AmyEden Posted May 11, 2021 Share Posted May 11, 2021 Hey, So i'm looking for a way to animate and freeze at some frame the global seed of the scattering node. I'm trying to replicate the polyjuice effect in Harry potter 2 and i'm having a bit of struggle with the scattering. The effect is some sort of bubbles that grow and reduce on a morphing head into an other. I managed the bubbles effect and the morphing just fine but the bubbles are always on the same place. They are controled by a scattering and color and i would like to animate it in that way : - when the color is black there are no bubbles and when it's white they grow. I would like the global seed of the scattering to change when it's black and freeze and take the last value when it's white. for exemple at from frame 0 to 10 it's white with the scattering seed set a 1, then from frame 11 to 15 it's back and the scattering seed changes to 2 then from frame 16 to 26 it's white again with the scattering froze to 2 and on and on in that way. Does anybody has a way to make that happen ? I joint the file with the pig head so that anyone can open it without any additionnal file. Thank you so much for your help PS: i'm very new to houdini. head_bubbles_ocforum.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted May 12, 2021 Share Posted May 12, 2021 You can brute force this by using code to drive the scatter seed. It's crude, but it works. if(@Frame>=1 && @Frame<48){ f@seed = 0.1;} if(@Frame>=48 && @Frame<96){ f@seed = 0.2;} if(@Frame>=96 && @Frame<144){ f@seed = 0.3;} if(@Frame>=144 && @Frame<192){ f@seed = 0.4;} if(@Frame>=192 && @Frame<240){ f@seed = 0.5;} So every 48 frames a new seed is generated as a Detail attribute. Drive the global seed of the scatter by fetching the value using the hScript detail function. Quote Link to comment Share on other sites More sharing options...
AmyEden Posted May 12, 2021 Author Share Posted May 12, 2021 Thank you so so much it works perfectly however I can't make the detail fonction work. I read the houdini documentation and they say that the first parameter is the geo path but that doesn't seem to work. And neither does 0 like you showed on your screen caption. Could you explain what I need to do ? Thank you so much Quote Link to comment Share on other sites More sharing options...
Ultraman Posted May 12, 2021 Share Posted May 12, 2021 On 5/11/2021 at 9:44 PM, AmyEden said: Hey, So i'm looking for a way to animate and freeze at some frame the global seed of the scattering node. I'm trying to replicate the polyjuice effect in Harry potter 2 and i'm having a bit of struggle with the scattering. The effect is some sort of bubbles that grow and reduce on a morphing head into an other. I managed the bubbles effect and the morphing just fine but the bubbles are always on the same place. They are controled by a scattering and color and i would like to animate it in that way : - when the color is black there are no bubbles and when it's white they grow. I would like the global seed of the scattering to change when it's black and freeze and take the last value when it's white. for exemple at from frame 0 to 10 it's white with the scattering seed set a 1, then from frame 11 to 15 it's back and the scattering seed changes to 2 then from frame 16 to 26 it's white again with the scattering froze to 2 and on and on in that way. Does anybody has a way to make that happen ? I joint the file with the pig head so that anyone can open it without any additionnal file. Thank you so much for your help PS: i'm very new to houdini. head_bubbles_ocforum.hipnc round($F/10) // what about this one in the Seed? Quote Link to comment Share on other sites More sharing options...
Atom Posted May 12, 2021 Share Posted May 12, 2021 Zero does work as you can see no error in my screenshot. Make sure your attribute wrangle is running in detail mode. @UltramanThat's a much simpler solution, but what if I want to change every 48 frames? The round will produce a change at frame 24 as well. Quote Link to comment Share on other sites More sharing options...
Ultraman Posted May 12, 2021 Share Posted May 12, 2021 10 minutes ago, Atom said: Zero does work as you can see no error in my screenshot. Make sure your attribute wrangle is running in detail mode. @UltramanThat's a much simpler solution, but what if I want to change every 48 frames? The round will produce a change at frame 24 as well. @Atom // Right is simple and doesn't have any range like if statement // but for fixing issue ceil function can be work but in overall ur word is true .. Quote Link to comment Share on other sites More sharing options...
Atom Posted May 12, 2021 Share Posted May 12, 2021 (edited) This version references a CHOP wave in sample/hold mode. The scatter fetches this chopnet value for the seed. Here's a quick attempt at synchronizing the scatter change with the color fade. A lag channel is added to the CHOP network to generate a source supplied to the color node. You can adjust the period of the wave1 node to change the speed for both outputs. Use the phase to align the red waveform with the purple. ap_head_bubbles_odforum.hipnc Edited May 12, 2021 by Atom 2 Quote Link to comment Share on other sites More sharing options...
AmyEden Posted May 12, 2021 Author Share Posted May 12, 2021 Thank you so much for you both ! I tried with the function round but I can't really synchronized it with the sin. Changing to detail in the wranggle worked ! And i'm really happy with the results so I think I will go with that I will look at the chop version tomorrow although it seems a bit more complicated than the wranggle. I'll be sure to give it a go though and I will keep you updated ! Thank you so much anyway ! Quote Link to comment Share on other sites More sharing options...
Atom Posted May 13, 2021 Share Posted May 13, 2021 (edited) Here's another version where the scatter changes its seed per frame. Add a popnet to sample from that changing source. The popnet will add, age, and remove points. Base the pscale on the age and you can fade them in and out over particle life. ap_head_bubbles_odforum.hipnc Edited May 13, 2021 by Atom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.