[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39110] trunk/blender: stricter NDOF guards for Windows (forgot in earlier commit)
Mike Erwin
significant.bit at gmail.com
Sun Aug 7 01:13:37 CEST 2011
Revision: 39110
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39110
Author: merwin
Date: 2011-08-06 23:13:36 +0000 (Sat, 06 Aug 2011)
Log Message:
-----------
stricter NDOF guards for Windows (forgot in earlier commit)
Modified Paths:
--------------
trunk/blender/build_files/scons/config/darwin-config.py
trunk/blender/intern/ghost/intern/GHOST_SystemWin32.h
trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesrna/intern/rna_userdef.c
trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
Modified: trunk/blender/build_files/scons/config/darwin-config.py
===================================================================
--- trunk/blender/build_files/scons/config/darwin-config.py 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/build_files/scons/config/darwin-config.py 2011-08-06 23:13:36 UTC (rev 39110)
@@ -21,6 +21,7 @@
MAC_PROC=commands.getoutput(cmd)
cmd = 'uname -r'
cmd_res=commands.getoutput(cmd)
+MAC_CUR_VER='10.5' # by default (test below fails on my 10.5 PowerPC)
if cmd_res[:2]=='7':
MAC_CUR_VER='10.3'
elif cmd_res[:2]=='8':
Modified: trunk/blender/intern/ghost/intern/GHOST_SystemWin32.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemWin32.h 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemWin32.h 2011-08-06 23:13:36 UTC (rev 39110)
@@ -302,6 +302,7 @@
*/
static void processMinMaxInfo(MINMAXINFO * minmax);
+#ifdef WITH_INPUT_NDOF
/**
* Handles Motion and Button events from a SpaceNavigator or related device.
* Instead of returning an event object, this function communicates directly
@@ -310,6 +311,7 @@
* @return Whether an event was generated and sent.
*/
bool processNDOF(RAWINPUT const& raw);
+#endif
/**
* Returns the local state of the modifier keys (from the message queue).
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_fly.c 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_fly.c 2011-08-06 23:13:36 UTC (rev 39110)
@@ -1138,7 +1138,7 @@
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, fly_object);
}
- // puts("redraw!"); // too frequent, commented with NDOF_FLY_DRAW_TOOMUCH for now
+ puts("redraw!"); // too frequent, commented with NDOF_FLY_DRAW_TOOMUCH for now
ED_region_tag_redraw(CTX_wm_region(C));
}
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2011-08-06 23:13:36 UTC (rev 39110)
@@ -603,7 +603,7 @@
#define NDOF_ORBIT_INVERT_AXES (1 << 6)
/* zoom is up/down if this flag is set (otherwise forward/backward) */
#define NDOF_ZOOM_UPDOWN (1 << 7)
-#define NDOF_INVERT_ZOOM (1 << 8)
+#define NDOF_ZOOM_INVERT (1 << 8)
#ifdef __cplusplus
Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2011-08-06 23:13:36 UTC (rev 39110)
@@ -2746,19 +2746,32 @@
RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
/* 3D mouse settings */
+ /* global options */
prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.25f, 4.0f);
RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
+ prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
+ RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
+
+ prop= RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
+ RNA_def_property_ui_text(prop, "Invert Zoom", "Zoom using opposite direction");
+
+ /* 3D view */
prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
/* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
+ /* 3D view: orbit */
prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
+ /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode'
+ /* 3D view: fly */
prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-08-06 22:59:05 UTC (rev 39109)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-08-06 23:13:36 UTC (rev 39110)
@@ -2330,26 +2330,28 @@
const float s = U.ndof_sensitivity;
data->tvec[0]= s * ghost->tx;
+
data->rvec[0]= s * ghost->rx;
+ data->rvec[1]= s * ghost->ry;
+ data->rvec[2]= s * ghost->rz;
if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
{
- // swap Y and Z
+ // rotate so Y is where Z was (maintain handed-ness)
data->tvec[1]= s * ghost->tz;
- data->tvec[2]= s * ghost->ty;
+ data->tvec[2]= s * -ghost->ty;
// should this affect rotation also?
// initial guess is 'yes', but get user feedback immediately!
+#if 0 // after turning this on, my guess becomes 'no'
data->rvec[1]= s * ghost->rz;
data->rvec[2]= s * ghost->ry;
+#endif
}
else
{
data->tvec[1]= s * ghost->ty;
data->tvec[2]= s * ghost->tz;
-
- data->rvec[1]= s * ghost->ry;
- data->rvec[2]= s * ghost->rz;
}
data->dt = ghost->dt;
More information about the Bf-blender-cvs
mailing list