Jump to content

Prim expression


Recommended Posts

Hello,

 

I hope this is the right place to ask this question. It is about the prim expression. I did not understand very well what prim_num and attrib_index are in this expression.

prim($OBJID, 0, "Cd", 1)

In my understanding is returning the value of the attribute color of the specific object id. But 0 referes to what (prim_num) and 1 is what (attrib_index)

So i did not understand those two from the expression attrib index and prim num (I have read in the help file but...).

 

Thank you very much

Link to comment
Share on other sites

I'm not sure if your referring to the vex function or the hscript expression.

 

Prim num is the number of the primitive you want to get the attribute value from, this would be the number that would show up if you toggled prim numbers on in the viewport or the far left column in the details view of prim attributes.

 

Index refers to the component of the attribute, if you have a float it would always be zero, but if you have a vector like Cd it could be 0, 1, or 2 for the x, y, and z components.

 

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