summaryrefslogtreecommitdiffstats
path: root/editor/plugins/path_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-09-05 18:11:56 +0200
committerGitHub <noreply@github.com>2018-09-05 18:11:56 +0200
commit8804eb8c061634f740af04132b2c68e5c27c449d (patch)
treeb9cdc64ce976705bec97cc6d21546c77fd6a8dfb /editor/plugins/path_editor_plugin.cpp
parent2f4912ec69a07d62a4b56a5be6d8ada59516b310 (diff)
parent4a412943d4a80703a178396be34e2576f891bc80 (diff)
downloadredot-engine-8804eb8c061634f740af04132b2c68e5c27c449d.tar.gz
Merge pull request #21707 from JFonS/fix_instanced_selection
Fix selection of instanced scenes in 3D
Diffstat (limited to 'editor/plugins/path_editor_plugin.cpp')
-rw-r--r--editor/plugins/path_editor_plugin.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index d74cd11cbc..df6c40ed02 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -215,8 +215,8 @@ void PathSpatialGizmo::redraw() {
clear();
- Ref<SpatialMaterial> path_material = gizmo_plugin->get_material("path_material");
- Ref<SpatialMaterial> path_thin_material = gizmo_plugin->get_material("path_thin_material");
+ Ref<SpatialMaterial> path_material = gizmo_plugin->get_material("path_material", this);
+ Ref<SpatialMaterial> path_thin_material = gizmo_plugin->get_material("path_thin_material", this);
Ref<SpatialMaterial> handles_material = gizmo_plugin->get_material("handles");
Ref<Curve3D> c = path->get_curve();
@@ -641,24 +641,8 @@ String PathSpatialGizmoPlugin::get_name() const {
PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() {
Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8));
-
- Ref<SpatialMaterial> path_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
- path_color.a = 0.8;
- path_material->set_albedo(path_color);
- path_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
- path_material->set_line_width(3);
- path_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
- path_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
-
- Ref<SpatialMaterial> path_thin_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
+ create_material("path_material", path_color);
path_color.a = 0.4;
- path_thin_material->set_albedo(path_color);
- path_thin_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
- path_thin_material->set_line_width(1);
- path_thin_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
- path_thin_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
-
- add_material("path_material", path_material);
- add_material("path_thin_material", path_thin_material);
+ create_material("path_thin_material", path_color);
create_handle_material("handles");
}