CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 10-18-2012, 04:28 PM   #1
ricksilliker's Avatar
Rick Silliker
Technical Artist
Burbank, USA
Join Date: Aug 2010
Posts: 55
Send a message via AIM to ricksilliker
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.

Old 10-21-2012, 07:29 AM   #2
A newbie
zoharl's Avatar
Wellington, New Zealand
Join Date: Mar 2009
Posts: 1,821
If you have the project directory, just search for files underneath it.
Old 10-22-2012, 07:47 AM   #3
ntashev's Avatar
Nikolay Tashev
Lighting/Rendering Artist
Sofia, Bulgaria
Join Date: Nov 2005
Posts: 326
Send a message via ICQ to ntashev
All of this can be done inside maya:
-query list of files from specified folder

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

-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)".
-select necessary objects for export

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


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..

Old 10-22-2012, 07:47 AM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:45 PM.

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