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
bfa9be85
Commit
bfa9be85
authored
Feb 23, 2019
by
Juan Linietsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove copy and use instance material override in gizmos, fixes #23783
parent
6cd4006f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
spatial_editor_plugin.h
editor/plugins/spatial_editor_plugin.h
+2
-1
spatial_editor_gizmos.cpp
editor/spatial_editor_gizmos.cpp
+7
-4
path.cpp
scene/3d/path.cpp
+3
-0
No files found.
editor/plugins/spatial_editor_plugin.h
View file @
bfa9be85
...
...
@@ -60,6 +60,7 @@ public:
RID
instance
;
Ref
<
ArrayMesh
>
mesh
;
Ref
<
Material
>
material
;
RID
skeleton
;
bool
billboard
;
bool
unscaled
;
...
...
@@ -103,7 +104,7 @@ protected:
public
:
void
add_lines
(
const
Vector
<
Vector3
>
&
p_lines
,
const
Ref
<
Material
>
&
p_material
,
bool
p_billboard
=
false
);
void
add_mesh
(
const
Ref
<
ArrayMesh
>
&
p_mesh
,
bool
p_billboard
=
false
,
const
RID
&
p_skeleton
=
RID
());
void
add_mesh
(
const
Ref
<
ArrayMesh
>
&
p_mesh
,
bool
p_billboard
=
false
,
const
RID
&
p_skeleton
=
RID
()
,
const
Ref
<
Material
>
&
p_material
=
Ref
<
Material
>
()
);
void
add_collision_segments
(
const
Vector
<
Vector3
>
&
p_lines
);
void
add_collision_triangles
(
const
Ref
<
TriangleMesh
>
&
p_tmesh
);
void
add_unscaled_billboard
(
const
Ref
<
Material
>
&
p_material
,
float
p_scale
=
1
);
...
...
editor/spatial_editor_gizmos.cpp
View file @
bfa9be85
...
...
@@ -179,7 +179,7 @@ void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base, bool p_hidde
VS
::
get_singleton
()
->
instance_set_layer_mask
(
instance
,
layer
);
//gizmos are 26
}
void
EditorSpatialGizmo
::
add_mesh
(
const
Ref
<
ArrayMesh
>
&
p_mesh
,
bool
p_billboard
,
const
RID
&
p_skeleton
)
{
void
EditorSpatialGizmo
::
add_mesh
(
const
Ref
<
ArrayMesh
>
&
p_mesh
,
bool
p_billboard
,
const
RID
&
p_skeleton
,
const
Ref
<
Material
>
&
p_material
)
{
ERR_FAIL_COND
(
!
spatial_node
);
Instance
ins
;
...
...
@@ -187,9 +187,13 @@ void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard
ins
.
billboard
=
p_billboard
;
ins
.
mesh
=
p_mesh
;
ins
.
skeleton
=
p_skeleton
;
ins
.
material
=
p_material
;
if
(
valid
)
{
ins
.
create_instance
(
spatial_node
,
hidden
);
VS
::
get_singleton
()
->
instance_set_transform
(
ins
.
instance
,
spatial_node
->
get_global_transform
());
if
(
ins
.
material
.
is_valid
())
{
VS
::
get_singleton
()
->
instance_geometry_set_material_override
(
ins
.
instance
,
p_material
->
get_rid
());
}
}
instances
.
push_back
(
ins
);
...
...
@@ -3519,9 +3523,8 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
if
(
Object
::
cast_to
<
ConcavePolygonShape
>
(
*
s
))
{
Ref
<
ConcavePolygonShape
>
cs2
=
s
;
Ref
<
ArrayMesh
>
mesh
=
cs2
->
get_debug_mesh
()
->
duplicate
();
mesh
->
surface_set_material
(
0
,
material
);
p_gizmo
->
add_mesh
(
mesh
);
Ref
<
ArrayMesh
>
mesh
=
cs2
->
get_debug_mesh
();
p_gizmo
->
add_mesh
(
mesh
,
false
,
RID
(),
material
);
}
if
(
Object
::
cast_to
<
RayShape
>
(
*
s
))
{
...
...
scene/3d/path.cpp
View file @
bfa9be85
...
...
@@ -107,6 +107,9 @@ void PathFollow::_update_transform() {
}
float
bl
=
c
->
get_baked_length
();
if
(
bl
==
0.0
)
{
return
;
}
float
bi
=
c
->
get_bake_interval
();
float
o
=
offset
;
float
o_next
=
offset
+
bi
;
...
...
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