Jump to content

Creating an attribute that slowly decreases per frame?


Recommended Posts

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.

Link to comment
Share on other sites

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 by Sepu
Link to comment
Share on other sites

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 by shadowst17
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by fencer
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...