1
$\begingroup$

I have a robot model in blender. Whose links are formed as parent child relationship and a tree is formed. At the moment I am looking how to get translation and rotation of the child object with respect to its parent object. I am using Blender 2.79b at the moment. Selecting any object in the scene gives (0, 0, 0) for translation and (0, 0, 0) for rotation.

Here is the visual description of the desired transformation

Transform of a selected object

Any leads will be appreciated.

$\endgroup$
4
  • $\begingroup$ You can do this manually without fuss, or are you looking for a node or some feature? $\endgroup$
    – Edgel3D
    Jun 6, 2021 at 4:24
  • $\begingroup$ How can I get that manually can you please share your insights either by script or from the gui. (Sorry I am new to Blender) $\endgroup$ Jun 24, 2021 at 12:10
  • $\begingroup$ The info can be calculated using little more than mental arithmetic. Since you've mentioned you're new to Blender, I'll go off and prepare a short ans, setting out how to extract the info from the gui. Can you tell us why you need this relational info? Is it that you're trying to manipulate appendages externally perhaps? - blender.stackexchange.com/questions/226867/… $\endgroup$
    – Edgel3D
    Jun 28, 2021 at 10:51
  • $\begingroup$ Related blender.stackexchange.com/questions/169416/… In particular note what you see in UI is the basis matrix, not the local matrix (matches local matrix when the parent inverse is identity.) Ultimately you want the local matrix of the object. ie with an object active location = context.object.matrix_local.translation and Euler rotation euler_rotation = context.object.matrix_local.to_euler() $\endgroup$
    – batFINGER
    Jun 30, 2021 at 4:02

1 Answer 1

0
$\begingroup$

When in this case the cube is parented to the Icosphere with CTL-P and "Keep Transformation" is selected, the cube's current global location is frozen in it's LOC slots. No matter where the parent goes, this reading won't change.

When the parent moves, you can obtain the child's new global location by freezing the animation, selecting the child, then -

Press SH-S and choose "Cursor to Selected"

Press SH-A and add an empty.

The Empty will have been placed at the precise location of the cube's Origin Point and it's LOC slots will be displayng the cube's global location.

Use arithmetic or a calculator to obtain the difference between those and the parent's.

Should the parent also be a child of something else, use an empty in the same way to read off it's global location.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.