Merge branch 'blender-v4.5-release'

This commit is contained in:
Julien Duroure
2025-06-17 12:02:41 +02:00
3 changed files with 14 additions and 2 deletions

View File

@@ -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',

View File

@@ -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