Script job on scene name change

84 views
Skip to first unread message

Justin Rosen

unread,
Sep 10, 2010, 12:03:51 PM9/10/10
to python_in...@googlegroups.com
Heya,

I'm trying to get a script job that catches when the name of a scene changes.

The following works
pm.scriptJob(event=["workspaceChanged", updateSceneName])

But doesn't work through code
pm.cmds.file(rename="test")

I perused the events and couldn't find one that seemed to fit.  Any ideas?

Thanks
Justin

hapgilmore

unread,
Sep 10, 2010, 4:20:59 PM9/10/10
to python_inside_maya
It may be because the 'file -rename' command only changes the name of
the scene in maya. On it's own, the rename command doesn't actually
save/write anything. Have you tried combining rename with saveAs? I
bet that would cause the workspace to change.

-Ian

Justin Rosen

unread,
Sep 10, 2010, 4:41:59 PM9/10/10
to python_in...@googlegroups.com
That's what I figured.  Although, I don't need to actually save the scene at any point.

We're rewriting our render submission ui which updates interactively when things change in maya.  Because we have very strict naming conventions, you can't submit to the farm unless your scene is named correctly (We''ve overridden the open/save dialogs to handle this).  I wanted to update my ui whenever the scene name changed to let the user know their scene wasn't named correctly.  In almost all cases workspaceChanged will works fine, there's just a few edge cases.

Thanks!
Justin




Reply all
Reply to author
Forward
0 new messages