Cleanup: UI: Icons shuffling around #127197
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127197
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "dfelinto/blender:icons-shuffle"
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?
No functional changes.
The comments in the file are used as categories by some of our ICON reading tools.
I split this PR in a few commits, so the alphabetical sorting doesn't add unecessary noise into the main change.
@blender-bot build
Cleanup: UI: Icons shuffling aroundto WIP: Cleanup: UI: Icons shuffling aroundFor some mysterious reason, the order shuffling commit messes up with the record-on icon coloring, and adds an extra space there:
I'm investigating it, worst case I will skip the alphabetical sorting.
e4c3cd7fd4
tocceb194b4e
I'm not finding any issues with this new version with NONE first.
Did you end up being able to put that "record_on" where you wanted it to go? If not I can investigate why. AFAIK everything between ICON_NONE and LAST_SVG_ITEM should be able to move around like this as long as the toggle pairs are kept together.
This removes the cryptic comment "/* XXX fix this up */". Do you know what that was about?
WIP: Cleanup: UI: Icons shuffling aroundto Cleanup: UI: Icons shuffling aroundHi @Harley thanks for taking a look. I have no idea about the cryptic comment, but I assumed it will never be tackled, so this is a good moment to clean this up.
I just updated the patch and got everything working. The issue with NONE is that NONE has to be the first item apparently. It is documented now at least.
Will load this up again in a sec, but I think this reverses the order of ICON_LOCK and ICON_UNLOCK. This could be done but would require code changes as well. Our toggles take the icon index of one and then there also a value indicating whether the other is before or after. And then we have a flag that reverses it.
Probably best to keep the same order and then another job could be to reorder those in some consistent order like OFF then ON. Yikes some could really use some renaming too, like that CHECKBOX_DEHLT and HLT
This did not intend to change the order of any of the toggle icons which are currently being used as a toggle. Not sure how this affects add-ons ... I wonder if more icons would need to be moved to the toggle section.
One thing we could do if you are okay with it is to get the first two commits in first, and then we look over the alphabetical sorting later. Feel free to cherry-pick them into main if you want.
This is the only pair that is reversed as far as I can see. In the majority of the cases of toggles we actually set both of them in a ternary, which makes no difference. And add-ons too always use enums, so not worried about them. It only becomes a problem when we do things like this:
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
where the `1" means the next icon is +1 away.There might be some but not sure if you want them with the others. Fake_user_off/on, holdout_off/on, modifier_off/on, restrict_color_off/on, restrict_instanced_off/on, line_numbers_off/on, syntax_off/on, wordwrap_off/on, mute_ipo_off/on, solo_off/on. But I can see the utility in having some or all of these within a different category.
I'm pretty sure that we had one or two pairs there were separated from each other (because there was no suitable space on the old sheet), but can't see them right now.
Yes, I'll probably do a bit more checking and then will update this PR
I had to redo this from scratch because I couldn't figure out at what point it failed. We definitely have some code somewhere that is depending on one of these icons or, more likely, depending on the relative space between multiples. I'll eventually figure it out.
@blender-bot package
Package build started. Download here when ready.
Hi Harley, thanks for looking into that.
I see that you did a few too many changes ... it would be easier if you had started off from the 2nd commit instead. Some of the changes I made with Pablo on the first two commits were completely lost now.
I'm about to update this patch with:
That said, one thing I didn't understand from your changes is why did you move the following to the "TOGGLE" category?
DEF_ICON(UNLINKED)
DEF_ICON(LINKED)
DEF_ICON(MODIFIER_OFF)
DEF_ICON(MODIFIER_ON)
DEF_ICON(RESTRICT_COLOR_OFF)
DEF_ICON(RESTRICT_COLOR_ON)
DEF_ICON(RESTRICT_INSTANCED_OFF)
DEF_ICON(RESTRICT_INSTANCED_ON)
None of them seem to be used by any RNA_def_property_ui_icon ... with consecutive being 1/true/-1.
I would suggest we move them back to their respective category.
I will do this as a separate commit, so we can still roll-back this easily.
The other change I'm bringing back is to make sure the category is a single comment before the values, leaving any further explanation as a separate comment. It makes much easier for the scripts to parse the categories this way.
I noticed that DECORATE_UNLOCKED/DECORATE_LOCKED also needs to be treat as a toggle because of code like:
row.prop(pchan, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED')
.This preserves the toggability of the prop, but use a different reference icon :/ Man this code ... I start regretting touching it :)
4fc17a0917
to4ec91724ba
@Harley I moved the commits (with your changes) to dfelinto/blender:icons-shuffle-backup.
And did a cleanup (not including the toggles which I believe are not needed - see my comment earlier). So there are now only two commits here. I will ask for Julian to take a look, if he is ok with it I go ahead and commit, otherwise we talk later.
We can always revert/tweak things after they are in main.
@blender-bot package
Package build started. Download here when ready.
Seems fine in general. This is changing icon values for scripts, but I'd hope that scripts don't use the raw values instead of the proper identifiers.
Reading the comments, I don't understand the current state, are there issues remaining or not?
@JulianEisel no issues as far as I'm concerned.
The current approach is moving less icons to the TOGGLE category than what Harley was suggesting. But I don't see the point/need of doing that.
So my suggestion is to commit the patch as it is, and eventually do the extra change if needed,
@dfelinto @pablovazquez @JulianEisel
For the same reason. Any of those pairs could be used like that in the future and then a subsequent sorting could break them.
Yes, sorry about that. I was (unsuccessfully) chasing a weird error. I'd like to explain it here just in case we see it again later...
The UI_icons.hh file as I first found it here had the order of ICON_LOCKED and ICON_UNLOCKED reversed. That seemed like a small problem and I just put them back in the original order. But that didn't fix it and it was very odd...
My test for this was the "transform lock" icons in the View3D sidebar. I had assumed the original issue was just that the icon pair was going in the wrong direction but that wasn't it. It was toggling between ICON_LOCKED and DECORATE_UNLOCKED, which at the time were very far away from each other while this RNA_def_property_ui_icon "iconadd" stuff should only work for immediate neighbors.
I started from scratch and made similar changes, sorted sections, and it broke in a similar way. Usually the result was this odd locked/decorate_unlocked and sometimes it would be locked/fund. About the only thing I knew before my night ended (each test iteration took a while) was that it was some portion of the sorting, but not which section. We probably have some code somewhere that is assuming a relationship between subsequent icons for some reason and perhaps getting weird if the difference is negative.
Anyway, the list as it is now in main does not show this problem.