MEL snippets

Point and Aim constrain a object to 3 vertices

Create three locators/null objects, name the CnstrObj_Aim_Loc_1, CnstrObj_Pos_Loc_1 and CnstrObj_Up_Loc_1. Create a new expression in the expression editor.

float $point_pos[] = `pointPosition Axel_Torso_Geo_1.vtx[335]`;
float $point_aim[] = `pointPosition Axel_Torso_Geo_1.vtx[336]`;
float $point_ref[] = `pointPosition Axel_Torso_Geo_1.vtx[271]`;

Axel_SecurityBadge_Pos_Loc_1.translateX = $point_pos[0];
Axel_SecurityBadge_Pos_Loc_1.translateY = $point_pos[1];
Axel_SecurityBadge_Pos_Loc_1.translateZ = $point_pos[2];

Axel_SecurityBadge_Aim_Loc_1.translateX = $point_aim[0];
Axel_SecurityBadge_Aim_Loc_1.translateY = $point_aim[1];
Axel_SecurityBadge_Aim_Loc_1.translateZ = $point_aim[2];

Axel_SecurityBadge_Ref_Loc_1.translateX = $point_ref[0];
Axel_SecurityBadge_Ref_Loc_1.translateY = $point_ref[1];
Axel_SecurityBadge_Ref_Loc_1.translateZ = $point_ref[2];