Collection enable/disable: use camera visibility as behaviour

Authored by Dalai Felinto (dfelinto) on Sep 21 2017, 3:06 PM.


I see that I'm bringing up patches before having some design documents shared,
debated and approved. So I will leave this patch here, ready, waiting for the
decision on this.

This creates a distinction for collections between being visible and being enable.
This is a follow up on 9ad2c0b6154b and originally presented at D2849.

Although support objects are already behaving different when a collection is
enabled or invisible, mesh objects behave exactly the same.

With this patch users can now disable a collection if they want a group,
boolean, ..., to not be rendered. Or they can enable it (assuming the
collection is visible) to edit those objects.

If we don't implement this patch I believe we will need to replace the collection
visibility with options such as visible to camera, visible to render, ...

Diff Detail

rB Blender
Build Status
Buildable 839
Build 839: arc lint + arc unit

Just to be clear, the concerns raised by @Sergey Sharybin (sergey) are related to having an object used for boolean casting shadows even if you turn it invible.
Same goes for groups or particles, where you often wants to hide the original "group" objects entirely.

In 2.7 you would switch to a different "visibility bit" and you can edit those object.

In 2.8 you will need to enable those objects collections, eventually hiding all other collections.

@Brecht Van Lommel (brecht) you helped with the patch yesterday (D2849) yet you didn't say your opinion on that. What do you think?

My opinion on all this is quite different from the design docs, but here it is.

There's a few different use cases for hiding objects:

  1. Helper objects that should not affect a render at all (booleans, collision, duplis, bone shapes).
  2. Temporarily hiding objects or collections while working in the viewport.
  3. Temporarily hiding objects or collections in a render.
  4. Rendering into separate layers to be composited together.

For 1) hiding should be a property of the object itself, not the collection. It doesn't matter which collection they are part of, they should never be visible in a final render. Particularly if you are linking in dupligroups this is required since you can't put objects in the group in separate collections. The existing OB_RESTRICT_RENDER seems useful to keep for that. These objects also would not affects shadows or light probes I think, but they could still be visible in the viewport.

For 2) there should be a property that users can set with H shortcut and similar tools, in a way that users don't have to worry about affecting the final render and can press alt H when they're done without breaking anything. For this I think OB_RESTRICT_VIEW works well.

Both 1) and 2) could be controlled at the collection level too, which would be most convenient for 3) as well. Otherwise you'd have to either change individual object render visibility temporarily, or remove and re-add a collection in the layer, which would both be inconvenient. I think a collection option to make it invisible entirely would be good to have here, and this could be visually indicated in the outliner with a checkbox and greying out the collection and objects below it.

For 4), current render layers have various layer options. I think "Scene" and "Exclude" in 2.8 would be replaced by letting the users choose which collections to add to a layer.

For "Layer" (visible to camera or not) and "Mask" (render as holdout), I believe the plan at the workshop was to support them by letting collections override equivalent objects properties. That seems pretty reasonable to me if overrides are still planned to work like that. A builtin property of the collection to do the same could work too if overrides are not obvious enough. Either way I think this should be something that should be quite separate from 1), 2), 3), that more advanced users would set up for the purpose of compositing.