Jump to content

Is there a way to add array attributes using Wrangle SOPs?


magneto

Recommended Posts

Hi,

I don't see the add attribute syntax for arrays. addattribute VEX function supports this but I think this function is not available in Wrangle SOPs.

Any idea how to do this in Wrangle SOPs? Because otherwise this prevents the use of Wrangle SOPs.

Thanks :)

EDIT: Actually I don't think I can use Wrangle SOPs anyway because the point VEX function also doesn't have the array return overload, unlike his sister import function, which does support returning arrays.

This separation is very confusing, and I hope these are unified so we don't have one in one but not the other and vice versa :(

Edited by magneto
Link to comment
Share on other sites

it should work for Point Wrangle SOP as it is based on VOP SOP:


float a[] = array(1, 2, 3, 4, 5);
addattribute("attrib", a, arraylength(a));[/CODE]

however it may be different for Wrangle SOPs based on CVEX such as (Attrib Wrangle, Volume Wrangle...) since they may not support all VEX functions yet

  • Like 1
Link to comment
Share on other sites

Thanks anim, that seems to work. So now only 2 problems exist.

1. I still need a way to import array attribute values from the second input.

2. When I use the above code you posted, the attribute values are bizarre for some reason. If I am not wrong, they all should have 1,2,3,4,5 as attrib values. Here is how it looks in the Details View:

n8yi6hq.png

EDIT: Also I just tried it and #2 seems to work perfectly in 12.5, but in 13.0.222 has the problem shown in the above picture.

EDIT2: Changing the attribute name will change the values "randomly" every time.

Edited by magneto
Link to comment
Share on other sites

not sure what's going on in your scene so here is an example file

it just creates array attribute using Point Wrangle

then another Point wrangle will get that attribute from first and second input and add the values together to produce resulting array

EDIT: oh, and I'm using 12.5.376 didn't test with 13

ts_array_attribs_pointwrangle.hipnc

Edited by anim
  • Like 2
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...