Merge pull request #87126 from ryevdokimov/fix-84424(2)

Fix position and basis of 3D Scenes instantiated via drag and drop
This commit is contained in:
Rémi Verschelde 2024-02-14 14:07:58 +01:00
commit a1cc37966c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -4371,7 +4371,8 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
}
Transform3D new_tf = node3d->get_transform();
new_tf.origin = parent_tf.affine_inverse().xform(preview_node_pos);
new_tf.origin = parent_tf.affine_inverse().xform(preview_node_pos + node3d->get_position());
new_tf.basis = parent_tf.affine_inverse().basis * new_tf.basis;
undo_redo->add_do_method(instantiated_scene, "set_transform", new_tf);
}