Vinz9 Posted October 12, 2009 Share Posted October 12, 2009 Hi, Going back to Houdini after using Maya for sometime. In a maya expression, at each frame I can query the current position, rotation... and then do whatever I want with it. Or more simply put, I can write something like cube.translateX = cube.translateX + 1; (with a condition resetting tx on frame 1). Now in Houdini, writing something like ch("tx") + 1 in the translateX of an object crashes Houdini And in a VEX Sop, it seems I can't query the current position of the points, P and other attributes always return their initial value. What I'm trying to do in a vex sop is : do something with the points if a certain condition is true and store the current position, and when the condition becomes false use the last stored position. Do I need to go to chops or use the sop solver to do something like this ? I love chops, but having to cache attributes over the whole sequence is slow and memory intensive, and I've always found the sop solver a bit unstable and not easy to debug. Would a python sop help me there ? Another way I thought about it to write a script to write keyframes but it's not really interactive Thanks a lot Vincent Quote Link to comment Share on other sites More sharing options...
edward Posted October 12, 2009 Share Posted October 12, 2009 Houdini's expression language, unlike MEL, is functional rather than being imperative. What this means is that your expressions can only return values, never set values. Sometimes this is also called history-independent meaning that the expressions can be evaluated at any frame, without relying on previous calculations (or "history"). To do the equivalent of "cube.translateX = cube.translateX + 1", you probably just want "$F - 1 + <offset>" where <offset> is the starting value at frame 1. If you want to use history, then you have to go to some sort of operator context that maintains history across time like CHOPs, POPs, or DOPs. Quote Link to comment Share on other sites More sharing options...
Vinz9 Posted October 13, 2009 Author Share Posted October 13, 2009 Ok, thanks for the clear explanation 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.