Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_snap.c
| Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| ED_transverts_update_obedit(&tvs, obedit); | ED_transverts_update_obedit(&tvs, obedit); | ||||
| } | } | ||||
| ED_transverts_free(&tvs); | ED_transverts_free(&tvs); | ||||
| } | } | ||||
| MEM_freeN(objects); | MEM_freeN(objects); | ||||
| } | } | ||||
| else if (obact && (obact->mode & OB_MODE_POSE)) { | else if (obact && (obact->mode & OB_MODE_POSE)) { | ||||
| struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); | struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); | ||||
| CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| { | uint objects_len = 0; | ||||
| Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data(view_layer, CTX_wm_view3d(C), | |||||
| &objects_len, OB_MODE_POSE); | |||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | |||||
| Object *ob = objects[ob_index]; | |||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| float snap_target_local[3]; | float snap_target_local[3]; | ||||
| invert_m4_m4(ob->imat, ob->obmat); | invert_m4_m4(ob->imat, ob->obmat); | ||||
| mul_v3_m4v3(snap_target_local, ob->imat, snap_target_global); | mul_v3_m4v3(snap_target_local, ob->imat, snap_target_global); | ||||
| for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | ||||
| pchan->bone->flag &= ~BONE_TRANSFORM; | pchan->bone->flag &= ~BONE_TRANSFORM; | ||||
| } | } | ||||
| ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); | ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| CTX_DATA_END; | MEM_freeN(objects); | ||||
| } | } | ||||
| else { | else { | ||||
| struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); | struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| ListBase ctx_data_list; | ListBase ctx_data_list; | ||||
| CollectionPointerLink *ctx_ob; | CollectionPointerLink *ctx_ob; | ||||
| Object *ob; | Object *ob; | ||||
| ▲ Show 20 Lines • Show All 486 Lines • Show Last 20 Lines | |||||