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 Tools Search this Thread Display Modes
  10 October 2012
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

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.

  10 October 2012
If you have the project directory, just search for files underneath it.
  10 October 2012
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::
  10 October 2012
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
Society of Digital Artists

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

All times are GMT. The time now is 07:47 AM.

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