def get_render_location(mypoint):
v1 = Vector(mypoint)
scene = bpy.context.scene
co_2d = object_utils.world_to_camera_view(scene, scene.camera, v1)
# Get pixel coords
render_scale = scene.render.resolution_percentage / 100
render_size = (int(scene.render.resolution_x * render_scale),
int(scene.render.resolution_y * render_scale))
return [round(co_2d.x * render_size[0]), round(co_2d.y * render_size[1])]
# ---------------------------------------------------------
# Get center of circle base on 3 points
#
# Point a: (x,y,z) arc start
# Point b: (x,y,z) center
# Point c: (x,y,z) midle point in the arc
# Point d: (x,y,z) arc end
# Return:
# ang: angle (radians)
# len: len of arc
#
# ---------------------------------------------------------
评论列表
文章目录