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?
On 13 February 2015 at 08:45, likage <[email protected]> wrote:
>
>
> I am trying to attempt something where it does the following:
> * Open a new Maya Scene
> * Imports in a rig
> * Apply animation curve onto the rig
> * Publish
>
> Meaning, to say, in one Maya scene - there will only be one rig plus its
> own animation.
> Pertaining to the above, I will need to do the same thing over a huge list
> that I have.
>
> And so, was wondering if this is possible to be done in an automated
> manner?
>
> I did write up a mock UI, where it allows user to select the rigs they
> wanted to import, and provide the file location where the animation curve
> is to be applied against the rig import
> So far I have only completed the rig importing part (was a single
> selection).
> Say, if this automatedd process can indeed be done, and I have selected
> two rigs, are there any ways in which I can test to know there Maya is
> indeed having 2 maya scenes, each loading in the rig?
>
>
> --
> 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/f8d367d8-c1cc-469c-9866-4d4a542a8e69%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/f8d367d8-c1cc-469c-9866-4d4a542a8e69%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
*Marcus Ottosson*
[email protected]
--
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/CAFRtmOCOBXXEDTcVrhK8uX7rCD0BgFQinLJSJWzaZ6ZPzRvpCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.