https://svn.blender.org/svnroot/bf-blender/trunk/blender, in sync with trunk now
authorCampbell Barton <ideasman42@gmail.com>
Fri, 5 Aug 2011 08:28:03 +0000 (08:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 5 Aug 2011 08:28:03 +0000 (08:28 +0000)
41 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/darwin-config.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/rst/bge.constraints.rst
doc/python_api/rst/bge.texture.rst
doc/python_api/rst/bgl.rst
intern/ghost/intern/GHOST_NDOFManagerWin32.cpp
intern/ghost/intern/GHOST_NDOFManagerWin32.h
intern/ghost/intern/GHOST_SystemWin32.cpp
release/scripts/startup/bl_ui/space_userpref_keymap.py
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/resources.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/intern/bpy_driver.c
source/blender/python/intern/bpy_library.c
source/blender/python/intern/bpy_operator.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index 2d104ebfceaceda96936dbab6188699a69151b05..a0a0359d8d751fbe8b182ab13e7d7f6a273999c3 100644 (file)
@@ -998,9 +998,24 @@ elseif(APPLE)
                elseif(WITH_CODEC_QUICKTIME)
                        set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
                endif()
+
+               # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED! 
+               # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
+               if(WITH_INPUT_NDOF)
+                       # This thread it *should* work and check the framework - campbell
+                       # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
+                       find_library(3D_CONNEXION_CLIENT_LIBRARY
+                               NAMES 3DconnexionClient
+                       )
+                       if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
+                               set(WITH_INPUT_NDOF OFF)
+                       endif()
+               endif()
+
        else()
                set(PLATFORM_CFLAGS "-pipe -funsigned-char")
                set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
+               set(WITH_INPUT_NDOF OFF)  # unsupported
        endif()
 
        if(WITH_OPENCOLLADA)
index dbeabb5c2eff08ee0abc0d3de907856b8f6c4a62..4f920190276714e11a1fb021489d1cb06da5ce58 100644 (file)
@@ -253,6 +253,15 @@ if 'blenderlite' in B.targets:
         if k not in B.arguments:
             env[k] = v
 
+# detect presence of 3D_CONNEXION_CLIENT_LIBRARY for OSX
+if env['OURPLATFORM']=='darwin':
+    envi = Environment()
+    conf = Configure(envi)
+    if not conf.CheckCHeader('ConnexionClientAPI.h'): # CheckCXXHeader if it is c++ !
+        print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
+        env['WITH_BF_3DMOUSE'] = 0
+    envi = conf.Finish()
+
 
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
@@ -664,11 +673,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 4a4bc4acd6711a5e382a9582cc0c35ab4b56a64e..00b0c6ebf00da08a10d0d34faa09a34c49451ad4 100644 (file)
@@ -266,7 +266,7 @@ elif MACOSX_ARCHITECTURE == 'x86_64':
     BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
 
 # SpaceNavigator and related 3D mice
-WITH_BF_3DMOUSE = True
+WITH_BF_3DMOUSE = False
 
 #############################################################################
 ###################  various compile settings and flags    ##################
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 66f0494b1dd276ce83f481003ef9b5bb684451ca..9b911b9d6f0c719cee97595647f60232cdc63064 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
@@ -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 12ce86174571aeddfff35b55fe22528c2beb2ce8..da0a358dfed472e6cd6944a06aa8807e9a14df26 100644 (file)
@@ -2,6 +2,10 @@
 Physics Constraints (bge.constraints)
 =====================================
 
+.. module:: bge.constraints
+
+.. literalinclude:: ../examples/bge.constraints.py
+
 .. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
 
    Creates a constraint.
index f3e9f98dded30f82a4a512cce000baa78d647f09..0b32c7a393bc35fc9a5ed0b0a8965959666ce5e2 100644 (file)
@@ -36,6 +36,10 @@ When the texture object is deleted, the new texture is deleted and the old textu
 
 .. module:: bge.texture
 
+.. literalinclude:: ../examples/bge.texture.py
+
+.. literalinclude:: ../examples/bge.texture.1.py
+
 .. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0])
 
    FFmpeg video source
index 236bfafb295aa542984ff08b9fb189ac23efb6b6..5f3158bf5dd2ec82d4bcd3dc5ae097ba01f7e7cc 100644 (file)
@@ -15,7 +15,7 @@ collections of tutorials.
 The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
 OpenGL}" and the online NeHe tutorials are two of the best resources.
 
-..note::
+.. note::
    You can use the :class:`Image` type to load and set textures.
    See :class:`Image.gl_load` and :class:`Image.gl_load`,
    for example.
@@ -1386,7 +1386,7 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
         bgl.glGetFloatv(bgl.GL_MODELVIEW_MATRIX, view_matrix)
         f = 1.0 / view_matrix[0]
 
-               # Instead of the usual glRasterPos2i(xval, yval)
+        # Instead of the usual glRasterPos2i(xval, yval)
         bgl.glRasterPos2f(xval * f, yval * f)
 
 
@@ -1848,10 +1848,13 @@ class Buffer:
    .. code-block:: python
 
       import bgl
+
       myByteBuffer = bgl.Buffer(bgl.GL_BYTE, [32, 32])
       bgl.glGetPolygonStipple(myByteBuffer)
+
       print(myByteBuffer.dimensions)
       print(myByteBuffer.to_list())
+
       sliceBuffer = myByteBuffer[0:16]
       print(sliceBuffer)
 
index 57d84ec14d47395bf38eae47a4082dc36453861f..fd62e845f7d954c8edcd827bc1a57e300b2421c6 100644 (file)
@@ -22,7 +22,9 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
+#ifdef WITH_INPUT_NDOF // use contents of this file
+
 #include "GHOST_NDOFManagerWin32.h"
 
 
@@ -39,3 +41,5 @@ bool GHOST_NDOFManagerWin32::available()
        // always available since RawInput is built into Windows
        return true;
 }
+
+#endif // WITH_INPUT_NDOF
index 31f7e074cd6b1bba8c596924fa972c2430e3faf5..9f3eddeb3c84ddacae395145cb691ec724915d01 100644 (file)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
+
 #ifndef _GHOST_NDOFMANAGERWIN32_H_
 #define _GHOST_NDOFMANAGERWIN32_H_
 
+#ifdef WITH_INPUT_NDOF
+
 #include "GHOST_NDOFManager.h"
 
 
@@ -37,4 +40,5 @@ public:
 };
 
 
-#endif
+#endif // WITH_INPUT_NDOF
+#endif // #include guard
index bbf8efeaee399b677013831c4d621c5f01ec3989..38f3985b13931a97e73d2308982f8bb93bb0971d 100644 (file)
@@ -62,7 +62,6 @@
 #endif
 #endif
 
-#include "GHOST_Debug.h"
 #include "GHOST_DisplayManagerWin32.h"
 #include "GHOST_EventButton.h"
 #include "GHOST_EventCursor.h"
 #include "GHOST_TimerManager.h"
 #include "GHOST_WindowManager.h"
 #include "GHOST_WindowWin32.h"
+
+#ifdef WITH_INPUT_NDOF
 #include "GHOST_NDOFManagerWin32.h"
+#endif
 
 // Key code values not found in winuser.h
 #ifndef VK_MINUS
 
 static void initRawInput()
 {
-       RAWINPUTDEVICE devices[2];
-       memset(devices, 0, 2 * sizeof(RAWINPUTDEVICE));
+#ifdef WITH_INPUT_NDOF
+#define DEVICE_COUNT 2
+#else
+#define DEVICE_COUNT 1
+#endif
 
-       // multi-axis mouse (SpaceNavigator, etc.)
-       devices[0].usUsagePage = 0x01;
-       devices[0].usUsage = 0x08;
+       RAWINPUTDEVICE devices[DEVICE_COUNT];
+       memset(devices, 0, DEVICE_COUNT * sizeof(RAWINPUTDEVICE));
 
        // Initiates WM_INPUT messages from keyboard
        // That way GHOST can retrieve true keys
+       devices[0].usUsagePage = 0x01;
+       devices[0].usUsage = 0x06; /* http://msdn.microsoft.com/en-us/windows/hardware/gg487473.aspx */
+
+#ifdef WITH_INPUT_NDOF
+       // multi-axis mouse (SpaceNavigator, etc.)
        devices[1].usUsagePage = 0x01;
-       devices[1].usUsage = 0x06; /* http://msdn.microsoft.com/en-us/windows/hardware/gg487473.aspx */
+       devices[1].usUsage = 0x08;
+#endif
 
-       if (RegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)))
-               puts("registered for RawInput (spacenav & keyboard)");
+       if (RegisterRawInputDevices(devices, DEVICE_COUNT, sizeof(RAWINPUTDEVICE)))
+               ; // yay!
        else
                printf("could not register for RawInput: %d\n", (int)GetLastError());
+
+#undef DEVICE_COUNT
 }
 
 GHOST_SystemWin32::GHOST_SystemWin32()
@@ -808,6 +820,7 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
                case 1: // translation
                {
                        short* axis = (short*)(data + 1);
+                       // massage into blender view coords (same goes for rotation)
                        short t[3] = {axis[0], -axis[2], axis[1]};
                        m_ndofManager->updateTranslation(t, now);
 
@@ -830,14 +843,6 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw)
                }
                case 3: // buttons
                {
-#if 0
-                       // I'm getting garbage bits -- examine whole report:
-                       printf("ndof: HID report for buttons [");
-                       for (int i = 0; i < raw.data.hid.dwSizeHid; ++i)
-                               printf(" %02X", data[i]);
-                       printf(" ]\n");
-#endif
-
                        int button_bits;
                        memcpy(&button_bits, data + 1, sizeof(button_bits));
                        m_ndofManager->updateButtons(button_bits, now);
@@ -892,12 +897,12 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                                        GHOST_PRINT(" key ignored\n")
                                                }
                                                break;
-                                       case RIM_TYPEHID:
 #ifdef WITH_INPUT_NDOF
+                                       case RIM_TYPEHID:
                                                if (system->processNDOF(raw))
                                                        eventHandled = true;
-#endif
                                                break;
+#endif
                                        }
                                break;
                                }
index 8fed3a934d9b92109992bfb6fbf0686e01a268f0..585c3cffcb9bf99027486c7a6b1212ea730054a3 100644 (file)
@@ -592,6 +592,9 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
         if not self.filepath:
             raise Exception("Filepath not set")
 
+        if not self.filepath.endswith('.py'):
+            self.filepath += '.py'
+
         f = open(self.filepath, "w")
         if not f:
             raise Exception("Could not open file")
index 85d4b936c518fc6f47eb66611b726cbb574b14cd..479314777284ac5639c098c919f00f844dff0cd8 100644 (file)
@@ -211,7 +211,16 @@ int BLO_has_bfile_extension(char *str);
  */
 int BLO_is_a_library(const char *path, char *dir, char *group);
 
-struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, const char *filepath);
+
+/**
+ * Initialize the BlendHandle for appending or linking library data.
+ *
+ * @param mainvar The current main database eg G.main or CTX_data_main(C).
+ * @param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory.
+ * @param filepath Used for relative linking, copied to the lib->name
+ * @return the library Main, to be passed to BLO_library_append_named_part as mainl.
+ */
+struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, const char *filepath);
 
 
 /**
@@ -243,11 +252,6 @@ void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendH
 
 void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
 
-/* deprecated */
-#if 1
-void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, int idcode, short flag, struct Main *mainvar, struct Scene *scene, struct ReportList *reports);
-#endif
-
 BlendFileData* blo_read_blendafterruntime(int file, char *name, int actualsize, struct ReportList *reports);
 
 #ifdef __cplusplus
index 2c287441f3851504c6691d792c7c104f3ee1844e..a76353fa0c7af12828f0a2cee17ab7a263368edf 100644 (file)
@@ -13041,9 +13041,8 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r)
 
 /* common routine to append/link something from a library */
 
-static Main* library_append_begin(const bContext *C, FileData **fd, const char *filepath)
+static Main* library_append_begin(Main *mainvar, FileData **fd, const char *filepath)
 {
-       Main *mainvar= CTX_data_main(C);
        Main *mainl;
 
        /* make mains */
@@ -13059,64 +13058,17 @@ static Main* library_append_begin(const bContext *C, FileData **fd, const char *
        return mainl;
 }
 
-Main* BLO_library_append_begin(const bContext *C, BlendHandle** bh, const char *filepath)
+Main* BLO_library_append_begin(Main *mainvar, BlendHandle** bh, const char *filepath)
 {
        FileData *fd= (FileData*)(*bh);
-       return library_append_begin(C, &fd, filepath);
+       return library_append_begin(mainvar, &fd, filepath);
 }
 
-static void append_do_cursor(Scene *scene, Library *curlib, short flag)
-{
-       Base *centerbase;
-       Object *ob;
-       float *curs, centerloc[3], vec[3], min[3], max[3];
-       int count= 0;
-
-       /* when not linking (appending)... */
-       if(flag & FILE_LINK) 
-               return;
-
-       /* we're not appending at cursor */
-       if((flag & FILE_ATCURSOR) == 0) 
-               return;
-       
-       /* find the center of everything appended */
-       INIT_MINMAX(min, max);
-       centerbase= (scene->base.first);
-       while(centerbase) {
-               if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
-                       VECCOPY(vec, centerbase->object->loc);
-                       DO_MINMAX(vec, min, max);
-                       count++;
-               }
-               centerbase= centerbase->next;
-       }
-       /* we haven't found any objects to move to cursor */
-       if(!count) 
-               return;
-       
-       /* move from the center of the appended objects to cursor */
-       mid_v3_v3v3(centerloc, min, max);
-       curs = scene->cursor;
-       VECSUB(centerloc,curs,centerloc);
-       
-       /* now translate the center of the objects */
-       centerbase= (scene->base.first);
-       while(centerbase) {
-               if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
-                       ob= centerbase->object;
-                       ob->loc[0] += centerloc[0];
-                       ob->loc[1] += centerloc[1];
-                       ob->loc[2] += centerloc[2];
-               }
-               centerbase= centerbase->next;
-       }
-}
 
+/* Context == NULL signifies not to do any scene manipulation */
 static void library_append_end(const bContext *C, Main *mainl, FileData **fd, int idcode, short flag)
 {
        Main *mainvar;
-       Scene *scene= CTX_data_scene(C);
        Library *curlib;
 
        /* make main consistent */
@@ -13145,22 +13097,26 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
        lib_verify_nodetree(mainvar, FALSE);
        fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */
 
-       /* give a base to loose objects. If group append, do it for objects too */
-       if(scene) {
-               const short is_link= (flag & FILE_LINK) != 0;
-               if(idcode==ID_SCE) {
-                       /* dont instance anything when linking in scenes, assume the scene its self instances the data */
-               }
-               else {
-                       give_base_to_objects(mainvar, scene, curlib, idcode, is_link);
+       if(C) {
+               Scene *scene= CTX_data_scene(C);
 
-                       if (flag & FILE_GROUP_INSTANCE) {
-                               give_base_to_groups(mainvar, scene);
+               /* give a base to loose objects. If group append, do it for objects too */
+               if(scene) {
+                       const short is_link= (flag & FILE_LINK) != 0;
+                       if(idcode==ID_SCE) {
+                               /* dont instance anything when linking in scenes, assume the scene its self instances the data */
+                       }
+                       else {
+                               give_base_to_objects(mainvar, scene, curlib, idcode, is_link);
+
+                               if (flag & FILE_GROUP_INSTANCE) {
+                                       give_base_to_groups(mainvar, scene);
+                               }
                        }
                }
-       }
-       else {
-               printf("library_append_end, scene is NULL (objects wont get bases)\n");
+               else {
+                       printf("library_append_end, scene is NULL (objects wont get bases)\n");
+               }
        }
        /* has been removed... erm, why? s..ton) */
        /* 20040907: looks like they are give base already in append_named_part(); -Nathan L */
@@ -13171,8 +13127,6 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
                blo_freefiledata( *fd );
                *fd = NULL;
        }       
-
-       append_do_cursor(scene, curlib, flag);
 }
 
 void BLO_library_append_end(const bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag)
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 2311aafbb17f523c5cdd7bb1bd9c7d0dc9fc63e3..d0c2b387445b9bbe02b09a006683386040f7eb70 100644 (file)
@@ -242,7 +242,9 @@ enum {
 
        TH_DRAWEXTRA_EDGELEN,
        TH_DRAWEXTRA_FACEAREA,
-       TH_DRAWEXTRA_FACEANG
+       TH_DRAWEXTRA_FACEANG,
+
+       TH_NODE_CURVING
 };
 /* XXX WARNING: previous is saved in file, so do not change order! */
 
index 0c755180b3ac5883fb57551d92694ac85aca3ce7..32e87b3a793995a0ec5c930a15ddb51d22194319 100644 (file)
@@ -360,7 +360,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
                                cp= ts->syntaxv; break;
                        case TH_NODE_GROUP:
                                cp= ts->syntaxc; break;
-                               
+                       case TH_NODE_CURVING:
+                               cp= &ts->noodle_curving; break;
+
                        case TH_SEQ_MOVIE:
                                cp= ts->movie; break;
                        case TH_SEQ_IMAGE:
@@ -787,6 +789,7 @@ void ui_theme_init_default(void)
        SETCOL(btheme->tnode.syntaxb, 108, 105, 111, 255);      /* operator */
        SETCOL(btheme->tnode.syntaxv, 104, 106, 117, 255);      /* generator */
        SETCOL(btheme->tnode.syntaxc, 105, 117, 110, 255);      /* group */
+       btheme->tnode.noodle_curving = 5;
 
        /* space logic */
        btheme->tlogic= btheme->tv3d;
@@ -1553,7 +1556,14 @@ void init_userdef_do_versions(void)
                /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
                U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
        }
-       
+
+       if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 1)) {
+               bTheme *btheme;
+               for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+                       btheme->tnode.noodle_curving = 5;
+               }
+       }
+
        /* GL Texture Garbage Collection (variable abused above!) */
        if (U.textimeout == 0) {
                U.texcollectrate = 60;
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 77524c7e117496d8a93404df1f6f6a2b5bacdfef..d4253495e976e2e000e2296c3ec6835787758efa 100644 (file)
@@ -64,6 +64,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <ctype.h>
 
 /* for events */
 #define NOTACTIVEFILE                  0
@@ -1079,8 +1080,18 @@ static void file_expand_directory(bContext *C)
                }
 
 #ifdef WIN32
-               if (sfile->params->dir[0] == '\0')
+               if (sfile->params->dir[0] == '\0') {
                        get_default_root(sfile->params->dir);
+               }
+               /* change "C:" --> "C:\", [#28102] */
+               else if (   (isalpha(sfile->params->dir[0]) &&
+                           (sfile->params->dir[1] == ':')) &&
+                           (sfile->params->dir[2] == '\0')
+
+               ) {
+                       sfile->params->dir[2]= '\\';
+                       sfile->params->dir[3]= '\0';
+               }
 #endif
        }
 }
index 50e657bbb61d031d70d0305e7d5b51dbaefe3020..c32d05e9c30b4ebfaa791e8de6ff233a5ea3ddf4 100644 (file)
@@ -1768,8 +1768,8 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
                vec[3][0]= snode->mx;
                vec[3][1]= snode->my;
        }
-       
-       dist= 0.5f*ABS(vec[0][0] - vec[3][0]);
+
+       dist= UI_GetThemeValue(TH_NODE_CURVING)*0.10f*ABS(vec[0][0] - vec[3][0]);
        
        /* check direction later, for top sockets */
        vec[1][0]= vec[0][0]+dist;
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 b7a7b6b5412e9c8b3bff5598acd9acbb0a5c137e..6a69d32d307fb83b11116a23eebaa7876c848de3 100644 (file)
@@ -1785,7 +1785,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
                                se = give_stripelem(seq, cfra);
 
                                seq_new= seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
-                               BLI_addtail(&ed->seqbase, seq_new);
+                               BLI_addtail(ed->seqbasep, seq_new);
 
                                seq_new->start= start_ofs;
                                seq_new->type= SEQ_IMAGE;
@@ -1839,7 +1839,6 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
        ot->description="On image sequences strips, it return a strip for each image";
        
        /* api callbacks */
-       ot->invoke= WM_operator_props_popup;
        ot->exec= sequencer_separate_images_exec;
        ot->poll= sequencer_edit_poll;
        
index 9df00163302f2dee9ef7814e0f2c9e62d1250f76..d5ff475566e3170ba4c32fa66ae8406aefedec8f 100644 (file)
@@ -889,6 +889,7 @@ void resetTransRestrictions(TransInfo *t)
        t->flag &= ~T_ALL_RESTRICTIONS;
 }
 
+/* the *op can be NULL */
 int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
 {
        Scene *sce = CTX_data_scene(C);
@@ -1017,7 +1018,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
                }
 
                /* initialize UV transform from */
-               if (RNA_struct_find_property(op->ptr, "correct_uv")) {
+               if (op && 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;
index ff9f2269f53f1c3cd71e09056a8e7d0cf26b8457..1549bd717485beb8a0b731489af7523371a2c465 100644 (file)
@@ -703,7 +703,7 @@ enum FileSortTypeE {
 #define FILE_HIDE_DOT          (1<<3)
 #define FILE_AUTOSELECT                (1<<4)
 #define FILE_ACTIVELAY         (1<<5)
-#define FILE_ATCURSOR          (1<<6)
+/* #define FILE_ATCURSOR       (1<<6) */ /* deprecated */
 #define FILE_DIRSEL_ONLY       (1<<7)
 #define FILE_FILTER                    (1<<8)
 #define FILE_BOOKMARKS         (1<<9)
index 86e9d65a62f9a8f954edf56538142aaa94c40066..17c66d9804e929e8cdc9e143631241f9b59c346e 100644 (file)
@@ -220,7 +220,7 @@ typedef struct ThemeSpace {
        char console_cursor[4];
        
        char vertex_size, outline_width, facedot_size;
-       char bpad;
+       char noodle_curving;
 
        char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
        char syntaxv[4], syntaxc[4];
index e71be8c153e89fbc9366c9d337133ceb74789005..f1056c86a4cb1d0c9380bccdb1a5b3f405497611 100644 (file)
@@ -4007,10 +4007,13 @@ void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
 {
        PropertyRNA *prop= RNA_struct_find_property(ptr, name);
 
-       if(prop)
+       if(prop) {
                RNA_property_string_get(ptr, prop, value);
-       else
+       }
+       else {
                printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name);
+               value[0]= '\0';
+       }
 }
 
 char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
index b54f11f62ff2780ba7a7ac7b823f74e2559bb8ee..0ebf90437494007a4d4601692f23ea43c0d5f748 100644 (file)
@@ -45,9 +45,9 @@
 
 // #include "ED_mesh.h"
 
-#include "BLI_math.h"
 
 #ifdef RNA_RUNTIME
+#include "BLI_math.h"
 
 #include "BKE_main.h"
 #include "BKE_global.h"
@@ -544,7 +544,8 @@ void RNA_api_object(StructRNA *srna)
        /* location of point for test and max distance */
        parm= RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       RNA_def_float(func, "max_dist", sqrt(FLT_MAX), 0.0, FLT_MAX, "", "", 0.0, FLT_MAX);
+       /* default is sqrt(FLT_MAX) */
+       RNA_def_float(func, "max_dist", 1.844674352395373e+19, 0.0, FLT_MAX, "", "", 0.0, FLT_MAX);
 
        /* return location and normal */
        parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4);
index 7a9193571fdd0de74486f0738bb4f6bdf066a45a..a1a99c34e70f67d3301213b88288b0d0a432bee6 100644 (file)
@@ -1351,6 +1351,13 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
        RNA_def_property_array(prop, 3);
        RNA_def_property_ui_text(prop, "Group Node", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop= RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
+       RNA_def_property_int_default(prop, 5);
+       RNA_def_property_range(prop, 0, 10);
+       RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
 }
 
 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
index bcd5df97c2ce4bb262eb2f1823e225a365bb5a1f..d68fd9a9111dcf5038c9ba96c8d3eee3c8561de0 100644 (file)
@@ -41,8 +41,6 @@
 
 #include "bpy_driver.h"
 
-#include "../generic/py_capi_utils.h"
-
 /* for pydrivers (drivers using one-line Python expressions to express relationships between targets) */
 PyObject *bpy_pydriver_Dict= NULL;
 
@@ -89,7 +87,7 @@ int bpy_pydriver_create_dict(void)
 void BPY_driver_reset(void)
 {
        PyGILState_STATE gilstate;
-       int use_gil= !PYC_INTERPRETER_ACTIVE;
+       int use_gil= 1; /* !PYC_INTERPRETER_ACTIVE; */
 
        if(use_gil)
                gilstate= PyGILState_Ensure();
@@ -120,9 +118,14 @@ static void pydriver_error(ChannelDriver *driver)
 /* This evals py driver expressions, 'expr' is a Python expression that
  * should evaluate to a float number, which is returned.
  *
- * note: PyGILState_Ensure() isnt always called because python can call the
- * bake operator which intern starts a thread which calls scene update which
- * does a driver update. to avoid a deadlock check PYC_INTERPRETER_ACTIVE if PyGILState_Ensure() is needed.
+ * (old)note: PyGILState_Ensure() isnt always called because python can call
+ * the bake operator which intern starts a thread which calls scene update
+ * which does a driver update. to avoid a deadlock check PYC_INTERPRETER_ACTIVE
+ * if PyGILState_Ensure() is needed - see [#27683]
+ *
+ * (new)note: checking if python is running is not threadsafe [#28114]
+ * now release the GIL on python operator execution instead, using
+ * PyEval_SaveThread() / PyEval_RestoreThread() so we dont lock up blender.
  */
 float BPY_driver_exec(ChannelDriver *driver)
 {
@@ -149,7 +152,7 @@ float BPY_driver_exec(ChannelDriver *driver)
                return 0.0f;
        }
 
-       use_gil= !PYC_INTERPRETER_ACTIVE;
+       use_gil= 1; /* !PYC_INTERPRETER_ACTIVE; */
 
        if(use_gil)
                gilstate= PyGILState_Ensure();
index 85bffb5a8cc056196c531fb6615d2c1de41cdbf8..4ce3e0356e27600ef00f1cb9fb79fdc9e951cb40 100644 (file)
@@ -39,6 +39,7 @@
 #include "BKE_library.h"
 #include "BKE_idcode.h"
 #include "BKE_report.h"
+#include "BKE_context.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
@@ -317,7 +318,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
        flag_all_listbases_ids(LIB_PRE_EXISTING, 1);
 
        /* here appending/linking starts */
-       mainl= BLO_library_append_begin(BPy_GetContext(), &(self->blo_handle), self->relpath);
+       mainl= BLO_library_append_begin(CTX_data_main(BPy_GetContext()), &(self->blo_handle), self->relpath);
 
        {
                int i= 0, code;
index b8883e655f284efb0c1717a98cda22e94093c2f2..4a17c45ae3884bcf3904862afe5d8c4c8f66949f 100644 (file)
 #include "BKE_report.h"
 #include "BKE_context.h"
 
+/* so operators called can spawn threads which aquire the GIL */
+#define BPY_RELEASE_GIL
+
+
 static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
 {
        wmOperatorType *ot;
@@ -219,7 +223,22 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
                        reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
                        BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); /* own so these dont move into global reports */
 
-                       operator_ret= WM_operator_call_py(C, ot, context, &ptr, reports);
+#ifdef BPY_RELEASE_GIL
+                       /* release GIL, since a thread could be started from an operator
+                        * that updates a driver */
+                       /* note: I havve not seen any examples of code that does this
+                        * so it may not be officially supported but seems to work ok. */
+                       {
+                               PyThreadState *ts= PyEval_SaveThread();
+#endif
+
+                               operator_ret= WM_operator_call_py(C, ot, context, &ptr, reports);
+
+#ifdef BPY_RELEASE_GIL
+                               /* regain GIL */
+                               PyEval_RestoreThread(ts);
+                       }
+#endif
 
                        error_val= BPy_reports_to_error(reports, PyExc_RuntimeError, FALSE);
 
index a47dfacf3586f6a38e4c016ccfca1f78fb2627ee..7238cede2ccdbcb22e346649aa0c75f61ade9605 100644 (file)
@@ -1621,7 +1621,6 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
        int idcode, totfiles=0;
        short flag;
 
-       name[0] = '\0';
        RNA_string_get(op->ptr, "filename", name);
        RNA_string_get(op->ptr, "directory", dir);
 
@@ -1690,7 +1689,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
        flag_all_listbases_ids(LIB_PRE_EXISTING, 1);
 
        /* here appending/linking starts */
-       mainl = BLO_library_append_begin(C, &bh, libname);
+       mainl = BLO_library_append_begin(bmain, &bh, libname);
        if(totfiles == 0) {
                BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag);
        }
index 58089cc4b2d2503cba979ec0cbaa4bf8280eb4c7..b04a0d24e7820b265ba08d4f57a773ff0f42feb4 100644 (file)
@@ -950,7 +950,6 @@ bool KX_BlenderSceneConverter::LinkBlendFilePath(const char *path, char *group,
 
 bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
 {
-       bContext *C;
        Main *main_newlib; /* stored as a dynamic 'main' until we free it */
        Main *main_tmp= NULL; /* created only for linking, then freed */
        LinkNode *names = NULL;
@@ -981,12 +980,10 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
        }
        
        main_newlib= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
-       C= CTX_create();
-       CTX_data_main_set(C, main_newlib);
        BKE_reports_init(&reports, RPT_STORE);  
 
        /* here appending/linking starts */
-       main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
+       main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
 
        int totnames_dummy;
        names = BLO_blendhandle_get_datablock_names( bpy_openlib, idcode, &totnames_dummy);
@@ -1000,11 +997,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
        }
        BLI_linklist_free(names, free); /* free linklist *and* each node's data */
        
-       BLO_library_append_end(C, main_tmp, &bpy_openlib, idcode, flag);
+       BLO_library_append_end(NULL, main_tmp, &bpy_openlib, idcode, flag);
 
        /* now do another round of linking for Scenes so all actions are properly loaded */
        if (idcode==ID_SCE && options & LIB_LOAD_LOAD_ACTIONS) {
-               main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
+               main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
 
                int totnames_dummy;
                names = BLO_blendhandle_get_datablock_names( bpy_openlib, ID_AC, &totnames_dummy);
@@ -1018,12 +1015,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
                }
                BLI_linklist_free(names, free); /* free linklist *and* each node's data */
        
-               BLO_library_append_end(C, main_tmp, &bpy_openlib, ID_AC, flag);
+               BLO_library_append_end(NULL, main_tmp, &bpy_openlib, ID_AC, flag);
        }
        
        BLO_blendhandle_close(bpy_openlib);
-       
-       CTX_free(C);
+
        BKE_reports_clear(&reports);
        /* done linking */