Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

question about cmds.ogsRender() and cmds.isolateSelect()

question about cmds.ogsRender() and cmds.isolateSelect()

g2m.agent
Collaborator Collaborator
590 Views
2 Replies
Message 1 of 3

question about cmds.ogsRender() and cmds.isolateSelect()

g2m.agent
Collaborator
Collaborator

the viewport like this: 3 objects, 1 selected(the green one).

vp.png

my code:

cmds.isolateSelect("modelPanel4",state=True)
cmds.isolateSelect("modelPanel4",aso=True)
cmds.ogsRender(h=512, w=512, cv=True, ems=True)

When I execute them one by one, the result is as expected.

step.png

When I execute them together, isolate becomes invalid.

once.png

why??

0 Likes
Accepted solutions (1)
591 Views
2 Replies
Replies (2)
Message 2 of 3

BigRoy
Advocate
Advocate
Accepted solution

This could have to do with the Viewport not updating prior to the render and using a cached view or something alike.

 

You could try triggering a refresh in between. Or even try a ogs reset.

 

from maya import cmds

cmds.refresh(force=True)
cmds.ogs(reset=True)

You might need only the refresh - I haven't tested this code.

Message 3 of 3

g2m.agent
Collaborator
Collaborator

thank you for your reply! actually, I already do this way a few days ago. and I have a backup solution: renderSetup.

0 Likes