UI: Add initial UI support for ID pointers custom properties #110458

Merged
Bastien Montagne merged 1 commits from mont29/blender:ui-for-datablock-customprops into main 2023-08-21 14:14:33 +02:00

Customprops to IDs are supported since years through code, but were
never exposed directly in the UI of customporperties.

This commit mainly:

  • Adds a new DATABLOCK type to UI customprops types.
  • Exposes the exiting id_type settings to python API.

image

Customprops to IDs are supported since years through code, but were never exposed directly in the UI of customporperties. This commit mainly: * Adds a new `DATABLOCK` type to UI customprops types. * Exposes the exiting `id_type` settings to python API. ![image](/attachments/4eaa0edf-75c5-4079-9451-86a60d59e62e)
Author
Owner

@JulianEisel will need your help to finalize and polish this I think.

@JulianEisel will need your help to finalize and polish this I think.
Contributor

The "list all IDs from main" idea could work well for selecting a custom property ID in the drivers editor as well, since it currently requires type selection first:
image

But it would probably need better UX, like optionally grouping/filtering the IDs by type.

The "list all IDs from main" idea could work well for selecting a custom property ID in the drivers editor as well, since it currently requires type selection first: ![image](/attachments/58b76e46-9748-4c70-9f14-2e31ce64375c) But it would probably need better UX, like optionally grouping/filtering the IDs by type.
Member

Nice! This should probably use the IDPropertyUIDataID::id_type value to allow limiting the choice to a specific type. Also I think that type should probably be editable with the custom property edit operator.

Nice! This should probably use the `IDPropertyUIDataID::id_type` value to allow limiting the choice to a specific type. Also I think that type should probably be editable with the custom property edit operator.
Member

Some points:

  • If drivers were to get a "Pick one from every ID in the entire .blend" drop-down, I don't think that should be default behaviour. Selecting type first, then ID, is much more intuitive imo.
  • In the same vein, I agree that having a type selector for ID custom properties would also be desirable.
  • Are ID custom properties allowed to have a default value other than a null pointer? I don't personally need this functionality, but I can see it being both useful and dangerous. (default values are usually quite hidden, and hidden ID pointers are icky).
  • Since object names aren't unique, as soon as linked IDs get involved, the drop-down list should ideally also display the library path or .blend file name of linked IDs, in order to allow users to uniquely identify them by just looking through the list.
Some points: - If drivers were to get a "Pick one from every ID in the entire .blend" drop-down, I don't think that should be default behaviour. Selecting type first, then ID, is much more intuitive imo. - In the same vein, I agree that having a type selector for ID custom properties would also be desirable. - Are ID custom properties allowed to have a default value other than a null pointer? I don't personally need this functionality, but I can see it being both useful and dangerous. (default values are usually quite hidden, and hidden ID pointers are icky). - Since object names aren't unique, as soon as linked IDs get involved, the drop-down list should _ideally_ also display the library path or .blend file name of linked IDs, in order to allow users to uniquely identify them by just looking through the list.
Bastien Montagne force-pushed ui-for-datablock-customprops from 4bacf23c3b to 5acad9adce 2023-08-10 17:09:57 +02:00 Compare
Bastien Montagne force-pushed ui-for-datablock-customprops from 5acad9adce to 34bd74e51d 2023-08-10 17:32:40 +02:00 Compare
Author
Owner

Updated the diff, removed the 'all ID types' changes/possibility for now (this would require quite some UI work in the ID template), added handling of the ID property id_type uidata.

Updated the diff, removed the 'all ID types' changes/possibility for now (this would require quite some UI work in the ID template), added handling of the ID property `id_type` uidata.
Author
Owner

@blender-bot build

@blender-bot build
Bastien Montagne changed title from WIP: UI: Add initial UI support for ID pointers custom properties. to UI: Add initial UI support for ID pointers custom properties. 2023-08-10 17:38:13 +02:00
Bastien Montagne requested review from Pablo Vazquez 2023-08-10 17:38:51 +02:00
Bastien Montagne requested review from Campbell Barton 2023-08-10 17:38:51 +02:00
Bastien Montagne requested review from Julian Eisel 2023-08-10 17:38:51 +02:00
Hans Goudey changed title from UI: Add initial UI support for ID pointers custom properties. to UI: Add initial UI support for ID pointers custom properties 2023-08-11 02:30:25 +02:00
Julian Eisel approved these changes 2023-08-11 15:07:46 +02:00
Julian Eisel left a comment
Member

Don't have much to say about this, the little UI code that's here looks fine.

Don't have much to say about this, the little UI code that's here looks fine.

I would expect this to use a simple ID "search" instead of a template (without allowing for Fake User or Duplicate/Make Unique). Similar to how we refer to points elsewhere such as the UV Projection modifier, the set Material nodes, the objects we set in constraints, ...

Basically I don't think we have the option anywhere else in Blender to make a new datablock outside the context where the new data-block can be edited. And I don't see a strong reason to break that rule for the custom properties.

I would expect this to use a simple ID "search" instead of a template (without allowing for Fake User or Duplicate/Make Unique). Similar to how we refer to points elsewhere such as the UV Projection modifier, the set Material nodes, the objects we set in constraints, ... Basically I don't think we have the option anywhere else in Blender to make a new datablock outside the context where the new data-block can be edited. And I don't see a strong reason to break that rule for the custom properties.

I think ID search is normally used for cases where the user count is not increased, like objects which exist only by being in the scene. For the general case I think showing the user count and fake user buttons is important.

I don't think we need a button to create a new datablock here though.

I think ID search is normally used for cases where the user count is not increased, like objects which exist only by being in the scene. For the general case I think showing the user count and fake user buttons is important. I don't think we need a button to create a new datablock here though.
Author
Owner

@brecht The only way to create new IDs here is by the implicit behavior of the user count button, which creates a single-user copy of the selected ID when clicked... AFAIK there is no way to prevent this behavior?

@brecht The only way to create new IDs here is by the implicit behavior of the user count button, which creates a single-user copy of the selected ID when clicked... AFAIK there is no way to prevent this behavior?

From @dfelinto's reply I got the impression it was possible to create a completely new datablock, but creating a single user copy seems fine to me.

From @dfelinto's reply I got the impression it was possible to create a completely new datablock, but creating a single user copy seems fine to me.

In general this patch looks good, only two points.

  • Editing an ID property always resets it to None, even when the description is changed, attached patch that resolves this issue.
  • I'd prefer DATA_BLOCK over DATABLOCK for the enum.

I don't think another review iteration is needed, accepting.

In general this patch looks good, only two points. - Editing an ID property always resets it to None, even when the description is changed, attached patch that resolves this issue. - I'd prefer `DATA_BLOCK` over `DATABLOCK` for the enum. I don't think another review iteration is needed, accepting.
Campbell Barton approved these changes 2023-08-18 13:52:53 +02:00
Bastien Montagne force-pushed ui-for-datablock-customprops from 34bd74e51d to e4ce221172 2023-08-21 12:07:06 +02:00 Compare
Author
Owner

@blender-bot build

@blender-bot build
Bastien Montagne force-pushed ui-for-datablock-customprops from e4ce221172 to f15e1c2a3a 2023-08-21 12:18:56 +02:00 Compare
Author
Owner

@blender-bot build

@blender-bot build
Bastien Montagne force-pushed ui-for-datablock-customprops from f15e1c2a3a to 9c435ad8fc 2023-08-21 14:12:45 +02:00 Compare
Bastien Montagne force-pushed ui-for-datablock-customprops from 9c435ad8fc to 2174000df8 2023-08-21 14:14:09 +02:00 Compare
Bastien Montagne merged commit b3c7f3c8a9 into main 2023-08-21 14:14:33 +02:00
Bastien Montagne deleted branch ui-for-datablock-customprops 2023-08-21 14:14:35 +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
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
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
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
8 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#110458
No description provided.