Creating attribute of n size with Wrangle

   2369   7   1
User Avatar
Member
639 posts
Joined: July 2005
Offline
Hi,
How does one create attribute of size n with Wrangle SOP?
For example,
Test[0] ... Test[10] for n=10
Thanks!
Edited by EigenAlex - Feb. 12, 2019 15:12:20
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Maybe you could add more info give example of the context?

Do you want a single detail attribute that could possibly be in the range of n (0-10);

A detail attribute array of n values?

A point/prim attribute?
Edited by BabaJ - Feb. 12, 2019 15:24:16
User Avatar
Member
639 posts
Joined: July 2005
Offline
Sorry, for example, if you use Attribute Create SOP to create an attribute (of any type), say, Test. You can then specify its size to be 10. So then you have attribute Test[0], Test[1], Test[3], and so onbeing listed.

I was wondering what is the equivalence with VEX expression in Wrangle SOP…
Edited by EigenAlex - Feb. 12, 2019 15:32:28
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
You mean this?

i[]@example_array;
resize(@example_array, 10);
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
639 posts
Joined: July 2005
Offline
oh yes! Thank you! I've been searching for that for a while now!

EDIT: Actually, not quite…

This is what I am looking for, but instead I wanted to be able to do this in Wrangle SOP…
Edited by EigenAlex - Feb. 12, 2019 15:43:39

Attachments:
Screen Shot 2019-02-12 at 12.43.05 PM.png (58.1 KB)

User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
You can go to this page and use the different types;

http://www.sidefx.com/docs/houdini/vex/snippets.html [www.sidefx.com]

The most you will be able to do as far as I know would be a 4x4 matrix:

4@Test = set(0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0);


And to set individual component values you can use the setcomp function:

setcomp(4@Test, 44.0, 1, 3);

The last two integer values are column and row index of the matrix, so you have to do combinations of 0-3 to index the full range of 16 components.

http://www.sidefx.com/docs/houdini/vex/functions/setcomp.html [www.sidefx.com]
Edited by BabaJ - Feb. 12, 2019 19:14:38
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
TheUsualAlex
Hi,
How does one create attribute of size n with Wrangle SOP?
For example,

You can't afaik.
You have to use attibute create sop, or python to create attributes of arbitrary (fixed) length.

Wrangles can only create attributes of size 1, 2, 3, 4, 9, or 16.
User Avatar
Member
639 posts
Joined: July 2005
Offline
I see… thank you for the head's up!
  • Quick Links