Quantcast
Channel: mel wiki
Viewing all articles
Browse latest Browse all 610

Changing the file type causes Maya to loose the scene name.

$
0
0
As of Maya 2016, there's an annoying bug:
  • If you open a scene, and change its file type (from ma to mb or vice versa), it will lose the scene name.
  • If you open a scene, save the scene, then change the filetype, the bug doesn't show up.
Example of it acting broken:
import maya.cmds as mc

mc.file(r"C:/path/to/my/file.mb", open=True, force=True)
fileType1 = mc.file(query=True, type=True)
fileName1 = mc.file(query=True, sceneName=True)
print fileType1, fileName1
['mayaBinary'] C:/path/to/my/file.mb

# Change the file type:
mc.file(type='mayaAscii')

fileType2 = mc.file(query=True, type=True)
fileName2 = mc.file(query=True, sceneName=True)
print fileType2, fileName2
[u'mayaAscii']  # !!!! no more filename, it is an empty string !!!!!!!
Here is it not broken:
import maya.cmds as mc

mc.file(r"C:/path/to/my/file.mb", open=True, force=True)
fileType1 = mc.file(query=True, type=True)
fileName1 = mc.file(query=True, sceneName=True)
print fileType1, fileName1
['mayaBinary'] C:/path/to/my/file.mb

# Save the file
mc.file(save=True, force=True)

# Change the file type:
mc.file(type='mayaAscii')

fileType2 = mc.file(query=True, type=True)
fileName2 = mc.file(query=True, sceneName=True)
print fileType2, fileName2
[u'mayaAscii'] C:/path/to/my/file.ma

Viewing all articles
Browse latest Browse all 610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>