shadowst17 Posted December 14, 2016 Share Posted December 14, 2016 Hello, I want to create an attribute that over time decreases on each point depending on when they entered the event. Pretty much an age attribute. I can't seem to figure out how to get it to work as you can't seem to reference time within an Attribute VOP and any tutorials that have something similar utilise temperature or particle age which only work if using those types of FX. Any help with this would be great as feel it can't be too difficult and would be incredibly useful in a number of my projects. Quote Link to comment Share on other sites More sharing options...
Atom Posted December 14, 2016 Share Posted December 14, 2016 (edited) I have not used it yet but you may want to check out AttributeFade. Pull up the help card. I think it was designed for tasks such as fading attributes over time. Edited December 14, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 14, 2016 Share Posted December 14, 2016 (edited) You can use attribute Wrangle or do it in attribute Vop check you spreadsheet and see how the pscale value goes down. You can decrease any attribute this way and create any kind of event as well. f@pscale = 1; if (@Frame >= 2) { @pscale -= .01 * @Frame; } Edited December 14, 2016 by Sepu Quote Link to comment Share on other sites More sharing options...
haggi Posted December 14, 2016 Share Posted December 14, 2016 Or you can use a fit. I love this function: float result = fit(@Frame, 100, 200, 1, 0); This way you can set exactly the duration and the range. 1 Quote Link to comment Share on other sites More sharing options...
shadowst17 Posted December 14, 2016 Author Share Posted December 14, 2016 (edited) The two VEX wrangle methods decrease over time which is great. How can I go about beginning that decrease on each point individually when they reach a certain value? Sepu's method seems to do this if I add a CHOP with lag node but eventually they all catch up and crease the value on all points at the same value. Edited December 14, 2016 by shadowst17 Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 14, 2016 Share Posted December 14, 2016 I do not have Houdini in front of me but you could multiply @Time by @ptnum something like this float myTime = @Time * chf('speed'); @pscale -= myTime * @ptnum; then you could remove points that are 0 or less, use the removepoint vex function. Quote Link to comment Share on other sites More sharing options...
shawn_kearney Posted December 14, 2016 Share Posted December 14, 2016 pardon my ignorance, but what is 'minus equal'? Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 14, 2016 Share Posted December 14, 2016 (edited) its the same as saying @attr = @attr - other variable or attribute @attr -= or += is just a shorthand op. Edited December 14, 2016 by Sepu Quote Link to comment Share on other sites More sharing options...
fencer Posted December 14, 2016 Share Posted December 14, 2016 You mean like that? chahge_over_time.hip Quote Link to comment Share on other sites More sharing options...
shawn_kearney Posted December 14, 2016 Share Posted December 14, 2016 so then: @P.y += 10 is the same as saying @P.y = @P.y + 10 Quote Link to comment Share on other sites More sharing options...
shawn_kearney Posted December 14, 2016 Share Posted December 14, 2016 (edited) bear in mind that multiplying time by 0...1 will be a non-linear asymptote (which can be problematic if you need a zero value). I think that @haggi fit() solution is more predictable. Edited December 14, 2016 by shawn_kearney Quote Link to comment Share on other sites More sharing options...
shadowst17 Posted December 14, 2016 Author Share Posted December 14, 2016 18 minutes ago, fencer said: You mean like that? chahge_over_time.hip This method works really well! The value seems to taper off very quickly though over time, how would I go about making it so it can be a linear transition from 0-1? Haven't really used VEX much. Quote Link to comment Share on other sites More sharing options...
Sepu Posted December 14, 2016 Share Posted December 14, 2016 26 minutes ago, shawn_kearney said: so then: @P.y += 10 is the same as saying @P.y = @P.y + 10 Yes is the same . Quote Link to comment Share on other sites More sharing options...
fencer Posted December 14, 2016 Share Posted December 14, 2016 (edited) 2 hours ago, shadowst17 said: This method works really well! The value seems to taper off very quickly though over time, how would I go about making it so it can be a linear transition from 0-1? Haven't really used VEX much. if(@P.y <0) f@ctime = point(1, "ctime", @ptnum) + 0.1; 0.1 value is increasing value, you can change it on for example 0.0416 (1/24 fps), means that value will change from 0 to 1 in 1 sec Edited December 14, 2016 by fencer Quote Link to comment Share on other sites More sharing options...
moneitor Posted December 19, 2016 Share Posted December 19, 2016 Hi, I create one using a sop solver, maybe is usefull, not as elegant as the ones already showed tho, inside the solver there is a ramp that allow you either to make them shrink or grow throw time, also you can control the duration of the Fading modifying the Fade attribute, its just a quick idea, maybe not the most optimized way as you need a solver. testScaleFade.hip 1 Quote Link to comment Share on other sites More sharing options...
anto187 Posted December 19, 2016 Share Posted December 19, 2016 10 minutes ago, moneitor said: Hi, I create one using a sop solver, maybe is usefull, not as elegant as the ones already showed tho, inside the solver there is a ramp that allow you either to make them shrink or grow throw time, also you can control the duration of the Fading modifying the Fade attribute, its just a quick idea, maybe not the most optimized way as you need a solver. testScaleFade.hip its really rare, i was developed like this and just finished 5 minute before you upload, and you have done similiar with my approach, and more advance than mine because has a ramp on the solver, thanks moneitor..its really help me alot. Quote Link to comment Share on other sites More sharing options...
anto187 Posted December 19, 2016 Share Posted December 19, 2016 14 minutes ago, moneitor said: Hi, I create one using a sop solver, maybe is usefull, not as elegant as the ones already showed tho, inside the solver there is a ramp that allow you either to make them shrink or grow throw time, also you can control the duration of the Fading modifying the Fade attribute, its just a quick idea, maybe not the most optimized way as you need a solver. testScaleFade.hip and how about a random speed time, where should i put multiplication of random id of point to do speed random time? Quote Link to comment Share on other sites More sharing options...
moneitor Posted December 20, 2016 Share Posted December 20, 2016 Hi man, I just added a bit of words to the attribwrangle in order to add some random variation, the slider variation will give you some random values between -variation to +variation. testScaleFade.hip 1 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.