diff options
author | diddykonga <jacobmaley@yahoo.com> | 2021-12-17 12:04:35 -0600 |
---|---|---|
committer | Diddykonga <jacobmaley@yahoo.com> | 2022-02-17 01:44:13 -0600 |
commit | 78dc608aa891e5076f710bbdb530adbc851832ec (patch) | |
tree | 1fc2e2b4a7595747c72bfd104a618a0039001ce9 /editor/import | |
parent | d4766b2f6cab1f2e38ecfa7de3d0e68eb9139b8c (diff) |
Change 'find_node' to 'find_nodes' and Add 'type' parameter
Changed 'find_node' to 'find_nodes' which now returns an 'TypedArray<Node>', as well as Added a 'type' parameter to match against specific node types, which supports inheritance.
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/scene_import_settings.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 488bd02de4..4e06253041 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -377,9 +377,10 @@ void SceneImportSettings::_update_view_gizmos() { continue; } - MeshInstance3D *collider_view = static_cast<MeshInstance3D *>(mesh_node->find_node("collider_view")); - CRASH_COND_MSG(collider_view == nullptr, "This is unreachable, since the collider view is always created even when the collision is not used! If this is triggered there is a bug on the function `_fill_scene`."); + TypedArray<Node> descendants = mesh_node->find_nodes("collider_view", "MeshInstance3D"); + CRASH_COND_MSG(descendants.is_empty(), "This is unreachable, since the collider view is always created even when the collision is not used! If this is triggered there is a bug on the function `_fill_scene`."); + MeshInstance3D *collider_view = static_cast<MeshInstance3D *>(descendants[0].operator Object *()); collider_view->set_visible(generate_collider); if (generate_collider) { // This collider_view doesn't have a mesh so we need to generate a new one. |