Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap_object.c
| Show First 20 Lines • Show All 1,832 Lines • ▼ Show 20 Lines | static short snapArmature(SnapData *snapdata, | ||||
| for (int i = snapdata->clip_plane_len; i--;) { | for (int i = snapdata->clip_plane_len; i--;) { | ||||
| mul_v4_m4v4(clip_planes_local[i], tobmat, snapdata->clip_plane[i]); | mul_v4_m4v4(clip_planes_local[i], tobmat, snapdata->clip_plane[i]); | ||||
| } | } | ||||
| bool is_persp = snapdata->view_proj == VIEW_PROJ_PERSP; | bool is_persp = snapdata->view_proj == VIEW_PROJ_PERSP; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| if (arm->edbo) { | if (arm->edbo) { | ||||
| for (EditBone *eBone = arm->edbo->first; eBone; eBone = eBone->next) { | LISTBASE_FOREACH (EditBone *, eBone, arm->edbo) { | ||||
| if (eBone->layer & arm->layer) { | if (eBone->layer & arm->layer) { | ||||
| /* skip hidden or moving (selected) bones */ | /* skip hidden or moving (selected) bones */ | ||||
| if ((eBone->flag & (BONE_HIDDEN_A | BONE_ROOTSEL | BONE_TIPSEL)) == 0) { | if ((eBone->flag & (BONE_HIDDEN_A | BONE_ROOTSEL | BONE_TIPSEL)) == 0) { | ||||
| bool has_vert_snap = false; | bool has_vert_snap = false; | ||||
| if (snapdata->snap_to_flag & SCE_SNAP_MODE_VERTEX) { | if (snapdata->snap_to_flag & SCE_SNAP_MODE_VERTEX) { | ||||
| has_vert_snap = test_projected_vert_dist(&neasrest_precalc, | has_vert_snap = test_projected_vert_dist(&neasrest_precalc, | ||||
| clip_planes_local, | clip_planes_local, | ||||
| Show All 26 Lines | LISTBASE_FOREACH (EditBone *, eBone, arm->edbo) { | ||||
| retval = SCE_SNAP_MODE_EDGE; | retval = SCE_SNAP_MODE_EDGE; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else if (ob->pose && ob->pose->chanbase.first) { | else if (ob->pose && ob->pose->chanbase.first) { | ||||
| for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { | ||||
| Bone *bone = pchan->bone; | Bone *bone = pchan->bone; | ||||
| /* skip hidden bones */ | /* skip hidden bones */ | ||||
| if (bone && !(bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) { | if (bone && !(bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) { | ||||
| bool has_vert_snap = false; | bool has_vert_snap = false; | ||||
| const float *head_vec = pchan->pose_head; | const float *head_vec = pchan->pose_head; | ||||
| const float *tail_vec = pchan->pose_tail; | const float *tail_vec = pchan->pose_tail; | ||||
| if (snapdata->snap_to_flag & SCE_SNAP_MODE_VERTEX) { | if (snapdata->snap_to_flag & SCE_SNAP_MODE_VERTEX) { | ||||
| ▲ Show 20 Lines • Show All 1,426 Lines • Show Last 20 Lines | |||||