Pose library: fix asset creation operator poll when no object active #104466
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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-addons#104466
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pioverfour/blender-addons:dp_fix_poselib_operator_poll"
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?
When the POSELIB_OT_create_pose_asset operator was displayed in the
UI, for instance pressing F3 after deleting an object, the poll method
tried to access the mode of a None object, leading to the following
error message being displayed:
This commit adds a check for whether an object is currently active.
Thanks for the patch!
It can't land as-is, though. The PR description should be a proper commit message, and thus be slightly more specific than "the operator" or "an error message".
@ -63,3 +63,3 @@
if context.object.mode != "POSE":
if context.object is None or context.object.mode != "POSE":
# The operator assumes pose mode, so that bone selection is visible.
cls.poll_message_set("The object must be in Pose mode")
I think the poll message is now a little vague, as it references 'the object' while there may not even be one.
How about "An active armature object in pose mode is needed"?
e51b6023e8
to39b130bc66
Thank you for the feedback, I admit it’s sometimes a bit hard to know what granularity needs to go into commit messages. Here I thought the operator mentioned in the commit title was precise enough, and the full error message too much info.
That's fine, and understandable.
My personal approach for such descriptions is to make sure they can be understood without having to read the code. And if I can make it understandable when someone lazily skips over details in the title, even better :)
As for the error message, for me as reviewer it's nice to know explicitly which error is solved. In this case it's also clear from the code, but for more complex situations I want to know what I can expect before looking at the code. If I have to check the code to understand the change, I can never see if the code is doing the right thing or not, making my job as a reviewer that much harder.
This is perfect, thanks!
Interesting, thanks! I’ll try to do better next time ;)