summaryrefslogtreecommitdiffstats
path: root/modules/fbx/fbx_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fbx/fbx_document.cpp')
-rw-r--r--modules/fbx/fbx_document.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/fbx/fbx_document.cpp b/modules/fbx/fbx_document.cpp
index bde23289f4..44a929d285 100644
--- a/modules/fbx/fbx_document.cpp
+++ b/modules/fbx/fbx_document.cpp
@@ -1629,6 +1629,9 @@ void FBXDocument::_generate_skeleton_bone_node(Ref<FBXState> p_state, const GLTF
active_skeleton = skeleton;
current_node = active_skeleton;
+ if (active_skeleton) {
+ p_scene_parent = active_skeleton;
+ }
if (requires_extra_node) {
current_node = nullptr;
@@ -2019,8 +2022,8 @@ Node *FBXDocument::generate_scene(Ref<GLTFState> p_state, float p_bake_fps, bool
GLTFNodeIndex fbx_root = state->root_nodes.write[0];
Node *fbx_root_node = state->get_scene_node(fbx_root);
Node *root = fbx_root_node;
- if (fbx_root_node && fbx_root_node->get_parent()) {
- root = fbx_root_node->get_parent();
+ if (root && root->get_owner() && root->get_owner() != root) {
+ root = root->get_owner();
}
ERR_FAIL_NULL_V(root, nullptr);
_process_mesh_instances(state, root);