tenegger Posted July 11, 2015 Share Posted July 11, 2015 Hi, I want to control an animation range by a color attribute. I want to use attribute transfer of color (black is default, red is the color transferred) so that when the points are black the animation is at frame 1, and when the points get to red the animation is at its endframe. I have tried some tutorials and got some copy stamped animation on some spheres (see attached file). As the point colors change to red it triggers the animation BUT this will only play through once and never get triggered again, even if the point color returns to red again. I cant figure out how to do this - and I would love the help of some more experienced folk please. thanks from chris sphere_anim_triggered_by_color.hipnc Quote Link to comment Share on other sites More sharing options...
mestela Posted July 12, 2015 Share Posted July 12, 2015 (edited) I attached a (hopefully) simpler example. I find hscript expressions confusing and odd, chops moreso (powerful yes, but unintuitive). Whenever possible I try and do things in vex/vops, makes more sense to my feeble brain. (edit: tidy up nodes that weren't needed, other things) stamp_time_v04.hipnc Edited July 12, 2015 by mestela Quote Link to comment Share on other sites More sharing options...
tenegger Posted July 12, 2015 Author Share Posted July 12, 2015 matt- thanks! this is great and thanks for adding the notations too. This is laid out most clearly and my feeble brain can just about understand it I have a couple of questions about the wrangle inside the solver- firstly, does "@frame += 1" mean add 1? why is there an equals sign after the plus sign? secondly, the "if (@Cd.r >1)" why is this asking if red channel is greater than 1? The note says it tests if there is any color - wouldn't this mean testing if Cd.r >0? I am very new to the syntax in here so please be gentle if you have to explain foundational concepts even if it seems very simple . Thanks again, I really appreciate the guidance, from chris Quote Link to comment Share on other sites More sharing options...
mestela Posted July 12, 2015 Share Posted July 12, 2015 Yep, 'x += 1' is shorthand for ' x = x + 1', its common to a lot of languages: https://en.wikipedia.org/wiki/Augmented_assignment And yes, that test should probably > 0. If you watch the colour values in the geometry spreadsheet, you'll see the red accumulates to higher than 1 anyway (as it keeps adding onto itself due to the solver sop), so at worst the animation triggers 1 frame behind where the box is. Quote Link to comment Share on other sites More sharing options...
tenegger Posted July 12, 2015 Author Share Posted July 12, 2015 great, thanks for clarifying all that. 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.