Jump to content

Transfer all attributes using VEX


Recommended Posts

Is there a way to transfer -all- point & prim attributes in VEX like you can with attribute transfer (or ray), which is old and slow and non-compilable, looking for a modern VEX solution

Normally I would just use intersect or pcopen or whatever for single attributes but I want to be able to transfer ALL incoming attributes (or have a typed list that can utilize wildcards) without having to manually specify them, so it can account for any incoming attributes upstream

thanks

Edited by Neon Junkyard
Link to comment
Share on other sites

I'd not do it in VEX, it can get tedious as you will have to check for attribute size, attribute type info attribute type, etc.

Also it would probably not be the fastest

 

for minimum amout of work and maximum efficiency, you can do one of the following for example

1. if it's a single value

- create i@sourcept,  i@sourceprim, ... attribute on the original geo (from its @ptnum, @primnum, ...)

- create i@sourcept, i@sourceprim, ... on the other geo based on which one you want to copy from

- after VEX use Attribute Copy to copy all needed attributes from original geo based on that attrib

 

2. to interpolate values

- on the other geo create i[]@sourcepts f[]@sourceweights storing array of point numbers and weights you want to interpolate from and use Attribute Interpolate SOP (point numbers and weights) to transfer all the attributes you want

similar for prims and vertices

Edited by anim
  • Like 4
Link to comment
Share on other sites

Ah thanks Tomas, those are great solutions!  Yea the vex route Im realizing is more trouble than its worth, currently for most cases that dont require interpolated values im using the ray sop (that is now compilable) set to mindist with transform points unchecked and import attributes from hits. Doesnt account for your second solution though so thank you for that

I know as soon as I spend any sort of time making some custom attribute transfer sop that handles all edge case scenarios sidefx will release a new version of it, happens every time

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...