Page MenuHome

Duplicating an armature clears B-Bones' custom handle references
Closed, ResolvedPublic

Description

System Information
Operating system: macOS 10.14.4
Graphics card: AMD Radeon R9 M295X 4GB

Blender Version
Broken: blender-2.80.0-git20190422.797539e76ccf-x86_64

Short description of error
Duplicating an armature clears B-Bones' custom handle references.

Exact steps for others to reproduce the error

# Create an armature and enter Edit Mode
bpy.ops.object.armature_add()
bpy.ops.object.editmode_toggle()

# Change the armature's display mode to visualize B-Bones
bpy.context.active_object.data.display_type = 'BBONE'

# Duplicate `Bone` as `Bone.001`
bpy.ops.armature.select_all(action='SELECT')
bpy.ops.armature.duplicate_move(TRANSFORM_OT_translate={"value":(1, 0, 0), "orient_type":'GLOBAL'})

# Set up the bendy bone
bpy.context.active_object.data.edit_bones['Bone'].bbone_segments = 32
bpy.context.active_object.data.edit_bones['Bone'].bbone_handle_type_start = 'ABSOLUTE'
bpy.context.active_object.data.edit_bones['Bone'].bbone_custom_handle_start = bpy.context.active_object.data.edit_bones['Bone.001']
assert bpy.context.active_object.data.edit_bones['Bone'].bbone_custom_handle_start == bpy.context.active_object.data.edit_bones['Bone.001']

# Exit Edit Mode
bpy.ops.object.editmode_toggle()

# Duplicate the armature, selecting the new armature
bpy.context.object.data.bones['Bone'].bbone_handle_type_start = 'ABSOLUTE'
bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, -2, 0), "orient_type":'GLOBAL'})

# Enter Edit Mode
bpy.ops.object.editmode_toggle()

# Expected: The following assertion is satisfied.
# Actual: The following assertion is broken, throwing `AssertionError`.
assert bpy.context.active_object.data.edit_bones['Bone'].bbone_custom_handle_start == bpy.context.active_object.data.edit_bones['Bone.001']