Gray out "Asset Shelf" region toggle in menu if none is available #110756

Open
Julian Eisel wants to merge 2 commits from JulianEisel/blender:temp-asset-shelf-region-toggle-disable into asset-shelf

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

The 3D View > View > Asset Shelf toggle can be confusing when no asset shelf
is available. Better to gray it out then. Ideally we would display a disabled
hint in the tooltip, but the current code doesn't allow doing that while
keeping the property editable.

Multiple ways to go about this, e.g. we could have some dedicated query
in the API. But I think querying this through region context makes
sense, since we can get all the necessary information that way already.

The _3D View > View > Asset Shelf_ toggle can be confusing when no asset shelf is available. Better to gray it out then. Ideally we would display a disabled hint in the tooltip, but the current code doesn't allow doing that while keeping the property editable. Multiple ways to go about this, e.g. we could have some dedicated query in the API. But I think querying this through region context makes sense, since we can get all the necessary information that way already.
Julian Eisel added the
Module
User Interface
Interest
Asset Browser
labels 2023-08-03 14:47:45 +02:00
Julian Eisel added 1 commit 2023-08-03 14:47:57 +02:00
73f1f628ba Gray out "Asset Shelf" region toggle in menu if none is available
Multiple ways to go about this, e.g. we could have some dedicated query
in the API. But I think querying this through region context makes
sense.
Julian Eisel added 1 commit 2023-08-03 15:07:48 +02:00
Julian Eisel requested review from Campbell Barton 2023-08-03 15:18:50 +02:00
Julian Eisel added a new dependency 2023-08-03 15:19:08 +02:00
Campbell Barton reviewed 2023-08-03 15:30:14 +02:00
@ -27,6 +27,19 @@ class ASSETSHELF_PT_display(Panel):
return context.asset_shelf is not None
class Utils:

This is included in a way which makes it seem like it's intended to be a public function. If other UI code is expected to access this (outside of Blender's own scripts).

Would it be a more general solution to to able to access region.poll() or expose RGN_FLAG_POLL_FAILED to RNA?
This way it's possible to check if regions would be shown without having custom per-region API's.

This is included in a way which makes it seem like it's intended to be a public function. If other UI code is expected to access this (outside of Blender's own scripts). Would it be a more general solution to to able to access `region.poll()` or expose `RGN_FLAG_POLL_FAILED` to RNA? This way it's possible to check if regions would be shown without having custom per-region API's.
Author
Member

Submitted an alternative solution: #113063. It exposes the region poll result and hides the menu items entirely as opposed to graying them out, to avoid further confusion.

Submitted an alternative solution: #113063. It exposes the region poll result and hides the menu items entirely as opposed to graying them out, to avoid further confusion.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u temp-asset-shelf-region-toggle-disable:JulianEisel-temp-asset-shelf-region-toggle-disable
git checkout JulianEisel-temp-asset-shelf-region-toggle-disable

Merge

Merge the changes and update on Gitea.
git checkout asset-shelf
git merge --no-ff JulianEisel-temp-asset-shelf-region-toggle-disable
git checkout asset-shelf
git merge --ff-only JulianEisel-temp-asset-shelf-region-toggle-disable
git checkout JulianEisel-temp-asset-shelf-region-toggle-disable
git rebase asset-shelf
git checkout asset-shelf
git merge --no-ff JulianEisel-temp-asset-shelf-region-toggle-disable
git checkout asset-shelf
git merge --squash JulianEisel-temp-asset-shelf-region-toggle-disable
git checkout asset-shelf
git merge JulianEisel-temp-asset-shelf-region-toggle-disable
git push origin asset-shelf
Sign in to join this conversation.
No reviewers
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
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.

Reference: blender/blender#110756
No description provided.