sim Posted January 15, 2014 Share Posted January 15, 2014 Hi all, I'm trying to use Python to solve an animation problem I have. I must say I'm very new to Python in Houdini. And I can't even be sure if it's Python that I want to use to solve this problem. I have a curve created by joining together a bunch of nulls. I animated the shape of the curve by keyframing the nulls positions. Though however I change the curve I need to keep it at a constant length. Two of the nulls and part of the curve is off-camera and they're free to move any where. I figured I could use a Python expression in conjunction with measure sop to iterativley move the two hidden nulls to maintain a constant length. Though I've had no luck so far. I'm not even having much luck getting Python to something simple like making one box follow the keyframed position of another box over time. I can set the position when I press 'Apply' for the code in my Expression Editor. However it doesn't update when I play the timeline. I've looked for Python examples for this kind of stuff. I've found lots on tool creation and creating and modifying nodes, but nothing yet on animation. Can anyone point me to an example that could help me? Or is Python even the best way to solve this? Should I perhaps be trying to do something in chops? 'cheers, Simeon Quote Link to comment Share on other sites More sharing options...
animknight Posted January 16, 2014 Share Posted January 16, 2014 Can you post an example file ? Quote Link to comment Share on other sites More sharing options...
ranxerox Posted February 3, 2014 Share Posted February 3, 2014 if you turn on "even length segments" on the polyspline sop you can effectively set a maximum length for your curve .. does that do what you want ? -G Hi all, I'm trying to use Python to solve an animation problem I have. I must say I'm very new to Python in Houdini. And I can't even be sure if it's Python that I want to use to solve this problem. I have a curve created by joining together a bunch of nulls. I animated the shape of the curve by keyframing the nulls positions. Though however I change the curve I need to keep it at a constant length. Two of the nulls and part of the curve is off-camera and they're free to move any where. I figured I could use a Python expression in conjunction with measure sop to iterativley move the two hidden nulls to maintain a constant length. Though I've had no luck so far. I'm not even having much luck getting Python to something simple like making one box follow the keyframed position of another box over time. I can set the position when I press 'Apply' for the code in my Expression Editor. However it doesn't update when I play the timeline. I've looked for Python examples for this kind of stuff. I've found lots on tool creation and creating and modifying nodes, but nothing yet on animation. Can anyone point me to an example that could help me? Or is Python even the best way to solve this? Should I perhaps be trying to do something in chops? 'cheers, Simeon 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.