Merging r39486 through r39651 from trunk into vgroup_modifiers.
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 23 Aug 2011 12:45:35 +0000 (12:45 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 23 Aug 2011 12:45:35 +0000 (12:45 +0000)
159 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/slave_compile.py
build_files/buildbot/slave_pack.py
build_files/cmake/buildinfo.cmake
build_files/cmake/macros.cmake
build_files/scons/config/linux-config.py [moved from build_files/scons/config/linux2-config.py with 98% similarity]
build_files/scons/config/linuxcross-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/build_systems/scons-dev.txt
doc/build_systems/scons.txt
doc/python_api/examples/bpy.types.ID.user_clear.1.py [new file with mode: 0644]
doc/python_api/sphinx_doc_gen.py
extern/bullet2/src/SConscript
intern/ghost/SConscript
intern/ghost/intern/GHOST_NDOFManagerCocoa.h
intern/ghost/intern/GHOST_NDOFManagerCocoa.mm
release/scripts/modules/bpy_extras/mesh_utils.py
release/scripts/startup/bl_operators/add_mesh_torus.py
release/scripts/startup/bl_operators/mesh.py
release/scripts/startup/bl_operators/nla.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_operators/object_align.py
release/scripts/startup/bl_operators/object_quick_effects.py
release/scripts/startup/bl_operators/object_randomize_transform.py
release/scripts/startup/bl_operators/sequencer.py
release/scripts/startup/bl_operators/uvcalc_lightmap.py
release/scripts/startup/bl_operators/uvcalc_smart_project.py
release/scripts/startup/bl_operators/vertexpaint_dirt.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_console.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_userpref_keymap.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/templates/addon_add_object.py
release/scripts/templates/operator_export.py
release/scripts/templates/operator_mesh_add.py
release/scripts/templates/operator_modal_view3d.py
release/scripts/templates/operator_simple.py
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/multires.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/jitter.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/rct.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/SConscript
source/blender/collada/CMakeLists.txt
source/blender/collada/DocumentExporter.cpp
source/blender/collada/SConscript
source/blender/editors/armature/SConscript
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/SConscript
source/blender/editors/object/SConscript
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/physics/SConscript
source/blender/editors/render/SConscript
source/blender/editors/render/render_shading.c
source/blender/editors/screen/SConscript
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/SConscript
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_file/SConscript
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_node/SConscript
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/gpu/intern/gpu_shader_material.glsl.c
source/blender/imbuf/intern/filter.c
source/blender/makesdna/DNA_sdna_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/intern/CMakeLists.txt
source/blender/makesdna/intern/SConscript
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_texture.c
source/blender/nodes/SConscript
source/blender/python/generic/noise_py_api.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_util.h
source/blender/render/SConscript
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/gammaCorrectionTables.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/sunsky.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
source/creator/CMakeLists.txt
source/creator/buildinfo.c
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.cpp

index cf083b87bc77a0f73cfcb7f7f276ae6474f1181f..4a544cbfa0567e7ab42352be93c00bc4ee2dfac0 100644 (file)
@@ -62,6 +62,22 @@ set(CMAKE_BUILD_TYPE_INIT "Release")
 # quiet output for Makefiles, 'make -s' helps too
 # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
 
+#-----------------------------------------------------------------------------
+# Set policy
+
+# see "cmake --help-policy CMP0003"
+# So library linking is more sane
+cmake_policy(SET CMP0003 NEW)
+
+# So BUILDINFO and BLENDERPATH strings are automatically quoted
+cmake_policy(SET CMP0005 NEW)
+
+# So syntax problems are errors
+cmake_policy(SET CMP0010 NEW)
+
+# Input directories must have CMakeLists.txt
+cmake_policy(SET CMP0014 NEW)
+
 #-----------------------------------------------------------------------------
 # Load some macros.
 include(build_files/cmake/macros.cmake)
@@ -499,6 +515,9 @@ if(UNIX AND NOT APPLE)
        # GNU Compiler
        if(CMAKE_COMPILER_IS_GNUCC)
                set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+       # CLang is the same as GCC for now.
+       elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+               set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
        # Intel C++ Compiler
        elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
                # think these next two are broken
@@ -691,11 +710,11 @@ elseif(WIN32)
                                ${LIBDIR}/ffmpeg/include/msvc
                        )
                        set(FFMPEG_LIBRARIES
-                               ${LIBDIR}/ffmpeg/lib/avcodec-52.lib
-                               ${LIBDIR}/ffmpeg/lib/avformat-52.lib
-                               ${LIBDIR}/ffmpeg/lib/avdevice-52.lib
-                               ${LIBDIR}/ffmpeg/lib/avutil-50.lib
-                               ${LIBDIR}/ffmpeg/lib/swscale-0.lib
+                               ${LIBDIR}/ffmpeg/lib/avcodec-53.lib
+                               ${LIBDIR}/ffmpeg/lib/avformat-53.lib
+                               ${LIBDIR}/ffmpeg/lib/avdevice-53.lib
+                               ${LIBDIR}/ffmpeg/lib/avutil-51.lib
+                               ${LIBDIR}/ffmpeg/lib/swscale-2.lib
                        )
                endif()
 
@@ -822,7 +841,7 @@ elseif(WIN32)
                if(WITH_CODEC_FFMPEG)
                        set(FFMPEG ${LIBDIR}/ffmpeg)
                        set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
-                       set(FFMPEG_LIBRARIES avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
+                       set(FFMPEG_LIBRARIES avcodec-53 avformat-53 avdevice-53 avutil-51 swscale-2)
                        set(FFMPEG_LIBPATH ${FFMPEG}/lib)
                endif()
 
index 81c12c7c318091e2ee6ce19ae4bb84dcfb1d502c..7f11397a286d6b6a74dcc89abd0f98a5451d943c 100644 (file)
@@ -166,6 +166,13 @@ if sys.platform=='win32':
 
 env.SConscriptChdir(0)
 
+# Remove major kernel version from linux platform.
+# After Linus switched kernel to new version model this major version
+# shouldn't take much sense for building rules.
+
+if re.match('linux[0-9]+', platform):
+    platform = 'linux'
+
 crossbuild = B.arguments.get('BF_CROSS', None)
 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
     platform = 'linuxcross'
@@ -262,7 +269,7 @@ if env['OURPLATFORM']=='darwin':
     else:
         print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
 
-    # for now, Mac builders must download and install the driver framework from 3Dconnexion
+    # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion
     # necessary header file lives here when installed:
     # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
     if env['WITH_BF_3DMOUSE'] == 1 and not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
@@ -551,7 +558,7 @@ if  env['OURPLATFORM']!='darwin':
                     scriptinstall.append(env.Install(dir=dir,source=source))
 
 #-- icons
-if env['OURPLATFORM']=='linux2':
+if env['OURPLATFORM']=='linux':
     iconlist = []
     icontargetlist = []
 
@@ -630,7 +637,7 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
 
 if  env['OURPLATFORM']=='darwin':
         allinstall = [blenderinstall, plugininstall, textinstall]
-elif env['OURPLATFORM']=='linux2':
+elif env['OURPLATFORM']=='linux':
         allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
 else:
         allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
index e09fecede5909868068f3112edc28f76230a72f4..07dc4a9d83163bb852f02948d0ac8452f9b056a4 100644 (file)
@@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
 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 279f2d668046ce6d4a4353a7b3b5c311a779d053..54e66e847df15880a9106845052871a22995a98b 100644 (file)
@@ -16,7 +16,7 @@ WITH_BF_COLLADA = False
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
 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 d19143385100fbd1e728f9800496d3be3d813807..5d594229d3ee848721392a31ef2b7becd323027b 100644 (file)
@@ -16,7 +16,7 @@ WITH_BF_COLLADA = False
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
 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 bdba8892bf80ddc20c2ac0781399ced0f85f4350..9c569ff44581c806d9873aeb4f97ce23315308b3 100644 (file)
@@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
 WITH_BF_FFMPEG = True
 WITH_BF_STATICFFMPEG = True
 
-BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
+BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
 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 b83a65f2466301ecf2bdaed2f458c5f08c7c2dc9..415f95a516f284161fefa298ee08a08562b2f7be 100644 (file)
@@ -108,31 +108,11 @@ 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 = []
+            bitness = '32'
 
-            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)))
+            if builder.find('win64') != -1:
+                bitness = '64'
 
             scons_options.append('BF_BITNESS=' + bitness)
 
index 5fdeb4a8ad558c237182235c004e3b0e0fa0c03f..af8d99893b4409687529e9fd984e5b2ed2864dc6 100644 (file)
@@ -72,31 +72,11 @@ 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 = []
+            bitness = '32'
 
-            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)))
+            if builder.find('win64') != -1:
+                bitness = '64'
 
             scons_options.append('BF_BITNESS=' + bitness)
 
index bfc17ae2cfe7902c00cdb765c2857be519fb02ce..e68015e36d3a1394dcff4da15950cd4fd2ebed86 100644 (file)
@@ -27,9 +27,9 @@ endif()
 
 # Write a file with the SVNVERSION define
 file(WRITE buildinfo.h.txt
-       "#define BUILD_REV ${MY_WC_REVISION}\n"
-       "#define BUILD_DATE ${BUILD_DATE}\n"
-       "#define BUILD_TIME ${BUILD_TIME}\n"
+       "#define BUILD_REV \"${MY_WC_REVISION}\"\n"
+       "#define BUILD_DATE \"${BUILD_DATE}\"\n"
+       "#define BUILD_TIME \"${BUILD_TIME}\"\n"
 )
 
 # Copy the file to the final header only if the version changes
index 27694bcb8752c59b458f92058ee75c06d515b3a7..58938c8b0b02d57b30aa3b5b78a959a60e666b69 100644 (file)
@@ -145,11 +145,6 @@ endmacro()
 
 
 macro(SETUP_LIBDIRS)
-       # see "cmake --help-policy CMP0003"
-       if(COMMAND cmake_policy)
-               cmake_policy(SET CMP0003 NEW)
-       endif()
-
        link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
 
        if(WITH_PYTHON)  #  AND NOT WITH_PYTHON_MODULE  # WIN32 needs
similarity index 98%
rename from build_files/scons/config/linux2-config.py
rename to build_files/scons/config/linux-config.py
index d8e227cfb21531da3d98a34d6a2cc1f61cff8d19..c6613ec0ac1beba9374f01d75a7a8e9e944cc7dc 100644 (file)
@@ -1,4 +1,4 @@
-LCGDIR = '../lib/linux2'
+LCGDIR = '../lib/linux'
 LIBDIR = "${LCGDIR}"
 
 BF_PYTHON_ABI_FLAGS = 'm'  # Most common for linux distros
@@ -241,8 +241,8 @@ BF_PROFILE_LINKFLAGS = ['-pg']
 BF_DEBUG = False
 BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
 
-BF_BUILDDIR = '../build/linux2'
-BF_INSTALLDIR='../install/linux2'
+BF_BUILDDIR = '../build/linux'
+BF_INSTALLDIR='../install/linux'
 
 #Link against pthread
 PLATFORM_LINKFLAGS = ['-pthread']
index 62474527825b40f7493b587455c8b48792da3274..1bdf735f4581d8276c5a2554b7b2593b04ca6643 100644 (file)
@@ -126,9 +126,10 @@ WITH_BF_BINRELOC = False
 # enable ffmpeg  support
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 BF_FFMPEG = LIBDIR + '/ffmpeg'
-BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
+BF_FFMPEG_LIB = 'avformat-53 avcodec-53 avdevice-53 avutil-51 swscale-2'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 
 WITH_BF_OPENJPEG = True
 BF_OPENJPEG = '#extern/libopenjpeg'
index 6dac29b37f719c832a865bc71c2c6c8e8367bb1d..c815b76ef73ff4412080bb5ef5aa2c0675e99a0b 100644 (file)
@@ -18,9 +18,10 @@ BF_OPENAL_LIB = 'wrap_oal'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_FFMPEG = False
-BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
+BF_FFMPEG_LIB = 'avformat-53 avcodec-53 avdevice-53 avutil-51 swscale-2'
 BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
 BF_FFMPEG_INC =  LIBDIR + '/ffmpeg/include'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 
 BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
 BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
index 4baada7f9bf9814c23366a2b4255c9af8ef87596..2f8fa297667d977ce05fec81d001aee5f6d23c66 100644 (file)
@@ -6,8 +6,8 @@ WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 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_FFMPEG_LIB = 'avformat-53.lib avcodec-53.lib avdevice-53.lib avutil-51.lib swscale-2.lib'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '3.2'
index db7c8d09af829b62dcf7be8770999608c33fea95..ba9633a6b4c4f71646ae0efb881dda35b5021f6c 100644 (file)
@@ -6,8 +6,8 @@ WITH_BF_FFMPEG = True # -DWITH_FFMPEG
 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_FFMPEG_LIB = 'avformat-53.lib avcodec-53.lib avdevice-53.lib avutil-51.lib swscale-2.lib'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '3.2'
index 6fae2785192a545092dd5befcb2a14065a0a116d..94d09732be75f45c165f2c72eba9787fb5a4ed07 100644 (file)
@@ -206,7 +206,7 @@ def setup_staticlibs(lenv):
         if lenv['WITH_BF_STATICJEMALLOC']:
             statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC'])
 
-    if lenv['OURPLATFORM']=='linux2':
+    if lenv['OURPLATFORM']=='linux':
         if lenv['WITH_BF_3DMOUSE']:
             libincs += Split(lenv['BF_3DMOUSE_LIBPATH'])
             if lenv['WITH_BF_STATIC3DMOUSE']:
@@ -277,7 +277,7 @@ def setup_syslibs(lenv):
         if not lenv['WITH_BF_STATICJEMALLOC']:
             syslibs += Split(lenv['BF_JEMALLOC_LIB'])
 
-    if lenv['OURPLATFORM']=='linux2':
+    if lenv['OURPLATFORM']=='linux':
         if lenv['WITH_BF_3DMOUSE']:
             if not lenv['WITH_BF_STATIC3DMOUSE']:
                 syslibs += Split(lenv['BF_3DMOUSE_LIB'])
@@ -364,16 +364,16 @@ def buildinfo(lenv, build_type):
 
     obj = []
     if lenv['BF_BUILDINFO']:
-        lenv.Append (CPPDEFINES = ['BUILD_TIME="%s"'%(build_time),
-                                    'BUILD_DATE="%s"'%(build_date),
-                                    'BUILD_TYPE="%s"'%(build_type),
-                                    'BUILD_REV="%s"'%(build_rev),
-                                    'NAN_BUILDINFO',
-                                    'BUILD_PLATFORM="%s:%s"'%(platform.system(), platform.architecture()[0]),
+        lenv.Append (CPPDEFINES = ['BUILD_TIME=\\"%s\\"'%(build_time),
+                                    'BUILD_DATE=\\"%s\\"'%(build_date),
+                                    'BUILD_TYPE=\\"%s\\"'%(build_type),
+                                    'BUILD_REV=\\"%s\\"'%(build_rev),
+                                    'WITH_BUILDINFO',
+                                    'BUILD_PLATFORM=\\"%s:%s\\"'%(platform.system(), platform.architecture()[0]),
                                     'BUILD_CFLAGS=\\"%s\\"'%(build_cflags),
                                     'BUILD_CXXFLAGS=\\"%s\\"'%(build_cxxflags),
                                     'BUILD_LINKFLAGS=\\"%s\\"'%(build_linkflags),
-                                    'BUILD_SYSTEM="SCons"'
+                                    'BUILD_SYSTEM=\\"SCons\\"'
                     ])
 
         lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])
@@ -775,7 +775,7 @@ class BlenderEnvironment(SConsEnvironment):
         if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
             if lenv['BF_DEBUG']:
                 lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb','/NODEFAULTLIB:libcmt'])
-        if  lenv['OURPLATFORM']=='linux2':
+        if  lenv['OURPLATFORM']=='linux':
             if lenv['WITH_BF_PYTHON']:
                 lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
         if  lenv['OURPLATFORM']=='sunos5':
index 25e0582c536f13089213fe92763045a367804df7..d222c0bcc18a11f4410eb93ca3426a593a848fc6 100644 (file)
@@ -568,7 +568,7 @@ def buildslave(target=None, source=None, env=None):
         extension = '.tar.bz2'
 
     platform = env['OURPLATFORM'].split('-')[0]
-    if platform == 'linux2':
+    if platform == 'linux':
         import platform
 
         bitness = platform.architecture()[0]
index d13ea7c036fed115d0632db360902c72d98a8cd1..ca1b392480433ed3dd3001c8a0214cd80175af10 100644 (file)
@@ -27,7 +27,7 @@ $Id$
     filenames have the form (platform)-config.py, where platform one of:
 
         * darwin
-        * linux2
+        * linux
         * win32-mingw
         * win32-vc
 
index b4d9a90588500a290577c4bd54d840ada422a31c..9d018bcc7905f0a3a81abefc44d973264a257c5b 100644 (file)
@@ -76,7 +76,7 @@ $Id$
     $BLENDERHOME/config. Your platform specific defaults are in
     (platform)-config.py, where platform is one of:
 
-        - linux2, for machines running Linux
+        - linux, for machines running Linux
         - win32-vc, for Windows machines, compiling with a Microsoft compiler
         - win32-mingw, for Windows machines, compiling with the MingW compiler
         - darwin, for OS X machines
diff --git a/doc/python_api/examples/bpy.types.ID.user_clear.1.py b/doc/python_api/examples/bpy.types.ID.user_clear.1.py
new file mode 100644 (file)
index 0000000..68c35ca
--- /dev/null
@@ -0,0 +1,19 @@
+"""
+User Clear
+++++++++++
+This function is for advanced use only, misuse can crash blender since the user
+count is used to prevent data being removed when it is used.
+"""
+
+# This example shows what _not_ to do, and will crash blender.
+import bpy
+
+# object which is in the scene.
+obj = bpy.data.objects["Cube"]
+
+# without this, removal would raise an error.
+obj.user_clear()
+
+# runs without an exception
+# but will crash on redraw.
+bpy.data.objects.remove(obj)
index f8561c719bcc9cceec8379e00bbbb005202e3d68..a20e799811bca283542b5e01b3af92de956d1d86 100644 (file)
@@ -74,10 +74,10 @@ else:
         "bpy.props",
         "bpy.utils",
         "bpy.context",
-        "bpy.types",  # supports filtering
+        #"bpy.types",  # supports filtering
         "bpy.ops",  # supports filtering
         "bpy_extras",
-        "bge",
+        "bge",
         "aud",
         "bgl",
         "blf",
@@ -85,7 +85,7 @@ else:
         "mathutils.geometry",
     )
 
-    FILTER_BPY_TYPES = ("bpy_struct", "Panel", "Menu", "Operator", "RenderEngine")  # allow
+    FILTER_BPY_TYPES = ("bpy_struct", "Panel", "ID")  # allow
     FILTER_BPY_OPS = ("import.scene", )  # allow
 
     # for quick rebuilds
@@ -744,6 +744,8 @@ def pyrna2sphinx(BASEPATH):
                         descr = prop.name
                     fw("         `%s`, %s, %s\n\n" % (prop.identifier, descr, type_descr))
 
+            write_example_ref("      ", fw, "bpy.types." + struct.identifier + "." + func.identifier)
+
             fw("\n")
 
         # python methods
index 5cb9185d6a1903b15fd13ba0a8e8129fe6bd8b5b..fa00ad7bc2eebb307f6d3a263213b60e7b0c95db 100644 (file)
@@ -11,10 +11,10 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
     defs += ' WIN32 NDEBUG _WINDOWS'
     #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
     cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6', '/O3', '/EHcs']
-elif env['OURPLATFORM']=='win32-mingw':
+elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
     defs += ' NDEBUG'
     cflags += ['-O2']
-elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5':
+elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'):
     defs += ' NDEBUG'
     cflags += ['-O2']
 elif sys.platform=='darwin':
index 234fc0a172e1685fe1b27718b09664b31f5f874f..82f65c1c8ae45f58b4b85da80469979057d34434 100644 (file)
@@ -26,7 +26,7 @@ if env['WITH_GHOST_SDL']:
             pass
     incs += ' ' + env['BF_SDL_INC']
     defs += ['WITH_GHOST_SDL']
-elif window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'):
+elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'):
     for f in pf:
         try:
             sources.remove('intern' + os.sep + f + 'Win32.cpp')
@@ -81,7 +81,7 @@ else:
 if env['WITH_BF_3DMOUSE']:
     defs.append('WITH_INPUT_NDOF')
 
-    if env['OURPLATFORM']=='linux2':
+    if env['OURPLATFORM']=='linux':
         incs += ' ' + env['BF_3DMOUSE_INC']
 else:
     sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
index e9897f30104c2122ae84de83f3c28dee395b0011..5e85808b5a6d051da85c9cc6911b00cd563a4805 100644 (file)
@@ -43,6 +43,7 @@ public:
        // whether multi-axis functionality is available (via the OS or driver)
        // does not imply that a device is plugged in or being used
        bool available();
+       bool oldDRV();
 
 private:
        unsigned short m_clientID;
index 409ed953134b517286d2666517da8849bb7349e1..f665f5f6b39084e4ce859235227f8e7312beda31 100644 (file)
@@ -143,7 +143,7 @@ GHOST_NDOFManagerCocoa::GHOST_NDOFManagerCocoa(GHOST_System& sys)
 
                // printf("ndof: client id = %d\n", m_clientID);
 
-               if (SetConnexionClientButtonMask != NULL) {
+               if (oldDRV()) {
                        has_old_driver = false;
                        SetConnexionClientButtonMask(m_clientID, kConnexionMaskAllButtons);
                }
@@ -176,5 +176,14 @@ extern "C" {
                return InstallConnexionHandlers != NULL;
                // this means that the driver is installed and dynamically linked to blender
        }
+
+       bool GHOST_NDOFManagerCocoa::oldDRV()
+       {
+               extern OSErr SetConnexionClientButtonMask() __attribute__((weak_import));
+               // Make the linker happy for the framework check (see link below for more info)
+               // http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html
+               return SetConnexionClientButtonMask != NULL;
+               // this means that the driver has this symbol
+       }
 }
 #endif // WITH_INPUT_NDOF
index c965169ff04cdb267a43dd2abff40d21a1aaa410..4b5e3eeb066c9c925bb35692b82422b7c5dd86c1 100644 (file)
@@ -426,7 +426,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
         # See if its flipped the wrong way.
         flip = None
         for fi in fill:
-            if flip != None:
+            if flip is not None:
                 break
             for i, vi in enumerate(fi):
                 if vi == 0 and fi[i - 1] == 1:
index 1c4518c4feb11c401440610e0d1a510b8595917f..056b3478c2b49c17e1562c7df516b606d2c37c01 100644 (file)
@@ -88,36 +88,62 @@ class AddTorus(Operator):
     bl_label = "Add Torus"
     bl_options = {'REGISTER', 'UNDO'}
 
-    major_radius = FloatProperty(name="Major Radius",
+    major_radius = FloatProperty(
+            name="Major Radius",
             description=("Radius from the origin to the "
                          "center of the cross sections"),
-            default=1.0, min=0.01, max=100.0)
-    minor_radius = FloatProperty(name="Minor Radius",
+            min=0.01, max=100.0,
+            default=1.0,
+            )
+    minor_radius = FloatProperty(
+            name="Minor Radius",
             description="Radius of the torus' cross section",
-            default=0.25, min=0.01, max=100.0)
-    major_segments = IntProperty(name="Major Segments",
+            min=0.01, max=100.0,
+            default=0.25,
+            )
+    major_segments = IntProperty(
+            name="Major Segments",
             description="Number of segments for the main ring of the torus",
-            default=48, min=3, max=256)
-    minor_segments = IntProperty(name="Minor Segments",
+            min=3, max=256,
+            default=48,
+            )
+    minor_segments = IntProperty(
+            name="Minor Segments",
             description="Number of segments for the minor ring of the torus",
-            default=12, min=3, max=256)
-    use_abso = BoolProperty(name="Use Int+Ext Controls",
+            min=3, max=256,
+            default=12,
+            )
+    use_abso = BoolProperty(
+            name="Use Int+Ext Controls",
             description="Use the Int / Ext controls for torus dimensions",
-            default=False)
-    abso_major_rad = FloatProperty(name="Exterior Radius",
+            default=False,
+            )
+    abso_major_rad = FloatProperty(
+            name="Exterior Radius",
             description="Total Exterior Radius of the torus",
-            default=1.0, min=0.01, max=100.0)
-    abso_minor_rad = FloatProperty(name="Inside Radius",
+            min=0.01, max=100.0,
+            default=1.0,
+            )
+    abso_minor_rad = FloatProperty(
+            name="Inside Radius",
             description="Total Interior Radius of the torus",
-            default=0.5, min=0.01, max=100.0)
+            min=0.01, max=100.0,
+            default=0.5,
+            )
 
     # generic transform props
-    view_align = BoolProperty(name="Align to View",
-            default=False)
-    location = FloatVectorProperty(name="Location",
-            subtype='TRANSLATION')
-    rotation = FloatVectorProperty(name="Rotation",
-            subtype='EULER')
+    view_align = BoolProperty(
+            name="Align to View",
+            default=False,
+            )
+    location = FloatVectorProperty(
+            name="Location",
+            subtype='TRANSLATION',
+            )
+    rotation = FloatVectorProperty(
+            name="Rotation",
+            subtype='EULER',
+            )
 
     def execute(self, context):
 
index 4114381f3dc3e484cbdca66dd2a133368fd95f63..5f6583754e97eb05035323a83f3b22583b489e2a 100644 (file)
@@ -74,11 +74,11 @@ class MeshMirrorUV(Operator):
     bl_label = "Copy Mirrored UV coords"
     bl_options = {'REGISTER', 'UNDO'}
 
-    direction = EnumProperty(items=(
-                        ('POSITIVE', "Positive", ""),
-                        ('NEGATIVE', "Negative", "")),
-                name="Axis Direction",
-                description="")
+    direction = EnumProperty(
+            name="Axis Direction",
+            items=(('POSITIVE', "Positive", ""),
+                   ('NEGATIVE', "Negative", "")),
+            )
 
     @classmethod
     def poll(cls, context):
index 44ed846e530053c0acef8cff618ca7f7f2318915..714b889da26f4cae637e5e3a7a3c6993f69dde3d 100644 (file)
@@ -84,6 +84,7 @@ def bake(frame_start,
          do_pose=True,
          do_object=True,
          do_constraint_clear=False,
+         action=None,
          ):
 
     scene = bpy.context.scene
@@ -121,7 +122,8 @@ def bake(frame_start,
 
     # incase animation data hassnt been created
     atd = obj.animation_data_create()
-    action = bpy.data.actions.new("Action")
+    if action is None:
+        action = bpy.data.actions.new("Action")
     atd.action = action
 
     if do_pose:
index 79f57990f370e02274948ccdeacff43fa7d4665b..d26ec53e4e31d240653e02558e612ed9d7526dac 100644 (file)
@@ -195,8 +195,12 @@ class SubdivisionSet(Operator):
     bl_label = "Subdivision Set"
     bl_options = {'REGISTER', 'UNDO'}
 
-    level = IntProperty(name="Level",
-            default=1, min=-100, max=100, soft_min=-6, soft_max=6)
+    level = IntProperty(
+            name="Level",
+            min=-100, max=100,
+            soft_min=-6, soft_max=6,
+            default=1,
+            )
 
     relative = BoolProperty(
             name="Relative",
index d4a3d826f2f5c47d6538ee2dd8d2af8517ab9598..50e9bfb5b98345270d40962d2299f47c5916b6a3 100644 (file)
@@ -351,33 +351,34 @@ class AlignObjects(Operator):
             description=("Enables high quality calculation of the "
                          "bounding box for perfect results on complex "
                          "shape meshes with rotation/scale (Slow)"),
-            default=True)
-
-    align_mode = EnumProperty(items=(
-            ('OPT_1', "Negative Sides", ""),
-            ('OPT_2', "Centers", ""),
-            ('OPT_3', "Positive Sides", "")),
-        name="Align Mode:",
-        description="",
-        default='OPT_2')
-
-    relative_to = EnumProperty(items=(
-            ('OPT_1', "Scene Origin", ""),
-            ('OPT_2', "3D Cursor", ""),
-            ('OPT_3', "Selection", ""),
-            ('OPT_4', "Active", "")),
-        name="Relative To:",
-        description="",
-        default='OPT_4')
-
-    align_axis = EnumProperty(items=(
-            ('X', "X", ""),
-            ('Y', "Y", ""),
-            ('Z', "Z", ""),
-            ),
-                name="Align",
-                description="Align to axis",
-                options={'ENUM_FLAG'})
+            default=True,
+            )
+    align_mode = EnumProperty(
+            name="Align Mode:",
+            items=(('OPT_1', "Negative Sides", ""),
+                   ('OPT_2', "Centers", ""),
+                   ('OPT_3', "Positive Sides", ""),
+                   ),
+            default='OPT_2',
+            )
+    relative_to = EnumProperty(
+            name="Relative To:",
+            items=(('OPT_1', "Scene Origin", ""),
+                   ('OPT_2', "3D Cursor", ""),
+                   ('OPT_3', "Selection", ""),
+                   ('OPT_4', "Active", ""),
+                   ),
+            default='OPT_4',
+            )
+    align_axis = EnumProperty(
+            name="Align",
+            description="Align to axis",
+            items=(('X', "X", ""),
+                   ('Y', "Y", ""),
+                   ('Z', "Z", ""),
+                   ),
+            options={'ENUM_FLAG'},
+            )
 
     @classmethod
     def poll(cls, context):
index cd206da3a8ee4f5ee4b7da0b0973d2c2a23584b6..48b547980d4b6bd8dbffff4801532ae37891fd90 100644 (file)
@@ -51,19 +51,25 @@ class QuickFur(Operator):
     bl_label = "Quick Fur"
     bl_options = {'REGISTER', 'UNDO'}
 
-    density = EnumProperty(items=(
-                        ('LIGHT', "Light", ""),
-                        ('MEDIUM', "Medium", ""),
-                        ('HEAVY', "Heavy", "")),
-                name="Fur Density",
-                description="",
-                default='MEDIUM')
-
-    view_percentage = IntProperty(name="View %",
-            default=10, min=1, max=100, soft_min=1, soft_max=100)
-
-    length = FloatProperty(name="Length",
-            default=0.1, min=0.001, max=100, soft_min=0.01, soft_max=10)
+    density = EnumProperty(
+            name="Fur Density",
+            items=(('LIGHT', "Light", ""),
+                   ('MEDIUM', "Medium", ""),
+                   ('HEAVY', "Heavy", "")),
+            default='MEDIUM',
+            )
+    view_percentage = IntProperty(
+            name="View %",
+            min=1, max=100,
+            soft_min=1, soft_max=100,
+            default=10,
+            )
+    length = FloatProperty(
+            name="Length",
+            min=0.001, max=100,
+            soft_min=0.01, soft_max=10,
+            default=0.1,
+            )
 
     def execute(self, context):
         fake_context = bpy.context.copy()
@@ -110,31 +116,50 @@ class QuickExplode(Operator):
     bl_label = "Quick Explode"
     bl_options = {'REGISTER', 'UNDO'}
 
-    style = EnumProperty(items=(
-                        ('EXPLODE', "Explode", ""),
-                        ('BLEND', "Blend", "")),
-                name="Explode Style",
-                description="",
-                default='EXPLODE')
-
-    amount = IntProperty(name="Amount of pieces",
-            default=100, min=2, max=10000, soft_min=2, soft_max=10000)
-
-    frame_duration = IntProperty(name="Duration",
-            default=50, min=1, max=300000, soft_min=1, soft_max=10000)
-
-    frame_start = IntProperty(name="Start Frame",
-            default=1, min=1, max=300000, soft_min=1, soft_max=10000)
+    style = EnumProperty(
+            name="Explode Style",
+            items=(('EXPLODE', "Explode", ""),
+                   ('BLEND', "Blend", "")),
+            default='EXPLODE',
+            )
+    amount = IntProperty(
+            name="Amount of pieces",
+            min=2, max=10000,
+            soft_min=2, soft_max=10000,
+            default=100,
+            )
+    frame_duration = IntProperty(
+            name="Duration",
+            min=1, max=300000,
+            soft_min=1, soft_max=10000,
+            default=50,
+            )
 
-    frame_end = IntProperty(name="End Frame",
-            default=10, min=1, max=300000, soft_min=1, soft_max=10000)
+    frame_start = IntProperty(
+            name="Start Frame",
+            min=1, max=300000,
+            soft_min=1, soft_max=10000,
+            default=1,
+            )
+    frame_end = IntProperty(
+            name="End Frame",
+            min=1, max=300000,
+            soft_min=1, soft_max=10000,
+            default=10,
+            )
 
-    velocity = FloatProperty(name="Outwards Velocity",
-            default=1, min=0, max=300000, soft_min=0, soft_max=10)
+    velocity = FloatProperty(
+            name="Outwards Velocity",
+            min=0, max=300000,
+            soft_min=0, soft_max=10,
+            default=1,
+            )
 
-    fade = BoolProperty(name="Fade",
-                description="Fade the pieces over time.",
-                default=True)
+    fade = BoolProperty(
+            name="Fade",
+            description="Fade the pieces over time.",
+            default=True,
+            )
 
     def execute(self, context):
         fake_context = bpy.context.copy()
@@ -272,12 +297,11 @@ class QuickSmoke(Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     style = EnumProperty(
+            name="Smoke Style",
             items=(('STREAM', "Stream", ""),
                    ('PUFF', "Puff", ""),
                    ('FIRE', "Fire", ""),
                    ),
-            name="Smoke Style",
-            description="",
             default='STREAM',
             )
 
@@ -390,19 +414,16 @@ class QuickFluid(Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     style = EnumProperty(
+            name="Fluid Style",
             items=(('INFLOW', "Inflow", ""),
-                   ('BASIC', "Basic", ""),
-                   ),
-                name="Fluid Style",
-                description="",
-                default='BASIC',
-                )
+                   ('BASIC', "Basic", "")),
+            default='BASIC',
+            )
     initial_velocity = FloatVectorProperty(
             name="Initial Velocity",
             description="Initial velocity of the fluid",
+            min=-100.0, max=100.0,
             default=(0.0, 0.0, 0.0),
-            min=-100.0,
-            max=100.0,
             subtype='VELOCITY',
             )
     show_flows = BoolProperty(
index f65e3d27d830c37cdb680977bb86c59733fd6d45..7aea18487f3467e681f7bf0d4ff46f32b7b3e822 100644 (file)
@@ -145,9 +145,12 @@ class RandomizeLocRotSize(Operator):
             default=False,
             )
 
-    '''scale_min = FloatProperty(name="Minimun Scale Factor",
-        description="Lowest scale percentage possible",
-        default=0.15, min=-1.0, max=1.0, precision=3)'''
+    '''scale_min = FloatProperty(
+            name="Minimun Scale Factor",
+            description="Lowest scale percentage possible",
+            min=-1.0, max=1.0, precision=3,
+            default=0.15,
+            )'''
 
     scale = FloatVectorProperty(
             name="Scale",
index d2f85c8d7c715d1b88f70841301922e96efde671..856e182279a02233658421c8626c5f477c7e4109 100644 (file)
@@ -82,8 +82,12 @@ class SequencerCutMulticam(Operator):
     bl_label = "Cut multicam"
     bl_options = {'REGISTER', 'UNDO'}
 
-    camera = IntProperty(name="Camera",
-            default=1, min=1, max=32, soft_min=1, soft_max=32)
+    camera = IntProperty(
+            name="Camera",
+            min=1, max=32,
+            soft_min=1, soft_max=32,
+            default=1,
+            )
 
     @classmethod
     def poll(cls, context):
index 6b1c6e1be9801d551e48459b8f1779ca1fa5ae6a..060fe400045d03a5beef95f776387a0a3573fcff 100644 (file)
@@ -552,7 +552,6 @@ class LightMapPack(Operator):
 
     PREF_CONTEXT = bpy.props.EnumProperty(
             name="Selection",
-            description="",
             items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"),
                    ("ALL_FACES", "All Faces", "Average space UVs edge length of each loop"),
                    ("ALL_OBJECTS", "Selected Mesh Object", "Average space UVs edge length of each loop")
index 8afd6c104e072c31d788f861be35cac2ec016705..23838588f43992d7235c38fa2ff00ba64bff8af8 100644 (file)
@@ -178,7 +178,7 @@ def pointInEdges(pt, edges):
     intersectCount = 0
     for ed in edges:
         xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1])
-        if xi != None: # Is there an intersection.
+        if xi is not None: # Is there an intersection.
             intersectCount+=1
 
     return intersectCount % 2
@@ -1110,21 +1110,28 @@ class SmartProject(Operator):
     bl_label = "Smart UV Project"
     bl_options = {'REGISTER', 'UNDO'}
 
-    angle_limit = FloatProperty(name="Angle Limit",
+    angle_limit = FloatProperty(
+            name="Angle Limit",
             description="lower for more projection groups, higher for less distortion",
-            default=66.0, min=1.0, max=89.0)
-
-    island_margin = FloatProperty(name="Island Margin",
+            min=1.0, max=89.0,
+            default=66.0,
+            )
+    island_margin = FloatProperty(
+            name="Island Margin",
             description="Margin to reduce bleed from adjacent islands",
-            default=0.0, min=0.0, max=1.0)
-
-    user_area_weight = FloatProperty(name="Area Weight",
+            min=0.0, max=1.0,
+            default=0.0,
+            )
+    user_area_weight = FloatProperty(
+            name="Area Weight",
             description="Weight projections vector by faces with larger areas",
-            default=0.0, min=0.0, max=1.0)
+            min=0.0, max=1.0,
+            default=0.0,
+            )
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return context.active_object is not None
 
     def execute(self, context):
         main(context,
index facde82f812577133384065b6f0dc540a4ae0a2a..4c78adb7161306ad2402792e9f022edc159d6c59 100644 (file)
@@ -151,11 +151,35 @@ class VertexPaintDirt(Operator):
     bl_label = "Dirty Vertex Colors"
     bl_options = {'REGISTER', 'UNDO'}
 
-    blur_strength = FloatProperty(name="Blur Strength", description="Blur strength per iteration", default=1.0, min=0.01, max=1.0)
-    blur_iterations = IntProperty(name="Blur Iterations", description="Number times to blur the colors. (higher blurs more)", default=1, min=0, max=40)
-    clean_angle = FloatProperty(name="Highlight Angle", description="Less then 90 limits the angle used in the tonal range", default=180.0, min=0.0, max=180.0)
-    dirt_angle = FloatProperty(name="Dirt Angle", description="Less then 90 limits the angle used in the tonal range", default=0.0, min=0.0, max=180.0)
-    dirt_only = BoolProperty(name="Dirt Only", description="Dont calculate cleans for convex areas", default=False)
+    blur_strength = FloatProperty(
+            name="Blur Strength",
+            description="Blur strength per iteration",
+            min=0.01, max=1.0,
+            default=1.0,
+            )
+    blur_iterations = IntProperty(
+            name="Blur Iterations",
+            description="Number times to blur the colors. (higher blurs more)",
+            min=0, max=40,
+            default=1,
+            )
+    clean_angle = FloatProperty(
+            name="Highlight Angle",
+            description="Less then 90 limits the angle used in the tonal range",
+            min=0.0, max=180.0,
+            default=180.0,
+            )
+    dirt_angle = FloatProperty(
+            name="Dirt Angle",
+            description="Less then 90 limits the angle used in the tonal range",
+            min=0.0, max=180.0,
+            default=0.0,
+            )
+    dirt_only = BoolProperty(
+            name="Dirt Only",
+            description="Dont calculate cleans for convex areas",
+            default=False,
+            )
 
     def execute(self, context):
         import time
index fe75c54e60e6039990c7fce268b0e10efe64e555..aa09a088c4fc246a15f334f42f9cd5421291036e 100644 (file)
 
 import bpy
 from bpy.types import Menu, Operator
-from bpy.props import StringProperty, BoolProperty, IntProperty, \
-                      FloatProperty, EnumProperty
+from bpy.props import (StringProperty,
+                       BoolProperty,
+                       IntProperty,
+                       FloatProperty,
+                       EnumProperty,
+                       )
 
 from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
 
@@ -39,23 +43,30 @@ class MESH_OT_delete_edgeloop(Operator):
 
         return {'CANCELLED'}
 
-rna_path_prop = StringProperty(name="Context Attributes",
-        description="rna context string", maxlen=1024, default="")
+rna_path_prop = StringProperty(
+        name="Context Attributes",
+        description="rna context string",
+        maxlen=1024,
+        )
 
-rna_reverse_prop = BoolProperty(name="Reverse",
-        description="Cycle backwards", default=False)
+rna_reverse_prop = BoolProperty(
+        name="Reverse",
+        description="Cycle backwards",
+        default=False,
+        )
 
-rna_relative_prop = BoolProperty(name="Relative",
+rna_relative_prop = BoolProperty(
+        name="Relative",
         description="Apply relative to the current value (delta)",
-        default=False)
+        default=False,
+        )
 
 
 def context_path_validate(context, data_path):
-    import sys
     try:
         value = eval("context.%s" % data_path) if data_path else Ellipsis
-    except AttributeError:
-        if "'NoneType'" in str(sys.exc_info()[1]):
+    except AttributeError as e:
+        if str(e).startswith("'NoneType'"):
             # One of the items in the rna path is None, just ignore this
             value = Ellipsis
         else:
@@ -65,16 +76,65 @@ def context_path_validate(context, data_path):
     return value
 
 
+def operator_value_is_undo(value):
+    if value in {None, Ellipsis}:
+        return False
+
+    # typical properties or objects
+    id_data = getattr(value, "id_data", Ellipsis)
+
+    if id_data is None:
+        return False
+    elif id_data is Ellipsis:
+        # handle mathutils types
+        id_data = getattr(getattr(value, "owner", None), "id_data", None)
+
+        if id_data is None:
+            return False
+
+    # return True if its a non window ID type
+    return (isinstance(id_data, bpy.types.ID) and
+            (not isinstance(id_data, (bpy.types.WindowManager,
+                                      bpy.types.Screen,
+                                      bpy.types.Scene,
+                                      bpy.types.Brush,
+                                      ))))
+
+
+def operator_path_is_undo(context, data_path):
+    # note that if we have data paths that use strings this could fail
+    # luckily we dont do this!
+    #
+    # When we cant find the data owner assume no undo is needed.
+    data_path_head, data_path_sep, data_path_tail = data_path.rpartition(".")
+
+    if not data_path_head:
+        return False
+
+    value = context_path_validate(context, data_path_head)
+
+    return operator_value_is_undo(value)
+
+
+def operator_path_undo_return(context, data_path):
+    return {'FINISHED'} if operator_path_is_undo(context, data_path) else {'CANCELLED'}
+
+
+def operator_value_undo_return(value):
+    return {'FINISHED'} if operator_value_is_undo(value) else {'CANCELLED'}
+
+
 def execute_context_assign(self, context):
-    if context_path_validate(context, self.data_path) is Ellipsis:
+    data_path = self.data_path
+    if context_path_validate(context, data_path) is Ellipsis:
         return {'PASS_THROUGH'}
 
     if getattr(self, "relative", False):
-        exec("context.%s+=self.value" % self.data_path)
+        exec("context.%s += self.value" % data_path)
     else:
-        exec("context.%s=self.value" % self.data_path)
+        exec("context.%s = self.value" % data_path)
 
-    return {'FINISHED'}
+    return operator_path_undo_return(context, data_path)
 
 
 class BRUSH_OT_active_index_set(Operator):
@@ -82,15 +142,21 @@ class BRUSH_OT_active_index_set(Operator):
     bl_idname = "brush.active_index_set"
     bl_label = "Set Brush Number"
 
-    mode = StringProperty(name="mode",
-            description="Paint mode to set brush for", maxlen=1024)
-    index = IntProperty(name="number",
-            description="Brush number")
+    mode = StringProperty(
+            name="mode",
+            description="Paint mode to set brush for",
+            maxlen=1024,
+            )
+    index = IntProperty(
+            name="number",
+            description="Brush number",
+            )
 
     _attr_dict = {"sculpt": "use_paint_sculpt",
                   "vertex_paint": "use_paint_vertex",
                   "weight_paint": "use_paint_weight",
-                  "image_paint": "use_paint_image"}
+                  "image_paint": "use_paint_image",
+                  }
 
     def execute(self, context):
         attr = self._attr_dict.get(self.mode)
@@ -112,8 +178,11 @@ class WM_OT_context_set_boolean(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = BoolProperty(name="Value",
-            description="Assignment value", default=True)
+    value = BoolProperty(
+            name="Value",
+            description="Assignment value",
+            default=True,
+            )
 
     execute = execute_context_assign
 
@@ -125,7 +194,11 @@ class WM_OT_context_set_int(Operator):  # same as enum
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = IntProperty(name="Value", description="Assign value", default=0)
+    value = IntProperty(
+            name="Value",
+            description="Assign value",
+            default=0,
+            )
     relative = rna_relative_prop
 
     execute = execute_context_assign
@@ -138,17 +211,23 @@ class WM_OT_context_scale_int(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = FloatProperty(name="Value", description="Assign value", default=1.0)
-    always_step = BoolProperty(name="Always Step",
-        description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
-        default=True)
+    value = FloatProperty(
+            name="Value",
+            description="Assign value",
+            default=1.0,
+            )
+    always_step = BoolProperty(
+            name="Always Step",
+            description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
+            default=True,
+            )
 
     def execute(self, context):
-        if context_path_validate(context, self.data_path) is Ellipsis:
+        data_path = self.data_path
+        if context_path_validate(context, data_path) is Ellipsis:
             return {'PASS_THROUGH'}
 
         value = self.value
-        data_path = self.data_path
 
         if value == 1.0:  # nothing to do
             return {'CANCELLED'}
@@ -160,11 +239,12 @@ class WM_OT_context_scale_int(Operator):
             else:
                 add = "-1"
                 func = "min"
-            exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (data_path, func, data_path, data_path, add))
+            exec("context.%s = %s(round(context.%s * value), context.%s + %s)" %
+                 (data_path, func, data_path, data_path, add))
         else:
-            exec("context.%s *= value" % self.data_path)
+            exec("context.%s *= value" % data_path)
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_set_float(Operator):  # same as enum
@@ -174,8 +254,11 @@ class WM_OT_context_set_float(Operator):  # same as enum
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = FloatProperty(name="Value",
-            description="Assignment value", default=0.0)
+    value = FloatProperty(
+            name="Value",
+            description="Assignment value",
+            default=0.0,
+            )
     relative = rna_relative_prop
 
     execute = execute_context_assign
@@ -188,8 +271,11 @@ class WM_OT_context_set_string(Operator):  # same as enum
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = StringProperty(name="Value",
-            description="Assign value", maxlen=1024, default="")
+    value = StringProperty(
+            name="Value",
+            description="Assign value",
+            maxlen=1024,
+            )
 
     execute = execute_context_assign
 
@@ -201,9 +287,11 @@ class WM_OT_context_set_enum(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = StringProperty(name="Value",
+    value = StringProperty(
+            name="Value",
             description="Assignment value (as a string)",
-            maxlen=1024, default="")
+            maxlen=1024,
+            )
 
     execute = execute_context_assign
 
@@ -215,15 +303,18 @@ class WM_OT_context_set_value(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = StringProperty(name="Value",
+    value = StringProperty(
+            name="Value",
             description="Assignment value (as a string)",
-            maxlen=1024, default="")
+            maxlen=1024,
+            )
 
     def execute(self, context):
-        if context_path_validate(context, self.data_path) is Ellipsis:
+        data_path = self.data_path
+        if context_path_validate(context, data_path) is Ellipsis:
             return {'PASS_THROUGH'}
-        exec("context.%s=%s" % (self.data_path, self.value))
-        return {'FINISHED'}
+        exec("context.%s = %s" % (data_path, self.value))
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_toggle(Operator):
@@ -235,14 +326,14 @@ class WM_OT_context_toggle(Operator):
     data_path = rna_path_prop
 
     def execute(self, context):
+        data_path = self.data_path
 
-        if context_path_validate(context, self.data_path) is Ellipsis:
+        if context_path_validate(context, data_path) is Ellipsis:
             return {'PASS_THROUGH'}
 
-        exec("context.%s=not (context.%s)" %
-            (self.data_path, self.data_path))
+        exec("context.%s = not (context.%s)" % (data_path, data_path))
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_toggle_enum(Operator):
@@ -252,23 +343,30 @@ class WM_OT_context_toggle_enum(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value_1 = StringProperty(name="Value", \
-                description="Toggle enum", maxlen=1024, default="")
-
-    value_2 = StringProperty(name="Value", \
-                description="Toggle enum", maxlen=1024, default="")
+    value_1 = StringProperty(
+            name="Value",
+            description="Toggle enum",
+            maxlen=1024,
+            )
+    value_2 = StringProperty(
+            name="Value",
+            description="Toggle enum",
+            maxlen=1024,
+            )
 
     def execute(self, context):
+        data_path = self.data_path
 
-        if context_path_validate(context, self.data_path) is Ellipsis:
+        if context_path_validate(context, data_path) is Ellipsis:
             return {'PASS_THROUGH'}
 
-        exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
-            (self.data_path, self.value_1,\
-             self.value_2, self.data_path,
-             self.value_2))
+        exec("context.%s = ('%s', '%s')[context.%s != '%s']" %
+             (data_path, self.value_1,
+              self.value_2, data_path,
+              self.value_2,
+              ))
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_cycle_int(Operator):
@@ -292,7 +390,7 @@ class WM_OT_context_cycle_int(Operator):
         else:
             value += 1
 
-        exec("context.%s=value" % data_path)
+        exec("context.%s = value" % data_path)
 
         if value != eval("context.%s" % data_path):
             # relies on rna clamping int's out of the range
@@ -301,9 +399,9 @@ class WM_OT_context_cycle_int(Operator):
             else:
                 value = -1 << 31
 
-            exec("context.%s=value" % data_path)
+            exec("context.%s = value" % data_path)
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_cycle_enum(Operator):
@@ -316,15 +414,15 @@ class WM_OT_context_cycle_enum(Operator):
     reverse = rna_reverse_prop
 
     def execute(self, context):
-
-        value = context_path_validate(context, self.data_path)
+        data_path = self.data_path
+        value = context_path_validate(context, data_path)
         if value is Ellipsis:
             return {'PASS_THROUGH'}
 
         orig_value = value
 
         # Have to get rna enum values
-        rna_struct_str, rna_prop_str = self.data_path.rsplit('.', 1)
+        rna_struct_str, rna_prop_str = data_path.rsplit('.', 1)
         i = rna_prop_str.find('[')
 
         # just incse we get "context.foo.bar[0]"
@@ -354,8 +452,8 @@ class WM_OT_context_cycle_enum(Operator):
                 advance_enum = enums[orig_index + 1]
 
         # set the new value
-        exec("context.%s=advance_enum" % self.data_path)
-        return {'FINISHED'}
+        exec("context.%s = advance_enum" % data_path)
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_OT_context_cycle_array(Operator):
@@ -381,9 +479,9 @@ class WM_OT_context_cycle_array(Operator):
                 array.append(array.pop(0))
             return array
 
-        exec("context.%s=cycle(context.%s[:])" % (data_path, data_path))
+        exec("context.%s = cycle(context.%s[:])" % (data_path, data_path))
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
 class WM_MT_context_menu_enum(Menu):
@@ -426,8 +524,11 @@ class WM_OT_context_set_id(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
-    value = StringProperty(name="Value",
-            description="Assign value", maxlen=1024, default="")
+    value = StringProperty(
+            name="Value",
+            description="Assign value",
+            maxlen=1024,
+            )
 
     def execute(self, context):
         value = self.value
@@ -449,16 +550,21 @@ class WM_OT_context_set_id(Operator):
 
         if id_iter:
             value_id = getattr(bpy.data, id_iter).get(value)
-            exec("context.%s=value_id" % data_path)
+            exec("context.%s = value_id" % data_path)
 
-        return {'FINISHED'}
+        return operator_path_undo_return(context, data_path)
 
 
-doc_id = StringProperty(name="Doc ID",
-        description="", maxlen=1024, default="", options={'HIDDEN'})
+doc_id = StringProperty(
+        name="Doc ID",
+        maxlen=1024,
+        options={'HIDDEN'},
+        )
 
-doc_new = StringProperty(name="Edit Description",
-        description="", maxlen=1024, default="")
+doc_new = StringProperty(
+        name="Edit Description",
+        maxlen=1024,
+        )
 
 data_path_iter = StringProperty(
         description="The data path relative to the context, must point to an iterable.")
@@ -476,12 +582,13 @@ class WM_OT_context_collection_boolean_set(Operator):
     data_path_iter = data_path_iter
     data_path_item = data_path_item
 
-    type = EnumProperty(items=(
-            ('TOGGLE', "Toggle", ""),
-            ('ENABLE', "Enable", ""),
-            ('DISABLE', "Disable", ""),
-            ),
-        name="Type")
+    type = EnumProperty(
+            name="Type",
+            items=(('TOGGLE', "Toggle", ""),
+                   ('ENABLE', "Enable", ""),
+                   ('DISABLE', "Disable", ""),
+                   ),
+            )
 
     def execute(self, context):
         data_path_iter = self.data_path_iter
@@ -507,6 +614,10 @@ class WM_OT_context_collection_boolean_set(Operator):
 
             items_ok.append(item)
 
+        # avoid undo push when nothing to do
+        if not items_ok:
+            return {'CANCELLED'}
+
         if self.type == 'ENABLE':
             is_set = True
         elif self.type == 'DISABLE':
@@ -518,20 +629,26 @@ class WM_OT_context_collection_boolean_set(Operator):
         for item in items_ok:
             exec(exec_str)
 
-        return {'FINISHED'}
+        return operator_value_undo_return(item)
 
 
 class WM_OT_context_modal_mouse(Operator):
     '''Adjust arbitrary values with mouse input'''
     bl_idname = "wm.context_modal_mouse"
     bl_label = "Context Modal Mouse"
-    bl_options = {'GRAB_POINTER', 'BLOCKING', 'INTERNAL'}
+    bl_options = {'GRAB_POINTER', 'BLOCKING', 'UNDO', 'INTERNAL'}
 
     data_path_iter = data_path_iter
     data_path_item = data_path_item
 
-    input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta")
-    invert = BoolProperty(default=False, description="Invert the mouse input")
+    input_scale = FloatProperty(
+            description="Scale the mouse movement by this value before applying the delta",
+            default=0.01,
+            )
+    invert = BoolProperty(
+            description="Invert the mouse input",
+            default=False,
+            )
     initial_x = IntProperty(options={'HIDDEN'})
 
     def _values_store(self, context):
@@ -584,12 +701,13 @@ class WM_OT_context_modal_mouse(Operator):
             self._values_delta(delta)
 
         elif 'LEFTMOUSE' == event_type:
+            item = next(iter(self._values.keys()))
             self._values_clear()
-            return {'FINISHED'}
+            return operator_value_undo_return(item)
 
         elif event_type in {'RIGHTMOUSE', 'ESC'}:
             self._values_restore()
-            return {'FINISHED'}
+            return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
 
@@ -613,11 +731,13 @@ class WM_OT_url_open(Operator):
     bl_idname = "wm.url_open"
     bl_label = ""
 
-    url = StringProperty(name="URL", description="URL to open")
+    url = StringProperty(
+            name="URL",
+            description="URL to open",
+            )
 
     def execute(self, context):
         import webbrowser
-        _webbrowser_bug_fix()
         webbrowser.open(self.url)
         return {'FINISHED'}
 
@@ -627,7 +747,11 @@ class WM_OT_path_open(Operator):
     bl_idname = "wm.path_open"
     bl_label = ""
 
-    filepath = StringProperty(name="File Path", maxlen=1024, subtype='FILE_PATH')
+    filepath = StringProperty(
+            name="File Path",
+            maxlen=1024,
+            subtype='FILE_PATH',
+            )
 
     def execute(self, context):
         import sys
@@ -662,9 +786,11 @@ class WM_OT_doc_view(Operator):
 
     doc_id = doc_id
     if bpy.app.version_cycle == "release":
-        _prefix = "http://www.blender.org/documentation/blender_python_api_%s%s_release" % ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char)
+        _prefix = ("http://www.blender.org/documentation/blender_python_api_%s%s_release" %
+                   ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char))
     else:
-        _prefix = "http://www.blender.org/documentation/blender_python_api_%s" % "_".join(str(v) for v in bpy.app.version)
+        _prefix = ("http://www.blender.org/documentation/blender_python_api_%s" %
+                   "_".join(str(v) for v in bpy.app.version))
 
     def _nested_class_string(self, class_string):
         ls = []
@@ -682,8 +808,8 @@ class WM_OT_doc_view(Operator):
             class_name, class_prop = id_split
 
             if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop):
-                url = '%s/bpy.ops.%s.html#bpy.ops.%s.%s' % \
-                        (self._prefix, class_name, class_name, class_prop)
+                url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
+                       (self._prefix, class_name, class_name, class_prop))
             else:
 
                 # detect if this is a inherited member and use that name instead
@@ -696,14 +822,13 @@ class WM_OT_doc_view(Operator):
 
                 # It so happens that epydoc nests these, not sphinx
                 # class_name_full = self._nested_class_string(class_name)
-                url = '%s/bpy.types.%s.html#bpy.types.%s.%s' % \
-                        (self._prefix, class_name, class_name, class_prop)
+                url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" %
+                       (self._prefix, class_name, class_name, class_prop))
 
         else:
             return {'PASS_THROUGH'}
 
         import webbrowser
-        _webbrowser_bug_fix()
         webbrowser.open(url)
 
         return {'FINISHED'}
@@ -780,17 +905,36 @@ class WM_OT_doc_edit(Operator):
         return wm.invoke_props_dialog(self, width=600)
 
 
-rna_path = StringProperty(name="Property Edit",
-    description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
+rna_path = StringProperty(
+        name="Property Edit",
+        description="Property data_path edit",
+        maxlen=1024,
+        options={'HIDDEN'},
+        )
+
+rna_value = StringProperty(
+        name="Property Value",
+        description="Property value edit",
+        maxlen=1024,
+        )
 
-rna_value = StringProperty(name="Property Value",
-    description="Property value edit", maxlen=1024, default="")
+rna_property = StringProperty(
+        name="Property Name",
+        description="Property name edit",
+        maxlen=1024,
+        )
 
-rna_property = StringProperty(name="Property Name",
-    description="Property name edit", maxlen=1024, default="")
+rna_min = FloatProperty(
+        name="Min",
+        default=0.0,
+        precision=3,
+        )
 
-rna_min = FloatProperty(name="Min", default=0.0, precision=3)
-rna_max = FloatProperty(name="Max", default=1.0, precision=3)
+rna_max = FloatProperty(
+        name="Max",
+        default=1.0,
+        precision=3,
+        )
 
 
 class WM_OT_properties_edit(Operator):
@@ -804,7 +948,9 @@ class WM_OT_properties_edit(Operator):
     value = rna_value
     min = rna_min
     max = rna_max
-    description = StringProperty(name="Tip", default="")
+    description = StringProperty(
+            name="Tip",
+            )
 
     def execute(self, context):
         data_path = self.data_path
@@ -857,14 +1003,15 @@ class WM_OT_properties_edit(Operator):
         return {'FINISHED'}
 
     def invoke(self, context, event):
+        data_path = self.data_path
 
-        if not self.data_path:
+        if not data_path:
             self.report({'ERROR'}, "Data path not set")
             return {'CANCELLED'}
 
         self._last_prop = [self.property]
 
-        item = eval("context.%s" % self.data_path)
+        item = eval("context.%s" % data_path)
 
         # setup defaults
         prop_ui = rna_idprop_ui_prop_get(item, self.property, False)  # dont create
@@ -885,7 +1032,8 @@ class WM_OT_properties_add(Operator):
     data_path = rna_path
 
     def execute(self, context):
-        item = eval("context.%s" % self.data_path)
+        data_path = self.data_path
+        item = eval("context.%s" % data_path)
 
         def unique_name(names):
             prop = 'prop'
@@ -908,10 +1056,13 @@ class WM_OT_properties_context_change(Operator):
     bl_idname = "wm.properties_context_change"
     bl_label = ""
 
-    context = StringProperty(name="Context", maxlen=32)
+    context = StringProperty(
+            name="Context",
+            maxlen=32,
+            )
 
     def execute(self, context):
-        context.space_data.context = (self.context)
+        context.space_data.context = self.context
         return {'FINISHED'}
 
 
@@ -924,7 +1075,8 @@ class WM_OT_properties_remove(Operator):
     property = rna_property
 
     def execute(self, context):
-        item = eval("context.%s" % self.data_path)
+        data_path = self.data_path
+        item = eval("context.%s" % data_path)
         del item[self.property]
         return {'FINISHED'}
 
@@ -933,7 +1085,10 @@ class WM_OT_keyconfig_activate(Operator):
     bl_idname = "wm.keyconfig_activate"
     bl_label = "Activate Keyconfig"
 
-    filepath = StringProperty(name="File Path", maxlen=1024)
+    filepath = StringProperty(
+            name="File Path",
+            maxlen=1024,
+            )
 
     def execute(self, context):
         bpy.utils.keyconfig_set(self.filepath)
@@ -961,7 +1116,10 @@ class WM_OT_appconfig_activate(Operator):
     bl_idname = "wm.appconfig_activate"
     bl_label = "Activate Application Configuration"
 
-    filepath = StringProperty(name="File Path", maxlen=1024)
+    filepath = StringProperty(
+            name="File Path",
+            maxlen=1024,
+            )
 
     def execute(self, context):
         import os
@@ -1021,65 +1179,3 @@ class WM_OT_copy_prev_settings(Operator):
             return {'FINISHED'}
 
         return {'CANCELLED'}
-
-
-def _webbrowser_bug_fix():
-    # test for X11
-    import os
-
-    if os.environ.get("DISPLAY"):
-
-        # BSD licenced code copied from python, temp fix for bug
-        # http://bugs.python.org/issue11432, XXX == added code
-        def _invoke(self, args, remote, autoraise):
-            # XXX, added imports
-            import io
-            import subprocess
-            import time
-
-            raise_opt = []
-            if remote and self.raise_opts:
-                # use autoraise argument only for remote invocation
-                autoraise = int(autoraise)
-                opt = self.raise_opts[autoraise]
-                if opt:
-                    raise_opt = [opt]
-
-            cmdline = [self.name] + raise_opt + args
-
-            if remote or self.background:
-                inout = io.open(os.devnull, "r+")
-            else:
-                # for TTY browsers, we need stdin/out
-                inout = None
-            # if possible, put browser in separate process group, so
-            # keyboard interrupts don't affect browser as well as Python
-            setsid = getattr(os, 'setsid', None)
-            if not setsid:
-                setsid = getattr(os, 'setpgrp', None)
-
-            p = subprocess.Popen(cmdline, close_fds=True,  # XXX, stdin=inout,
-                                 stdout=(self.redirect_stdout and inout or None),
-                                 stderr=inout, preexec_fn=setsid)
-            if remote:
-                # wait five secons. If the subprocess is not finished, the
-                # remote invocation has (hopefully) started a new instance.
-                time.sleep(1)
-                rc = p.poll()
-                if rc is None:
-                    time.sleep(4)
-                    rc = p.poll()
-                    if rc is None:
-                        return True
-                # if remote call failed, open() will try direct invocation
-                return not rc
-            elif self.background:
-                if p.poll() is None:
-                    return True
-                else:
-                    return False
-            else:
-                return not p.wait()
-
-        import webbrowser
-        webbrowser.UnixBrowser._invoke = _invoke
index bf63c6071b99695bcf068a30a94785f9cb7fafe3..e1a23143bc0b75a3cdc01a4b385a256462d136ac 100644 (file)
@@ -102,7 +102,10 @@ def register():
         items.extend([(cat, cat, "") for cat in sorted(items_unique)])
         return items
 
-    WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter")
+    WindowManager.addon_search = StringProperty(
+            name="Search",
+            description="Search within the selected filter",
+            )
     WindowManager.addon_filter = EnumProperty(
             items=addon_filter_items,
             name="Category",
index f484d7b59e1a8ec7f44b0feb5e014fea42c4b07c..5255af40951d6604fba37cf071695f224eec16b0 100644 (file)
@@ -107,7 +107,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
 
         col = split.column()
 
-        if cam.dof_object != None:
+        if cam.dof_object is not None:
             col.enabled = False
         col.prop(cam, "dof_distance", text="Distance")
 
index 896b76c59f6b25a9eec87e76b208ab54c769a2f3..75df7dad5f2fc3be25a4c6df3cccc0e15cbdb936 100644 (file)
@@ -73,7 +73,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel):
         ob = context.object
         mesh = context.mesh
         space = context.space_data
-        layout.prop(context.scene.tool_settings, "mesh_select_mode", index=0, text="Vertex")
+
         if ob:
             layout.template_ID(ob, "data")
         elif mesh:
index 03243d1153ba269e041f40910163a8d80cf39e52..6f58f060504f7d93f567fffbd54015db3f59dbba 100644 (file)
@@ -156,7 +156,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
         if part:
             split = layout.split(percentage=0.65)
             if part.type == 'HAIR':
-                if psys != None and psys.is_edited:
+                if psys is not None and psys.is_edited:
                     split.operator("particle.edited_clear", text="Free Edit")
                 else:
                     row = split.row()
@@ -166,12 +166,12 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
                 row = split.row()
                 row.enabled = particle_panel_enabled(context, psys)
                 row.prop(part, "hair_step")
-                if psys != None and psys.is_edited:
+                if psys is not None and psys.is_edited:
                     if psys.is_global_hair:
                         layout.operator("particle.connect_hair")
                     else:
                         layout.operator("particle.disconnect_hair")
-            elif psys != None and part.type == 'REACTOR':
+            elif psys is not None and part.type == 'REACTOR':
                 split.enabled = particle_panel_enabled(context, psys)
                 split.prop(psys, "reactor_target_object")
                 split.prop(psys, "reactor_target_particle_system", text="Particle System")
@@ -654,7 +654,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
 
         if settings is None:
             return False
-        if psys != None and psys.point_cache.use_external:
+        if psys is not None and psys.point_cache.use_external:
             return False
         return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES
 
index ead65b92c3fe93f8b35bd7e448da9601c1c5e069..0172fbcbadd678fc5ddc6c0d391ed25384694d5a 100644 (file)
@@ -414,6 +414,10 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
             row = col.row()
             row.active = tex.use_normal_map
             row.prop(slot, "normal_map_space", text="")
+            
+            row = col.row()
+            row.active = not tex.use_normal_map
+            row.prop(tex, "use_derivative_map")
 
         col.prop(tex, "use_mipmap")
         row = col.row()
@@ -1025,12 +1029,14 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
 
             # only show bump settings if activated but not for normalmap images
             row = layout.row()
-            row.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map)
-
-            row.prop(tex, "bump_method", text="Method")
+            
+            sub = row.row()
+            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map))
+            sub.prop(tex, "bump_method", text="Method")
 
+                       # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
             sub = row.row()
-            sub.active = tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}
+            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) 
             sub.prop(tex, "bump_objectspace", text="Space")
 
 
index d457a66def8340fb239dedb58f7bf1bf7da81725..cbbefa01a3c1340cd79241dd3c56e14f83d75df9 100644 (file)
@@ -41,7 +41,7 @@ class CONSOLE_MT_console(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator("console.clear")
         layout.operator("console.copy")
         layout.operator("console.paste")
@@ -141,7 +141,11 @@ class ConsoleLanguage(Operator):
     '''Set the current language for this console'''
     bl_idname = "console.language"
     bl_label = "Console Language"
-    language = StringProperty(name="Language", maxlen=32, default="")
+
+    language = StringProperty(
+            name="Language",
+            maxlen=32,
+            )
 
     def execute(self, context):
         sc = context.space_data
index dfbd7b3ae14a14ab8fc5737f895223aa2ce7035a..ae55e1373db3964173fe294e097d20db02752eb6 100644 (file)
@@ -101,7 +101,7 @@ class DOPESHEET_HT_header(Header):
             row.menu("DOPESHEET_MT_select")
             row.menu("DOPESHEET_MT_marker")
 
-            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
+            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
                 row.menu("DOPESHEET_MT_channel")
             elif st.mode == 'GPENCIL':
                 row.menu("DOPESHEET_MT_gpencil_channel")
index 2042fa1729dc4414b8c72bbf976378a594c1d293..97b5d8457e02a668c19876133787cdbd1b684b05 100644 (file)
@@ -452,7 +452,7 @@ class IMAGE_PT_game_properties(Panel):
         split = layout.split()
 
         col = split.column()
-        
+
         col.prop(ima, "use_animation")
         sub = col.column(align=True)
         sub.active = ima.use_animation
@@ -507,7 +507,7 @@ class IMAGE_PT_view_waveform(Panel):
         layout = self.layout
 
         sima = context.space_data
-        
+
         layout.template_waveform(sima, "scopes")
         row = layout.split(percentage=0.75)
         row.prop(sima.scopes, "waveform_alpha")
@@ -544,9 +544,9 @@ class IMAGE_PT_sample_line(Panel):
 
     def draw(self, context):
         layout = self.layout
-        
+
         sima = context.space_data
-        
+
         layout.operator("image.sample_line")
         layout.template_histogram(sima, "sample_histogram")
         layout.prop(sima.sample_histogram, "mode")
@@ -564,9 +564,9 @@ class IMAGE_PT_scope_sample(Panel):
 
     def draw(self, context):
         layout = self.layout
-        
+
         sima = context.space_data
-        
+
         row = layout.row()
         row.prop(sima.scopes, "use_full_resolution")
         sub = row.row()
@@ -613,14 +613,14 @@ class IMAGE_PT_view_properties(Panel):
             col = layout.column()
             col.label("Cursor Location:")
             col.row().prop(uvedit, "cursor_location", text="")
-            
+
             col.separator()
-            
+
             col.label(text="UVs:")
             col.row().prop(uvedit, "edge_draw_type", expand=True)
 
             split = layout.split()
-            
+
             col = split.column()
             col.prop(uvedit, "show_faces")
             col.prop(uvedit, "show_smooth_edges", text="Smooth")
index 38c1e24f27ee81cfe5c7b43ffa3efd2ca97c7bec..5afc5edf6eb122eb4ea96a1ce3139588c2da5eb4 100644 (file)
@@ -194,7 +194,7 @@ class INFO_MT_mesh_add(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
         layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
@@ -215,7 +215,7 @@ class INFO_MT_curve_add(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
         layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
@@ -246,7 +246,7 @@ class INFO_MT_surface_add(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
         layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
@@ -262,7 +262,7 @@ class INFO_MT_armature_add(Menu):
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
 
index 148338368feafbe65a43a6d5dbf6987da53df8ec..13edc3471d2034b786116f4bd2763286842b91d3 100644 (file)
@@ -1106,7 +1106,10 @@ class WM_OT_addon_disable(Operator):
     bl_idname = "wm.addon_disable"
     bl_label = "Disable Add-On"
 
-    module = StringProperty(name="Module", description="Module name of the addon to disable")
+    module = StringProperty(
+            name="Module",
+            description="Module name of the addon to disable",
+            )
 
     def execute(self, context):
         addon_utils.disable(self.module)
@@ -1118,16 +1121,35 @@ class WM_OT_addon_install(Operator):
     bl_idname = "wm.addon_install"
     bl_label = "Install Add-On..."
 
-    overwrite = BoolProperty(name="Overwrite", description="Remove existing addons with the same ID", default=True)
+    overwrite = BoolProperty(
+            name="Overwrite",
+            description="Remove existing addons with the same ID",
+            default=True,
+            )
     target = EnumProperty(
             name="Target Path",
             items=(('DEFAULT', "Default", ""),
-                   ('PREFS', "User Prefs", "")))
+                   ('PREFS', "User Prefs", "")),
+            )
 
-    filepath = StringProperty(name="File Path", description="File path to write file to")
-    filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
-    filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
-    filter_glob = StringProperty(default="*.py;*.zip", options={'HIDDEN'})
+    filepath = StringProperty(
+            name="File Path",
+            description="File path to write file to",
+            )
+    filter_folder = BoolProperty(
+            name="Filter folders",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_python = BoolProperty(
+            name="Filter python",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_glob = StringProperty(
+            default="*.py;*.zip",
+            options={'HIDDEN'},
+            )
 
     @staticmethod
     def _module_remove(path_addons, module):
@@ -1264,7 +1286,10 @@ class WM_OT_addon_remove(Operator):
     bl_idname = "wm.addon_remove"
     bl_label = "Remove Add-On"
 
-    module = StringProperty(name="Module", description="Module name of the addon to remove")
+    module = StringProperty(
+            name="Module",
+            description="Module name of the addon to remove",
+            )
 
     @staticmethod
     def path_from_addon(module):
@@ -1312,7 +1337,10 @@ class WM_OT_addon_expand(Operator):
     bl_idname = "wm.addon_expand"
     bl_label = ""
 
-    module = StringProperty(name="Module", description="Module name of the addon to expand")
+    module = StringProperty(
+            name="Module",
+            description="Module name of the addon to expand",
+            )
 
     def execute(self, context):
         module_name = self.module
index 6a81ff5830ea624a5e67cb7f0d59560f23e4351c..9ed1591cbf39cdb6a76f71f03f3d12a67cfa5570 100644 (file)
@@ -533,12 +533,31 @@ class WM_OT_keyconfig_import(Operator):
     bl_idname = "wm.keyconfig_import"
     bl_label = "Import Key Configuration..."
 
-    filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
-    filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
-    filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
-    filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
-
-    keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
+    filepath = StringProperty(
+            name="File Path",
+            description="Filepath to write file to",
+            default="keymap.py",
+            )
+    filter_folder = BoolProperty(
+            name="Filter folders",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_text = BoolProperty(
+            name="Filter text",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_python = BoolProperty(
+            name="Filter python",
+            default=True,
+            options={'HIDDEN'},
+            )
+    keep_original = BoolProperty(
+            name="Keep original",
+            description="Keep original file after copying to configuration folder",
+            default=True,
+            )
 
     def execute(self, context):
         from os.path import basename
@@ -580,10 +599,26 @@ class WM_OT_keyconfig_export(Operator):
     bl_idname = "wm.keyconfig_export"
     bl_label = "Export Key Configuration..."
 
-    filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
-    filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
-    filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
-    filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
+    filepath = StringProperty(
+            name="File Path",
+            description="Filepath to write file to",
+            default="keymap.py",
+            )
+    filter_folder = BoolProperty(
+            name="Filter folders",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_text = BoolProperty(
+            name="Filter text",
+            default=True,
+            options={'HIDDEN'},
+            )
+    filter_python = BoolProperty(
+            name="Filter python",
+            default=True,
+            options={'HIDDEN'},
+            )
 
     def execute(self, context):
         if not self.filepath:
@@ -673,7 +708,10 @@ class WM_OT_keymap_restore(Operator):
     bl_idname = "wm.keymap_restore"
     bl_label = "Restore Key Map(s)"
 
-    all = BoolProperty(name="All Keymaps", description="Restore all keymaps to default")
+    all = BoolProperty(
+            name="All Keymaps",
+            description="Restore all keymaps to default",
+            )
 
     def execute(self, context):
         wm = context.window_manager
@@ -693,7 +731,10 @@ class WM_OT_keyitem_restore(Operator):
     bl_idname = "wm.keyitem_restore"
     bl_label = "Restore Key Map Item"
 
-    item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
+    item_id = IntProperty(
+            name="Item Identifier",
+            description="Identifier of the item to remove",
+            )
 
     @classmethod
     def poll(cls, context):
@@ -737,7 +778,10 @@ class WM_OT_keyitem_remove(Operator):
     bl_idname = "wm.keyitem_remove"
     bl_label = "Remove Key Map Item"
 
-    item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
+    item_id = IntProperty(
+            name="Item Identifier",
+            description="Identifier of the item to remove",
+            )
 
     @classmethod
     def poll(cls, context):
index 864d59f0cdb2625df607c66ae9c863867ac483aa..b71593add961fbdb2ca5157b6cf89e19772c5d06 100644 (file)
@@ -1049,7 +1049,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
         ob = context.active_object
 
         col = layout.column()
-        col.active = ob.vertex_groups.active != None
+        col.active = ob.vertex_groups.active is not None
         col.operator("object.vertex_group_normalize_all", text="Normalize All")
         col.operator("object.vertex_group_normalize", text="Normalize")
         col.operator("object.vertex_group_invert", text="Invert")
index 98517fd97a0bdf7e95cc3024e114d3f800c9ef30..833ac60099577767657d03024328caa7fa440267 100644 (file)
@@ -45,10 +45,12 @@ class OBJECT_OT_add_object(bpy.types.Operator, AddObjectHelper):
     bl_description = "Create a new Mesh Object"
     bl_options = {'REGISTER', 'UNDO'}
 
-    scale = FloatVectorProperty(name='scale',
-                                default=(1.0, 1.0, 1.0),
-                                subtype='TRANSLATION',
-                                description='scaling')
+    scale = FloatVectorProperty(
+            name='scale',
+            default=(1.0, 1.0, 1.0),
+            subtype='TRANSLATION',
+            description='scaling',
+            )
 
     def execute(self, context):
 
index 4cf943a53b786b0208a73b5270013b87b0eb6d88..b1d53e6ee0cbdaaed60ad37d33834430de00914f 100644 (file)
@@ -24,22 +24,30 @@ class ExportSomeData(bpy.types.Operator, ExportHelper):
     # ExportHelper mixin class uses this
     filename_ext = ".txt"
 
-    filter_glob = StringProperty(default="*.txt", options={'HIDDEN'})
+    filter_glob = StringProperty(
+            default="*.txt",
+            options={'HIDDEN'},
+            )
 
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
-    use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default=True)
-
-    type = EnumProperty(items=(('OPT_A', "First Option", "Description one"),
-                               ('OPT_B', "Second Option", "Description two."),
-                               ),
-                        name="Example Enum",
-                        description="Choose between two items",
-                        default='OPT_A')
+    use_setting = BoolProperty(
+            name="Example Boolean",
+            description="Example Tooltip",
+            default=True,
+            )
+
+    type = EnumProperty(
+            name="Example Enum",
+            description="Choose between two items",
+            items=(('OPT_A', "First Option", "Description one"),
+                   ('OPT_B', "Second Option", "Description two.")),
+            default='OPT_A',
+            )
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return context.active_object is not None
 
     def execute(self, context):
         return write_some_data(context, self.filepath, self.use_setting)
index 10d23a6712dec4a6ccc05aaebacb2a0b4f53fc12..d89b7e82f77974ba7abe069f05a1d6bb81cb4c55 100644 (file)
@@ -43,25 +43,38 @@ class AddBox(bpy.types.Operator):
     bl_label = "Add Box"
     bl_options = {'REGISTER', 'UNDO'}
 
-    width = FloatProperty(name="Width",
+    width = FloatProperty(
+            name="Width",
             description="Box Width",
-            default=1.0, min=0.01, max=100.0)
-
-    height = FloatProperty(name="Height",
+            min=0.01, max=100.0,
+            default=1.0,
+            )
+    height = FloatProperty(
+            name="Height",
             description="Box Height",
-            default=1.0, min=0.01, max=100.0)
-
-    depth = FloatProperty(name="Depth",
+            min=0.01, max=100.0,
+            default=1.0,
+            )
+    depth = FloatProperty(
+            name="Depth",
             description="Box Depth",
-            default=1.0, min=0.01, max=100.0)
+            min=0.01, max=100.0,
+            default=1.0,
+            )
 
     # generic transform props
-    view_align = BoolProperty(name="Align to View",
-            default=False)
-    location = FloatVectorProperty(name="Location",
-            subtype='TRANSLATION')
-    rotation = FloatVectorProperty(name="Rotation",
-            subtype='EULER')
+    view_align = BoolProperty(
+            name="Align to View",
+            default=False,
+            )
+    location = FloatVectorProperty(
+            name="Location",
+            subtype='TRANSLATION',
+            )
+    rotation = FloatVectorProperty(
+            name="Rotation",
+            subtype='EULER',
+            )
 
     def execute(self, context):
 
index 925449835ca651d4b5dc76ad1b2205c86f7de755..263bf72f1293e796ef13e00970226a09d3a93bb2 100644 (file)
@@ -8,7 +8,10 @@ class ViewOperator(bpy.types.Operator):
     bl_idname = "view3d.modal_operator"
     bl_label = "Simple View Operator"
 
-    offset = FloatVectorProperty(name="Offset", size=3)
+    offset = FloatVectorProperty(
+            name="Offset",
+            size=3,
+            )
 
     def execute(self, context):
         v3d = context.space_data
index 8348c7a95b13a17b0dd42210cc6d5de6e8e2e863..05d9afc0ad1d46ba32876bf75f66b76905ad9819 100644 (file)
@@ -13,7 +13,7 @@ class SimpleOperator(bpy.types.Operator):
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return context.active_object is not None
 
     def execute(self, context):
         main(context)
index 8aa816f9cb5b566b155386776c5cb5518358d578..fcb8da48962db28be26e0c4cc11b96b94737daff 100644 (file)
@@ -1245,6 +1245,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                sim.ob= par;
                sim.psys= psys;
                sim.psmd= psys_get_modifier(par, psys);
+               /* make sure emitter imat is in global coordinates instead of render view coordinates */
+               invert_m4_m4(par->imat, par->obmat);
 
                /* first check for loops (particle system object used as dupli object) */
                if(part->ren_as == PART_DRAW_OB) {
@@ -1349,6 +1351,10 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                                continue;
 
                        if(part->ren_as==PART_DRAW_GR) {
+                               /* prevent divide by zero below [#28336] */
+                               if(totgroup == 0)
+                                       continue;
+
                                /* for groups, pick the object based on settings */
                                if(part->draw&PART_DRAW_RAND_GR)
                                        b= BLI_rand() % totgroup;
index ea055e90b45477df459c03ebc9faf66f51c2fbc9..3a86389dba712888fb58e1a23668844682c6ee6d 100644 (file)
@@ -923,7 +923,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
        
        for(i = 0; i < dm->getNumVerts(dm); i++)
        {
-               maxdist = MAX2(maxdist, clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len*2.0));
+               maxdist = MAX2(maxdist, clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len*2.0f));
        }
        
        clmd->clothObject->bvhselftree = bvhselftree_build_from_cloth ( clmd, maxdist );
index 88a670ecb220d4e9ff701cb13d148d7de7b04498..e621e800520863d526ebafa85cfa42a98e4f090b 100644 (file)
@@ -1537,6 +1537,7 @@ void multires_load_old(Object *ob, Mesh *me)
                me->mface[i].v2 = lvl->faces[i].v[1];
                me->mface[i].v3 = lvl->faces[i].v[2];
                me->mface[i].v4 = lvl->faces[i].v[3];
+               me->mface[i].mat_nr = lvl->faces[i].mat_nr;
        }
 
        /* Add a multires modifier to the object */
index 2e0f4b483b14f2ade2c4a93b3a6a8fb78d4806b1..3299752646b411c9f2dabda3eaad9f3b414a45a2 100644 (file)
@@ -69,8 +69,10 @@ int BLI_gzip(const char *from, const char *to) {
        int readsize = 0;
        int rval= 0, err;
        gzFile gzfile;
-       
-       gzfile = gzopen(to, "wb"); 
+
+       /* level 1 is very close to 3 (the default) in terms of file size,
+        * but about twice as fast, best use for speedy saving - campbell */
+       gzfile = gzopen(to, "wb1");
        if(gzfile == NULL)
                return -1;
        
index 16f0c86c4498b7f13bdb3440dae99a115bdd4638..f0e81d6b5e93d03bba9edf002dc8070f3d56e420 100644 (file)
@@ -53,10 +53,10 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
                y = jit1[i+1];
                for (j = 2*num-2; j>=0 ; j-=2) {
                        if (i != j){
-                               vecx = jit1[j] - x - 1.0;
-                               vecy = jit1[j+1] - y - 1.0;
+                               vecx = jit1[j] - x - 1.0f;
+                               vecy = jit1[j+1] - y - 1.0f;
                                for (k = 3; k>0 ; k--){
-                                       if( fabs(vecx)<rad1 && fabs(vecy)<rad1) {
+                                       if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
                                                len=  sqrt(vecx*vecx + vecy*vecy);
                                                if(len>0 && len<rad1) {
                                                        len= len/rad1;
@@ -64,9 +64,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
                                                        dvecy += vecy/len;
                                                }
                                        }
-                                       vecx += 1.0;
+                                       vecx += 1.0f;
 
-                                       if( fabs(vecx)<rad1 && fabs(vecy)<rad1) {
+                                       if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
                                                len=  sqrt(vecx*vecx + vecy*vecy);
                                                if(len>0 && len<rad1) {
                                                        len= len/rad1;
@@ -74,9 +74,9 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
                                                        dvecy += vecy/len;
                                                }
                                        }
-                                       vecx += 1.0;
+                                       vecx += 1.0f;
 
-                                       if( fabs(vecx)<rad1 && fabs(vecy)<rad1) {
+                                       if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
                                                len=  sqrt(vecx*vecx + vecy*vecy);
                                                if(len>0 && len<rad1) {
                                                        len= len/rad1;
@@ -84,16 +84,16 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
                                                        dvecy += vecy/len;
                                                }
                                        }
-                                       vecx -= 2.0;
-                                       vecy += 1.0;
+                                       vecx -= 2.0f;
+                                       vecy += 1.0f;
                                }
                        }
                }
 
-               x -= dvecx/18.0 ;
-               y -= dvecy/18.0;
-               x -= floor(x) ;
-               y -= floor(y);
+               x -= dvecx/18.0f;
+               y -= dvecy/18.0f;
+               x -= floorf(x) ;
+               y -= floorf(y);
                jit2[i] = x;
                jit2[i+1] = y;
        }
@@ -111,28 +111,28 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
                y = jit1[i+1];
                for (j =2*num -2; j>= 0 ; j-=2){
                        if (i != j){
-                               vecx = jit1[j] - x - 1.0;
-                               vecy = jit1[j+1] - y - 1.0;
+                               vecx = jit1[j] - x - 1.0f;
+                               vecy = jit1[j+1] - y - 1.0f;
 
-                               if( fabs(vecx)<rad2) dvecx+= vecx*rad2;
-                               vecx += 1.0;
-                               if( fabs(vecx)<rad2) dvecx+= vecx*rad2;
-                               vecx += 1.0;
-                               if( fabs(vecx)<rad2) dvecx+= vecx*rad2;
+                               if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+                               vecx += 1.0f;
+                               if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
+                               vecx += 1.0f;
+                               if( fabsf(vecx)<rad2) dvecx+= vecx*rad2;
 
-                               if( fabs(vecy)<rad2) dvecy+= vecy*rad2;
-                               vecy += 1.0;
-                               if( fabs(vecy)<rad2) dvecy+= vecy*rad2;
-                               vecy += 1.0;
-                               if( fabs(vecy)<rad2) dvecy+= vecy*rad2;
+                               if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+                               vecy += 1.0f;
+                               if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
+                               vecy += 1.0f;
+                               if( fabsf(vecy)<rad2) dvecy+= vecy*rad2;
 
                        }
                }
 
-               x -= dvecx/2 ;
-               y -= dvecy/2;
-               x -= floor(x) ;
-               y -= floor(y);
+               x -= dvecx/2.0f;
+               y -= dvecy/2.0f;
+               x -= floorf(x) ;
+               y -= floorf(y);
                jit2[i] = x;
                jit2[i+1] = y;
        }
@@ -148,17 +148,17 @@ void BLI_initjit(float *jitarr, int num)
        if(num==0) return;
 
        jit2= MEM_mallocN(12 + 2*sizeof(float)*num, "initjit");
-       rad1=  1.0/sqrt((float)num);
-       rad2= 1.0/((float)num);
-       rad3= sqrt((float)num)/((float)num);
+       rad1= 1.0f/sqrtf((float)num);
+       rad2= 1.0f/((float)num);
+       rad3= sqrtf((float)num)/((float)num);
 
        BLI_srand(31415926 + num);
        x= 0;
        for(i=0; i<2*num; i+=2) {
-               jitarr[i]= x+ rad1*(0.5-BLI_drand());
-               jitarr[i+1]= ((float)i/2)/num +rad1*(0.5-BLI_drand());
+               jitarr[i]= x+ rad1*(float)(0.5-BLI_drand());
+               jitarr[i+1]= ((float)i/2)/num +rad1*(float)(0.5-BLI_drand());
                x+= rad3;
-               x -= floor(x);
+               x -= floorf(x);
        }
 
        for (i=0 ; i<24 ; i++) {
@@ -171,8 +171,8 @@ void BLI_initjit(float *jitarr, int num)
        
        /* finally, move jittertab to be centered around (0,0) */
        for(i=0; i<2*num; i+=2) {
-               jitarr[i] -= 0.5;
-               jitarr[i+1] -= 0.5;
+               jitarr[i] -= 0.5f;
+               jitarr[i+1] -= 0.5f;
        }
        
 }
index fc329fe1bf13ca7d0461de1bb6ad1b725be750e0..5b5de3ab3b61649b0a4653d37834665dd0d6aa07 100644 (file)
@@ -402,7 +402,7 @@ int isect_line_sphere_v3(const float l1[3], const float l2[3],
                madd_v3_v3v3fl(r_p1, l1, ldir, mu);
                return 1;
        }
-       else if (i > 0.0) {
+       else if (i > 0.0f) {
                const float i_sqrt= sqrt(i); /* avoid calc twice */
 
                /* first intersection */
@@ -456,7 +456,7 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2],
                madd_v2_v2v2fl(r_p1, l1, ldir, mu);
                return 1;
        }
-       else if (i > 0.0) {
+       else if (i > 0.0f) {
                const float i_sqrt= sqrt(i); /* avoid calc twice */
 
                /* first intersection */
@@ -2010,7 +2010,7 @@ void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const f
                }
 
                if(IS_ZERO(denom)==0)
-                       uv[1]= (float) (( (1-uv[0])*(st0[i]-st[i]) + uv[0]*(st1[i]-st[i]) ) / denom);
+                       uv[1]= (float) (( (1.0f-uv[0])*(st0[i]-st[i]) + uv[0]*(st1[i]-st[i]) ) / denom);
        }
 }
 
index dfd715ccbf28c336d1a773b2fc89852362654c47..e3e507d016a01028dc69ae00626f748394b71370 100644 (file)
@@ -213,7 +213,7 @@ void quat_to_mat4(float m[][4], const float q[4])
        double q0, q1, q2, q3, qda,qdb,qdc,qaa,qab,qac,qbb,qbc,qcc;
 
 #ifdef DEBUG
-       if(!((q0=dot_qtqt(q, q))==0.0f || (fabsf(q0-1.0f) < (float)QUAT_EPSILON))) {
+       if(!((q0=dot_qtqt(q, q))==0.0f || (fabs(q0-1.0) < QUAT_EPSILON))) {
                fprintf(stderr, "Warning! quat_to_mat4() called with non-normalized: size %.8f *** report a bug ***\n", (float)q0);
        }
 #endif
@@ -492,8 +492,8 @@ void vec_to_quat(float q[4], const float vec[3], short axis, const short upflag)
                        else angle= (float)(-0.5*atan2(-fp[0], -fp[1]));
                }
                                
-               co= (float)cos(angle);
-               si= (float)(sin(angle)/len1);
+               co= cosf(angle);
+               si= sinf(angle)/len1;
                q2[0]= co;
                q2[1]= x2*si;
                q2[2]= y2*si;
index 17b07b49309f8b2f6e2f185845764e178cbd0a78..31ae8adc2d404c65afd118c4ae132ed34f2c86af 100644 (file)
@@ -233,10 +233,10 @@ int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest)
 
 void BLI_copy_rcti_rctf(rcti *tar, const rctf *src)
 {
-       tar->xmin= floor(src->xmin + 0.5);
-       tar->xmax= floor((src->xmax - src->xmin) + 0.5);
-       tar->ymin= floor(src->ymin + 0.5);
-       tar->ymax= floor((src->ymax - src->ymin) + 0.5);
+       tar->xmin= floor(src->xmin + 0.5f);
+       tar->xmax= floor((src->xmax - src->xmin) + 0.5f);
+       tar->ymin= floor(src->ymin + 0.5f);
+       tar->ymax= floor((src->ymax - src->ymin) + 0.5f);
 }
 
 void print_rctf(const char *str, rctf *rect)
index 47a07d86e6660bd2cbc9c00fa24c2207d5a74ec6..b159106f7488123e75fb6e2fdad365b9ec0ae7cd 100644 (file)
@@ -288,7 +288,7 @@ static short testedgeside(float *v1, float *v2, float *v3)
        inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy])
                +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]);
 
-       if(inp<0.0) return 0;
+       if(inp < 0.0f) return 0;
        else if(inp==0) {
                if(v1[cox]==v3[cox] && v1[coy]==v3[coy]) return 0;
                if(v2[cox]==v3[cox] && v2[coy]==v3[coy]) return 0;
@@ -312,8 +312,8 @@ static short addedgetoscanvert(ScFillVert *sc, EditEdge *eed)
        y= eed->v1->co[coy];
 
        fac1= eed->v2->co[coy]-y;
-       if(fac1==0.0) {
-               fac1= 1.0e10*(eed->v2->co[cox]-x);
+       if(fac1==0.0f) {
+               fac1= 1.0e10f*(eed->v2->co[cox]-x);
 
        }
        else fac1= (x-eed->v2->co[cox])/fac1;
@@ -324,8 +324,8 @@ static short addedgetoscanvert(ScFillVert *sc, EditEdge *eed)
                if(ed->v2==eed->v2) return 0;
 
                fac= ed->v2->co[coy]-y;
-               if(fac==0.0) {
-                       fac= 1.0e10*(ed->v2->co[cox]-x);
+               if(fac==0.0f) {
+                       fac= 1.0e10f*(ed->v2->co[cox]-x);
 
                }
                else fac= (x-ed->v2->co[cox])/fac;
@@ -443,7 +443,7 @@ static void testvertexnearedge(void)
                                                vec2[1]= eed->v2->co[coy];
                                                if(boundinsideEV(eed,eve)) {
                                                        dist= dist_to_line_v2(vec1,vec2,vec3);
-                                                       if(dist<COMPLIMIT) {
+                                                       if(dist<(float)COMPLIMIT) {
                                                                /* new edge */
                                                                ed1= BLI_addfilledge(eed->v1, eve);
                                                                
@@ -816,7 +816,7 @@ int BLI_edgefill(short mat_nr)
                if(v2) {
                        if( compare_v3v3(v2, eve->co, COMPLIMIT)==0) {
                                len= normal_tri_v3( norm,v1, v2, eve->co);
-                               if(len != 0.0) break;
+                               if(len != 0.0f) break;
                        }
                }
                else if(compare_v3v3(v1, eve->co, COMPLIMIT)==0) {
@@ -825,7 +825,7 @@ int BLI_edgefill(short mat_nr)
                eve= eve->next;
        }
 
-       if(len==0.0) return 0;  /* no fill possible */
+       if(len==0.0f) return 0; /* no fill possible */
 
        norm[0]= fabs(norm[0]);
        norm[1]= fabs(norm[1]);
index be15b191c8a236f4c064e833ac0d509a35527452..4088481c844f4fbbd36b1287861114d9d07bc700 100644 (file)
@@ -55,7 +55,7 @@ set(SRC
 )
 
 if(WITH_BUILDINFO)
-       add_definitions(-DNAN_BUILDINFO)
+       add_definitions(-DWITH_BUILDINFO)
 endif()
 
 blender_add_lib(bf_blenloader "${SRC}" "${INC}" "${INC_SYS}")
index 4c024c9ee20113afbfda2517a75fb19275edda0a..167050cf0e20e5a86a3fbbb812bdd571a2272589 100644 (file)
@@ -11677,8 +11677,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        Tex *tex;
                        for(tex= main->tex.first; tex; tex= tex->id.next) {
                                if(tex->pd) {
-                                       if (tex->pd->falloff_speed_scale == 0.0)
-                                               tex->pd->falloff_speed_scale = 100.0;
+                                       if (tex->pd->falloff_speed_scale == 0.0f)
+                                               tex->pd->falloff_speed_scale = 100.0f;
 
                                        if (!tex->pd->falloff_curve) {
                                                tex->pd->falloff_curve = curvemapping_add(1, 0, 0, 1, 1);
index 8ad8ba121e7b2c2ead486dab946cbdc43ce77ae2..9e9e7457df850063bedb7a24d5b9d2efa052d181 100644 (file)
@@ -2467,7 +2467,7 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
        fg.subversion= BLENDER_SUBVERSION;
        fg.minversion= BLENDER_MINVERSION;
        fg.minsubversion= BLENDER_MINSUBVERSION;
-#ifdef NAN_BUILDINFO
+#ifdef WITH_BUILDINFO
        {
                extern char build_rev[];
                fg.revision= atoi(build_rev);
index 32e69069bb0dbe5fccc28461f864bd061e5604d7..7c7c1318a6ec42c2044769e30d74716a4b9de5c4 100644 (file)
@@ -11,7 +11,7 @@ if env['WITH_BF_QUICKTIME']:
     defs.append('WITH_QUICKTIME')
     incs += ' ' + env['BF_QUICKTIME_INC']
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index e2a68d196822bbb7bd9ca2b6f8aedf74679ebb75..b5c84bc3c84310c66627bb6d8c9b2e6b52c44ce5 100644 (file)
@@ -107,7 +107,7 @@ set(SRC
 )
 
 if(WITH_BUILDINFO)
-       add_definitions(-DNAN_BUILDINFO)
+       add_definitions(-DWITH_BUILDINFO)
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
index e6e0953680c9530e98363400308783d4aba5a14c..b26318f6114dd9196f4a4bfe94bb6f0766937440 100644 (file)
@@ -52,7 +52,7 @@ extern "C"
 #include "BLI_path_util.h"
 #include "BLI_fileops.h"
 #include "ED_keyframing.h"
-#ifdef NAN_BUILDINFO
+#ifdef WITH_BUILDINFO
 extern char build_rev[];
 #endif
 }
@@ -1002,7 +1002,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename, bool
        else {
                asset.getContributor().mAuthor = "Blender User";
        }
-#ifdef NAN_BUILDINFO
+#ifdef WITH_BUILDINFO
        char version_buf[128];
        sprintf(version_buf, "Blender %d.%02d.%d r%s", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION, build_rev);
        asset.getContributor().mAuthoringTool = version_buf;
index 3dd6160c445da506fb239b0e8ceafc1e5a9bbc09..17cca9e37063ccdc2d2df51362a31361dfc9722d 100644 (file)
@@ -38,6 +38,6 @@ else:
     incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include [OPENCOLLADA]/GeneratedSaxParser/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
 
 if env['BF_BUILDINFO']:
-    defs.append('NAN_BUILDINFO')
+    defs.append('WITH_BUILDINFO')
 
 env.BlenderLib ('bf_collada', sources, Split(incs), defs, libtype='core', priority=200 )
index beabd912a2031aaaccc628889724e022ff5dbd96..b7f9a263bc11f9e0f7ec02521f94a2b02f87d162 100644 (file)
@@ -7,7 +7,7 @@ incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../gpu ../../makesrna #/intern/opennl/extern'
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index e31e3a26b4045ddd7e7fbc2653266b34150909a9..a5ceb8bdb1951bfa6cb26bde576d1095324c9cfe 100644 (file)
@@ -710,6 +710,27 @@ int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but)
        return 1;
 }
 
+/* use to check if we need to disable undo, but dont make any changes
+ * returns FALSE if undo needs to be disabled. */
+static int ui_but_is_rna_undo(uiBut *but)
+{
+       if(but->rnapoin.id.data) {
+               /* avoid undo push for buttons who's ID are screen or wm level
+                * we could disable undo for buttons with no ID too but may have
+                * unforseen conciquences, so best check for ID's we _know_ are not
+                * handled by undo - campbell */
+               ID *id= but->rnapoin.id.data;
+               if(ELEM(GS(id->name), ID_SCR, ID_WM)) {
+                       return FALSE;
+               }
+               else {
+                       return TRUE;
+               }
+       }
+
+       return TRUE;
+}
+
 /* assigns automatic keybindings to menu items for fast access
  * (underline key in menu) */
 static void ui_menu_block_set_keyaccels(uiBlock *block)
@@ -1245,14 +1266,14 @@ int ui_is_but_float(uiBut *but)
 
 int ui_is_but_unit(uiBut *but)
 {
-       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
-       int unit_type= uiButGetUnitType(but);
+       UnitSettings *unit= but->block->unit;
+       const int unit_type= uiButGetUnitType(but);
 
        if(unit_type == PROP_UNIT_NONE)
                return 0;
 
 #if 1 // removed so angle buttons get correct snapping
-       if (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION)
+       if (unit->system_rotation == USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION)
                return 0;
 #endif
        
@@ -1260,7 +1281,7 @@ int ui_is_but_unit(uiBut *but)
        if (unit_type == PROP_UNIT_TIME)
                return 0;
 
-       if (scene->unit.system == USER_UNIT_NONE) {
+       if (unit->system == USER_UNIT_NONE) {
                if (unit_type != PROP_UNIT_ROTATION) {
                        return 0;
                }
@@ -1293,19 +1314,19 @@ double ui_get_but_val(uiBut *but)
 
                switch(RNA_property_type(prop)) {
                        case PROP_BOOLEAN:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_check(prop))
                                        value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_boolean_get(&but->rnapoin, prop);
                                break;
                        case PROP_INT:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_check(prop))
                                        value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_int_get(&but->rnapoin, prop);
                                break;
                        case PROP_FLOAT:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_check(prop))
                                        value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_float_get(&but->rnapoin, prop);
@@ -1459,19 +1480,20 @@ int ui_get_but_string_max_length(uiBut *but)
 
 static double ui_get_but_scale_unit(uiBut *but, double value)
 {
-       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+       UnitSettings *unit= but->block->unit;
        int unit_type= uiButGetUnitType(but);
 
        if(unit_type == PROP_UNIT_LENGTH) {
-               return value * (double)scene->unit.scale_length;
+               return value * (double)unit->scale_length;
        }
        else if(unit_type == PROP_UNIT_AREA) {
-               return value * pow(scene->unit.scale_length, 2);
+               return value * pow(unit->scale_length, 2);
        }
        else if(unit_type == PROP_UNIT_VOLUME) {
-               return value * pow(scene->unit.scale_length, 3);
+               return value * pow(unit->scale_length, 3);
        }
        else if(unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
+               Scene *scene= CTX_data_scene(but->block->evil_C);
                return FRA2TIME(value);
        }
        else {
@@ -1483,14 +1505,14 @@ static double ui_get_but_scale_unit(uiBut *but, double value)
 void ui_convert_to_unit_alt_name(uiBut *but, char *str, int maxlen)
 {
        if(ui_is_but_unit(but)) {
+               UnitSettings *unit= but->block->unit;
                int unit_type= uiButGetUnitType(but);
                char *orig_str;
-               Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
                
                orig_str= MEM_callocN(sizeof(char)*maxlen + 1, "textedit sub str");
                memcpy(orig_str, str, maxlen);
                
-               bUnit_ToUnitAltName(str, maxlen, orig_str, scene->unit.system, unit_type>>16);
+               bUnit_ToUnitAltName(str, maxlen, orig_str, unit->system, unit_type>>16);
                
                MEM_freeN(orig_str);
        }
@@ -1498,27 +1520,26 @@ void ui_convert_to_unit_alt_name(uiBut *but, char *str, int maxlen)
 
 static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, int pad)
 {
-       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
-       int do_split= scene->unit.flag & USER_UNIT_OPT_SPLIT;
+       UnitSettings *unit= but->block->unit;
+       int do_split= unit->flag & USER_UNIT_OPT_SPLIT;
        int unit_type= uiButGetUnitType(but);
        int precision= but->a2;
 
-       if(scene->unit.scale_length<0.0001f) scene->unit.scale_length= 1.0f; // XXX do_versions
+       if(unit->scale_length<0.0001f) unit->scale_length= 1.0f; // XXX do_versions
 
        /* Sanity checks */
        if(precision > PRECISION_FLOAT_MAX)     precision= PRECISION_FLOAT_MAX;
        else if(precision==0)                           precision= 2;
 
-       bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, scene->unit.system, unit_type>>16, do_split, pad);
+       bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precision, unit->system, unit_type>>16, do_split, pad);
 }
 
 static float ui_get_but_step_unit(uiBut *but, float step_default)
 {
-       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
        int unit_type= uiButGetUnitType(but)>>16;
        float step;
 
-       step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, step_default), scene->unit.system, unit_type);
+       step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, step_default), but->block->unit->system, unit_type);
 
        if(step > 0.0f) { /* -1 is an error value */
                return (float)((double)step/ui_get_but_scale_unit(but, 1.0))*100.0f;
@@ -1606,12 +1627,11 @@ static int ui_set_but_string_eval_num_unit(bContext *C, uiBut *but, const char *
 {
        char str_unit_convert[256];
        const int unit_type= uiButGetUnitType(but);
-       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
 
        BLI_strncpy(str_unit_convert, str, sizeof(str_unit_convert));
 
        /* ugly, use the draw string to get the value, this could cause problems if it includes some text which resolves to a unit */
-       bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), scene->unit.system, unit_type>>16);
+       bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), but->block->unit->system, unit_type>>16);
 
        return (BPY_button_exec(C, str_unit_convert, value, TRUE) != -1);
 }
@@ -1958,7 +1978,10 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
        block->active= 1;
        block->dt= dt;
        block->evil_C= (void*)C; // XXX
-       if (scn) block->color_profile= (scn->r.color_mgt_flag & R_COLOR_MANAGEMENT);
+       if (scn) {
+               block->color_profile= (scn->r.color_mgt_flag & R_COLOR_MANAGEMENT);
+               block->unit= &scn->unit;
+       }
        BLI_strncpy(block->name, name, sizeof(block->name));
 
        if(region)
@@ -2506,12 +2529,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
 
 static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2,  const char *tip)
 {
+       const PropertyType proptype= RNA_property_type(prop);
        uiBut *but;
-       PropertyType proptype;
        int freestr= 0, icon= 0;
 
-       proptype= RNA_property_type(prop);
-
        /* use rna values if parameters are not specified */
        if(!str) {
                if(type == MENU && proptype == PROP_ENUM) {
@@ -2636,9 +2657,14 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
                UI_DEF_BUT_RNA_DISABLE(but);
        }
 
+       if (but->flag & UI_BUT_UNDO && (ui_but_is_rna_undo(but) == FALSE)) {
+               but->flag &= ~UI_BUT_UNDO;
+       }
+
        /* If this button uses units, calculate the step from this */
-       if(ui_is_but_unit(but))
+       if((proptype == PROP_FLOAT) && ui_is_but_unit(but)) {
                but->a1= ui_get_but_step_unit(but, but->a1);
+       }
 
        if(freestr)
                MEM_freeN((void *)str);
@@ -2682,6 +2708,7 @@ static uiBut *ui_def_but_operator(uiBlock *block, int type, const char *opname,
        but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip);
        but->optype= ot;
        but->opcontext= opcontext;
+       but->flag &= ~UI_BUT_UNDO; /* no need for ui_but_is_undo(), we never need undo here */
 
        if(!ot) {
                but->flag |= UI_BUT_DISABLED;
@@ -2711,6 +2738,7 @@ static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opn
        but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
        but->optype= ot;
        but->opcontext= opcontext;
+       but->flag &= ~UI_BUT_UNDO; /* no need for ui_but_is_undo(), we never need undo here */
 
        if(!ot) {
                but->flag |= UI_BUT_DISABLED;
index 97299a6a766ff523aaeb037ca32d8ac59f21c741..dd7d2ca765fd9116d4fd76f2b1d63d77a68d8a60 100644 (file)
@@ -140,26 +140,25 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
        glEnd();
 }
 
-static void round_box_shade_col(float *col1, float *col2, float fac)
+static void round_box_shade_col(const float col1[3], float const col2[3], const float fac)
 {
-       float col[4];
+       float col[3];
 
        col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]);
        col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]);
        col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]);
-       col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]);
-       glColor4fv(col);
+       glColor3fv(col);
 }
 
-
 /* linear horizontal shade within button or in outline */
 /* view2d scrollers use it */
 void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
 {
        float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
                                          {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
-       float div= maxy-miny;
-       float coltop[4], coldown[4], color[4];
+       const float div= maxy - miny;
+       const float idiv= 1.0f / div;
+       float coltop[3], coldown[3], color[4];
        int a;
        
        /* mult */
@@ -173,11 +172,9 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
        coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f;
        coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f;
        coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f;
-       coltop[3]= color[3];
        coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f;
        coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f;
        coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f;
-       coldown[3]= color[3];
 
        glShadeModel(GL_SMOOTH);
        glBegin(mode);
@@ -189,11 +186,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
                glVertex2f(maxx-rad, miny);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(coltop, coldown, vec[a][1]/div);
+                       round_box_shade_col(coltop, coldown, vec[a][1]*idiv);
                        glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
                }
                
-               round_box_shade_col(coltop, coldown, rad/div);
+               round_box_shade_col(coltop, coldown, rad*idiv);
                glVertex2f(maxx, miny+rad);
        }
        else {
@@ -204,11 +201,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
        /* corner right-top */
        if(roundboxtype & 2) {
                
-               round_box_shade_col(coltop, coldown, (div-rad)/div);
+               round_box_shade_col(coltop, coldown, (div-rad)*idiv);
                glVertex2f(maxx, maxy-rad);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])/div);
+                       round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])*idiv);
                        glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
                }
                round_box_shade_col(coltop, coldown, 1.0);
@@ -226,11 +223,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
                glVertex2f(minx+rad, maxy);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(coltop, coldown, (div-vec[a][1])/div);
+                       round_box_shade_col(coltop, coldown, (div-vec[a][1])*idiv);
                        glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
                }
                
-               round_box_shade_col(coltop, coldown, (div-rad)/div);
+               round_box_shade_col(coltop, coldown, (div-rad)*idiv);
                glVertex2f(minx, maxy-rad);
        }
        else {
@@ -241,11 +238,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
        /* corner left-bottom */
        if(roundboxtype & 8) {
                
-               round_box_shade_col(coltop, coldown, rad/div);
+               round_box_shade_col(coltop, coldown, rad*idiv);
                glVertex2f(minx, miny+rad);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(coltop, coldown, (rad-vec[a][1])/div);
+                       round_box_shade_col(coltop, coldown, (rad-vec[a][1])*idiv);
                        glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
                }
                
@@ -267,7 +264,8 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
 {
        float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
                                          {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
-       float div= maxx-minx;
+       const float div= maxx - minx;
+       const float idiv= 1.0f / div;
        float colLeft[3], colRight[3], color[4];
        int a;
        
@@ -295,11 +293,11 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
                glVertex2f(maxx-rad, miny);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(colLeft, colRight, vec[a][0]/div);
+                       round_box_shade_col(colLeft, colRight, vec[a][0]*idiv);
                        glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
                }
                
-               round_box_shade_col(colLeft, colRight, rad/div);
+               round_box_shade_col(colLeft, colRight, rad*idiv);
                glVertex2f(maxx, miny+rad);
        }
        else {
@@ -314,10 +312,10 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
                
                for(a=0; a<7; a++) {
                        
-                       round_box_shade_col(colLeft, colRight, (div-rad-vec[a][0])/div);
+                       round_box_shade_col(colLeft, colRight, (div-rad-vec[a][0])*idiv);
                        glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
                }
-               round_box_shade_col(colLeft, colRight, (div-rad)/div);
+               round_box_shade_col(colLeft, colRight, (div-rad)*idiv);
                glVertex2f(maxx-rad, maxy);
        }
        else {
@@ -327,11 +325,11 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
        
        /* corner left-top */
        if(roundboxtype & 1) {
-               round_box_shade_col(colLeft, colRight, (div-rad)/div);
+               round_box_shade_col(colLeft, colRight, (div-rad)*idiv);
                glVertex2f(minx+rad, maxy);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(colLeft, colRight, (div-rad+vec[a][0])/div);
+                       round_box_shade_col(colLeft, colRight, (div-rad+vec[a][0])*idiv);
                        glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
                }
                
@@ -349,7 +347,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
                glVertex2f(minx, miny+rad);
                
                for(a=0; a<7; a++) {
-                       round_box_shade_col(colLeft, colRight, (vec[a][0])/div);
+                       round_box_shade_col(colLeft, colRight, (vec[a][0])*idiv);
                        glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
                }
                
index 6f3ca2bf003e006fc38ae21987a74841652f6525..3bd29f8de3e01aecacb9891225849698a9b2ecf9 100644 (file)
@@ -2310,13 +2310,13 @@ static float ui_numedit_apply_snapf(uiBut *but, float tempf, float softmin, floa
                float fac= 1.0f;
                
                if(ui_is_but_unit(but)) {
-                       Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+                       UnitSettings *unit= but->block->unit;
                        int unit_type= uiButGetUnitType(but)>>16;
 
-                       if(bUnit_IsValid(scene->unit.system, unit_type)) {
-                               fac= (float)bUnit_BaseScalar(scene->unit.system, unit_type);
+                       if(bUnit_IsValid(unit->system, unit_type)) {
+                               fac= (float)bUnit_BaseScalar(unit->system, unit_type);
                                if(ELEM3(unit_type, B_UNIT_LENGTH, B_UNIT_AREA, B_UNIT_VOLUME)) {
-                                       fac /= scene->unit.scale_length;
+                                       fac /= unit->scale_length;
                                }
                        }
                }
index 242210e01bbc86cf59d3d7db77bdc0ce9633be11..40b98bebcd0ac7007eb10a6bfbcd44bad142e084 100644 (file)
@@ -332,7 +332,9 @@ struct uiBlock {
        void *evil_C;                           // XXX hack for dynamic operator enums
 
        float _hsv[3];                          // XXX, only access via ui_block_hsv_get()
-       char color_profile;                             // color profile for correcting linear colors for display
+       char color_profile;                     // color profile for correcting linear colors for display
+       struct UnitSettings *unit;      // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time.
+
 };
 
 typedef struct uiSafetyRct {
index 4810b3fdf54627083969f426f35c3adca67f8014..3575a8527fc015f89e6c14b1c8edbe8a5fcf5511 100644 (file)
@@ -1017,12 +1017,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
                ui_item_array(layout, block, name, icon, ptr, prop, len, 0, 0, w, h, expand, slider, toggle, icon_only);
        /* enum item */
        else if(type == PROP_ENUM && index == RNA_ENUM_VALUE) {
-               const char *identifier= RNA_property_identifier(prop);
-
                if(icon && name[0] && !icon_only)
                        uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
                else if(icon)
-                       uiDefIconButR(block, ROW, 0, icon, 0, 0, w, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
+                       uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
                else
                        uiDefButR_prop(block, ROW, 0, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL);
        }
index d235fd0c16a4b51157ea60f255f23f80844a0bfc..5da875356ea2524672c4086f3fd0988d57c689ae 100644 (file)
@@ -180,7 +180,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y
        
        glEnable(GL_BLEND);
        glGetFloatv(GL_CURRENT_COLOR, color);
-       color[3]*= 0.125;
+       color[3] *= 0.125f;
        glColor4fv(color);
        
        /* for each AA step */
index 34936c025bcb85c95d8bf103eb8d45748c46435f..b992ae5f04c7067b681d92a9dd92b7a636933ac2 100644 (file)
@@ -8,7 +8,7 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../gpu ../../blenloader'
 incs += ' ../../makesrna ../../render/extern/include  #/intern/elbeem/extern'
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index 660643fbb0fc2793b0f2ae783e4c462ebd798f79..ca048cb59f9f741290f4fe91eb93adbec0426e93 100644 (file)
@@ -10,7 +10,7 @@ incs += ' ../../render/extern/include ../../gpu' # for object_bake.c
 
 defs = []
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index cd42661f320354de8f5f9e2f6850b71361062058..d5f10f1d37d5c82e84331f4767ff3c60ce958f87 100644 (file)
@@ -182,7 +182,7 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
        }
        
        RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object", -FLT_MAX, FLT_MAX);
-       RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", -M_PI * 2.0f, M_PI * 2.0f);
+       RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f);
        
        prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
        RNA_def_property_flag(prop, PROP_HIDDEN);
index 679e4e58017f6c03a0d9b78456242f7521ab5d4e..ee162464c70402dcfdcf8847c5119936bf8576f7 100644 (file)
@@ -636,14 +636,14 @@ static void apply_heights_data(void *bake_data)
                        if(ibuf->rect_float) {
                                float *rrgbf= ibuf->rect_float + i*4;
 
-                               if(max-min > 1e-5) height= (heights[i]-min)/(max-min);
+                               if(max-min > 1e-5f) height= (heights[i]-min)/(max-min);
                                else height= 0;
 
                                rrgbf[0]=rrgbf[1]=rrgbf[2]= height;
                        } else {
                                char *rrgb= (char*)ibuf->rect + i*4;
 
-                               if(max-min > 1e-5) height= (heights[i]-min)/(max-min);
+                               if(max-min > 1e-5f) height= (heights[i]-min)/(max-min);
                                else height= 0;
 
                                rrgb[0]=rrgb[1]=rrgb[2]= FTOCHAR(height);
index 274819c918cb078aa597a8c2ff03760ce3178fb8..188416eb04c28164e682f70e7d304e67629b4237 100644 (file)
@@ -10,7 +10,7 @@ incs += ' ../../makesrna ../../render/extern/include  #/intern/elbeem/extern'
 
 defs = ''
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index 2b9737557cd0f6e8b1da465992d7a5fb6c8713a0..53418500ea64bf2dd6b5e3d6c1a05f080f349b26 100644 (file)
@@ -9,7 +9,7 @@ incs += ' ../../gpu'
 incs += ' ../../makesrna ../../render/extern/include  #/intern/elbeem/extern'
 incs += ' ../../blenloader'
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index cfed2750e18e14b3f99769f01d1e120008cb3548..fbdcf7ba9b301a92fbf83e95d27558a75f8ab8d7 100644 (file)
@@ -787,7 +787,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
        ot->poll= envmap_save_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
        
        /* properties */
        //RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as.");
@@ -875,8 +875,6 @@ static int copy_material_exec(bContext *C, wmOperator *UNUSED(op))
 
        copy_matcopybuf(ma);
 
-       WM_event_add_notifier(C, NC_MATERIAL, ma);
-
        return OPERATOR_FINISHED;
 }
 
@@ -891,7 +889,7 @@ void MATERIAL_OT_copy(wmOperatorType *ot)
        ot->exec= copy_material_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the material */
 }
 
 static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1015,8 +1013,6 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
 
        copy_mtex_copybuf(id);
 
-       WM_event_add_notifier(C, NC_TEXTURE, NULL);
-
        return OPERATOR_FINISHED;
 }
 
@@ -1039,7 +1035,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot)
        ot->poll= copy_mtex_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the mtex */
 }
 
 static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
index 61f3429521de49439ba1945677aa173920d0626c..1381c8202240152b82e1aa009828241651d3046c 100644 (file)
@@ -10,7 +10,7 @@ incs += ' #/intern/guardedalloc #/extern/glew/include'
 
 defs = ''
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index 82986dfbcc4b82b5a462aaa2321f549ee33cbc88..bc97cd9d3ff0297d12763a5e4a7fe0c0d1318090 100644 (file)
@@ -1406,6 +1406,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
                                                   "Displays current editor type. "
                                                   "Click for menu of available types");
        uiButSetFunc(but, spacefunc, NULL, NULL);
+       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
        
        return xco + UI_UNIT_X + 14;
 }
@@ -1414,6 +1415,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
 {
        ScrArea *sa= CTX_wm_area(C);
        int xco= 8;
+       uiBut *but;
        
        if (!sa->full)
                xco= ED_area_header_switchbutton(C, block, yco);
@@ -1421,20 +1423,22 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
        uiBlockSetEmboss(block, UI_EMBOSSN);
 
        if (sa->flag & HEADER_NO_PULLDOWN) {
-               uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, 
+               but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
                                                 ICON_DISCLOSURE_TRI_RIGHT,
                                                 xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
                                                 &(sa->flag), 0, 0, 0, 0, 
                                                 "Show pulldown menus");
        }
        else {
-               uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, 
+               but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
                                                 ICON_DISCLOSURE_TRI_DOWN,
                                                 xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
                                                 &(sa->flag), 0, 0, 0, 0, 
                                                 "Hide pulldown menus");
        }
 
+       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
+
        uiBlockSetEmboss(block, UI_EMBOSS);
        
        return xco + UI_UNIT_X;
index 90b56ded2cdc1f41202878968dfab3e1a32682b2..b3927fcee6870570e8d8236b94652554a6443c42 100644 (file)
@@ -10,7 +10,7 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../render/extern/include'
 incs += ' ../../gpu ../../makesrna ../../blenloader'
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index 8e1a4b2d16c06b81712de396caeb977e10067341..0d81a84deea3706bc12a398d99bd61ad17d54a2e 100644 (file)
@@ -904,6 +904,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
        block= uiLayoutGetBlock(row);
        uiBlockSetEmboss(block, UI_EMBOSSN);
        but= uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed");
+       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
        uiButSetFunc(but, pin_cb, NULL, NULL);
 
        for(a=0; a<path->len; a++) {
index 19c600be93761516e07317a8110a9ac8c4a50b98..e631718b0cbd5b26a9a1908e10a93f5ea25ff339 100644 (file)
@@ -104,6 +104,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
 {
        SpaceButs *sbuts= CTX_wm_space_buts(C);
        uiBlock *block;
+       uiBut *but;
        int xco, yco= 2;
 
        buttons_context_compute(C, sbuts);
@@ -118,33 +119,32 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
        xco -= UI_UNIT_X;
        
        // Default panels
+
        uiBlockBeginAlign(block);
-       if(sbuts->pathflag & (1<<BCONTEXT_RENDER))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_SCENE,                     xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_RENDER, 0, 0, "Render");
-       if(sbuts->pathflag & (1<<BCONTEXT_SCENE))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_SCENE_DATA,                        xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_SCENE, 0, 0, "Scene");
-       if(sbuts->pathflag & (1<<BCONTEXT_WORLD))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_WORLD,             xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_WORLD, 0, 0, "World");
-       if(sbuts->pathflag & (1<<BCONTEXT_OBJECT))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_OBJECT_DATA,       xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_OBJECT, 0, 0, "Object");
-       if(sbuts->pathflag & (1<<BCONTEXT_CONSTRAINT))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_CONSTRAINT,        xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, "Object Constraints");
-       if(sbuts->pathflag & (1<<BCONTEXT_MODIFIER))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_MODIFIER,  xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_MODIFIER, 0, 0, "Modifiers");
-       if(sbuts->pathflag & (1<<BCONTEXT_DATA))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     sbuts->dataicon,        xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, "Object Data");
-       if(sbuts->pathflag & (1<<BCONTEXT_BONE))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_BONE_DATA, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_BONE, 0, 0, "Bone");
-       if(sbuts->pathflag & (1<<BCONTEXT_BONE_CONSTRAINT))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_CONSTRAINT_BONE,   xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_BONE_CONSTRAINT, 0, 0, "Bone Constraints");
-       if(sbuts->pathflag & (1<<BCONTEXT_MATERIAL))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_MATERIAL,  xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_MATERIAL, 0, 0, "Material");
-       if(sbuts->pathflag & (1<<BCONTEXT_TEXTURE))
-               uiDefIconButS(block, ROW, B_BUTSPREVIEW,        ICON_TEXTURE,   xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_TEXTURE, 0, 0, "Texture");
-       if(sbuts->pathflag & (1<<BCONTEXT_PARTICLE))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_PARTICLES, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_PARTICLE, 0, 0, "Particles");
-       if(sbuts->pathflag & (1<<BCONTEXT_PHYSICS))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_PHYSICS,   xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)BCONTEXT_PHYSICS, 0, 0, "Physics");
+
+#define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \
+       if(sbuts->pathflag & (1<<_ctx)) { \
+               but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, _tip); \
+               uiButClearFlag(but, UI_BUT_UNDO); \
+       } \
+
+
+       BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, "Render")
+       BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, "Scene");
+       BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, "World");
+       BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, "Object");
+       BUTTON_HEADER_CTX(BCONTEXT_CONSTRAINT, ICON_CONSTRAINT, "Object Constraints");
+       BUTTON_HEADER_CTX(BCONTEXT_MODIFIER, ICON_MODIFIER, "Object Modifiers");
+       BUTTON_HEADER_CTX(BCONTEXT_DATA, sbuts->dataicon, "Object Data");
+       BUTTON_HEADER_CTX(BCONTEXT_BONE, ICON_BONE_DATA, "Bone");
+       BUTTON_HEADER_CTX(BCONTEXT_BONE_CONSTRAINT, ICON_CONSTRAINT_BONE, "Bone Constraints");
+       BUTTON_HEADER_CTX(BCONTEXT_MATERIAL, ICON_MATERIAL, "Material");
+       BUTTON_HEADER_CTX(BCONTEXT_TEXTURE, ICON_TEXTURE, "Textures");
+       BUTTON_HEADER_CTX(BCONTEXT_PARTICLE, ICON_PARTICLES, "Particles");
+       BUTTON_HEADER_CTX(BCONTEXT_PHYSICS, ICON_PHYSICS, "Physics");
+
+#undef BUTTON_HEADER_CTX
+
        xco+= BUT_UNIT_X;
        
        uiBlockEndAlign(block);
index 7c55b40e8161b6bbdd3bda5731debda371b863ac..ad96840f7b9fc0449c46f9a64c5e8810c114dfc7 100644 (file)
@@ -19,7 +19,7 @@ if env['WITH_BF_OPENEXR']:
 if env['WITH_BF_TIFF']:
     defs.append('WITH_TIFF')
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index ea8c7fc0cfa5227fda5b5c365270c09710c9ca01..6e0d19099632bbd11602d9f2e98e631e4d5c3059 100644 (file)
@@ -1331,7 +1331,7 @@ void IMAGE_OT_reload(wmOperatorType *ot)
        ot->exec= reload_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo, image buffer is not handled by undo */
 }
 
 /********************** new image operator *********************/
@@ -1989,7 +1989,7 @@ void IMAGE_OT_sample_line(wmOperatorType *ot)
        ot->cancel= WM_gesture_straightline_cancel;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= 0; /* no undo/register since this operates on the space */
        
        WM_operator_properties_gesture_straightline(ot, CURSOR_EDIT);
 }
index d58fb7b11f0557403cb6e6d6990de56508ebd481..e09565d38e933b581ab11eb2b50091480d3b434c 100644 (file)
@@ -273,7 +273,7 @@ void FILE_OT_report_missing_files(wmOperatorType *ot)
        ot->exec= report_missing_files_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= 0; /* only reports so no need to undo/register */
 }
 
 /********************* find missing files operator *********************/
index 634d4b777d9390cf442c5582160ae555879bf2f8..c4309dcfca341922259d550006f25ec03bb8323f 100644 (file)
@@ -15,7 +15,7 @@ if env['CC'] == 'gcc':
     #cf.append('-Werror')
     pass
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index 9cafc46ca5307f6d0f14bc058d3229678a1a218a..011f9a31c93a785c42f6613ebb6ba99de94f7fbf 100644 (file)
@@ -550,14 +550,16 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
                                }
                        }
                        else if(node->type==CMP_NODE_COMPOSITE) {
-                               bNode *tnode;
-                               
-                               for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
-                                       if( tnode->type==CMP_NODE_COMPOSITE)
-                                               tnode->flag &= ~NODE_DO_OUTPUT;
-                               
-                               node->flag |= NODE_DO_OUTPUT;
-                               ED_node_generic_update(bmain, ntree, node);
+                               if (was_output==0) {
+                                       bNode *tnode;
+                                       
+                                       for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
+                                               if( tnode->type==CMP_NODE_COMPOSITE)
+                                                       tnode->flag &= ~NODE_DO_OUTPUT;
+                                       
+                                       node->flag |= NODE_DO_OUTPUT;
+                                       ED_node_generic_update(bmain, ntree, node);
+                               }
                        }
                }
                else if(ntree->type==NTREE_TEXTURE) {
index 85bbbd4fffbd5be45edba90463ee8ec5b7e7e8a0..cf4ce9c06a8f5551fbf849b89fc4972cbe85c7bf 100644 (file)
@@ -124,8 +124,8 @@ typedef struct TreeElement {
 #define OL_TOGW OL_TOG_RESTRICT_VIEWX
 
 #define OL_RNA_COLX                    (UI_UNIT_X*15)
-#define OL_RNA_COL_SIZEX       (UI_UNIT_X*7.5)
-#define OL_RNA_COL_SPACEX      (UI_UNIT_X*2.5)
+#define OL_RNA_COL_SIZEX       (UI_UNIT_X*7.5f)
+#define OL_RNA_COL_SPACEX      (UI_UNIT_X*2.5f)
 
 
 /* outliner_tree.c ----------------------------------------------- */
@@ -143,9 +143,6 @@ void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct Space
 void draw_outliner(const struct bContext *C);
 
 /* outliner_select.c -------------------------------------------- */
-
-void outliner_select(struct SpaceOops *soops, ListBase *lb, int *index, short *selecting);
-
 int tree_element_type_active(struct bContext *C, struct Scene *scene, struct SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set);
 int tree_element_active(struct bContext *C, struct Scene *scene, SpaceOops *soops, TreeElement *te, int set);
 
index 620a936a944d6f558b84a7e470103aae1040a0f2..46a9bde826798da3ea72f75660dc7b7a1153383a 100644 (file)
 /* ****************************************************** */
 /* Outliner Selection (grey-blue highlight for rows) */
 
-void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting)
+static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting)
 {
        TreeElement *te;
        TreeStoreElem *tselem;
+       int change= 0;
        
        for (te= lb->first; te && *index >= 0; te=te->next, (*index)--) {
                tselem= TREESTORE(te);
@@ -131,6 +132,8 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin
                                        tselem->flag |= TSE_SELECTED;
                                else 
                                        tselem->flag &= ~TSE_SELECTED;
+
+                               change |= 1;
                        }
                }
                else if ((tselem->flag & TSE_CLOSED)==0) {
@@ -142,10 +145,12 @@ void outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selectin
                         *      function correctly
                         */
                        (*index)--;
-                       outliner_select(soops, &te->subtree, index, selecting);
+                       change |= outliner_select(soops, &te->subtree, index, selecting);
                        (*index)++;
                }
        }
+
+       return change;
 }
 
 /* ****************************************************** */
@@ -839,11 +844,14 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event)
                                                fmval[0], fmval[1], NULL, &row);
                
                /* select relevant row */
-               outliner_select(soops, &soops->tree, &row, &selecting);
+               if(outliner_select(soops, &soops->tree, &row, &selecting)) {
                
-               soops->storeflag |= SO_TREESTORE_REDRAW;
+                       soops->storeflag |= SO_TREESTORE_REDRAW;
                
-               ED_undo_push(C, "Outliner selection event");
+                       /* no need for undo push here, only changing outliner data which is
+                        * scene level - campbell */
+                       /* ED_undo_push(C, "Outliner selection event"); */
+               }
        }
        
        ED_region_tag_redraw(ar);
index 5429f0ee98fd3b68da5b82ed27b6e8fb981624ed..e876da41bd9c363b66f6cf952a23e7900b6bef56 100644 (file)
@@ -1202,7 +1202,7 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
        ot->poll= sequencer_edit_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
 }
 
 /* reload operator */
@@ -1228,9 +1228,6 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot)
        /* api callbacks */
        ot->exec= sequencer_refresh_all_exec;
        ot->poll= sequencer_edit_poll;
-       
-       /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
@@ -2525,7 +2522,7 @@ void SEQUENCER_OT_copy(wmOperatorType *ot)
        ot->poll= sequencer_edit_poll;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER;
 
        /* properties */
 }
index f5c178267aa3cc36f9b14a990f0d3101b927a43b..ddc10d78cac0faabaa7667cdbc6a7a9bc6355fd1 100644 (file)
@@ -2367,7 +2367,20 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
                        }
                }
        }
-       
+
+       /* useful for debugging index vs shape key index */
+#if 0
+       {
+               EditVert *eve;
+               int j;
+               UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
+               for(eve= em->verts.first, j= 0; eve; eve= eve->next, j++) {
+                       sprintf(val, "%d:%d", j, eve->keyindex);
+                       view3d_cached_text_draw_add(eve->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+               }
+       }
+#endif
+
        if(v3d->zbuf) {
                glEnable(GL_DEPTH_TEST);
                bglPolygonOffset(rv3d->dist, 0.0f);
index 7cf95261211739fff6538481a3a3369ad027d78c..f8837594ddb1aa0e11fda0e7c6302b7f340ed37a 100644 (file)
@@ -721,7 +721,7 @@ static void draw_rotation_guide(RegionView3D *rv3d)
                {
                #define ROT_AXIS_DETAIL 13
                const float s = 0.05f * scale;
-               const float step = 2.f * M_PI / ROT_AXIS_DETAIL;
+               const float step = 2.f * (float)(M_PI / ROT_AXIS_DETAIL);
                float angle;
                int i;
 
@@ -1041,7 +1041,7 @@ static void drawviewborder_triangle(float x1, float x2, float y1, float y2, cons
        glBegin(GL_LINES);
        if(w > h) {
                if(golden) {
-                       ofs = w * (1.0f-(1.0f/1.61803399));
+                       ofs = w * (1.0f-(1.0f/1.61803399f));
                }
                else {
                        ofs = h * (h / w);
@@ -1059,7 +1059,7 @@ static void drawviewborder_triangle(float x1, float x2, float y1, float y2, cons
        }
        else {
                if(golden) {
-                       ofs = h * (1.0f-(1.0f/1.61803399));
+                       ofs = h * (1.0f-(1.0f/1.61803399f));
                }
                else {
                        ofs = w * (w / h);
@@ -1203,7 +1203,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
 
                if (ca->dtx & CAM_DTX_GOLDEN) {
                        UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
-                       drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399));
+                       drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399f));
                }
 
                if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) {
index 3e6bbc1333487beb57768f30f7f349883ccc1da2..979a602b4f5abe7e77c8f6e6ef3a46a201109f43 100644 (file)
@@ -1697,7 +1697,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
 static void view_dolly_mouseloc(ARegion *ar, float orig_ofs[3], float dvec[3], float dfac)
 {
        RegionView3D *rv3d= ar->regiondata;
-       madd_v3_v3v3fl(rv3d->ofs, orig_ofs, dvec, -(1.0 - dfac));
+       madd_v3_v3v3fl(rv3d->ofs, orig_ofs, dvec, -(1.0f - dfac));
 }
 
 static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_invert)
@@ -1718,7 +1718,7 @@ static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_inv
                if (zoom_invert)
                        SWAP(float, len1, len2);
 
-               zfac =  1.0 + ((len2 - len1) * 0.01 * vod->rv3d->dist);
+               zfac =  1.0f + ((len2 - len1) * 0.01f * vod->rv3d->dist);
        }
 
        if(zfac != 1.0f)
index 046037a092fbca94af28968ad5697af4efd3171b..30d1a5088888f7c315a875b9a7b1fb833e8ed561 100644 (file)
@@ -867,7 +867,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
                                        upvec[2]=1;
                                        mul_m3_v3(mat, upvec);
                                        /*make sure we have some z rolling*/
-                                       if (fabs(upvec[2]) > 0.00001f) {
+                                       if (fabsf(upvec[2]) > 0.00001f) {
                                                roll= upvec[2] * -5.0f;
 
                                                upvec[0]= 1.0f; /*rotate the view about this axis*/
index 5b95ae63e56d1010f0af51aaaee51bcdfc954f34..78dcf6c9a5c265e39cab3b24eb1c9440fa236577 100644 (file)
@@ -281,31 +281,32 @@ static char *view3d_modeselect_pup(Scene *scene)
        str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
        
        if(ob==NULL || ob->data==NULL) return string;
-       if(ob->id.lib || ((ID *)ob->data)->lib) return string;
+       if(ob->id.lib) return string;
        
-       /* if active object is editable */
-       if ( ((ob->type == OB_MESH)
-               || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
-               || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
-               
-               str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
-       }
-       else if (ob->type == OB_ARMATURE) {
-               if (ob->mode & OB_MODE_POSE)
-                       str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
-               else
+       if(!((ID *)ob->data)->lib) {
+               /* if active object is editable */
+               if ( ((ob->type == OB_MESH)
+                       || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
+                       || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
+                       
                        str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
-       }
+               }
+               else if (ob->type == OB_ARMATURE) {
+                       if (ob->mode & OB_MODE_POSE)
+                               str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
+                       else
+                               str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
+               }
 
-       if (ob->type == OB_MESH) {
+               if (ob->type == OB_MESH) {
 
-               str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
-               str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
-               str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
-               str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
+                       str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
+                       str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
+                       str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
+                       str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
+               }
        }
-
-       
+               
        /* if active object is an armature */
        if (ob->type==OB_ARMATURE) {
                str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT);
@@ -465,6 +466,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
        Object *ob= OBACT;
        Object *obedit = CTX_data_edit_object(C);
        uiBlock *block;
+       uiBut *but;
        uiLayout *row;
        const float dpi_fac= UI_DPI_FAC;
        
@@ -512,9 +514,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                block= uiLayoutGetBlock(row);
                
                if(v3d->twflag & V3D_USE_MANIPULATOR) {
-                       uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
-                       uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
-                       uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+                       but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
+                       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
+                       but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
+                       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
+                       but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+                       uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
                }
                        
                if (v3d->twmode > (BIF_countTransformOrientation(C) - 1) + V3D_MANIP_CUSTOM) {
@@ -522,7 +527,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                }
                        
                str_menu = BIF_menustringTransformOrientation(C, "Orientation");
-               uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+               but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+               uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
                MEM_freeN((void *)str_menu);
        }
 
index e47cb1db753922803817d27c30631463a88b39a1..8416b37fd5e9afd334831145573694a0409cd714 100644 (file)
@@ -263,9 +263,13 @@ void view3d_keymap(wmKeyConfig *keyconf)
 
        /* selection*/
        WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "center", TRUE);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "enumerate", TRUE);
+       kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "center", TRUE);
+       RNA_boolean_set(kmi->ptr, "object", TRUE); /* use Ctrl+Select for 2 purposes */
+       kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
+       RNA_boolean_set(kmi->ptr, "enumerate", TRUE);
 
        /* selection key-combinations */
        kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
index 86112a42d994974145c200f7c38786b265c09e63..f241e640906d2275427f5ee59f64ae02f5bc61c6 100644 (file)
@@ -1231,8 +1231,8 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
        if(BASACT && BASACT->next) startbase= BASACT->next;
        
        /* This block uses the control key to make the object selected by its center point rather than its contents */
-       /* XXX later on, in editmode do not activate */
-       if(vc.obedit==NULL && obcenter) {
+       /* in editmode do not activate */
+       if(obcenter) {
                
                /* note; shift+alt goes to group-flush-selecting */
                if(enumerate) {
@@ -1838,11 +1838,22 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
        short extend= RNA_boolean_get(op->ptr, "extend");
        short center= RNA_boolean_get(op->ptr, "center");
        short enumerate= RNA_boolean_get(op->ptr, "enumerate");
+       short object= RNA_boolean_get(op->ptr, "object");
        int     retval = 0;
 
        view3d_operator_needs_opengl(C);
 
-       if(obedit && center==FALSE) {
+       if(object) {
+               obedit= NULL;
+               obact= NULL;
+
+               /* ack, this is incorrect but to do this correctly we would need an
+                * alternative editmode/objectmode keymap, this copies the functionality
+                * from 2.4x where Ctrl+Select in editmode does object select only */
+               center= FALSE;
+       }
+
+       if(obedit && object==FALSE) {
                if(obedit->type==OB_MESH)
                        retval = mouse_mesh(C, event->mval, extend);
                else if(obedit->type==OB_ARMATURE)
@@ -1891,6 +1902,7 @@ void VIEW3D_OT_select(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
        RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection.");
        RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only).");
+       RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only).");
 }
 
 
index c1c812e8c68d3f6121a647e5b59e6977d43cafb4..b234ac4ceecee495c3b9a729351c97e1a19c6d53 100644 (file)
@@ -1356,16 +1356,15 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
        ToolSettings *ts = CTX_data_tool_settings(C);
        int constraint_axis[3] = {0, 0, 0};
        int proportional = 0;
+       PropertyRNA *prop;
 
-       if (RNA_struct_find_property(op->ptr, "value"))
-       {
-               if (t->flag & T_AUTOVALUES)
-               {
-                       RNA_float_set_array(op->ptr, "value", t->auto_values);
+       if ((prop= RNA_struct_find_property(op->ptr, "value"))) {
+               float *values= (t->flag & T_AUTOVALUES) ? t->auto_values : t->values;
+               if (RNA_property_array_check(prop)) {
+                       RNA_property_float_set_array(op->ptr, prop, values);
                }
-               else
-               {
-                       RNA_float_set_array(op->ptr, "value", t->values);
+               else {
+                       RNA_property_float_set(op->ptr, prop, values[0]);
                }
        }
 
@@ -4649,7 +4648,7 @@ static int createSlideVerts(TransInfo *t)
                                                        uv_new = tf->uv[k];
 
                                                        if (ev->tmp.l) {
-                                                               if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001f || fabs(suv->origuv[1]-uv_new[1]) > 0.0001f) {
+                                                               if (fabsf(suv->origuv[0]-uv_new[0]) > 0.0001f || fabs(suv->origuv[1]-uv_new[1]) > 0.0001f) {
                                                                        ev->tmp.l = -1; /* Tag as invalid */
                                                                        BLI_linklist_free(suv->fuv_list,NULL);
                                                                        suv->fuv_list = NULL;
index ae6836446fa855edbdb92ab1bba2eb1feb511e1a..e8a7896abd51f55ae20563c7bfa455d31f6d7dc7 100644 (file)
@@ -205,11 +205,7 @@ static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short imp
                float *uv[4];
                int nverts;
                
-               if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) {
-                       if(efa->h)
-                               continue;
-               }
-               else if((efa->h) || (sel && (efa->f & SELECT)==0))
+               if((efa->h) || (sel && (efa->f & SELECT)==0))
                        continue;
 
                tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -586,7 +582,7 @@ void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit)
                return;
        }
 
-       liveHandle = construct_param_handle(scene, em, 0, fillholes, 1, 1);
+       liveHandle = construct_param_handle(scene, em, 0, fillholes, 0, 1);
 
        param_lscm_begin(liveHandle, PARAM_TRUE, abf);
        BKE_mesh_end_editmesh(obedit->data, em);
index 274884000dbbc8314f92db764c4819e2572bcb50..28624e9350c964abc029909b3d7658de3f3a5756 100644 (file)
@@ -906,6 +906,7 @@ static void do_material_tex(GPUShadeInput *shi)
        int init_done = 0, iBumpSpacePrev;
        GPUNodeLink *vNorg, *vNacc, *fPrevMagnitude;
        int iFirstTimeNMap=1;
+       int found_deriv_map = 0;
 
        GPU_link(mat, "set_value", GPU_uniform(&one), &stencil);
 
@@ -1043,6 +1044,8 @@ static void do_material_tex(GPUShadeInput *shi)
 
                        if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
                                if(tex->type==TEX_IMAGE) {
+                                       found_deriv_map = tex->imaflag & TEX_DERIVATIVEMAP;
+
                                        if(tex->imaflag & TEX_NORMALMAP) {
                                                /* normalmap image */
                                                GPU_link(mat, "mtex_normal", texco, GPU_image(tex->ima, &tex->iuser), &tnor );
@@ -1082,9 +1085,10 @@ static void do_material_tex(GPUShadeInput *shi)
                                                        GPU_link(mat, "mtex_blend_normal", tnorfac, shi->vn, newnor, &shi->vn);
                                                }
                                                
-                                       } else if( mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) {
+                                       } else if( (mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) || found_deriv_map) {
                                                /* ntap bumpmap image */
                                                int iBumpSpace;
+                                               float ima_x, ima_y;
                                                float hScale = 0.1f; // compatibility adjustment factor for all bumpspace types
                                                float hScaleTex = 13.0f; // factor for scaling texspace bumps
                                                
@@ -1142,9 +1146,24 @@ static void do_material_tex(GPUShadeInput *shi)
                                                        
                                                        iBumpSpacePrev = iBumpSpace;
                                                }
+
+                                               // resolve texture resolution
+                                               if( (mtex->texflag & MTEX_BUMP_TEXTURESPACE) || found_deriv_map ) {
+                                                       ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser);
+                                                       ima_x= 512.0f; ima_y= 512.f;            // prevent calling textureSize, glsl 1.3 only
+                                                       if(ibuf) {
+                                                               ima_x= ibuf->x;
+                                                               ima_y= ibuf->y;
+                                                       }
+                                               }
                                                
                                                
-                                               if( mtex->texflag & MTEX_3TAP_BUMP )
+                                               if(found_deriv_map) {
+                                                       GPU_link( mat, "mtex_bump_deriv", 
+                                                                 texco, GPU_image(tex->ima, &tex->iuser), GPU_uniform(&ima_x), GPU_uniform(&ima_y), tnorfac,
+                                                                 &dBs, &dBt );
+                                               }
+                                               else if( mtex->texflag & MTEX_3TAP_BUMP )
                                                        GPU_link( mat, "mtex_bump_tap3", 
                                                                  texco, GPU_image(tex->ima, &tex->iuser), tnorfac,
                                                                  &dBs, &dBt );
@@ -1155,12 +1174,6 @@ static void do_material_tex(GPUShadeInput *shi)
                                                
                                                
                                                if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
-                                                       float ima_x= 512.0f, ima_y= 512.f;              // prevent calling textureSize, glsl 1.3 only
-                                                       ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser);
-                                                       if(ibuf) {
-                                                               ima_x= ibuf->x;
-                                                               ima_y= ibuf->y;
-                                                       }
                                                        
                                                        GPU_link( mat, "mtex_bump_apply_texspace",
                                                                  fDet, dBs, dBt, vR1, vR2, 
index feb0a84fa874a551fe45263bacd9be4295b0ce46..0aae6d84a01bffbe06c194c2a8c956dfd26307c5 100644 (file)
@@ -1226,6 +1226,22 @@ void mtex_bump_tap5( vec3 texco, sampler2D ima, float hScale,
        dBt = hScale * (Hu - Hd);
 }
 
+void mtex_bump_deriv( vec3 texco, sampler2D ima, float ima_x, float ima_y, float hScale, 
+                     out float dBs, out float dBt ) 
+{
+       float s = 1;            // negate this if flipped texture coordinate
+       vec2 TexDx = dFdx(texco.xy);
+       vec2 TexDy = dFdy(texco.xy);
+       
+       // this variant using a derivative map is described here
+       // http://mmikkelsen3d.blogspot.com/2011/07/derivative-maps.html
+       vec2 dim = vec2(ima_x, ima_y);
+       vec2 dBduv = hScale*dim*(2*texture2D(ima, texco.xy).xy-1);
+       
+       dBs = dBduv.x*TexDx.x + s*dBduv.y*TexDx.y;
+       dBt = dBduv.x*TexDy.x + s*dBduv.y*TexDy.y;
+}
+
 void mtex_bump_apply( float fDet, float dBs, float dBt, vec3 vR1, vec3 vR2, vec3 vNacc_in,
                                          out vec3 vNacc_out, out vec3 perturbed_norm ) 
 {
index b60f7f1555ee283b8f27489639cd1fc0da377db8..8b23e2b205dbc75bdcadeaf111cc7db2173aba60 100644 (file)
@@ -1,6 +1,6 @@
 /* DataToC output of file <gpu_shader_material_glsl> */
 
-int datatoc_gpu_shader_material_glsl_size= 39207;
+int datatoc_gpu_shader_material_glsl_size= 39783;
 char datatoc_gpu_shader_material_glsl[]= {
  10,102,108,111, 97,116, 32,
 101,120,112, 95, 98,108,101,110,100,101,114, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10,  9,114,101,116,117,114,110, 32,112,
@@ -838,6 +838,24 @@ char datatoc_gpu_shader_material_glsl[]= {
 119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117, 41, 44, 32, 72,117, 32, 41, 59, 10,  9, 10,
   9,100, 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,114, 32, 45, 32, 72,108, 41, 59, 10,  9,100, 66,116, 32,
  61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117, 32, 45, 32, 72,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95, 98,117,109,112, 95,100,101,114,105,118, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,
+101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,120, 44, 32,102,108,111, 97,116, 32,105,109, 97,
+ 95,121, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,100, 66,116, 32, 41, 32, 10,123, 10,  9,102,108,111, 97,116, 32,115, 32, 61, 32, 49, 59,  9,  9, 47, 47, 32,110,101,103, 97,
+116,101, 32,116,104,105,115, 32,105,102, 32,102,108,105,112,112,101,100, 32,116,101,120,116,117,114,101, 32, 99,111,111,114,100,
+105,110, 97,116,101, 10,  9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,
+121, 41, 59, 10,  9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41,
+ 59, 10,  9, 10,  9, 47, 47, 32,116,104,105,115, 32,118, 97,114,105, 97,110,116, 32,117,115,105,110,103, 32, 97, 32,100,101,114,
+105,118, 97,116,105,118,101, 32,109, 97,112, 32,105,115, 32,100,101,115, 99,114,105, 98,101,100, 32,104,101,114,101, 10,  9, 47,
+ 47, 32,104,116,116,112, 58, 47, 47,109,109,105,107,107,101,108,115,101,110, 51,100, 46, 98,108,111,103,115,112,111,116, 46, 99,
+111,109, 47, 50, 48, 49, 49, 47, 48, 55, 47,100,101,114,105,118, 97,116,105,118,101, 45,109, 97,112,115, 46,104,116,109,108, 10,
+  9,118,101, 99, 50, 32,100,105,109, 32, 61, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 44, 32,105,109, 97, 95,121, 41, 59, 10,
+  9,118,101, 99, 50, 32,100, 66,100,117,118, 32, 61, 32,104, 83, 99, 97,108,101, 42,100,105,109, 42, 40, 50, 42,116,101,120,116,
+117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 46,120,121, 45, 49, 41, 59, 10,  9, 10,  9,100,
+ 66,115, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,120, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121,
+ 42, 84,101,120, 68,120, 46,121, 59, 10,  9,100, 66,116, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,121, 46,120,
+ 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,121, 46,121, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
 101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116,
  32,100, 66,115, 44, 32,102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,
 118, 82, 50, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10,  9,  9,  9,  9,  9, 32, 32,111,117,116, 32,118,
index 3f391b91c0fd47f40b8a0414752881f1430c3afb..7f1eef803186dc04bb83b4862a4cb97919c1240d 100644 (file)
@@ -397,10 +397,10 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
                                        float acc[4]={0,0,0,0};
                                        k = 0;
 
-                                       /*if (check_pixel_assigned(srcbuf, srcmask, filter_make_index(x-1, y, width, height), depth, is_float) ||
+                                       if (check_pixel_assigned(srcbuf, srcmask, filter_make_index(x-1, y, width, height), depth, is_float) ||
                                                check_pixel_assigned(srcbuf, srcmask, filter_make_index(x+1, y, width, height), depth, is_float) ||
                                                check_pixel_assigned(srcbuf, srcmask, filter_make_index(x, y-1, width, height), depth, is_float) ||
-                                               check_pixel_assigned(srcbuf, srcmask, filter_make_index(x, y+1, width, height), depth, is_float))*/ {
+                                               check_pixel_assigned(srcbuf, srcmask, filter_make_index(x, y+1, width, height), depth, is_float)) {
                                                for(i= -n; i<=n; i++) {
                                                        for(j=-n; j<=n; j++) {
                                                                if(i != 0 || j != 0) {
index e5f924b5fa6ba7aeb0c252caabecba113ef72da6..829d1eee03b09ce2b86d31e8011015d81f8d76b2 100644 (file)
@@ -54,7 +54,10 @@ typedef struct SDNA {
 
                                                   (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
                                                   type and name numbers respectively */
-       
+
+       struct GHash *structs_map; /* ghash for faster lookups,
+                                                                 requires WITH_DNA_GHASH to be used for now */
+
                /* wrong place for this really, its a simple
                 * cache for findstruct_nr.
                 */
index e81a9979c12864de15b881cdc4021199e86beccf..6e850a07d94a2941cd5a6012253229cb3301a21a 100644 (file)
@@ -342,6 +342,7 @@ typedef struct TexMapping {
 #define TEX_NORMALMAP  2048
 #define TEX_GAUSS_MIP  4096
 #define TEX_FILTER_MIN 8192
+#define TEX_DERIVATIVEMAP      16384
 
 /* texfilter */
 // TXF_BOX -> blender's old texture filtering method
index 429db63b5266f459ff0a078ae2c28e7ba098e3f7..5edebfe3903bdc091b82328bb515e14ccbadca3e 100644 (file)
 
 # message(STATUS "Configuring makesdna")
 
+# add_definitions(-DWITH_DNA_GHASH)
+
 blender_include_dirs(
        ../../../../intern/guardedalloc
        ../../blenloader
+       ../../blenlib
        ..
 )
 
+
+# -----------------------------------------------------------------------------
 # Build makesdna executable
 set(SRC
        makesdna.c
@@ -56,6 +61,8 @@ add_custom_command(
        DEPENDS makesdna
 )
 
+
+# -----------------------------------------------------------------------------
 # Build bf_dna library
 set(INC
 
@@ -72,3 +79,22 @@ set(SRC
 )
 
 blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}")
+
+
+# -----------------------------------------------------------------------------
+# Build bf_dna_blenlib library
+set(INC
+
+)
+
+set(INC_SYS
+
+)
+
+set(SRC
+       ../../blenlib/intern/BLI_mempool.c
+       ../../blenlib/intern/listbase.c
+       ../../blenlib/intern/BLI_ghash.c
+)
+
+blender_add_lib(bf_dna_blenlib "${SRC}" "${INC}" "${INC_SYS}")
index e51ee53e07894e7d10fcbe740861f9ae8f7c3960..8185676cbfc69c807d1cb172797c35adf795dd72 100644 (file)
@@ -67,5 +67,6 @@ else:
     else:
         dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
 
+# TODO, get WITH_DNA_GHASH working, see CMake's 'WITH_DNA_GHASH'
 obj = ['intern/dna.c', 'intern/dna_genfile.c']
 Return ('obj')
index 4e9b023b3260c224a4e5cc18acdfda0cbc81e084..ebcfce84e3733bd5d02def50693493029925591f 100644 (file)
 
 #include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN
 
+#ifdef WITH_DNA_GHASH
+#  include "BLI_ghash.h"
+#endif
+
 #include "DNA_genfile.h"
 #include "DNA_sdna_types.h" // for SDNA ;-)
 
@@ -197,7 +201,11 @@ void DNA_sdna_free(SDNA *sdna)
        MEM_freeN((void *)sdna->names);
        MEM_freeN(sdna->types);
        MEM_freeN(sdna->structs);
-       
+
+#ifdef WITH_DNA_GHASH
+       BLI_ghash_free(sdna->structs_map, NULL, NULL);
+#endif
+
        MEM_freeN(sdna);
 }
 
@@ -275,24 +283,30 @@ static short *findstruct_name(SDNA *sdna, const char *str)
 int DNA_struct_find_nr(SDNA *sdna, const char *str)
 {
        short *sp= NULL;
-       int a;
 
        if(sdna->lastfind<sdna->nr_structs) {
                sp= sdna->structs[sdna->lastfind];
                if(strcmp( sdna->types[ sp[0] ], str )==0) return sdna->lastfind;
        }
 
-       for(a=0; a<sdna->nr_structs; a++) {
+#ifdef WITH_DNA_GHASH
+       return (intptr_t)BLI_ghash_lookup(sdna->structs_map, str) - 1;
+#else
+       {
+               int a;
 
-               sp= sdna->structs[a];
-               
-               if(strcmp( sdna->types[ sp[0] ], str )==0) {
-                       sdna->lastfind= a;
-                       return a;
+               for(a=0; a<sdna->nr_structs; a++) {
+
+                       sp= sdna->structs[a];
+
+                       if(strcmp( sdna->types[ sp[0] ], str )==0) {
+                               sdna->lastfind= a;
+                               return a;
+                       }
                }
        }
-       
        return -1;
+#endif
 }
 
 /* ************************* END DIV ********************** */
@@ -481,6 +495,16 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
                                        sp[10]= 9;
                        }
                }
+
+#ifdef WITH_DNA_GHASH
+               /* create a ghash lookup to speed up */
+               sdna->structs_map= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "init_structDNA gh");
+
+               for(nr = 0; nr < sdna->nr_structs; nr++) {
+                       sp= sdna->structs[nr];
+                       BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], (void *)(nr + 1));
+               }
+#endif
        }
 }
 
index b706db5e64c87f0eeb2a522c95c9a9e11de971a2..1cb24630fbe709599387ce76402e59f98c30240d 100644 (file)
@@ -54,7 +54,7 @@ if env['WITH_BF_PYTHON']:
 if env['WITH_BF_COLLADA']:
     defs.append('WITH_COLLADA')
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index cb593e7deab26a2a6eae730df85fc6451de0e166..cc7bcf04716e70e430939e53f694763afdb17228 100644 (file)
@@ -243,6 +243,7 @@ blender_include_dirs_sys(
 
 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
 target_link_libraries(makesrna bf_dna)
+target_link_libraries(makesrna bf_dna_blenlib)
 
 # Output rna_*_gen.c
 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
index 5e43ed9b2fbcd039f70b0ad7535c11c30532f792..24c892b96c444a5608135dfd5a3599a3f157ed34 100644 (file)
@@ -91,7 +91,7 @@ if env['WITH_BF_PYTHON']:
 if env['WITH_BF_COLLADA']:
     defs.append('WITH_COLLADA')
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
@@ -140,7 +140,7 @@ targetpath = root_build_dir+'/makesrna'
 if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
     targetpath = '#' + targetpath
 
-if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
+if env['OURPLATFORM'] == 'linux' and root_build_dir[0]==os.sep:
     makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib'])
 else:
     makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_dna', 'bf_blenlib'])
index 1ce4108bab2af08f5acf107f46e744ef5d412520..1b2396a4215639cb98295a4e23a14c1a6c0fda07 100644 (file)
@@ -294,6 +294,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL);
        RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions");
        RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 
        prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "goalspring");
@@ -313,6 +314,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING);
        RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group");
        RNA_def_property_update(prop, 0, "rna_cloth_update");
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
        
        prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "Cdis");
index ca679239dd3bdffd2114ac832d3ed1e3b6df5f8c..463f65fd3d5ab4db73cfc42acc3b1de0325ae882 100644 (file)
@@ -770,7 +770,6 @@ static void rna_def_pointcache(BlenderRNA *brna)
        prop= RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, point_cache_compress_items);
        RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
-       RNA_def_property_update(prop, 0, NULL);
 
        /* flags */
        prop= RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
index 5cc8539f187abd3e96520f20c40982a3e832c657..1f64603d6b4f3a159d343512568b42698812f7d1 100644 (file)
@@ -803,7 +803,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
        prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "axis");
        RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is usually the main direction input");
-       RNA_def_property_range(prop, 1, 2);
+       RNA_def_property_range(prop, 1, 8);
        RNA_def_property_update(prop, NC_LOGIC, NULL);
 
        prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
index 8c4e4d9e736aa7af32c20da702f0a06b8b901ffc..476ac325848287403bc9e3de8713ad407d7af52d 100644 (file)
@@ -1481,7 +1481,7 @@ static void rna_def_wipe(BlenderRNA *brna)
 #if 1 /* expose as radians */
        prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL);
-       RNA_def_property_range(prop, DEG2RAD(-90.0f), DEG2RAD(90.0f));
+       RNA_def_property_range(prop, DEG2RAD(-90.0), DEG2RAD(90.0));
 #else
        prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "angle");
index 43d1aa242297e14bf271c4b439b7035da9dec5fa..d439c2551f14eafb177505d546bce02e8a02b90d 100644 (file)
@@ -241,13 +241,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
        RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
        RNA_def_property_enum_items(prop, smoke_cache_comp_items);
        RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
-       RNA_def_property_update(prop, 0, NULL);
 
        prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
        RNA_def_property_enum_items(prop, smoke_domain_colli_items);
        RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object.");
-       RNA_def_property_update(prop, 0, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
 
        prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "EffectorWeights");
@@ -290,14 +289,12 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
        RNA_def_property_range(prop, 0.001, 1);
        RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
        RNA_def_property_ui_text(prop, "Density", "");
-       RNA_def_property_update(prop, 0, NULL); // NC_OBJECT|ND_MODIFIER
 
        prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "temp");
        RNA_def_property_range(prop, -10, 10);
        RNA_def_property_ui_range(prop, -10, 10, 1, 1);
        RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
-       RNA_def_property_update(prop, 0, NULL);
        
        prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "psys");
@@ -309,24 +306,20 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
        prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
        RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
-       RNA_def_property_update(prop, 0, NULL);
 
        prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
        RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area.");
-       RNA_def_property_update(prop, 0, NULL);
 
        prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
        RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
-       RNA_def_property_update(prop, 0, NULL);
 
        prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "vel_multi");
        RNA_def_property_range(prop, -2.0, 2.0);
        RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
        RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
-       RNA_def_property_update(prop, 0, NULL);
 }
 
 static void rna_def_smoke_coll_settings(BlenderRNA *brna)
index 9e3a31ddb2e15a992ece8ea7f100ce9194bcf7bc..f459563f49eff6b34a5d66bcc6770d324c9622cd 100644 (file)
@@ -1147,6 +1147,12 @@ static void rna_def_texture_image(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
        RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
        RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+       /* Derivative Map */
+       prop= RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP);
+       RNA_def_property_ui_text(prop, "Derivative Map", "Uses red and green as derivative values");
+       RNA_def_property_update(prop, 0, "rna_Texture_update");
 }
 
 static void rna_def_texture_plugin(BlenderRNA *brna)
index 4bed612144cb945f1074562bf530e5eeeaa75b2a..8d17c6f5e164aeafb12f57c79032f1b5c529c140 100644 (file)
@@ -26,7 +26,7 @@ if env['WITH_BF_PYTHON']:
     if env['BF_DEBUG']:
         defs.append('_DEBUG')
 
-if env['OURPLATFORM'] == 'linux2':
+if env['OURPLATFORM'] == 'linux':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
 
index f5761f713a6166a48432916fd539d684eb3019f2..7be0998c0a1dccc409f2263646ea49c5b675ff4f 100644 (file)
@@ -210,8 +210,8 @@ static void randuvec(float v[3])
        if((r = 1.f - v[2] * v[2]) > 0.f) {
                float a = (float)(6.283185307f * frand());
                r = (float)sqrt(r);
-               v[0] = (float)(r * cos(a));
-               v[1] = (float)(r * sin(a));
+               v[0] = (float)(r * cosf(a));
+               v[1] = (float)(r * sinf(a));
        }
        else {
                v[2] = 1.f;
@@ -254,7 +254,7 @@ static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args)
        if(!PyArg_ParseTuple(args, "(fff)|i:noise", &x, &y, &z, &nb))
                return NULL;
 
-       return PyFloat_FromDouble((2.0 * BLI_gNoise(1.0, x, y, z, 0, nb) - 1.0));
+       return PyFloat_FromDouble((2.0f * BLI_gNoise(1.0f, x, y, z, 0, nb) - 1.0f));
 }
 
 /*-------------------------------------------------------------------------*/
@@ -264,11 +264,11 @@ static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args)
 static void noise_vector(float x, float y, float z, int nb, float v[3])
 {
        /* Simply evaluate noise at 3 different positions */
-       v[0] = (float)(2.0 * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
-                                nb) - 1.0);
-       v[1] = (float)(2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0);
-       v[2] = (float)(2.0 * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
-                                nb) - 1.0);
+       v[0]= (float)(2.0f * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
+                                nb) - 1.0f);
+       v[1]= (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
+       v[2]= (float)(2.0f * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
+                                nb) - 1.0f);
 }
 
 static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args)
@@ -291,7 +291,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
        float amp, out, t;
        int i;
        amp = 1.f;
-       out = (float)(2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0);
+       out = (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
        if(hard)
                out = (float)fabs(out);
        for(i = 1; i < oct; i++) {
@@ -299,7 +299,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
                x *= freqscale;
                y *= freqscale;
                z *= freqscale;
-               t = (float)(amp * (2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0));
+               t = (float)(amp * (2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f));
                if(hard)
                        t = (float)fabs(t);
                out += t;
index 8bd6e6c611c14dd2821204838d43ba56e2f36b1e..e5e90380d61a1fe174145feccbd9cbf9f1dd3d94 100644 (file)
@@ -87,6 +87,14 @@ static double        bpy_timer_run; /* time for each python script run */
 static double  bpy_timer_run_tot; /* accumulate python runs */
 #endif
 
+/* use for updating while a python script runs - in case of file load */
+void bpy_context_update(bContext *C)
+{
+       BPy_SetContext(C);
+       bpy_import_main_set(CTX_data_main(C));
+       BPY_modules_update(C); /* can give really bad results if this isnt here */
+}
+
 void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
 {
        py_call_level++;
@@ -95,16 +103,7 @@ void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
                *gilstate= PyGILState_Ensure();
 
        if(py_call_level==1) {
-
-               if(C) { // XXX - should always be true.
-                       BPy_SetContext(C);
-                       bpy_import_main_set(CTX_data_main(C));
-               }
-               else {
-                       fprintf(stderr, "ERROR: Python context called with a NULL Context. this should not happen!\n");
-               }
-
-               BPY_modules_update(C); /* can give really bad results if this isnt here */
+               bpy_context_update(C);
 
 #ifdef TIME_PY_RUN
                if(bpy_timer_count==0) {
@@ -570,6 +569,12 @@ void BPY_modules_load_user(bContext *C)
        if(bmain==NULL)
                return;
 
+       /* update pointers since this can run from a nested script
+        * on file load */
+       if(py_call_level) {
+               bpy_context_update(C);
+       }
+
        bpy_context_set(C, &gilstate);
 
        for(text=CTX_data_main(C)->text.first; text; text= text->id.next) {
index ba8145c27737a989fb1a66b55f0b85d62a700e70..7255387205798b5d400d77d4550515b04d106430 100644 (file)
@@ -84,7 +84,9 @@ int pyrna_struct_validity_check(BPy_StructRNA *pysrna)
 {
        if(pysrna->ptr.type)
                return 0;
-       PyErr_Format(PyExc_ReferenceError, "StructRNA of type %.200s has been removed", Py_TYPE(pysrna)->tp_name);
+       PyErr_Format(PyExc_ReferenceError,
+                    "StructRNA of type %.200s has been removed",
+                    Py_TYPE(pysrna)->tp_name);
        return -1;
 }
 
@@ -790,43 +792,62 @@ static PyObject *pyrna_struct_str(BPy_StructRNA *self)
        const char *name;
 
        if(!PYRNA_STRUCT_IS_VALID(self)) {
-               return PyUnicode_FromFormat("<bpy_struct, %.200s dead>", Py_TYPE(self)->tp_name);
+               return PyUnicode_FromFormat("<bpy_struct, %.200s dead>",
+                                           Py_TYPE(self)->tp_name);
        }
 
        /* print name if available */
        name= RNA_struct_name_get_alloc(&self->ptr, NULL, FALSE);
        if(name) {
-               ret= PyUnicode_FromFormat("<bpy_struct, %.200s(\"%.200s\")>", RNA_struct_identifier(self->ptr.type), name);
+               ret= PyUnicode_FromFormat("<bpy_struct, %.200s(\"%.200s\")>",
+                                         RNA_struct_identifier(self->ptr.type),
+                                         name);
                MEM_freeN((void *)name);
                return ret;
        }
 
-       return PyUnicode_FromFormat("<bpy_struct, %.200s at %p>", RNA_struct_identifier(self->ptr.type), self->ptr.data);
+       return PyUnicode_FromFormat("<bpy_struct, %.200s at %p>",
+                                   RNA_struct_identifier(self->ptr.type),
+                                   self->ptr.data);
 }
 
 static PyObject *pyrna_struct_repr(BPy_StructRNA *self)
 {
        ID *id= self->ptr.id.data;
+       PyObject *tmp_str;
+       PyObject *ret;
+
        if(id == NULL || !PYRNA_STRUCT_IS_VALID(self))
                return pyrna_struct_str(self); /* fallback */
 
+       tmp_str= PyUnicode_FromString(id->name+2);
+
        if(RNA_struct_is_ID(self->ptr.type)) {
-               return PyUnicode_FromFormat("bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id->name+2);
+               ret= PyUnicode_FromFormat("bpy.data.%s[%R]",
+                                           BKE_idcode_to_name_plural(GS(id->name)),
+                                           tmp_str);
        }
        else {
-               PyObject *ret;
                const char *path;
                path= RNA_path_from_ID_to_struct(&self->ptr);
                if(path) {
-                       ret= PyUnicode_FromFormat("bpy.data.%s[\"%s\"].%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, path);
+                       ret= PyUnicode_FromFormat("bpy.data.%s[%R].%s",
+                                                 BKE_idcode_to_name_plural(GS(id->name)),
+                                                 tmp_str,
+                                                 path);
                        MEM_freeN((void *)path);
                }
                else { /* cant find, print something sane */
-                       ret= PyUnicode_FromFormat("bpy.data.%s[\"%s\"]...%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, RNA_struct_identifier(self->ptr.type));
+                       ret= PyUnicode_FromFormat("bpy.data.%s[%R]...%s",
+                                                 BKE_idcode_to_name_plural(GS(id->name)),
+                                                 tmp_str,
+                                                 RNA_struct_identifier(self->ptr.type));
                }
-
-               return ret;
        }
+
+       Py_DECREF(tmp_str);
+
+       return ret;
 }
 
 static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
@@ -870,7 +891,11 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
                name= RNA_struct_name_get_alloc(&ptr, NULL, FALSE);
 
                if(name) {
-                       ret= PyUnicode_FromFormat("<bpy_%.200s, %.200s.%.200s(\"%.200s\")>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name);
+                       ret= PyUnicode_FromFormat("<bpy_%.200s, %.200s.%.200s(\"%.200s\")>",
+                                                 type_fmt,
+                                                 RNA_struct_identifier(self->ptr.type),
+                                                 RNA_property_identifier(self->prop),
+                                                 name);
                        MEM_freeN((void *)name);
                        return ret;
                }
@@ -878,40 +903,59 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
        if(RNA_property_type(self->prop) == PROP_COLLECTION) {
                PointerRNA r_ptr;
                if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
-                       return PyUnicode_FromFormat("<bpy_%.200s, %.200s>", type_fmt, RNA_struct_identifier(r_ptr.type));
+                       return PyUnicode_FromFormat("<bpy_%.200s, %.200s>",
+                                                   type_fmt,
+                                                   RNA_struct_identifier(r_ptr.type));
                }
        }
 
-       return PyUnicode_FromFormat("<bpy_%.200s, %.200s.%.200s>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop));
+       return PyUnicode_FromFormat("<bpy_%.200s, %.200s.%.200s>",
+                                   type_fmt,
+                                   RNA_struct_identifier(self->ptr.type),
+                                   RNA_property_identifier(self->prop));
 }
 
 static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
 {
-       ID *id;
+       ID *id= self->ptr.id.data;
+       PyObject *tmp_str;
        PyObject *ret;
        const char *path;
 
        PYRNA_PROP_CHECK_OBJ(self)
 
-       if((id= self->ptr.id.data) == NULL)
+       if(id == NULL)
                return pyrna_prop_str(self); /* fallback */
 
+       tmp_str= PyUnicode_FromString(id->name+2);
+
        path= RNA_path_from_ID_to_property(&self->ptr, self->prop);
        if(path) {
-               ret= PyUnicode_FromFormat("bpy.data.%s[\"%s\"].%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, path);
+               ret= PyUnicode_FromFormat("bpy.data.%s[%R].%s",
+                                         BKE_idcode_to_name_plural(GS(id->name)),
+                                         tmp_str,
+                                         path);
                MEM_freeN((void *)path);
        }
        else { /* cant find, print something sane */
-               ret= PyUnicode_FromFormat("bpy.data.%s[\"%s\"]...%s", BKE_idcode_to_name_plural(GS(id->name)), id->name+2, RNA_property_identifier(self->prop));
+               ret= PyUnicode_FromFormat("bpy.data.%s[%R]...%s",
+                                         BKE_idcode_to_name_plural(GS(id->name)),
+                                         tmp_str,
+                                         RNA_property_identifier(self->prop));
        }
 
+       Py_DECREF(tmp_str);
+
        return ret;
 }
 
 
 static PyObject *pyrna_func_repr(BPy_FunctionRNA *self)
 {
-       return PyUnicode_FromFormat("<%.200s %.200s.%.200s()>", Py_TYPE(self)->tp_name, RNA_struct_identifier(self->ptr.type), RNA_function_identifier(self->func));
+       return PyUnicode_FromFormat("<%.200s %.200s.%.200s()>",
+                                   Py_TYPE(self)->tp_name,
+                                   RNA_struct_identifier(self->ptr.type),
+                                   RNA_function_identifier(self->func));
 }
 
 
@@ -2995,7 +3039,9 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
        else if (self->ptr.type == &RNA_Context) {
                bContext *C= self->ptr.data;
                if(C==NULL) {
-                       PyErr_Format(PyExc_AttributeError, "bpy_struct: Context is 'NULL', can't get \"%.200s\" from context", name);
+                       PyErr_Format(PyExc_AttributeError,
+                                    "bpy_struct: Context is 'NULL', can't get \"%.200s\" from context",
+                                    name);
                        ret= NULL;
                }
                else {
@@ -3054,7 +3100,9 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
        }
        else {
 #if 0
-               PyErr_Format(PyExc_AttributeError, "bpy_struct: attribute \"%.200s\" not found", name);
+               PyErr_Format(PyExc_AttributeError,
+