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
b6c17016
Unverified
Commit
b6c17016
authored
Aug 29, 2018
by
Rémi Verschelde
Committed by
GitHub
Aug 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21485 from JFonS/fix_selection
Saner selection code for instanced scenes in 3D, should close #21447
parents
d2abbfb1
b58bb95c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
spatial_editor_plugin.cpp
editor/plugins/spatial_editor_plugin.cpp
+9
-12
No files found.
editor/plugins/spatial_editor_plugin.cpp
View file @
b6c17016
...
...
@@ -307,7 +307,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
Node
*
edited_scene
=
get_tree
()
->
get_edited_scene_root
();
ObjectID
closest
=
0
;
Spatial
*
item
=
NULL
;
Node
*
item
=
NULL
;
float
closest_dist
=
1e20
;
int
selected_handle
=
-
1
;
...
...
@@ -341,19 +341,16 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
if
(
dist
<
closest_dist
)
{
//make sure that whathever is selected is editable
while
(
spat
&&
spat
!=
edited_scene
&&
spat
->
get_owner
()
!=
edited_scene
&&
!
edited_scene
->
is_editable_instance
(
spat
->
get_owner
()))
{
spat
=
Object
::
cast_to
<
Spatial
>
(
spat
->
get_owner
());
}
if
(
spat
)
{
item
=
spat
;
closest
=
spat
->
get_instance_id
();
closest_dist
=
dist
;
selected_handle
=
handle
;
Node
*
owner
=
spat
->
get_owner
();
if
(
owner
!=
edited_scene
&&
!
edited_scene
->
is_editable_instance
(
owner
))
{
item
=
owner
;
}
else
{
ERR_PRINT
(
"Bug?"
);
item
=
Object
::
cast_to
<
Node
>
(
spat
);
}
closest
=
item
->
get_instance_id
();
closest_dist
=
dist
;
selected_handle
=
handle
;
}
}
...
...
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