Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2019-05-09 12:19:38 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-05-09 12:21:34 +0300
commit5ab57f7ba41dff3d4554d1cb47db2b2868efe710 (patch)
tree84fefd90ab7b498fc1542eebc2f009ca8986f42d /source/blender/editors/transform
parentffb3226d276fd0af584431bc86ab25fa79c44a37 (diff)
Move out pose edit options into the pose data
Move pose edit mode booleans out of the armature data into the pose data Reviewed By: Brecht Differential Revision: http://developer.blender.org/D4832
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_conversions.c29
-rw-r--r--source/blender/editors/transform/transform_generics.c5
3 files changed, 14 insertions, 22 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 0e2d6dcc493..b0f720bfdf7 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -402,7 +402,7 @@ typedef struct PoseInitData_Mirror {
} orig;
/**
* An extra offset to apply after mirroring.
- * Use with #ARM_MIRROR_RELATIVE.
+ * Use with #POSE_MIRROR_RELATIVE.
*/
float offset_mtx[4][4];
} PoseInitData_Mirror;
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index a4971ef24a9..4037fab2b68 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1286,17 +1286,18 @@ static void createTransPose(TransInfo *t)
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
Object *ob = tc->poseobj;
+ bPose *pose = ob->pose;
bArmature *arm;
short ik_on = 0;
/* check validity of state */
arm = BKE_armature_from_object(tc->poseobj);
- if ((arm == NULL) || (ob->pose == NULL)) {
+ if ((arm == NULL) || (pose == NULL)) {
continue;
}
- const bool mirror = ((arm->flag & ARM_MIRROR_EDIT) != 0);
+ const bool mirror = ((pose->flag & POSE_MIRROR_EDIT) != 0);
/* set flags and count total */
tc->data_len = count_set_pose_transflags(ob, t->mode, t->around, has_translate_rotate);
@@ -1313,7 +1314,7 @@ static void createTransPose(TransInfo *t)
}
/* do we need to add temporal IK chains? */
- if ((arm->flag & ARM_AUTO_IK) && t->mode == TFM_TRANSLATION) {
+ if ((pose->flag & POSE_AUTO_IK) && t->mode == TFM_TRANSLATION) {
ik_on = pose_grab_with_ik(bmain, ob);
if (ik_on) {
t->flag |= T_AUTOIK;
@@ -1363,16 +1364,14 @@ static void createTransPose(TransInfo *t)
PoseInitData_Mirror *pid = tc->custom.type.data;
int pid_index = 0;
- bArmature *arm;
+ bPose *pose = ob->pose;
- /* check validity of state */
- arm = BKE_armature_from_object(tc->poseobj);
- if ((arm == NULL) || (ob->pose == NULL)) {
+ if (pose == NULL) {
continue;
}
- const bool mirror = ((arm->flag & ARM_MIRROR_EDIT) != 0);
- const bool is_mirror_relative = ((arm->flag & ARM_MIRROR_RELATIVE) != 0);
+ const bool mirror = ((pose->flag & POSE_MIRROR_EDIT) != 0);
+ const bool is_mirror_relative = ((pose->flag & POSE_MIRROR_RELATIVE) != 0);
tc->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */
@@ -1420,17 +1419,9 @@ static void createTransPose(TransInfo *t)
void restoreMirrorPoseBones(TransDataContainer *tc)
{
- bArmature *arm;
-
- if (tc->obedit) {
- arm = tc->obedit->data;
- }
- else {
- BLI_assert(tc->poseobj != NULL);
- arm = tc->poseobj->data;
- }
+ bPose *pose = tc->poseobj->pose;
- if (!(arm->flag & ARM_MIRROR_EDIT)) {
+ if (!(pose->flag & POSE_MIRROR_EDIT)) {
return;
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 87be60531cc..ddd8a1d19e4 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1030,11 +1030,12 @@ static void recalcData_objects(TransInfo *t)
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
Object *ob = tc->poseobj;
bArmature *arm = ob->data;
+ bPose *pose = ob->pose;
- if (arm->flag & ARM_MIRROR_EDIT) {
+ if (pose->flag & POSE_MIRROR_EDIT) {
if (t->state != TRANS_CANCEL) {
PoseInitData_Mirror *pid = NULL;
- if (arm->flag & ARM_MIRROR_RELATIVE) {
+ if (pose->flag & POSE_MIRROR_RELATIVE) {
pid = tc->custom.type.data;
}
pose_transform_mirror_update(ob, pid);