dynamics.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:BlenderRobotDesigner 作者: HBPNeurorobotics 项目源码 文件源码
def execute(self, context):
        bpy.ops.object.parent_set(type='BONE')

        if bpy.context.active_bone.parent:
            to_parent_matrix = bpy.context.active_bone.parent.matrix_local
        else:
            to_parent_matrix = Matrix()
        from_parent_matrix, bone_matrix = bpy.context.active_bone.RobotEditor.getTransform()
        armature_matrix = bpy.context.active_object.matrix_basis

        # find selected physics frame
        for ob in bpy.data.objects:
            if ob.select and ob.RobotEditor.tag == 'PHYSICS_FRAME':
                frame = ob
                print(frame.name)

        # frame.matrix_basis = armature_matrix*to_parent_matrix*from_parent_matrix*bone_matrix
        # frame.matrix_basis = parent_matrix*armature_matrix*bone_matrix
        return {'FINISHED'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号