summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-14 11:59:06 +0200
committerGitHub <noreply@github.com>2021-08-14 11:59:06 +0200
commita96c96ca7241974b1f86156a0ee70a87eae7b3e7 (patch)
tree5cc0668867814ed4c8518c0a9ab2d09dbbf51145 /scene/resources
parent59879447a395adc4ced2ee7e88b0ef1bcc32c82d (diff)
parent7094ccfbe98737e5ba5198f25a49dce252268a5e (diff)
Merge pull request #50147 from aaronfranke/disable-node3d
Disable Node3D when compiling without 3D and fix disable_3d option
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/packed_scene.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index eddbb9a842..54bfc427c4 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -162,12 +162,14 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
}
WARN_PRINT(vformat("Node %s of type %s cannot be created. A placeholder will be created instead.", snames[n.name], snames[n.type]).ascii().get_data());
if (n.parent >= 0 && n.parent < nc && ret_nodes[n.parent]) {
- if (Object::cast_to<Node3D>(ret_nodes[n.parent])) {
- obj = memnew(Node3D);
- } else if (Object::cast_to<Control>(ret_nodes[n.parent])) {
+ if (Object::cast_to<Control>(ret_nodes[n.parent])) {
obj = memnew(Control);
} else if (Object::cast_to<Node2D>(ret_nodes[n.parent])) {
obj = memnew(Node2D);
+#ifndef _3D_DISABLED
+ } else if (Object::cast_to<Node3D>(ret_nodes[n.parent])) {
+ obj = memnew(Node3D);
+#endif // _3D_DISABLED
}
}