diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-18 23:01:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-18 23:01:35 +0300 |
commit | ae5a814f26e78dd65557773b5c00c341cdca1947 (patch) | |
tree | c605eed391e60b097820b501e588309d517acf07 /source/blender/editors/interface/interface.c | |
parent | 5f6b9fd324162358ac482b151bc034e0006d6734 (diff) |
ID properties that are displayed via RNA can now define their own UI settings,
only implimented min/max precision & step.
at the moment there is no way to edit these other then via python
example of setting UI limits...
>>> C.object['foo'] = 0.5
>>> C.object['_RNA_UI'] = {'foo': {'step': 0.5, 'soft_max': 10.0, 'soft_min': 0.0, 'precision': 2, 'description': 'Some setting'}}
Also fixed typo's: precission -> precision
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 51c38ee859f..b9f80946345 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1355,15 +1355,15 @@ static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double va Scene *scene= CTX_data_scene((bContext *)but->block->evil_C); int do_split= scene->unit.flag & USER_UNIT_OPT_SPLIT; int unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop)); - int precission= but->a2; + int precision= but->a2; if(scene->unit.scale_length<0.0001) scene->unit.scale_length= 1.0; // XXX do_versions /* Sanity checks */ - if(precission>4) precission= 4; - else if(precission==0) precission= 2; + if(precision>4) precision= 4; + else if(precision==0) precision= 2; - bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precission, scene->unit.system, unit_type, do_split, pad); + bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, scene->unit.system, unit_type, do_split, pad); } static float ui_get_but_step_unit(uiBut *but, double value, float step_default) |