1
$\begingroup$

When child object transforms are zeroed out, I want the child object to return to the current world space location of its parent, and report 0,0,0 in the child's location transform fields. In addition, applying the location transforms for children should likewise be based off of this same parent world space location, and not the world space origin. This is how parent-child behaviors commonly work in other programs. But seemingly not in Blender.

I've been researching this problem both on and off this site. It appears that other people are asking similar questions, both here and elsewhere, and are not getting answers. Or are getting the wrong answers. Or they are being told that scripting is the key. How could scripting be the key?

I want to zero out child transforms and have the child object end up wherever its parent is currently located. Can this be done in Blender? If it can't be, then what is the workflow I'm expected to adopt so that I won't need children to return to parent locations when their transforms are zeroed out? The only thing i can think of as a workaround is to create everything that needs parenting at the world space origin. That is not always practical.

Why are all location transforms always global coordinates in Blender? Even the use of Delta transforms doesn't make for an intuitive workaround. In some ways, conceptualizing the spatial relationships between parents and children becomes even worse with Deltas. It's also inconvenient to need to go somewhere else in the UI to manage transform values.

In Edit Mode, there is both a Local and Global way of viewing coordinates for selected components. But no corresponding option exists for objects in Object Mode. That is not consistent nor convenient.

I don't expect anyone to read the below linked thread in its entirety, but it highlights a discussion on this very topic. If anyone is so inclined, and partakes, they will discover that, apparently, the devs don't see this as a problem in need of fixing. Also, someone in the thread evidently made an in-house addon to make parenting work in Blender the way it works in every other program, and wanted everyone else to know they made it. But they evidently didn't want anyone else to have it, because they didn't mention whether it was available publicly. https://developer.blender.org/T68190

The Parent Inverse seems to be an extremely cryptic and convoluted concept, in part because its value is always hidden. It's also a reference entirely too dependent on mathematical jargon to be encouraging to artists and non-programmers. But it's also one that is central to this issue. My understanding is that this value is an offset, and is needed to prevent newly parented objects from automatically snapping to parent origins. It keeps child objects wherever they already are in world space after parenting. Okay. But then, why is this value not used to zero out the child's transforms, since the inverse data would actually be useful for this purpose? Why even have the Parent Inverse function if it is not going to be used to provide this kind of functionality?

This is one of the most frustrating things about Blender for anyone who has ever used another 3D software program. This is especially true for riggers/animators, who want to be able to quickly zero out transform values and get children immediately returned to parent positions.

If I am simply failing to understand the right way to do things, I would love to be told, so long as the right way to do things was demonstrated afterwards.

$\endgroup$
1
$\begingroup$

An example of object parenting

Object A has its origin in world space at x=10.0, y=10.0, z=10.0

Object B has its origin in world space at x=2.0, y=2.0, z=2.0

When parenting Object B to Object A, Object B ends up in the coordinate space of Object A.

The new coordinates of Object B in local coordinate space, relative to its parent, are: x=-8.0, y=-8.0, z=-8.0

What Blender displays in the UI

Blender does the exact same thing as described above. Object B does end up in the coordinate space of Object A.

But the coordinates you see in the UI - in the item panel of the 3D view - are still displaying x=2.0, y=2.0, z=2.0. I guess you expected it to display the coordinates in local space like x=-8.0, y=-8.0, z=-8.0.

What you see in that place of the UI is the "location" tied to the so called "Input Matrix" resp. matrix_basis. The "Input Matrix" is neither the global matrix nor the local matrix, but a particular matrix for user input. Citing the docs:

Matrix access to location, rotation and scale (including deltas), before constraints and parenting are applied

https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.matrix_basis

So it’s kind of an unspoilt matrix that is not "polluted" by constraints or parenting. You could add a "Limit Location" constraint to Object B, limit its location to 0/0/0, but the input matrix remains on 2/2/2.

The "location" that is actually displayed in the UI is the input matrix without delta transforms.

On the one hand it’s a pretty clean and stable matrix to keep user input separate from other influences. On the other hand I can understand that you’d like to see and edit the final/actual coordinates in local space after parenting.

Possible Solutions

Here’s a corresponding feature request with some discussion: https://blender.community/c/rightclickselect/hLdbbc/

In there they’re mentioning an addon that adds direct access to world and local matrix in the object properties: https://gitlab.com/blender3d/addons/object-location-edit/-/releases#v0.03

And here’s an addon that transforms the matrix values in a way that the values of the input matrix become those of the local matrix: https://github.com/drewcassidy/blender-apply-parent-inverse

You can see and edit all these matrices without any plugin in the Outliner:

  • Set the Outliner’s display mode to "Data API"
  • Object -> "Object B" -> Matrix World / Local Matrix / Input Matrix / Parent Inverse Matrix

Checking out the local matrix you’ll see Object B's coordinates are: x=-8.0, y=-8.0, z=-8.0 indeed.

$\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.