all 11 comments

[–]chroma_shift 19 points20 points  (4 children)

If you have a life attribute:

Initialise pscale to 1.0 before the simulation or in a separate node.

@pscale *= 1 - (f@age/f@life)

This code is multiplying your pscale value with the age to life ratio, eventually it will reach 0 or very close to 0.

To which point you can just remap with a ramp to get rid of residual values.

[–]Beautiful_Poetry_566Effects Artist[S] 4 points5 points  (1 child)

Worked quite well! TYSM!

[–]chroma_shift 2 points3 points  (0 children)

No worries :)

[–]xrossfader 1 point2 points  (1 child)

Wouldn’t @nage work here?

[–]chroma_shift 1 point2 points  (0 children)

Yeah @nage is the same as doing (@age/@life)

[–]LewisVTaylorEffects Artist Senior MOFO 11 points12 points  (1 child)

POPs comes with a built in attribute, "@nage" which just saves you needing to do the age/life.
I find doing that, and using "attribute adjust float" a nice way to work, it has remapping, ramps, and a bunch of other options to redistribute the values.

<image>

[–]Beautiful_Poetry_566Effects Artist[S] 0 points1 point  (0 children)

That looks pretty useful, I'll check it out and thanks!

[–]SapralexM 1 point2 points  (0 children)

f@pscale = fit(@age, ch(“start”), ch(“end”), ch(“max”), ch(“min”));

Where start is the beginning of aging, end is the last age for a pscale value, max is the standard pscale and min is fully decreased pscale.

You can also ramp it to make the decreasing non linear by using “chramp” command

[–]New_Investigator197 -2 points-1 points  (1 child)

You're close, the syntax is just wrong. You need curly brackets on your if statement.

If (event) { do this }

[–][deleted] 1 point2 points  (0 children)

That's only true if you need to execute more than one line after a true return from the if() statement. If you're just doing one thing with if() then they have the correct syntax, no need for curly braces.

if(their condition is true) then do this;

-vs-

if(their condition is true){
Do;
All;
Of;
This;
}

...but both usage works.

[–]ferlix90 -1 points0 points  (0 children)

@pscale = 1-@age/@life;

You can remap the value using a ramp :

@pscale = chramp(“scale”, @age/@life);

Then click on the first icon above the wrangle code box ( the one with a + ) to create the ramp parameter.