PDA

View Full Version : component attributes?


PolyHertz
01-30-2011, 07:53 AM
Do components like verts/edges/faces have attributes such as position that can be referenced for the scriptJob -attributeChange flag?

NaughtyNathan
01-30-2011, 01:47 PM
attributes only really exist on nodes and, as components aren't actually nodes but are themselves a type of attribute of the mesh node, I don't think you could say they have their own attributes as such. However, as they are attributes themselves could you use that as the scriptJob link?

For a vertex (.vtx[3] for example), you could get it's local tweak position like so:
getAttr meshNode.cp[3]; // (cp = 'Control Point')so in theory, if you had a scriptJob connected to this attribute, it would fire whenever that vertex was modified (in theory! and it wouldn't work if the object was moved as the vertex tweak would not be modified)

edges and faces are mesh attrs too (mesh.edge and mesh.face), but don't really have a "position" as this is defined entirely by their verts. Sure, you can derive position info from them, but this is not really the nature of what a node attribute is usually for or contains.

check the Node and Attribute Reference documentation for mesh and see if that helps.

:nathaN

PolyHertz
01-31-2011, 01:42 AM
Thanks Nathan, that helped a lot and was able to get the scriptjob to recognize component tweaks. :)

CGTalk Moderation
01-31-2011, 01:42 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.