forcing UI updates in Mel Commands

1,479 views
Skip to first unread message

stephenkmann

unread,
Jan 23, 2012, 11:15:55 AM1/23/12
to maya...@googlegroups.com
i've been bitten by this before, and Now I can't find the correct update.

 I'm creating render layers and saving a file in one fell swoop of a mel script.
 
 the issue is, if I don't actually visualize the scene in maya, it doesn't do "something" that updates the layers and makes them able to be switched between.

I tried grabbing all the echoed commands from the script job, but it still isn't doing "something" that maya has to do, to finalize the making of these render layers.

the error i get is this:


[11:12:42] Render: Error: Cannot switch from 'defaultRenderLayer' to 'superLayer' because of an override to a missing node within a referenced scene. Reload the referenced scene if it's unloaded, clean up the referenced scene or remove corresponding reference edits if the node has been deleted in the referenced scene.
[11:12:42] Render: Warning: Cannot render 'superLayer' because we can't switch to that layer.

I get this error, only if I instantly send the file to the renderfarm, but if I wait, then run the part that sends the file to the render farm, its fine,, the only difference is waiting for maya to do whatever it does ,and then running the second half of the script

anyone have an idea on how to force maya to these updates?

--
stephe...@gmail.com
http://smannimation.blogspot.com/
http://nymayausersgroup.blogspot.com/
http://smann3d.blogspot.com/

Sandy Sutherland

unread,
Jan 24, 2012, 5:00:12 AM1/24/12
to maya...@googlegroups.com
This is a totally random stab in the dark, but what if you just put the line:

refresh;

I think that at least forces a redraw of the viewport, which might be enough to kick the render layer into action.

Stephen

unread,
Jan 24, 2012, 8:13:26 AM1/24/12
to maya...@googlegroups.com, maya...@googlegroups.com
I was thinking the same thing.  I used refresh -f. As well as changed the current time. Unfortunately neither updated the layers info.  

However I did find that  even though I'm not doing anything to the reference , besides referencing it, that importing fixes the issue. Granted I still would like to find what maya is doing so I don't have to go that route. 
  I really hate when actions are tied into Maya's UI , like having to open the render globals window to get all the render settings to update. 

Thanks
-s


Sent from blackberry

Hamish McKenzie

unread,
Feb 7, 2012, 6:42:49 AM2/7/12
to maya...@googlegroups.com
I'm reasonably sure the layers are updated via a script job.  Script jobs only evaluate when maya is idle, which explains why you only get the behaviour if you "instantly" send it to the farm...

I'm not sure how to force maya to evaluate script jobs, but you could always go hunting to see what script is being called and just call it manually.  I expect doing a scriptJob -lj and poking around the output you'll be able to figure out which magical script is doing the update.

Good luck.
-h.

stephenkmann

unread,
Feb 7, 2012, 9:26:33 AM2/7/12
to maya...@googlegroups.com
that totally makes sense, thanks Hamish,

-=s
Reply all
Reply to author
Forward
0 new messages