UI: Props Dialog Default Properties #119007
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119007
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley/blender:ProDialogDefProps"
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?
Allow activating numerical buttons upon opening of props dialogs. Set
defaults for some dialogs where appropriate.
When props dialogs open we can currently set that a particular input should be active right away by setting the property as default. Unfortunately this currently only works for text inputs. This PR adds code to allow setting a numerical input as activated on open and then also sets four defaults where appropriate:
For
ARMATURE_OT_move_to_collection
when adding to a new bone collection, this PR changes the title slightly to include "Bone Collection". Otherwise this dialog you get when hitting "M" in pose mode looks exactly the same as hitting "M" in object mode, which are very different. This also adds "Bones" as the default bone collection name as it is in the list itself.@ -1166,8 +1166,9 @@ static int move_to_collection_regular_invoke(bContext *C, wmOperator *op)
static int move_to_new_collection_invoke(bContext *C, wmOperator *op)
{
RNA_string_set(op->ptr, "new_collection_name", IFACE_("Bones"));
Could this be done by giving the string property a default value? That seems better than potentially overridint a value remembered from last time or a value set explicitly
@ -2622,6 +2622,7 @@ static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent * /*event
/* Better for user feedback. */
RNA_string_set(op->ptr, "name", DATA_(IMA_DEF_NAME));
op->type->prop = RNA_struct_find_property(op->ptr, "name");
Feels like this should be done when defining the property. I think the operator type should basically be considered const after it is registered
Yes, makes sense. I actually only just noticed that
op->type->prop
is meant for this use. Looks messy though, probably needs a helper likeRNA_property_set_default
?It's usually written like
ot->prop = RNA_def_*
which isn't so bad. It's really more related to the operator system than RNA. So if we had something,WM_operator_set_default_prop
might be better. But I'd probably wait for something like a different API for registering operators.OMG, I didn't recognize that this is what that was doing. Just because we have so many instances where we assign to it multiple times - like in ANIM_OT_channels_view_selected for example.
But I see that now. Finally makes sense. LOL.
I don't think so? The property would then just have that value in times when it could otherwise be blank. Setting the default name or value there fits with similar uses in image_new_invoke, move_to_collection_invoke.
@HooglyBoogly
Testing the idea of just adding these as property defaults, I am seeing odd things to do with translation. As in if I make the default string
"Bones"
,IFACE_("Bones")
,N_("Bones")
, etc it works in English, but in Spanish I only ever see the word "Bones". Even though I know that this word is translated because I see "Huesos" if add one in the Bone Collections list.But does work where I have it in the invoke.
Great point, didn't think of that!
@blender-bot build
@blender-bot build