rdg Posted May 30, 2007 Share Posted May 30, 2007 Hi, I try to redo some of my recent 3dsmax discoveries in houdini. Yes, I have to admit I still have a relapse every now and then. This time is is about: additive animation I know I can set a variable/spare channel to hold $speed and set the x transform of a object: $F * $speed This works well, as long as the the object is moving all the time. but what if there is boolean switch like: $moving $F * $speed should only be added to the current position if $moving is true. How would one do this the houdini way? I tried 'set/setenv' in a custom function and probably missed the right syntax as it just threw an error. Georg Quote Link to comment Share on other sites More sharing options...
digitallysane Posted May 30, 2007 Share Posted May 30, 2007 CHOPs maybe? Something like the Logic CHOP might help. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 30, 2007 Share Posted May 30, 2007 How about using the warp chop? (using index method I find easiest) or just replace $F with a linear channel that is either increasing or held? Quote Link to comment Share on other sites More sharing options...
antoinedurr Posted May 31, 2007 Share Posted May 31, 2007 If it's a one-time stop, then you could do something like min($F,40)*$speed, which would stop your animation at frame 40. If the scenario is more complicated, i.e. multiple stops and starts, then I'd figure out how to create a square wave where it's 0 when there's no motion and 1 when there is, and slurp it into an area CHOP. -- Antoine Quote Link to comment Share on other sites More sharing options...
rdg Posted May 31, 2007 Author Share Posted May 31, 2007 lurp it into an area CHOP. Thanks Antoine, the area CHOP was my last thought last evening and my first thought this morning. It is good to know I haven't been wrong - but it is an disturbing situation, nevertheless. As the area CHOP outputs the integrals of a given function and way is a function/derivative of speed - this is the way to go. Georg Quote Link to comment Share on other sites More sharing options...
rdg Posted June 1, 2007 Author Share Posted June 1, 2007 The areaSOP approach worked very well for my first experiment: a rotor that is controlled by a on/off switch and a RPM-parameter. But on ran aground on my next experiment: I have an animated cube: it just travels from -3 to +3 in tx. How do I calculate the way traveled? If I just use the area for tx - this isn't the way traveled. I tried a spare parameter with ch("./tx") - chf("./tx", $F -1) but this is neither speed nor acceleration? I want to add this "distance" every frame to a channel. chf(".", $F - 1) + ch("./tx") - chf("./tx", $F -1) didn't work either. Maybe you can shed some light on this issue Kind regards, Georg Quote Link to comment Share on other sites More sharing options...
rdg Posted June 4, 2007 Author Share Posted June 4, 2007 I had another idea: a spare channel with this expression: { float sum = 0; for (i = 0; i<$F; i++){ sum += chf("./tx", i) - chf("./tx", i - 1); } return sum; } This does what I was looking for ... I guess. Georg Quote Link to comment Share on other sites More sharing options...
rdg Posted June 5, 2007 Author Share Posted June 5, 2007 to keep this complete: { float sum = 0; for (i = 0; i<$F; i++){ sum += length(chf("./tx", i) - chf("./tx", i - 1), chf("./ty", i) - chf("./ty", i - 1), chf("./tz", i) - chf("./tz", i - 1)); } return sum; } this is the *real* way traveled - not just in x. 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.