Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
41af859c
Commit
41af859c
authored
Jun 07, 2020
by
Marcus Brummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-apply basis of newly added node (via drag-n-drop) in editor viewport
parent
ec1bf96e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
node_3d_editor_plugin.cpp
editor/plugins/node_3d_editor_plugin.cpp
+7
-3
No files found.
editor/plugins/node_3d_editor_plugin.cpp
View file @
41af859c
...
@@ -3658,15 +3658,19 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
...
@@ -3658,15 +3658,19 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
editor_data
->
get_undo_redo
().
add_do_method
(
ed
,
"live_debug_instance_node"
,
editor
->
get_edited_scene
()
->
get_path_to
(
parent
),
path
,
new_name
);
editor_data
->
get_undo_redo
().
add_do_method
(
ed
,
"live_debug_instance_node"
,
editor
->
get_edited_scene
()
->
get_path_to
(
parent
),
path
,
new_name
);
editor_data
->
get_undo_redo
().
add_undo_method
(
ed
,
"live_debug_remove_node"
,
NodePath
(
String
(
editor
->
get_edited_scene
()
->
get_path_to
(
parent
))
+
"/"
+
new_name
));
editor_data
->
get_undo_redo
().
add_undo_method
(
ed
,
"live_debug_remove_node"
,
NodePath
(
String
(
editor
->
get_edited_scene
()
->
get_path_to
(
parent
))
+
"/"
+
new_name
));
Node3D
*
node3d
=
Object
::
cast_to
<
Node3D
>
(
instanced_scene
);
if
(
node3d
)
{
Transform
global_transform
;
Transform
global_transform
;
Node3D
*
parent_spatial
=
Object
::
cast_to
<
Node3D
>
(
parent
);
Node3D
*
parent_node3d
=
Object
::
cast_to
<
Node3D
>
(
parent
);
if
(
parent_spatial
)
{
if
(
parent_node3d
)
{
global_transform
=
parent_spatial
->
get_global_gizmo_transform
();
global_transform
=
parent_node3d
->
get_global_gizmo_transform
();
}
}
global_transform
.
origin
=
spatial_editor
->
snap_point
(
_get_instance_position
(
p_point
));
global_transform
.
origin
=
spatial_editor
->
snap_point
(
_get_instance_position
(
p_point
));
global_transform
.
basis
*=
node3d
->
get_transform
().
basis
;
editor_data
->
get_undo_redo
().
add_do_method
(
instanced_scene
,
"set_global_transform"
,
global_transform
);
editor_data
->
get_undo_redo
().
add_do_method
(
instanced_scene
,
"set_global_transform"
,
global_transform
);
}
return
true
;
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment