Fix for error when exporting mesh with no armature
This commit is contained in:
@@ -130,7 +130,7 @@ def build_psk(context, input_objects: PskInputObjects, options: PskBuildOptions)
|
||||
psk_bone.children_count = 0
|
||||
psk_bone.parent_index = 0
|
||||
psk_bone.location = Vector3.zero()
|
||||
psk_bone.rotation = coordinate_system_default_rotation
|
||||
psk_bone.rotation = Quaternion.from_bpy_quaternion(coordinate_system_default_rotation)
|
||||
psk.bones.append(psk_bone)
|
||||
else:
|
||||
bone_names = get_export_bone_names(armature_object, options.bone_filter_mode, options.bone_collection_indices)
|
||||
|
||||
@@ -2,7 +2,7 @@ from ctypes import *
|
||||
from typing import Tuple
|
||||
|
||||
from bpy.props import EnumProperty
|
||||
from mathutils import Vector, Matrix
|
||||
from mathutils import Vector, Matrix, Quaternion as BpyQuaternion
|
||||
|
||||
|
||||
class Color(Structure):
|
||||
@@ -84,6 +84,15 @@ class Quaternion(Structure):
|
||||
def identity(cls):
|
||||
return Quaternion(0, 0, 0, 1)
|
||||
|
||||
@classmethod
|
||||
def from_bpy_quaternion(cls, other: BpyQuaternion) -> BpyQuaternion:
|
||||
quaternion = Quaternion()
|
||||
quaternion.x = other.x
|
||||
quaternion.y = other.y
|
||||
quaternion.z = other.z
|
||||
quaternion.w = other.w
|
||||
return quaternion
|
||||
|
||||
|
||||
class Section(Structure):
|
||||
_fields_ = [
|
||||
|
||||
Reference in New Issue
Block a user