Merging r38951 through r38987 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Aug 2011 14:02:08 +0000 (14:02 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Aug 2011 14:02:08 +0000 (14:02 +0000)
35 files changed:
CMakeLists.txt
SConstruct
build_files/buildbot/config/user-config-i686.py
build_files/buildbot/config/user-config-player-i686.py
build_files/buildbot/config/user-config-player-x86_64.py
build_files/buildbot/config/user-config-x86_64.py
build_files/buildbot/master.cfg
build_files/buildbot/slave_compile.py
build_files/buildbot/slave_pack.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/btools.py
doc/python_api/blender-org/static/default.css_t
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_NDOFManager.cpp
intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
intern/ghost/intern/GHOST_NDOFManagerWin32.cpp
intern/ghost/intern/GHOST_NDOFManagerX11.cpp
intern/ghost/intern/GHOST_NDOFManagerX11.h
intern/ghost/intern/GHOST_SystemWin32.cpp
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/startup/bl_ui/properties_material.py
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/ED_transform.h
source/blender/editors/screen/glutil.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_scene.c
source/blender/render/intern/source/rendercore.c
source/blender/windowmanager/intern/wm_event_system.c

index 2ef487022e83e8ce2be472c0a6d09f550bf14600..89ee95df4575af265d0c9e79914c77f3c09d7d15 100644 (file)
@@ -182,7 +182,7 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 
 # Misc
-option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
+option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" OFF)
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
 if(UNIX AND NOT APPLE)
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
index e27f8eae3672ed39c71e16de5a648ba33cb454e9..529f6daeef1415bb37428f098e7ff5c5a741d28f 100644 (file)
@@ -111,6 +111,11 @@ btools.print_targets(B.targets, B.bc)
 
 # handling cmd line arguments & config file
 
+# bitness stuff
+tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python
+if tempbitness in (32, 64): # only set if 32 or 64 has been given
+    bitness = int(tempbitness)
+
 # first check cmdline for toolset and we create env to work on
 quickie = B.arguments.get('BF_QUICK', None)
 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
@@ -659,11 +664,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
 
     if env['WITH_BF_FFMPEG']:
-        dllsources += ['${BF_FFMPEG_LIBPATH}/avcodec-52.dll',
-                    '${BF_FFMPEG_LIBPATH}/avformat-52.dll',
-                    '${BF_FFMPEG_LIBPATH}/avdevice-52.dll',
-                    '${BF_FFMPEG_LIBPATH}/avutil-50.dll',
-                    '${BF_FFMPEG_LIBPATH}/swscale-0.dll']
+        dllsources += env['BF_FFMPEG_DLL'].split()
 
     # Since the thumb handler is loaded by Explorer, architecture is
     # strict: the x86 build fails on x64 Windows. We need to ship
index 07dc4a9d83163bb852f02948d0ac8452f9b056a4..e09fecede5909868068f3112edc28f76230a72f4 100644 (file)
@@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
 BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib32'
 BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
     '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
index ab31c6ce8a760b8cde92a35d70441de90bd8b30c..279f2d668046ce6d4a4353a7b3b5c311a779d053 100644 (file)
@@ -13,7 +13,18 @@ WITH_BF_STATICPYTHON = True
 WITH_BF_COLLADA = False
 
 # FFMPEG configuration
-WITH_BF_FFMPEG = False
+WITH_BF_FFMPEG = True
+WITH_BF_STATICFFMPEG = True
+
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib32'
+BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libfaad.a'
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
index 601b2c3ca1a2c9b80e2fb0ce8166c3003064ffd1..d19143385100fbd1e728f9800496d3be3d813807 100644 (file)
@@ -13,7 +13,18 @@ WITH_BF_STATICPYTHON = True
 WITH_BF_COLLADA = False
 
 # FFMPEG configuration
-WITH_BF_FFMPEG = False
+WITH_BF_FFMPEG = True
+WITH_BF_STATICFFMPEG = True
+
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib64'
+BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
+    '${BF_FFMPEG_LIBPATH}/libfaad.a'
 
 # Don't depend on system's libstdc++
 WITH_BF_STATICCXX = True
index 9c569ff44581c806d9873aeb4f97ce23315308b3..bdba8892bf80ddc20c2ac0781399ced0f85f4350 100644 (file)
@@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
 BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib64'
 BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
     '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
index fd712f1b832c8c58c70ecc41f76e6bfb651d11c8..1e70ec5e13e9afd5922d3c739a4192ab1531767d 100644 (file)
@@ -116,6 +116,7 @@ add_builder(c, 'linux_x86_64_scons', '', generic_builder)
 add_builder(c, 'salad_linux_x86_64_scons', '', generic_builder, 'soc-2011-salad')
 add_builder(c, 'win32_scons', 'windows', generic_builder)
 add_builder(c, 'salad_win32_scons', 'windows', generic_builder, 'soc-2011-salad')
+add_builder(c, 'win64_scons', 'windows', generic_builder)
 #add_builder(c, 'freebsd_i386_cmake', '', generic_builder)
 #add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
 
index e74d889c243f6aeef4183001a1765fdcafec1f21..9dd39ccd3088b27d8e10fe18477072d5d55cf493 100644 (file)
@@ -108,5 +108,33 @@ else:
 
         sys.exit(0)
     else:
+        bitness = '32'
+        # Switch to new FFmpeg library
+        if builder.find('win') != -1:
+            if builder.find('win32') != -1:
+                LCGDIR = '#../lib/windows'
+            elif builder.find('win64') != -1:
+                LCGDIR = '#../lib/win64'
+                bitness = '64'
+
+            all_ffmpeg_libs = ['avcodec-53',
+                               'avdevice-53',
+                               'avformat-53',
+                               'avutil-51',
+                               'swscale-2']
+
+            ffmpeg_lib = []
+            ffmpeg_dll = []
+
+            for lib in all_ffmpeg_libs:
+                ffmpeg_lib.append(lib + '.lib')
+                ffmpeg_dll.append('${BF_FFMPEG_LIBPATH}/' + lib + '.dll')
+
+            scons_options.append('BF_FFMPEG=' + LCGDIR + '/ffmpeg-0.8')
+            scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
+            scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
+
+            scons_options.append('BF_BITNESS='+bitness)
+
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
         sys.exit(retcode)
index 4c19b723fc8635061ab12d6bf0c71bb2cedecab4..e779b10bd2a8272f2f76b7dacfedd31f24438ed8 100644 (file)
@@ -72,6 +72,34 @@ if builder.find('scons') != -1:
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
         sys.exit(retcode)
     else:
+        bitness = '32'
+        # Switch to new FFmpeg library
+        if builder.find('win') != -1:
+            if builder.find('win32') != -1:
+                LCGDIR = '#../lib/windows'
+            elif builder.find('win64') != -1:
+                LCGDIR = '#../lib/win64'
+                bitness = '64'
+
+            all_ffmpeg_libs = ['avcodec-53',
+                               'avdevice-53',
+                               'avformat-53',
+                               'avutil-51',
+                               'swscale-2']
+
+            ffmpeg_lib = []
+            ffmpeg_dll = []
+
+            for lib in all_ffmpeg_libs:
+                ffmpeg_lib.append(lib + '.lib')
+                ffmpeg_dll.append('${BF_FFMPEG_LIBPATH}/' + lib + '.dll')
+
+            scons_options.append('BF_FFMPEG=' + LCGDIR + '/ffmpeg-0.8')
+            scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
+            scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
+
+            scons_options.append('BF_BITNESS='+bitness)
+
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
         sys.exit(retcode)
 
index 5a91852052ddb74f2e7bece77d5612789ffc94d2..4baada7f9bf9814c23366a2b4255c9af8ef87596 100644 (file)
@@ -7,6 +7,7 @@ BF_FFMPEG = LIBDIR +'/ffmpeg'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-52.dll ${BF_FFMPEG_LIBPATH}/avcodec-52.dll ${BF_FFMPEG_LIBPATH}/avdevice-52.dll ${BF_FFMPEG_LIBPATH}/avutil-50.dll ${BF_FFMPEG_LIBPATH}/swscale-0.dll'
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '3.2'
index 6717f12fcf8e2ab78875090789100b5643e442b2..db7c8d09af829b62dcf7be8770999608c33fea95 100644 (file)
@@ -7,6 +7,7 @@ BF_FFMPEG = LIBDIR +'/ffmpeg'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc '
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-52.dll ${BF_FFMPEG_LIBPATH}/avcodec-52.dll ${BF_FFMPEG_LIBPATH}/avdevice-52.dll ${BF_FFMPEG_LIBPATH}/avutil-50.dll ${BF_FFMPEG_LIBPATH}/swscale-0.dll'
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '3.2'
index 3894eee0236ec679f28149b664cd7e8561f4b1b1..5508b8d35cd9754c958af29655d428bdb52deb95 100644 (file)
@@ -87,7 +87,7 @@ def validate_arguments(args, bc):
             'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
             'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
             'WITH_BF_DDS', 'WITH_BF_CINEON', 'WITH_BF_HDR',
-            'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG',  'BF_FFMPEG_INC',
+            'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG',  'BF_FFMPEG_INC', 'BF_FFMPEG_DLL',
             'WITH_BF_STATICFFMPEG', 'BF_FFMPEG_LIB_STATIC',
             'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
             'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
@@ -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'
+            'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', '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
@@ -159,7 +159,7 @@ def validate_arguments(args, bc):
             'BF_BSC', 'BF_CONFIG',
             'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG',
             'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG',
-            'BF_UNIT_TEST']
+            'BF_UNIT_TEST', 'BF_BITNESS']
 
     okdict = {}
 
@@ -291,6 +291,7 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
         ('BF_FFMPEG', 'FFMPEG base path', ''),
         ('BF_FFMPEG_LIB', 'FFMPEG library', ''),
+        ('BF_FFMPEG_DLL', 'FFMPEG dll libraries to be installed', ''),
         ('BF_FFMPEG_EXTRA', 'FFMPEG flags that must be preserved', ''),
 
         ('BF_FFMPEG_INC', 'FFMPEG includes', ''),
index 6f3f25d8a6a90f8c1f113583b0900e87f94369af..e6fe922e3af28ac99a2dd5d5f3bb1574a0960a45 100644 (file)
@@ -219,7 +219,7 @@ div.sphinxsidebarwrapper.fixed {
 }
 
 {%- if theme_stickysidebar|tobool %}
-/* this is nice, but it it leads to hidden headings when jumping
+/* this is nice, but it leads to hidden headings when jumping
    to an anchor */
 /*
 div.related {
index 2180ddbe5673b59ea93c4eb3a1f148cdd5bd4867..d7658c50a366428ee136946e4637d7ab58c32eaa 100644 (file)
@@ -44,7 +44,6 @@ set(SRC
        intern/GHOST_ISystem.cpp
        intern/GHOST_ISystemPaths.cpp
        intern/GHOST_ModifierKeys.cpp
-       intern/GHOST_NDOFManager.cpp
        intern/GHOST_Path-api.cpp
        intern/GHOST_Path-api.cpp
        intern/GHOST_Rect.cpp
@@ -74,12 +73,10 @@ set(SRC
        intern/GHOST_EventDragnDrop.h
        intern/GHOST_EventKey.h
        intern/GHOST_EventManager.h
-       intern/GHOST_EventNDOF.h
        intern/GHOST_EventString.h
        intern/GHOST_EventTrackpad.h
        intern/GHOST_EventWheel.h
        intern/GHOST_ModifierKeys.h
-       intern/GHOST_NDOFManager.h
        intern/GHOST_System.h
        intern/GHOST_SystemPaths.h
        intern/GHOST_TimerManager.h
@@ -99,6 +96,14 @@ endif()
 
 if(WITH_INPUT_NDOF)
        add_definitions(-DWITH_INPUT_NDOF)
+
+       list(APPEND SRC
+               intern/GHOST_NDOFManager.cpp
+
+               intern/GHOST_EventNDOF.h
+               intern/GHOST_NDOFManager.h
+       )
+
        list(APPEND INC_SYS
                ${NDOF_INCLUDE_DIRS}
        )
index 5a0f14c85a367e868dfcb1e3a13b454d09cf0558..855e27b99644411f61456f8a49f7e8fabf84d5c9 100644 (file)
@@ -79,17 +79,15 @@ static const char* ndof_button_names[] = {
        "NDOF_BUTTON_8",
        "NDOF_BUTTON_9",
        "NDOF_BUTTON_10",
-       };
+};
 #endif
 
-static const NDOF_ButtonT SpaceNavigator_HID_map[] =
-       {
+static const NDOF_ButtonT SpaceNavigator_HID_map[] = {
        NDOF_BUTTON_MENU,
        NDOF_BUTTON_FIT
-       };
+};
 
-static const NDOF_ButtonT SpaceExplorer_HID_map[] =
-       {
+static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
        NDOF_BUTTON_1,
        NDOF_BUTTON_2,
        NDOF_BUTTON_TOP,
@@ -105,10 +103,9 @@ static const NDOF_ButtonT SpaceExplorer_HID_map[] =
        NDOF_BUTTON_PLUS,
        NDOF_BUTTON_MINUS,
        NDOF_BUTTON_ROTATE
-       };
+};
 
-static const NDOF_ButtonT SpacePilotPro_HID_map[] =
-       {
+static const NDOF_ButtonT SpacePilotPro_HID_map[] = {
        NDOF_BUTTON_MENU,
        NDOF_BUTTON_FIT,
        NDOF_BUTTON_TOP,
@@ -140,12 +137,11 @@ static const NDOF_ButtonT SpacePilotPro_HID_map[] =
        NDOF_BUTTON_DOMINANT,
        NDOF_BUTTON_PLUS,
        NDOF_BUTTON_MINUS
-       };
+};
 
-static const NDOF_ButtonT SpacePilot_HID_map[] =
-// this is the older SpacePilot (sans Pro)
-// thanks to polosson for the info in this table
-       {
+/* this is the older SpacePilot (sans Pro)
+ * thanks to polosson for the info in this table */
+static const NDOF_ButtonT SpacePilot_HID_map[] = {
        NDOF_BUTTON_1,
        NDOF_BUTTON_2,
        NDOF_BUTTON_3,
@@ -167,7 +163,7 @@ static const NDOF_ButtonT SpacePilot_HID_map[] =
        NDOF_BUTTON_DOMINANT,
        NDOF_BUTTON_ROTATE,
        NDOF_BUTTON_NONE // the CONFIG button -- what does it do?
-       };
+};
 
 GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
        : m_system(sys)
@@ -180,29 +176,21 @@ GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
        , m_motionState(GHOST_kNotStarted)
        , m_motionEventPending(false)
        , m_deadZone(0.f)
-       {
+{
        // to avoid the rare situation where one triple is updated and
        // the other is not, initialize them both here:
        memset(m_translation, 0, sizeof(m_translation));
        memset(m_rotation, 0, sizeof(m_rotation));
-
-       #ifdef WITH_INPUT_NDOF
-       GHOST_PRINT("WITH_INPUT_NDOF is defined!");
-       #else
-       GHOST_PRINT("WITH_INPUT_NDOF is not defined.");
-       #endif
-       }
+}
 
 bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short product_id)
-       {
+{
        // default to NDOF_UnknownDevice so rogue button events will get discarded
        // "mystery device" owners can help build a HID_map for their hardware
 
-       switch (vendor_id)
-               {
+       switch (vendor_id) {
                case 0x046D: // Logitech (3Dconnexion)
-                       switch (product_id)
-                               {
+                       switch (product_id) {
                                // -- current devices --
                                case 0xC626:
                                        puts("ndof: using SpaceNavigator");
@@ -239,182 +227,183 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
 
                                default:
                                        printf("ndof: unknown Logitech product %04hx\n", product_id);
-                               }
+                       }
                        break;
                default:
                        printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
-               }
+       }
 
-       if (m_deviceType == NDOF_UnknownDevice)
+       if (m_deviceType == NDOF_UnknownDevice) {
                return false;
-       else
-               {
+       }
+       else {
                m_buttonMask = ~(-1 << m_buttonCount);
 
-               #ifdef DEBUG_NDOF_BUTTONS
+#ifdef DEBUG_NDOF_BUTTONS
                printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
-               #endif
+#endif
 
                return true;
-               }
        }
+}
 
 void GHOST_NDOFManager::updateTranslation(short t[3], GHOST_TUns64 time)
-       {
+{
        memcpy(m_translation, t, sizeof(m_translation));
        m_motionTime = time;
        m_motionEventPending = true;
-       }
+}
 
 void GHOST_NDOFManager::updateRotation(short r[3], GHOST_TUns64 time)
-       {
+{
        memcpy(m_rotation, r, sizeof(m_rotation));
        m_motionTime = time;
        m_motionEventPending = true;
-       }
+}
 
 void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
-       {
+{
        GHOST_EventNDOFButton* event = new GHOST_EventNDOFButton(time, window);
        GHOST_TEventNDOFButtonData* data = (GHOST_TEventNDOFButtonData*) event->getData();
 
        data->action = press ? GHOST_kPress : GHOST_kRelease;
        data->button = button;
 
-       #ifdef DEBUG_NDOF_BUTTONS
+#ifdef DEBUG_NDOF_BUTTONS
        printf("%s %s\n", ndof_button_names[button], press ? "pressed" : "released");
-       #endif
+#endif
 
        m_system.pushEvent(event);
-       }
+}
 
 void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
-       {
+{
        GHOST_TEventType type = press ? GHOST_kEventKeyDown : GHOST_kEventKeyUp;
        GHOST_EventKey* event = new GHOST_EventKey(time, type, window, key);
 
-       #ifdef DEBUG_NDOF_BUTTONS
+#ifdef DEBUG_NDOF_BUTTONS
        printf("keyboard %s\n", press ? "down" : "up");
-       #endif
+#endif
 
        m_system.pushEvent(event);
-       }
+}
 
 void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64 time)
-       {
+{
        GHOST_IWindow* window = m_system.getWindowManager()->getActiveWindow();
 
-       #ifdef DEBUG_NDOF_BUTTONS
+#ifdef DEBUG_NDOF_BUTTONS
        if (m_deviceType != NDOF_UnknownDevice)
                printf("ndof: button %d -> ", button_number);
-       #endif
+#endif
 
-       switch (m_deviceType)
-               {
+       switch (m_deviceType) {
                case NDOF_SpaceNavigator:
                        sendButtonEvent(SpaceNavigator_HID_map[button_number], press, time, window);
                        break;
                case NDOF_SpaceExplorer:
-                       switch (button_number)
-                               {
+                       switch (button_number) {
                                case 6: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
                                case 7: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
                                case 8: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
                                case 9: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
                                default: sendButtonEvent(SpaceExplorer_HID_map[button_number], press, time, window);
-                               }
+                       }
                        break;
                case NDOF_SpacePilotPro:
-                       switch (button_number)
-                               {
+                       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(SpacePilotPro_HID_map[button_number], press, time, window);
-                               }
+                       }
                        break;
                case NDOF_SpacePilot:
-                       switch (button_number)
-                               {
+                       switch (button_number) {
                                case 10: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
                                case 11: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
                                case 12: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
                                case 13: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
                                case 20: puts("ndof: ignoring CONFIG button"); break;
                                default: sendButtonEvent(SpacePilot_HID_map[button_number], press, time, window);
-                               }
+                       }
                        break;
                case NDOF_UnknownDevice:
                        printf("ndof: button %d on unknown device (ignoring)\n", button_number);
-               }
+       }
 
        int mask = 1 << button_number;
-       if (press)
+       if (press) {
                m_buttons |= mask; // set this button's bit
-       else
+       }
+       else {
                m_buttons &= ~mask; // clear this button's bit
        }
+}
 
 void GHOST_NDOFManager::updateButtons(int button_bits, GHOST_TUns64 time)
-       {
+{
        button_bits &= m_buttonMask; // discard any "garbage" bits
 
        int diff = m_buttons ^ button_bits;
 
-       for (int button_number = 0; button_number < m_buttonCount; ++button_number)
-               {
+       for (int button_number = 0; button_number < m_buttonCount; ++button_number) {
                int mask = 1 << button_number;
 
-               if (diff & mask)
-                       {
+               if (diff & mask) {
                        bool press = button_bits & mask;
                        updateButton(button_number, press, time);
-                       }
                }
        }
+}
 
 void GHOST_NDOFManager::setDeadZone(float dz)
-       {
-       if (dz < 0.f)
+{
+       if (dz < 0.f) {
                // negative values don't make sense, so clamp at zero
                dz = 0.f;
-       else if (dz > 0.5f)
+       }
+       else if (dz > 0.5f) {
                // warn the rogue user/programmer, but allow it
                printf("ndof: dead zone of %.2f is rather high...\n", dz);
-
+       }
        m_deadZone = dz;
 
        printf("ndof: dead zone set to %.2f\n", dz);
-       }
+}
 
 static bool atHomePosition(GHOST_TEventNDOFMotionData* ndof)
-       {
-       #define HOME(foo) (ndof->foo == 0)
+{
+#define HOME(foo) (ndof->foo == 0)
        return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
-       }
+#undef HOME
+}
 
 static bool nearHomePosition(GHOST_TEventNDOFMotionData* ndof, float threshold)
-       {
-       if (threshold == 0.f)
+{
+       if (threshold == 0.f) {
                return atHomePosition(ndof);
-       else
-               {
-               #define HOME1(foo) (fabsf(ndof->foo) < threshold)
+       }
+       else {
+#define HOME1(foo) (fabsf(ndof->foo) < threshold)
                return HOME1(tx) && HOME1(ty) && HOME1(tz) && HOME1(rx) && HOME1(ry) && HOME1(rz);
-               }
+#undef HOME1
        }
+}
 
 bool GHOST_NDOFManager::sendMotionEvent()
-       {
+{
        if (!m_motionEventPending)
                return false;
 
        m_motionEventPending = false; // any pending motion is handled right now
 
        GHOST_IWindow* window = m_system.getWindowManager()->getActiveWindow();
-       if (window == NULL)
+
+       if (window == NULL) {
                return false; // delivery will fail, so don't bother sending
+       }
 
        GHOST_EventNDOFMotion* event = new GHOST_EventNDOFMotion(m_motionTime, window);
        GHOST_TEventNDOFMotionData* data = (GHOST_TEventNDOFMotionData*) event->getData();
@@ -438,51 +427,48 @@ bool GHOST_NDOFManager::sendMotionEvent()
 
        // determine what kind of motion event to send (Starting, InProgress, Finishing)
        // and where that leaves this NDOF manager (NotStarted, InProgress, Finished)
-       switch (m_motionState)
-               {
+       switch (m_motionState) {
                case GHOST_kNotStarted:
                case GHOST_kFinished:
-                       if (handMotion)
-                               {
+                       if (handMotion) {
                                data->progress = GHOST_kStarting;
                                m_motionState = GHOST_kInProgress;
                                // prev motion time will be ancient, so just make up something reasonable
                                data->dt = 0.0125f;
-                               }
-                       else
-                               {
+                       }
+                       else {
                                // send no event and keep current state
                                delete event;
                                return false;
-                               }
+                       }
                        break;
                case GHOST_kInProgress:
-                       if (handMotion)
-                               {
+                       if (handMotion) {
                                data->progress = GHOST_kInProgress;
                                // keep InProgress state
-                               }
-                       else
-                               {
+                       }
+                       else {
                                data->progress = GHOST_kFinishing;
                                m_motionState = GHOST_kFinished;
-                               }
+                       }
                        break;
-               }
+               default:
+                       break;
+       }
 
-       #ifdef DEBUG_NDOF_MOTION
+#ifdef DEBUG_NDOF_MOTION
        printf("ndof motion sent -- %s\n", progress_string[data->progress]);
 
        // show details about this motion event
        printf("    T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f\n",
-               data->tx, data->ty, data->tz,
-               data->rx, data->ry, data->rz,
-               data->dt);
-       #endif
+              data->tx, data->ty, data->tz,
+              data->rx, data->ry, data->rz,
+              data->dt);
+#endif
 
        m_system.pushEvent(event);
 
        m_prevMotionTime = m_motionTime;
 
        return true;
-       }
+}
index 07811c563ec83524a1464cc766e2b990d48b35a4..53a991a7396f78ede325f01cbf93bfbdbf59d9ec 100644 (file)
@@ -40,7 +40,7 @@ static GHOST_NDOFManager* ndof_manager = NULL;
 static bool has_old_driver = true;
 
 static void NDOF_DeviceAdded(io_connect_t connection)
-       {
+{
        printf("ndof: device added\n"); // change these: printf --> informational reports
 
 #if 0 // device preferences will be useful some day
@@ -55,27 +55,27 @@ static void NDOF_DeviceAdded(io_connect_t connection)
        unsigned short productID = result & 0xffff;
 
        ndof_manager->setDevice(vendorID, productID);
-       }
+}
 
 static void NDOF_DeviceRemoved(io_connect_t connection)
-       {
+{
        printf("ndof: device removed\n");
-       }
+}
 
 static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, void* messageArgument)
-       {
+{
        switch (messageType)
-               {
+       {
                case kConnexionMsgDeviceState:
-                       {
+               {
                        ConnexionDeviceState* s = (ConnexionDeviceState*)messageArgument;
 
                        GHOST_TUns64 now = ghost_system->getMilliSeconds();
 
                        switch (s->command)
-                               {
+                       {
                                case kConnexionCmdHandleAxis:
-                                       {
+                               {
                                        // convert to blender view coordinates
                                        short t[3] = {s->axis[0], -(s->axis[2]), s->axis[1]};
                                        short r[3] = {-(s->axis[3]), s->axis[5], -(s->axis[4])};
@@ -85,23 +85,23 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
 
                                        ghost_system->notifyExternalEventProcessed();
                                        break;
-                                       }
+                               }
                                case kConnexionCmdHandleButtons:
-                                       {
+                               {
                                        int button_bits = has_old_driver ? s->buttons8 : s->buttons;
                                        ndof_manager->updateButtons(button_bits, now);
                                        ghost_system->notifyExternalEventProcessed();
                                        break;
-                                       }
+                               }
                                case kConnexionCmdAppSpecific:
                                        printf("ndof: app-specific command, param = %hd, value = %d\n", s->param, s->value);
                                        break;
 
                                default:
                                        printf("ndof: mystery device command %d\n", s->command);
-                               }
-                       break;
                        }
+                       break;
+               }
                case kConnexionMsgPrefsChanged:
                        // printf("ndof: prefs changed\n"); // this includes app switches
                        // TODO: look through updated prefs for things blender cares about
@@ -117,58 +117,56 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
                        break;
                default:
                        printf("ndof: mystery event %d\n", messageType);
-               }
        }
+}
 
 GHOST_NDOFManagerCocoa::GHOST_NDOFManagerCocoa(GHOST_System& sys)
-       : GHOST_NDOFManager(sys)
-       {
+    : GHOST_NDOFManager(sys)
+{
        if (available())
-               {
+       {
                // give static functions something to talk to:
                ghost_system = dynamic_cast<GHOST_SystemCocoa*>(&sys);
                ndof_manager = this;
 
                OSErr error = InstallConnexionHandlers(NDOF_DeviceEvent, NDOF_DeviceAdded, NDOF_DeviceRemoved);
-               if (error)
-                       {
+               if (error) {
                        printf("ndof: error %d while installing handlers\n", error);
                        return;
-                       }
+               }
 
                // Pascal string *and* a four-letter constant. How old-skool.
                m_clientID = RegisterConnexionClient('blnd', (UInt8*) "\007blender",
-                       kConnexionClientModeTakeOver, kConnexionMaskAll);
+                                                    kConnexionClientModeTakeOver, kConnexionMaskAll);
 
                // printf("ndof: client id = %d\n", m_clientID);
 
-               if (SetConnexionClientButtonMask != NULL)
-                       {
+               if (SetConnexionClientButtonMask != NULL) {
                        has_old_driver = false;
                        SetConnexionClientButtonMask(m_clientID, kConnexionMaskAllButtons);
-                       }
-               else
+               }
+               else {
                        printf("ndof: old 3Dx driver installed, some buttons may not work\n");
                }
-       else
-               {
+       }
+       else {
                printf("ndof: 3Dx driver not found\n");
                // This isn't a hard error, just means the user doesn't have a 3D mouse.
-               }
        }
+}
 
 GHOST_NDOFManagerCocoa::~GHOST_NDOFManagerCocoa()
-       {
+{
        UnregisterConnexionClient(m_clientID);
        CleanupConnexionHandlers();
        ghost_system = NULL;
        ndof_manager = NULL;
-       }
+}
 
 bool GHOST_NDOFManagerCocoa::available()
-       {
+{
        // extern OSErr InstallConnexionHandlers() __attribute__((weak_import));
        // ^^ not needed since the entire framework is weak-linked
        return InstallConnexionHandlers != NULL;
        // this means that the driver is installed and dynamically linked to blender
-       }
+}
index 099b163edebc837bdefa8972b1ab02324ab778a2..57d84ec14d47395bf38eae47a4082dc36453861f 100644 (file)
 
 
 GHOST_NDOFManagerWin32::GHOST_NDOFManagerWin32(GHOST_System& sys)
-       : GHOST_NDOFManager(sys)
-       {}
+    : GHOST_NDOFManager(sys)
+{
+       setDeadZone(0.1f);
+}
 
 // whether multi-axis functionality is available (via the OS or driver)
 // does not imply that a device is plugged in or being used
 bool GHOST_NDOFManagerWin32::available()
-       {
+{
        // always available since RawInput is built into Windows
        return true;
-       }
+}
index 8043af2760e7d972ee493793a96dfeb69514c19e..099fa15d179ee0335879bbfb278de277f19014c3 100644 (file)
 
 
 GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
-       : GHOST_NDOFManager(sys)
-       , m_available(false)
-       {
+    :
+      GHOST_NDOFManager(sys),
+      m_available(false)
+{
        setDeadZone(0.1f); // how to calibrate on Linux? throw away slight motion!
 
-       if (spnav_open() != -1)
-               {
+       if (spnav_open() != -1) {
                // determine exactly which device (if any) is plugged in
 
-               #define MAX_LINE_LENGTH 100
+#define MAX_LINE_LENGTH 100
 
                // look for USB devices with Logitech's vendor ID
                FILE* command_output = popen("lsusb -d 046d:","r");
-               if (command_output)
-                       {
+               if (command_output) {
                        char line[MAX_LINE_LENGTH] = {0};
-                       while (fgets(line, MAX_LINE_LENGTH, command_output))
-                               {
+                       while (fgets(line, MAX_LINE_LENGTH, command_output)) {
                                unsigned short vendor_id = 0, product_id = 0;
                                if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2)
-                                       if (setDevice(vendor_id, product_id))
-                                               {
+                                       if (setDevice(vendor_id, product_id)) {
                                                m_available = true;
                                                break; // stop looking once the first 3D mouse is found
-                                               }
-                               }
-                       pclose(command_output);
+                                       }
                        }
+                       pclose(command_output);
                }
-       else
-               {
+       }
+       else {
                printf("ndof: spacenavd not found\n");
                // This isn't a hard error, just means the user doesn't have a 3D mouse.
-               }
        }
+}
 
 GHOST_NDOFManagerX11::~GHOST_NDOFManagerX11()
-       {
+{
        if (m_available)
                spnav_close();
-       }
+}
 
 bool GHOST_NDOFManagerX11::available()
-       {
+{
        return m_available;
-       }
+}
 
 //bool GHOST_NDOFManagerX11::identifyDevice()
-//     {
+//{
 //     
-//     }
+//}
 
 bool GHOST_NDOFManagerX11::processEvents()
-       {
+{
        GHOST_TUns64 now = m_system.getMilliSeconds();
 
        bool anyProcessed = false;
        spnav_event e;
-       while (spnav_poll_event(&e))
-               {
-               switch (e.type)
-                       {
+       while (spnav_poll_event(&e)) {
+               switch (e.type) {
                        case SPNAV_EVENT_MOTION:
-                               {
+                       {
                                // 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};
@@ -101,12 +95,12 @@ bool GHOST_NDOFManagerX11::processEvents()
                                updateTranslation(t, now);
                                updateRotation(r, now);
                                break;
-                               }
+                       }
                        case SPNAV_EVENT_BUTTON:
                                updateButton(e.button.bnum, e.button.press, now);
                                break;
-                       }
-               anyProcessed = true;
                }
-       return anyProcessed;
+               anyProcessed = true;
        }
+       return anyProcessed;
+}
index 175041b21e9817eb4d859a922fae7ffcb68c1ae0..82bd256c70736c6e869c50bf91217493f951672c 100644 (file)
 
 #include "GHOST_NDOFManager.h"
 
-// Event capture is handled within the NDOF manager on Linux,
-// so there's no need for SystemX11 to look for them.
+/* Event capture is handled within the NDOF manager on Linux,
+ * so there's no need for SystemX11 to look for them. */
 
 class GHOST_NDOFManagerX11 : public GHOST_NDOFManager
-       {
+{
 public:
        GHOST_NDOFManagerX11(GHOST_System&);
        ~GHOST_NDOFManagerX11();
@@ -40,10 +40,10 @@ public:
        bool processEvents();
 
 private:
-//     bool identifyDevice();
+       //      bool identifyDevice();
 
        bool m_available;
-       };
+};
 
 #endif
 
index c985c6dd0a65c0edef061e0fc8e6838c6e7bdf66..bbf8efeaee399b677013831c4d621c5f01ec3989 100644 (file)
@@ -730,11 +730,9 @@ GHOST_Event* GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, GHOST_
 {
        GHOST_System* system = (GHOST_System*)getSystem();
 
-       if (type == GHOST_kEventWindowActivate)
-               {
-               puts("activating window");
+       if (type == GHOST_kEventWindowActivate) {
                system->getWindowManager()->setActiveWindow(window);
-               }
+       }
 
        return new GHOST_Event(system->getMilliSeconds(), type, window);
 }
index f476b371d0c3eb56c197557235993d4b87a26211..45664384efaa4372ccc3ba66a93fd67ab41153ee 100644 (file)
@@ -37,6 +37,15 @@ import bpy
 from bpy.props import StringProperty, BoolProperty, EnumProperty
 
 
+def _check_axis_conversion(op):
+    if hasattr(op, "axis_forward") and hasattr(op, "axis_up"):
+        return axis_conversion_ensure(op,
+                                      "axis_forward",
+                                      "axis_up",
+                                      )
+    return False
+
+
 class ExportHelper:
     filepath = StringProperty(
             name="File Path",
@@ -70,21 +79,22 @@ class ExportHelper:
         return {'RUNNING_MODAL'}
 
     def check(self, context):
+        change_ext = False
+        change_axis = _check_axis_conversion(self)
+
         check_extension = self.check_extension
 
-        if check_extension is None:
-            return False
+        if check_extension is not None:
+            filepath = bpy.path.ensure_ext(self.filepath,
+                                           self.filename_ext
+                                           if check_extension
+                                           else "")
 
-        filepath = bpy.path.ensure_ext(self.filepath,
-                                       self.filename_ext
-                                       if check_extension
-                                       else "")
+            if filepath != self.filepath:
+                self.filepath = filepath
+                change_ext = True
 
-        if filepath != self.filepath:
-            self.filepath = filepath
-            return True
-
-        return False
+        return (change_ext or change_axis)
 
 
 class ImportHelper:
@@ -99,6 +109,9 @@ class ImportHelper:
         context.window_manager.fileselect_add(self)
         return {'RUNNING_MODAL'}
 
+    def check(self, context):
+        return _check_axis_conversion(self)
+
 
 # Axis conversion function, not pretty LUT
 # use lookup tabes to convert between any axis
index 2a52ae23782a57238a3f246ab0072f3efdaf2931..296c05d78f5fa1ec975c7dcecfe2a4c40da09f62 100644 (file)
@@ -247,15 +247,17 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
             row.prop(mat, "diffuse_fresnel_factor", text="Factor")
 
         if mat.use_diffuse_ramp:
-            layout.separator()
-            layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
-            layout.separator()
+            col = layout.column()
+            col.active = (not mat.use_shadeless)
+            col.separator()
+            col.template_color_ramp(mat, "diffuse_ramp", expand=True)
+            col.separator()
 
-            row = layout.row()
+            row = col.row()
             row.prop(mat, "diffuse_ramp_input", text="Input")
             row.prop(mat, "diffuse_ramp_blend", text="Blend")
 
-            layout.prop(mat, "diffuse_ramp_factor", text="Factor")
+            col.prop(mat, "diffuse_ramp_factor", text="Factor")
 
 
 class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
index c9615204607af31c01acbbb18d6b9b351576469c..27bd31c20ff9391ee58a8134f6562116fba0103b 100644 (file)
@@ -52,6 +52,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad);
 /* glStipple defines */
 extern unsigned char stipple_halftone[128];
 extern unsigned char stipple_quarttone[128];
+extern unsigned char stipple_diag_stripes_pos[128];
+extern unsigned char stipple_diag_stripes_neg[128];
 
        /**
         * Draw a lined (non-looping) arc with the given
index 3fd3a0ba0e1878708c083a17de4f2663dcf0de06..6b66d051a3ca0265feab0a282408cc58811e0839 100644 (file)
@@ -149,6 +149,7 @@ void BIF_selectOrientation(void);
 #define P_ALIGN_SNAP   (P_GEO_SNAP|(1 << 5))
 #define P_CONSTRAINT   (1 << 6)
 #define P_OPTIONS              (1 << 7)
+#define P_CORRECT_UV   (1 << 8)
 
 void Transform_Properties(struct wmOperatorType *ot, int flags);
 
index 2918c98c84a9aaadfcd428fd6b27fcb57fb8bbee..f56ae17d3664963132932f6b4f04325525396a64 100644 (file)
@@ -92,6 +92,44 @@ GLubyte stipple_quarttone[128] = {
        136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0};
 
 
+GLubyte stipple_diag_stripes_pos[128] = {
+    0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
+       0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
+       0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
+       0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
+       0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+       0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
+       0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
+       0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
+       0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
+       0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
+       0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
+       0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
+       0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+       0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
+       0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
+       0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f};
+
+
+GLubyte stipple_diag_stripes_neg[128] = {
+    0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+       0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
+       0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
+       0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
+       0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
+       0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
+       0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
+       0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
+       0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+       0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
+       0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
+       0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
+       0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
+       0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
+       0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
+       0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80};
+
+
 void fdrawbezier(float vec[4][3])
 {
        float dist;
index 6e84c1a7f0ccbff57776d1d7ff87099d81025362..e0ebde589a8be34fd2de024e54ebd6cc12b28613 100644 (file)
@@ -452,14 +452,10 @@ static int view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
 
        wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
 
-       float dt = ndof->dt > 0.25f ? 0.0125f : ndof->dt;
-       /* this is probably the first event for this motion, so set dt to something reasonable
-        * TODO: replace such guesswork with a flag or field from the NDOF manager
-        */
-
+       float dt = ndof->dt;
        /* tune these until it feels right */
-       const float zoom_sensitivity = 0.5f;
-       const float pan_sensitivity = 300.f;
+       const float zoom_sensitivity = 0.5f; // 50% per second (I think)
+       const float pan_sensitivity = 300.f; // screen pixels per second
 
        float pan_x = pan_sensitivity * dt * ndof->tvec[0] / sima->zoom;
        float pan_y = pan_sensitivity * dt * ndof->tvec[1] / sima->zoom;
index 594d2942e8faa5abd02bb316ee236a886c26fd73..98687bb90e01c67bc69635f43b7065fb0161311d 100644 (file)
@@ -639,6 +639,25 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
        /* draw sound wave */
        if(seq->type == SEQ_SOUND) drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin)/ar->winx);
 
+       /* draw lock */
+       if(seq->flag & SEQ_LOCK) {
+               glEnable(GL_POLYGON_STIPPLE);
+               glEnable(GL_BLEND);
+
+               /* light stripes */
+               glColor4ub(255, 255, 255, 32);
+               glPolygonStipple(stipple_diag_stripes_pos);
+               glRectf(x1, y1, x2, y2);
+
+               /* dark stripes */
+               glColor4ub(0, 0, 0, 32);
+               glPolygonStipple(stipple_diag_stripes_neg);
+               glRectf(x1, y1, x2, y2);
+
+               glDisable(GL_POLYGON_STIPPLE);
+               glDisable(GL_BLEND);
+       }
+
        get_seq_color3ubv(scene, seq, col);
        if (G.moving && (seq->flag & SELECT)) {
                if(seq->flag & SEQ_OVERLAP) {
index 8f6474184b2df2835716fe596454bad56cfc01fe..acb6f5c1268ade428770163d2b8b2fc7b737952a 100644 (file)
@@ -1191,7 +1191,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
        return TRUE;
 }
 
-/* dont set windows active in in here, is used by renderwin too */
+/* dont set windows active in here, is used by renderwin too */
 void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
 {
        if(rv3d->persp==RV3D_CAMOB) {       /* obs/camera */
index f3bb779b02425a736085556f8b089b71ab824bd8..7f7bc0e63a71ec3cad7e204d9043bced63495631 100644 (file)
@@ -4290,7 +4290,7 @@ static int createSlideVerts(TransInfo *t)
        /* UV correction vars */
        GHash **uvarray= NULL;
        SlideData *sld = MEM_callocN(sizeof(*sld), "sld");
-       int  uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
+       const int  uvlay_tot=  (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) ? CustomData_number_of_layers(&em->fdata, CD_MTFACE) : 0;
        int uvlay_idx;
        TransDataSlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
        RegionView3D *v3d = t->ar ? t->ar->regiondata : NULL; /* background mode support */
@@ -4662,7 +4662,7 @@ static int createSlideVerts(TransInfo *t)
        sld->end[0] = (int) end[0];
        sld->end[1] = (int) end[1];
        
-       if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
+       if (uvlay_tot) {
                int maxnum = 0;
 
                uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
@@ -4852,8 +4852,6 @@ void initEdgeSlide(TransInfo *t)
 
 int doEdgeSlide(TransInfo *t, float perc)
 {
-       Mesh *me= t->obedit->data;
-       EditMesh *em = me->edit_mesh;
        SlideData *sld = t->customData;
        EditVert *ev, *nearest = sld->nearest;
        EditVert *centerVert, *upVert, *downVert;
@@ -4864,7 +4862,7 @@ int doEdgeSlide(TransInfo *t, float perc)
        int prop=1, flip=0;
        /* UV correction vars */
        GHash **uvarray= sld->uvhash;
-       int  uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
+       const int  uvlay_tot= sld->uvlay_tot;
        int uvlay_idx;
        TransDataSlideUv *suv;
        float uv_tmp[2];
@@ -4890,7 +4888,7 @@ int doEdgeSlide(TransInfo *t, float perc)
                        tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
                        interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
 
-                       if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+                       if (uvlay_tot) {
                                for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
                                        suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
                                        if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
@@ -4920,7 +4918,7 @@ int doEdgeSlide(TransInfo *t, float perc)
                        if(newlen < 0.0f) {newlen = 0.0;}
                        if(flip == 0) {
                                interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
-                               if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+                               if (uvlay_tot) {
                                        /* dont do anything if no UVs */
                                        for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
                                                suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
@@ -4937,7 +4935,7 @@ int doEdgeSlide(TransInfo *t, float perc)
                        } else{
                                interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
 
-                               if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+                               if (uvlay_tot) {
                                        /* dont do anything if no UVs */
                                        for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
                                                suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
index d62005c1074302bd68377d36be150656068c25b0..837bc1cf3eadb7c68f3f907c958e7ee6a42c0d1e 100644 (file)
@@ -1056,6 +1056,22 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
                                t->options |= CTX_NO_PET;
                        }
                }
+
+               /* initialize UV transform from */
+               if (RNA_struct_find_property(op->ptr, "correct_uv")) {
+                       if(RNA_property_is_set(op->ptr, "correct_uv")) {
+                               if(RNA_boolean_get(op->ptr, "correct_uv")) {
+                                       t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
+                               }
+                               else {
+                                       t->settings->uvcalc_flag &= ~UVCALC_TRANSFORM_CORRECT;
+                               }
+                       }
+                       else {
+                               RNA_boolean_set(op->ptr, "correct_uv", t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT);
+                       }
+               }
+
        }
        else if(t->spacetype==SPACE_IMAGE)
        {
index e4ca1cfb90a947c681a60f909c30eb74d0c2f604..a6c8d1fd82d2016b1be475f1ad278c4a2ba7ed27 100644 (file)
@@ -360,11 +360,17 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
 
        TransInfo *t = op->customdata;
 
+       #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
 
        /* XXX insert keys are called here, and require context */
        t->context= C;
@@ -502,6 +508,11 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
                RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Object data texture space", "");
        }
 
+       if (flags & P_CORRECT_UV)
+       {
+               RNA_def_boolean(ot->srna, "correct_uv", 0, "Correct UV coords when transforming", "");
+       }
+
        // Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
        /*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
        //RNA_def_property_flag(prop, PROP_HIDDEN);
@@ -749,7 +760,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
 
        RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
 
-       Transform_Properties(ot, P_MIRROR|P_SNAP);
+       Transform_Properties(ot, P_MIRROR|P_SNAP|P_CORRECT_UV);
 }
 
 void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
index f9b9874aa11fa234646474ee7fd1f8c92a7b6027..e615b41723738b2f532ed688c7ffcbd95c017d70 100644 (file)
@@ -606,6 +606,9 @@ extern UserDef U; /* from blenkernel blender.c */
 /* actually... users probably don't care about what the mode
    is called, just that it feels right */
 #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)
 
 
 #ifdef __cplusplus
index 6c0228757488295a7093d8cf2cdec045b3abdfce..6a169a482fb0bc1604c80f3bcb28c9cd02aba3ea 100644 (file)
@@ -3260,7 +3260,7 @@ void RNA_def_scene(BlenderRNA *brna)
        RNA_def_property_int_sdna(prop, NULL, "r.cfra");
        RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
        RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
-       RNA_def_property_ui_text(prop, "Current Frame", "Current Frame");
+       RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
        RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
        
index a7e19c8db4f474123ee73f975aaf7e3847e43424..c08d6c0f456de00a4926d2f8213af08c3c8c15f0 100644 (file)
@@ -730,7 +730,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
        
        if(zpass==NULL) return;
 
-       /* check for at least one sun lamp that its atmosphere flag is is enabled */
+       /* check for at least one sun lamp that its atmosphere flag is enabled */
        for(go=R.lights.first; go; go= go->next) {
                lar= go->lampren;
                if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP))
index 0abae2e06b76443a343a159aa7906afabcf25e91..2f0c1a72be9d9447f4ebbd8f822a63c9549db3e3 100644 (file)
@@ -2324,12 +2324,27 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
        const float s = U.ndof_sensitivity;
 
        data->tvec[0]= s * ghost->tx;
-       data->tvec[1]= s * ghost->ty;
-       data->tvec[2]= s * ghost->tz;
-
        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
+               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!
+               data->rvec[1]= s * ghost->rz;
+               data->rvec[2]= s * ghost->ry;
+               }
+       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;