TeaLeaf Posted May 4, 2013 Share Posted May 4, 2013 Hi Guys, If I have an attribute called chicken (for example) how do I decrement it by 1 each frame in VOPs. I thought I could just attribute import it, subtract constant, and use a parameter/bind to export it again. I'm sure I've done it before but I can't remember how! Cheers Quote Link to comment Share on other sites More sharing options...
jujoje Posted May 4, 2013 Share Posted May 4, 2013 Hi, There are two ways I can think of to do this. The first is pretty much what you're doing: simply import the attribute and subtract the current frame from it. Alternatively you could use the solver SOP. See the attached hip files. The reason simply subtracting a constant doesn't work is that SOPs are not time aware. Each time you increment a frame the network will cook again. As a result on each frame it will create the default chicken value and subtract the same constant from it, and thus the value won't change. Thus you need to use the frame variable ($F) somewhere, or the solver SOP. Anyways, hope that helps, Jules subtractChickenSOP.hipnc subtractChickenVopSop.hipnc Quote Link to comment Share on other sites More sharing options...
TeaLeaf Posted May 5, 2013 Author Share Posted May 5, 2013 Awesome, thank you for both of those and the explanation! Cheers 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.