|
@@ -8554,18 +8554,16 @@ Error GLTFDocument::append_from_scene(Node *p_node, Ref<GLTFState> p_state, uint
|
|
// Add the root node(s) and their descendants to the state.
|
|
// Add the root node(s) and their descendants to the state.
|
|
if (_root_node_mode == RootNodeMode::ROOT_NODE_MODE_MULTI_ROOT) {
|
|
if (_root_node_mode == RootNodeMode::ROOT_NODE_MODE_MULTI_ROOT) {
|
|
const int child_count = p_node->get_child_count();
|
|
const int child_count = p_node->get_child_count();
|
|
- if (child_count > 0) {
|
|
|
|
- for (int i = 0; i < child_count; i++) {
|
|
|
|
- _convert_scene_node(state, p_node->get_child(i), -1, -1);
|
|
|
|
- }
|
|
|
|
- state->scene_name = p_node->get_name();
|
|
|
|
- return OK;
|
|
|
|
|
|
+ for (int i = 0; i < child_count; i++) {
|
|
|
|
+ _convert_scene_node(state, p_node->get_child(i), -1, -1);
|
|
}
|
|
}
|
|
|
|
+ state->scene_name = p_node->get_name();
|
|
|
|
+ } else {
|
|
|
|
+ if (_root_node_mode == RootNodeMode::ROOT_NODE_MODE_SINGLE_ROOT) {
|
|
|
|
+ state->extensions_used.append("GODOT_single_root");
|
|
|
|
+ }
|
|
|
|
+ _convert_scene_node(state, p_node, -1, -1);
|
|
}
|
|
}
|
|
- if (_root_node_mode == RootNodeMode::ROOT_NODE_MODE_SINGLE_ROOT) {
|
|
|
|
- state->extensions_used.append("GODOT_single_root");
|
|
|
|
- }
|
|
|
|
- _convert_scene_node(state, p_node, -1, -1);
|
|
|
|
// Run post-convert for each extension, in case an extension needs to do something after converting the scene.
|
|
// Run post-convert for each extension, in case an extension needs to do something after converting the scene.
|
|
for (Ref<GLTFDocumentExtension> ext : document_extensions) {
|
|
for (Ref<GLTFDocumentExtension> ext : document_extensions) {
|
|
ERR_CONTINUE(ext.is_null());
|
|
ERR_CONTINUE(ext.is_null());
|