UI: Replace list of workspace add-ons with a UIList #112684
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112684
Loading…
Reference in New Issue
No description provided.
Delete Branch "guishe/blender:workspace-addons"
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?
Resolves #111272
I kept using operator to activate and deactivate the add-ons within the UILits, but they do not align well
What if you put them on the right like in my mockup?
Thanks for working on this!
Done, although now it can only be activated and deactivated with the checkbox
I also attach tests of what it looks if there are unknown add-ons
Not sure I understand, what's an "unknown add-on"? All add-ons should be available at all times just disabled from that particular editor.
Is a list of add-ons that are supposed to be active in the workspace but are disabled or removed from preferences. This list already exists
Interesting, that's for another patch then.
The only thing left I'd change is to not force the rows to be 10, that's way too tall for a list that can be resized and filtered anyway. Maybe
8
for the regular add-ons and4
for unknown would be enough?3f0198ef45
to1b50d55bc9
I changed it to 8.
I update the patch, before I used a temporary property collection to store the add-ons lists, but it didn't convince me too much doing that way
Thanks! I can't review the code, @ideasman42 could you (or poke someone who could) please have a look at the code for this? IIRC you worked on the first implementation back in 2.8.
The end result is something we want (scrollable list similar to other UILists) but it seems the code is more involved.
Generally seems fine, requesting minor changes.
@ -81,0 +68,4 @@
"addons",
context.workspace,
"active_addon",
rows=8)
*picky* use
,
& newline for trailing parenthesis.@ -96,0 +93,4 @@
class WORKSPACE_UL_addons_items(bpy.types.UIList):
@classmethod
def filter_addons_by_category_name(cls, pattern, bitflag, addons, reverse=False):
Can be a static method using a
_
prefix as it's for internal use only.@ -96,0 +106,4 @@
return []
# Implicitly add heading/trailing wildcards.
pattern = "*" + pattern + "*"
Compile the pattern for faster evaluation, since it doesn't need to compile the expression for every match.
Noticed Blender's UI logic also did this, updated:
b177f27e6f
I added
re.IGNORECASE
tore.compile(...,re.IGNORECASE)
, most UIList are case-insensitive and without that feels wrong@ -96,0 +112,4 @@
for i, addon in enumerate(addons):
name = addon_category_name(addon)
# This is similar to a logical xor
End sentences with a full-stop.
@ -96,0 +113,4 @@
for i, addon in enumerate(addons):
name = addon_category_name(addon)
# This is similar to a logical xor
if bool(name and fnmatch.fnmatch(name, pattern)) is not bool(reverse):
no need for
bool(reverse)
, can bereverse
.@ -96,0 +118,4 @@
return flags
@classmethod
def sort_addons_by_category_name(cls, addons):
_
prefix.cls
isn't used this can be astaticmethod
.@ -96,0 +122,4 @@
"""
Re-order addons using their categories and names (case-insensitive).
return a list mapping org_idx -> new_idx,
or an empty list if no sorting has been done.
odd indentation, can be wrapped onto the previous line.
Would the latest changes make this patch ready to go?
@guishe if so, could you please update this against the latest
main
? Thanks!