Jump to content

Driving point position from a different vector attribute


Triplett

Recommended Posts

I am certain that this is a simple question, but I am still struggling with it. I have a vector attribute called "centroid" on a bunch of primitives, and I want to create a point cloud whose P values match the centroid positions. I could use any of David Kahl's methods here https://www.youtube.com/watch?v=iyZ8dIqJ47U if I wanted a point at the centroid of every prim, but instead I have several prims with the same "centroid" vector because I obtained it by running "extract centroid" over prim pieces via a for-each loop. My instinct is that this is a super simple VEX expression like: @P = @centroid;   But that is obviously wrong. I also tried the set expression, but that didn't seem to work either. 
Is this like "promoting" an custom attribute into an intrinsic one like "P?"

Link to comment
Share on other sites

Fenolis: Thanks, that works great if you want a point at each prim. What you shared looks like one of David Kahl's methods above. 

The issue I have is the centroid attribute is the same for different sets of prims. In pseudocode what I want is v@P = v@Centroid, so all of the prims or points could be moved to their corresponding centroid positions. Unfortunately I can't get that syntax right.

Noobini: I'd like to share the file, but it uses a big json file and a bunch of other dependent files in order to create the attributes. It is too big to upload and download all that.

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