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/makesrna/intern/rna_pose.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/makesrna/intern/rna_pose.c')
-rw-r--r--source/blender/makesrna/intern/rna_pose.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index ba65e42895c..5ffbe1613e0 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -1359,12 +1359,25 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_dependency_update");
- prop = RNA_def_property(srna, "custom_shape_scale", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "custom_scale");
- RNA_def_property_range(prop, 0.0f, 1000.0f);
+ prop = RNA_def_property(srna, "custom_shape_scale_xyz", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "custom_scale_xyz");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
+ RNA_def_property_float_array_default(prop, rna_default_scale_3d);
RNA_def_property_ui_text(prop, "Custom Shape Scale", "Adjust the size of the custom shape");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
+ prop = RNA_def_property(srna, "custom_shape_translation", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "custom_translation");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
+ RNA_def_property_ui_text(prop, "Custom Shape Translation", "Adjust the location of the custom shape");
+ RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+ RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
+
+ prop = RNA_def_property(srna, "custom_shape_rotation_euler", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float_sdna(prop, NULL, "custom_rotation_euler");
+ RNA_def_property_ui_text(prop, "Custom Shape Rotation", "Adjust the rotation of the custom shape");
+ RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
+
prop = RNA_def_property(srna, "use_custom_shape_bone_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", PCHAN_DRAW_NO_CUSTOM_BONE_SIZE);
RNA_def_property_ui_text(