Invalid subscript for type float.r Error!

   3628   6   0
User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Hello everyone.
I've created a COP2 Network node and import my image as volume slice.
Attribute spreadsheet shows me a name attribute with 3 separate primitives which contain C.r, C.g and C.b.
So I append a volume wrangle node and try to manipulate for example C.r with this:
@C.r = 0;
But VEX shows me Invalid subscript for type float.r error!
Any suggestion?
Thanks in advance.
User Avatar
Staff
6245 posts
Joined: July 2005
Offline
C is not a vector. Only some names are automatically considered vectors (P, Cd, etc), the rest are treated as float unless specified otherwise.

v@C.r = 0;
@C.g = 1;

or

vector @C;
@C.r = 0;
@C.g = 1;

The type only has to be specified once, the other uses will inherit it.

You may need to rename the volume to C.x, C.y, C.z for the vector binding to work, I can't remember off hand the rules.
User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Thanks a lot Jeff.
I do what you said. Error is gone but color still remains the same!
I already changed visualization of @C with volume visualize node but can't do this with volume wrangle!
Also I didn't find help card for COP2 Network in both online and offline documentation.

Attachments:
Nothing has changed!.png (499.9 KB)

User Avatar
Staff
6245 posts
Joined: July 2005
Offline
jlait
You may need to rename the volume to C.x, C.y, C.z for the vector binding to work, I can't remember off hand the rules.

You can use the Name sop with
*.[rgb]
to
*.[xyz]
Edited by jlait - June 9, 2017 14:32:21

Attachments:
renamevolume.hip (66.0 KB)

User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Thanks dear Jeff for your great responsiveness.
Is this normal?

Attachments:
Problem Persists.png (294.5 KB)

User Avatar
Staff
6245 posts
Joined: July 2005
Offline
I got too fancy with my rename pattern, apparently you need 3 patterns of
*.r to *.x
etc.

Attachments:
renamevolume_fix.hip (66.2 KB)

User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
That's it.
Really thanks dear Jeff.
  • Quick Links