diff --git a/lib/linux_x64 b/lib/linux_x64 index da374aa9efb..304b70c2a30 160000 --- a/lib/linux_x64 +++ b/lib/linux_x64 @@ -1 +1 @@ -Subproject commit da374aa9efb4f5a2768b8d863830d95cc4d7031a +Subproject commit 304b70c2a30e62556f9d74c2035c84a3d4dbaef5 diff --git a/scripts/addons_core/io_scene_gltf2/__init__.py b/scripts/addons_core/io_scene_gltf2/__init__.py index cd20b179084..843d70f46dc 100755 --- a/scripts/addons_core/io_scene_gltf2/__init__.py +++ b/scripts/addons_core/io_scene_gltf2/__init__.py @@ -5,7 +5,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (5, 0, 2), + "version": (5, 0, 3), 'blender': (4, 4, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/scripts/addons_core/io_scene_gltf2/blender/imp/vnode.py b/scripts/addons_core/io_scene_gltf2/blender/imp/vnode.py index fce1850cc45..4b36793a2ee 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/imp/vnode.py +++ b/scripts/addons_core/io_scene_gltf2/blender/imp/vnode.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import bpy +from itertools import chain from mathutils import Vector, Quaternion, Matrix from ...io.imp.gltf2_io_binary import BinaryData from ..com.gltf2_blender_math import scale_rot_swap_matrix, nearby_signed_perm_matrix @@ -242,6 +243,7 @@ def manage_gpu_instancing(gltf, vnode, i, ext, mesh_id): inst_vnode.children = [] inst_vnode.base_trs = get_inst_trs(gltf, trans_list[inst], rot_list[inst], scale_list[inst]) inst_vnode.mesh_idx = mesh_id + # Do not set scenes here, this will be handle later by recursive add_nodes_to_scene vnode.children.append(inst_id) @@ -283,6 +285,13 @@ def mark_bones_and_armas(gltf): gltf.vnodes[arma_id].type = VNode.Object gltf.vnodes[arma_id].is_arma = True gltf.vnodes[arma_id].arma_name = skin.name or 'Armature' + # Because the dummy root node is no more an dummy node, but a real armature object, + # We need to set the scenes on the vnode + gltf.vnodes[arma_id].scenes = list( + set(chain.from_iterable( + gltf.vnodes[joint].scenes for joint in skin.joints + )) + ) for joint in skin.joints: while joint != arma_id: @@ -434,6 +443,7 @@ def fixup_multitype_nodes(gltf): gltf.vnodes[new_id] = VNode() gltf.vnodes[new_id].mesh_node_idx = vnode.mesh_node_idx gltf.vnodes[new_id].parent = id + gltf.vnodes[new_id].scenes = vnode.scenes vnode.children.append(new_id) vnode.mesh_node_idx = None needs_move = True @@ -444,6 +454,7 @@ def fixup_multitype_nodes(gltf): gltf.vnodes[new_id] = VNode() gltf.vnodes[new_id].camera_node_idx = vnode.camera_node_idx gltf.vnodes[new_id].parent = id + gltf.vnodes[new_id].scenes = vnode.scenes vnode.children.append(new_id) vnode.camera_node_idx = None needs_move = True @@ -454,6 +465,7 @@ def fixup_multitype_nodes(gltf): gltf.vnodes[new_id] = VNode() gltf.vnodes[new_id].light_node_idx = vnode.light_node_idx gltf.vnodes[new_id].parent = id + gltf.vnodes[new_id].scenes = vnode.scenes vnode.children.append(new_id) vnode.light_node_idx = None needs_move = True