Fix T45032 allow float rotational values for numpad rotation
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user