Help with importing .mb relative path

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
  05 May 2013
Help with importing .mb relative path

hi i use this site a lot when im stuck but couldn't find an answer to this but sorry if its been asked before it seems simple.
Is there a way to use mel script to load a .mb file but relative to the mel script file, so its in the same folder on a different computer it would still work? Thanks in advance
 
  05 May 2013
not mel but this should work (python).

import maya.cmds as mc
import os

newFileName = 'testFile.mb'

newFilePath = os.path.join(os.path.split(mc.file(q=True, loc=True))[0], newFileName)
mc.file(filePath, o=True)


Thinking bout it there should be a simpler way, will have a butchers.
__________________
ldunham.blogspot.com
 
  05 May 2013
if the mel script is already on the MAYA_SCRIPT_PATH, like in "My Documents/maya/2012/scripts", then you can get the path to the MEL script using "whatIs".

for example:

whatIs "myMelScript.mel";

returns the path to the script file.
 
  05 May 2013
ah i mis-read. cheers.
__________________
ldunham.blogspot.com
 
  05 May 2013
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:08 PM.


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