美文网首页
blender 计算bvh运动轨迹备忘

blender 计算bvh运动轨迹备忘

作者: 皿卜土 | 来源:发表于2019-08-02 06:33 被阅读0次

简单设定动画

import bpy
C = bpy.context

positions = (0,0,0),(0,0,0.1),(0,0,0.3),(0,0,0.5)
frame_num = 0

for p in positions:
    C.scene.frame_set(frame_num)
    C.active_object.location = p
    C.active_object.keyframe_insert(data_path="location")
    frame_num += 1

FK在pos模式下的运动轨迹

import bpy
C = bpy.context
D = bpy.data

armature = D.objects['short']
target = 'mixamorig:LeftFoot'
for i in range(1,20):
    C.scene.frame_set(i)
    C.active_object.location = armature.pose.bones[target].matrix.translation
    C.active_object.rotation_euler = armature.pose.bones[target].matrix.to_euler('XYZ')
    C.active_object.scale = armature.pose.bones[target].matrix.to_scale()
    C.active_object.keyframe_insert(data_path="location")
    C.active_object.keyframe_insert(data_path="rotation_euler")
    C.active_object.keyframe_insert(data_path="scale")

C.scene.frame_set(0)

相关文章

网友评论

      本文标题:blender 计算bvh运动轨迹备忘

      本文链接:https://www.haomeiwen.com/subject/sbfkdctx.html