diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-05-10 21:36:11 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-05-10 21:36:11 +0300 |
commit | f305aba8688a2b88b6495985435cc79213a22a3f (patch) | |
tree | 776da790c24419de67ef8b5d6b82ed52f81113ce /source/blender/editors/interface/interface_ops.c | |
parent | 4f80260f1160178a47180ccc0b82a11437388a83 (diff) |
Make sure 'use_property_button_exec' can deal with arrays as well
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index c130064ca12..09388ff1a18 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -353,11 +353,21 @@ static int use_property_button_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } + int array_len = RNA_property_array_length(&scene_props_ptr, prop); + bool is_array = array_len != 0; + switch (RNA_property_type(prop)) { case PROP_FLOAT: { - float value = RNA_property_float_get(&scene_props_ptr, prop); - BKE_collection_engine_property_add_float(props, identifier, value); + if (is_array) { + float values[RNA_MAX_ARRAY_LENGTH]; + RNA_property_float_get_array(&scene_props_ptr, prop, values); + BKE_collection_engine_property_add_float_array(props, identifier, values, array_len); + } + else { + float value = RNA_property_float_get(&scene_props_ptr, prop); + BKE_collection_engine_property_add_float(props, identifier, value); + } break; } case PROP_ENUM: |