Skip to content

Commit

Permalink
Merge pull request #87126 from ryevdokimov/fix-84424(2)
Browse files Browse the repository at this point in the history
Fix position and basis of 3D Scenes instantiated via drag and drop
  • Loading branch information
akien-mga committed Feb 14, 2024
2 parents 3a2fb42 + be0104a commit a1cc379
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a1cc379

Please sign in to comment.