Fix #118637: crash after editbone duplication in certain case #118676
No reviewers
Labels
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
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118676
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lichtwerk/blender:118637"
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?
Crash happens in
action_group_colors_set_from_posebone
/ANIM_bonecolor_posebone_get
on abPoseChannel
without abone
.If I am not mistaken a new
bPoseChannel
(e.g. after duplication) willonly get its
bone
after leaving editmode.So in a way the situation is similar to
2a8ce1f121
Behavior of
animchan_sync_group
is not reliable in a way that gettinga
bPoseChannel
from anbActionGroup
will guarantee these are reallycorresponding. So usually, if you dulplicate/symmetrize a bone, there
would be no corresponding
bActionGroup
and nothing would happenreally. But you could for example group fcurves from
Bone
under agroup called
Bone.001
and vice versa. This is totally allowed to do.In this case,
animchan_sync_group
is doing nothing totally helpful, soit could find the "wrong"
bPoseChannel
. And it could tryaction_group_colors_set_from_posebone
with thatbPoseChannel
whichstill does not have a
bone
and then crash.So now only do this if we have a valid
bone
.Thanks for the analysis & the fix!
To slowly migrate our code towards more predictability, I'm trying to get as much of the new code to distinguish between "this
nullptr
parameter makes sense for this function" from "this really cannot benullptr
for this function to do its job". Here I feel we're in the latter case -- "set something based on this posebone" can't do its job without getting a posebone. In the longer run we could make the parameter a reference instead, to drive the point home that it's not optional.So if you don't mind applying this diff before landing the PR it's a LGTM!
PS: the check for
pchan->bone
I kept inside the function. It would create too tight coupling to move that check out, as then the caller would have to know that the function might actually use that pointer.