'matrix_world.translation' setter is broken when parented to Curve #71278

Closed
opened 2019-11-02 02:01:21 +01:00 by Christopher Gearhart · 7 comments

System Information
Operating system: Mac OS
Graphics card:

Blender Version
Broken: 2.80

Short description of error
Setting the translation of an object via the Python API, when parented to a curve, does not behave as expected. See the attached screenshot below:

Python matrix_world setter broken.png

Instead of setting the translation as expected, it seems that the translation setter is adding to the value. I believe this behavior is caused by the setter reading the curve's origin, assuming that this drives the child's location, while the child's location is actually being driven by some point along the curve.

Exact steps for others to reproduce the error

  • Open default scene
  • Add a 'Bezier Curve' object
  • Parent the default cube to the Curve, without inverse (i.e. 'Set Parent to Object (Without Inverse)')
    • the cube should have moved slightly so that it is on the end of the curve
  • Select the default cube so that it is the active object
  • In the scripting editor, type the following commands in succession:
    C.object.matrix_world.translation.x
    C.object.matrix_world.translation.x = -1
    C.object.matrix_world.translation.x
**System Information** Operating system: Mac OS Graphics card: <irrelevant> **Blender Version** Broken: 2.80 **Short description of error** Setting the translation of an object via the Python API, when parented to a curve, does not behave as expected. See the attached screenshot below: ![Python matrix_world setter broken.png](https://archive.blender.org/developer/F7896117/Python_matrix_world_setter_broken.png) Instead of setting the translation as expected, it seems that the translation setter is adding to the value. I believe this behavior is caused by the setter reading the curve's origin, assuming that this drives the child's location, while the child's location is actually being driven by some point along the curve. **Exact steps for others to reproduce the error** - Open default scene - Add a 'Bezier Curve' object - Parent the default cube to the Curve, without inverse (i.e. 'Set Parent to Object (Without Inverse)') - the cube should have moved slightly so that it is on the end of the curve - Select the default cube so that it is the active object - In the scripting editor, type the following commands in succession: `C.object.matrix_world.translation.x` `C.object.matrix_world.translation.x = -1` `C.object.matrix_world.translation.x`

Added subscriber: @bblanimation

Added subscriber: @bblanimation
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I can reproduce the issue. I'd actually be surprised if that would have worked^^

While this is an issue, I don't think that Blender can make this work reliably in all cases.

I can reproduce the issue. I'd actually be surprised if that would have worked^^ While this is an issue, I don't think that Blender can make this work reliably in all cases.

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Bastien Montagne self-assigned this 2020-01-15 16:14:39 +01:00

This is indeed not expected to work, in fact it won’t work for any 'advanced' parenting (to curve, to bone, etc.). Thanks for the report, but no bug here, just (reasonable) limitations of existing code.

This is indeed not expected to work, in fact it won’t work for any 'advanced' parenting (to curve, to bone, etc.). Thanks for the report, but no bug here, just (reasonable) limitations of existing code.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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-addons#71278
No description provided.