Page MenuHome

Fix T63794: Duplicating an armature clears B-Bones' custom handle references
ClosedPublic

Authored by Tomoaki Kawada (yvt) on Apr 23 2019, 6:18 PM.

Details

Summary

This patch fixes T63794 by updating duplicated bones' custom handle references to point the new armature's bones.

The problem occurs because B-Bones of a duplicated armature keep pointing the old armature's bones. The references are cleared upon entering Edit Mode because there are no matching EditBone for such bones, and find_ebone_link just returns NULL in such cases.

Diff Detail

Repository
rB Blender

Event Timeline

Tomoaki Kawada (yvt) edited the summary of this revision. (Show Details)Apr 23 2019, 6:19 PM
Tomoaki Kawada (yvt) edited the summary of this revision. (Show Details)Apr 23 2019, 6:27 PM

Looks ok overall, but I have some performance concerns.

source/blender/blenkernel/intern/armature.c
177

Maybe it's better to use BKE_armature_bone_from_name_map to create a hash table for lookup? In a big rig with many B-Bones this is effectively quadratic complexity, and this copying code is used internally by depsgraph for copy-on-write.

  • Use a hashtable to find bones by name in copy_bonechildren_custom_handles
Tomoaki Kawada (yvt) marked an inline comment as done.Apr 26 2019, 5:46 AM
Tomoaki Kawada (yvt) added inline comments.
source/blender/blenkernel/intern/armature.c
177

You are right, updated the code.

This revision is now accepted and ready to land.Apr 28 2019, 4:07 PM
This revision was automatically updated to reflect the committed changes.