Hi! Faced a problem that seems difficult to me as a beginner. Tell me please, I want to get a projection of a point from a human body model onto a plane.
And set the sphere at this point as a mark. I managed to make some progress in the task, but the coordinate transformation was too much for mу.
For making projection I suppose to use next code:
loc = mathutils.geometry.intersect_ray_tri(p1, p2, p3, view_vector, view_point, True) if not loc: loc = mathutils.geometry.intersect_ray_tri(p2, p4, p3, view_vector, view_point, True)
But how I can get the every bone coordinate?
I tried to use that code, but it doesnot work propertly:
pose_obj = bpy.data.objects['Reference'] hip = bpy.data.objects['Reference'].pose.bones["Body1:Hips"] cube = bpy.data.objects['Cube'].pose loc_hip = hip.bone.matrix_local.inverted()