Changing bbone_easein/out outside of Edit Mode crashes Blender #69165

Closed
opened 2019-08-26 11:18:35 +02:00 by Ovionis · 14 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 770/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64

Blender Version
Broken: version: 2.81 (sub 3), branch: master, commit date: 2019-08-25 19:05, hash: af8e8be7b1
Worked: (optional)

Description of error
Rigify keeps crashing when I click Generate.
I was debugging IT to find what's wrong and consistently found the crash at two particular instances where it tries to set a data.bone's bbone_ease_in property.
Rigify's code has it always do this when in object mode, despite this being a edit bone type thing. (it's not literally an editbone but it functionally is).

The code in Rigify should be changed to run this stuff in Edit mode but I assume your priority is to fix the crash.

Exact steps for others to reproduce the error
While in Object or Pose mode, change a pose.bone's bone.bbone_easein property, or change a data.bone's easein property.

bpy.context.object.data.bones- [x].bbone_easein = 1
bpy.context.object.pose.bones- [x].bone.bbone_easein = 1

bbone_ease.blend

2019-08-26 04-14-41.mp4

**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: GeForce GTX 770/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64 **Blender Version** Broken: version: 2.81 (sub 3), branch: master, commit date: 2019-08-25 19:05, hash: `af8e8be7b1` Worked: (optional) **Description of error** Rigify keeps crashing when I click Generate. I was debugging IT to find what's wrong and consistently found the crash at two particular instances where it tries to set a data.bone's bbone_ease_in property. Rigify's code has it always do this when in object mode, despite this being a edit bone type thing. (it's not literally an editbone but it functionally is). The code in Rigify should be changed to run this stuff in Edit mode but I assume your priority is to fix the crash. **Exact steps for others to reproduce the error** While in Object or Pose mode, change a pose.bone's bone.bbone_easein property, or change a data.bone's easein property. bpy.context.object.data.bones- [x].bbone_easein = 1 bpy.context.object.pose.bones- [x].bone.bbone_easein = 1 [bbone_ease.blend](https://archive.blender.org/developer/F7704375/bbone_ease.blend) [2019-08-26 04-14-41.mp4](https://archive.blender.org/developer/F7704374/2019-08-26_04-14-41.mp4)
Author

Added subscriber: @Phigon

Added subscriber: @Phigon

#69171 was marked as duplicate of this issue

#69171 was marked as duplicate of this issue
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Can confirm, caused by f041d2f116.

Got a bandaid here, also checking why apparently editmode bbone settings are out of sync from pose/objectmode...

Can confirm, caused by f041d2f116. Got a bandaid here, also checking why apparently editmode bbone settings are out of sync from pose/objectmode...
Member

Added subscribers: @angavrilov, @ZedDB, @brecht

Added subscribers: @angavrilov, @ZedDB, @brecht
Member

Reading my way into modeswitching on armatures, there is something wrong syncing/updating between editmode and posemode in relation to the bbone settings (as mentioned above -- setting something on EditBone will never really get carried over to PoseBone...)

But regarding the crash, shouldnt we play safe and do something more like (otherwise crashes in rna_Armature_editbone_transform_update)?
P1083: #69165 bandaid



diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index d3bdcf03d4d..addca6bba92 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -613,16 +613,19 @@ static void rna_Armature_transform(bArmature *arm, float *mat)
 
 /* Settings for curved bbone settings -
  * The posemode values get applied over the top of the editmode ones. */
-void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
+void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone, bool is_editbone)
 {
-#  define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone) \
+#  define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone) \
     { \
       if (is_posebone) { \
         RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); \
       } \
-      else { \
+      else if (is_editbone){ \
         RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); \
       } \
+      else { \
+        RNA_def_property_update(prop, 0, "rna_Armature_update_data"); \
+      } \
     } \
     ((void)0)
 
@@ -634,14 +637,14 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
   RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, 2);
   RNA_def_property_ui_text(
       prop, "Roll In", "Roll offset for the start of the B-Bone, adjusts twist");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_rollout", PROP_FLOAT, PROP_ANGLE);
   RNA_def_property_float_sdna(prop, NULL, "roll2");
   RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, 2);
   RNA_def_property_ui_text(
       prop, "Roll Out", "Roll offset for the end of the B-Bone, adjusts twist");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   if (is_posebone == false) {
     prop = RNA_def_property(srna, "use_endroll_as_inroll", PROP_BOOLEAN, PROP_NONE);
@@ -658,28 +661,28 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
   RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(
       prop, "In X", "X-axis handle offset for start of the B-Bone's curve, adjusts curvature");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_curveiny", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "curve_in_y");
   RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(
       prop, "In Y", "Y-axis handle offset for start of the B-Bone's curve, adjusts curvature");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_curveoutx", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "curve_out_x");
   RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(
       prop, "Out X", "X-axis handle offset for end of the B-Bone's curve, adjusts curvature");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_curveouty", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "curve_out_y");
   RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(
       prop, "Out Y", "Y-axis handle offset for end of the B-Bone's curve, adjusts curvature");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   /* Ease In/Out */
   prop = RNA_def_property(srna, "bbone_easein", PROP_FLOAT, PROP_NONE);
@@ -687,14 +690,14 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
   RNA_def_property_ui_range(prop, -5.0f, 5.0f, 1, 3);
   RNA_def_property_float_default(prop, 1.0f);
   RNA_def_property_ui_text(prop, "Ease In", "Length of first Bezier Handle (for B-Bones only)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_easeout", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "ease2");
   RNA_def_property_ui_range(prop, -5.0f, 5.0f, 1, 3);
   RNA_def_property_float_default(prop, 1.0f);
   RNA_def_property_ui_text(prop, "Ease Out", "Length of second Bezier Handle (for B-Bones only)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   /* Scale In/Out */
   prop = RNA_def_property(srna, "bbone_scaleinx", PROP_FLOAT, PROP_NONE);
@@ -706,7 +709,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
                            "Scale In X",
                            "X-axis scale factor for start of the B-Bone, "
                            "adjusts thickness (for tapering effects)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_scaleiny", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "scale_in_y");
@@ -717,7 +720,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
                            "Scale In Y",
                            "Y-axis scale factor for start of the B-Bone, "
                            "adjusts thickness (for tapering effects)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_scaleoutx", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "scale_out_x");
@@ -728,7 +731,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
                            "Scale Out X",
                            "X-axis scale factor for end of the B-Bone, "
                            "adjusts thickness (for tapering effects)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
   prop = RNA_def_property(srna, "bbone_scaleouty", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "scale_out_y");
@@ -739,12 +742,12 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
                            "Scale Out Y",
                            "Y-axis scale factor for end of the B-Bone, "
                            "adjusts thickness (for tapering effects)");
-  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+  RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone);
 
 #  undef RNA_DEF_CURVEBONE_UPDATE
 }
 
-static void rna_def_bone_common(StructRNA *srna, int editbone)
+static void rna_def_bone_common(StructRNA *srna, bool is_editbone)
 {
   static const EnumPropertyItem prop_bbone_handle_type[] = {
       {BBONE_HANDLE_AUTO,
@@ -777,7 +780,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
   RNA_def_property_string_sdna(prop, NULL, "name");
   RNA_def_property_ui_text(prop, "Name", "");
   RNA_def_struct_name_property(srna, prop);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_string_funcs(prop, NULL, NULL, "rna_EditBone_name_set");
   }
   else {
@@ -789,7 +792,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
   prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
   RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
   RNA_def_property_array(prop, 32);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
   }
   else {
@@ -800,7 +803,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
 
   prop = RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set");
   }
   else {
@@ -871,7 +874,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
   /* Number values */
   /* envelope deform settings */
   prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_DISTANCE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -890,7 +893,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
   RNA_def_property_update(prop, 0, "rna_Armature_update_data");
 
   prop = RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_DISTANCE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -904,7 +907,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
       prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)");
 
   prop = RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_DISTANCE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -919,7 +922,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
 
   /* b-bones deform settings */
   prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -931,7 +934,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
       prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)");
 
   prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -942,7 +945,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
   RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size");
 
   prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE);
-  if (editbone) {
+  if (is_editbone) {
     RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
   }
   else {
@@ -962,8 +965,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
 
   prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "bbone_prev");
-  RNA_def_property_struct_type(prop, editbone ? "EditBone" : "Bone");
-  if (editbone) {
+  RNA_def_property_struct_type(prop, is_editbone ? "EditBone" : "Bone");
+  if (is_editbone) {
     RNA_def_property_pointer_funcs(
         prop, "rna_EditBone_bbone_prev_get", "rna_EditBone_bbone_prev_set", NULL, NULL);
     RNA_def_property_update(prop, 0, "rna_Armature_dependency_update");
@@ -986,8 +989,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
 
   prop = RNA_def_property(srna, "bbone_custom_handle_end", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "bbone_next");
-  RNA_def_property_struct_type(prop, editbone ? "EditBone" : "Bone");
-  if (editbone) {
+  RNA_def_property_struct_type(prop, is_editbone ? "EditBone" : "Bone");
+  if (is_editbone) {
     RNA_def_property_pointer_funcs(
         prop, "rna_EditBone_bbone_next_get", "rna_EditBone_bbone_next_set", NULL, NULL);
     RNA_def_property_update(prop, 0, "rna_Armature_dependency_update");
@@ -1029,8 +1032,8 @@ static void rna_def_bone(BlenderRNA *brna)
   RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP);
   RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone");
 
-  rna_def_bone_common(srna, 0);
-  rna_def_bone_curved_common(srna, 0);
+  rna_def_bone_common(srna, false);
+  rna_def_bone_curved_common(srna, false, false);
 
   /* XXX should we define this in PoseChannel wrapping code instead?
    *     But PoseChannels directly get some of their flags from here... */
@@ -1152,8 +1155,8 @@ static void rna_def_edit_bone(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
 
-  rna_def_bone_common(srna, 1);
-  rna_def_bone_curved_common(srna, 0);
+  rna_def_bone_common(srna, true);
+  rna_def_bone_curved_common(srna, false, true);
 
   prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 26f25e4988d..fa13c56e4fa 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -223,7 +223,7 @@ bool rna_AnimaData_override_apply(struct Main *bmain,
 void rna_def_animviz_common(struct StructRNA *srna);
 void rna_def_motionpath_common(struct StructRNA *srna);
 
-void rna_def_bone_curved_common(struct StructRNA *srna, bool is_posebone);
+void rna_def_bone_curved_common(struct StructRNA *srna, bool is_posebone, bool is_editbone);
 
 void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
 void rna_def_mtex_common(struct BlenderRNA *brna,
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 7637930f37f..33d7d7d99cf 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -1044,7 +1044,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
   RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
 
   /* Curved bones settings - Applied on top of restpose values */
-  rna_def_bone_curved_common(srna, true);
+  rna_def_bone_curved_common(srna, true, false);
 
   /* Custom BBone next/prev sources */
   prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE);

CC @brecht
CC @angavrilov
CC @ZedDB

Reading my way into modeswitching on armatures, there is something wrong syncing/updating between editmode and posemode in relation to the bbone settings (as mentioned above -- setting something on EditBone will never really get carried over to PoseBone...) But regarding the crash, shouldnt we play safe and do something more like (otherwise crashes in `rna_Armature_editbone_transform_update`)? [P1083: #69165 bandaid](https://archive.blender.org/developer/P1083.txt) ``` diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index d3bdcf03d4d..addca6bba92 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -613,16 +613,19 @@ static void rna_Armature_transform(bArmature *arm, float *mat) /* Settings for curved bbone settings - * The posemode values get applied over the top of the editmode ones. */ -void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) +void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone, bool is_editbone) { -# define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone) \ +# define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone) \ { \ if (is_posebone) { \ RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); \ } \ - else { \ + else if (is_editbone){ \ RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); \ } \ + else { \ + RNA_def_property_update(prop, 0, "rna_Armature_update_data"); \ + } \ } \ ((void)0) @@ -634,14 +637,14 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, 2); RNA_def_property_ui_text( prop, "Roll In", "Roll offset for the start of the B-Bone, adjusts twist"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_rollout", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "roll2"); RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, 2); RNA_def_property_ui_text( prop, "Roll Out", "Roll offset for the end of the B-Bone, adjusts twist"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); if (is_posebone == false) { prop = RNA_def_property(srna, "use_endroll_as_inroll", PROP_BOOLEAN, PROP_NONE); @@ -658,28 +661,28 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_ui_text( prop, "In X", "X-axis handle offset for start of the B-Bone's curve, adjusts curvature"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_curveiny", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curve_in_y"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_ui_text( prop, "In Y", "Y-axis handle offset for start of the B-Bone's curve, adjusts curvature"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_curveoutx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curve_out_x"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_ui_text( prop, "Out X", "X-axis handle offset for end of the B-Bone's curve, adjusts curvature"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_curveouty", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curve_out_y"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_ui_text( prop, "Out Y", "Y-axis handle offset for end of the B-Bone's curve, adjusts curvature"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); /* Ease In/Out */ prop = RNA_def_property(srna, "bbone_easein", PROP_FLOAT, PROP_NONE); @@ -687,14 +690,14 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) RNA_def_property_ui_range(prop, -5.0f, 5.0f, 1, 3); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Ease In", "Length of first Bezier Handle (for B-Bones only)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_easeout", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ease2"); RNA_def_property_ui_range(prop, -5.0f, 5.0f, 1, 3); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Ease Out", "Length of second Bezier Handle (for B-Bones only)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); /* Scale In/Out */ prop = RNA_def_property(srna, "bbone_scaleinx", PROP_FLOAT, PROP_NONE); @@ -706,7 +709,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) "Scale In X", "X-axis scale factor for start of the B-Bone, " "adjusts thickness (for tapering effects)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_scaleiny", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale_in_y"); @@ -717,7 +720,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) "Scale In Y", "Y-axis scale factor for start of the B-Bone, " "adjusts thickness (for tapering effects)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_scaleoutx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale_out_x"); @@ -728,7 +731,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) "Scale Out X", "X-axis scale factor for end of the B-Bone, " "adjusts thickness (for tapering effects)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); prop = RNA_def_property(srna, "bbone_scaleouty", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale_out_y"); @@ -739,12 +742,12 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) "Scale Out Y", "Y-axis scale factor for end of the B-Bone, " "adjusts thickness (for tapering effects)"); - RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); + RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone); # undef RNA_DEF_CURVEBONE_UPDATE } -static void rna_def_bone_common(StructRNA *srna, int editbone) +static void rna_def_bone_common(StructRNA *srna, bool is_editbone) { static const EnumPropertyItem prop_bbone_handle_type[] = { {BBONE_HANDLE_AUTO, @@ -777,7 +780,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - if (editbone) { + if (is_editbone) { RNA_def_property_string_funcs(prop, NULL, NULL, "rna_EditBone_name_set"); } else { @@ -789,7 +792,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 32); - if (editbone) { + if (is_editbone) { RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set"); } else { @@ -800,7 +803,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop = RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED); - if (editbone) { + if (is_editbone) { RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set"); } else { @@ -871,7 +874,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) /* Number values */ /* envelope deform settings */ prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_DISTANCE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -890,7 +893,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_DISTANCE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -904,7 +907,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)"); prop = RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_DISTANCE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -919,7 +922,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) /* b-bones deform settings */ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -931,7 +934,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)"); prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -942,7 +945,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size"); prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE); - if (editbone) { + if (is_editbone) { RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); } else { @@ -962,8 +965,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bbone_prev"); - RNA_def_property_struct_type(prop, editbone ? "EditBone" : "Bone"); - if (editbone) { + RNA_def_property_struct_type(prop, is_editbone ? "EditBone" : "Bone"); + if (is_editbone) { RNA_def_property_pointer_funcs( prop, "rna_EditBone_bbone_prev_get", "rna_EditBone_bbone_prev_set", NULL, NULL); RNA_def_property_update(prop, 0, "rna_Armature_dependency_update"); @@ -986,8 +989,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop = RNA_def_property(srna, "bbone_custom_handle_end", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bbone_next"); - RNA_def_property_struct_type(prop, editbone ? "EditBone" : "Bone"); - if (editbone) { + RNA_def_property_struct_type(prop, is_editbone ? "EditBone" : "Bone"); + if (is_editbone) { RNA_def_property_pointer_funcs( prop, "rna_EditBone_bbone_next_get", "rna_EditBone_bbone_next_set", NULL, NULL); RNA_def_property_update(prop, 0, "rna_Armature_dependency_update"); @@ -1029,8 +1032,8 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone"); - rna_def_bone_common(srna, 0); - rna_def_bone_curved_common(srna, 0); + rna_def_bone_common(srna, false); + rna_def_bone_curved_common(srna, false, false); /* XXX should we define this in PoseChannel wrapping code instead? * But PoseChannels directly get some of their flags from here... */ @@ -1152,8 +1155,8 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); - rna_def_bone_common(srna, 1); - rna_def_bone_curved_common(srna, 0); + rna_def_bone_common(srna, true); + rna_def_bone_curved_common(srna, false, true); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 26f25e4988d..fa13c56e4fa 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -223,7 +223,7 @@ bool rna_AnimaData_override_apply(struct Main *bmain, void rna_def_animviz_common(struct StructRNA *srna); void rna_def_motionpath_common(struct StructRNA *srna); -void rna_def_bone_curved_common(struct StructRNA *srna, bool is_posebone); +void rna_def_bone_curved_common(struct StructRNA *srna, bool is_posebone, bool is_editbone); void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable); void rna_def_mtex_common(struct BlenderRNA *brna, diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 7637930f37f..33d7d7d99cf 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -1044,7 +1044,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* Curved bones settings - Applied on top of restpose values */ - rna_def_bone_curved_common(srna, true); + rna_def_bone_curved_common(srna, true, false); /* Custom BBone next/prev sources */ prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE); ``` CC @brecht CC @angavrilov CC @ZedDB
Member

Added subscriber: @LucianoMunoz

Added subscriber: @LucianoMunoz
Member

Would even consider this High priority, we shouldnt break stuff, so that important Addons are unusable imho.
Everyone involved: please put this back to Confirmed, Medium if you think this is exaggerating....

Would even consider this High priority, we shouldnt break stuff, so that important Addons are unusable imho. Everyone involved: please put this back to `Confirmed, Medium` if you think this is exaggerating....
Member

In #69165#762613, @lichtwerk wrote:
Reading my way into modeswitching on armatures, there is something wrong syncing/updating between editmode and posemode in relation to the bbone settings (as mentioned above -- setting something on EditBone will never really get carried over to PoseBone...)

Please ignore this part (due to my inexperience with rigging... these are not expected to be in sync, final result is the combination of edit and pose...)

> In #69165#762613, @lichtwerk wrote: > Reading my way into modeswitching on armatures, there is something wrong syncing/updating between editmode and posemode in relation to the bbone settings (as mentioned above -- setting something on EditBone will never really get carried over to PoseBone...) Please ignore this part (due to my inexperience with rigging... these are not expected to be in sync, final result is the combination of edit and pose...)

Added subscriber: @Mets

Added subscriber: @Mets

@lichtwerk We (@Mets and I) will try to take a look at this soonish.

@lichtwerk We (@Mets and I) will try to take a look at this soonish.

This issue was referenced by 1c21b79108

This issue was referenced by 1c21b79108f38fdd977051d15fa467b7448b5528

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Alexander Gavrilov self-assigned this 2019-08-27 11:52:36 +02:00
Member

Of course my first patch would cause everything to explode, I expected nothing less!

Thanks for the fix @lichtwerk!

As @ZedDB said, we want to look into ways to make the split between pose and edit bone properties a bit clearer and more functional. But I'm a total noob at C and a hobby coder so it probably won't happen for a while, unless Sebastian does everything. :P

Of course my first patch would cause everything to explode, I expected nothing less! Thanks for the fix @lichtwerk! As @ZedDB said, we want to look into ways to make the split between pose and edit bone properties a bit clearer and more functional. But I'm a total noob at C and a hobby coder so it probably won't happen for a while, unless Sebastian does everything. :P
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#69165
No description provided.