Jump to content
Sign in to follow this  
magneto

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

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks alot anim, glad that I can now use import. But yeah 13 still has the same weird values. 12.5 works perfectly.

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
Sign in to follow this  

×