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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-06 20:52:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-06 20:52:20 +0300
commit1c4b04f1fde15a3be86a650b54f6e23030a97973 (patch)
tree26e7d27e411b261d9d6ee26e302dce5967961fec /source
parent4165a57a66724b9b0f7e696a9d0ef75ee29a6af8 (diff)
parent0e68751b8a0bac59a275b1fe3d818b8259d1cc7f (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/BLI_math_base.h18
-rw-r--r--source/blender/makesrna/intern/rna_animation.c2
-rw-r--r--source/blender/makesrna/intern/rna_nla.c2
3 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 6f8e48d83b2..f455436ce63 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -200,24 +200,28 @@ double double_round(double x, int ndigits);
* check the vector is unit length, or zero length (which can't be helped in some cases).
*/
#ifndef NDEBUG
-/* note: 0.0001 is too small becaues normals may be converted from short's: see [#34322] */
+/** \note 0.0001 is too small becaues normals may be converted from short's: see T34322. */
# define BLI_ASSERT_UNIT_EPSILON 0.0002f
+/**
+ * \note Checks are flipped so NAN doesn't assert. This is done because we're making sure the value was normalized
+ * and in the case we don't want NAN to be raising asserts since there is nothing to be done in that case.
+ */
# define BLI_ASSERT_UNIT_V3(v) { \
const float _test_unit = len_squared_v3(v); \
- BLI_assert((fabsf(_test_unit - 1.0f) < BLI_ASSERT_UNIT_EPSILON) || \
- (fabsf(_test_unit) < BLI_ASSERT_UNIT_EPSILON)); \
+ BLI_assert(!(fabsf(_test_unit - 1.0f) >= BLI_ASSERT_UNIT_EPSILON) || \
+ !(fabsf(_test_unit) >= BLI_ASSERT_UNIT_EPSILON)); \
} (void)0
# define BLI_ASSERT_UNIT_V2(v) { \
const float _test_unit = len_squared_v2(v); \
- BLI_assert((fabsf(_test_unit - 1.0f) < BLI_ASSERT_UNIT_EPSILON) || \
- (fabsf(_test_unit) < BLI_ASSERT_UNIT_EPSILON)); \
+ BLI_assert(!(fabsf(_test_unit - 1.0f) >= BLI_ASSERT_UNIT_EPSILON) || \
+ !(fabsf(_test_unit) >= BLI_ASSERT_UNIT_EPSILON)); \
} (void)0
# define BLI_ASSERT_UNIT_QUAT(q) { \
const float _test_unit = dot_qtqt(q, q); \
- BLI_assert((fabsf(_test_unit - 1.0f) < BLI_ASSERT_UNIT_EPSILON * 10) || \
- (fabsf(_test_unit) < BLI_ASSERT_UNIT_EPSILON * 10)); \
+ BLI_assert(!(fabsf(_test_unit - 1.0f) >= BLI_ASSERT_UNIT_EPSILON * 10) || \
+ !(fabsf(_test_unit) >= BLI_ASSERT_UNIT_EPSILON * 10)); \
} (void)0
# define BLI_ASSERT_ZERO_M3(m) { \
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 0b928e63545..d2c719ac5d1 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -1074,7 +1074,7 @@ static void rna_def_animdata(BlenderRNA *brna)
"Method used for combining Active Action's result with result of NLA stack");
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
- prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "act_influence");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.0f, 1.0f);
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 1301762a4bc..38086a47c51 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -655,7 +655,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
"NLA Strips that this strip acts as a container for (if it is of type Meta)");
/* Settings - Values necessary for evaluation */
- prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result");
/* XXX: Update temporarily disabled so that the property can be edited at all!