VEX code fails in pop drag force - whitewater masterclass

   3177   3   0
User Avatar
Member
398 posts
Joined: March 2009
Offline
Hi

I'm still fairly new to Houdini, so apologies for the silly question.

Following white water masterclass available under tutorials https://www.sidefx.com/tutorials/houdini-17-masterclass-whitewater-system/. [www.sidefx.com]

I'm using Houdini 18.416. Specifically around 1h08m, Omar adds one line of VEX code to popdrag and popforce nodes respectively that feed into white water solver.

This line of code in popdrag: @airresist *= fit(@age, 0, ch(“max_age”), 0, 1);
And this line of code in popforce: @force *= fit (@age, 0, ch(“max_age”), 0, 1);

This however causes my whole simulation to fail with the following error:
“Read-only expression on left side of assignment”.

Also when I look at particles in the solver geometry the geometry spreadsheet doesn't show @airresist and @force attributes as available on particles…

Any help appreciated.

Attachments:
Screenshot from 2020-04-14 00-47-21.png (211.9 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
LukeP
This line of code in popdrag: @airresist *= fit(@age, 0, ch(“max_age”), 0, 1);
And this line of code in popforce: @force *= fit (@age, 0, ch(“max_age”), 0, 1);

those should probably be:
airresist *= fit(@age, 0, ch(max_age), 0, 1);
force *= fit (@age, 0, ch(max_age), 0, 1);
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
398 posts
Joined: March 2009
Offline
Thank you! That fixed it! Surprised that the person doing masterclass had @ in front of them and that it worked for them lol.

Regards,
Luke
User Avatar
Member
73 posts
Joined: March 2020
Offline
It must have been a bug in Houdini that had since been fixed. https://www.sidefx.com/docs/houdini/dopparticles/vexpressions.html [www.sidefx.com] clarifies the following:

However, whereas wranglers affect geometry by directly setting attribute values, particle nodes cannot change attribute values (usually below). Instead, they work by reading parameter and attribute values and then modifying the parameters values accordingly. This lets you change the values of the node’s parameters for each particle.

airresist and force are parameter values and can be written to, whereas @airresist and @force are read-only attributes.
  • Quick Links