Sounds simple enough.
def do(rig):
# Open a new Maya Scene
cmds.file(newFile=True)
# Imports in a rig
cmds.file(rig, i=True)
# Apply animation curve onto the rig
apply_my_animation() # Your custom function for applying animation
# Publish
cmds.file(exportAll=True)
Pass this once for every file you’d like to have opened. For example.
import os
for rig in os.listdir("/my_rigs"):
do(rig)
Job done. :)
are there any ways in which I can test to know there Maya is indeed having 2 maya scenes, each loading in the rig?
Not sure I follow, what is it that you would like to test for?
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f8d367d8-c1cc-469c-9866-4d4a542a8e69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMYbrUGq_Ro9cogqEJToRMg6EYPgyB89RHRJeOk7vssXg%40mail.gmail.com.
I apologize in advance if I did not make myself clear, really sorry about that.Basically, I am trying to source for Rigs in the database (if you see the screenshot below, the UI is still not exactly done but...), User will first source the rigs in the Search Filter, they can select multiple rig versions and the add the rigs by clicking onto the "Add Rig" button which will then display under the QTreeWidget under the Migrate sectionThen via the list of rigs in the QTreeWidget in the Migrate section, based on each item in the list, I would like to import each item into a new scene since very much later on, I will need to get this published out based on each new scene.Of course before that, I would like to get this importing + new scene thingy settled first before I try advacning to the more complicated stuff... And so that is why I had wanted it to be an automated process..About the standalone as mentioned by Educardo, I tried:import maya.standalone as standalone
standalone.initialize(name='python')but I gotten this error in my editor:# Error: initialize() takes no keyword arguments
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# TypeError: initialize() takes no keyword arguments #
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/34d04a91-c7e0-4ea8-b876-a68c23b49ad3%40googlegroups.com.
Sure, why not just run your add code N times? What's the blocking issue?
This is slightly off topic but is it possible to add multiple of the same selection/items, in this case, for example I wanted to add 3 items of the same selection in my search filter into the QTreeWidget under the Migrate section?
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f3af7833-c0a8-4dc0-881a-8131be1bfffe%40googlegroups.com.