CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-08-2013, 04:36 PM   #1
rgkovach123
Know-it-All
robert
austin, USA
 
Join Date: Nov 2006
Posts: 364
Maya File somehow losing it's Name

I have a Maya file, that when I open it, loses it's Name.

in other words, I can't Save the File - Maya can't find the name, so it opens the Save As Dialog.

After opening the file:

Code:
cmds.file(save=True, type='mayaAscii') // Error: A file must be given a name before saving. Use file -rename first, then try saving again.


Querying the name returns nothing:
Code:
cmds.file(q=True, sn=True)


Querying the full path and filename works, so i can manually rename the file back to its name, but this seems like a bug...

Code:
filename = cmds.file(q=True, exn=True) // Result: C:/Temp/MyFile.ma //


Anyone else encourtered this problem?
 
Old 03-11-2013, 02:51 AM   #2
kosingcg
Tatlong Dimension
 
kosingcg's Avatar
portfolio
Oliver Magno
Render TD
MPC - Montreal
Canada
 
Join Date: Feb 2013
Posts: 77
are you saving binary to ascii or ascii to binary file?
 
Old 03-12-2013, 02:04 PM   #3
rgkovach123
Know-it-All
robert
austin, USA
 
Join Date: Nov 2006
Posts: 364
it's ascii, and as far as i can tell, the file information is intact.
seems like maya has trouble parsing the file when it is opened, preventing the file name from getting registered with maya. the file also fails to appear on the "recently opened" list.
 
Old 03-12-2013, 02:11 PM   #4
isoparmB
Wave man
 
isoparmB's Avatar
Martin
wandering in Singapore
Makati, Philippines
 
Join Date: Nov 2005
Posts: 868
Are there any tracebacks in the script editor after opening the file?

You can try renaming the file in a python script editor:

from maya import cmds
cmds.file( rename='test.ma' )

After doing that, try saving it again, and reopen it.
__________________
...everything will be fine, as long as nothing goes wrong...
 
Old 03-12-2013, 02:50 PM   #5
rgkovach123
Know-it-All
robert
austin, USA
 
Join Date: Nov 2006
Posts: 364
yea the problem with that is that renaming the file loses the original path to the file.
A new path is constructed under the current project with the new name.

so, if the file isn't opened under a project that reconstructs the exact same full path, the file ends up getting saved in a new location.
 
Old 03-13-2013, 02:54 AM   #6
kosingcg
Tatlong Dimension
 
kosingcg's Avatar
portfolio
Oliver Magno
Render TD
MPC - Montreal
Canada
 
Join Date: Feb 2013
Posts: 77
I remembered this problem now, once I have this kind of problem from the galaxy far far away.

You are using the save option without inputting a file name, the command should be:

Code:
cmds.file( f = true, type='mayaAscii', save=True)


Forcing maya to save the file with the current file name.

Or:
Code:
cmds.file( 'nameOfYourMayaFile.ma', f = true, type='mayaAscii', save=True)


Either of the 2 commands should work.
__________________
We are the captives of our own identities,
living in the prisons of our own creations.
 
Old 03-13-2013, 02:54 AM   #7
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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
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 01:14 PM.


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