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:
authorCampbell Barton <ideasman42@gmail.com>2013-09-16 05:35:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-16 05:35:52 +0400
commitabb37f4152ea8945fdffdc956acdd3002e54db2d (patch)
tree0e8200b6bb31654553b52e24e22a49ca1ed5c98a /source/blender/blenkernel
parent7e2977b051d6aecd8effe89f11db5373bc0dc3b1 (diff)
replace RNA_property_array_length with RNA_property_array_check where the length of the array is only used to check if the property is an array or not.
(this isnt reliable since arrays can be zero length).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 4b05b0800a5..8e697ad4ef3 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1652,19 +1652,19 @@ static void nlaevalchan_value_init(NlaEvalChannel *nec)
*/
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
nec->value = (float)RNA_property_boolean_get_default_index(ptr, prop, index);
else
nec->value = (float)RNA_property_boolean_get_default(ptr, prop);
break;
case PROP_INT:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
nec->value = (float)RNA_property_int_get_default_index(ptr, prop, index);
else
nec->value = (float)RNA_property_int_get_default(ptr, prop);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
nec->value = RNA_property_float_get_default_index(ptr, prop, index);
else
nec->value = RNA_property_float_get_default(ptr, prop);
@@ -2071,19 +2071,19 @@ void nladata_flush_channels(ListBase *channels)
/* write values - see animsys_write_rna_setting() to sync the code */
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
RNA_property_boolean_set_index(ptr, prop, array_index, ANIMSYS_FLOAT_AS_BOOL(value));
else
RNA_property_boolean_set(ptr, prop, ANIMSYS_FLOAT_AS_BOOL(value));
break;
case PROP_INT:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
RNA_property_int_set_index(ptr, prop, array_index, (int)value);
else
RNA_property_int_set(ptr, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(ptr, prop))
+ if (RNA_property_array_check(prop))
RNA_property_float_set_index(ptr, prop, array_index, value);
else
RNA_property_float_set(ptr, prop, value);