Select pass mode (AOV for rendering) in Blender using python

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Select pass mode (AOV for rendering) in Blender using python

Post by pro »

Hi,
I would like to automatically change the "Pass" mode in Blender to render only specific AOV - please see also my question on BlenderStackexchange: https://blender.stackexchange.com/quest ... hon-script . It's possible to select it with mouse click, but I couldn't find a way to change it programatically (from answers I got there, it seems that it's not accessible trough PythonAPI).

Even if I store the .blend project with this setting selected, when running blender in background, program doesn't detect the selection.

Did you have any similar problem or you maybe have an idea how to access this variable programmarically? Is there maybe a workaround? If there are none, also a solution with recompiling Blender would be OK for me if I would know what to change...

Image
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Select pass mode (AOV for rendering) in Blender using python

Post by B.Y.O.B. »

It does not matter which AOV is selected in the image editor, Blender/LuxCore will always render all of the requested AOVs. The same is true for Cycles by the way.
You can enable/disable AOVs in the render layer settings, but the "Combined" and "Default Lightgroup" AOVs will always be enabled (they are enabled in LuxCore itself and I think there's no way to disable them).

If you want full control over the AOVs from BlendLuxCore, you could edit this file: https://github.com/LuxCoreRender/BlendL ... rt/aovs.py
However, as I said, "Combined" aka RGB_IMAGEPIPELINE and "Default Lightgroup" aka RADIANCE_GROUP 0 will always be enabled internally in LuxCore if I remember correctly.
For a list of the names LuxCore uses internally for the AOVs, see https://wiki.luxcorerender.org/LuxCore_ ... ka_AOVs.29

P.S. The comments on stackexchange are right by the way, you can't change the selected pass from Python in Blender (I have looked into this for the denoiser UI). But you don't need to change this setting anyway because it doesn't matter for the rendering which pass is selected.
Attachments
2019-01-28_11-04-28.png
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Re: Select pass mode (AOV for rendering) in Blender using python

Post by pro »

B.Y.O.B. wrote: Mon Jan 28, 2019 10:09 am It does not matter which AOV is selected in the image editor, Blender/LuxCore will always render all of the requested AOVs. The same is true for Cycles by the way.
You can enable/disable AOVs in the render layer settings, but the "Combined" and "Default Lightgroup" AOVs will always be enabled (they are enabled in LuxCore itself and I think there's no way to disable them).

If you want full control over the AOVs from BlendLuxCore, you could edit this file: https://github.com/LuxCoreRender/BlendL ... rt/aovs.py
However, as I said, "Combined" aka RGB_IMAGEPIPELINE and "Default Lightgroup" aka RADIANCE_GROUP 0 will always be enabled internally in LuxCore if I remember correctly.
For a list of the names LuxCore uses internally for the AOVs, see https://wiki.luxcorerender.org/LuxCore_ ... ka_AOVs.29

P.S. The comments on stackexchange are right by the way, you can't change the selected pass from Python in Blender (I have looked into this for the denoiser UI). But you don't need to change this setting anyway because it doesn't matter for the rendering which pass is selected.
Thank you B.Y.O.B. for this detailed and fast answer - after reading it, I understood that I only need to create a script, which creates and correctly links "composition nodes" in Blender (my final goal was to automatically set up the rendering to output irradiance only).
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Select pass mode (AOV for rendering) in Blender using python

Post by B.Y.O.B. »

Yes, you can use the file output node for this:
https://docs.blender.org/manual/en/late ... /file.html
Post Reply