Skip to content
Snippets Groups Projects
Commit d22cc667 authored by Candoran2's avatar Candoran2 Committed by neomonkeus
Browse files

Change import of bone bind matrix to directly set matrix.

parent 104485aa
No related branches found
No related tags found
No related merge requests found
......@@ -243,11 +243,9 @@ class Armature:
# get transformation in blender's coordinate space
b_bind = math.nif_bind_to_blender_bind(n_bind)
# the following is a workaround because blender can no longer set matrices to bones directly
tail, roll = bpy.types.Bone.AxisRollFromMatrix(b_bind.to_3x3())
b_edit_bone.head = b_bind.to_translation()
b_edit_bone.tail = tail + b_edit_bone.head
b_edit_bone.roll = roll
# set the bone matrix - but set the tail first to prevent issues with zero-length bone
b_edit_bone.tail = mathutils.Vector3([0,0,1])
b_edit_bone.matrix = b_bind
# link to parent
if b_parent_bone:
b_edit_bone.parent = b_parent_bone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment