SceneRenderLayer Removal/Refactor

Authored by Dalai Felinto (dfelinto) on Nov 16 2017, 11:14 PM.



This patch moves all the functionality previously in SceneRenderLayer to SceneLayer.
If we want to rename some of these structs now would be a good time to do it, before they are in SceneLayer.

Everything should be working, though I will test things further tomorrow. Once this is committed depsgraph can get
rid of the workaround added in rna_Main_meshes_new_from_object and finish whatever this patch was preventing from being finished.

This patch also adds a few placeholders for the overrides (samples, ...). These are obviously not working, so some unittests that rely on 'lay', and 'zmask' will fail.

This patch does not addressed the change of moving samples to ViewRender (I have this as a separate patch and needs some separate discussion).

Following next is the individual note of the individual parts that were committed.

Note 1: It is up to Cycles to still get rid of exclude_layer internally.
Note 2: Cycles still need to handle its own doversion for the use_layer_samples cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.

Note 3: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).

Note 4: There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead of taking things from it bit by bit.

Diff Detail

rB Blender

What is the purpose of these values moving forward layflag for eg, doesn't seem to be used.

Is this just for versioning so they can be used later?

If this is only for loading old file data. All old values could be moved into a sub-struct legacy_data or similar, so we know whats for versioning and whats meant to be used for new code.


picky - prefer snake case, already used all over.


Technically layflag was used here: rl->layflag = scene_layer->layflag;in render_result_new(). I will bring it back now. But this seems all legacy features from before the custom passes patch.

  • Use scene_layer->layflag for RenderLayer->layflag
  • From review: rename freestyleConfig to freestyle_config
  • Fix Cycles addon after SceneRenderLayer > RenderLayer
  • Fix memleak
  • Fix user interface
  • Code cleanup: We still have a crash no write/reading saved files because of freestyle

I'm investing the freestyle related crash, a bit clueless at the moment, but I will update this patch once it's done.

Fix freestyle config reading issues
Fix issue affecting render layer unittests

@Sergey Sharybin (sergey) patch is ready and I plan to commit tomorrow first thing.
Cycles unittest is failing for me in 2.8, so I couldn't test if this
patch makes it better or worse.

I would like to hear from you on that before I pull the plug.

Run Cycles tests, they are passing for me. From quick looking over the patch did not see anything obviously wrong. We can tweak code later anyway.

The most crucial thing is to get DNA right.

This revision was automatically updated to reflect the committed changes.