I Just cannot get this syntax right.
In either pointWrangle SOP or attributeWrangleSOP
To scale a float attribute (pscale) per point per time step.
@pscale == .9 ;
or
$pscale == .9 ;
No good
What am I getting wrong?
VEX code for scaling pscale per point per time step
1953 6 0- Dave_ah
- Member
- 436 posts
- Joined: July 2005
- Offline
- Dave_ah
- Member
- 436 posts
- Joined: July 2005
- Offline
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
Dave_ahso why wouldn't you try the same? (instead of trying == which is comparison of equality and not an assignment)
For Maya users equivalent MEL code would be
pscale *= .9 ;
@pscale *= 0.9;
assuming you run it in DOP environment, like Solver SOP or directly DOP net
Edited by tamte - July 3, 2023 01:39:17
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Dave_ah
- Member
- 436 posts
- Joined: July 2005
- Offline
tamtepscale *= .9 ;Dave_ahso why wouldn't you try the same? (instead of trying == which is comparison of equality and not an assignment)
For Maya users equivalent MEL code would be
pscale *= .9 ;@pscale *= 0.9;
assuming you run it in DOP environment, like Solver SOP or directly DOP net
Does not work in SOP level pointWrangle and attributeWrangle SOPs. Houdini generates syntax error and bypasses the SOP node.
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
Dave_ahyou forgot @ to bind to pscale attributetamtepscale *= .9 ;Dave_ahso why wouldn't you try the same? (instead of trying == which is comparison of equality and not an assignment)
For Maya users equivalent MEL code would be
pscale *= .9 ;@pscale *= 0.9;
assuming you run it in DOP environment, like Solver SOP or directly DOP net
Does not work in SOP level pointWrangle and attributeWrangle SOPs. Houdini generates syntax error and bypasses the SOP node.
here is an example in plain SOPs where this will be applied once to incoming value
and also inside of Solver SOP where it will be applied every timestep
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Dave_ah
- Member
- 436 posts
- Joined: July 2005
- Offline
tamteDave_ahyou forgot @ to bind to pscale attributetamtepscale *= .9 ;Dave_ahso why wouldn't you try the same? (instead of trying == which is comparison of equality and not an assignment)
For Maya users equivalent MEL code would be
pscale *= .9 ;@pscale *= 0.9;
assuming you run it in DOP environment, like Solver SOP or directly DOP net
Does not work in SOP level pointWrangle and attributeWrangle SOPs. Houdini generates syntax error and bypasses the SOP node.
here is an example in plain SOPs where this will be applied once to incoming value
and also inside of Solver SOP where it will be applied every timestep
What is the difference between $pscale and @pscale in VEX? @pscale reads like Py.
Overall how does Houdini treat, in expression, @attribute vs. $attribute .
- BabaJ
- Member
- 2129 posts
- Joined: Sept. 2015
- Offline
Dave_ah
What is the difference between $pscale and @pscale in VEX? @pscale reads like Py.
Overall how does Houdini treat, in expression, @attribute vs. $attribute .
The @ symbol is typically used in a vex context to refer to the name that follows as an attribute.
The $ symbol is typically used in a context in which Hscript is being used.
That's the short and simple explanation although there is a bit more to it in certain cases.
For example, sometimes in a vex context you can use an Hscript expression(where $name is used) if enclosed within back ticks.
if(`$F > 5`) @pscale = 2; // Works in a wrangle code window but is less efficient than the next purely vex line. if(@Frame > 5) @pscale = 2;
-
- Quick Links