mirror of
https://github.com/godotengine/godot.git
synced 2025-04-01 00:41:35 +08:00
Merge pull request #104713 from aaronfranke/gltf-post-convert
GLTF: Fix `export_post_convert` not running for multi-root scenes
This commit is contained in:
commit
b13c96b097
@ -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.
|
||||
if (_root_node_mode == RootNodeMode::ROOT_NODE_MODE_MULTI_ROOT) {
|
||||
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.
|
||||
for (Ref<GLTFDocumentExtension> ext : document_extensions) {
|
||||
ERR_CONTINUE(ext.is_null());
|
||||
|
Loading…
x
Reference in New Issue
Block a user