Page MenuHome

Render API: option for custom render engines to disable image file saving
ClosedPublic

Authored by Thomas Lachmann (TL) on Jun 5 2021, 5:08 PM.

Details

Summary

For some custom rendering engines it's advantageous not to write the image files to disk.
An example would be a network rendering engine which does it's own image writing.

To disable image/movie saving in RenderEngine addons use:
bl_use_disable_image_save = True

This is only for rendering animations.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 15166
Build 15166: arc lint + arc unit

Event Timeline

Thomas Lachmann (TL) requested review of this revision.Jun 5 2021, 5:08 PM
Thomas Lachmann (TL) created this revision.
Brecht Van Lommel (brecht) requested changes to this revision.Jun 7 2021, 1:33 PM
  • Property names should not be negated like this, it should be "Use Image Save" defaulting to true (easiest is to use RNA_def_property_boolean_negative_sdna).
  • Mention in the description that this is for animation rendering.
  • Don't print "Saving" when no image was saved.
  • This seems incompatible with the "Overwrite" and "Placeholders" options? I guess that code needs to be disabled too and options hidden from the UI.
This revision now requires changes to proceed.Jun 7 2021, 1:33 PM
Thomas Lachmann (TL) edited the summary of this revision. (Show Details)
  • property name changed to "Use Image Save", defaults to true
  • changed the description of the property to clarify it's for animations
  • removed the "Save (time)" printf when no file is written
  • modified "Overwrite" & "Placeholder" behaviour when "Use Image Save" is disabled
  • also removed writing to a video file when "Use Image Save" is disabled
  • This seems incompatible with the "Overwrite" and "Placeholders" options? I guess that code needs to be disabled too and options hidden from the UI.

I've disabled this code when "Use Image Save" is disabled, also writing a video is prevented.

About the GUI:
I'm not sure if this needs to be hidden, because if a custom rendering engine disables file saving from blender, it should remove the output and stamp panel from the ui.
The documentation states:

# RenderEngines also need to tell UI Panels that they are compatible with.
# We recommend to enable all panels marked as BLENDER_RENDER, and then
# exclude any panels that are replaced by custom panels registered by the
# render engine, or that are not supported.

In this case these 2 panels are not supported, right?

About the GUI:
I'm not sure if this needs to be hidden, because if a custom rendering engine disables file saving from blender, it should remove the output and stamp panel from the ui.

I'm not sure about if remove this pannels is necessary. In most cases, each render engine can design a own 'Output' pannel, between others reasons, because some output formats aren't compatible with the own image output formats.
Cheers..

About the GUI:
I'm not sure if this needs to be hidden, because if a custom rendering engine disables file saving from blender, it should remove the output and stamp panel from the ui.

I'm not sure about if remove this pannels is necessary. In most cases, each render engine can design a own 'Output' pannel, between others reasons, because some output formats aren't compatible with the own image output formats.
Cheers..

My thinking is that removing the panels and optionally creating a own 'Output' panel is in the responsibility of the custom exporter.

My thinking is that removing the panels and optionally creating a own 'Output' panel is in the responsibility of the custom exporter.

Yes. I agree.

Brecht Van Lommel (brecht) requested changes to this revision.Jun 8 2021, 6:39 PM

Add-ons can override the panels as they wish, but the default panel might as well take it into account.

There's a design issue with this patch though. For the compositor and sequencer, you'd still need to output images. This new option can only really work when outputting images directly from the render engine. When combined with bl_use_postprocess = False this is not an issue, and maybe that's what you would use for network rendering anyway?

But for regular renderers, it's not clear what the correct implementation is in Blender or the add-on. So either it needs to be limited to bl_use_postprocess = False, or some more design and implementation work is needed.

This revision now requires changes to proceed.Jun 8 2021, 6:39 PM

My use case for this is a rendering engine which does it's own file saving, so I'm good with using bl_use_postprocess = False.
And I guess for network rendering this is also sufficient.

Updated the patch accordingly.

What is your point of view about the UI? Should Overwrite and Placeholder options disabled when this option is turned on?
Or maybe even the complete Output and Metadata panel?
In my opinion this could be handled by the render engine.

Fix incorrect do_write_file condition, tweak description

Since this is only applies when post-processing is disabled, I think it's ok to leave the output panel unaffected, since then you likely need to override the whole thing anyway.

This revision is now accepted and ready to land.Jun 14 2021, 2:26 PM