file doesn't query filename in 2015/16


#1

I’m using the command file to querying the filename in Maya 2014. But it doesn’t work in 2015 or 2016.

filename = cmds.file(q=True, sn=True, shn=True, wcn=True)

I tried using pymel and it works fine.

pm.sceneName()

but, is this a bug or did something change in 2015? Or is there something wrong with the scenes I’m opening?

Is there any other way to get the file name?


#2

pm.sceneName() and the file() command work fine here in Maya2015. I get the complete path with sceneName() and the file name part only with the file() maya command.


#3

Sorry, I had a mistake in my pm code.

The pm.sceneName() is working fine as intended.
For some reason, the cmds.file isn’t.

I haven’t found the problem yet, but it seems to be something in the scenes files and not Maya’s version.

Until I find the problem, I guess I’ll have to stick with pymel. It works fine even with these bugged scene files.