Pose Bones BPY BPY bugged #129815

Closed
opened 2024-11-04 19:08:48 +01:00 by wueo · 3 comments

System Information
Operating system: Linux-6.11.6-200.fsync.fc40.x86_64-x86_64-with-glibc2.39 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 565.57.01

Blender Version
Broken: version: 4.2.3 LTS, branch: blender-v4.2-release, commit date: 2024-10-14 15:20, hash: 0e22e4fcea03
Worked: (None or no1 that i know of)

Short description of error
hello

  1. trying to move through bpy the pose bones head, head_local, tail, tail_local through python gives error saying :

Error: Python: Traceback (most recent call last):
File "/home/vuaieo/Desktop/BPY Pose Bones codes.blend/Text", line 4, in
AttributeError: bpy_struct: attribute "head" from "Bone" is read-only

  1. the code: bpy.data.objects['Armature'].pose.bones['Bone'].bone.matrix gives 3x3 matrix
    not sure if is a bug but the bpy.data.objects['Armature'].pose.bones['Bone'].bone.matrix_local gives 4x4 for the edit bone and not pose bone even if it says its pose bone🥶

  2. and also there is no moving center for the pose bone and the rotation do rotates around the head and not center . usualy when you select a bone(edit) and move or rotate you rotate on center and not heads...

Exact steps for others to reproduce the error
open the blend file and script editor where i prepared the codes to be pasted in the python console to see yourselfs.
and dear gods please make this no feature request again🙏🥴🖖

**System Information** Operating system: Linux-6.11.6-200.fsync.fc40.x86_64-x86_64-with-glibc2.39 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 565.57.01 **Blender Version** Broken: version: 4.2.3 LTS, branch: blender-v4.2-release, commit date: 2024-10-14 15:20, hash: `0e22e4fcea03` Worked: (None or no1 that i know of) **Short description of error** hello 1. trying to move through bpy the pose bones head, head_local, tail, tail_local through python gives error saying : Error: Python: Traceback (most recent call last): File "/home/vuaieo/Desktop/BPY Pose Bones codes.blend/Text", line 4, in <module> AttributeError: bpy_struct: attribute "head" from "Bone" is read-only 2. the code: bpy.data.objects['Armature'].pose.bones['Bone'].bone.matrix gives 3x3 matrix not sure if is a bug but the bpy.data.objects['Armature'].pose.bones['Bone'].bone.matrix_local gives 4x4 for the edit bone and not pose bone even if it says its pose bone🥶 3. and also there is no moving center for the pose bone and the rotation do rotates around the head and not center . usualy when you select a bone(edit) and move or rotate you rotate on center and not heads... **Exact steps for others to reproduce the error** open the blend file and script editor where i prepared the codes to be pasted in the python console to see yourselfs. and dear gods please make this no feature request again🙏🥴🖖
wueo added the
Status
Needs Triage
Severity
Normal
Type
Bug
labels 2024-11-04 19:08:48 +01:00

Hi, as I understand it, the Bone object represents the original bone in its rest position, the PoseBone object is the transformed version for poses, and the EditBone is a temporary object used for editing the original Bone.

It's by design that in Edit Mode, the median center pivot is the average of the selected elements' heads and tails, as both can be transformed in edit mode.

I'm not familiar enough with the details to explain why Bone.matrix is a 3x3 matrix, but this doesn't seem to be a bug.

The head, tail, and center attributes of a Pose Bone are read-only in the Python API, and accessing them should raise an error, which is the behavior you're experiencing.

So overall, I don't think this is a bug report, but rather a misunderstanding of the Python API and Blender's structure.

Hi, as I understand it, the `Bone` object represents the original bone in its rest position, the `PoseBone` object is the transformed version for poses, and the `EditBone` is a temporary object used for editing the original `Bone`. It's by design that in Edit Mode, the median center pivot is the average of the selected elements' heads and tails, as both can be transformed in edit mode. I'm not familiar enough with the details to explain why `Bone.matrix` is a 3x3 matrix, but this doesn't seem to be a bug. The head, tail, and center attributes of a `Pose Bone` are read-only in the Python API, and accessing them should raise an error, which is the behavior you're experiencing. So overall, I don't think this is a bug report, but rather a misunderstanding of the Python API and Blender's structure.
Germano Cavalcante added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2024-11-04 20:26:22 +01:00
Author

hi thanks for answer but the console said its error. lets say you need to move the pose bone in specific place that the middle of it would be placed there, how you do that withiout beeing math genius scientist if even possible? shouldnt there be command for middle aswell too for simple addon wannabe makers? and matrix 4x4 is from pose bones and not edit bone codes... i not sure what information i can give else for this , please tell more so we can implement these not features asap...

hi thanks for answer but the console said its error. lets say you need to move the pose bone in specific place that the middle of it would be placed there, how you do that withiout beeing math genius scientist if even possible? shouldnt there be command for middle aswell too for simple addon wannabe makers? and matrix 4x4 is from pose bones and not edit bone codes... i not sure what information i can give else for this , please tell more so we can implement these not features asap...

I understand your concern, but calculating the midpoint of a pose bone seems straightforward. If you have the coordinates of the tail and head, the middle point would be calculated simply as (tail + head) * 0.5 or (tail + head) / 2. Therefore, I don't see the need to add a specific API in C++ to calculate this value.

Anyway, thanks for the report. However, please use other channels for user feedback and feature requests: Feature Requests.

For more information on why this isn't considered a bug, please visit: Not a Bug.

I understand your concern, but calculating the midpoint of a pose bone seems straightforward. If you have the coordinates of the tail and head, the middle point would be calculated simply as `(tail + head) * 0.5` or `(tail + head) / 2`. Therefore, I don't see the need to add a specific API in C++ to calculate this value. Anyway, thanks for the report. However, please use other channels for user feedback and feature requests: [Feature Requests](https://developer.blender.org/docs/handbook/communication/user_feedback/#feature-requests). For more information on why this isn't considered a bug, please visit: [Not a Bug](https://developer.blender.org/docs/handbook/bug_reports/not_a_bug/).
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2024-11-05 01:03:25 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#129815
No description provided.