Index: blender/source/blender/python/intern/bpy_props.c =================================================================== --- blender/source/blender/python/intern/bpy_props.c (Revision 26429) +++ blender/source/blender/python/intern/bpy_props.c (Arbeitskopie) @@ -139,16 +139,18 @@ return NULL; /* self's type was compatible but error getting the srna */ } else if(srna) { - static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "hidden", NULL}; - char *id=NULL, *name="", *description=""; + static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "hidden", "unit", NULL}; + char *id=NULL, *name="", *description="", *unit_string="NONE"; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f; - int precision= 2, hidden=0; + int precision= 2, hidden=0, unit=0; PropertyRNA *prop; - if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssffffffii:FloatProperty", kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &precision, &hidden)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssffffffiii:FloatProperty", kwlist, &id, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &precision, &hidden, &unit)) return NULL; - prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max); +/* TODO parse "unit_string" and convert to "unit" PropertyRNA enum */ + + prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max, unit); RNA_def_property_ui_range(prop, min, max, step, precision); if(hidden) RNA_def_property_flag(prop, PROP_HIDDEN); RNA_def_property_duplicate_pointers(prop); Index: blender/source/blender/makesrna/intern/rna_object_api.c =================================================================== --- blender/source/blender/makesrna/intern/rna_object_api.c (Revision 26429) +++ blender/source/blender/makesrna/intern/rna_object_api.c (Arbeitskopie) @@ -462,7 +462,7 @@ RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to add vertex to."); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f); + parm= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f, PROP_UNIT_NONE); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode."); RNA_def_property_flag(parm, PROP_REQUIRED); Index: blender/source/blender/makesrna/intern/rna_ui_api.c =================================================================== --- blender/source/blender/makesrna/intern/rna_ui_api.c (Revision 26429) +++ blender/source/blender/makesrna/intern/rna_ui_api.c (Arbeitskopie) @@ -145,7 +145,7 @@ func= RNA_def_function(srna, "split", "uiLayoutSplit"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); - RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); + RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f, PROP_UNIT_NONE); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); /* items */ Index: blender/source/blender/makesrna/intern/rna_define.c =================================================================== --- blender/source/blender/makesrna/intern/rna_define.c (Revision 26429) +++ blender/source/blender/makesrna/intern/rna_define.c (Arbeitskopie) @@ -2171,12 +2171,16 @@ } PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, - float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) + float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax, PropertyUnit unit) { ContainerRNA *cont= cont_; PropertyRNA *prop; prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE); + + /* Set the unit of this FloatProperty */ + prop->subtype = unit; + RNA_def_property_float_default(prop, default_value); if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax); RNA_def_property_ui_text(prop, ui_name, ui_description); Index: blender/source/blender/makesrna/RNA_define.h =================================================================== --- blender/source/blender/makesrna/RNA_define.h (Revision 26429) +++ blender/source/blender/makesrna/RNA_define.h (Arbeitskopie) @@ -88,7 +88,7 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); -PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); +PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax, PropertyUnit unit); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); Index: blender/source/blender/windowmanager/intern/wm_operators.c =================================================================== --- blender/source/blender/windowmanager/intern/wm_operators.c (Revision 26429) +++ blender/source/blender/windowmanager/intern/wm_operators.c (Arbeitskopie) @@ -2587,10 +2587,10 @@ {0, NULL, 0, NULL, NULL}}; /* Should be set in custom invoke() */ - RNA_def_float(ot->srna, "initial_value", 0, 0, FLT_MAX, "Initial Value", "", 0, FLT_MAX); + RNA_def_float(ot->srna, "initial_value", 0, 0, FLT_MAX, "Initial Value", "", 0, FLT_MAX, PROP_UNIT_NONE); /* Set internally, should be used in custom exec() to get final value */ - RNA_def_float(ot->srna, "new_value", 0, 0, FLT_MAX, "New Value", "", 0, FLT_MAX); + RNA_def_float(ot->srna, "new_value", 0, 0, FLT_MAX, "New Value", "", 0, FLT_MAX, PROP_UNIT_NONE); /* Should be set before calling operator */ RNA_def_enum(ot->srna, "mode", radial_mode_items, 0, "Mode", ""); Index: blender/source/blender/editors/screen/screen_ops.c =================================================================== --- blender/source/blender/editors/screen/screen_ops.c (Revision 26429) +++ blender/source/blender/editors/screen/screen_ops.c (Arbeitskopie) @@ -1313,7 +1313,7 @@ /* rna */ RNA_def_enum(ot->srna, "direction", prop_direction_items, 'h', "Direction", ""); - RNA_def_float(ot->srna, "factor", 0.5f, 0.0, 1.0, "Factor", "", 0.0, 1.0); + RNA_def_float(ot->srna, "factor", 0.5f, 0.0, 1.0, "Factor", "", 0.0, 1.0, PROP_UNIT_NONE); } Index: blender/source/blender/editors/physics/particle_edit.c =================================================================== --- blender/source/blender/editors/physics/particle_edit.c (Revision 26429) +++ blender/source/blender/editors/physics/particle_edit.c (Arbeitskopie) @@ -2365,7 +2365,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float(ot->srna, "threshold", 0.0002f, 0.0f, FLT_MAX, "Threshold", "Threshold distance withing which particles are removed", 0.00001f, 0.1f); + RNA_def_float(ot->srna, "threshold", 0.0002f, 0.0f, FLT_MAX, "Threshold", "Threshold distance withing which particles are removed", 0.00001f, 0.1f, PROP_UNIT_LENGTH); } Index: blender/source/blender/editors/curve/editcurve.c =================================================================== --- blender/source/blender/editors/curve/editcurve.c (Revision 26429) +++ blender/source/blender/editors/curve/editcurve.c (Arbeitskopie) @@ -1191,7 +1191,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "", 0.0001f, 10.0f); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "", 0.0001f, 10.0f, PROP_UNIT_NONE); } /********************* smooth operator ********************/ Index: blender/source/blender/editors/space_action/action_edit.c =================================================================== --- blender/source/blender/editors/space_action/action_edit.c (Revision 26429) +++ blender/source/blender/editors/space_action/action_edit.c (Arbeitskopie) @@ -733,7 +733,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f); + RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f, PROP_UNIT_NONE); } /* ******************** Sample Keyframes Operator *********************** */ Index: blender/source/blender/editors/transform/transform_ops.c =================================================================== --- blender/source/blender/editors/transform/transform_ops.c (Revision 26429) +++ blender/source/blender/editors/transform/transform_ops.c (Arbeitskopie) @@ -387,7 +387,7 @@ { RNA_def_enum(ot->srna, "proportional", proportional_editing_items, 0, "Proportional Editing", ""); RNA_def_enum(ot->srna, "proportional_editing_falloff", proportional_falloff_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); - RNA_def_float(ot->srna, "proportional_size", 1, 0, FLT_MAX, "Proportional Size", "", 0, 100); + RNA_def_float(ot->srna, "proportional_size", 1, 0, FLT_MAX, "Proportional Size", "", 0, 100, PROP_UNIT_NONE); } void Properties_Axis(struct wmOperatorType *ot) @@ -600,7 +600,7 @@ ot->cancel = transform_cancel; ot->poll = ED_operator_areaactive; - RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); Properties_Proportional(ot); @@ -627,7 +627,7 @@ ot->cancel = transform_cancel; ot->poll = ED_operator_editmesh; - RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); Properties_Proportional(ot); Index: blender/source/blender/editors/mesh/editmesh_tools.c =================================================================== --- blender/source/blender/editors/mesh/editmesh_tools.c (Revision 26429) +++ blender/source/blender/editors/mesh/editmesh_tools.c (Arbeitskopie) @@ -513,7 +513,7 @@ /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "limit", 0.0001f, 0.000001f, 50.0f, "Merge Threshold", "Minimum distance between merged verts", 0.00001f, 2.0f); + RNA_def_float(ot->srna, "limit", 0.0001f, 0.000001f, 50.0f, "Merge Threshold", "Minimum distance between merged verts", 0.00001f, 2.0f, PROP_UNIT_LENGTH); } // XXX is this needed? @@ -846,7 +846,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX); + RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX, PROP_UNIT_LENGTH); RNA_def_int(ot->srna, "steps", 10, 0, 180, "Steps", "", 0, INT_MAX); } @@ -983,7 +983,7 @@ /* props */ RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX); RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates"); - RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f); + RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f, PROP_UNIT_NONE); /* todo: PROP_UNIT_ROTATION? */ RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX); RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX); @@ -5184,7 +5184,7 @@ /* properties */ prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending."); RNA_def_enum_funcs(prop, shape_itemf); - RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f); + RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f, PROP_UNIT_NONE); RNA_def_boolean(ot->srna, "add", 1, "Add", "Add rather then blend between shapes."); } @@ -6717,8 +6717,8 @@ /* properties */ RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10); - RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f); - RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor.", 0.0f, 1000.0f); + RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor.", 0.0f, 1000.0f, PROP_UNIT_NONE); } /********************** Fill Operators *************************/ Index: blender/source/blender/editors/mesh/editmesh_mods.c =================================================================== --- blender/source/blender/editors/mesh/editmesh_mods.c (Revision 26429) +++ blender/source/blender/editors/mesh/editmesh_mods.c (Arbeitskopie) @@ -3035,7 +3035,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_float(ot->srna, "sharpness", 0.01f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f); + RNA_def_float(ot->srna, "sharpness", 0.01f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f, PROP_UNIT_NONE); /* todo: PROP_UNIT_ROTATION? */ } @@ -3203,7 +3203,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_float(ot->srna, "sharpness", 0.0f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f); + RNA_def_float(ot->srna, "sharpness", 0.0f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f, PROP_UNIT_NONE); /* todo: PROP_UNIT_ROTATION? */ } void select_non_manifold(EditMesh *em, wmOperator *op ) @@ -4538,7 +4538,7 @@ /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - prop= RNA_def_float(ot->srna, "thickness", 0.01f, -FLT_MAX, FLT_MAX, "thickness", "", -10.0f, 10.0f); + prop= RNA_def_float(ot->srna, "thickness", 0.01f, -FLT_MAX, FLT_MAX, "thickness", "", -10.0f, 10.0f, PROP_UNIT_LENGTH); RNA_def_property_ui_range(prop, -10, 10, 0.1, 4); } Index: blender/source/blender/editors/mesh/editmesh_add.c =================================================================== --- blender/source/blender/editors/mesh/editmesh_add.c (Revision 26429) +++ blender/source/blender/editors/mesh/editmesh_add.c (Arbeitskopie) @@ -1402,7 +1402,7 @@ /* props */ RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 3, 500); - RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00, PROP_UNIT_LENGTH); RNA_def_boolean(ot->srna, "fill", 0, "Fill", ""); ED_object_add_generic_props(ot, TRUE); @@ -1442,8 +1442,8 @@ /* props */ RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500); - RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00); - RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00, PROP_UNIT_LENGTH); + RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00, PROP_UNIT_LENGTH); RNA_def_boolean(ot->srna, "cap_ends", 1, "Cap Ends", ""); ED_object_add_generic_props(ot, TRUE); @@ -1482,8 +1482,8 @@ /* props */ RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500); - RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00); - RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00, PROP_UNIT_LENGTH); + RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00, PROP_UNIT_LENGTH); RNA_def_boolean(ot->srna, "cap_end", 0, "Cap End", ""); ED_object_add_generic_props(ot, TRUE); @@ -1523,7 +1523,7 @@ /* props */ RNA_def_int(ot->srna, "x_subdivisions", 10, INT_MIN, INT_MAX, "X Subdivisions", "", 3, 1000); RNA_def_int(ot->srna, "y_subdivisions", 10, INT_MIN, INT_MAX, "Y Subdivisions", "", 3, 1000); - RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX); + RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX, PROP_UNIT_LENGTH); ED_object_add_generic_props(ot, TRUE); } @@ -1594,7 +1594,7 @@ /* props */ RNA_def_int(ot->srna, "segments", 32, INT_MIN, INT_MAX, "Segments", "", 3, 500); RNA_def_int(ot->srna, "rings", 24, INT_MIN, INT_MAX, "Rings", "", 3, 500); - RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00); + RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00, PROP_UNIT_LENGTH); ED_object_add_generic_props(ot, TRUE); } @@ -1631,7 +1631,7 @@ /* props */ RNA_def_int(ot->srna, "subdivisions", 2, 0, 6, "Subdivisions", "", 0, 8); - RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00); + RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00, PROP_UNIT_LENGTH); ED_object_add_generic_props(ot, TRUE); } Index: blender/source/blender/editors/space_image/image_ops.c =================================================================== --- blender/source/blender/editors/space_image/image_ops.c (Revision 26429) +++ blender/source/blender/editors/space_image/image_ops.c (Arbeitskopie) @@ -412,7 +412,8 @@ /* properties */ RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, - "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", -FLT_MAX, FLT_MAX); + "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", + -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); } /********************** view all operator *********************/ @@ -612,7 +613,8 @@ /* properties */ RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX, - "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX); + "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", + -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); } /**************** load/replace/save callbacks ******************/ @@ -1205,7 +1207,7 @@ RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width.", 1, 16384); RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height.", 1, 16384); RNA_def_float_color(ot->srna, "color", 3, NULL, 0.0f, FLT_MAX, "Color", "Default fill color.", 0.0f, 1.0f); - RNA_def_float(ot->srna, "alpha", 1.0f, 0.0f, 1.0f, "Alpha", "Default fill alpha.", 0.0f, 1.0f); + RNA_def_float(ot->srna, "alpha", 1.0f, 0.0f, 1.0f, "Alpha", "Default fill alpha.", 0.0f, 1.0f, PROP_UNIT_NONE); RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing."); RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth."); } Index: blender/source/blender/editors/uvedit/uvedit_ops.c =================================================================== --- blender/source/blender/editors/uvedit/uvedit_ops.c (Revision 26429) +++ blender/source/blender/editors/uvedit/uvedit_ops.c (Arbeitskopie) @@ -1265,7 +1265,7 @@ /* properties */ RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance."); - RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates.", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates.", -FLT_MAX, FLT_MAX, PROP_UNIT_LENGTH); } /* ******************** (de)select all operator **************** */ Index: blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c =================================================================== --- blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c (Revision 26429) +++ blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c (Arbeitskopie) @@ -682,7 +682,7 @@ RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", "Direction of the sphere or cylinder."); RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align", "How to determine rotation around the pole."); if(radius) - RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "Radius of the sphere or cylinder.", 0.0001f, 100.0f); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "Radius of the sphere or cylinder.", 0.0001f, 100.0f, PROP_UNIT_LENGTH); } static void correct_uv_aspect(EditMesh *em) @@ -1374,6 +1374,6 @@ ot->poll= ED_operator_uvmap; /* properties */ - RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", "Size of the cube to project on.", 0.001f, 100.0f); + RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", "Size of the cube to project on.", 0.001f, 100.0f, PROP_UNIT_LENGTH); uv_map_clip_correct_properties(ot); } Index: blender/source/blender/editors/interface/interface.c =================================================================== --- blender/source/blender/editors/interface/interface.c (Revision 26429) +++ blender/source/blender/editors/interface/interface.c (Arbeitskopie) @@ -1421,6 +1421,12 @@ if(subtype == PROP_UNIT_LENGTH) { return value * scene->unit.scale_length; } + else if (subtype == PROP_UNIT_AREA) { + return value * pow(scene->unit.scale_length, 2); + } + else if (subtype == PROP_UNIT_VOLUME) { + return value * pow(scene->unit.scale_length, 3); + } else if(subtype == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */ return FRA2TIME(value); } Index: blender/source/blender/editors/interface/view2d_ops.c =================================================================== --- blender/source/blender/editors/interface/view2d_ops.c (Revision 26429) +++ blender/source/blender/editors/interface/view2d_ops.c (Arbeitskopie) @@ -704,8 +704,8 @@ // ot->flag= OPTYPE_REGISTER; /* rna - must keep these in sync with the other operators */ - RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX); - RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); } /* this operator only needs this single callback, where it callsthe view_zoom_*() methods */ @@ -760,8 +760,8 @@ // ot->flag= OPTYPE_REGISTER; /* rna - must keep these in sync with the other operators */ - RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX); - RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); } /* ********************************************************* */ @@ -1018,8 +1018,8 @@ // ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna - must keep these in sync with the other operators */ - RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX); - RNA_def_float(ot->srna, "deltay", 0, -FLT_MAX, FLT_MAX, "Delta Y", "", -FLT_MAX, FLT_MAX); + RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "deltay", 0, -FLT_MAX, FLT_MAX, "Delta Y", "", -FLT_MAX, FLT_MAX, PROP_UNIT_NONE); } /* ********************************************************* */ Index: blender/source/blender/editors/object/object_vgroup.c =================================================================== --- blender/source/blender/editors/object/object_vgroup.c (Revision 26429) +++ blender/source/blender/editors/object/object_vgroup.c (Arbeitskopie) @@ -1542,8 +1542,8 @@ /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights.", -1.0f, 1.f); - RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f); + RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights.", -1.0f, 1.f, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f, PROP_UNIT_NONE); } static int vertex_group_normalize_exec(bContext *C, wmOperator *op) @@ -1696,7 +1696,7 @@ /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f); + RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f, PROP_UNIT_NONE); RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups."); RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning."); } Index: blender/source/blender/editors/space_graph/graph_ops.c =================================================================== --- blender/source/blender/editors/space_graph/graph_ops.c (Revision 26429) +++ blender/source/blender/editors/space_graph/graph_ops.c (Arbeitskopie) @@ -183,7 +183,7 @@ /* rna */ RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); - RNA_def_float(ot->srna, "value", 0, FLT_MIN, FLT_MAX, "Value", "", -100.0f, 100.0f); + RNA_def_float(ot->srna, "value", 0, FLT_MIN, FLT_MAX, "Value", "", -100.0f, 100.0f, PROP_UNIT_NONE); } /* Toggle Handles ----------------------------------------------------------------- */ Index: blender/source/blender/editors/space_graph/graph_edit.c =================================================================== --- blender/source/blender/editors/space_graph/graph_edit.c (Revision 26429) +++ blender/source/blender/editors/space_graph/graph_edit.c (Arbeitskopie) @@ -602,8 +602,8 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float(ot->srna, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame Number", "Frame to insert keyframe on", 0, 100); - RNA_def_float(ot->srna, "value", 1.0f, -FLT_MAX, FLT_MAX, "Value", "Value for keyframe on", 0, 100); + RNA_def_float(ot->srna, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame Number", "Frame to insert keyframe on", 0, 100, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "value", 1.0f, -FLT_MAX, FLT_MAX, "Value", "Value for keyframe on", 0, 100, PROP_UNIT_NONE); } /* ******************** Copy/Paste Keyframes Operator ************************* */ @@ -924,7 +924,7 @@ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f); + RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f, PROP_UNIT_NONE); } /* ******************** Bake F-Curve Operator *********************** */ @@ -1139,15 +1139,15 @@ /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); - RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00); - RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00); - RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1); - RNA_def_float(ot->srna, "release", 0.2, 0.0, 5.0, "Release time", "", 0.01, 0.2); - RNA_def_float(ot->srna, "threshold", 0.0, 0.0, 1.0, "Threshold", "", 0.01, 0.1); + RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "release", 0.2, 0.0, 5.0, "Release time", "", 0.01, 0.2, PROP_UNIT_NONE); + RNA_def_float(ot->srna, "threshold", 0.0, 0.0, 1.0, "Threshold", "", 0.01, 0.1, PROP_UNIT_NONE); RNA_def_boolean(ot->srna, "accumulate", 0, "Accumulate", ""); RNA_def_boolean(ot->srna, "additive", 0, "Additive", ""); RNA_def_boolean(ot->srna, "square", 0, "Square", ""); - RNA_def_float(ot->srna, "sthreshold", 0.1, 0.0, 1.0, "Square Threshold", "", 0.01, 0.1); + RNA_def_float(ot->srna, "sthreshold", 0.1, 0.0, 1.0, "Square Threshold", "", 0.01, 0.1, PROP_UNIT_NONE); } /* ******************** Sample Keyframes Operator *********************** */