bpy: Inconsistent return for .bones properties .children_recursive and .parent_recursive based on mode #63951

Closed
opened 2019-04-28 04:38:31 +02:00 by sok0 · 8 comments

Blender Version
2.79b

in

class bpy.types.Bone(bpy_struct)
parent_recursive - A list of parents, starting with the immediate parent (readonly)
children_recursive - A list of all children from this bone. (readonly)

there are inconsistent returns depending on the 3d view mode.

In edit mode, children_recursive returns a list of editbones.
In object mode, children_recursive returns a list of bones.

this makes sense so far. now for the inconsistency:

In edit mode AND object mode, parent_recursive returns a list of bones.
parent_recursive does not return a list of edit bones while in edit mode.

does it make much more sense to have a list of edit bones return while in edit mode?

**Blender Version** 2.79b in class bpy.types.Bone(bpy_struct) parent_recursive - A list of parents, starting with the immediate parent (readonly) children_recursive - A list of all children from this bone. (readonly) there are inconsistent returns depending on the 3d view mode. In edit mode, children_recursive returns a list of editbones. In object mode, children_recursive returns a list of bones. this makes sense so far. now for the inconsistency: In edit mode AND object mode, parent_recursive returns a list of bones. parent_recursive does not return a list of edit bones while in edit mode. does it make much more sense to have a list of edit bones return while in edit mode?
Author

Added subscriber: @sok0

Added subscriber: @sok0
sok0 changed title from bpy: Inconsistent return for .bones properties .children_recursive and .parent_recursive based on context to bpy: Inconsistent return for .bones properties .children_recursive and .parent_recursive based on mode 2019-04-28 04:44:54 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Could you show a test-case of this happening, a quick test here shows this to work as expected in 2.79b and 2.80.

>>> bpy.context.object.data.edit_bones[-1].parent_recursive

[bpy.data.armatures['Armature']...EditBone, bpy.data.armatures['Armature']...EditBone]
Could you show a test-case of this happening, a quick test here shows this to work as expected in 2.79b and 2.80. ``` >>> bpy.context.object.data.edit_bones[-1].parent_recursive [bpy.data.armatures['Armature']...EditBone, bpy.data.armatures['Armature']...EditBone] ```
Author

Hi here is test case where I am getting bones return while in edit mode:

image.png

Hi here is test case where I am getting bones return while in edit mode: ![image.png](https://archive.blender.org/developer/F7004390/image.png)

Please include a blend file.

Please include a blend file.
Author
[#63951.blend](https://archive.blender.org/developer/F7006047/T63951.blend)

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2019-05-06 07:30:48 +02:00

You need to access edit bones from the armature, eg:

bpy.data.armatures['Armature'].edit_bones['Bone.009'].parent_recursive
You need to access edit bones from the armature, eg: ``` bpy.data.armatures['Armature'].edit_bones['Bone.009'].parent_recursive ```
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
2 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#63951
No description provided.