Name filtering for Asset Shelf assets #107784

Closed
opened 2023-05-09 15:47:06 +02:00 by Dalai Felinto · 2 comments

We need to have a way for animators to filter the assets based on the name, similar to how it was possible in the current/old Pose Library panel.

We need to have a way for animators to filter the assets based on the name, similar to how it was possible in the current/old Pose Library panel.
Dalai Felinto added the
Type
To Do
label 2023-05-09 15:47:06 +02:00
Dalai Felinto added this to the Brush Assets & Asset Shelf project 2023-05-09 15:47:07 +02:00
Member

For now I think it's enough to implement this for the grid view only, it can be generalized easily later.

Notes on how this could be implemented:

  • Store a filter string in AssetShelfSettings.
  • Add a virtual ui::AbstractGridViewItem::is_filtered_visible() (returns true in the default implementation).
  • Override it to perform name filtering in ed::asset::shelf::AssetView (asset_shelf_asset_view.cc).
  • Add a ui::AbstractGridViewItem::foreach_filtered_item() iterator that calls it.
  • Use that instead of foreach_item in GridViewLayoutBuilder::build_from_view()
  • BuildOnlyVisibleButtonsHelper::fill_layout_after_visible() needs to get the count of visible items, not the total item count.
  • Optionally: foreach_filtered_item() could avoid re-filtering all the time, by storing the result in the item (e.g. something like a {"filtered_visible", "filtered_hidden", "filter_pending"} enum).

This would filter drawn items, but wouldn't remove grid items from storage, which is important to keep state like selection and active of the items.

For now I think it's enough to implement this for the grid view only, it can be generalized easily later. Notes on how this could be implemented: - Store a filter string in `AssetShelfSettings`. - Add a virtual `ui::AbstractGridViewItem::is_filtered_visible()` (returns true in the default implementation). - Override it to perform name filtering in `ed::asset::shelf::AssetView` (`asset_shelf_asset_view.cc`). - Add a `ui::AbstractGridViewItem::foreach_filtered_item()` iterator that calls it. - Use that instead of `foreach_item` in `GridViewLayoutBuilder::build_from_view()` - `BuildOnlyVisibleButtonsHelper::fill_layout_after_visible()` needs to get the count of visible items, not the total item count. - Optionally: `foreach_filtered_item()` could avoid re-filtering all the time, by storing the result in the item (e.g. something like a {"filtered_visible", "filtered_hidden", "filter_pending"} enum). This would filter drawn items, but wouldn't remove grid items from storage, which is important to keep state like selection and active of the items.
Member

Implemented with 8848a78111 & 86e72999dd.

Implemented with 8848a78111 & 86e72999dd.
Blender Bot added the
Status
Archived
label 2023-06-08 17:45:39 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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 Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107784
No description provided.