operator.py 文件源码

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

项目:Workplane 作者: BenjaminSauder 项目源码 文件源码
def set_transform_orientation(self, context, transform_orientation):
        #print("catching space: " + transform_orientation) 

        #op.create_orientation doesn't work if nothing is selected, so I missuse the view orientation a bit to cicumvent
        use_view = transform_orientation == "VIEW" or transform_orientation.endswith("_EMPTY")
        bpy.ops.transform.create_orientation(name=work_plane, use=True, use_view=use_view, overwrite=True)

        current = context.space_data.current_orientation

        if transform_orientation.startswith("GLOBAL"):
            current.matrix = Matrix().to_3x3()

        if transform_orientation.startswith("LOCAL"):
            active_object = context.active_object
            current.matrix = active_object.matrix_world.to_3x3()   

        return current.matrix
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号