possible bug in Blender: misbehaving child object

I’ve stumbled upon a problem in Blender but I don’t know whether there’s something I’m misunderstanding or whether there’s a real bug. I’m inclined to think the latter but I’d like feedback before I file a bug report about this.

Here is my understanding:

  1. An object which has no parent has global coordinates but no local coordinates. Or maybe you could say the local coordinates are equal to the global coordinates. The two sets of coordinates can never be different if the object has no parent.

  2. An object which has a parent has global coordinates and local coordinates and the two set of coordinates can be different. The local coordinates represent the child’s position relative to its parent.

  3. In the sentence “the coordinates of an object”, the word “coordinates” can refer to different sets of coordinates depending on whether or not the object has a parent. If the object has no parent, the “coordinates” are global coordinates. If the object has a parent, the “coordinates” are local coordinates.

So in effect, after object A is made a child of object B, then “object A’s coordinates” are the local coordinates of object A relative to its parent B.

If I do not change anything else but make object A a child of object B a second time, it should have no effect on A’s coordinates.

But I’ve found that in fact it does have an effect. I think this is a bug.

I’m attaching two files.

parenting_works1: In this file, parenting works as expected. The parent object (named Parent) has an IPO making it rotate on its Z axis. The child also has an IPO changing its coordinates from whatever value they have at frame 1 to (0,0,0). So the child (named Child) rotates around the parent but at the same time it gets nearer to the parent up to the point of having the same global coordinates as the parent.

parenting_fails: In this file, parenting does not work at all as expected. The only difference between the first file and this one is that I’ve made Child a child of Parent a second time. But this time around, the child does not end up at the same location as the parent.

The way to see this is to play the frames back and forth in the Timeline window.

Now, someone might point out that the child object in the second file starts at a different position than in the first file so I’m confused and did not set my testing apparatus properly. Yes, the child is in a different position but that’s another manifestation of the phenomenon I’m reporting. The way to find this out is as follows:

  1. Open parenting_works1.blend.

  2. Select the child and then the parent. Hit Ctrl-P and accept the parenting. What you’ve done is reparenting the child to the same parent it has. This operation should have no effect whatsoever.

  3. Go into the Timeline window and switch the current frame to 2. Pay attention to the child object and see how it jumps position. If you go back to the first frame, it won’t return to its original position either.

I found that the way to restore normal behavior is to select the child and issue “Clear Location” and “Clear Origin”. Then the child will behave as intended.

If this is not a bug, then please explain the logic.

Attachments

parenting_works1.blend (143 KB)parenting_fails.blend (143 KB)

No, thats not correct. See this page:
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Coordinate_Spaces_in_Blender

No. An object with a parent sees the coordinates of the parent as its global coordinate system.

So parenting an object to another does more than one thing, because the child needs to get an artificial offset to its parent to stay on its place (it gets an inverse matrix transformation). Try Alt-P->Clear parent inverse to remove this inverse matrix.

You may also parent with Ctrl-Shift-P->Make parent without inverse. This parents without the inverse matrix but clears Location.

So the inverse matrix is different in the second case.

Thanks for the reply. Let’s tackle the matter of interpretation before dealing with anything else. I checked again and I believe my interpretation is correct.

See the attachment. If you open it and hit Alt-P in the Text window, you’ll get this out on the console:

localspace coordinates:  (0.0, 4.0, 0.0)
worldspace coordinates:  (4.0, 4.0, 0.0)
unparented
localspace coordinates:  (0.0, 4.0, 0.0)
worldspace coordinates:  (0.0, 4.0, 0.0)

These are the coordinates of Child as reported by Blender. As long as the Child has a parent, the localspace coordinates are relative to the parent and the worldspace coordinates ( == globalspace) are relative to the world origin. As soon as the child loses its parent (after the “unparented” line), its local coordinates and world coordinates are identical.

This illustrates what I said in my initial post.

Attachments

coordinates_example.blend (141 KB)

Thanks for the reply. Let’s tackle the matter of interpretation before dealing with anything else. I checked again and I believe my interpretation is correct.

See the attachment. If you open it and hit Alt-P in the Text window, you’ll get this out on the console:

localspace coordinates:  (0.0, 4.0, 0.0)
worldspace coordinates:  (4.0, 4.0, 0.0)
unparented
localspace coordinates:  (0.0, 4.0, 0.0)
worldspace coordinates:  (0.0, 4.0, 0.0)

These are the coordinates of Child as reported by Blender. As long as the Child has a parent, the localspace coordinates are relative to the parent and the worldspace coordinates ( == globalspace) are relative to the world origin. As soon as the child loses its parent (after the “unparented” line), its local coordinates and world coordinates are identical.

This illustrates what I said in my initial post.

(3rd attempt to post this reply… for some reason the first two tries did no seem to go through.)

Thanks for the reply. Let’s tackle the matter of interpretation before dealing with anything else. I checked again and I believe my interpretation is correct.

See the attachment. If you open it and hit Alt-P in the Text window, you’ll get this out on the console:

localspace coordinates: (0.0, 4.0, 0.0)
worldspace coordinates: (4.0, 4.0, 0.0)
unparented
localspace coordinates: (0.0, 4.0, 0.0)
worldspace coordinates: (0.0, 4.0, 0.0)

These are the coordinates of Child as reported by Blender. As long as the Child has a parent, the localspace coordinates are relative to the parent and the worldspace coordinates ( == globalspace) are relative to the world origin. As soon as the child loses its parent (after the “unparented” line), its local coordinates and world coordinates are identical.

This illustrates what I said in my initial post.