Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 5883d1d37ab8 src/luxrender/export/__init__.py
- --- a/src/luxrender/export/__init__.py Thu Sep 08 21:15:26 2011 -0700
- +++ b/src/luxrender/export/__init__.py Mon Sep 12 23:45:06 2011 +0200
- @@ -289,6 +289,42 @@
- next_matrix *= mathutils.Matrix.Scale(anim_scale[2], 4, mathutils.Vector([0,0,1]))
- return next_matrix
- + elif obj.parent != None and obj.parent.type == 'ARMATURE' and obj.parent.animation_data.action != None and len(obj.parent.animation_data.action.fcurves)>0:
- + print('**** object_anim_matrix ***')
- + next_frame = scene.frame_current + frame_offset
- +
- + # get the parent bone
- + if obj.parent_type != 'BONE':
- + return False
- +
- + print(obj.matrix_local)
- +
- + bone = obj.parent.pose.bones[obj.parent_bone]
- +
- + anim_location = bone.location.copy()
- + anim_rotation = bone.rotation_euler.copy()
- + anim_scale = bone.scale.copy()
- +
- + for fc in obj.parent.animation_data.action.fcurves:
- + if fc.data_path.endswith('location'):
- + anim_location[fc.array_index] = fc.evaluate(next_frame)
- + if fc.data_path.endswith('rotation_euler'):
- + anim_rotation[fc.array_index] = fc.evaluate(next_frame)
- + if fc.data_path.endswith('scale'):
- + anim_scale[fc.array_index] = fc.evaluate(next_frame)
- +
- + next_matrix = mathutils.Matrix.Translation( mathutils.Vector((anim_location.x, -anim_location.z, anim_location.y)) )
- + anim_rotn_e = mathutils.Euler(anim_rotation)
- + anim_rotn_e.make_compatible(bone.rotation_euler)
- + anim_rotn_e = anim_rotn_e.to_matrix().to_4x4()
- + next_matrix *= anim_rotn_e
- +
- + if not ignore_scale:
- + next_matrix *= mathutils.Matrix.Scale(anim_scale[0], 4, mathutils.Vector([1,0,0]))
- + next_matrix *= mathutils.Matrix.Scale(anim_scale[1], 4, mathutils.Vector([0,1,0]))
- + next_matrix *= mathutils.Matrix.Scale(anim_scale[2], 4, mathutils.Vector([0,0,1]))
- +
- + return next_matrix
- else:
- return False
Add Comment
Please, Sign In to add comment