Crash when flipping names of bones #33074

Closed
opened 2012-11-03 23:03:53 +01:00 by Alberto Torres Ruiz · 6 comments

%%%- Have two mirrored bones, Bone_L and Bone_R

  • Have an object parented to Bone_R
  • In edit mode, with X-mirror disabled, delete Bone_R
  • Duplicate Bone_L and press W -> flip names
  • Crash

It doesn't occur if you exit and reenter edit mode between steps 3 and 4.%%%

%%%- Have two mirrored bones, Bone_L and Bone_R - Have an object parented to Bone_R - In edit mode, with X-mirror disabled, delete Bone_R - Duplicate Bone_L and press W -> flip names - Crash It doesn't occur if you exit and reenter edit mode between steps 3 and 4.%%%

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%To clarify, regarding "It doesn't occur if you exit and reenter edit mode...", this means "after duplicating Bone_L". That's what I'm seeing, anyway.

The crash is happening because duplicating Bone_L creates a pose channel that doesn't point to a bone (since only an edit mode bone object exists at that point). Then the "Flip Names" command renames the pose channel to Bone_R, so the bone parenting code finds it and tries to get the length of the non-existent bone, causing a crash. Exiting and re-entering edit mode creates a proper bone object and hooks it up to the pose channel, so the crash doesn't occur.

It seems like the fix is to just check for the existence of the bone as well as the pose channel in the parenting code? This means flipping bone names won't hook up parented objects correctly until you exit edit mode, but that seems like an acceptable compromise.

Another possibility is to find the EditBone and use its length instead; I'm looking into this now.%%%

%%%To clarify, regarding "It doesn't occur if you exit and reenter edit mode...", this means "after duplicating Bone_L". That's what I'm seeing, anyway. The crash is happening because duplicating Bone_L creates a pose channel that doesn't point to a bone (since only an edit mode bone object exists at that point). Then the "Flip Names" command renames the pose channel to Bone_R, so the bone parenting code finds it and tries to get the length of the non-existent bone, causing a crash. Exiting and re-entering edit mode creates a proper bone object and hooks it up to the pose channel, so the crash doesn't occur. It seems like the fix is to just check for the existence of the bone as well as the pose channel in the parenting code? This means flipping bone names won't hook up parented objects correctly until you exit edit mode, but that seems like an acceptable compromise. Another possibility is to find the EditBone and use its length instead; I'm looking into this now.%%%
Member

%%%Hmm, finding the EditBone and use its length would require blenkernel/intern/object.c to include editors/include/ED_armature.h, which seems like a bad idea. A patch to bail out of bone parenting if the pose channel has no bone is attached.%%%

%%%Hmm, finding the EditBone and use its length would require blenkernel/intern/object.c to include editors/include/ED_armature.h, which seems like a bad idea. A patch to bail out of bone parenting if the pose channel has no bone is attached.%%%
Member

%%%Hey Ben - good to see you here again. I'd be happy to back your svn account so you commit yourself?%%%

%%%Hey Ben - good to see you here again. I'd be happy to back your svn account so you commit yourself?%%%
Member

%%%Syncing armature data and pose channels always has been a bit weak in this design.
It was based on old 2.0 design - attempt to have 1 object sharing many armatures in different ways. That's a feature we don't use really - especially now we have group instancing for entire characters.

I think the basic fix from Ben is acceptable for this call. In armature editmode pose channels are not used or visible really.

BTW: ED_ api calls indeed have to stay inside the editors/ directory!%%%

%%%Syncing armature data and pose channels always has been a bit weak in this design. It was based on old 2.0 design - attempt to have 1 object sharing many armatures in different ways. That's a feature we don't use really - especially now we have group instancing for entire characters. I think the basic fix from Ben is acceptable for this call. In armature editmode pose channels are not used or visible really. BTW: ED_ api calls indeed have to stay inside the editors/ directory!%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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
3 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#33074
No description provided.