diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-27 10:47:10 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-27 10:47:10 -0600 |
commit | c5cd7c66ee417f6854fb5e36812e870849c46c3e (patch) | |
tree | 46866e6b84e18ebd0ada42389bb1eac119b7571a /editor | |
parent | 06f4bcdefb14c77b553f10a805188057952b9cdf (diff) | |
parent | 612981c1ea7d1beb927b53a2e4056827ed6ca32a (diff) | |
download | redot-engine-c5cd7c66ee417f6854fb5e36812e870849c46c3e.tar.gz |
Merge pull request #85443 from smix8/gridmap_castshadows
Add ShadowCastingSetting to MeshLibrary / GridMap items
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/mesh_library_editor_plugin.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 6f79ab0529..39401e2738 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -156,6 +156,25 @@ void MeshLibraryEditor::_import_scene_parse_node(Ref<MeshLibrary> p_library, Has } p_library->set_item_mesh(item_id, item_mesh); + GeometryInstance3D::ShadowCastingSetting gi3d_cast_shadows_setting = mesh_instance_node->get_cast_shadows_setting(); + switch (gi3d_cast_shadows_setting) { + case GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_OFF: { + p_library->set_item_mesh_cast_shadow(item_id, RS::ShadowCastingSetting::SHADOW_CASTING_SETTING_OFF); + } break; + case GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_ON: { + p_library->set_item_mesh_cast_shadow(item_id, RS::ShadowCastingSetting::SHADOW_CASTING_SETTING_ON); + } break; + case GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_DOUBLE_SIDED: { + p_library->set_item_mesh_cast_shadow(item_id, RS::ShadowCastingSetting::SHADOW_CASTING_SETTING_DOUBLE_SIDED); + } break; + case GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_SHADOWS_ONLY: { + p_library->set_item_mesh_cast_shadow(item_id, RS::ShadowCastingSetting::SHADOW_CASTING_SETTING_SHADOWS_ONLY); + } break; + default: { + p_library->set_item_mesh_cast_shadow(item_id, RS::ShadowCastingSetting::SHADOW_CASTING_SETTING_ON); + } break; + } + Transform3D item_mesh_transform; if (p_apply_xforms) { item_mesh_transform = mesh_instance_node->get_transform(); |