Page MenuHome

Outliner visibility unification and per-viewlayer collection visibility
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Nov 30 2018, 5:42 AM.

Details

Summary
  • [re-commit] Per view-layer collection visibility
  • [re-commit] Fix/workaround issues in pose and edit mode
  • Outliner: Gray out collections only when they are invisible
  • Outliner: Implement 3 levels of viewport visibility
Now collection and objects can be either:
* Hidden for all the view layers.
* Hidden for a view layer but not necessarily for all others.
* Visible for a view layer but not necessarily for all others.

Regarding icons: Whatever we decide to use for the "Hidden for all view
layers" needs to be a toggle-like icon. Because when viewing "Scenes"
instead of "View Layer" in the outliner we should be able to edit the
collection "Hidden for all the view layers" as an on/off option.

Shortcuts:
* Ctrl + Click: Isolate collection (use shift to extend).
* Alt + Click: Disable collection.
* Shift + Click: Hide/Show collection and its children (objects and collections).

See T57857 for discussion.

TODO:

  • Not rebuild depsgraph on visibility change (only on disable collections).
  • New icon for enable/disable (low priority, can be done after merge).
  • Expose all options (isolate, hide/show, hide/show hierarchy, enable/disable) to a context menu in outliner.
  • Support drag&drop (not sure if it is possible)
  • Alt + Click conflicts with emulate 3 mouse button, decide what to do about it (if anything).

Diff Detail

Repository
rB Blender

Event Timeline

And just for the records, up to rB937136251aff could go into 2.8 with no problems. It is the equivalent of the "bring per-view layer collection visibility" with keeping eyes as they were.

I know I'm not technically a reviewer for this patch, but I tested it anyway.

This patch is a definite improvement I think. The properly working visibility toggles for collections is a huge plus, and the simplification of the Outliner toggles is nicer and more straight forward.

This should make the Outliner and collections vastly easier to use.

This revision is now accepted and ready to land.Dec 7 2018, 4:10 PM
  • Ctrl+Click was used to isolate objects, we should keep that functionality.
  • Ideally there should also still be a way to say, "hide the objects in this collection everywhere". Right click > select all objects > H still works. But artists were using this a lot to make sure some objects are hidden, even if they are in multiple collections.

I'm not sure what the right shortcuts are for these features, or if the latter needs one at

  • We need a different icon than the screen one I think.
  • "Ctrl to hide for all viewports": would use "disable" instead of "hide" there?
  • Drag toggle to quickly drag and toggle multiple icons no longer works.
  • Toggling visibility on collections used to be fast, now it's slow? Is this doing a depsgraph update?
Brecht Van Lommel (brecht) requested changes to this revision.Dec 7 2018, 6:23 PM
This revision now requires changes to proceed.Dec 7 2018, 6:23 PM
  • Ctrl+Click was used to isolate objects, we should keep that functionality.
  • Ideally there should also still be a way to say, "hide the objects in this collection everywhere". Right click > select all objects > H still works. But artists were using this a lot to make sure some objects are hidden, even if they are in multiple collections.

Yes, I also talked to Dalai about this. There could indeed be an operator available in the right-click menu to do that.

  • We need a different icon than the screen one I think.

Yes, we could use the eye but with a strikethrough perhaps?

  • "Ctrl to hide for all viewports": would use "disable" instead of "hide" there?

Yes I think so too.

  • Drag toggle to quickly drag and toggle multiple icons no longer works.

Good catch. That is a nice feature to make sure keeps working.

Merge with latest blender2.8, no functional change

Toggling visibility on collections used to be fast, now it's slow? Is this doing a depsgraph update?

That's something I talked to @Sergey Sharybin (sergey). His take was that it would be "strange" to have disable collection and objects in the depsgraph.

So yes I'm tagging relations to update. I suppose we could treat those disabled collection/objects as some temporary state, similar to local view, where we still want them to affect the rest of the scene (e.g., collision bodies for simulation), yet are simply not drawn in the viewport.

@Dalai Felinto (dfelinto) I finally tried it out myself and I think it's great so far and I agree with all the feedback of @William Reynish (billreynish) and @Brecht Van Lommel (brecht) I do agree that the isolating with Ctrl clicking is still very useful and hiding all the components like it currently works should also be easily accessible to the user.
Perhaps we can assign shortcuts this way:

Ctrl + Click = Isolate (Hide only) -> Hide everything except the object when used on the an object eye icon OR hide everything except the the contents of the collection when used on a collection eye icon, The contents of the collection keep their current visibility settings. The item with the clicked eye icon always becomes shown.

Alt + Click = Disable Visibility

Shift + Click = Hide/Show item + all contents.

Holding Shift could then also be combined with the other two to affect the contents as well:

Ctrl + Shift + Click = Isolate (Show & Hide) = Same as Ctrl + Click except that all contents of a clicked collection will be set to be shown as well.

Alt + Shift + Click = Disable Visibility + All contents

These functions and combinations could also be accessed in the right click menu. This would also explain the shortcuts for them.
Maybe the combinations with Shift are a bit too much since they could make it too complicated but I can see it being useful, especially with the 2 kinds of isolating.

That's something I talked to @Sergey Sharybin (sergey). His take was that it would be "strange" to have disable collection and objects in the depsgraph.

So yes I'm tagging relations to update. I suppose we could treat those disabled collection/objects as some temporary state, similar to local view, where we still want them to affect the rest of the scene (e.g., collision bodies for simulation), yet are simply not drawn in the viewport.

I think that is what we should do, for consistency with objects which have the same hide/disable distinction.

Ideally the depsgraph would not be so slow at doing relation updates, but for usability now it's nice to be able to quickly toggle collection hiding on more complex files.

  • Merge remote-tracking branch 'origin/master' into temp-outliner-visibility

Shift + Click = Hide/Show item + all contents.

Why bother with that? When clicking in a collection its objects won't be visible unless they are also in another collection. Is that the case you want to cover?

Shift + Click = Hide/Show item + all contents.

Why bother with that? When clicking in a collection its objects won't be visible unless they are also in another collection. Is that the case you want to cover?

Yes exactly. The current behaviour is very useful that clicking the eye icon is hiding all contents in all linked collections. But if clicking the icon instead hides only the collection itself (similar to screen icon currently) there should still be an alternative way of hiding all contents as well that is just as fast.

  • From review: hide > disable
  • From review: Alt + Click to disable visibility
  • From review: Ctrl + Click to isolate collection
  • From review: Shift + Click to change visibility hierarchily

Seems nice overall. I noticed a few small issues right away:

  • We should re-order the toggles, so the visibility toggles are next to each other, rather than being on either side of the selectability toggle
  • We need a new icon for the viewport disabled state (probably eye with line through it)
  • Alt-click doesn't work with Emulate 3 Button Mouse, which lots of people use. Se we should fine another key for it - or at least provide another way to do it. (We could start by adding it to the right-click menu)
  • From review: Outliner order - select, viewport, render
  • From review: Enable drag & drop
  • From review: Do not rebuild depsgraph (wip)

I still need to test the depsgraph change to be sure:

  1. It is not rebuilding on visibility change.
  2. It is rebuilding when disabling/enabling collections.
  3. It is setting the correct visibility of objects.
  • More adjustments to not rebuild depsgraph

Right now we only remove bases that are disabled.

We control the base visibility in two places:

  • BKE_layer_collection_sync() and BKE_layer_eval_view_layer().

What I tried to do was to make this separation even more strict, by respecting the
BASE_VISIBLE flag set in _sync() when evaluating the view layer.

  • Fix OBJECT_OT_hide_collection update
  • All the operators also in the collection context menu.
Brecht Van Lommel (brecht) requested changes to this revision.Feb 5 2019, 7:35 PM

Generally looks fine.

For the naming in the outliner Visibility menu and associated operators, personally would prefer something like this:

Isolate
Show
Hide
-----
Show Hierarchy
Hide Hierarchy
---- 
Enable in Viewports
Disable in Viewports
----
Enable in Render
Disable in Render

Although "All Inside" is maybe more clear than "Hierarchy" (the term used in other places)? What's confusing to me is that the object itself is also hidden, not just the ones inside.

I prefer to use Enable/Disable for both Viewports and Render to indicate they behave in similar ways, distinct from Show/Hide.

source/blender/editors/space_outliner/outliner_intern.h
130 ↗(On Diff #13475)

Change to OL_TOG_RESTRICT_SELECTX to avoid overlapping object names and icons.

This revision now requires changes to proceed.Feb 5 2019, 7:35 PM
  • From review: Fix restrict column width
  • From review: Rename Outliner operators

Addressed all but the "All Inside". @William Reynish (billreynish) was the one proposing the original names. Feel free to speak up WIlliam.

source/blender/editors/space_outliner/outliner_intern.h
130 ↗(On Diff #13475)

Good catch. Problem was introduced when I swapped the order of the columns.

I've committed a fix that will make drag lock on the visibility icon work when this is committed.

source/blender/editors/space_outliner/outliner_collections.c
898 ↗(On Diff #13475)

All these operations work with the active collection. But I think they should affect all selected collections similar to the View Layer operators?

See collection_view_layer_exec for how to loop over selected collections.

Besides better tooltips and working on selected items, this looks good to me now. Those can be committed in a second step too, I don't want to block this longer.

source/blender/editors/space_outliner/outliner_draw.c
702 ↗(On Diff #13516)

Would be nice to mention ctrl and shift behavior as well. You can use \n line breaks in the tooltip to keep it readable.

This revision is now accepted and ready to land.Feb 5 2019, 8:29 PM
  • From review: tooltip
  • Tweaks for drag lock after recent commit in master
  • From review: Outliner operators to affect all selected collections
This revision was automatically updated to reflect the committed changes.

@Dalai Felinto (dfelinto) I tried it out and it works just as expected except for that Ctrl clicking does only work for collections and not objects. Is this intentional since it's also not mentioned in the tooltip for objects?

EDIT: The Tooltip for collections also says: "Alt to disable for all viewports".
Shouldn't it say "view layers" instead of viewports? Hiding & Unhiding is still no per viewport settings after all.

  • Note to self: I believe I'm changing the master collection visibility flags when isolating a collection, leading to subsequent collections to be created hidden.

@Dalai Felinto (dfelinto) I tried it out and it works just as expected except for that Ctrl clicking does only work for collections and not objects. Is this intentional since it's also not mentioned in the tooltip for objects?

Correct, I implemented this for collections only. I suppose I could also do it for objects, do you think it would be good to have?

EDIT: The Tooltip for collections also says: "Alt to disable for all viewports".
Shouldn't it say "view layers" instead of viewports? Hiding & Unhiding is still no per viewport settings after all.

Not really since it affects only the viewport drawing but not the render of the collection.

@Dalai Felinto (dfelinto) More feedback from using it a couple of hours:

  • When click & dragging the eye icons in the outliner it is way to easy to accidentally drag over an object that is disabled for viewport visibility and change it. This can happen quite often by accident when users actually want to keep the visibility locked.

It's probably best if the viewport-disabled state can only be changed by Alt clicking or Alt click & dragging over those objects.

  • When using Shift click on a collection it will hide/show all contents within but this means it will also do this to all viewport-disabled items. This makes the Shift click functionality basically useless since the user would never want to accidentally change all the viewport-disabled objects within.

Here as well: Maybe it would be best to only affect the viewport-disabled objects with Alt clicking.

  • Note to self: I believe I'm changing the master collection visibility flags when isolating a collection, leading to subsequent collections to be created hidden.

@Dalai Felinto (dfelinto) I tried it out and it works just as expected except for that Ctrl clicking does only work for collections and not objects. Is this intentional since it's also not mentioned in the tooltip for objects?

Correct, I implemented this for collections only. I suppose I could also do it for objects, do you think it would be good to have?

I think it would be good to have the Ctrl click functionality per objects as well. I use(d) it quite often actually. Important here would be that it doesn't change the viewport-disabled state throughout the outliner.
It should act similarly to using Shift + H in the viewport in my opinion.

EDIT: The Tooltip for collections also says: "Alt to disable for all viewports".
Shouldn't it say "view layers" instead of viewports? Hiding & Unhiding is still no per viewport settings after all.

Not really since it affects only the viewport drawing but not the render of the collection.

I get that. Maybe it should say then "Alt to disable viewport visibility for all view layers". Since view layers are not just used for rendering but also isolating portions of the file you currently want to work on in the viewport, saying view layers still makes sense to me and is a more accurate description.

More feedback from the rest of the Spring team:

  • Right now it's possible to change the viewport-disable icon when an object/collection is linked. I guess this should be locked just like the render visibility icon and selectability icon. At least after reloading the file the icon get reset back to the same state like from where it is linked from.

There are also some concerns about readability of what is hidden and why/how but that might be more related to themes & icons.
We'll keep using the current changes and give more feedback whenever something strikes us as very odd/wrong or broken :)

@Julien Kaspar (JulienKaspar) implemented some of it on rB766741b0aa8.

Notice that I'm still ignoring the disable state of a collection when you are directly trying to isolate it, same for its parents.
All other cases it is not touching it. See if that works for you.

Still missing:

  • Isolate functionality per object.
  • Lock disable/enable for linked objects/collections.
  • Tooltip for alt click (if you with @William Reynish (billreynish) could agree on a new text, just poke me and I update).

@Dalai Felinto (dfelinto) The shift click seems to still not work correctly. It works when Shift clicking to hide but when Shift clicking to show it changes the screen icon to an eye without actually changing the disabled state.
If the file gets saved afterwards and reverted/reloaded the disabled state is completely gone ...

@Julien Kaspar (JulienKaspar) shift+click was indeed still changing disable state of inside objects. Fixed now (rBdb231e87fc84).

More feedback notes:

  • When Ctrl clicking a collection, it will unhide all other collections but any objects that are in the scene root will remain shown. They should also be hidden (unless they are also part of the clicked on collection of course) to get the intended result.
  • When Hiding collections and pressing Alt + H in the 3D view it will not affect the visibility of collections and only objects instead. Currently the only way to unhide collections is to click the eye icons. There is no way of unhiding everything like Alt + H is supposed to do.

@William Reynish (billreynish) @Dalai Felinto (dfelinto)
There is also a bigger issue that is larger than what this task is for but it became more obvious with these recent changes:
After almost a year of working with 2.8 there is still some confusion and very different viewpoints on how the visibility settings should be used. There is a general need to have one temporary and easily revertible visibility setting and one more rigid locked way of settings something to be hidden/shown. before 2.8 this was the eye icon and the layers.
In 2.8 we now have 3 (or 4): The eye (show/hide), the screen (disabling), excluding (and view layers).

The animators generally used the screen icon exclusively since it optimised the framerate more than the eye and because it was a column that was always present and easy to access. It's a slow workflow but reliable.
They never used view layers and excluding ... ever. This is especially the case since it is more of a hidden feature with little indication in the outliner items or the interface.

For the lighters the screen icon is often used carefully since it affects visibility when linked. The eye icon is instead used much more commonly for viewport visibility while working on a set, asset or lighting file.
Excluding is recommended only to be used for render setups and very rarely for the viewport while working on something.

I personally used the screen icon rarely for the same reason as the lighers. I instead tried setting up view layers and used excluding for seeing different parts of the scene. It always takes a bit more time to change and set up but I thought this was the intended way to use them and the closest way to working with the old layers.

I think it's a bit problematic that the workflow of a lot of people at the studio ended up very different and divided and that there's no clear agreement on how to use the features in their current state.
There is and was a lot of confusion and frustration and it was probably never really communicated how to use the new features properly. Everyone just kinda settled with the most "good enough" workflow.
And it's hard to simplify the outliner and make it less confusing when everyone has a different way of using it :/

What do you think?

  • When Ctrl clicking a collection, it will unhide all other collections but any objects that are in the scene root will remain shown.

For me Ctrl clicking in a collection is working as expected. The behaviour you expect will come once we implement ctrl+click in objects.
Objects in the scene root are urging to be moved to a sub-collection eventually by the user. Until them they are treated as this "collection-less-playing-by-their-own-rules" objects.

  • When Hiding collections and pressing Alt + H in the 3D view it will not affect the visibility of collections and only objects instead.

Also intended, though I can see your frustration. That comes from we exposing visibility settings per objects. A solution for this would be to bring back the "Show all l̶a̶y̶e̶r̶ collections" again (the old ` shortcut). Any suggestion for shortcuts?

There is also a bigger issue that is larger than what this task (...).

Can we create a new design task for this? I know this is related to the patch, but the design discussion here is getting a bit out of hand. That said I love your feedback.

I think what will solve the problem, is if we re-introduce per-viewport 'unlinked' collection visibility.

In the Collections popover in the 3D View, there could be a checkbox called 'Local Visibility'. If enabled, the collections set there will only affect this viewport. We had this in 2.79 with the 'unlink layers' toggle.

This also makes it so you can see different things in different viewports, which is an important feature to support anyway. Very useful for, say, modelling a tree in viewport 1 and seeing the whole forest in viewport 2.

So I think we need to add this feature back anyway - and it really gives the Collection Visibility popover a real reason to exist.

@Dalai Felinto (dfelinto)

Can we create a new design task for this? I know this is related to the patch, but the design discussion here is getting a bit out of hand.

I agree. @William Reynish (billreynish) can we create another task or tasks about this issue for more discussion?

But just to give a reply to your idea to bring the "per-viewport 'unlinked' collection visibility" back ... god that's a mouthful :D
I think that feature would in itself not solve the problem, then you would have just 2 independent viewports, both with the same problem.
But about bringing that feature back: In my opinion the best way is to be able to specify which viewport is supposed to use which view layer (If that is even possible with the dependency graph)
Managing the exclusion and eye icons is already per view layer so this makes sense. To make changes and management of visibility more accessible the user would need to be able to access all view layers from the outliner similar to how all render layers were accessible in the Properties and all viewport layers in the 3D View in 2.7x.
This could be done by showing the Hierarchy in the outliner with view layers as well ( Scene Collection -> View Layer - > Collection -> Object )
This is a big suggestion and topic and should be continued in another task of course ;)

For me Ctrl clicking in a collection is working as expected. The behaviour you expect will come once we implement ctrl+click in objects.
Objects in the scene root are urging to be moved to a sub-collection eventually by the user. Until them they are treated as this "collection-less-playing-by-their-own-rules" objects.

Fair enough.

Also intended, though I can see your frustration. That comes from we exposing visibility settings per objects. A solution for this would be to bring back the "Show all l̶a̶y̶e̶r̶ collections" again (the old ` shortcut). Any suggestion for shortcuts?

A workaround currently is to Ctrl click the top most collections but a shortcut would probably be best. Don't know which one through. Perhaps Ctrl + H?
Well it's currently occupied by a popup menu though. But I can confidently say that literally no ever used or would ever use it.

I need to think of this more and try out some things in practice. I'll probably give more feedback tomorrow :)

More feedback:

  • When hiding a collection with the eye icon it does not hide the collection wherever it is also linked in the outliner. But when linked it should get hidden as well. We don't need the eye icon to act exactly like excluding does when it comes to hiding linked collections.
  • When hiding and unhiding objects in the outliner they will remember if they were selected. But when hiding collections it will unselect all objects within. They should still remember if they were selected to make it consistent.

But to be honest: The more I use the new eye toggle behaviour, the more I think it should be reverted to how it worked before the change. It's too complicated to use right now.
It's supposed to be the quick & simple visibility toggle but now it's much slower and hard to grasp how to unhide/hide things.

In practice the old eye toggle behaviour was far more comfortable. It was fast, easy to use and didn't require additional shortcuts to be usable like this:

  • When toggling the eye on a collection it toggles the eye of the contents as well & wherever they are linked to in the outliner
  • When everything in a collection is hidden, the collection eye icon is automatically tuned off
  • When at least one object is shown in a collection it will toggle the collection eye icon automatically on

What do you think about the old eye toggle behaviour @Dalai Felinto (dfelinto) ?