Creating attribute of n size with Wrangle
2382
7
1
EigenAlex
Member
639 posts
Joined: July 2005
Offline
Feb. 12, 2019 3:11 p.m.
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
BabaJ
Member
2039 posts
Joined: Sept. 2015
Offline
Feb. 12, 2019 3:23 p.m.
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
EigenAlex
Member
639 posts
Joined: July 2005
Offline
Feb. 12, 2019 3:30 p.m.
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 on
being listed. I was wondering what is the equivalence with VEX expression in Wrangle SOP…
Edited by EigenAlex - Feb. 12, 2019 15:32:28
Feb. 12, 2019 3:36 p.m.
You mean this?
i []@example_array ;
resize (@example_array , 10 );
EigenAlex
Member
639 posts
Joined: July 2005
Offline
Feb. 12, 2019 3:38 p.m.
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)
BabaJ
Member
2039 posts
Joined: Sept. 2015
Offline
Feb. 12, 2019 7:02 p.m.
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
jsmack
Member
7768 posts
Joined: Sept. 2011
Online
Feb. 12, 2019 9:37 p.m.
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.
EigenAlex
Member
639 posts
Joined: July 2005
Offline
Feb. 13, 2019 5:58 p.m.
I see… thank you for the head's up!