pm.system.sceneName() sometimes gives empty string


#1

Hello there.
I have a python script which does things, and in this script i want to get the scene name by using the pm.system.sceneName() function. But sometimes it only returns an empty string. What causes this and how can i make sure that i always retrieve the scene name?


#2

Solved it (i think).
If the maya scene is not saved the string is empty, by saving the scene and restarting maya the sceneName returns the correct string