Hello,
Does anyone know if it's possible to create attributes ‘dynamicaly’ in vex?
Just for simplicities sake, say in a point wrangle create dynamic number of attributes that are each an array of values.
Where the user sets the number of arrays created with either 1,2,3 or 4 and so on etc. with a parameter slider.
It's not important what the dynamicly created arrays are named ie., I don't need this to be ‘displayed’ or available for the user end.
Just so I can access them distinctly according to how many were created.
According to documents vex currently does not support multi-dimensional arrays, which if they did I could easily implement what I want by using an array of arrays.
I'm putting this question out there before I make an RFE, in case there is a way to do the equivalent of a multi-dimensional array.
Thanks for any help.
Dynamic Attribute 'declaration' in vex
3568 5 1- BabaJ
- Member
- 2042 posts
- Joined: Sept. 2015
- Offline
- malbrecht
- Member
- 806 posts
- Joined: Oct. 2016
- Offline
Maybe this video is of some help?
Marc
Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
- BabaJ
- Member
- 2042 posts
- Joined: Sept. 2015
- Offline
- BabaJ
- Member
- 2042 posts
- Joined: Sept. 2015
- Offline
- tamte
- Member
- 8591 posts
- Joined: July 2007
- Offline
very convoluted question, I guess it depends on the final use
you can always create points with array attribute
create as many points you want addpoint() => first dimension
each can have different array as an attrib setpointattrib() => second dimension
and of course you can as well create many attribs instead of points setpointattrib() (or addpointattrib() prior to H16), depending on needs
you can always create points with array attribute
create as many points you want addpoint() => first dimension
each can have different array as an attrib setpointattrib() => second dimension
and of course you can as well create many attribs instead of points setpointattrib() (or addpointattrib() prior to H16), depending on needs
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jlait
- Staff
- 6220 posts
- Joined: July 2005
- Offline
If you want ragged array-of-arrays, and you just need to store them in attributes and retrieve them, you can use a pair of array attributes. One stores the lengths of your sub-arrays, the other raw data.
We do something similar to export normal arrays to OpenCL as they are effectively array-of-arrays from the viewpoint of an OpenCL kernel.
Rather than length, you can also store the absolute start allowing random access. Length can then be specified separately, or implied as a difference between starts.
This is all basically re-inventing memory management using a normal float array as just an arbitrary memory container. So all squarely falls under “workarounds”; which is why there already are RFEs for proper arrays-of-arrays in VEX.
float @arraydata[]; int @arraylen[]; int curstart = 0; foreach (int len; arraylen) { float a[] = @arraydata[curstart:curstart+len]; // Work on a[] curstart += len; }
We do something similar to export normal arrays to OpenCL as they are effectively array-of-arrays from the viewpoint of an OpenCL kernel.
Rather than length, you can also store the absolute start allowing random access. Length can then be specified separately, or implied as a difference between starts.
This is all basically re-inventing memory management using a normal float array as just an arbitrary memory container. So all squarely falls under “workarounds”; which is why there already are RFEs for proper arrays-of-arrays in VEX.
-
- Quick Links