[Bf-blender-cvs] [276a862ebc5] master: Fix failing alembic test after IDProperty UI data refactor

Hans Goudey noreply at git.blender.org
Fri Aug 27 21:31:28 CEST 2021


Commit: 276a862ebc5629f45f672e7ca6b5ba55077c88f3
Author: Hans Goudey
Date:   Fri Aug 27 14:31:19 2021 -0500
Branches: master
https://developer.blender.org/rB276a862ebc5629f45f672e7ca6b5ba55077c88f3

Fix failing alembic test after IDProperty UI data refactor

The default float IDProperty min value rB8b9a3b94fc148d19 for when there
is no UI data was FLT_MIN instead of -FLT_MAX, which meant that animated
custom property values couldn't be less than zero unless they had their
UI data values edited previously.

That's a mistake I won't make again! Also change the int minimums from
-INT_MAX to INT_MIN to sanitize the whole situation.

===================================================================

M	source/blender/blenkernel/intern/idprop.c
M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 786df14756a..f7411f541b7 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -1665,9 +1665,9 @@ IDPropertyUIData *IDP_ui_data_ensure(IDProperty *prop)
     }
     case IDP_UI_DATA_TYPE_INT: {
       IDPropertyUIDataInt *ui_data = MEM_callocN(sizeof(IDPropertyUIDataInt), __func__);
-      ui_data->min = -INT_MAX;
+      ui_data->min = INT_MIN;
       ui_data->max = INT_MAX;
-      ui_data->soft_min = -INT_MAX;
+      ui_data->soft_min = INT_MIN;
       ui_data->soft_max = INT_MAX;
       ui_data->step = 1;
       prop->ui_data = (IDPropertyUIData *)ui_data;
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 2d6d5408aa0..a2905018cc7 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1333,7 +1333,7 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin
       *hardmax = (float)ui_data->max;
     }
     else {
-      *hardmin = FLT_MIN;
+      *hardmin = -FLT_MAX;
       *hardmax = FLT_MAX;
     }
     return;
@@ -1377,7 +1377,7 @@ void RNA_property_float_ui_range(PointerRNA *ptr,
       *precision = (float)ui_data->precision;
     }
     else {
-      *softmin = FLT_MIN;
+      *softmin = -FLT_MAX;
       *softmax = FLT_MAX;
       *step = 1.0f;
       *precision = 3.0f;



More information about the Bf-blender-cvs mailing list