Unable to load VRayRT for batch playblast

Hi Chaos Group !

I can’t find the way to run a playblast in a subprocess and get the same result as an interactive playblast with VRay IPR.
The maya command cmds.playblast works well but the chosen renderer isn’t VRayRT in batch mode.

Here is a frame of each result:

1. Launch VRay IPR via UI button then running playblast script in interactive session

2. Running the same playblast script in subprocess

The Maya hardware renderer does not understand the VRay materials so a white constant appears.
With Lambert materials the meshes have color with both interactive and batch playblast.

I tried to force VRayRT renderer with

model_editor = cmds.playblast([COLOR=#aa4926]activeEditor[/COLOR]=[COLOR=#6897bb]1[/COLOR])
cmds.modelEditor(model_editor[COLOR=#cc7832], [/COLOR][COLOR=#aa4926]e[/COLOR]=[COLOR=#6897bb]1[/COLOR][COLOR=#cc7832], [/COLOR][COLOR=#aa4926]rendererOverrideName[/COLOR]=[COLOR=#a5c261]"VRayRT"[/COLOR])

or with openMaya

view = omui.M3dView.active3dView()
view.setRenderOverrideName("VRayRT")
view.refresh(True, True, True)

But these solutions are not working in batch mode.

So, is there a way to use VRayRT as playblast renderer in batch mode ?

Bonus question:
Using one of the script snippets above in an interactive session the VRay IPR starts well. But if I run the playblast without waiting the IPR is fully loaded, the Maya scene freeze.
Is there a callback I can use to launch playblast only when VRay IPR is ready ?

My setup :

  • centos 7
  • maya 2018.6
  • vray_for_maya 4.12.02

I also attached a zip containing my test scene and the full python script I used.

Thanks
Thibaud
vray_rt_batch_tests.zip (11.5 KB)

I’m afraid there’s currently no way to do this. I think the reason neither approach works is that there isn’t actually a modelPanel in batch mode/mayapy, and there’s also no M3dView, in your script printing M3dView.numberOf3dViews() returns 0.
But even if you find a way to start V-Ray IPR in Batch, there’s another problem, which is the cause for the “bonus question”: currently we start the render from an idle callback, which doesn’t happen until the script is complete in UI, and I think doesn’t happen at all in batch. We’ll have to change the way V-Ray IPR is started to adress this problem. I’ll log this as a bug report in our system and post here if there’s any progress on this.