#NEWLINE# @ staticmethod #NEWLINE# def convertVMDBoneRotationToBlender( blender_bone , rotation ) : #NEWLINE# #INDENT# if ( not isinstance ( rotation , mathutils . Quaternion ) ) : #NEWLINE# #INDENT# rot = mathutils . Quaternion ( ) #NEWLINE# ( rot . x , rot . y , rot . z , rot . w ) = rotation #NEWLINE# rotation = rot #NEWLINE# #UNINDENT# mat = mathutils . Matrix ( ) #NEWLINE# ( mat [ 0 ] [ 0 ] , mat [ 1 ] [ 0 ] , mat [ 2 ] [ 0 ] ) = ( blender_bone . x_axis . x , blender_bone . y_axis . x , blender_bone . z_axis . x ) #NEWLINE# ( mat [ 0 ] [ 1 ] , mat [ 1 ] [ 1 ] , mat [ 2 ] [ 1 ] ) = ( blender_bone . x_axis . y , blender_bone . y_axis . y , blender_bone . z_axis . y ) #NEWLINE# ( mat [ 0 ] [ 2 ] , mat [ 1 ] [ 2 ] , mat [ 2 ] [ 2 ] ) = ( blender_bone . x_axis . z , blender_bone . y_axis . z , blender_bone . z_axis . z ) #NEWLINE# ( vec , angle ) = rotation . to_axis_angle ( ) #NEWLINE# v = mathutils . Vector ( ( ( - vec . x ) , ( - vec . z ) , ( - vec . y ) ) ) #NEWLINE# return mathutils . Quaternion ( ( mat * v ) , angle ) . normalized ( )