Jump to content

stupid attribute question


ranxerox

Recommended Posts

I want to setup a bunch of points as parameters to a popnet, using an addsop. These points have a custom attribute which I want to assign values to (depending upon their point index $PT). I am not sure what the easiest way to do this is. I have an add sop, followed by an attribCreate sop, and in the initialization of the value I have an expression, but this gets really messy really fast. For instance .. if($pt==0,1,3) .. this works for 2 values of PT, but how would I go about doing more ? I though I could use python to do this with a dictionary myDict = {0:1,1:3,2:5}, then index this dictionary with the $PT .. this would work but it seems python expressions only work in channel expressions (is this true ?..).

sorry for the confusion, just frustrated because it seems like this should be really simple but ..

maybe there is a better way altogether ?

thanks

-ranx

Link to comment
Share on other sites

Unless you're positioning the points with the add SOP as well, I always use a grid SOP, and just do a 1xN grid where N is the quantity of points I want. Then the attribcreate SOP. In there, add a custom float parameter (with the gear menu), set the attribute value to chf("newfloatparam", $PT). Now I just add keyframes on whatever point numbers I want to set.

Another approach is to make your points, add the attribute (but don't set any values), lock the attribcreate SOP, and then pull up the geometry spreadsheet, and enter values there (yes, you can edit all the attribute values in the spreadsheet).

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