Jump to content

Float/Int attribute of arbitrary size in VEX


Alain2131

Recommended Posts

Hello !

I want to "write out" an array variable to discrete float/int attributes (in the format a[0], a[1], a[2], a[3], a[4], a[5], etc).
In the Geometry Info, it'd be reported as "a 6flt", as opposed to "a flt[]".

I was able to create such an attribute using attribcreate (just set the Size to whatever value).
And then, in VEX, the attribute is represented as an array (read using point()). I can change the content, but to write it out I had to use the setpointattrib() function.
The f[]@a syntax did nothing, both for reading the attribute, and writing it out.
I was able to get the size using the pointattribsize() function.
arbitrary_size_float_attribute.hipnc

Is there a way to create a float/int attribute of arbitrary size in VEX, like the attribcreate does ?

 

A few constraints :
The size is known beforehand.
I cannot use the attribcreate node.
I want to use the @ syntax for speed, but will settle with setpointattrib() if I can't.

A solution could be to write it as an array attribute, then extract that array into a float/int attribute of a fixed size. But I don't know how to do that.

Thanks !

Edited by Alain2131
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...