Page MenuHome

Not a major issue but... is this a bug or a feature? - "children_recursive" function returns bones with type based on mode not the source bone type.
Closed, ResolvedPublic

Description

System Information
Operating system: Windows 10
Graphics card: GTX 1070 8gb

Blender Version
Broken: (2.90)
Worked: (2.83)

Short description of error
I'm not sure if this is intended but since i updated to 2.90 one of my add-ons started throwing an error because of this.

When calling the children_recursive function on a bpy.types.Bone in edit mode it returns a list of bpy.types.EditBone instead of bpy.types.Bone like it did before.

This is my first error report, and if its intended then i did not find anything about this in the changes.

Exact steps for others to reproduce the error

Create an armature.

Extrude a few bones to create a small hierarchy.

Run this code from the text editor.

import bpy

armature = bpy.context.object

bone = armature.data.bones[0]

# run a print test in object mode...
bpy.ops.object.mode_set(mode='OBJECT')
print("-----------------OBJECT MODE--------------------")
# returns bpy.types.Bone
print("PARENT", bone.bl_rna)
# returns bpy.types.Bone
print("CHILD", bone.children_recursive[0].bl_rna)

# switch to edit mode and run the same test code...
bpy.ops.object.mode_set(mode='EDIT')
print("-----------------EDIT MODE--------------------")
# still returns bpy.types.Bone
print("PARENT", bone.bl_rna)
# now returns bpy.types.EditBone ???
print("CHILD", bone.children_recursive[0].bl_rna)

Is it just me or is this not quite right?