diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-24 15:12:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-24 15:12:24 +0300 |
commit | b863bf98e53a709e3353e80d87f574f860187cdb (patch) | |
tree | 75de687c7876300674e1d2b6e215e46fdb49f3dd /source/blender/editors/interface/interface.c | |
parent | 10c58adba975530f549aeb0f73f3ea3e2888149e (diff) |
RNA
* Wrap most user editable data in DNA_mesh_types.h and DNA_meshdata_types.h.
Still needs to be improved in some areas though, especially how to deal
with data layers (expose per element or as array, or both?), and data in
face corners (bmesh type data structures are more logical here).
Tweaks to RNA defining to make some cases easier:
* Added range callback function for int/float.
* Added 'skip' callback for listbase and array iterators to skip items in
the collection.
* Extra error print when calling wrong define_property_*_sdna functions.
* Also made button code respect non_editable flag, is quick change though,
need to add support for properly graying out etc.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index bfc6db320f2..4e14916e396 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1138,30 +1138,32 @@ void ui_set_but_val(uiBut *but, double value) if(but->rnaprop) { prop= but->rnaprop; - switch(RNA_property_type(prop, &but->rnapoin)) { - case PROP_BOOLEAN: - if(RNA_property_array_length(prop, &but->rnapoin)) - RNA_property_boolean_set_array(prop, &but->rnapoin, but->rnaindex, value); - else - RNA_property_boolean_set(prop, &but->rnapoin, value); - break; - case PROP_INT: - if(RNA_property_array_length(prop, &but->rnapoin)) - RNA_property_int_set_array(prop, &but->rnapoin, but->rnaindex, value); - else - RNA_property_int_set(prop, &but->rnapoin, value); - break; - case PROP_FLOAT: - if(RNA_property_array_length(prop, &but->rnapoin)) - RNA_property_float_set_array(prop, &but->rnapoin, but->rnaindex, value); - else - RNA_property_float_set(prop, &but->rnapoin, value); - break; - case PROP_ENUM: - RNA_property_enum_set(prop, &but->rnapoin, value); - break; - default: - break; + if(RNA_property_editable(prop, &but->rnapoin)) { + switch(RNA_property_type(prop, &but->rnapoin)) { + case PROP_BOOLEAN: + if(RNA_property_array_length(prop, &but->rnapoin)) + RNA_property_boolean_set_array(prop, &but->rnapoin, but->rnaindex, value); + else + RNA_property_boolean_set(prop, &but->rnapoin, value); + break; + case PROP_INT: + if(RNA_property_array_length(prop, &but->rnapoin)) + RNA_property_int_set_array(prop, &but->rnapoin, but->rnaindex, value); + else + RNA_property_int_set(prop, &but->rnapoin, value); + break; + case PROP_FLOAT: + if(RNA_property_array_length(prop, &but->rnapoin)) + RNA_property_float_set_array(prop, &but->rnapoin, but->rnaindex, value); + else + RNA_property_float_set(prop, &but->rnapoin, value); + break; + case PROP_ENUM: + RNA_property_enum_set(prop, &but->rnapoin, value); + break; + default: + break; + } } } else if(but->pointype==0); |