Maniphest T76556

Object join doesn't respect parenting
Closed, Resolved

Assigned To
Hans Goudey (HooglyBoogly)
Authored By
Ricardo de Sena (rsenas)
May 8 2020, 5:01 PM
Tags
  • BF Blender
  • Modeling
Subscribers
Alaska (Alaska)
Ankit Meel (ankitm)
Brecht Van Lommel (brecht)
Hans Goudey (HooglyBoogly)
Ricardo de Sena (rsenas)
sok0

Description

System Information
Operating system: Windows 10
Graphics card: NVidia GeForce Gt730

Blender Version
Blender 2.82A and Blender 2.83Beta 2020/05/08

Short description of error
When selecting two objects and doing the command Ctrl + Join they disappear.

Exact steps for others to reproduce the error

The error occurs when selecting the smallest and then the largest object and pressing Ctrl+J
But when selecting the big one and then the small one the error doesn't happen.

Revisions and Commits

rB Blender
D7723

Event Timeline

Ricardo de Sena (rsenas) created this task.May 8 2020, 5:01 PM
Ankit Meel (ankitm) updated the task description.May 8 2020, 6:11 PM
Ankit Meel (ankitm) renamed this task from Crash on Ctrl+Join two objects in mode object. to Objects disappear on Ctrl+Join based on order of selection.May 8 2020, 6:28 PM
Ankit Meel (ankitm) changed the task status from Needs Triage to Confirmed.
Ankit Meel (ankitm) updated the task description.
Ankit Meel (ankitm) added a project: Modeling.
Ankit Meel (ankitm) added a subscriber: Ankit Meel (ankitm).
Alaska (Alaska) added a subscriber: Alaska (Alaska).EditedMay 9 2020, 12:07 AM

@Ankit Meel (ankitm) I don't believe this is a bug. The small object is being joined to a large object. The large object is the child of the small object and has a different position to the parent.
The objects doesn't disappear, they just shift to the location of the child object which is now "reset" because it no longer has a parent to reference it's location off of.

If you unparent the objects then join them, the issue does not occur.

Ankit Meel (ankitm) changed the task status from Confirmed to Needs Triage.May 9 2020, 8:11 AM
Ankit Meel (ankitm) closed this task as Archived.EditedMay 9 2020, 9:36 AM
Ankit Meel (ankitm) claimed this task.

Right, I didn't check in outliner.

Brecht Van Lommel (brecht) reopened this task as Confirmed.May 9 2020, 4:41 PM
Brecht Van Lommel (brecht) removed Ankit Meel (ankitm) as the assignee of this task.
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

The object transform including parenting should be applied to the vertex coordinates, so that the joined vertices remain in the same location.

Ricardo de Sena (rsenas) added a comment.May 11 2020, 6:25 PM

Always learning and being more attentive. Thank you.

Hans Goudey (HooglyBoogly) claimed this task.EditedMay 12 2020, 9:30 PM
Hans Goudey (HooglyBoogly) added a subscriber: Hans Goudey (HooglyBoogly).

Here's a simpler demonstration. The problem is a bit different with different object types.

  • Mesh: Parent and child use the child transform without parenting.
  • Curve: Same
  • Gpencil: Parent stays in the same location, child uses its own transform.
  • Armature: Dependency cycle. This probably doesn't apply here.

Hans Goudey (HooglyBoogly) renamed this task from Objects disappear on Ctrl+Join based on order of selection to Object join doesn't respect parent transform of child object.May 12 2020, 9:37 PM
Hans Goudey (HooglyBoogly) renamed this task from Object join doesn't respect parent transform of child object to Object join doesn't respect parenting.
sok0 added a subscriber: sok0.EditedMay 13 2020, 4:22 PM

Isn't this behavior to be expected due to the parent inverse matrix? The parent object has moved since it was parented to the child object (verified below) . As a result the child object moves back to its basis transform location when the parenting relationship is broken.

To avoid this quirk of the parent inverse matrix, there are two options:

  1. Apply all transforms to the parent with Ctrl+A. This will also reset the parent inverse matrix of child objects
  2. Clear Parent and Keep Transformation on the child with Alt+P.

Either way, you then can join objects with the desired result, no need to change to the join operator.

footnote:

# move parent back to it's original location at time of parenting
bpy.data.objects['Slice.006'].matrix_basis = bpy.data.objects['Slice.004'].matrix_parent_inverse.inverted()
#undo the parenting operation
bpy.data.objects['Slice.004'].parent = None
Hans Goudey (HooglyBoogly) closed this task as Resolved by committing rB5e96c4385469: Fix T76556: Apply parenting when joining parent into object.May 13 2020, 9:22 PM
Hans Goudey (HooglyBoogly) added a commit: rB5e96c4385469: Fix T76556: Apply parenting when joining parent into object.
Hans Goudey (HooglyBoogly) added a comment.May 13 2020, 9:28 PM
In T76556#930761, @sok0 wrote:

Either way, you then can join objects with the desired result, no need to change to the join operator.

The change is simple anyway, and avoids the need for applying the parent transform first.