Batch Export Script(Python)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
Batch Export Script(Python)

Hi Everyone,

I am in the process of needing and writing a script to export a folder of animations from Maya to C4D, and I just had a couple questions. Basically the steps involved would be:

-query list of files from specified folder
-geocache bound meshes
-select necessary objects for export
-export

I just wanted to know really if this can be done internally in Maya just because the pipeline I work with is both PC and Mac. If it can be done internally is there a specific command to handle files searching in a project? The file finding is the only part I am unsure about really.

Rick
 
Old 10 October 2012   #2
If you have the project directory, just search for files underneath it.
 
Old 10 October 2012   #3
All of this can be done inside maya:
Quote: -query list of files from specified folder


 getFileList -folder "someFolder" -filespec "*.mb";
 

Quote: -geocache bound meshes

this is a little bit tricky, there is a cacheFile command, but maya does all sorts of preparations before you export a cache file, which are different say for common deformed geometry and ncloth, so you can enable "echo all commands" in the script editor, then do a cache for some geometry, and you will see the appropriate mel procedure that is called. It should be something like "doPerformGeometryCache(...long list of parameters)".
Quote: -select necessary objects for export


 // select object by wildcard
 select -replace `ls "*geo*"`;
 

Quote: -export

there is a file -exportSelected command, but better do a test export and check the script editor again to see the full command and arguments.
__________________
..aut inveniam viam aut faciam..
::Copy SOP 4 Maya::
 
Old 10 October 2012   #4
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:59 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.