diff options
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 5ebcec63cd4..a6f733708c7 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -697,20 +697,26 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); + if (RNA_property_array_length(&new_ptr, prop)) { + if (RNA_property_editable_index(&new_ptr, prop, array_index)) + RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); + } else RNA_property_boolean_set(&new_ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); + if (RNA_property_array_length(&new_ptr, prop)){ + if (RNA_property_editable_index(&new_ptr, prop, array_index)) + RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); + } else RNA_property_int_set(&new_ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_float_set_index(&new_ptr, prop, array_index, value); + if (RNA_property_array_length(&new_ptr, prop)) { + if (RNA_property_editable_index(&new_ptr, prop, array_index)) + RNA_property_float_set_index(&new_ptr, prop, array_index, value); + } else RNA_property_float_set(&new_ptr, prop, value); break; @@ -1434,20 +1440,26 @@ void nladata_flush_channels (ListBase *channels) switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(ptr, prop)) - RNA_property_boolean_set_index(ptr, prop, array_index, (int)value); + if (RNA_property_array_length(ptr, prop)) { + if (RNA_property_editable_index(ptr, prop, array_index)) + RNA_property_boolean_set_index(ptr, prop, array_index, (int)value); + } else RNA_property_boolean_set(ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(ptr, prop)) - RNA_property_int_set_index(ptr, prop, array_index, (int)value); + if (RNA_property_array_length(ptr, prop)) { + if (RNA_property_editable_index(ptr, prop, array_index)) + 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)) - RNA_property_float_set_index(ptr, prop, array_index, value); + if (RNA_property_array_length(ptr, prop)) { + if (RNA_property_editable_index(ptr, prop, array_index)) + RNA_property_float_set_index(ptr, prop, array_index, value); + } else RNA_property_float_set(ptr, prop, value); break; |