UI: Outliner "File Mode" Manage User Count #118691
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118691
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:OutlinerUserCount"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In Outliner "Blender File Mode" view, show user counts, and allow
removing and adding fake user, requested in #118655.
While in Outliner "Blender File Mode" this PR shows user counts and fake user status. The count shows the total number of users, so including fake_user if set. You can click on the shield icon to add or remove fake_user.
In the following, "Cone" has no users and no "fake user" protection. It will be removed if this status is not changed.
"Cube" has one real user and is not protected from deletion (no fake user). "Icosphere" has no real users but is protected from deletion by a fake_user. "Suzanne" has a real user and also has deletion protection. Torus has five real users and no deletion protection. Objects show a user count but not a shield button.
Tooltip hints
This PR avoids the use of the "fake user" term in favor of describing this as a "protection from deletion."
Hovering over the user count just says "Number of users."
Note this PR also changes the "Unused Data" mode similarly:
UI Demonstration: Outliner "File Mode" Manage User Countto UI: Outliner "File Mode" Manage User CountIt's not obvious that clicking the trash or users icon will mark the datablock as protected. You might rather expect that clicking the trash icon will delete the datablock.
I updated this PR so it is back to the empty shield, but does show "0" in this case, to see if this seems any more obvious.
This PR currently allows adding and removing fake user from items that don't have any real users. Is there something that could happen to items with real single or multiple users?
I did try playing with the idea of allowing the reduction of the user count to zero for items that have a single real user. That was interesting. Mark your only camera for removal, save and load and it is gone. On load there is a warning to console that something was unexpectedly not found but otherwise it worked fine.
@brecht
Of course if this continue to look not right, or if we do need to add "fake user" to items that already have real users, I can do this in two columns.
Having one user always marked with shield is misleading. Most of the users in file have one user but aren't protected with fake user. This will lead to impression that removing that user is fine because its protected with fake user. There needs to be shield icon if single user is fake user and regular icon if its regular user.
Fake user is unrelated functionality and doesn't have anything to do with user count. I might have 7 users but still want to protect it as fake user, just in case, to protect it in upcoming recursive Purge for example. Not having ability to mark that is also not good. Funcinality-wise I think we're losing one by combining two concepts together.
That is what this PR does. There might be some captures that are incorrect though so I will update this to make it more clear.
Makes sense and I have updated this PR to allow that. Will update the captures to illustrate this.
This looks really good. An important idea (though likely controversial) is that the concept of "Fake User" really needs to go away in favor of better naming. This is a very "programmer-centric" way of looking at things, whereas most users will never align to such terminology. As Blender has been continuing to improve its UI paradigms, the "fake user" naming is certainly one that I would suggest needs to die a recent death.
I see what you did. Really perfect thanks for clarifying.
With Blend File mode acquiring this functionality I would say "Orphaned Data" mode of outliner doesn't really need to exist anymore. Blend File mode can have filtering option "Only Orphaned" and it will be exactly the same, but probably much less code and maintenance.
It's more elegant to have a single column and looks nice.
Adding protection still feels rather hidden to me when there are users, it's not obvious that it's possible even with a tooltip. Also wondering if the users icon is appropriate, as it's the same word but not quite the same meaning.
My preference would be to just have an empty shield instead of the users icon, but this could use some feedback from others in the UI team.
@ -1826,0 +1858,4 @@
if (id->flag & LIB_FAKEUSER) {
icon = ICON_FAKE_USER_ON;
tip = ID_IS_LINKED(id) ? TIP_("Item is protected from deletion") :
TIP_("Click to remove deletion protection");
deletion protection -> protection from deletion?
For consistency with "Click to add" tooltip.
I would not bother changing this, it's not really the same and I doubt it saves much code or maintenance.
We should rename "Orphan Data" to "Unused Data" now though, to go along with File > Cleanup changes.
That doesn't sound like enough differentiation between the most important state and less important states. Having 0 users (with removal imminent) would look almost the same as 4 users without fake_user, except for the small number. Unless I am not quite clear on what is important for users to to see here.
For me it helps explain the column a bit better. The metaphor kinda works...
Not sure how to phrase this. Is the ownership of items here always a single group of things? For example could we always show an icon for "mesh object" for mesh items? Scene icon for lights (sorry, not sure who owns lights). So instead of showing the users as anonymous people we use icons that represent type of object that uses them?
The problems I see with this PR as it is now:
There is a missing connection between user count and the column. I like that "fake user" is not used. But I am missing the explanation of what the "3" or "0" represents. That could go away if I could think of how to incorporate that into the tooltips, but no luck so far.
I find the state of having 0 users without fake user to not be represented strongly enough. It does have some visual contrast in that it changes from bright and filled to empty, but it doesn't seem to indicate a state of imminent removal. But not sure how strong users would want this to be. The shield could be filled with red, and or an "X" in it. The state could instead use a the warning icon and be yellow?
@Harley in the current proposal would I still be able to click (or drag even) on the shield to set/unset fake user?
It’s also not clear to me (looking at the UI) when would I see the shield and when not. Is it shield whenever there is fake user, and there user icon otherwise (unless there are no users and then you show the empty shield?)?
I find strange to see the number by the shield since we are not really counting the number of shields.
As for some of the original motivation to use the number by the data block icons, this is what we do elsewhere already in the ID templates.
Yes, you can click on any item in the column to set/unset fake user. But dragging does not (yet) work.
It shows an empty shield and zero users for items in danger of deletion. It shows a shield with checkmark if fake user is set. Otherwise shows the users icon. This way you can differentiate between an item that has a single user that is real versus one that is fake. And you can add fake user to items with multiple users to ensure they stick around.
There is definitely a missing connection here explaining that the numbers are all user counts.
In your mockup, the following shows three items. The first is without users, but the other two I can't guess. I'm assuming that the second item has 2 real users and fake user? And the third item has only a fake user? Or are you showing only the count of real users?
But the big problem arises when you collapse this group:
Now the "3" here means number of items in the list, not number of users. With a mixture of open and closed sections this would get even weirder.
@dfelinto @brecht
I updated this patch to incorporate an idea we hatched in our meeting today.
It does make the column more visually and logically consistent, showing only shields. We can still differentiate between an item with one fake user versus one real user. The state of imminent deletion is shown in a more alarming way.
It also separates the "fake user" from real users, so easier to consider it a separate "deletion protection" mechanism. And also easier to remove it.
But how does it "read" to you?
The "Shield" icon with a number will not work for objects, because objects do not have a fake_user.
I propose add two icons "Shield" and "Users":
Then you can use only "Users" icon for objects, without a "Shield" icon:
When using two icons, you can add actions to them.
I would expect the number to be red instead of the shield? But the idea seems fine to me.
I think objects don't show user counts in the user interface in general, so they could also not show either fake user or the user count here. But it can be useful to see it, so showing it with a different icon seems fine.
For showing the users, if we put that in a tooltip we don't need distinct icons. But a tooltip does have limited space, and no interactivity in case we want to add a way to remove the user from there. But such editing functionality could also be in a context menu.
I updated the PR so we could to either or both, now showing both red.
This PR is now showing objects with that "users" icon, disabled, showing count. No idea if it helps or confuses.
The number with the shield is confusing.
It looks like the number of shields, not the number of users.
I updated this PR to show the list of users on the tooltip, up to a maximum of 100.
It doesn't do so for objects, only because I wasn't sure how to get an object with multiple users.
Link Objects to Scene
(Ctrl + L) in3D Viewport
or Drag and Drop Object (LMB + Ctrl) inOutliner
:Then you got an object with multiple users:
Being able to inspect users somewhere in the UI is very helpful (dont know how many times I have been using
bpy.data.user_map
in debugging/triaging).@brecht : is removing [individual] users something we would really want to support? I mean we do have
.user_clear()
but that already runs into undefined territory (e.g. removing object users from meshes will make the objects to empties and spit out something likeX local ObjectData and X local Object proxies are reported to be missing, this should never happen
)I would just do the number. To me the shield being red indicates there is something notable about it being off, whereas most of the time that's just fine.
That's already helpful. I think ideally there would be more information per user, which type of datablock it is. An maybe even showing the RNA path to it, or the name of the last struct in the RNA path. For that we'd need to put each user on its own line.
That's probably beyond this pull request though.
I'm not sure how useful it is. It's certainly beyond the scope of this pull request, though does affect the design choices here. I guess we can not worry about it for now, since it's not obviously so useful.
done.
I am apparently too dumb to figure out how to even get the users of objects, or users of materials, etc. I did try using
BKE_library_foreach_ID_link
before realizing that was getting IDs I am linked to, not IDs that link to me.I’ll assume the screenshots are up to date for my feedback.
I find very strange that we see the icon use when there is one user (and no fake user? Or with fake user? I don’t even know). While seeing the shield in every other case.
I still think we should not mix the numbers and the shield, we are not counting the number of shields, that’s confusing for the sake of information density.
My proposal would still be to use the counter on the corner of the data block icons. Even if it could potentially mislead you when the tab is collapsed.
Other than that, if this option is really non desirable, I would add two columns, one for the user count, and one for the shield.
Now I wish this conversation could be had on top of the mockup, not as part of code/PR. I feel that we would have had a quicker turn around and wouldn’t need to wait a whole week for something which was supposed to be simple.
Overall I think before bringing a new idea up it would have been more efficient to first see if the original design would stand. And if not, to give a chance for the original design to be rethought, as opposed to have the design hijacked and the discussion shifted like this.
@dfelinto shield icon is always shown on 1 user 0 or multiple. Only excrption is Object which cant have fake user and cant be shielded.
Number on data block icon for me feels line how many of those I have. Not how many users that one has. Thats very distinct. If shield icon is on right user count needs to be there as well so that things that are associated with users are coupled
Some thoughts while talking with Harley:
So I think we could first mimic what we do for orphan data. Then if we want to improve how we show users, we do to both.
f95439070e
to2c48fbd6c6
@brecht
Chatted with Dalai and decided we should just do it simply and use the same style of display as we currently use for "Unused Data" mode. Here I just use the same code for both, with changes, so the two views use consistent tooltips. I updated the capture and the information in the first comment.
The only thing I'm not sure about is what to do with Objects. This PR is just not showing either the user count nor fake_user shield for these since you mentioned we don't normally allow setting/clearing fake user for these. But I could show user count without a shield, or grey-out shield, etc. I just don't know how important that information is.
It's a bit weird. They do have a user count. In fact we also allow setting fake user if you go to to the "Data API" view. But we don't consider this if you remove an object. So even if you add fake user in "Data API", deleting an object it just goes away.
Not sure. It looks like this then:
It isn't just that it is hard to tell the difference, but I'd have to explain to users why these shields can't be interacted with. With a tooltip I maybe show something like "Objects do not support deletion protection" or similar perhaps. But not sure I like showing something that is not applicable.
Use ICON_NONE instead?
Icon none is fine (better indeed). Why did you made their lines deactivate by the way? I think it is fine to draw their numbers fully white
Thanks!
Just me being lazy in getting those captures. The numbers will be fully white.
@dfelinto
I updated the capture in the first comment. I gave the image a bit more context so it shows more combinations of types and states.
The design issue mentions.
To me it makes sense to hide this by default, though I'm not sure how important it is.
UI: Outliner "File Mode" Manage User Countto WIP: UI: Outliner "File Mode" Manage User CountI’m a bit confused about the edits on Brecht’s reply. But anyways, I think it is ok to have it hidden by default
I'm assuming that I selected "Edit" on his comment rather than "Quote Reply", messed up his comment, then he fixed it. LOL
WIP: UI: Outliner "File Mode" Manage User Countto UI: Outliner "File Mode" Manage User CountDone.
@dfelinto - would I still be able to click (or drag even) on the shield to set/unset fake user?
Yes, dragging down multiple items in a row works as expected.
@blender-bot build
46cc6efb3b
to0d3a7aff5f
@JulianEisel @HooglyBoogly
As discussed in the UI Module this PR is updated to show user counts and fake user status in a single column. I have updated the captures and the text in the first comment.
The only part undiscussed in the meeting is that this shows the counts for Objects (this was asked for in this thread), but without a shield since we don't normally allow changing this. I was surprised that the combination works as well as it does, looks pretty nice.
Where is this coming from for objects in particular? It seems arbitrary to me to not show the shield for objects.
I'm only going by the following, from earlier in this thread:
"The "Shield" icon with a number will not work for objects, because objects do not have a fake_user" - Grigoriy Titaev
""I think objects don't show user counts in the user interface in general, so they could also not show either fake user or the user count here. But it can be useful to see it, so showing it with a different icon seems fine" - @brecht
Objects can have a fake user just like any other data-block.
I think consistency is more valuable here. I would just make all the data-block types look the same.
Just wanted to note that objects do show user count in UI
Users for objects are modifiers, constraints, and custom properties that reference the object with eyedropper.
@HooglyBoogly
I know I can add a fake user to objects by doing so in "Data Api" mode of the outliner. But it seems to not be considered. As in I add a "fake user" to a mesh object I can then just delete it and it seems to be removed immediately, leaving its mesh data in place with zero users
I did try using a disabled shield for objects, but the difference seemed a bit subtle. Although that is how linked data would look - disabled and inactive shield.
I think we should keep object fake user hidden from the UI. Technically it may be possible to set through the Python API or Data API, but that's more by accident than intentional.
Unlike other datablocks, objects are immediately deleted when they have no more users. Longer term, I think we should remove the fake user setting from a bunch more datablocks and delete them immediately (see #61209). I would rather not introduce fake user for objects now when we want to get rid of it.
I went looking at the notes:
I don't see any reference to that fact that this introduces an inconsistency on how we show the data in the Orphan Data view and here. What is the plan on that regard? As we talked, I would expect such a change to happen as a separate PR, not mingled with this one.
Also I thought we had already agreed on this, no? Also IIRC the idea was indeed to not show the shield for object (as also suggested by Brecht).
I still have some thoughts regarding that shield with the number, but I was hoping we could separate this from the functionality proposed here (since again, we already do this on the Orphan Data view).
What is the inconsistency exactly? There are screen captures in the first comment showing how these two views look with this PR applied and they look quite consistent to me AFAICT.
It isn't a mingling, but code sharing. This PR alters a section of code used by both views in order to keep them consistent and avoids code duplication.
This PR currently reflects the consensus view of the UI Module following a meeting on Tuesday, March 26 2024.
This PR does not do so.
That sounds interesting and I look forward to hearing your thoughts on that.
It mingles because now any discussion about how to represent the numbers differently get on the way of this functionality being merged with an already "tried-and-proofed' design.
I didn't see that this patch was also changing how we show the users for Orphan data, my bad.
I think this approach is trying to aim at a very dense amount of information to save space (the 2nd column). But failing (imho) to do so in a clear way.
But honestly I think I'm repeating myself here and I don't know if I have anything else to offer here since I haven't volunteered any design either. If the UI team wants to take ownership of this project, then please go ahead and change/commit to your heart content.
@JulianEisel @HooglyBoogly @pablovazquez
This PR is updated to reflect the consensus of the last UI meeting:
The captures in the first comment have been updated.
@blender-bot build
@ -30,6 +30,7 @@ struct IconFile {
struct IconTextOverlay {
char text[5];
uchar color[4] = {0};
I think the zero initialization here is unnecessary?
Weirdly it is. At least with my compiler...
uiBut initializes this like this:
And I would expect with C++17 that the above would recursively initialize all parts of this to zero. But instead I see the color value with initial 204 junk value instead. I have only managed to start off with zeros by initializing in the struct itself.
Good to know! No big deal, thanks for checking.
@ -1798,0 +1827,4 @@
}
else {
UI_but_func_set(bt, restrictbutton_id_user_toggle, id, nullptr);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
Could you add a comment about why
UI_BUT_DRAG_LOCK
is set here? I think it was discussed in the PR but I'm not sure myself here now.I'm not adding this flag here, it is also set here in existing code.
But I wasn't sure what it did to be honest until now. It does not enable you to drag down a column of items to set/unset them all at once easily - that is allowed regardless.
What this adds is it allows you to drag inaccurately once dragging starts. Without this flag you must stay within the bounds of the checkboxes, but with it you can veer off quite a bit and it will toggle them. Nice feature.
Will add a comment.
Numbers with shields and without shields look different.
This may be confusing, some users may think that different numbers (small and big) mean different things.
Maybe for a consistent look making the numbers without shield the same as the numbers with shields.
Small numbers in the lower right corner, with empty icons:
@blender-bot build
Blender 4.2.0 Alpha (2024-04-21)
The number and tooltip only change when the cursor moves outside the icon, not after clicking.
@gtitaev hi, can you make a report for that?
@PratikPB2123, done: #120913