PDA

View Full Version : script for importing stuffs


Geuse
02-22-2009, 08:23 PM
Hi all. I've been putting together a vast and decent script pack of a bunch of great scripts from highend3D. I've been using the Maya.env file with realtive paths and then specified my own folder structure to look for all the scripts. In the past I've relied on the modules, but I coudln't seem to make it work with the "MAYA_SCRIPT_PATH" variable in Maya.env so I scrapped the whole modules interface and wrote my own paths instead. Good or Bad?.

Anyway. As I went along I figured it would be great if I could create some shelf icons for importing scenefiles with the click of a button. However I can't really figure out how to do this and still keep my filepaths relative.


string $rootFolder = (`internalVar -userAppDir`);

string $customMayaConfigFolder = $rootFolder+"CUSTOM_MAYA_CONFIG";




file -import -type "mayaAscii" -rpr "scenefile.ma" "$customMayaConfigFolder/scenefile.ma";



This here works great, but I have a little problem and it is because of I'm using the same folder structure for absolute path in school and realtive path at home(I want to be able to bring it over from system to system without changing to much). the only thing I'm changing is the first line in the maya.env which specifies where my "CUSTOM_MAYA_CONFIG" -folder is located. at home it looks for a reltive path directly under the "MAYA_APP_DIR" and at school it's an absolute path on the network.

I thought of using one global procedure for each model and then use that .mel-file to call the scene-file it corresponds to. Or perhaps build a loading window that lists all the scene files in a specific folder. So for instance if I have this folder structure: "CUSTOM_MAYA_CONFIG\Models"
There's a mel-script in that folder that lists all scene files in the same folder and list their names in a window with a "import" button.

I hope I'm making myself kinda clear atleast. I'd really appreciate some thoughts or suggestions on all of this!!

CGTalk Moderation
02-22-2009, 08:23 PM
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.