import bpy, json, math from mathutils import Vector rig = next(o for o in bpy.data.objects if o.name.startswith("DockArm_Rig")) out = {} for k in (1, 2, 3): t = bpy.data.objects["_Tender%d" % k] pb = rig.pose.bones["Arm%d_Head" % k] wrist = rig.matrix_world @ pb.head tl = t.matrix_world.translation inv = t.matrix_world.inverted() out[k] = {"tender_origin": [round(c, 4) for c in tl], "wrist": [round(c, 4) for c in wrist], "wrist_in_tender_frame": [round(c, 4) for c in inv @ wrist], "parent": t.parent.name if t.parent else None, "parent_bone": t.parent_bone, "inst_offset": [round(c, 4) for c in t.instance_collection.instance_offset]} # the Kazah's collar in the ship: centre of its Hatch_Collar ring in the Tender's frame kz = bpy.data.objects["_Tender1"].instance_collection hc = next(o for o in kz.objects if o.name.startswith("Hatch_Collar")) vs = [hc.matrix_world @ v.co for v in hc.data.vertices if abs((hc.matrix_world @ v.co).z - 0.75) < 0.03] cx = sum(v.x for v in vs) / len(vs); cy = sum(v.y for v in vs) / len(vs) out["kazah_collar_centre_own_frame"] = [round(cx, 4), round(cy, 4)] print("PROBE", json.dumps(out))