@life / @Cd;
@life / random(@Cd);
Should I be making a point VOP or an AttributeCreate at SOP level ?
@life / @Cd;
@life / random(@Cd);
float life_as_percent = @age/@life; / Really just 0-1 not a percent. // Set color by age. v@Cd = set(life_as_percent,life_as_percent,life_as_percent); // Set color by life. v@Cd = set(@life,@life,@life); // Age only red channel. v@Cd = set(life_as_percent,@life,@life); // Age red, random green. v@Cd = set(life_as_percent,random(@ptnum),@life);
v@Cd = set(life_as_percent,life_as_percent,life_as_percent)
float life_as_percent = @age; v@Cd = set(life_as_percent,life_as_percent,life_as_percent);
float life_as_percent = @age; v@Cd = set(0.5,0.3,0.3);
@nage
@age/@life
jlim
Do you have a sample file we could look at? Your first code block is missing a semi-colon “;”
You can also use (normalized age):It is the same value you would get from@nage@age/@life
I attached a very simple sample scene.. you can also see a usage of a ramp parameter for finer control.
H15.5.607 Indie
float life_as_percent = @age; //@Cd = set(life_as_percent,0,0); @Cd / random(@age);
@Cd = random(@ptnum);
jlim
Upon dropping a POP velocity DOP, leaving the VEXpression empty, you can set the velocity (v) attribute for the particles directly. Overwriting any existing ones from up the chain.
So if you type in a value to the Velocity parameter like: 0, 1, 0 …particles will move up. But there's not much else you can do, like vary the speed for each particle.
That is where VEXpressions could come in. It will let you use VEX to manipulate the parameter values.
Keyword is PARAMETER values. Not ATTRIBUTE values.
In this case, it will allow you to vary or override the Velocity PARAMETER value (Not the velocity ATTRIBUTE - although after processing the VEX code, it will eventually write to the particle's velocity attribute).
I've attached a sample usage of VEXpressions in a POP Velocity. It reads in some custom attributes, and uses those to set the velocity parameter. You can also see here how you can set the color from within the VEXpression, although I don't fully recommend that method only due to the fact that it can be quite a lengthy function to type And the attribute in question (@Cd) should already exist for it to work.
Lastly, you can have a more detailed info regarding this topic by reading through it here:
https://www.sidefx.com/docs/houdini/dopparticles/vexpressions [sidefx.com]
I hope this helps
H15.5.607 Indie
Christopher RYes, as mentioned on the docs link from above, there is a drop-down menu on the side of a VEXpression, choose Pass Through to see the valid paramaters for the current POP DOP.
…is there a list of parameters I can use in POP Velocity ?
Christopher RWhat do you mean by "it must be binded? Are you referring to the Data Bindings tabs?
You have to bind the Attribute VOP then you can call the Attribute within the POP Velocity but it must be binded, correct ?
Christopher RNope. Parameters are what you see in the UI. When you hover over a parameter, it would show its name (in smallcase) and a description. That name is what you would use inside a VEXpression.
If I understand, parameters in your explanation would be using VOPS ?
Christopher RYes, it is exactly what I did on the last sample file I uploaded (H15_velocity_vexpression.hiplc [sidefx.com])
As an alternative could you use a Wrangler (AttributeWrangler /PointWrangler) at SOP level and write out what's in VOP in the Wrangler then use that in the VEX POPVelocity ?
Christopher R
You have to bind the Attribute VOP then you can call the Attribute within the POP Velocity but it must be binded, correct ?
What do you mean by "it must be binded? Are you referring to the Data Bindings tabs?
If you want to call Attributes within the POP Velocity.. the attribute should first exist.
As an alternative could you use a Wrangler (AttributeWrangler /PointWrangler) at SOP level and write out what's in VOP in the Wrangler then use that in the VEX POPVelocity ?
Yes, it is exactly what I did on the last sample file I uploaded (H15_velocity_vexpression.hiplc )
The attributes @myNoise and @myRamp were all created in SOPs level. Then POP Velocity was able to read those
Christopher RYes, you have to create the attribute, via Wrangles/VOPs/Attribute Create/etc…
I mean you have to create a attribute,…
Christopher RAn Attribute VOP cannot have a VOP Network inside it, unless you were referring to subnets?
…followed by a VOP network within the attribute VOP, correct ?
Christopher RYes, all of those can be written inside a single Wrangle node at SOP level. It really just depends on the workflow
I mean completely eliminating those Attribute VOPs and condensing everything from those Attribute VOPS into a wrangler node at SOP level ?