diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-18 17:10:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-18 17:10:09 +0300 |
commit | 3ae670fc02f9e4eadf3c92f8c8c30df81e4aaaf2 (patch) | |
tree | 0cd56059e7a2d58e59aa93d82094566245b30b16 /source | |
parent | 4045e838dff87dc95f31d908c7ef4ab541bbe9f4 (diff) |
fix [#24786] Setting Rotation Units to Radians doesn't affect the UI [33146]
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 11 |
5 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 1240b85393b..4cb59a2ee86 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -255,6 +255,8 @@ static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0, static struct bUnitDef buNaturalRotDef[] = { {"degree", "degrees", "°", NULL, "Degrees", M_PI/180.0, 0.0, B_UNIT_DEF_NONE}, +// {"radian", "radians", "r", NULL, "Radians", 1.0, 0.0, B_UNIT_DEF_NONE}, +// {"turn", "turns", "t", NULL, "Turns", 1.0/(M_PI*2.0), 0.0,B_UNIT_DEF_NONE}, {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0} }; static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, sizeof(buNaturalRotDef)/sizeof(bUnitDef)}; diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 7cfe180a7bf..dd27de883b3 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -392,7 +392,7 @@ float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short res if (RNA_SUBTYPE_UNIT(RNA_property_subtype(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) { + if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) { if (restore) return M_PI / 180.0f; /* degrees to radians */ else diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 7120440468c..85c9feaf823 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1252,8 +1252,8 @@ int ui_is_but_unit(uiBut *but) unit_type = RNA_SUBTYPE_UNIT(RNA_property_subtype(but->rnaprop)); -#if 0 // removed so angle buttons get correct snapping - if (scene->unit.flag & USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION) +#if 1 // removed so angle buttons get correct snapping + if (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION) return 0; #endif diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index edba4d7a0eb..eedcf36c584 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -743,8 +743,10 @@ typedef struct bStats { typedef struct UnitSettings { /* Display/Editing unit options for each scene */ float scale_length; /* maybe have other unit conversions? */ - short system; - short flag; /* imperial, metric etc */ + char system; /* imperial, metric etc */ + char system_rotation; /* not implimented as a propper unit system yet */ + short flag; + } UnitSettings; typedef struct PhysicsSettings { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 780d99cc8ca..0cb4a251d0c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1278,6 +1278,11 @@ static void rna_def_unit_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, unit_systems); RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display"); RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rotation_units); + RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values"); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions"); @@ -1289,12 +1294,6 @@ static void rna_def_unit_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT); RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs"); RNA_def_property_update(prop, NC_WINDOW, NULL); - - prop= RNA_def_property(srna, "rotation_units", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, rotation_units); - RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values"); - RNA_def_property_update(prop, NC_WINDOW, NULL); } void rna_def_render_layer_common(StructRNA *srna, int scene) |