diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-06-11 19:12:26 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-06-11 19:13:22 +0300 |
commit | 8c2619a11a155ecd8c331eb383a9c0749bb965ab (patch) | |
tree | efd5fe36f5335a54b50db9aec0bf831d60d4eaf3 /source/blender | |
parent | 939948c23384119dbcc7d94614cabf76dde22391 (diff) |
Fix T45032 allow float rotational values for numpad rotation
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/resources.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 617a3e1bdc6..8e7c1674f06 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1612,8 +1612,8 @@ void init_userdef_do_versions(void) U.tw_size = 25; /* percentage of window size */ U.tw_handlesize = 16; /* percentage of widget radius */ } - if (U.pad_rot_angle == 0) - U.pad_rot_angle = 15; + if (U.pad_rot_angle == 0.0f) + U.pad_rot_angle = 15.0f; /* graph editor - unselected F-Curve visibility */ if (U.fcu_inactive_alpha == 0) { diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index b7f2f48dece..d38de4a426e 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3954,7 +3954,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) char view_opposite; PropertyRNA *prop_angle = RNA_struct_find_property(op->ptr, "angle"); float angle = RNA_property_is_set(op->ptr, prop_angle) ? - RNA_property_float_get(op->ptr, prop_angle) : DEG2RADF((float)U.pad_rot_angle); + RNA_property_float_get(op->ptr, prop_angle) : DEG2RADF(U.pad_rot_angle); /* no NULL check is needed, poll checks */ v3d = CTX_wm_view3d(C); @@ -4183,7 +4183,7 @@ static int viewroll_exec(bContext *C, wmOperator *op) rv3d = ar->regiondata; if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) { int type = RNA_enum_get(op->ptr, "type"); - float angle = (type == 0) ? RNA_float_get(op->ptr, "angle") : DEG2RADF((float)U.pad_rot_angle); + float angle = (type == 0) ? RNA_float_get(op->ptr, "angle") : DEG2RADF(U.pad_rot_angle); float mousevec[3]; float quat_new[4]; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index af0c3bfbf0e..3a0e346d0c8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -490,8 +490,10 @@ typedef struct UserDef { short dragthreshold; int memcachelimit; int prefetchframes; + float pad_rot_angle; /* control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use */ + float pad3; short frameserverport; - short pad_rot_angle; /* control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use */ + short pad4; short obcenter_dia; short rvisize; /* rotating view icon size */ short rvibright; /* rotating view icon brightness */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 82afcfdbf29..b4f67630ffd 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3459,8 +3459,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable"); - prop = RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle"); + prop = RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pad_rot_angle"); RNA_def_property_range(prop, 0, 90); RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)"); |