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:
authorYuki Shirakawa <shirakawa>2021-05-11 12:22:41 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-05-11 12:31:58 +0300
commitfc5bf09fd88c331b568c5b485bb0e487179ecb44 (patch)
tree1fb6e32ec8ad3699dca241c9224b4fe69f67135c /source/blender/blenkernel/intern/action.c
parenta02be602f9cb1e5c5e38de5b1553829b9aa58b56 (diff)
Rigging: Add transform for custom bone shapes
Add translation/rotation/scale parameters for custom bones shapes. The new scale is a 3D vector `custom_shape_scale_xyz`, and replaces the `custom_shape_scale` float. Reviewed By: #animation_rigging, sybren, zeddb Differential Revision: https://developer.blender.org/D10974
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 3f3aa0386e2..a7e36b09516 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -656,7 +656,9 @@ bPoseChannel *BKE_pose_channel_ensure(bPose *pose, const char *name)
BLI_strncpy(chan->name, name, sizeof(chan->name));
- chan->custom_scale = 1.0f;
+ copy_v3_fl(chan->custom_scale_xyz, 1.0f);
+ zero_v3(chan->custom_translation);
+ zero_v3(chan->custom_rotation_euler);
/* init vars to prevent math errors */
unit_qt(chan->quat);
@@ -1235,8 +1237,10 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f
if (pchan->custom) {
id_us_plus(&pchan->custom->id);
}
+ copy_v3_v3(pchan->custom_scale_xyz, pchan_from->custom_scale_xyz);
+ copy_v3_v3(pchan->custom_translation, pchan_from->custom_translation);
+ copy_v3_v3(pchan->custom_rotation_euler, pchan_from->custom_rotation_euler);
- pchan->custom_scale = pchan_from->custom_scale;
pchan->drawflag = pchan_from->drawflag;
}