[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43527] branches/bmesh/blender: svn merge ^/trunk/blender -r43482:43524

Campbell Barton ideasman42 at gmail.com
Thu Jan 19 12:31:32 CET 2012


Revision: 43527
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43527
Author:   campbellbarton
Date:     2012-01-19 11:31:31 +0000 (Thu, 19 Jan 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r43482:43524

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43482

Modified Paths:
--------------
    branches/bmesh/blender/intern/cycles/kernel/kernel_shader.h
    branches/bmesh/blender/intern/cycles/render/light.cpp
    branches/bmesh/blender/intern/ghost/GHOST_ISystem.h
    branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.cpp
    branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.h
    branches/bmesh/blender/intern/ghost/intern/GHOST_SystemX11.cpp
    branches/bmesh/blender/intern/ghost/test/CMakeLists.txt
    branches/bmesh/blender/source/blender/blenkernel/BKE_DerivedMesh.h
    branches/bmesh/blender/source/blender/blenkernel/BKE_image.h
    branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
    branches/bmesh/blender/source/blender/blenkernel/intern/brush.c
    branches/bmesh/blender/source/blender/blenkernel/intern/image_gen.c
    branches/bmesh/blender/source/blender/blenkernel/intern/node.c
    branches/bmesh/blender/source/blender/blenkernel/intern/sequencer.c
    branches/bmesh/blender/source/blender/blenlib/BLI_math_color.h
    branches/bmesh/blender/source/blender/blenlib/intern/math_color.c
    branches/bmesh/blender/source/blender/blenlib/intern/math_color_inline.c
    branches/bmesh/blender/source/blender/editors/animation/anim_channels_defines.c
    branches/bmesh/blender/source/blender/editors/include/UI_resources.h
    branches/bmesh/blender/source/blender/editors/interface/interface_intern.h
    branches/bmesh/blender/source/blender/editors/interface/interface_templates.c
    branches/bmesh/blender/source/blender/editors/interface/interface_widgets.c
    branches/bmesh/blender/source/blender/editors/object/object_bake.c
    branches/bmesh/blender/source/blender/editors/sculpt_paint/CMakeLists.txt
    branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_intern.h
    branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
    branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt_intern.h
    branches/bmesh/blender/source/blender/editors/space_clip/clip_graph_draw.c
    branches/bmesh/blender/source/blender/editors/space_clip/clip_graph_ops.c
    branches/bmesh/blender/source/blender/editors/space_clip/clip_utils.c
    branches/bmesh/blender/source/blender/editors/space_clip/space_clip.c
    branches/bmesh/blender/source/blender/editors/space_clip/tracking_ops.c
    branches/bmesh/blender/source/blender/editors/space_outliner/outliner_intern.h
    branches/bmesh/blender/source/blender/editors/space_outliner/outliner_ops.c
    branches/bmesh/blender/source/blender/editors/space_outliner/outliner_select.c
    branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/bmesh/blender/source/blender/editors/space_view3d/drawarmature.c
    branches/bmesh/blender/source/blender/editors/space_view3d/drawmesh.c
    branches/bmesh/blender/source/blender/editors/space_view3d/drawobject.c
    branches/bmesh/blender/source/blender/editors/space_view3d/view3d_draw.c
    branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
    branches/bmesh/blender/source/blender/editors/transform/transform_generics.c
    branches/bmesh/blender/source/blender/editors/uvedit/uvedit_ops.c
    branches/bmesh/blender/source/blender/imbuf/intern/divers.c
    branches/bmesh/blender/source/blender/makesdna/DNA_tracking_types.h
    branches/bmesh/blender/source/blender/makesrna/intern/SConscript
    branches/bmesh/blender/source/blender/makesrna/intern/rna_controller.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_object_api.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_scene.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_sensor.c
    branches/bmesh/blender/source/blender/python/intern/bpy_rna.c
    branches/bmesh/blender/source/blender/render/intern/source/render_texture.c
    branches/bmesh/blender/source/blender/render/intern/source/rendercore.c
    branches/bmesh/blender/source/blender/windowmanager/intern/wm_operators.c
    branches/bmesh/blender/source/tests/bl_mesh_modifiers.py

Added Paths:
-----------
    branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_cursor.c

Property Changed:
----------------
    branches/bmesh/blender/
    branches/bmesh/blender/release/
    branches/bmesh/blender/release/scripts/startup/bl_ui/properties_paint_common.py
    branches/bmesh/blender/source/blender/editors/space_outliner/


Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43482
   + /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43524

Modified: branches/bmesh/blender/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/bmesh/blender/intern/cycles/kernel/kernel_shader.h	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/cycles/kernel/kernel_shader.h	2012-01-19 11:31:31 UTC (rev 43527)
@@ -151,7 +151,7 @@
 			instanced = true;
 		else
 #endif
-			sd->object = -sd->object-1;
+			sd->object = ~sd->object;
 #ifdef __INSTANCING__
 	}
 #endif

Modified: branches/bmesh/blender/intern/cycles/render/light.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/render/light.cpp	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/cycles/render/light.cpp	2012-01-19 11:31:31 UTC (rev 43527)
@@ -109,7 +109,7 @@
 
 	/* triangles */
 	size_t offset = 0;
-	size_t j = 0;
+	int j = 0;
 
 	foreach(Object *object, scene->objects) {
 		Mesh *mesh = object->mesh;
@@ -128,8 +128,11 @@
 		/* sum area */
 		if(have_emission) {
 			Transform tfm = object->tfm;
-			int object_id = (mesh->transform_applied)? -j-1: j;
+			int object_id = j;
 
+			if(mesh->transform_applied)
+				object_id = ~object_id;
+
 			for(size_t i = 0; i < mesh->triangles.size(); i++) {
 				Shader *shader = scene->shaders[mesh->shader[i]];
 
@@ -161,9 +164,9 @@
 	if(!multi_light) {
 		float lightarea = (totarea > 0.0f)? totarea/scene->lights.size(): 1.0f;
 
-		for(size_t i = 0; i < scene->lights.size(); i++, offset++) {
+		for(int i = 0; i < scene->lights.size(); i++, offset++) {
 			distribution[offset].x = totarea;
-			distribution[offset].y = __int_as_float(-i-1);
+			distribution[offset].y = __int_as_float(~(int)i);
 			distribution[offset].z = 1.0f;
 			distribution[offset].w = scene->lights[i]->size;
 			totarea += lightarea;

Modified: branches/bmesh/blender/intern/ghost/GHOST_ISystem.h
===================================================================
--- branches/bmesh/blender/intern/ghost/GHOST_ISystem.h	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/ghost/GHOST_ISystem.h	2012-01-19 11:31:31 UTC (rev 43527)
@@ -68,13 +68,28 @@
  * <li> Access to the state of the mouse buttons and the keyboard.</li>
  * <li> Menus for windows with events generated when they are accessed (this is
  *     work in progress).</li>
+ * <li> Video mode switching.</li>
+ * <li> Copy/Paste buffers.</li>
+ * <li> System paths.</li>
  * </ul>
  * Font management has been moved to a separate library.
  *
  * \section platforms Platforms
  *
+ * GHOST supports the following platforms:
+ * <ul>
+ * <li> OSX Cocoa.</li>
+ * <li> OSX Carbon.</li>
+ * <li> Windows.</li>
+ * <li> X11.</li>
+ * <li> SDL1.3 (experemental).</li>
+ * <li> NULL (headless mode).</li>
+ * </ul>
+ *
  * \section Building GHOST
  *
+ * GHOST is not build standalone however there are tests in intern/ghost/test
+ *
  * \section interface Interface
  * GHOST has two programming interfaces:
  * <ul>

Modified: branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.cpp
===================================================================
--- branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.cpp	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.cpp	2012-01-19 11:31:31 UTC (rev 43527)
@@ -137,6 +137,37 @@
 	NDOF_BUTTON_MINUS
 };
 
+// latest HW: button-compatible with SpacePilotPro, just fewer of them
+static const NDOF_ButtonT SpaceMousePro_HID_map[] = {
+	NDOF_BUTTON_MENU,
+	NDOF_BUTTON_FIT,
+	NDOF_BUTTON_TOP,
+	NDOF_BUTTON_NONE, // left
+	NDOF_BUTTON_RIGHT,
+	NDOF_BUTTON_FRONT,
+	NDOF_BUTTON_NONE, // bottom
+	NDOF_BUTTON_NONE, // back
+	NDOF_BUTTON_ROLL_CW,
+	NDOF_BUTTON_NONE, // roll ccw
+	NDOF_BUTTON_NONE, // iso 1
+	NDOF_BUTTON_NONE, // iso 2
+	NDOF_BUTTON_1,
+	NDOF_BUTTON_2,
+	NDOF_BUTTON_3,
+	NDOF_BUTTON_4,
+	NDOF_BUTTON_NONE, // 5
+	NDOF_BUTTON_NONE, // 6
+	NDOF_BUTTON_NONE, // 7
+	NDOF_BUTTON_NONE, // 8
+	NDOF_BUTTON_NONE, // 9
+	NDOF_BUTTON_NONE, // 10
+	NDOF_BUTTON_NONE, // esc key
+	NDOF_BUTTON_NONE, // alt key
+	NDOF_BUTTON_NONE, // shift key
+	NDOF_BUTTON_NONE, // ctrl key
+	NDOF_BUTTON_ROTATE,
+};
+
 /* this is the older SpacePilot (sans Pro)
  * thanks to polosson for the info in this table */
 static const NDOF_ButtonT SpacePilot_HID_map[] = {
@@ -210,6 +241,12 @@
 					m_deviceType = NDOF_SpacePilotPro;
 					m_buttonCount = 31;
 					break;
+				case 0xC62B:
+					puts("ndof: using SpaceMousePro");
+					m_deviceType = NDOF_SpaceMousePro;
+					m_buttonCount = 27;
+					// ^^ actually has 15 buttons, but their HID codes range from 0 to 26
+					break;
 
 				// -- older devices --
 				case 0xC625:
@@ -237,6 +274,8 @@
 	else {
 		m_buttonMask = ~(-1 << m_buttonCount);
 
+		// special case for SpaceMousePro? maybe...
+
 #ifdef DEBUG_NDOF_BUTTONS
 		printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
 #endif
@@ -261,6 +300,16 @@
 
 void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
 {
+	if (button == NDOF_BUTTON_NONE) {
+		// just being exceptionally cautious...
+		// air-tight button masking and proper function key emulation
+		// should guarantee we never get to this point
+#ifdef DEBUG_NDOF_BUTTONS
+		printf("discarding NDOF_BUTTON_NONE (should not escape the NDOF manager)\n");
+#endif
+		return;
+	}
+
 	GHOST_EventNDOFButton* event = new GHOST_EventNDOFButton(time, window);
 	GHOST_TEventNDOFButtonData* data = (GHOST_TEventNDOFButtonData*) event->getData();
 
@@ -317,6 +366,15 @@
 				default: sendButtonEvent(SpacePilotPro_HID_map[button_number], press, time, window);
 			}
 			break;
+		case NDOF_SpaceMousePro:
+			switch (button_number) {
+				case 22: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
+				case 23: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
+				case 24: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
+				case 25: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
+				default: sendButtonEvent(SpaceMousePro_HID_map[button_number], press, time, window);
+			}
+			break;
 		case NDOF_SpacePilot:
 			switch (button_number) {
 				case 10: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;

Modified: branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.h
===================================================================
--- branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.h	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/ghost/intern/GHOST_NDOFManager.h	2012-01-19 11:31:31 UTC (rev 43527)
@@ -37,6 +37,7 @@
 	NDOF_SpaceNavigator,
 	NDOF_SpaceExplorer,
 	NDOF_SpacePilotPro,
+	NDOF_SpaceMousePro,
 
 	// older devices
 	NDOF_SpacePilot

Modified: branches/bmesh/blender/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/bmesh/blender/intern/ghost/intern/GHOST_SystemX11.cpp	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/ghost/intern/GHOST_SystemX11.cpp	2012-01-19 11:31:31 UTC (rev 43527)
@@ -422,6 +422,18 @@
 	return anyProcessed;
 }
 
+
+#ifdef WITH_X11_XINPUT
+/* set currently using tablet mode (stylus or eraser) depending on device ID */
+static void setTabletMode(GHOST_WindowX11 * window, XID deviceid)
+{
+	if(deviceid == window->GetXTablet().StylusID)
+		window->GetXTablet().CommonData.Active= GHOST_kTabletModeStylus;
+	else if(deviceid == window->GetXTablet().EraserID)
+		window->GetXTablet().CommonData.Active= GHOST_kTabletModeEraser;
+}
+#endif /* WITH_X11_XINPUT */
+
 	void
 GHOST_SystemX11::processEvent(XEvent *xe)
 {
@@ -824,6 +836,12 @@
 			if(xe->type == window->GetXTablet().MotionEvent) 
 			{
 				XDeviceMotionEvent* data = (XDeviceMotionEvent*)xe;
+
+				/* stroke might begin without leading ProxyIn event,
+				 * this happens when window is opened when stylus is already hovering
+				 * around tablet surface */
+				setTabletMode(window, data->deviceid);
+
 				window->GetXTablet().CommonData.Pressure= 
 					data->axis_data[2]/((float)window->GetXTablet().PressureLevels);
 			
@@ -837,10 +855,8 @@
 			else if(xe->type == window->GetXTablet().ProxInEvent) 
 			{
 				XProximityNotifyEvent* data = (XProximityNotifyEvent*)xe;
-				if(data->deviceid == window->GetXTablet().StylusID)
-					window->GetXTablet().CommonData.Active= GHOST_kTabletModeStylus;
-				else if(data->deviceid == window->GetXTablet().EraserID)
-					window->GetXTablet().CommonData.Active= GHOST_kTabletModeEraser;
+
+				setTabletMode(window, data->deviceid);
 			}
 			else if(xe->type == window->GetXTablet().ProxOutEvent)
 				window->GetXTablet().CommonData.Active= GHOST_kTabletModeNone;

Modified: branches/bmesh/blender/intern/ghost/test/CMakeLists.txt
===================================================================
--- branches/bmesh/blender/intern/ghost/test/CMakeLists.txt	2012-01-19 11:27:00 UTC (rev 43526)
+++ branches/bmesh/blender/intern/ghost/test/CMakeLists.txt	2012-01-19 11:31:31 UTC (rev 43527)
@@ -35,6 +35,25 @@
 
 
 # -----------------------------------------------------------------------------
+# Defines
+
+# set the endian define
+if(MSVC)
+	# for some reason this fails on msvc
+	add_definitions(-D__LITTLE_ENDIAN__)
+else()
+	include(TestBigEndian)
+	test_big_endian(_SYSTEM_BIG_ENDIAN)
+	if(_SYSTEM_BIG_ENDIAN)
+		add_definitions(-D__BIG_ENDIAN__)
+	else()
+		add_definitions(-D__LITTLE_ENDIAN__)
+	endif()
+	unset(_SYSTEM_BIG_ENDIAN)
+endif()
+
+
+# -----------------------------------------------------------------------------
 # Libraries
 
 # ghost
@@ -74,6 +93,7 @@
 		"../../../source/blender/blenlib/intern/fileops.c"

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list