Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Phan <darkneter@gmail.com>2011-02-08 19:56:23 +0300
committerJohn Phan <darkneter@gmail.com>2011-02-08 19:56:23 +0300
commitd00841b43fb7d9120b3ad235c6fbfaad2a288ad4 (patch)
treefa4c4e5e28669c8d5bbdaf69223918e623fc4ee4 /io_export_unreal_psk_psa.py
parent7df77158d8942bf43342b8bca3b733f7cf24ab13 (diff)
Fixed quat.
Diffstat (limited to 'io_export_unreal_psk_psa.py')
-rw-r--r--io_export_unreal_psk_psa.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py
index dd5e29ed..14fcd9d1 100644
--- a/io_export_unreal_psk_psa.py
+++ b/io_export_unreal_psk_psa.py
@@ -938,7 +938,7 @@ def make_fquat(bquat):
def make_fquat_default(bquat):
quat = FQuat()
-
+ #print(dir(bquat))
quat.X = bquat.x
quat.Y = bquat.y
quat.Z = bquat.z
@@ -970,8 +970,8 @@ def parse_bone(blender_bone, psk_file, psa_file, parent_id, is_root_bone, parent
if child_parent != None:
quat_root = blender_bone.matrix
quat = make_fquat(quat_root.to_quaternion())
-
- quat_parent = child_parent.matrix.to_quaternion().inverse()
+ #print("DIR:",dir(child_parent.matrix.to_quaternion()))
+ quat_parent = child_parent.matrix.to_quaternion().inverted()
parent_head = child_parent.head * quat_parent
parent_tail = child_parent.tail * quat_parent
@@ -1410,14 +1410,18 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
if parent_pose != None:
parentposemat = mathutils.Matrix(parent_pose.matrix)
#blender 2.4X it been flip around with new 2.50 (mat1 * mat2) should now be (mat2 * mat1)
- posebonemat = parentposemat.invert() * posebonemat
+ posebonemat = parentposemat.inverted() * posebonemat
+ #print("parentposemat ::::",parentposemat)
+ #print("parentposemat ::::",dir(posebonemat.to_quaternion()))
head = posebonemat.to_translation()
- quat = posebonemat.to_quaternion().normalize()
+ quat = posebonemat.to_quaternion().normalized()
+ #print("position :",posebonemat.to_translation(),"quat",posebonemat.to_quaternion().normalized())
+ #print("posebonemat",posebonemat)
vkey = VQuatAnimKey()
vkey.Position.X = head.x
vkey.Position.Y = head.y
vkey.Position.Z = head.z
-
+ #print("quat:",quat)
if parent_pose != None:
quat = make_fquat(quat)
else: