diff options
Diffstat (limited to 'source/blender/editors/armature/armature_add.c')
-rw-r--r-- | source/blender/editors/armature/armature_add.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index dd43e3e6613..2e4e13d2773 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -422,7 +422,7 @@ static void updateDuplicateActionConstraintSettings( float mat[4][4]; bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; - BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); + BKE_constraint_custom_object_space_init(&cob, curcon); unit_m4(mat); bPoseChannel *target_pchan = BKE_pose_channel_find_name(ob->pose, act_con->subtarget); @@ -576,7 +576,7 @@ static void updateDuplicateLocRotConstraintSettings(Object *ob, unit_m4(local_mat); bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; - BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); + BKE_constraint_custom_object_space_init(&cob, curcon); BKE_constraint_mat_convertspace( ob, pchan, &cob, local_mat, curcon->ownspace, CONSTRAINT_SPACE_LOCAL, false); @@ -631,7 +631,7 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, float target_mat[4][4], own_mat[4][4], imat[4][4]; bConstraintOb cob = {.depsgraph = NULL, .scene = NULL, .ob = ob, .pchan = pchan}; - BKE_constraint_custom_object_space_get(cob.space_obj_world_matrix, curcon); + BKE_constraint_custom_object_space_init(&cob, curcon); unit_m4(own_mat); BKE_constraint_mat_convertspace( @@ -920,6 +920,7 @@ EditBone *duplicateEditBone(EditBone *cur_bone, const char *name, ListBase *edit static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) { + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); const bool do_flip_names = RNA_boolean_get(op->ptr, "do_flip_names"); @@ -930,7 +931,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( - view_layer, CTX_wm_view3d(C), &objects_len); + scene, view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { EditBone *ebone_iter; /* The beginning of the duplicated bones in the edbo list */ @@ -1094,6 +1095,7 @@ static EditBone *get_symmetrized_bone(bArmature *arm, EditBone *bone) */ static int armature_symmetrize_exec(bContext *C, wmOperator *op) { + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); const int direction = RNA_enum_get(op->ptr, "direction"); const int axis = 0; @@ -1105,7 +1107,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( - view_layer, CTX_wm_view3d(C), &objects_len); + scene, view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; bArmature *arm = obedit->data; @@ -1349,13 +1351,14 @@ void ARMATURE_OT_symmetrize(wmOperatorType *ot) /* if forked && mirror-edit: makes two bones with flipped names */ static int armature_extrude_exec(bContext *C, wmOperator *op) { + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); const bool forked = RNA_boolean_get(op->ptr, "forked"); bool changed_multi = false; uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( - view_layer, CTX_wm_view3d(C), &objects_len); + scene, view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *ob = objects[ob_index]; bArmature *arm = ob->data; |