Hey guys,
This post isn't python specific, so forgive me if it's misplaced.
I'm having some trouble interacting with an imagePlane after enabling the
"useFrameExtension" attribute. Once this attribute is enabled, there should be
an expression connected to the imagePlane node. I want to delete that
expression in order to create my own key frames. The problem is that when I
script these actions the expression doesn't get created until Maya regains
control from the script.
For example, if I run this script;
imagePlaneName = "imagePlane1" # assuming this has already been created
cmds.setAttr( "%s.useFrameExtension" % imagePlaneName, 1 )
connected_expressions = cmds.listConnections("%s.frameExtension" %
imagePlaneName, source=True, destination=False)
connected_expressions will be empty.
I've tried sleeping the script and looping over the listConnections like this
cmds.setAttr( "%s.useFrameExtension" % imagePlaneName, 1 )
while not connected_expressions:
connected_expressions = cmds.listConnections("%s.frameExtension" %
imagePlaneName, source=True, destination=False)
time.sleep(1)
...but neither seems to allow Maya to create the expression. The only thing
that seems to work is to stop the script entirely and give control back to
Maya. Like this;
cmds.setAttr( "%s.useFrameExtension" % imagePlaneName, 1 )
STOP THE SCRIPT
connected_expressions = cmds.listConnections("%s.frameExtension" %
imagePlaneName, source=True, destination=False)
In this final case, the connected_expressions variable will contain a list of
at least one expression. The one I need.
How can I delay my script or force Maya to continue the expression creation so
that I can act on the expression?
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/f9676b7a-74b4-4522-8cf6-b9ee2cfe553b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.