I would look at message attributes. i.e. create a message attribute
somewhere on the rig (top level?) and plug the "message" attr of the shader
or shading group into that. Then it's persistent across maya sessions,etc.
Should be pretty easy to add to your script, too.
#create and connect message attr
cmds.addAttr(YOUR_RIG_OBJ, at="message", ln="origShader")
cmds.connectAttr("{0}.message".format(YOUR_SHDR),
"{0}.origShader".format(YOUR_RIG_OBJ))
# getting object back from the message attr is bit weird, maybe there's an
easier way? I'm getting the attr then getting the object from that
orig = cmds.connectionInfo("{0}.origShader".format(YOUR_RIG_OBJ),
sfd=True).partition(".")[0]
Z
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ea9581ec-f36c-4089-b99b-5e933b58e32c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.