Index: source/blender/makesrna/intern/makesrna.c =================================================================== --- source/blender/makesrna/intern/makesrna.c (Revision 26598) +++ source/blender/makesrna/intern/makesrna.c (Arbeitskopie) @@ -360,7 +360,8 @@ static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp) { - if(prop->type == PROP_FLOAT && prop->subtype == PROP_COLOR) + + if(prop->type == PROP_FLOAT && RNA_SUBTYPE_VALUE(prop->subtype) == PROP_COLOR) if(strcmp(dp->dnatype, "float") != 0 && strcmp(dp->dnatype, "double") != 0) return 1; Index: source/blender/makesrna/intern/rna_rna.c =================================================================== --- source/blender/makesrna/intern/rna_rna.c (Revision 26598) +++ source/blender/makesrna/intern/rna_rna.c (Arbeitskopie) @@ -433,7 +433,7 @@ { PropertyRNA *prop= (PropertyRNA*)ptr->data; rna_idproperty_check(&prop, ptr); - return RNA_SUBTYPE_UNIT(prop->subtype); + return (int)RNA_property_unit(prop); } static int rna_Property_readonly_get(PointerRNA *ptr) Index: source/blender/makesrna/intern/rna_access.c =================================================================== --- source/blender/makesrna/intern/rna_access.c (Revision 26598) +++ source/blender/makesrna/intern/rna_access.c (Arbeitskopie) @@ -663,12 +663,12 @@ PropertySubType RNA_property_subtype(PropertyRNA *prop) { - return rna_ensure_property(prop)->subtype; + return RNA_SUBTYPE_VALUE(rna_ensure_property(prop)->subtype); } PropertyUnit RNA_property_unit(PropertyRNA *prop) { - return RNA_SUBTYPE_UNIT(rna_ensure_property(prop)->subtype); + return RNA_SUBTYPE_UNIT_VALUE(rna_ensure_property(prop)->subtype); } int RNA_property_flag(PropertyRNA *prop) @@ -712,7 +712,7 @@ const char *vectoritem= "XYZW"; const char *quatitem= "WXYZ"; const char *coloritem= "RGBA"; - PropertySubType subtype= rna_ensure_property(prop)->subtype; + PropertySubType subtype= RNA_property_subtype(prop); /* get string to use for array index */ if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) @@ -727,7 +727,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) { - PropertySubType subtype= rna_ensure_property(prop)->subtype; + PropertySubType subtype= RNA_property_subtype(prop); name= toupper(name); Index: source/blender/makesrna/intern/rna_define.c =================================================================== --- source/blender/makesrna/intern/rna_define.c (Revision 26598) +++ source/blender/makesrna/intern/rna_define.c (Arbeitskopie) @@ -873,10 +873,10 @@ case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; - iprop->hardmin= (subtype == PROP_UNSIGNED)? 0: INT_MIN; + iprop->hardmin= (RNA_SUBTYPE_VALUE(subtype) == PROP_UNSIGNED)? 0: INT_MIN; iprop->hardmax= INT_MAX; - iprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */ + iprop->softmin= (RNA_SUBTYPE_VALUE(subtype) == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */ iprop->softmax= 10000; iprop->step= 1; break; @@ -884,19 +884,19 @@ case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; - fprop->hardmin= (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX; + fprop->hardmin= (RNA_SUBTYPE_VALUE(subtype) == PROP_UNSIGNED)? 0.0f: -FLT_MAX; fprop->hardmax= FLT_MAX; - if(subtype == PROP_COLOR) { + if(RNA_SUBTYPE_VALUE(subtype) == PROP_COLOR) { fprop->softmin= 0.0f; fprop->softmax= 1.0f; } - else if(subtype == PROP_FACTOR) { + else if(RNA_SUBTYPE_VALUE(subtype) == PROP_FACTOR) { fprop->softmin= fprop->hardmin= 0.0f; fprop->softmax= fprop->hardmax= 1.0f; } else { - fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */ + fprop->softmin= (RNA_SUBTYPE_VALUE(subtype) == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */ fprop->softmax= 10000.0f; } fprop->step= 10; @@ -1533,7 +1533,7 @@ iprop->softmax= 10000; } - if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE || prop->subtype == PROP_FACTOR) + if(RNA_SUBTYPE_VALUE(prop->subtype) == PROP_UNSIGNED || RNA_SUBTYPE_VALUE(prop->subtype) == PROP_PERCENTAGE || RNA_SUBTYPE_VALUE(prop->subtype) == PROP_FACTOR) iprop->hardmin= iprop->softmin= 0; } } Index: source/blender/editors/animation/anim_draw.c =================================================================== --- source/blender/editors/animation/anim_draw.c (Revision 26598) +++ source/blender/editors/animation/anim_draw.c (Arbeitskopie) @@ -412,7 +412,7 @@ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { /* rotations: radians <-> degrees? */ - if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) + if (RNA_property_unit(prop) == PROP_UNIT_ROTATION) { /* if the radians flag is not set, default to using degrees which need conversions */ if ((scene) && (scene->unit.flag & USER_UNIT_ROT_RADIANS) == 0) { Index: source/blender/editors/interface/interface.c =================================================================== --- source/blender/editors/interface/interface.c (Revision 26598) +++ source/blender/editors/interface/interface.c (Arbeitskopie) @@ -1243,7 +1243,7 @@ if(but->rnaprop==NULL) return 0; - unit_type = RNA_SUBTYPE_UNIT(RNA_property_subtype(but->rnaprop)); + unit_type = RNA_property_unit(but->rnaprop); if (scene->unit.flag & USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION) return 0; @@ -1428,18 +1428,21 @@ static double ui_get_but_scale_unit(uiBut *but, double value) { Scene *scene= CTX_data_scene((bContext *)but->block->evil_C); - int subtype= RNA_SUBTYPE_UNIT(RNA_property_subtype(but->rnaprop)); + int unit_type= RNA_property_unit(but->rnaprop); - if(subtype == PROP_UNIT_LENGTH) { + if(unit_type == PROP_UNIT_LENGTH) { +printf("ui_get_but_scale_unit: PROP_UNIT_LENGTH"); /* DEBUG */ return value * scene->unit.scale_length; } - else if(subtype == PROP_UNIT_AREA) { + else if(unit_type == PROP_UNIT_AREA) { +printf("ui_get_but_scale_unit: PROP_UNIT_AREA"); /* DEBUG */ return value * pow(scene->unit.scale_length, 2); } - else if(subtype == PROP_UNIT_VOLUME) { + else if(unit_type == PROP_UNIT_VOLUME) { +printf("ui_get_but_scale_unit: PROP_UNIT_VOLUME"); /* DEBUG */ return value * pow(scene->unit.scale_length, 3); } - else if(subtype == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */ + else if(unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */ return FRA2TIME(value); } else { @@ -1451,7 +1454,7 @@ { 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 unit_type= RNA_property_unit(but->rnaprop); int precision= but->a2; if(scene->unit.scale_length<0.0001) scene->unit.scale_length= 1.0; // XXX do_versions @@ -1466,7 +1469,7 @@ static float ui_get_but_step_unit(uiBut *but, double value, float step_default) { Scene *scene= CTX_data_scene((bContext *)but->block->evil_C); - int unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop)); + int unit_type= RNA_property_unit(but->rnaprop); float step; step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, value), scene->unit.system, unit_type); @@ -1621,7 +1624,7 @@ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C); if(but->rnaprop) - unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop)); + unit_type= RNA_property_unit(but->rnaprop); else unit_type= 0; Index: source/blender/editors/interface/interface_regions.c =================================================================== --- source/blender/editors/interface/interface_regions.c (Revision 26598) +++ source/blender/editors/interface/interface_regions.c (Arbeitskopie) @@ -390,7 +390,7 @@ } if(but->rnaprop) { - int unit_type = RNA_SUBTYPE_UNIT(RNA_property_subtype(but->rnaprop)); + int unit_type = RNA_property_unit(but->rnaprop); if (unit_type == PROP_UNIT_ROTATION) { if (RNA_property_type(but->rnaprop) == PROP_FLOAT) {