I'm playing about with vex at the moment.
I have a question re copy to points SOP and VEX trying to target and manipulate individual copies.
Lets say the pscale of copy ID3 is 2.5 to begin with..
// SET THE SCALE OF OBJECT ID3 to 10
setattrib(0, ‘point’, ‘pscale’, 3, 0, 10, ‘set’);
The geometry spreadsheet now states pscale = “10” and the geo in the scene view is indeed 10 units.
float myscale = attrib(0, ‘point’, ‘pscale’, 3);
printf('%f', myscale);
But this print function still shows “2.5"
What am I doing wrong?
thanks
Vex setattrib() not updating.. kind of...
1300 1 1- A_Ghost
- Member
- 4 posts
- Joined: 7月 2014
- Offline
- N-G
- Member
- 209 posts
- Joined: 3月 2018
- Offline
It's true!
When you try to read attribute with attrib function it reads attribute from first input which pscale is still 2.5.
If you want to access the latest version of changes in the same node you can do this for instance:
Also this code runs faster than calling attrib and setattrib which are run-time functions…
When you try to read attribute with attrib function it reads attribute from first input which pscale is still 2.5.
If you want to access the latest version of changes in the same node you can do this for instance:
if (@ptnum == 3) { f@pscale = 10; printf("%f", f@pscale); }
-
- Quick Links