Merging r39135 through r39172 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 8 Aug 2011 07:14:59 +0000 (07:14 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 8 Aug 2011 07:14:59 +0000 (07:14 +0000)
42 files changed:
CMakeLists.txt
SConstruct
build_files/buildbot/slave_compile.py
build_files/buildbot/slave_pack.py
build_files/cmake/macros.cmake
build_files/scons/config/darwin-config.py
build_files/scons/tools/btools.py
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_NDOFManager.cpp
intern/ghost/intern/GHOST_NDOFManagerCocoa.h
intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
intern/ghost/intern/GHOST_NDOFManagerX11.cpp
intern/ghost/intern/GHOST_NDOFManagerX11.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemPathsX11.cpp
intern/ghost/intern/GHOST_SystemSDL.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/modules/bpy_extras/mesh_utils.py
release/scripts/modules/bpyml.py
release/scripts/modules/bpyml_ui.py
release/scripts/modules/rna_info.py
release/scripts/startup/bl_operators/image.py
release/scripts/startup/bl_operators/uvcalc_lightmap.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/templates/operator_modal.py
release/scripts/templates/operator_modal_draw.py
release/scripts/templates/operator_modal_view3d.py
source/blender/editors/interface/resources.c
source/blender/editors/transform/CMakeLists.txt
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ndofinput.c [deleted file]
source/blender/editors/transform/transform_ops.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/tests/CMakeLists.txt
source/tests/bl_run_operators.py

index e054eb9ce7ed5987ab1b077d33eb4fcef2dcc70b..641e798b0ef00fde66531f239efb210d58336a95 100644 (file)
@@ -1013,6 +1013,10 @@ elseif(APPLE)
                        if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
                                set(WITH_INPUT_NDOF OFF)
                        endif()
+
+                       if(WITH_INPUT_NDOF)
+                               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework 3DconnexionClient")
+                       endif()
                endif()
 
        else()
index 4f920190276714e11a1fb021489d1cb06da5ce58..7b25f744103c0c2f9b20576d18f4785d691eb6b9 100644 (file)
@@ -253,14 +253,22 @@ if 'blenderlite' in B.targets:
         if k not in B.arguments:
             env[k] = v
 
-# detect presence of 3D_CONNEXION_CLIENT_LIBRARY for OSX
+# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
 if env['OURPLATFORM']=='darwin':
-    envi = Environment()
-    conf = Configure(envi)
-    if not conf.CheckCHeader('ConnexionClientAPI.h'): # CheckCXXHeader if it is c++ !
+    print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
+    print "Available " + env['MACOSX_SDK_CHECK']
+    if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
+        print  B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk"
+    else:
+        print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
+
+    # for now, Mac builders must download and install the driver framework from 3Dconnexion
+    # necessary header file lives here when installed:
+    # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
+    if env['WITH_BF_3DMOUSE'] == 1 and not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
         print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
         env['WITH_BF_3DMOUSE'] = 0
-    envi = conf.Finish()
+        env['FOUND_NDOF_DRIVERS'] = 0
 
 
 if env['WITH_BF_OPENMP'] == 1:
index 9dd39ccd3088b27d8e10fe18477072d5d55cf493..b83a65f2466301ecf2bdaed2f458c5f08c7c2dc9 100644 (file)
@@ -134,7 +134,7 @@ else:
             scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
             scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
 
-            scons_options.append('BF_BITNESS='+bitness)
+            scons_options.append('BF_BITNESS=' + bitness)
 
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
         sys.exit(retcode)
index e779b10bd2a8272f2f76b7dacfedd31f24438ed8..5fdeb4a8ad558c237182235c004e3b0e0fa0c03f 100644 (file)
@@ -98,7 +98,7 @@ if builder.find('scons') != -1:
             scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
             scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
 
-            scons_options.append('BF_BITNESS='+bitness)
+            scons_options.append('BF_BITNESS=' + bitness)
 
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
         sys.exit(retcode)
index ed200abd4195a016212dfaadbc8b915fff448276..27694bcb8752c59b458f92058ee75c06d515b3a7 100644 (file)
@@ -62,6 +62,10 @@ macro(blender_include_dirs
        foreach(_INC ${ARGV})
                get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
                list(APPEND _ALL_INCS ${_ABS_INC})
+               # for checking for invalid includes, disable for regular use
+               ##if(NOT EXISTS "${_ABS_INC}/")
+               ##      message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
+               ##endif()
        endforeach()
        include_directories(${_ALL_INCS})
        unset(_INC)
@@ -75,6 +79,9 @@ macro(blender_include_dirs_sys
        foreach(_INC ${ARGV})
                get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
                list(APPEND _ALL_INCS ${_ABS_INC})
+               ##if(NOT EXISTS "${_ABS_INC}/")
+               ##      message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
+               ##endif()
        endforeach()
        include_directories(SYSTEM ${_ALL_INCS})
        unset(_INC)
index 97e8e90e574a07d398b47aac75a0e1276a972e8a..29695896921d10bec48aa322bd1723ed963fc2c4 100644 (file)
@@ -21,17 +21,23 @@ cmd = 'uname -p'
 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':
+
+if cmd_res[:1]=='7':
        MAC_CUR_VER='10.3'
-elif cmd_res[:2]=='8':
+elif cmd_res[:1]=='8':
        MAC_CUR_VER='10.4'
-elif cmd_res[:2]=='9':
+elif cmd_res[:1]=='9':
        MAC_CUR_VER='10.5'
 elif cmd_res[:2]=='10':
        MAC_CUR_VER='10.6'
 elif cmd_res[:2]=='11':
        MAC_CUR_VER='10.7'
+cmd = 'xcodebuild -version'
+cmd_xcode=commands.getoutput(cmd)
+XCODE_CUR_VER=cmd_xcode
+cmd = 'xcodebuild -showsdks'
+cmd_sdk=commands.getoutput(cmd)
+MACOSX_SDK_CHECK=cmd_sdk
 
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
        USE_QTKIT=True # Carbon quicktime is not available for 64bit
@@ -60,21 +66,23 @@ elif MACOSX_ARCHITECTURE == 'i386' and MAC_CUR_VER == '10.4':
        LCGDIR = '#../lib/darwin-8.x.i386'
        CC = 'gcc-4.0'
        CXX = 'g++-4.0'
-elif MAC_CUR_VER >= '10.6':
-       # OSX 10.6 and 10.7 developer tools do not come with sdk < 10.6 anymore !
-       MAC_MIN_VERS = '10.6'
-       MACOSX_DEPLOYMENT_TARGET = '10.6'
-       MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
-       LCGDIR = '#../lib/darwin-9.x.universal'
-       CC = 'llvm-gcc-4.2'
-       CXX = 'llvm-g++-4.2'
 else :
-       MAC_MIN_VERS = '10.5'
-       MACOSX_DEPLOYMENT_TARGET = '10.5'
-       MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
-       LCGDIR = '#../lib/darwin-9.x.universal'
-       CC = 'gcc-4.2'
-       CXX = 'g++-4.2'
+       if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
+               # OSX 10.5/6 with Xcode 3.x
+               MAC_MIN_VERS = '10.5'
+               MACOSX_DEPLOYMENT_TARGET = '10.5'
+               MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
+               LCGDIR = '#../lib/darwin-9.x.universal'
+               CC = 'gcc-4.2'
+               CXX = 'g++-4.2'
+       else:
+               # OSX 10.6/7 with Xcode 4.x
+               MAC_MIN_VERS = '10.6'
+               MACOSX_DEPLOYMENT_TARGET = '10.6'
+               MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
+               LCGDIR = '#../lib/darwin-9.x.universal'
+               CC = 'gcc-4.2'
+               CXX = 'g++-4.2'
 
 LIBDIR = '${LCGDIR}'
 
@@ -199,8 +207,8 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
 BF_GETTEXT_LIB = 'intl'
 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
 
-WITH_BF_GAMEENGINE=True
-WITH_BF_PLAYER = False
+WITH_BF_GAMEENGINE = True
+WITH_BF_PLAYER = True
 
 WITH_BF_BULLET = True
 BF_BULLET = '#extern/bullet2/src'
@@ -251,7 +259,7 @@ BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
 
 #OpenCollada flags
-WITH_BF_COLLADA = False
+WITH_BF_COLLADA = True
 BF_COLLADA = '#source/blender/collada'
 BF_COLLADA_INC = '${BF_COLLADA}'
 BF_COLLADA_LIB = 'bf_collada'
@@ -277,7 +285,7 @@ elif MACOSX_ARCHITECTURE == 'x86_64':
     BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
 
 # SpaceNavigator and related 3D mice
-WITH_BF_3DMOUSE = False
+WITH_BF_3DMOUSE = True
 
 #############################################################################
 ###################  various compile settings and flags    ##################
@@ -296,31 +304,31 @@ CPPFLAGS = []+ARCH_FLAGS
 CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
 CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
 
-if WITH_GHOST_COCOA==True:
+if WITH_GHOST_COCOA:
        PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
 else:
        PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
 
-if WITH_BF_QUICKTIME == True:
-       if USE_QTKIT == True:
+if WITH_BF_QUICKTIME:
+       if USE_QTKIT:
                PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
        else:
                PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
 
-if WITH_BF_3DMOUSE:
+if FOUND_NDOF_DRIVERS:
        PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS + ['-weak_framework','3DconnexionClient']
 
 #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
 LLIBS = ['stdc++', 'SystemStubs']
 
-# some flags shuffling for different Os versions
+# some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
        CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
        CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
        PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
        LLIBS.append('crt3.o')
        
-if USE_SDK==True:
+if USE_SDK:
        SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]    
        PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-isysroot',MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
        CCFLAGS=SDK_FLAGS+CCFLAGS
index 5508b8d35cd9754c958af29655d428bdb52deb95..0259d93f6edf1e1c7c5b64f835cf187192a021b9 100644 (file)
@@ -136,7 +136,7 @@ def validate_arguments(args, bc):
             'BF_NO_ELBEEM',
             'WITH_BF_CXX_GUARDEDALLOC',
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
-            'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
+            'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'FOUND_NDOF_DRIVERS', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
             ]
     
     # Have options here that scons expects to be lists
@@ -149,7 +149,7 @@ def validate_arguments(args, bc):
             'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
             'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
             'C_WARN', 'CC_WARN', 'CXX_WARN',
-            'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE',
+            'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER',
     ]
     
     
@@ -439,6 +439,7 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
 
         (BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
+        (BoolVariable('FOUND_NDOF_DRIVERS', 'We detected NDOF libs or framework', False)),
         (BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
         ('BF_3DMOUSE', '3d mouse library base path', ''),
         ('BF_3DMOUSE_INC', '3d mouse library include path', ''),
@@ -462,6 +463,8 @@ def read_opts(env, cfg, args):
         ('LLIBS', 'Platform libs', []),
         ('PLATFORM_LINKFLAGS', 'Platform linkflags', []),
         ('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
+        ('MACOSX_SDK_CHECK', 'detect available OSX sdk`s', ''),
+        ('XCODE_CUR_VER', 'detect XCode version', ''),
 
         (BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
         ('BF_PROFILE_CFLAGS', 'C only profiling flags', []),
index d7658c50a366428ee136946e4637d7ab58c32eaa..bdda0f3382ebf008eb6db1b035ed829da8e2573a 100644 (file)
@@ -149,6 +149,10 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
                        intern/GHOST_SystemPathsX11.cpp
                        intern/GHOST_SystemPathsX11.h
                )
+
+               if(NOT WITH_INSTALL_PORTABLE)
+                       add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+               endif()
        elseif(WIN32)
 
                list(APPEND SRC
@@ -204,10 +208,6 @@ elseif(APPLE)
 
 elseif(UNIX)
 
-       if(WITH_X11_XINPUT)
-               add_definitions(-DWITH_X11_XINPUT)
-       endif()
-
        list(APPEND INC_SYS
                ${X11_X11_INCLUDE_PATH}
        )
@@ -224,10 +224,6 @@ elseif(UNIX)
                intern/GHOST_WindowX11.h
        )
 
-       if(NOT WITH_INSTALL_PORTABLE)
-               add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
-       endif()
-
        if(X11_XF86keysym_INCLUDE_PATH)
                add_definitions(-DWITH_XF86KEYSYM)
                list(APPEND INC_SYS
@@ -243,6 +239,14 @@ elseif(UNIX)
                )
        endif()
 
+       if(NOT WITH_INSTALL_PORTABLE)
+               add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
+       endif()
+
+       if(WITH_X11_XINPUT)
+               add_definitions(-DWITH_X11_XINPUT)
+       endif()
+
 elseif(WIN32)
        if(MSVC)
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
index 855e27b99644411f61456f8a49f7e8fabf84d5c9..a24ccc3ff6c8d860eaae00ad196887d50e29c948 100644 (file)
@@ -375,7 +375,7 @@ void GHOST_NDOFManager::setDeadZone(float dz)
 
 static bool atHomePosition(GHOST_TEventNDOFMotionData* ndof)
 {
-#define HOME(foo) (ndof->foo == 0)
+#define HOME(foo) (ndof->foo == 0.f)
        return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
 #undef HOME
 }
@@ -386,9 +386,9 @@ static bool nearHomePosition(GHOST_TEventNDOFMotionData* ndof, float threshold)
                return atHomePosition(ndof);
        }
        else {
-#define HOME1(foo) (fabsf(ndof->foo) < threshold)
-               return HOME1(tx) && HOME1(ty) && HOME1(tz) && HOME1(rx) && HOME1(ry) && HOME1(rz);
-#undef HOME1
+#define HOME(foo) (fabsf(ndof->foo) < threshold)
+               return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
+#undef HOME
        }
 }
 
@@ -423,17 +423,17 @@ bool GHOST_NDOFManager::sendMotionEvent()
 
        data->dt = 0.001f * (m_motionTime - m_prevMotionTime); // in seconds
 
-       bool handMotion = !nearHomePosition(data, m_deadZone);
+       bool weHaveMotion = !nearHomePosition(data, m_deadZone);
 
        // determine what kind of motion event to send (Starting, InProgress, Finishing)
        // and where that leaves this NDOF manager (NotStarted, InProgress, Finished)
        switch (m_motionState) {
                case GHOST_kNotStarted:
                case GHOST_kFinished:
-                       if (handMotion) {
+                       if (weHaveMotion) {
                                data->progress = GHOST_kStarting;
                                m_motionState = GHOST_kInProgress;
-                               // prev motion time will be ancient, so just make up something reasonable
+                               // prev motion time will be ancient, so just make up a reasonable time delta
                                data->dt = 0.0125f;
                        }
                        else {
@@ -443,9 +443,9 @@ bool GHOST_NDOFManager::sendMotionEvent()
                        }
                        break;
                case GHOST_kInProgress:
-                       if (handMotion) {
+                       if (weHaveMotion) {
                                data->progress = GHOST_kInProgress;
-                               // keep InProgress state
+                               // remain 'InProgress'
                        }
                        else {
                                data->progress = GHOST_kFinishing;
@@ -453,7 +453,7 @@ bool GHOST_NDOFManager::sendMotionEvent()
                        }
                        break;
                default:
-                       break;
+                       ; // will always be one of the above
        }
 
 #ifdef DEBUG_NDOF_MOTION
index 27397b711b7a0e2df9840416a8429de4c33d2a54..e9897f30104c2122ae84de83f3c28dee395b0011 100644 (file)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
 #ifndef _GHOST_NDOFMANAGERCOCOA_H_
 #define _GHOST_NDOFMANAGERCOCOA_H_
 
+#ifdef WITH_INPUT_NDOF
+
 #include "GHOST_NDOFManager.h"
 
 // Event capture is handled within the NDOF manager on Macintosh,
@@ -47,4 +49,5 @@ private:
 };
 
 
-#endif
+#endif // WITH_INPUT_NDOF
+#endif // #include guard
index 53a991a7396f78ede325f01cbf93bfbdbf59d9ec..1d90b6daa6866198131ba9098424cbe6fc06242c 100644 (file)
@@ -22,7 +22,9 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
+#ifdef WITH_INPUT_NDOF
+
 #include "GHOST_NDOFManagerCocoa.h"
 #include "GHOST_SystemCocoa.h"
 
@@ -170,3 +172,5 @@ bool GHOST_NDOFManagerCocoa::available()
        return InstallConnexionHandlers != NULL;
        // this means that the driver is installed and dynamically linked to blender
 }
+
+#endif // WITH_INPUT_NDOF
index 099fa15d179ee0335879bbfb278de277f19014c3..4dd5331903962875e8b01fa4f7c18e590a869c16 100644 (file)
@@ -22,7 +22,9 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
+#ifdef WITH_INPUT_NDOF
+
 #include "GHOST_NDOFManagerX11.h"
 #include "GHOST_SystemX11.h"
 #include <spnav.h>
@@ -34,14 +36,14 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
       GHOST_NDOFManager(sys),
       m_available(false)
 {
-       setDeadZone(0.1f); // how to calibrate on Linux? throw away slight motion!
+       setDeadZone(0.1f); /* how to calibrate on Linux? throw away slight motion! */
 
        if (spnav_open() != -1) {
-               // determine exactly which device (if any) is plugged in
+               /* determine exactly which device (if any) is plugged in */
 
 #define MAX_LINE_LENGTH 100
 
-               // look for USB devices with Logitech's vendor ID
+               /* look for USB devices with Logitech's vendor ID */
                FILE* command_output = popen("lsusb -d 046d:","r");
                if (command_output) {
                        char line[MAX_LINE_LENGTH] = {0};
@@ -50,15 +52,15 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
                                if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2)
                                        if (setDevice(vendor_id, product_id)) {
                                                m_available = true;
-                                               break; // stop looking once the first 3D mouse is found
+                                               break; /* stop looking once the first 3D mouse is found */
                                        }
                        }
                        pclose(command_output);
                }
        }
        else {
-               printf("ndof: spacenavd not found\n");
-               // This isn't a hard error, just means the user doesn't have a 3D mouse.
+               puts("ndof: spacenavd not found");
+               /* This isn't a hard error, just means the user doesn't have a 3D mouse. */
        }
 }
 
@@ -73,11 +75,6 @@ bool GHOST_NDOFManagerX11::available()
        return m_available;
 }
 
-//bool GHOST_NDOFManagerX11::identifyDevice()
-//{
-//     
-//}
-
 bool GHOST_NDOFManagerX11::processEvents()
 {
        GHOST_TUns64 now = m_system.getMilliSeconds();
@@ -88,7 +85,7 @@ bool GHOST_NDOFManagerX11::processEvents()
                switch (e.type) {
                        case SPNAV_EVENT_MOTION:
                        {
-                               // convert to blender view coords
+                               /* convert to blender view coords */
                                short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
                                short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
 
@@ -104,3 +101,5 @@ bool GHOST_NDOFManagerX11::processEvents()
        }
        return anyProcessed;
 }
+
+#endif /* WITH_INPUT_NDOF */
index 82bd256c70736c6e869c50bf91217493f951672c..0a5497537563996ef6d5296d97ebe83acf1f5584 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef _GHOST_NDOFMANAGERX11_H_
 #define _GHOST_NDOFMANAGERX11_H_
 
+#ifdef WITH_INPUT_NDOF
+
 #include "GHOST_NDOFManager.h"
 
 /* Event capture is handled within the NDOF manager on Linux,
@@ -40,10 +42,9 @@ public:
        bool processEvents();
 
 private:
-       //      bool identifyDevice();
-
        bool m_available;
 };
 
-#endif
+#endif /* WITH_INPUT_NDOF */
+#endif /* #include guard */
 
index 17f0f2d6ecde753edc0da85d9d9a3ce18ec1325f..303c2b24497df406d08ee3aa47f8d0325af20a80 100644 (file)
@@ -21,8 +21,8 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s):     Maarten Gribnau 05/2001
- *                                     Damien Plisson 09/2009
+ * Contributors: Maarten Gribnau 05/2001
+ *               Damien Plisson 09/2009
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 #include "GHOST_EventButton.h"
 #include "GHOST_EventCursor.h"
 #include "GHOST_EventWheel.h"
-#include "GHOST_EventNDOF.h"
 #include "GHOST_EventTrackpad.h"
 #include "GHOST_EventDragnDrop.h"
 #include "GHOST_EventString.h"
-
 #include "GHOST_TimerManager.h"
 #include "GHOST_TimerTask.h"
 #include "GHOST_WindowManager.h"
 #include "GHOST_WindowCocoa.h"
+#ifdef WITH_INPUT_NDOF
 #include "GHOST_NDOFManagerCocoa.h"
+#endif
+
 #include "AssertMacros.h"
 
 #pragma mark KeyMap, mouse converters
index dd8935732c504974a175336b4d0043612d47bad0..135f5c42dc5d51babb8c9ff4792791bfe8e99c11 100644 (file)
 #include <stdio.h> // for fprintf only
 #include <cstdlib> // for exit
 
-using namespace std;
+#ifdef PREFIX
+static const char *static_path= PREFIX "/share" ;
+#else
+static const char *static_path= NULL;
+#endif
 
 GHOST_SystemPathsX11::GHOST_SystemPathsX11()
 {
@@ -56,21 +60,12 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
 const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
 {
        /* no prefix assumes a portable build which only uses bundled scripts */
-#ifdef PREFIX
-       return (GHOST_TUns8*) PREFIX "/share";
-#else
-       return NULL;
-#endif
+       return (const GHOST_TUns8 *)static_path;
 }
 
 const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
 {
-       const char* env = getenv("HOME");
-       if(env) {
-               return (GHOST_TUns8*) env;
-       } else {
-               return NULL;
-       }
+       return (const GHOST_TUns8 *)getenv("HOME");
 }
 
 const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
index 69a9f936cf693bea950be2b365b5c3b8cdba8567..cd7efba592b469c74c990ec16ac650f6390af8e7 100644 (file)
@@ -167,6 +167,8 @@ convertSDLKey(SDL_Scancode key)
                GXMAP(type,SDL_SCANCODE_APOSTROPHE,     GHOST_kKeyQuote);
                GXMAP(type,SDL_SCANCODE_GRAVE,          GHOST_kKeyAccentGrave);
                GXMAP(type,SDL_SCANCODE_MINUS,          GHOST_kKeyMinus);
+               GXMAP(type,SDL_SCANCODE_EQUALS,         GHOST_kKeyEqual);
+
                GXMAP(type,SDL_SCANCODE_SLASH,          GHOST_kKeySlash);
                GXMAP(type,SDL_SCANCODE_BACKSLASH,      GHOST_kKeyBackslash);
                GXMAP(type,SDL_SCANCODE_KP_EQUALS,      GHOST_kKeyEqual);
@@ -198,6 +200,7 @@ convertSDLKey(SDL_Scancode key)
                GXMAP(type,SDL_SCANCODE_CAPSLOCK,       GHOST_kKeyCapsLock);
                GXMAP(type,SDL_SCANCODE_SCROLLLOCK,     GHOST_kKeyScrollLock);
                GXMAP(type,SDL_SCANCODE_NUMLOCKCLEAR,   GHOST_kKeyNumLock);
+               GXMAP(type,SDL_SCANCODE_PRINTSCREEN,    GHOST_kKeyPrintScreen);
 
                /* keypad events */
 
index 105f71b514f9ad8b0f20dedaaa765d4263e87f13..d5100e589f2aa08933664c21d173bee751826d07 100644 (file)
 #include "GHOST_EventKey.h"
 #include "GHOST_EventButton.h"
 #include "GHOST_EventWheel.h"
-#include "GHOST_NDOFManagerX11.h"
 #include "GHOST_DisplayManagerX11.h"
+#ifdef WITH_INPUT_NDOF
+#include "GHOST_NDOFManagerX11.h"
+#endif
 
 #include "GHOST_Debug.h"
 
@@ -815,22 +817,6 @@ GHOST_SystemX11::processEvent(XEvent *xe)
        }
 }
 
-#if 0 // obsolete SpaceNav code
-
-       void *
-GHOST_SystemX11::
-prepareNdofInfo(volatile GHOST_TEventNDOFData *currentNdofValues)
-{
-       const vector<GHOST_IWindow*>& v(m_windowManager->getWindows());
-       if (v.size() > 0)
-               sNdofInfo.window = static_cast<GHOST_WindowX11*>(v[0])->getXWindow();
-       sNdofInfo.display = m_display;
-       sNdofInfo.currValues = currentNdofValues;
-       return (void*)&sNdofInfo;
-}
-
-#endif
-
        GHOST_TSuccess 
 GHOST_SystemX11::
 getModifierKeys(
index 45664384efaa4372ccc3ba66a93fd67ab41153ee..bb4e95c051f0422cbf8cd22d1f4da566db140841 100644 (file)
@@ -379,7 +379,7 @@ def path_reference(filepath,
     is_relative = filepath.startswith("//")
     filepath_abs = os.path.normpath(bpy.path.abspath(filepath, base_src))
 
-    if mode in ('ABSOLUTE', 'RELATIVE', 'STRIP'):
+    if mode in {'ABSOLUTE', 'RELATIVE', 'STRIP'}:
         pass
     elif mode == 'MATCH':
         mode = 'RELATIVE' if is_relative else 'ABSOLUTE'
index f94006741387ce0b2eeca43629fbc555b414401c..c965169ff04cdb267a43dd2abff40d21a1aaa410 100644 (file)
@@ -294,7 +294,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
         '''
         Normal single concave loop filling
         '''
-        if type(from_data) in (tuple, list):
+        if type(from_data) in {tuple, list}:
             verts = [Vector(from_data[i]) for ii, i in enumerate(indices)]
         else:
             verts = [from_data.vertices[i].co for ii, i in enumerate(indices)]
@@ -312,7 +312,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
         used twice. This is used by lightwave LWO files a lot
         '''
 
-        if type(from_data) in (tuple, list):
+        if type(from_data) in {tuple, list}:
             verts = [vert_treplet(Vector(from_data[i]), ii)
                      for ii, i in enumerate(indices)]
         else:
index fdf5172a0b3597418369c0a31dcc80a396ed1d0e..42d2bf94fbaa99585208db55ba70ecd78215519c 100644 (file)
@@ -120,7 +120,7 @@ def fromxml(data):
         py_item = (xml_node.tagName, _fromxml_kwargs(xml_node), [])
         #_fromxml_iter(py_item, xml_node.childNodes)
         for xml_node_child in xml_node.childNodes:
-            if xml_node_child.nodeType not in (xml_node_child.TEXT_NODE, xml_node_child.COMMENT_NODE):
+            if xml_node_child.nodeType not in {xml_node_child.TEXT_NODE, xml_node_child.COMMENT_NODE}:
                 py_item[CHILDREN].append(_fromxml(xml_node_child))
         return py_item
 
index 5df04b8bf34784c410cb0ce197bc0b69a2996ffe..f4b6de23dbb2cf93ce9b68fe8137bfc7fa3e2ff4 100644 (file)
@@ -40,13 +40,13 @@ def _parse_rna(prop, value):
     elif prop.type == 'INT':
         value = int(value)
     elif prop.type == 'BOOLEAN':
-        if value in (True, False):
+        if value in {True, False}:
             pass
         else:
-            if value not in ("True", "False"):
+            if value not in {"True", "False"}:
                 raise Exception("invalid bool value: %s" % value)
             value = bool(value == "True")
-    elif prop.type in ('STRING', 'ENUM'):
+    elif prop.type in {'STRING', 'ENUM'}:
         pass
     elif prop.type == 'POINTER':
         value = eval("_bpy." + value)
index 93a344f4b09f97570feed6f58aec66a5e0344742..943f86adecbeea2a001264dd8d075b6df2953b4e 100644 (file)
@@ -148,7 +148,7 @@ class InfoStructRNA:
         import types
         functions = []
         for identifier, attr in self._get_py_visible_attrs():
-            if type(attr) in (types.FunctionType, types.MethodType):
+            if type(attr) in {types.FunctionType, types.MethodType}:
                 functions.append((identifier, attr))
         return functions
 
@@ -156,7 +156,7 @@ class InfoStructRNA:
         import types
         functions = []
         for identifier, attr in self._get_py_visible_attrs():
-            if type(attr) in (types.BuiltinMethodType, types.BuiltinFunctionType):
+            if type(attr) in {types.BuiltinMethodType, types.BuiltinFunctionType}:
                 functions.append((identifier, attr))
         return functions
 
@@ -260,7 +260,7 @@ class InfoPropertyRNA:
             if self.array_length:
                 type_str += " array of %d items" % (self.array_length)
 
-            if self.type in ("float", "int"):
+            if self.type in {"float", "int"}:
                 type_str += " in [%s, %s]" % (range_str(self.min), range_str(self.max))
             elif self.type == "enum":
                 if self.is_enum_flag:
@@ -595,7 +595,7 @@ def BuildRNAInfo():
             for prop in rna_info.properties:
                 # ERROR CHECK
                 default = prop.default
-                if type(default) in (float, int):
+                if type(default) in {float, int}:
                     if default < prop.min or default > prop.max:
                         print("\t %s.%s, %s not in [%s - %s]" % (rna_info.identifier, prop.identifier, default, prop.min, prop.max))
 
index 23bafe2eaae4bf39398c1afbf5f428648f4a8167..aca9b581b97be4a20b31a487be38c571c0705c56 100644 (file)
@@ -61,13 +61,19 @@ class EditExternally(bpy.types.Operator):
     def execute(self, context):
         import os
         import subprocess
-        filepath = os.path.normpath(bpy.path.abspath(self.filepath))
+
+        filepath = self.filepath
+
+        if not filepath:
+            self.report({'ERROR'}, "Image path not set")
+            return {'CANCELLED'}
+
+        filepath = os.path.normpath(bpy.path.abspath(filepath))
 
         if not os.path.exists(filepath):
             self.report({'ERROR'},
                         "Image path %r not found, image may be packed or "
                         "unsaved." % filepath)
-
             return {'CANCELLED'}
 
         cmd = self._editor_guess(context) + [filepath]
index 9ae0cd0ddf961a048659685482f27954cafd7b87..2f1acf0a5dc71d72450d5dd9bbc24ee2ca26f568 100644 (file)
@@ -520,7 +520,7 @@ def unwrap(operator, context, **kwargs):
         if obj and obj.type == 'MESH':
             meshes = [obj.data]
     else:
-        meshes = {me.name: me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if not me.library if len(me.faces)}.values()
+        meshes = list({me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if me.faces and me.library is None})
 
     if not meshes:
         operator.report({'ERROR'}, "No mesh object.")
index af33e45668c19933b84a5e1f0a50cc2172f44314..f9327aa6c4007ca503fe558a8f5cf713283c66de 100644 (file)
@@ -586,7 +586,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
             self._values_clear()
             return {'FINISHED'}
 
-        elif event_type in ('RIGHTMOUSE', 'ESC'):
+        elif event_type in {'RIGHTMOUSE', 'ESC'}:
             self._values_restore()
             return {'FINISHED'}
 
@@ -839,7 +839,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
 
         prop_ui = rna_idprop_ui_prop_get(item, prop)
 
-        if prop_type in (float, int):
+        if prop_type in {float, int}:
 
             prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.min)
             prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.max)
index 4c92296dacdc451a7ea8e1b0e55b089d7a5144f2..2870aab75efa9d8050e6db012e5dc1e673673827 100644 (file)
@@ -462,7 +462,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
             col.prop(part, "mass")
             col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
 
-        if part.physics_type in ('NEWTON', 'FLUID'):
+        if part.physics_type in {'NEWTON', 'FLUID'}:
             split = layout.split()
 
             col = split.column()
@@ -921,7 +921,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
                 col = row.column()
                 col.label(text="")
 
-        if part.render_type in ('OBJECT', 'GROUP') and not part.use_advanced_hair:
+        if part.render_type in {'OBJECT', 'GROUP'} and not part.use_advanced_hair:
             row = layout.row(align=True)
             row.prop(part, "particle_size")
             row.prop(part, "size_random", slider=True)
index 78dbd4c6b433d5e47239f75e650d5668f58df896..ed98c2cf50ebb51cc43447b41e56c1f7fb884c6a 100644 (file)
@@ -18,7 +18,7 @@ class ModalOperator(bpy.types.Operator):
         elif event.type == 'LEFTMOUSE':
             return {'FINISHED'}
 
-        elif event.type in ('RIGHTMOUSE', 'ESC'):
+        elif event.type in {'RIGHTMOUSE', 'ESC'}:
             context.object.location.x = self.first_value
             return {'CANCELLED'}
 
index e7a1f6e4ffeafc573437d3f9de263610bd504f76..b3d525a59bf08596ad17292e6e31901cc82e5c8f 100644 (file)
@@ -45,7 +45,7 @@ class ModalDrawOperator(bpy.types.Operator):
             context.region.callback_remove(self._handle)
             return {'FINISHED'}
 
-        elif event.type in ('RIGHTMOUSE', 'ESC'):
+        elif event.type in {'RIGHTMOUSE', 'ESC'}:
             context.region.callback_remove(self._handle)
             return {'CANCELLED'}
 
index c494f121017e2660c4acd779eccdbaf5aa2c6bbb..925449835ca651d4b5dc76ad1b2205c86f7de755 100644 (file)
@@ -29,7 +29,7 @@ class ViewOperator(bpy.types.Operator):
             context.area.header_text_set()
             return {'FINISHED'}
 
-        elif event.type in ('RIGHTMOUSE', 'ESC'):
+        elif event.type in {'RIGHTMOUSE', 'ESC'}:
             rv3d.view_location = self._initial_location
             context.area.header_text_set()
             return {'CANCELLED'}
index aeacdac5d141eaed557c178af9324bb7a7cc3856..3c5ce0bc3e5f72e1276f803a55acf50e57910263 100644 (file)
@@ -1595,7 +1595,7 @@ void init_userdef_do_versions(void)
                U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
        }
 
-       if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 1)) {
+       if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 2)) {
                bTheme *btheme;
                for(btheme= U.themes.first; btheme; btheme= btheme->next) {
                        btheme->tnode.noodle_curving = 5;
index 283b09f42e4fcd11dfdbab42e32ab28b9b37cde1..e44cc1f5df3faf162461901d2af91cb4a9c2e51b 100644 (file)
@@ -41,7 +41,6 @@ set(SRC
        transform_generics.c
        transform_input.c
        transform_manipulator.c
-       transform_ndofinput.c
        transform_ops.c
        transform_orientations.c
        transform_snap.c
index 7f7bc0e63a71ec3cad7e204d9043bced63495631..190d93b176beb7cbfa6d2799e42515678b601b49 100644 (file)
@@ -1040,11 +1040,6 @@ int transformEvent(TransInfo *t, wmEvent *event)
                        else view_editmove(event->type);
                        t->redraw= 1;
                        break;
-#if 0
-               case NDOF_MOTION:
-                       // should have been caught by tranform_modal
-                       return OPERATOR_PASS_THROUGH;
-#endif
                default:
                        handled = 0;
                        break;
index 4fa15ac85c4c4847e57d4a1b13fb4632e834384a..d95bb0e73aab296194e6c533c33a16402ac8dbe6 100644 (file)
@@ -67,14 +67,6 @@ struct wmTimer;
 struct ARegion;
 struct ReportList;
 
-typedef struct NDofInput {
-       int             flag;
-       int             axis;
-       float   fval[7];
-       float   factor[3];
-} NDofInput;
-
-
 /*
        The ctrl value has different meaning:
                0                       : No value has been typed
@@ -273,7 +265,6 @@ typedef struct TransInfo {
        TransCon    con;            /* transformed constraint               */
        TransSnap       tsnap;
        NumInput    num;            /* numerical input                      */
-       NDofInput   ndof;           /* ndof input                           */
        MouseInput      mouse;                  /* mouse input                          */
        char        redraw;         /* redraw flag                          */
        float           prop_size;              /* proportional circle radius           */
@@ -340,9 +331,6 @@ typedef struct TransInfo {
 
 /* ******************** Macros & Prototypes *********************** */
 
-/* NDOFINPUT FLAGS */
-#define NDOF_INIT                      1
-
 /* transinfo->state */
 #define TRANS_STARTING  0
 #define TRANS_RUNNING  1
@@ -687,20 +675,6 @@ void calculatePropRatio(TransInfo *t);
 
 void getViewVector(TransInfo *t, float coord[3], float vec[3]);
 
-/*********************** NDofInput ********************************/
-
-void initNDofInput(NDofInput *n);
-int hasNDofInput(NDofInput *n);
-void applyNDofInput(NDofInput *n, float *vec);
-int handleNDofInput(NDofInput *n, struct wmEvent *event);
-
-/* handleNDofInput return values */
-#define NDOF_REFRESH   1
-#define NDOF_NOMOVE            2
-#define NDOF_CONFIRM   3
-#define NDOF_CANCEL            4
-
-
 /*********************** Transform Orientations ******************************/
 
 void initTransformOrientation(struct bContext *C, TransInfo *t);
index c22fef8c66063a0e349694a04829e4a3a604b02f..44b8afcb8bbdeb60e865a3a2f133310055beb1e8 100644 (file)
@@ -1210,7 +1210,6 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        
        setTransformViewMatrices(t);
        initNumInput(&t->num);
-       initNDofInput(&t->ndof);
        
        return 1;
 }
diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c
deleted file mode 100644 (file)
index c594616..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/transform/transform_ndofinput.c
- *  \ingroup edtransform
- */
-
- #include <math.h>                     /* fabs */
-#include <stdio.h>                     /* for sprintf          */
-
-#include "BLI_utildefines.h"
-
-#include "BKE_global.h"                /* for G                        */
-       /* ABS */
-
-#include "WM_types.h"
-
-#include "transform.h"
-
-#if 0
-static int updateNDofMotion(NDofInput *n); // return 0 when motion is null
-#endif
-static void resetNDofInput(NDofInput *n);
-
-void initNDofInput(NDofInput *n)
-{
-       int i;
-
-       n->flag = 0;
-       n->axis = 0;
-       
-       resetNDofInput(n);
-       
-       for(i = 0; i < 3; i++)
-       {
-               n->factor[i] = 1.0f;
-       }
-}
-
-static void resetNDofInput(NDofInput *n)
-{      
-       int i;
-       for(i = 0; i < 6; i++)
-       {
-               n->fval[i] = 0.0f;
-       }
-}
-
-int handleNDofInput(NDofInput *UNUSED(n), wmEvent *UNUSED(event))
-{
-       int retval = 0;
-       // TRANSFORM_FIX_ME
-#if 0
-       switch(event)
-       {
-               case NDOFMOTION:
-                       if (updateNDofMotion(n) == 0)
-                       {
-                               retval = NDOF_NOMOVE;
-                       }
-                       else
-                       {
-                               retval = NDOF_REFRESH;
-                       }
-                       break;
-               case NDOFBUTTON:
-                       if (val == 1) 
-                       {
-                               retval = NDOF_CONFIRM;
-                       }
-                       else if (val == 2) 
-                       {
-                               retval = NDOF_CANCEL;
-                               resetNDofInput(n);
-                               n->flag &= ~NDOF_INIT;
-                       }
-                       break;
-       }
-#endif         
-       return retval;
-}
-
-int hasNDofInput(NDofInput *n)
-{
-       return (n->flag & NDOF_INIT) == NDOF_INIT;
-}
-
-void applyNDofInput(NDofInput *n, float *vec)
-{
-       if (hasNDofInput(n))
-       {
-               int i, j;
-               
-               for (i = 0, j = 0; i < 6; i++)
-               {
-                       if (n->axis & (1 << i))
-                       {
-                               vec[j] = n->fval[i] * n->factor[j];
-                               j++;
-                       }
-               }
-       }
-}
-
-// TRANSFORM_FIX_ME
-#if 0
-
-static int updateNDofMotion(NDofInput *n)
-{
-       float fval[7];
-       int i;
-       int retval = 0;
-
-       getndof(fval);
-
-       if (G.vd->ndoffilter)
-               filterNDOFvalues(fval);
-
-       for(i = 0; i < 6; i++)
-       {
-               if (!retval && fval[i] != 0.0f)
-               {
-                       retval = 1;
-               }
-               
-               n->fval[i] += fval[i] / 1024.0f;
-       }
-       
-       n->flag |= NDOF_INIT;
-       
-       return retval;
-}
-#endif
-
-
-
-
index a6c8d1fd82d2016b1be475f1ad278c4a2ba7ed27..7754d9973a33d85c0c6cd4e5621e1f8291526bf2 100644 (file)
@@ -360,17 +360,14 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
 
        TransInfo *t = op->customdata;
 
-       #if 0
+#if 0
        // stable 2D mouse coords map to different 3D coords while the 3D mouse is active
        // in other words, 2D deltas are no longer good enough!
        // disable until individual 'transformers' behave better
 
        if (event->type == NDOF_MOTION)
-       {
-               /* puts("transform_modal: passing through NDOF_MOTION"); */
                return OPERATOR_PASS_THROUGH;
-       }
-       #endif
+#endif
 
        /* XXX insert keys are called here, and require context */
        t->context= C;
index 738802feba370b992437015c60057affdadefbb0..bc8a169cff6de357f615f0ddb0e0dcb15738ceb9 100644 (file)
@@ -2852,7 +2852,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
        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'
+       /* 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);
index 20ac3ba7077bf057b25bd00b78fdf2f32b5915ce..dc83e29b497e2034bbe07b12d87b42a1d32c4156 100644 (file)
@@ -67,6 +67,7 @@ set(SRC
        intern/wm_window.c
 
        WM_api.h
+       WM_keymap.h
        WM_types.h
        wm.h
        wm_cursors.h
index a489845881f918763f89ec861e3f9813f7977c42..830ccfa7d1c7337df676a94f681f10d148bc524d 100644 (file)
@@ -391,8 +391,14 @@ typedef struct wmNDOFMotionData {
        /* awfully similar to GHOST_TEventNDOFMotionData... */
        // Each component normally ranges from -1 to +1, but can exceed that.
        // These use blender standard view coordinates, with positive rotations being CCW about the axis.
-       float tvec[3]; // translation
-       float rvec[3]; // rotation:
+       union {
+               float tvec[3]; // translation
+               struct { float tx, ty, tz; };
+               };
+       union {
+               float rvec[3]; // rotation:
+               struct { float rx, ry, rz; };
+               };
                // axis = (rx,ry,rz).normalized
                // amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
        float dt; // time since previous NDOF Motion event
index 258d6bbc025fe95198069f6769a5d0999021de8a..413ff181f11778c342e3c5acce01ca9aa1174354 100644 (file)
@@ -2329,29 +2329,32 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
 
        const float s = U.ndof_sensitivity;
 
-       data->tvec[0]= s * ghost->tx;
+       data->t= s * ghost->tx;
 
-       data->rvec[0]= s * ghost->rx;
-       data->rvec[1]= s * ghost->ry;
-       data->rvec[2]= s * ghost->rz;
+       data->r= s * ghost->rx;
+       data->r= s * ghost->ry;
+       data->r= s * ghost->rz;
 
        if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
                {
-               // rotate so Y is where Z was (maintain handed-ness)
-               data->tvec[1]= s * ghost->tz;
-               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;
+               /* rotate so Y is where Z was */
+               data->ty = s * ghost->tz;
+               data->tz = s * ghost->ty;
+               /* maintain handed-ness? or just do what feels right? */
+
+               /* 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->ry = s * ghost->rz;
+               data->rz = s * ghost->ry;
 #endif
                }
        else
                {
-               data->tvec[1]= s * ghost->ty;
-               data->tvec[2]= s * ghost->tz;
+               data->t= s * ghost->ty;
+               data->t= s * ghost->tz;
                }
 
        data->dt = ghost->dt;
index 8fd0d6e7099221ed4320b6abfe5f9f1a1500ecde..3f802642d33381ca853237e03c7ceb3eea438daa 100644 (file)
@@ -111,7 +111,7 @@ add_test(export_obj_all_objects ${TEST_BLENDER_EXE}
        --run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
        --md5_source=${TEST_OUT_DIR}/export_obj_all_objects.obj
        --md5_source=${TEST_OUT_DIR}/export_obj_all_objects.mtl
-       --md5=01c123948efadc6a71ab2c09a5925756 --md5_method=FILE
+       --md5=04b3ed97cede07a19548fc518ce9f8ca --md5_method=FILE
 )
 
 
@@ -196,7 +196,7 @@ add_test(export_x3d_cube ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\)
        --md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d
-       --md5=5e804c689896116331fa190a9fabbad4 --md5_method=FILE
+       --md5=2621d8cc2cc1d34f6711c54519907dac --md5_method=FILE
 )
 
 add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
@@ -204,7 +204,7 @@ add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\)
        --md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d
-       --md5=2d5bcf43cf7b6fbbef1c8cc566968fe5 --md5_method=FILE
+       --md5=d56b3736bab063d101d42079bd276f01 --md5_method=FILE
 )
 
 add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
@@ -212,7 +212,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
        --md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
-       --md5=2809ec13a4cab55d265ce7525c5db1b7 --md5_method=FILE
+       --md5=0914c9a7fcdbfc5741c1269497e9068b --md5_method=FILE
 )
 
 
@@ -273,7 +273,7 @@ add_test(export_fbx_cube ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_cube.fbx',use_selection=False,use_metadata=False\)
        --md5_source=${TEST_OUT_DIR}/export_fbx_cube.fbx
-       --md5=83dca99a0cb338852b8c85951a44c68a --md5_method=FILE
+       --md5=86da2495dffd7c270e682f599be6b3d1 --md5_method=FILE
 )
 
 add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
@@ -281,7 +281,7 @@ add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_nurbs.fbx',use_selection=False,use_metadata=False\)
        --md5_source=${TEST_OUT_DIR}/export_fbx_nurbs.fbx
-       --md5=c7d9491ffa6264e820ed1e12df63f871 --md5_method=FILE
+       --md5=88a263ddb5181e6522dc214debb92ced --md5_method=FILE
 )
 
 add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
@@ -289,5 +289,5 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
        --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
        --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_all_objects.fbx',use_selection=False,use_metadata=False\)
        --md5_source=${TEST_OUT_DIR}/export_fbx_all_objects.fbx
-       --md5=22867f82e1615fd1eae18cfaac8ba035 --md5_method=FILE
+       --md5=e6f75fe7de9aa366896456e13eafc76a --md5_method=FILE
 )
index 668b4e692284242f0681f30ef5d8de21606b0b12..b64055df252b9b6cb1e3cceb99b0e290f348c38c 100644 (file)
@@ -70,7 +70,7 @@ def run_ops(operators, setup_func=None):
 
             setup_func()
 
-            for mode in ('EXEC_DEFAULT', 'INVOKE_DEFAULT'):
+            for mode in {'EXEC_DEFAULT', 'INVOKE_DEFAULT'}:
                 try:
                     op(mode)
                 except: