mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00: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
1 changed files with 8 additions and 10 deletions
|
@ -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++) {
|
||||||
for (int i = 0; i < child_count; i++) {
|
_convert_scene_node(state, p_node->get_child(i), -1, -1);
|
||||||
_convert_scene_node(state, p_node->get_child(i), -1, -1);
|
|
||||||
}
|
|
||||||
state->scene_name = p_node->get_name();
|
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
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());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue