6ril Posted October 27, 2016 Share Posted October 27, 2016 Hello, I'm instancing a geo on a set of particles, but I need this geo to have an animation under certain conditions. I've search for ways to instance (or copy) animated geo, but all I found is how to offset an animation randomly. What I need (see attached .hip) is to either start an animation when a particle reach its destination (there's a popseek) or even better, to control an attribute that drives the animation (that would be the "Up" slider I made on the "geo2instance" node, at the scene level) I'm a little confused over a few points: - Should I instance (as in the attached .hip) or should I use a copySOP ? - The animation I need is really simple, it's just the size in Yaxis of a box. Do I need to animate it, and then control when to start the animation ? Or can I drive the parameter later on, after copying/instancing over the particles, using condition like if velocity is lower then this, or if the distance between that particle and it's goal is lower then this ... Just to be clear, I'm trying to have this : when the particle reach it's goal, then the central box should rise up. thanks guys ! OD-F_instances-animCTRL.hipnc Quote Link to comment Share on other sites More sharing options...
6ril Posted October 31, 2016 Author Share Posted October 31, 2016 anybody ? Quote Link to comment Share on other sites More sharing options...
TheDude Posted October 31, 2016 Share Posted October 31, 2016 Hey man, houdini is down at work atm so can't check out your hip, but basically if you have a trigger set up in your pops of when you want animation to start (I am imagining if it hits a surface, or something like that, then you'd make a new attribute that starts at 0 that adds 1 per frame), you can use this for what frame of the animation it is. Using the instancefile attribute (think that is the one) you explicitly tell what file to instance. So some sudo code would be string Frame = itoa(i@FrameCountingFromTrigger); //Frame is the trigger you add a value to every frame from whatever the condition is you want to start counting from s@instancfile = "/harddrive/project/instancefil1_" + Frame + ".bgeo.sc"; Quote Link to comment Share on other sites More sharing options...
galagast Posted November 1, 2016 Share Posted November 1, 2016 Hi, I'm also curious if there is a way to control parameters per instance. For now, in the attached file, I used copy stamping. I also just learned that you can stamp even from outside the network! (I stamped the spare parameter "up" that you created at geometry level) Houdini Indie 15.5.607 OD-F_instances-animCTRL_v2.hipnc 2 Quote Link to comment Share on other sites More sharing options...
6ril Posted November 2, 2016 Author Share Posted November 2, 2016 Thanks for your replies @Jamie, thanks I'll try to implement that way. @Jeff Lim, thanks, interesting how you use @timer. Quote Link to comment Share on other sites More sharing options...
rich_lord Posted November 2, 2016 Share Posted November 2, 2016 Theres also the chops method using the trigger chop. I made a post about this over here. Its very controllable, but difficult to understand and implement Quote Link to comment Share on other sites More sharing options...
galagast Posted November 3, 2016 Share Posted November 3, 2016 @rich_lord: Interesting, it got me curious about a CHOPs approach.. Although the sample file on the thread that you linked to did not use a Trigger CHOP. Also, it animated the points, not the actual animated instance. Learned quite a bit from your setup, thanks! I've attached a file inspired by rich_lord's suggestion. It's a bit of a hack.. this sample does not use a Copy SOP, but instead modifies/cheats the animation offset by modifying the primitive itself >_< (In this instance) I suppose this technique is purely scene specific hehe. Houdini 15.5.607 OD-F_instances-animCTRL_v3.hipnc 1 Quote Link to comment Share on other sites More sharing options...
6ril Posted November 3, 2016 Author Share Posted November 3, 2016 Thanks Richard! And thank you Jeff, for exploring that way with the initial .hip ! Made it easier for me to follow. Quote Link to comment Share on other sites More sharing options...
6ril Posted November 3, 2016 Author Share Posted November 3, 2016 While I'm at it, I've got trouble getting my particles to a full stop : / I'd want them to really stop as soon as they reach their respective goal point, instead of the current constant swaying. I've tried to bring the Velocity and Force to zero if Velocity < 0.1 but it's not a good idea, so I guess I should calculate the distance between a particle and its goal point, and use it as a threshold (instead of a low velocity threshold). There's a arrival feature, with a breaking distance and force, but it's never stopping the particles from the constant swaying. How would you do it? Quote Link to comment Share on other sites More sharing options...
Atom Posted November 3, 2016 Share Posted November 3, 2016 So what is timer? And why does it work? When I examine the v2 HIP file I notice you are creating a local variable called timer inside the Copy node and you enable stamping but you never use the variable in a stamp expression. If I rename the local variable timer to timer9 the animation of the rising tower never occurs. I search through the help cards and can't find any reference to timer. I don't understand what makes it go... Quote Link to comment Share on other sites More sharing options...
galagast Posted November 4, 2016 Share Posted November 4, 2016 (edited) Hey Atom, the timer variable on the Copy SOP is being used outside the particles object network. You will find the stamp function is up at the geo2instance object's "up" spare parameter. That is the specific bit that I mentioned on the post where I attached the v2 hip file, something new I also just learned while tackling this "timer" is just a variable name that I chose, it can be anything. Edited November 4, 2016 by galagast Quote Link to comment Share on other sites More sharing options...
6ril Posted November 4, 2016 Author Share Posted November 4, 2016 I managed to stop my particle with this : if distance to targetP is less than 0.01 -> @P == @targetP (where targetP is the position of the goal points) It's not perfect (there's a little jump to the final position), so if someone knows a better way, it would help Quote Link to comment Share on other sites More sharing options...
Atom Posted November 4, 2016 Share Posted November 4, 2016 (edited) Ah, thanks for explaining that Jeff. I guess the real test would be with some kind of animated geo sequence. @6ril: You may want to try just reducing velocity instead of setting position. I tried this code in a PopWrangle and it seems to work ok. string scatter_path = "op:/obj/particles/GOAL_points"; vector target_goalP = point(scatter_path,"P",@ptnum); if (length(target_goalP-@P) <0.001) { v@v = 0; } Edited November 4, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
6ril Posted November 4, 2016 Author Share Posted November 4, 2016 yep thanks atom, I did exactly that, earlier, but kept searching because they don't stop at goal position exactly. 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.