Jump to content
Alain2131

Float/Int attribute of arbitrary size in VEX

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×