playblast NURBCurves & joints in mayapy mayastandalone

playblast NURBCurves & joints in mayapy mayastandalone

oliv.dxyz
Participant Participant
535 Views
1 Reply
Message 1 of 2

playblast NURBCurves & joints in mayapy mayastandalone

oliv.dxyz
Participant
Participant

Hi all,

 

I'm trying to playblast a rig panel directly from a script (without maya ui) using mayapy. My issue is that my resulting images look different when playblasting from the script editor (within the maya ui) and from my mayapy script.

Using the script editor I can see my NURBCurves and joints in my image, but they disappear when using my script.

Searching in my interface I realize that the command on the panel to show the curves and joint is actually affecting my playblast. ie: the from the interface Show > NURBCurves On/Off has an impact on the image but strangely Show > Playblast Display > NURBCurves does not.
Similarly  this impact my playblast command.

editor = cmds.playblast(ae=True)
cmds.modelEditor(editor, nurbsCurves=False, edit=True)


issue is I have no editor using mayapy and mayastandalone so I don't know how to set this preferences.
in mayapy :

ipdb> editor = cmds.playblast(ae=True)
*** RuntimeError: Model editor name cannot be found for current view

 

Also I found the following settings that looks promising:

cmds.getAttr("hardwareRenderingGlobals.objectTypeFilterNameArray")
['NURBS Curves', 'NURBS Surfaces', 'Polygons', 'Subdiv Surface', 'Particles', 'Particle Instance', 'Fluids', 'Strokes', 'Image Planes
', 'UI', 'Lights', 'Cameras', 'Locators', 'Joints', 'IK Handles', 'Deformers', 'Motion Trails', 'Components', 'Hair Systems', 'Follic
les', 'Misc. UI', 'Ornaments']
cmds.getAttr("hardwareRenderingGlobals.objectTypeFilterValueArray")
[0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
cmds.setAttr("hardwareRenderingGlobals.objectTypeFilterValueArray", [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0
, 0, 0], type="Int32Array")


But no luck here too, it has no impact neither from mayapy or from the script editor..

Does anyone managed to do something similar and change the visibility options of object types for playblast in mayapy  ??

536 Views
1 Reply
Reply (1)
Message 2 of 2

oliv.dxyz
Participant
Participant

If someone is looking for a solution, I found that using 

cmds.ogsRender

with the right values for

 

hardwareRenderingGlobals.objectTypeFilterValueArray

 

did the trick.

 

Also these lines

 

cmds.colorManagementPrefs(e=True, outputTransformEnabled=True,outputTarget="renderer")
cmds.colorManagementPrefs(e=True, outputUseViewTransform=True, outputTarget="renderer")

 

allow to have a correct color management (image looking as the one I got from the ui).

 

Only issue now is that the colors doesn't seems to come through for joints and nurbs.

 

 

0 Likes