synched branch with trunk at revision 29109
authorNick Samarin <nicks1987@bigmir.net>
Mon, 31 May 2010 23:44:43 +0000 (23:44 +0000)
committerNick Samarin <nicks1987@bigmir.net>
Mon, 31 May 2010 23:44:43 +0000 (23:44 +0000)
210 files changed:
CMake/macros.cmake
CMakeLists.txt
SConstruct
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
config/win64-vc-config.py
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
release/datafiles/blenderbuttons
release/scripts/io/export_fbx.py
release/scripts/io/import_anim_bvh.py
release/scripts/keyingsets/keyingsets_utils.py
release/scripts/modules/add_object_utils.py [new file with mode: 0644]
release/scripts/modules/bpy/__init__.py
release/scripts/modules/bpy_types.py
release/scripts/op/add_mesh_torus.py
release/scripts/op/console_python.py
release/scripts/op/object.py
release/scripts/op/sequencer.py
release/scripts/op/uv.py
release/scripts/op/uvcalc_follow_active.py
release/scripts/op/wm.py
release/scripts/templates/operator_modal_view3d.py [new file with mode: 0644]
release/scripts/ui/properties_animviz.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_render.py
release/scripts/ui/space_info.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/sca.c
source/blender/blenlib/BLI_args.h
source/blender/blenlib/intern/BLI_args.c
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/threads.c
source/blender/blenloader/BLO_writefile.h
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/CMakeLists.txt
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/armature/poselib.c
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_file/Makefile
source/blender/editors/space_file/SConscript
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/writeimage.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/Makefile
source/blender/editors/space_image/SConscript
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_select.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_conversions.c
source/blender/gpu/GPU_draw.h
source/blender/gpu/intern/gpu_draw.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_thumbs.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/Makefile
source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/dynlibtiff.c [deleted file]
source/blender/imbuf/intern/dynlibtiff.h [deleted file]
source/blender/imbuf/intern/filetype.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/thumbs_blend.c [new file with mode: 0644]
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/Makefile
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/nodes/intern/CMP_nodes/CMP_displace.c
source/blender/python/BPY_extern.h
source/blender/python/doc/sphinx_doc_gen.py
source/blender/python/generic/mathutils_vector.c
source/blender/python/intern/bpy_driver.c
source/blender/python/intern/bpy_interface.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/texture.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/wm_event_types.h
source/creator/CMakeLists.txt
source/creator/Makefile
source/creator/SConscript
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ModifierDeformer.cpp
source/gameengine/Converter/BL_ModifierDeformer.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/PyDoc/bge.events.rst
source/gameengine/PyDoc/bge.logic.rst
source/gameengine/PyDoc/bge.render.rst
source/gameengine/PyDoc/bge.types.rst
source/nan_definitions.mk
source/nan_link.mk
tools/Blender.py
tools/btools.py
tools/crossmingw.py

index 73458d7312e80cb595d304970dfc0a2d631d6651..54b14dbd5ce4e0efff485b2d097ea101fd8b8737 100644 (file)
@@ -61,6 +61,9 @@ MACRO(SETUP_LIBDIRS)
   IF(WITH_OPENEXR)
     LINK_DIRECTORIES(${OPENEXR_LIBPATH})
   ENDIF(WITH_OPENEXR)
+  IF(WITH_TIFF)
+    LINK_DIRECTORIES(${TIFF_LIBPATH})
+  ENDIF(WITH_TIFF)
   IF(WITH_QUICKTIME)
     LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
   ENDIF(WITH_QUICKTIME)
@@ -134,6 +137,9 @@ MACRO(SETUP_LIBLINKS
   IF(WITH_QUICKTIME)
     TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
   ENDIF(WITH_QUICKTIME)
+  IF(WITH_TIFF)
+    TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
+  ENDIF(WITH_TIFF)
   IF(WITH_OPENEXR)
     IF(WIN32)
       FOREACH(loop_var ${OPENEXR_LIB})
index 038b61e56a687f86dbd5b7a6f5408d8c935a656b..287b3394456a5d3d3ecac3997e4a7757295aa430 100644 (file)
@@ -1,4 +1,4 @@
- # $Id$
+# $Id$
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # This program is free software; you can redistribute it and/or
@@ -63,6 +63,7 @@ OPTION(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 OPTION(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
 OPTION(WITH_ELBEEM        "Enable Elbeem (Fluid Simulation)" ON)
 OPTION(WITH_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
+OPTION(WITH_TIFF          "Enable LibTIFF Support" ON)
 OPTION(WITH_DDS           "Enable DDS Support" ON)
 OPTION(WITH_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
 OPTION(WITH_PYTHON        "Enable Embedded Python API" ON)
@@ -91,7 +92,7 @@ IF(UNIX AND NOT APPLE)
        OPTION(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org/)"      OFF)
 ELSE()
        OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
-       OPTION(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org/)"      ON)
+       OPTION(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org/)"      OFF)
 ENDIF()
 
 IF (APPLE)
@@ -124,11 +125,9 @@ IF(UNIX AND NOT APPLE)
 
        IF(WITH_OPENAL)
                FIND_PACKAGE(OpenAL)
-               IF(OPENAL_FOUND)
-                       SET(WITH_OPENAL ON)
-               ELSE(OPENAL_FOUND)
+               IF(NOT OPENAL_FOUND)
                        SET(WITH_OPENAL OFF)
-               ENDIF(OPENAL_FOUND)
+               ENDIF(NOT OPENAL_FOUND)
        ENDIF(WITH_OPENAL)
 
        IF(WITH_JACK)
@@ -163,19 +162,23 @@ IF(UNIX AND NOT APPLE)
        FIND_PACKAGE(Freetype)
        # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
 
-       # No way to set py31. remove for now.
-       # FIND_PACKAGE(PythonLibs)
-       SET(PYTHON /usr)
-       SET(PYTHON_VERSION 3.1)
-       SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
-       # SET(PYTHON_BINARY python) # not used yet
-       SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
-       SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
-  
-       # FIND_PACKAGE(PythonInterp) # not used yet
-       # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
-  
-       SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
+
+       IF(WITH_PYTHON)
+               # No way to set py31. remove for now.
+               # FIND_PACKAGE(PythonLibs)
+               SET(PYTHON /usr)
+               SET(PYTHON_VERSION 3.1)
+               SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+               # SET(PYTHON_BINARY python) # not used yet
+               SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
+               SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
+       
+               # FIND_PACKAGE(PythonInterp) # not used yet
+               # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
+
+               SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
+       ENDIF(WITH_PYTHON)
+
 
        IF(WITH_SDL)
                FIND_PACKAGE(SDL)
@@ -185,23 +188,27 @@ IF(UNIX AND NOT APPLE)
                ENDIF(NOT SDL_FOUND)
        ENDIF(WITH_SDL)
 
-    SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
-       FIND_PATH(OPENEXR_INC
-               ImfXdr.h
-               PATHS
-        ${OPENEXR}/include/OpenEXR
-               /usr/local/include/OpenEXR
-               /sw/include/OpenEXR
-               /opt/local/include/OpenEXR
-               /opt/csw/include/OpenEXR
-               /opt/include/OpenEXR
-       )
-       SET(OPENEXR_LIB Half IlmImf Iex Imath)
-
-       SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
-       SET(FFMPEG_INC ${FFMPEG}/include)
-       SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
-       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+       IF(WITH_OPENEXR)
+               SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
+               FIND_PATH(OPENEXR_INC
+                       ImfXdr.h
+                       PATHS
+                       ${OPENEXR}/include/OpenEXR
+                       /usr/local/include/OpenEXR
+                       /sw/include/OpenEXR
+                       /opt/local/include/OpenEXR
+                       /opt/csw/include/OpenEXR
+                       /opt/include/OpenEXR
+               )
+               SET(OPENEXR_LIB Half IlmImf Iex Imath)
+       ENDIF(WITH_OPENEXR)
+
+       IF(WITH_FFMPEG)
+               SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
+               SET(FFMPEG_INC ${FFMPEG}/include)
+               SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
+               SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+       ENDIF(WITH_FFMPEG)
   
        IF(WITH_FFTW3)
                SET(FFTW3 /usr)
@@ -215,6 +222,13 @@ IF(UNIX AND NOT APPLE)
        SET(LIBSAMPLERATE_LIB samplerate)
        SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
 
+       IF(WITH_TIFF)
+               FIND_PACKAGE(TIFF)
+               IF(NOT TIFF_FOUND)
+                       SET(WITH_TIFF OFF)
+               ENDIF(NOT TIFF_FOUND)
+       ENDIF(WITH_TIFF)
+
        FIND_PACKAGE(JPEG REQUIRED)
 
        FIND_PACKAGE(PNG REQUIRED)
@@ -241,6 +255,10 @@ IF(UNIX AND NOT APPLE)
        IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
                # BSD's dont use libdl.so
                SET(LLIBS "${LLIBS} -ldl")
+
+               # binreloc is linux only
+               SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
+               SET(BINRELOC_INC ${BINRELOC}/include)
        ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
        IF(WITH_OPENMP)
@@ -261,6 +279,7 @@ IF(UNIX AND NOT APPLE)
        INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
 ENDIF(UNIX AND NOT APPLE)
 
+
 IF(WIN32)
 
        # this file is included anyway when building under Windows with cl.exe
@@ -273,133 +292,19 @@ IF(WIN32)
                message("64 bit compiler detected.")
                SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
        ENDIF(CMAKE_CL_64)
+       
+       ADD_DEFINITIONS(-DWIN32)
 
-       SET(PYTHON ${LIBDIR}/python)
-       SET(PYTHON_VERSION 3.1)
-       SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
-       # SET(PYTHON_BINARY python) # not used yet
-       SET(PYTHON_LIB python31)
-       SET(PYTHON_LIBPATH ${PYTHON}/lib)
-
-       SET(OPENAL ${LIBDIR}/openal)
-       SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
-       SET(OPENAL_LIBRARY wrap_oal)
-       SET(OPENAL_LIBPATH ${OPENAL}/lib)
-
-       IF(WITH_JACK)
-               SET(JACK ${LIBDIR}/jack)
-               SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
-               SET(JACK_LIB libjack)
-               SET(JACK_LIBPATH ${JACK}/lib)
-       ENDIF(WITH_JACK)
-
-       IF(WITH_SNDFILE)
-               SET(SNDFILE ${LIBDIR}/sndfile)
-               SET(SNDFILE_INC ${SNDFILE}/include)
-               SET(SNDFILE_LIB libsndfile-1)
-               SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
-       ENDIF(WITH_SNDFILE)
-
-       IF(CMAKE_CL_64)
-               SET(PNG_LIBRARIES libpng)
-       ELSE(CMAKE_CL_64)
-               SET(PNG_LIBRARIES libpng_st)
-       ENDIF(CMAKE_CL_64)
-       SET(JPEG_LIBRARY libjpeg)
-
-       SET(ZLIB ${LIBDIR}/zlib)
-       SET(ZLIB_INC ${ZLIB}/include)
-       IF(CMAKE_CL_64)
-               SET(ZLIB_LIBRARIES libz)
-       ELSE(CMAKE_CL_64)
-               SET(ZLIB_LIBRARIES zlib)
-       ENDIF(CMAKE_CL_64)
-       SET(ZLIB_LIBPATH ${ZLIB}/lib)
-  
-       SET(PTHREADS ${LIBDIR}/pthreads)
-       SET(PTHREADS_INC ${PTHREADS}/include)
-       SET(PTHREADS_LIB pthreadVC2)
-       SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
-  
        SET(ICONV ${LIBDIR}/iconv)
        SET(ICONV_INC ${ICONV}/include)
        SET(ICONV_LIB iconv)
        SET(ICONV_LIBPATH ${ICONV}/lib)
-  
-       IF(WITH_FFTW3)
-               SET(FFTW3 ${LIBDIR}/fftw3)
-               SET(FFTW3_INC ${FFTW3}/include)
-               SET(FFTW3_LIB libfftw)
-               SET(FFTW3_LIBPATH ${FFTW3}/lib)
-       ENDIF(WITH_FFTW3)
-  
-       SET(GETTEXT ${LIBDIR}/gettext)
-       SET(GETTEXT_INC ${GETTEXT}/include)
-       IF(CMAKE_CL_64)
-               SET(GETTEXT_LIB gettext)
-       ELSE(CMAKE_CL_64)
-               SET(GETTEXT_LIB gnu_gettext)
-       ENDIF(CMAKE_CL_64)
-       SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
-
-       SET(FREETYPE ${LIBDIR}/freetype)
-       SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
-       SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
-       SET(FREETYPE_LIBRARY freetype2ST)
-  
-       SET(OPENEXR ${LIBDIR}/openexr)
-       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
-       SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
-       IF (MSVC80)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
-       ELSE (MSVC80)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
-       ENDIF(MSVC80)
-       IF (MSVC90)
-               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
-       ENDIF(MSVC90)
-
-  
-       SET(QUICKTIME ${LIBDIR}/QTDevWin)
-       SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
-       SET(QUICKTIME_LIB qtmlClient)
-       SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
-
-       SET(FFMPEG ${LIBDIR}/ffmpeg)
-       SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
-       SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
-       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
 
        SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
        SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
        SET(LIBSAMPLERATE_LIB libsamplerate)
        SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
 
-       IF(CMAKE_CL_64)
-               SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
-       ELSE(CMAKE_CL_64)
-               SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
-       ENDIF(CMAKE_CL_64)
-
-       SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
-       SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
-
-       IF(WITH_OPENMP)
-               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
-               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
-       ENDIF(WITH_OPENMP)
-
-       SET(SDL ${LIBDIR}/sdl)
-       SET(SDL_INCLUDE_DIR ${SDL}/include)
-       SET(SDL_LIBRARY SDL)
-       SET(SDL_LIBPATH ${SDL}/lib)
-
        SET(PNG "${LIBDIR}/png")
        SET(PNG_INC "${PNG}/include")
        SET(PNG_LIBPATH ${PNG}/lib)
@@ -408,30 +313,266 @@ IF(WIN32)
        SET(JPEG_INC "${JPEG}/include")
        SET(JPEG_LIBPATH ${JPEG}/lib)
 
-       SET(TIFF ${LIBDIR}/tiff)
-       SET(TIFF_INC ${TIFF}/include)
-  
        SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
-       SET(OPENCOLLADA ${LIBDIR}/opencollada)
-       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
-       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
-       SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
-       #pcre is bundled with openCollada
-       #SET(PCRE ${LIBDIR}/pcre)
-       #SET(PCRE_LIBPATH ${PCRE}/lib)
-       SET(PCRE_LIB pcre)
+       IF(WITH_PYTHON)
+               SET(PYTHON ${LIBDIR}/python)
+               SET(PYTHON_VERSION 3.1)
+               SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
+               # SET(PYTHON_BINARY python) # not used yet
+               SET(PYTHON_LIB python31)
+               SET(PYTHON_LIBPATH ${PYTHON}/lib)
+       ENDIF(WITH_PYTHON)
 
+       IF(WITH_OPENAL)
+               SET(OPENAL ${LIBDIR}/openal)
+               SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
+               SET(OPENAL_LIBRARY wrap_oal)
+               SET(OPENAL_LIBPATH ${OPENAL}/lib)
+       ENDIF(WITH_OPENAL)
+
+       IF(WITH_SNDFILE)
+               SET(SNDFILE ${LIBDIR}/sndfile)
+               SET(SNDFILE_INC ${SNDFILE}/include)
+               SET(SNDFILE_LIB libsndfile-1)
+               SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
+       ENDIF(WITH_SNDFILE)
+
+       IF(WITH_SDL)
+               SET(SDL ${LIBDIR}/sdl)
+               SET(SDL_INCLUDE_DIR ${SDL}/include)
+               SET(SDL_LIBRARY SDL)
+               SET(SDL_LIBPATH ${SDL}/lib)
+       ENDIF(WITH_SDL)
+
+       IF(WITH_QUICKTIME)
+               SET(QUICKTIME ${LIBDIR}/QTDevWin)
+               SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
+               SET(QUICKTIME_LIB qtmlClient)
+               SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
+       ENDIF(WITH_QUICKTIME)
+
+       IF(MSVC)
+               IF(CMAKE_CL_64)
+                       SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
+               ELSE(CMAKE_CL_64)
+                       SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+               ENDIF(CMAKE_CL_64)
+               
+               SET(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
+               SET(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
+
+               SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
+               SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
+               
+               IF(WITH_OPENMP)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
+                       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
+               ENDIF(WITH_OPENMP)
+               
+               SET(GETTEXT ${LIBDIR}/gettext)
+               SET(GETTEXT_INC ${GETTEXT}/include)
+               SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
+               IF(CMAKE_CL_64)
+                       SET(GETTEXT_LIB gettext)
+               ELSE(CMAKE_CL_64)
+                       SET(GETTEXT_LIB gnu_gettext)
+               ENDIF(CMAKE_CL_64)
+
+               IF(CMAKE_CL_64)
+                       SET(PNG_LIBRARIES libpng)
+               ELSE(CMAKE_CL_64)
+                       SET(PNG_LIBRARIES libpng_st)
+               ENDIF(CMAKE_CL_64)
+               SET(JPEG_LIBRARY libjpeg)
+
+               SET(ZLIB ${LIBDIR}/zlib)
+               SET(ZLIB_INC ${ZLIB}/include)
+               SET(ZLIB_LIBPATH ${ZLIB}/lib)
+               IF(CMAKE_CL_64)
+                       SET(ZLIB_LIBRARIES libz)
+               ELSE(CMAKE_CL_64)
+                       SET(ZLIB_LIBRARIES zlib)
+               ENDIF(CMAKE_CL_64)
+
+               SET(PTHREADS ${LIBDIR}/pthreads)
+               SET(PTHREADS_INC ${PTHREADS}/include)
+               SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
+               SET(PTHREADS_LIB pthreadVC2)
+               
+               SET(FREETYPE ${LIBDIR}/freetype)
+               SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+               SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
+               SET(FREETYPE_LIBRARY freetype2ST)
+
+               IF(WITH_FFTW3)
+                       SET(FFTW3 ${LIBDIR}/fftw3)
+                       SET(FFTW3_LIB libfftw)
+                       SET(FFTW3_INC ${FFTW3}/include)
+                       SET(FFTW3_LIBPATH ${FFTW3}/lib)
+               ENDIF(WITH_FFTW3)
+
+               IF(WITH_OPENCOLLADA)
+                       SET(OPENCOLLADA ${LIBDIR}/opencollada)
+                       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+                       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+                       SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
+                       #pcre is bundled with openCollada
+                       #SET(PCRE ${LIBDIR}/pcre)
+                       #SET(PCRE_LIBPATH ${PCRE}/lib)
+                       SET(PCRE_LIB pcre)
+               ENDIF(WITH_OPENCOLLADA)
+               
+               IF(WITH_FFMPEG)
+                       SET(FFMPEG ${LIBDIR}/ffmpeg)
+                       SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
+                       SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
+                       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+               ENDIF(WITH_FFMPEG)
+
+               IF(WITH_OPENEXR)
+                       SET(OPENEXR ${LIBDIR}/openexr)
+                       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
+                       SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
+                       IF (MSVC80)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
+                       ELSE (MSVC80)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
+                       ENDIF(MSVC80)
+                       IF (MSVC90)
+                               SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
+                       ENDIF(MSVC90)
+               ENDIF(WITH_OPENEXR)
+
+               IF(WITH_TIFF)
+                       SET(TIFF ${LIBDIR}/tiff)
+                       SET(TIFF_LIBRARY libtiff)
+                       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
+                       SET(TIFF_LIBPATH ${TIFF}/lib)
+               ENDIF(WITH_TIFF)
+
+               IF(WITH_JACK)
+                       SET(JACK ${LIBDIR}/jack)
+                       SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
+                       SET(JACK_LIB libjack)
+                       SET(JACK_LIBPATH ${JACK}/lib)
+               ENDIF(WITH_JACK)
+
+               # MSVC only, Mingw doesnt need
+               IF(CMAKE_CL_64)
+                       SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+               ELSE(CMAKE_CL_64)
+                       SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
+               ENDIF(CMAKE_CL_64)
+         
+               SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
+
+       ELSE(MSVC) # MINGW
+               SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
+
+               SET(CMAKE_CXX_FLAGS                "-pipe -funsigned-char -fno-strict-aliasing -mwindows" CACHE STRING "Mingw C++ flags ")
+               SET(CMAKE_C_FLAGS                  "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C flags ")
+
+               SET(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g" CACHE STRING "Mingw debug C++ flags ")
+               SET(CMAKE_CXX_FLAGS_RELEASE        "   -O2" CACHE STRING "Mingw release C++ flags ")
+               SET(CMAKE_CXX_FLAGS_MINSIZEREL     "   -Os" CACHE STRING "Mingw minsize release C++ flags ")
+               SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Mingw release, debug C++ flags ")
+
+               SET(CMAKE_C_FLAGS_DEBUG            "-O0 -g" CACHE STRING "Mingw debug C flags ")
+               SET(CMAKE_C_FLAGS_RELEASE          "-O2"    CACHE STRING "Mingw release C flags ")
+               SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os"    CACHE STRING "Mingw minsize release C flags ")
+               SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g" CACHE STRING "Mingw release, debug C++ flags ")
+               ADD_DEFINITIONS(-DFREE_WINDOWS)
+               
+               IF(WITH_OPENMP)
+                       SET(LLIBS "${LLIBS} -lgomp")
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
+                       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+               ENDIF(WITH_OPENMP)
+
+               SET(GETTEXT ${LIBDIR}/gcc/gettext)
+               SET(GETTEXT_INC ${GETTEXT}/include)
+               SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
+               SET(GETTEXT_LIB intl)
+
+               SET(JPEG_LIBRARY jpeg)
+               SET(PNG_LIBRARIES png)
+
+               SET(ZLIB ${LIBDIR}/zlib)
+               SET(ZLIB_INC ${ZLIB}/include)
+               SET(ZLIB_LIBPATH ${ZLIB}/lib)
+               SET(ZLIB_LIBRARIES z)
+
+               SET(PTHREADS ${LIBDIR}/pthreads)
+               SET(PTHREADS_INC ${PTHREADS}/include)
+               SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
+               SET(PTHREADS_LIB pthreadGC2)
+               
+               SET(FREETYPE ${LIBDIR}/gcc/freetype)
+               SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+               SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
+               SET(FREETYPE_LIBRARY freetype)
+
+               IF(WITH_FFTW3)
+                       SET(FFTW3 ${LIBDIR}/gcc/fftw3)
+                       SET(FFTW3_LIB fftw3)
+                       SET(FFTW3_INC ${FFTW3}/include)
+                       SET(FFTW3_LIBPATH ${FFTW3}/lib)
+               ENDIF(WITH_FFTW3)
+
+               IF(WITH_OPENCOLLADA)
+                       SET(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
+                       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+                       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
+                       SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
+                       #pcre is bundled with openCollada
+                       #SET(PCRE ${LIBDIR}/pcre)
+                       #SET(PCRE_LIBPATH ${PCRE}/lib)
+                       SET(PCRE_LIB pcre)
+               ENDIF(WITH_OPENCOLLADA)
+               
+               IF(WITH_FFMPEG)
+                       SET(FFMPEG ${LIBDIR}/ffmpeg)
+                       SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include)
+                       SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
+                       SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+               ENDIF(WITH_FFMPEG)
+
+               IF(WITH_OPENEXR)
+                       SET(OPENEXR ${LIBDIR}/gcc/openexr)
+                       SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
+                       SET(OPENEXR_LIB Half IlmImf Iex)
+                       SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
+               ENDIF(WITH_OPENEXR)
+
+               IF(WITH_TIFF)
+                       SET(TIFF ${LIBDIR}/gcc/tiff)
+                       SET(TIFF_LIBRARY tiff)
+                       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
+                       SET(TIFF_LIBPATH ${TIFF}/lib)
+               ENDIF(WITH_TIFF)
+
+               IF(WITH_JACK)
+                       SET(JACK ${LIBDIR}/jack)
+                       SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
+                       SET(JACK_LIB jack)
+                       SET(JACK_LIBPATH ${JACK}/lib)
+                       
+                       # TODO, gives linking errors, force off
+                       SET(WITH_JACK OFF)
+               ENDIF(WITH_JACK)
+
+       ENDIF(MSVC)
 
-       IF(CMAKE_CL_64)
-               SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
-       ELSE(CMAKE_CL_64)
-               SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
-       ENDIF(CMAKE_CL_64)
-  
-       SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
 ENDIF(WIN32)
 
+
 IF(APPLE)
        IF(WITH_LIBS10.5)
                SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
@@ -478,7 +619,7 @@ IF(APPLE)
                # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
                SET(PYTHON_LIB python${PYTHON_VERSION})
                SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
-               #    SET(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+               # SET(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
        ELSE(PYTHON_VERSION MATCHES 3.1)
                # otherwise, use custom system framework
 
@@ -585,7 +726,9 @@ IF(APPLE)
        SET(JPEG_LIBPATH ${JPEG}/lib)
 
        SET(TIFF ${LIBDIR}/tiff)
-       SET(TIFF_INC ${TIFF}/include)
+       SET(TIFF_INCLUDE_DIR ${TIFF}/include)
+       SET(TIFF_LIBRARY tiff)
+       SET(TIFF_LIBPATH ${TIFF}/lib)
 
        SET(EXETYPE MACOSX_BUNDLE)
 
@@ -608,11 +751,6 @@ IF(APPLE)
 
 ENDIF(APPLE)
 
-IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-       SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
-       SET(BINRELOC_INC ${BINRELOC}/include)
-ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-
 
 # buildinfo
 IF(WITH_BUILDINFO)
index 30d8788f040936311e892937c4da87d9a4187c15..dc6198bd81e384346a94dd8e2be7ac488f7359fe 100644 (file)
@@ -182,7 +182,7 @@ if os.path.exists(userconfig):
 else:
        print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
 
-opts = btools.read_opts(optfiles, B.arguments)
+opts = btools.read_opts(env, optfiles, B.arguments)
 opts.Update(env)
 
 if not env['BF_FANCY']:
@@ -457,8 +457,6 @@ if  env['OURPLATFORM']!='darwin':
                                if env['WITH_BF_FHS']:  dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[2:]))      # skip bin/.blender
                                else:                                   dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[1:]))      # skip bin
                                
-                               # print dir+ os.sep + f
-                               print dir
                                dottargetlist.append(dir + os.sep + f)
                                        
 
@@ -569,10 +567,12 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
 
        #currently win64-vc doesn't appear to have libpng.dll
        if env['OURPLATFORM'] != 'win64-vc':
-               dllsources += ['${BF_PNG_LIBPATH}/libpng.dll',
-                               '${BF_ZLIB_LIBPATH}/zlib.dll']
+               dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
 
-       dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
+       dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
+       # Used when linking to libtiff was dynamic
+       # keep it here until compilation on all platform would be ok
+       # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
 
        if env['OURPLATFORM'] != 'linuxcross':
                # pthreads library is already added
index bac4c9ab165a4a14267621025b5d3bd5ed5010a6..2c3d0a7e87e93909be80fb4f0d4e6892e94be46c 100644 (file)
@@ -163,8 +163,11 @@ BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'png'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
+WITH_BF_TIFF = True
 BF_TIFF = LIBDIR + '/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'tiff'
+BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
 
 WITH_BF_ZLIB = True
 BF_ZLIB = '/usr'
index 3951dac2454fdfddcb11b3791c0230a7e46a5dfc..199ea391d4e5b409ccb4d659eafb3590a20d4d46 100644 (file)
@@ -68,8 +68,10 @@ BF_PNG = '/usr'
 BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'png'
 
+WITH_BF_TIFF = True
 BF_TIFF = '/usr'
 BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'tiff'
 
 WITH_BF_ZLIB = True
 BF_ZLIB = '/usr'
index fe5e954f3bcc00d5daae6661047704eb4f397509..0f8a15a8c75036100afd672811c27ea7d9b9deb5 100644 (file)
@@ -55,7 +55,7 @@ WITH_BF_OPENEXR = True
 WITH_BF_STATICOPENEXR = False
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = ' Half IlmImf Iex '
+BF_OPENEXR_LIB = ' Half IlmImf Iex IlmThread '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@@ -75,9 +75,9 @@ BF_PNG_LIB = 'png'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
 WITH_BF_TIFF = True
-BF_TIFF = LIBDIR + '/tiff'
+BF_TIFF = LIBDIR + '/gcc/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
-BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIB = 'tiff'
 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
 
 WITH_BF_ZLIB = True
@@ -174,9 +174,6 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
 WITH_BF_RAYOPTIMIZATION = False
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
 
-CC = 'i586-mingw32msvc-gcc'
-CXX = 'i586-mingw32msvc-g++'
-
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 
 CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
index 9088db5a5d8493422bdbe9b6dbf3860a0a5a07d9..141658d32170bc0c8a96eb7c15b6f37f45f30a1e 100644 (file)
@@ -54,7 +54,7 @@ WITH_BF_OPENEXR = True
 WITH_BF_STATICOPENEXR = False
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = ' Half IlmImf Iex '
+BF_OPENEXR_LIB = ' Half IlmImf Iex IlmThread '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@@ -73,9 +73,10 @@ BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'png'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
-BF_TIFF = LIBDIR + '/tiff'
+WITH_BF_TIFF = True
+BF_TIFF = LIBDIR + '/gcc/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
-BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIB = 'tiff'
 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
 
 WITH_BF_ZLIB = True
index 3e8dfc3d5dfbbe2ae374d76248d9373a8d50d3a4..b3766247d2de9797d7ed8cd89ce54f46859ac178 100644 (file)
@@ -79,6 +79,7 @@ BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'libpng_st'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
+WITH_BF_TIFF = True
 BF_TIFF = LIBDIR + '/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
 BF_TIFF_LIB = 'libtiff'
index 41772dea14b5c6de76e0f363be0a6d196ed64b9f..c1cbb7cfee8384bb68dd1a7d7eedfaa24a96c356 100644 (file)
@@ -75,6 +75,7 @@ BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'libpng'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
+WITH_BF_TIFF = True
 BF_TIFF = LIBDIR + '/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
 BF_TIFF_LIB = 'libtiff'
index eb89258e1dd208d62230a59d05646914c9d748fb..2cec24714be82b1383fae0f0aa1356f7b3f4d4ac 100644 (file)
@@ -1106,7 +1106,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
                                        {
                                                droppedStr = [droppedArray objectAtIndex:i];
                                                
-                                               pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+                                               pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
                                                temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1); 
                                        
                                                if (!temp_buff) {
@@ -1114,7 +1114,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
                                                        break;
                                                }
                                        
-                                               strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+                                               strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
                                                temp_buff[pastedTextSize] = '\0';
                                                
                                                strArray->strings[i] = temp_buff;
@@ -1125,7 +1125,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
                                        
                                case GHOST_kDragnDropTypeString:
                                        droppedStr = (NSString*)data;
-                                       pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+                                       pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
                                        
                                        temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1); 
                                        
@@ -1133,7 +1133,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
                                                return GHOST_kFailure;
                                        }
                                        
-                                       strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+                                       strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
                                        
                                        temp_buff[pastedTextSize] = '\0';
                                        
index 19c3e061159c55082a5c9d1f3660863a8cf8e65a..1da6485019875b3849b846a54b0bc43ef56e3d9a 100644 (file)
@@ -162,7 +162,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
                        height = th;
                        top = rect.top;
                }
-               else if(top > rect.top)
+               else if(top < rect.top)
                        top = rect.top;
 
                m_hWnd = ::CreateWindow(
index a38525c7f461586576104488f463e9b410fa6338..b9fa75cc2540dda65beeb0290ebaee2d29568014 100644 (file)
Binary files a/release/datafiles/blenderbuttons and b/release/datafiles/blenderbuttons differ
index ee92399287f31a3e34b5947735d179dfeb738346..f0b20837e26c2f94089be6e8dc89142087cc38fd 100644 (file)
@@ -1504,17 +1504,14 @@ def write(filename, batch_objects = None, \
         file.write('\n\t\tPolygonVertexIndex: ')
         i=-1
         for f in me.faces:
-            fi = [v for v in f.verts]
-            # fi = [v_index for j, v_index in enumerate(f.verts) if v_index != 0 or j != 3]
-#                      fi = [v.index for v in f]
+            fi = f.verts[:]
 
-            # flip the last index, odd but it looks like
-            # this is how fbx tells one face from another
-            fi[-1] = -(fi[-1]+1)
+            # last index XORd w. -1 indicates end of face
+            fi[-1] = fi[-1] ^ -1
             fi = tuple(fi)
+
             if i==-1:
                 if len(fi) == 3:       file.write('%i,%i,%i' % fi )
-#                              if len(f) == 3:         file.write('%i,%i,%i' % fi )
                 else:                          file.write('%i,%i,%i,%i' % fi )
                 i=0
             else:
@@ -1522,10 +1519,26 @@ def write(filename, batch_objects = None, \
                     file.write('\n\t\t')
                     i=0
                 if len(fi) == 3:       file.write(',%i,%i,%i' % fi )
-#                              if len(f) == 3:         file.write(',%i,%i,%i' % fi )
                 else:                          file.write(',%i,%i,%i,%i' % fi )
             i+=1
 
+        # write loose edges as faces.
+        for ed in me.edges:
+            if ed.loose:
+                ed_val = ed.verts[:]
+                ed_val = ed_val[0], ed_val[-1] ^ -1
+
+                if i==-1:
+                    file.write('%i,%i' % ed_val)
+                    i=0
+                else:
+                    if i==13:
+                        file.write('\n\t\t')
+                        i=0
+                    file.write(',%i,%i' % ed_val)
+            i+=1
+
+
         file.write('\n\t\tEdges: ')
         i=-1
         for ed in me.edges:
@@ -2960,8 +2973,7 @@ Takes:  {''')
     # --------------------------- Footer
     if world:
         m = world.mist
-        has_mist = m.enabled
-#              has_mist = world.mode & 1
+        has_mist = m.use_mist
         mist_intense = m.intensity
         mist_start = m.start
         mist_end = m.depth
index bab692f9daf75fec08c574ee5dcb171fa5df19ef..4a708d684c82dde8a048d0b2aa6cd10d63bc59a7 100644 (file)
@@ -458,13 +458,11 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
             pose_bone = pose_bones[bone_name]
             pose_bone.rotation_mode = eul_order_lookup[tuple(bvh_node.rot_order)]
 
-    elif ROT_MODE == 'XYZ':
-        print(2)
+    elif ROT_MODE != 'QUATERNION':
         for pose_bone in pose_bones:
-            pose_bone.rotation_mode = 'XYZ'
+            pose_bone.rotation_mode = ROT_MODE
     else:
         # Quats default
-        print(3)
         pass
 
     context.scene.update()
@@ -520,13 +518,13 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
             lx, ly, lz, rx, ry, rz = bvh_node.anim_data[frame_current + 1]
 
             if bvh_node.has_rot:
-                bone_rotation_matrix = Euler(rx, ry, rz).to_matrix().resize4x4()
+                bone_rotation_matrix = Euler((rx, ry, rz)).to_matrix().resize4x4()
                 bone_rotation_matrix = bone_rest_matrix_inv * bone_rotation_matrix * bone_rest_matrix
 
                 if ROT_MODE == 'QUATERNION':
                     pose_bone.rotation_quaternion = bone_rotation_matrix.to_quat()
                 else:
-                    euler = bone_rotation_matrix.to_euler('XYZ', prev_euler[i]) # pose_bone.rotation_mode # TODO, XYZ default for now
+                    euler = bone_rotation_matrix.to_euler(pose_bone.rotation_mode, prev_euler[i])
                     pose_bone.rotation_euler = euler
                     prev_euler[i] = euler
 
@@ -569,17 +567,17 @@ class BvhImporter(bpy.types.Operator):
     loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False)
     rotate_mode = EnumProperty(items=(
             ('QUATERNION', "Quaternion", "Convert rotations to quaternions"),
-            ('NATIVE', "Euler (Native)", "Use the rotation order defined in the BVH file"),
+            ('NATIVE', "Euler (Native)", "Use the rotation order defined in the BVH file"),
             ('XYZ', "Euler (XYZ)", "Convert rotations to euler XYZ"),
-            ('XZY', "Euler (XZY)", "Convert rotations to euler XZY"),
-            ('YXZ', "Euler (YXZ)", "Convert rotations to euler YXZ"),
-            ('YZX', "Euler (YZX)", "Convert rotations to euler YZX"),
-            ('ZXY', "Euler (ZXY)", "Convert rotations to euler ZXY"),
-            # ('ZYX', "Euler (ZYX)", "Convert rotations to euler ZYX")),
+            ('XZY', "Euler (XZY)", "Convert rotations to euler XZY"),
+            ('YXZ', "Euler (YXZ)", "Convert rotations to euler YXZ"),
+            ('YZX', "Euler (YZX)", "Convert rotations to euler YZX"),
+            ('ZXY', "Euler (ZXY)", "Convert rotations to euler ZXY"),
+            ('ZYX', "Euler (ZYX)", "Convert rotations to euler ZYX"),
             ),
                 name="Rotation",
                 description="Rotation conversion.",
-                default='QUATERNION')
+                default='NATIVE')
 
     def execute(self, context):
         # print("Selected: " + context.active_object.name)
index 777f5f052e20310e3f4587730785932d9114bcea..77b0f3ebacdbe360be478ac6933bdb8ab11a9e63 100644 (file)
@@ -26,7 +26,7 @@ def RKS_POLL_selected_objects(ksi, context):
 def RKS_POLL_selected_bones(ksi, context):
     # we must be in Pose Mode, and there must be some bones selected 
     if (context.active_object) and (context.active_object.mode == 'POSE'):
-        if context.active_pose_bone or len(context.select_pose_bones):
+        if context.active_pose_bone or len(context.selected_pose_bones):
             return True;
     
     # nothing selected 
diff --git a/release/scripts/modules/add_object_utils.py b/release/scripts/modules/add_object_utils.py
new file mode 100644 (file)
index 0000000..350191a
--- /dev/null
@@ -0,0 +1,82 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+import bpy
+import mathutils
+
+def add_object_align_init(context, operator):
+
+    if operator and operator.properties.is_property_set("location") and operator.properties.is_property_set("rotation"):
+        location = mathutils.TranslationMatrix(mathutils.Vector(operator.properties.location))
+        rotation = mathutils.Euler(operator.properties.rotation).to_matrix().resize4x4()
+    else:
+        # TODO, local view cursor!
+        location = mathutils.TranslationMatrix(context.scene.cursor_location)
+
+        if context.user_preferences.edit.object_align == 'VIEW' and context.space_data.type == 'VIEW_3D':
+            rotation = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+        else:
+            rotation = mathutils.Matrix()
+
+        # set the operator properties
+        if operator:
+            operator.properties.location = location.translation_part()
+            operator.properties.rotation = rotation.to_euler()
+
+    return location * rotation
+
+
+def add_object_data(context, obdata, operator=None):
+
+    scene = context.scene
+
+    # ugh, could be made nicer
+    for ob in scene.objects:
+        ob.selected = False
+
+    obj_new = bpy.data.objects.new(obdata.name, obdata)
+
+    base = scene.objects.link(obj_new)
+    base.selected = True
+
+    if context.space_data and context.space_data.type == 'VIEW_3D':
+        base.layers_from_view(context.space_data)
+
+
+    obj_new.matrix = add_object_align_init(context, operator)
+
+    obj_act = scene.objects.active
+
+    if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type:
+        bpy.ops.object.mode_set(mode='OBJECT')
+
+        obj_act.selected = True
+        scene.update() # apply location
+        #scene.objects.active = obj_new
+
+        bpy.ops.object.join() # join into the active.
+
+        bpy.ops.object.mode_set(mode='EDIT')
+    else:
+        scene.objects.active = obj_new
+        if context.user_preferences.edit.enter_edit_mode:
+            bpy.ops.object.mode_set(mode='EDIT')
+
+    return base
index f0025290f097440bff9a5497ebc1d556d9d17412..1e6db441599a461d58e5dcee84457767a8ac586b 100644 (file)
@@ -43,17 +43,11 @@ def _main():
     ## people need to explain how this is even a fix.
     # _sys.path[:] = filter(None, _sys.path)
 
-    # a bit nasty but this prevents help() and input() from locking blender
-    # Ideally we could have some way for the console to replace sys.stdin but
-    # python would lock blender while waiting for a return value, not easy :|
-
-    if not app.debug:
-        _sys.stdin = None
-
     # because of how the console works. we need our own help() pager func.
     # replace the bold function because it adds crazy chars
     import pydoc
     pydoc.getpager = lambda: pydoc.plainpager
+    pydoc.Helper.getline = lambda self, prompt: None
     pydoc.TextDoc.bold = lambda self, text: text
 
 
index edead35dafeb87d4411689d5ebd0d4a53c259cba..28a30c232a9483594c4591422278171d5b7b2b72 100644 (file)
@@ -38,6 +38,16 @@ class Context(StructRNA):
         return new_context
 
 
+class Group(bpy_types.ID):
+    __slots__ = ()
+
+    @property
+    def users_dupli_object(self):
+        """The dupli group this group is used in, XXX, TODO, WHY DOESNT THIS WORK???"""
+        import bpy
+        return tuple(obj for obj in bpy.data.objects if self == obj.dupli_object)
+
+
 class Object(bpy_types.ID):
     __slots__ = ()
 
@@ -48,18 +58,16 @@ class Object(bpy_types.ID):
         return tuple(child for child in bpy.data.objects if child.parent == self)
 
     @property
-    def group_users(self):
+    def users_group(self):
         """The groups this object is in"""
         import bpy
-        name = self.name
-        return tuple(group for group in bpy.data.groups if name in group.objects)
+        return tuple(group for group in bpy.data.groups if self in group.objects[:])
 
     @property
-    def scene_users(self):
+    def users_scene(self):
         """The scenes this object is in"""
         import bpy
-        name = self.name
-        return tuple(scene for scene in bpy.data.scenes if name in scene.objects)
+        return tuple(scene for scene in bpy.data.scenes if self in scene.objects[:])
 
 
 class _GenericBone:
@@ -303,7 +311,7 @@ class Mesh(bpy_types.ID):
         edge_face_count_dict = self.edge_face_count_dict
         return [edge_face_count_dict.get(ed.key, 0) for ed in self.edges]
 
-    def edge_loops(self, faces=None, seams=()):
+    def edge_loops_from_faces(self, faces=None, seams=()):
         """
         Edge loops defined by faces
 
@@ -314,7 +322,7 @@ class Mesh(bpy_types.ID):
         return a list of edge key lists
         [ [(0,1), (4, 8), (3,8)], ...]
 
-        optionaly, seams are edge keys that will be removed
+        return a list of edge vertex index lists
         """
 
         OTHER_INDEX = 2, 3, 0, 1 # opposite face index
@@ -379,6 +387,71 @@ class Mesh(bpy_types.ID):
 
         return edge_loops
 
+    def edge_loops_from_edges(self, edges=None):
+        """
+        Edge loops defined by edges
+
+        Takes me.edges or a list of edges and returns the edge loops
+
+        return a list of vertex indices.
+        [ [1, 6, 7, 2], ...]
+
+        closed loops have matching start and end values.
+        """
+        line_polys = []
+        
+        # Get edges not used by a face
+        if edges is None:
+            edges = self.edges
+
+        if not hasattr(edges, "pop"):
+            edges = edges[:]
+
+        edge_dict= dict((ed.key, ed) for ed in self.edges if ed.selected)
+        
+        while edges:
+            current_edge= edges.pop()
+            vert_end, vert_start = current_edge.verts[:]
+            line_poly = [vert_start, vert_end]
+
+            ok = True
+            while ok:
+                ok = False
+                #for i, ed in enumerate(edges):
+                i = len(edges)
+                while i:
+                    i -= 1
+                    ed = edges[i]
+                    v1, v2 = ed.verts
+                    if v1 == vert_end:
+                        line_poly.append(v2)
+                        vert_end = line_poly[-1]
+                        ok = 1
+                        del edges[i]
+                        #break
+                    elif v2 == vert_end:
+                        line_poly.append(v1)
+                        vert_end = line_poly[-1]
+                        ok = 1
+                        del edges[i]
+                        #break
+                    elif v1 == vert_start:
+                        line_poly.insert(0, v2)
+                        vert_start = line_poly[0]
+                        ok = 1
+                        del edges[i]
+                        #break    
+                    elif v2 == vert_start:
+                        line_poly.insert(0, v1)
+                        vert_start = line_poly[0]
+                        ok = 1
+                        del edges[i]
+                        #break
+            line_polys.append(line_poly)
+
+        return line_polys
+
+
 
 class MeshEdge(StructRNA):
     __slots__ = ()
index f9ca0f604683f67157fcc5139845a007b0ad9181..16bf4e1c92c6f9093dffc6cf8a69fcd9f25fe098 100644 (file)
@@ -102,6 +102,10 @@ class AddTorus(bpy.types.Operator):
             description="Total Interior Radius of the torus",
             default=0.5, min=0.01, max=100.0)
 
+    # generic transform props
+    location = FloatVectorProperty(name="Location")
+    rotation = FloatVectorProperty(name="Rotation")
+
     def execute(self, context):
         props = self.properties
 
@@ -120,36 +124,10 @@ class AddTorus(bpy.types.Operator):
         mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4))
         mesh.verts.foreach_set("co", verts_loc)
         mesh.faces.foreach_set("verts_raw", faces)
-
-        scene = context.scene
-
-        # ugh
-        for ob in scene.objects:
-            ob.selected = False
-
         mesh.update()
-        ob_new = bpy.data.objects.new("Torus", mesh)
-        scene.objects.link(ob_new)
-        ob_new.selected = True
-
-        ob_new.location = scene.cursor_location
-
-        obj_act = scene.objects.active
-
-        if obj_act and obj_act.mode == 'EDIT':
-            bpy.ops.object.mode_set(mode='OBJECT')
-
-            obj_act.selected = True
-            scene.update() # apply location
-            #scene.objects.active = ob_new
-
-            bpy.ops.object.join() # join into the active.
 
-            bpy.ops.object.mode_set(mode='EDIT')
-        else:
-            scene.objects.active = ob_new
-            if context.user_preferences.edit.enter_edit_mode:
-                bpy.ops.object.mode_set(mode='EDIT')
+        import add_object_utils
+        add_object_utils.add_object_data(context, mesh, operator=self)
 
         return {'FINISHED'}
 
index 87abe0b6f4762e609866561969c7b94a8f46c497..1f0d9dbde605a84a2d7b7d06be716fe42e513433 100644 (file)
@@ -85,7 +85,7 @@ def execute(context):
     sc = context.space_data
 
     try:
-        line = sc.history[-1].line
+        line_object = sc.history[-1]
     except:
         return {'CANCELLED'}
 
@@ -102,13 +102,26 @@ def execute(context):
     sys.stdout = stdout
     sys.stderr = stderr
 
-    # run the console
-    if not line.strip():
-        line_exec = '\n'  # executes a multiline statement
-    else:
-        line_exec = line
+    # dont allow the stdin to be used, can lock blender.
+    stdin_backup = sys.stdin
+    sys.stdin = None
+
+    # incase exception happens
+    line = "" # incase of encodingf error
+    is_multiline = False
+
+    try:
+        line = line_object.line
 
-    is_multiline = console.push(line_exec)
+        # run the console, "\n" executes a multiline statement
+        line_exec = line if line.strip() else "\n"
+
+        is_multiline = console.push(line_exec)
+    except:
+        # unlikely, but this can happen with unicode errors for example.
+        import traceback
+        stderr.write(traceback.format_exc())
+        
 
     stdout.seek(0)
     stderr.seek(0)
@@ -144,6 +157,9 @@ def execute(context):
     if output_err:
         add_scrollback(output_err, 'ERROR')
 
+    # restore the stdin
+    sys.stdin = stdin_backup
+
     return {'FINISHED'}
 
 
@@ -154,23 +170,37 @@ def autocomplete(context):
 
     console = get_console(hash(context.region))[0]
 
-    current_line = sc.history[-1]
-    line = current_line.line
-
     if not console:
         return {'CANCELLED'}
 
     if sc.console_type != 'PYTHON':
         return {'CANCELLED'}
 
-    # This function isnt aware of the text editor or being an operator
-    # just does the autocomp then copy its results back
-    current_line.line, current_line.current_character, scrollback = \
-        intellisense.expand(
-            line=current_line.line,
-            cursor=current_line.current_character,
-            namespace=console.locals,
-            private=bpy.app.debug)
+    # dont allow the stdin to be used, can lock blender.
+    # note: unlikely stdin would be used for autocomp. but its possible.
+    stdin_backup = sys.stdin
+    sys.stdin = None
+    
+    scrollback = ""
+    scrollback_error = ""
+
+    try:
+        current_line = sc.history[-1]
+        line = current_line.line
+
+        # This function isnt aware of the text editor or being an operator
+        # just does the autocomp then copy its results back
+        current_line.line, current_line.current_character, scrollback = \
+            intellisense.expand(
+                line=current_line.line,
+                cursor=current_line.current_character,
+                namespace=console.locals,
+                private=bpy.app.debug)
+    except:
+        # unlikely, but this can happen with unicode errors for example.
+        # or if the api attribute access its self causes an error.
+        import traceback
+        scrollback_error = traceback.format_exc()
 
     # Separate automplete output by command prompts
     if scrollback != '':
@@ -182,6 +212,12 @@ def autocomplete(context):
     if scrollback:
         add_scrollback(scrollback, 'INFO')
 
+    if scrollback_error:
+        add_scrollback(scrollback_error, 'ERROR')
+
+    # restore the stdin
+    sys.stdin = stdin_backup
+
     context.area.tag_redraw()
 
     return {'FINISHED'}
index 8a11ef7aaf69e8d83c07f7a3652b31b4b1cf0766..a6e0930e69c8bc7af1ff63aead87bc6c8f410d07 100644 (file)
@@ -507,6 +507,26 @@ class MakeDupliFace(bpy.types.Operator):
         return {'FINISHED'}
 
 
+class IsolateTypeRender(bpy.types.Operator):
+    '''Select object matching a naming pattern'''
+    bl_idname = "object.isolate_type_render"
+    bl_label = "Isolate Render Selection"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        act_type = context.object.type
+        
+        for obj in context.visible_objects:
+            
+            if obj.selected:
+                obj.restrict_render = False
+            else:
+                if obj.type == act_type:
+                    obj.restrict_render = True
+
+        return {'FINISHED'}
+
+
 classes = [
     SelectPattern,
     SelectCamera,
@@ -514,6 +534,7 @@ classes = [
     SubdivisionSet,
     ShapeTransfer,
     JoinUVs,
+    IsolateTypeRender,
     MakeDupliFace]
 
 
index 8715f7eeec5d5c68942af03c6e0acdc207b1a081..48f83613147f96552a165856fc80644f03681c07 100644 (file)
@@ -94,11 +94,14 @@ class SequencerCutMulticam(bpy.types.Operator):
 
         s = context.scene.sequence_editor.active_strip
 
+        if s.multicam_source == camera:
+            return {'FINISHED'}
+
         if not s.selected:
             s.selected = True
 
         cfra = context.scene.frame_current
-        bpy.ops.sequencer.cut(frame=cfra, type='HARD', side='RIGHT')
+        bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT')
         for s in context.scene.sequence_editor.sequences_all:
             if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
                 context.scene.sequence_editor.active_strip = s
@@ -135,7 +138,6 @@ def register():
     register(SequencerCutMulticam)
     register(SequencerDeinterlaceSelectedMovies)
 
-
 def unregister():
     unregister = bpy.types.unregister
 
@@ -143,5 +145,7 @@ def unregister():
     unregister(SequencerCutMulticam)
     unregister(SequencerDeinterlaceSelectedMovies)
 
+
 if __name__ == "__main__":
     register()
index f22db9d87a8cf2f969ddf06e57f4388603b5208b..ad25553a41c96173c0c311576755c6fcf326cd40 100644 (file)
@@ -167,18 +167,34 @@ class ExportUVLayout(bpy.types.Operator):
             fw('1 setlinewidth\n')
             fw('1 setlinejoin\n')
             fw('1 setlinecap\n')
+            fw('/DRAW {')
+            # can remove from here to next comment to disable filling, aparently alpha is not supported
+            fw('gsave\n')
+            fw('0.7 setgray\n')
+            fw('fill\n')
+            fw('grestore\n')
+            fw('0 setgray\n')
+            # remove to here
+            fw('stroke\n')
+            fw('} def\n')
             fw('newpath\n')
-
+            
+            firstline = True
             for i, uvs in self._face_uv_iter(context):
                 for j, uv in enumerate(uvs):
                     x, y = uv[0], uv[1]
                     if j == 0:
+                        if not firstline:
+                            fw('closepath\n')
+                            fw('DRAW\n')
+                            fw('newpath\n')
+                        firstline = False
                         fw('%.5f %.5f moveto\n' % (x * image_width, y * image_height))
                     else:
                         fw('%.5f %.5f lineto\n' % (x * image_width, y * image_height))
 
             fw('closepath\n')
-            fw('stroke\n')
+            fw('DRAW\n')
             fw('showpage\n')
             fw('%%EOF\n')
 
@@ -203,7 +219,7 @@ def register():
     bpy.types.IMAGE_MT_uvs.append(menu_func)
 
 
-def unreguster():
+def unregister():
     bpy.types.unregister(ExportUVLayout)
     bpy.types.IMAGE_MT_uvs.remove(menu_func)
 
index c8a13441048cf03af9daa2f124a9ce4e9ca92d8b..81229f73461d5ce8be55c9838adc1c2fb7771904 100644 (file)
@@ -180,7 +180,7 @@ def extend(obj, operator, EXTEND_MODE):
     #SEAM = me.edges.seam
 
     if EXTEND_MODE == 'LENGTH':
-        edge_loops = me.edge_loops(face_sel, [ed.key for ed in me.edges if ed.seam])
+        edge_loops = me.edge_loops_from_faces(face_sel, [ed.key for ed in me.edges if ed.seam])
         me_verts = me.verts
         for loop in edge_loops:
             looplen = [0.0]
index af72c96a412f3d894a0d96d4e9275ea0e75a6535..0d204ce72ae64ce93e2a50b308acbdbd5d0fec90 100644 (file)
@@ -418,7 +418,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
 
 
 class WM_OT_url_open(bpy.types.Operator):
-    "Open the Blender Wiki in the Webbrowser"
+    "Open a website in the Webbrowser"
     bl_idname = "wm.url_open"
     bl_label = ""
 
diff --git a/release/scripts/templates/operator_modal_view3d.py b/release/scripts/templates/operator_modal_view3d.py
new file mode 100644 (file)
index 0000000..afe1793
--- /dev/null
@@ -0,0 +1,55 @@
+from mathutils import Vector
+from bpy.props import FloatVectorProperty
+
+class ViewOperator(bpy.types.Operator):
+    '''Translate the view using mouse events.'''
+    bl_idname = "view3d.modal_operator"
+    bl_label = "Simple View Operator"
+
+    offset = FloatVectorProperty(name="Offset", size=3)
+
+
+    def execute(self, context):
+        v3d = context.space_data
+        rv3d = v3d.region_3d
+
+        rv3d.view_location = self._initial_location + Vector(self.properties.offset)
+
+    def modal(self, context, event):
+        v3d = context.space_data
+        rv3d = v3d.region_3d
+
+        if event.type == 'MOUSEMOVE':
+            self.properties.offset = (self._initial_mouse - Vector((event.mouse_x, event.mouse_y, 0.0))) * 0.02
+            self.execute(context)
+
+        elif event.type == 'LEFTMOUSE':
+            return {'FINISHED'}
+
+        elif event.type in ('RIGHTMOUSE', 'ESC'):
+            rv3d.view_location = self._initial_location
+            return {'CANCELLED'}
+
+        return {'RUNNING_MODAL'}
+
+    def invoke(self, context, event):
+
+        if context.space_data.type == 'VIEW_3D':
+            v3d = context.space_data
+            rv3d = v3d.region_3d
+
+            context.manager.add_modal_handler(self)
+
+            if rv3d.view_perspective == 'CAMERA':
+                rv3d.view_perspective = 'PERSP'
+
+            self._initial_mouse = Vector((event.mouse_x, event.mouse_y, 0.0))
+            self._initial_location = rv3d.view_location.copy()
+
+            return {'RUNNING_MODAL'}
+        else:
+            self.report({'WARNING'}, "Active space must be a View3d")
+            return {'CANCELLED'}
+
+
+bpy.types.register(ViewOperator)
index 3e9c2158cb73a040d0a12179740368cc05dea49a..9eb046cc2c888c1a7ea0be42fbc6ce155cc9c5d3 100644 (file)
@@ -61,6 +61,8 @@ class MotionPathButtonsPanel(bpy.types.Panel):
         col.label(text="Display:")
         col.prop(mps, "show_frame_numbers", text="Frame Numbers")
         col.prop(mps, "highlight_keyframes", text="Keyframes")
+        if bones:
+            col.prop(mps, "search_all_action_keyframes", text="+ Non-Grouped Keyframes")
         col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers")
 
 
index 4338489ac5a1f4446489011394042fa462054b03..14493301b1e99e2a56e3f810c7ec6e9034d1663c 100644 (file)
@@ -24,7 +24,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class LAMP_MT_sunsky_presets(bpy.types.Menu):
-    bl_label = "Render Presets"
+    bl_label = "Sun & Sky Presets"
     preset_subdir = "sunsky"
     preset_operator = "script.execute_preset"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
index 6dbfe269436c93ddcb3637c6d12e1b1856ce1ebf..f1b3e63f7ab561368768cf2b59c7922fd1408829 100644 (file)
@@ -182,7 +182,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                 col.prop(group, "dupli_offset", text="")
 
                 prop = col.operator("wm.context_set_value", text="From Cursor")
-                prop.path = "object.group_users[%d].dupli_offset" % index
+                prop.path = "object.users_group[%d].dupli_offset" % index
                 prop.value = value
                 index += 1
 
index f53bac05a7c34642fb3afc27a5296e72e8ad5fe7..11527ad9bda19977f1f48bd9940e50eaf3604998 100644 (file)
@@ -76,7 +76,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
                 else:
                     layout.prop_object(con, "subtarget", con.target.data, "bones", text="")
 
-                if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO'):
+                if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO', 'PIVOT'):
                     row = layout.row()
                     row.label(text="Head/Tail:")
                     row.prop(con, "head_tail", text="")
@@ -730,6 +730,22 @@ class ConstraintButtonsPanel(bpy.types.Panel):
             col.prop(con, "xz_scaling_mode", text="")
         col.prop(con, "use_curve_radius")
 
+    def PIVOT(self, context, layout, con, wide_ui):
+        self.target_template(layout, con, wide_ui)
+
+        if con.target:
+            col = layout.column()
+            col.prop(con, "offset", text="Pivot Offset")
+        else:
+            col = layout.column()
+            col.prop(con, "use_relative_position")
+            if con.use_relative_position:  
+                col.prop(con, "offset", text="Relative Pivot Point")
+            else:
+                col.prop(con, "offset", text="Absolute Pivot Point")
+
+        col = layout.column()
+        col.prop(con, "enabled_rotation_range", text="Pivot When")
 
 class OBJECT_PT_constraints(ConstraintButtonsPanel):
     bl_label = "Object Constraints"
index 35c1f84cca5ad1b8d79290f8e5fefcd75da9974c..328a9816524b74366800e9b57e19fae92ab4feb8 100644 (file)
@@ -705,12 +705,6 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
             sub = split.column()
             sub.prop(part, "velocity_length")
         elif part.ren_as == 'PATH':
-
-            if part.type != 'HAIR' and part.physics_type != 'KEYED' and (psys.point_cache.baked is False):
-                box = layout.box()
-                box.label(text="Baked or keyed particles needed for correct rendering.")
-                return
-
             sub.prop(part, "render_strand")
             subsub = sub.column()
             subsub.active = (part.render_strand is False)
@@ -862,11 +856,6 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
 
         path = (part.ren_as == 'PATH' and part.draw_as == 'RENDER') or part.draw_as == 'PATH'
 
-        if path and part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked is False:
-            box = layout.box()
-            box.label(text="Baked or keyed particles needed for correct drawing.")
-            return
-
         row = layout.row()
         row.prop(part, "display", slider=True)
         if part.draw_as != 'RENDER' or part.ren_as == 'HALO':
index 0f856ec9fd1699f9a263151366f487bb94329235..3166023a83af1707c5c2f0fd517a73361f93bbc1 100644 (file)
@@ -187,14 +187,14 @@ class RENDER_PT_shading(RenderButtonsPanel):
         split = layout.split()
 
         col = split.column()
-        col.prop(rd, "render_textures", text="Textures")
-        col.prop(rd, "render_shadows", text="Shadows")
-        col.prop(rd, "render_sss", text="Subsurface Scattering")
-        col.prop(rd, "render_envmaps", text="Environment Map")
+        col.prop(rd, "use_textures", text="Textures")
+        col.prop(rd, "use_shadows", text="Shadows")
+        col.prop(rd, "use_sss", text="Subsurface Scattering")
+        col.prop(rd, "use_envmaps", text="Environment Map")
 
         if wide_ui:
             col = split.column()
-        col.prop(rd, "render_raytracing", text="Ray Tracing")
+        col.prop(rd, "use_raytracing", text="Ray Tracing")
         col.prop(rd, "color_management")
         col.prop(rd, "alpha_mode", text="Alpha")
 
@@ -233,7 +233,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
         sub.active = rd.use_compositing
         sub.prop(rd, "free_image_textures")
         sub = col.column()
-        sub.active = rd.render_raytracing
+        sub.active = rd.use_raytracing
         sub.label(text="Acceleration structure:")
         sub.prop(rd, "raytrace_structure", text="")
         if rd.raytrace_structure == 'OCTREE':
index 0cd92bb91fdba499d10073c8449bd09f25aa9e61..62db983b87e4644478323acb96862f9e96045af0 100644 (file)
@@ -199,6 +199,18 @@ class INFO_MT_mesh_add(bpy.types.Menu):
         layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
         layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
 
+class INFO_MT_curve_add(bpy.types.Menu):
+    bl_idname = "INFO_MT_curve_add"
+    bl_label = "Curve"
+
+    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")
+        layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text="Nurbs Curve")
+        layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
+        layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
 
 class INFO_MT_armature_add(bpy.types.Menu):
     bl_idname = "INFO_MT_armature_add"
@@ -221,7 +233,8 @@ class INFO_MT_add(bpy.types.Menu):
         #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
         layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
 
-        layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
+        #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
+        layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
         layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
         layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
         layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
@@ -245,7 +258,7 @@ class INFO_MT_add(bpy.types.Menu):
             layout.operator_context = 'INVOKE_DEFAULT'
             layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
         else:
-            layout.operator_menu_enum("object.group_instance_add", "type", text="Group Instance", icon='OUTLINER_OB_EMPTY')
+            layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
 
 
 class INFO_MT_game(bpy.types.Menu):
@@ -297,19 +310,19 @@ class INFO_MT_help(bpy.types.Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("help.manual", icon='HELP')
-        layout.operator("help.release_logs", icon='URL')
+        layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
+        layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-250/'
 
         layout.separator()
 
-        layout.operator("help.blender_website", icon='URL')
-        layout.operator("help.blender_eshop", icon='URL')
-        layout.operator("help.developer_community", icon='URL')
-        layout.operator("help.user_community", icon='URL')
+        layout.operator("wm.url_open", text="Blender Website", icon='URL').url = 'http://www.blender.org/'
+        layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = 'http://www.blender.org/e-shop'
+        layout.operator("wm.url_open", text="Developer Community", icon='URL').url = 'http://www.blender.org/community/get-involved/'
+        layout.operator("wm.url_open", text="User Community", icon='URL').url = 'http://www.blender.org/community/user-community/'
         layout.separator()
-        layout.operator("help.report_bug", icon='URL')
+        layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
         layout.separator()
-        layout.operator("help.python_api", icon='URL')
+        layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
         layout.operator("help.operator_cheat_sheet")
         layout.separator()
         layout.operator("wm.splash")
@@ -318,70 +331,6 @@ class INFO_MT_help(bpy.types.Menu):
 # Help operators
 
 
-class HelpOperator(bpy.types.Operator):
-
-    def execute(self, context):
-        import webbrowser
-        webbrowser.open(self._url)
-        return {'FINISHED'}
-
-
-class HELP_OT_manual(HelpOperator):
-    '''The Blender Wiki manual'''
-    bl_idname = "help.manual"
-    bl_label = "Manual"
-    _url = 'http://wiki.blender.org/index.php/Doc:Manual'
-
-
-class HELP_OT_release_logs(HelpOperator):
-    '''Information about the changes in this version of Blender'''
-    bl_idname = "help.release_logs"
-    bl_label = "Release Log"
-    _url = 'http://www.blender.org/development/release-logs/blender-250/'
-
-
-class HELP_OT_blender_website(HelpOperator):
-    '''The official Blender website'''
-    bl_idname = "help.blender_website"
-    bl_label = "Blender Website"
-    _url = 'http://www.blender.org/'
-
-
-class HELP_OT_blender_eshop(HelpOperator):
-    '''Buy official Blender resources and merchandise online'''
-    bl_idname = "help.blender_eshop"
-    bl_label = "Blender e-Shop"
-    _url = 'http://www.blender.org/e-shop'
-
-
-class HELP_OT_developer_community(HelpOperator):
-    '''Get involved with Blender development'''
-    bl_idname = "help.developer_community"
-    bl_label = "Developer Community"
-    _url = 'http://www.blender.org/community/get-involved/'
-
-
-class HELP_OT_user_community(HelpOperator):
-    '''Get involved with other Blender users'''
-    bl_idname = "help.user_community"
-    bl_label = "User Community"
-    _url = 'http://www.blender.org/community/user-community/'
-
-
-class HELP_OT_report_bug(HelpOperator):
-    '''Report a bug in the Blender bug tracker'''
-    bl_idname = "help.report_bug"
-    bl_label = "Report a Bug"
-    _url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
-
-
-class HELP_OT_python_api(HelpOperator):
-    '''Reference for operator and data Python API'''
-    bl_idname = "help.python_api"
-    bl_label = "Python API Reference"
-    _url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
-
-
 class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
     bl_idname = "help.operator_cheat_sheet"
     bl_label = "Operator Cheat Sheet (new textblock)"
@@ -416,19 +365,12 @@ classes = [
     INFO_MT_file_external_data,
     INFO_MT_add,
     INFO_MT_mesh_add,
+    INFO_MT_curve_add,
     INFO_MT_armature_add,
     INFO_MT_game,
     INFO_MT_render,
     INFO_MT_help,
 
-    HELP_OT_manual,
-    HELP_OT_release_logs,
-    HELP_OT_blender_website,
-    HELP_OT_blender_eshop,
-    HELP_OT_developer_community,
-    HELP_OT_user_community,
-    HELP_OT_report_bug,
-    HELP_OT_python_api,
     HELP_OT_operator_cheat_sheet]
 
 
index e300cfd3d3255166a585bd2d3349c79e5ed6a254..b94acf6f3ad4e88386c967b3fc9e4093a8d1f2e8 100644 (file)
@@ -457,6 +457,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
             row = layout.row(align=True)
             sub = row.row()
             sub.scale_x = 2.0
+          
             if not context.screen.animation_playing:
                 sub.operator("screen.animation_play", text="", icon='PLAY')
             else:
@@ -665,6 +666,12 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel):
         row.prop(strip.sound, "caching")
 
         layout.prop(strip, "volume")
+        layout.prop(strip, "attenuation")
+
+        col = layout.column(align=True)
+        col.label(text="Trim Duration:")
+        col.prop(strip, "animation_start_offset", text="Start")
+        col.prop(strip, "animation_end_offset", text="End")
 
 
 class SEQUENCER_PT_scene(SequencerButtonsPanel):
index a850f543e041bdcf3ccb052c8c90e5b5660c4c4a..d0d91c2accf53f2ad919e4aad8ea9cefb6efc979 100644 (file)
@@ -554,6 +554,10 @@ class USERPREF_PT_theme(bpy.types.Panel):
             ui = theme.user_interface.wcol_scroll
             col.label(text="Scroll Bar:")
             ui_items_general(col, ui)
+            
+            ui = theme.user_interface.wcol_progress
+            col.label(text="Progress Bar:")
+            ui_items_general(col, ui)
 
             ui = theme.user_interface.wcol_list_item
             col.label(text="List Item:")
@@ -1187,7 +1191,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
                 # If there are Infos or UI is expanded
                 if info["expanded"]:
                     row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name
-                elif info["author"] or info["version"] or info["url"] or info["location"]:
+                elif info["author"] or info["version"] or info["wiki_url"] or info["location"]:
                     row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name
                 else:
                     # Else, block UI
@@ -1216,12 +1220,19 @@ class USERPREF_PT_addons(bpy.types.Panel):
                         split = column.row().split(percentage=0.15)
                         split.label(text='Description:')
                         split.label(text=info["description"])
-                    if info["url"]:
+                    if info["wiki_url"] or info["tracker_url"]:
                         split = column.row().split(percentage=0.15)
                         split.label(text="Internet:")
-                        split.operator("wm.addon_links", text="Link to the Wiki").link = info["url"]
-                        split.separator()
-                        split.separator()
+                        if info["wiki_url"]:
+                            split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
+                        if info["tracker_url"]:
+                            split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
+                        
+                        if info["wiki_url"] and info["tracker_url"]:
+                            split.separator()
+                        else:
+                            split.separator()
+                            split.separator()
 
         # Append missing scripts
         # First collect scripts that are used but have no script file.
@@ -1245,7 +1256,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
 from bpy.props import *
 
 
-def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "url": "", "category": "", "expanded": False}):
+def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "expanded": False}):
     addon_info = getattr(mod, "bl_addon_info", {})
 
     # avoid re-initializing
@@ -1410,19 +1421,6 @@ class WM_OT_addon_expand(bpy.types.Operator):
         return {'FINISHED'}
 
 
-class WM_OT_addon_links(bpy.types.Operator):
-    "Open the Blender Wiki in the Webbrowser"
-    bl_idname = "wm.addon_links"
-    bl_label = ""
-
-    link = StringProperty(name="Link", description="Link to open")
-
-    def execute(self, context):
-        import webbrowser
-        webbrowser.open(self.properties.link)
-        return {'FINISHED'}
-
-
 classes = [
     USERPREF_HT_header,
     USERPREF_PT_tabs,
@@ -1440,8 +1438,7 @@ classes = [
     WM_OT_addon_enable,
     WM_OT_addon_disable,
     WM_OT_addon_install,
-    WM_OT_addon_expand,
-    WM_OT_addon_links]
+    WM_OT_addon_expand]
 
 
 def register():
index 8be176843fc4b371da53a278e7e9d71d7a32f506..4a3818eae733d36ed86aa4375c9b7817e0247976 100644 (file)
@@ -32,14 +32,13 @@ class VIEW3D_HT_header(bpy.types.Header):
         obj = context.active_object
         toolsettings = context.tool_settings
 
-        row = layout.row()
+        row = layout.row(align=True)
         row.template_header()
 
-        sub = row.row(align=True)
-
         # Menus
         if context.area.show_menus:
-
+            sub = row.row(align=True)
+                       
             sub.menu("VIEW3D_MT_view")
 
             # Select Menu
@@ -54,6 +53,7 @@ class VIEW3D_HT_header(bpy.types.Header):
             else:
                 sub.menu("VIEW3D_MT_object")
 
+        row = layout.row()
         row.template_header_3D()
 
         # do in C for now since these buttons cant be both toggle AND exclusive.
@@ -675,6 +675,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
         layout.menu("VIEW3D_MT_object_track")
         layout.menu("VIEW3D_MT_object_group")
         layout.menu("VIEW3D_MT_object_constraints")
+        layout.menu("VIEW3D_MT_object_game_properties")
 
         layout.separator()
 
@@ -706,14 +707,13 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
 
     def poll(self, context):
         # add more special types
-        obj = context.object
-        return bool(obj and obj.type == 'LAMP')
+        return context.object
 
     def draw(self, context):
         layout = self.layout
 
         obj = context.object
-        if obj and obj.type == 'LAMP':
+        if obj.type == 'LAMP':
             layout.operator_context = 'INVOKE_REGION_WIN'
 
             props = layout.operator("wm.context_modal_mouse", text="Spot Size")
@@ -736,6 +736,10 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
             props.path_item = "data.shadow_buffer_clip_end"
             props.input_scale = 0.05
 
+            layout.separator()
+
+        props = layout.operator("object.isolate_type_render")
+
 
 class VIEW3D_MT_object_apply(bpy.types.Menu):
     bl_label = "Apply"
@@ -793,6 +797,7 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu):
         layout = self.layout
 
         layout.operator("object.constraint_add_with_targets")
+        layout.operator("object.constraints_copy")
         layout.operator("object.constraints_clear")
 
 
@@ -840,6 +845,17 @@ class VIEW3D_MT_make_links(bpy.types.Menu):
         layout.operator_enums("object.make_links_data", "type") # inline
 
 
+class VIEW3D_MT_object_game_properties(bpy.types.Menu):
+    bl_label = "Game Properties"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("object.game_property_copy", text="Replace").operation="REPLACE"
+        layout.operator("object.game_property_copy", text="Merge").operation="MERGE"
+        # layout.operator("object.game_property_copy").operation="CLEAR" doesn't really belong as part of copy...
+        layout.operator_menu_enum("object.game_property_copy", "property", text="Copy...")
+
 # ********** Vertex paint menu **********
 
 
@@ -1145,6 +1161,7 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu):
         layout = self.layout
 
         layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
+        layout.operator("pose.constraints_copy")
         layout.operator("pose.constraints_clear")
 
 
@@ -2205,6 +2222,7 @@ classes = [
     VIEW3D_MT_object_track,
     VIEW3D_MT_object_group,
     VIEW3D_MT_object_constraints,
+    VIEW3D_MT_object_game_properties,
     VIEW3D_MT_object_showhide,
     VIEW3D_MT_make_single_user,
     VIEW3D_MT_make_links,
index 291deb5ea702b74a33381275cfeb6d464db7d2e7..6a602339e111cda407c689b7275dc58bef47a18e 100644 (file)
@@ -83,9 +83,6 @@ typedef struct Global {
        struct VFont *selfont;
        struct ListBase ttfdata;
 
-       /* libtiff flag used to determine if shared library loaded for libtiff*/
-       int have_libtiff;
-
        /* this variable is written to / read from FileGlobal->fileflags */
        int fileflags;
     
index e5c7745f63763e6138d387ab926463e92651d4c8..258fb6f1b3f6d249aa787b5df0b07886ebb5daaa 100644 (file)
@@ -52,9 +52,9 @@ void multiresModifier_join(struct Object *);
 void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
 void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
                                int updateblock, int simple);
-int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src);
-int multiresModifier_reshapeFromDM(struct MultiresModifierData *mmd, struct Object *ob, struct DerivedMesh *srcdm);
-int multiresModifier_reshapeFromDeformMod(struct MultiresModifierData *mmd, struct Object *ob, struct ModifierData *md);
+int multiresModifier_reshape(struct Object *dst, struct Object *src);
+int multiresModifier_reshapeFromDM(struct Object *ob, struct DerivedMesh *srcdm);
+int multiresModifier_reshapeFromDeformMod(struct Object *ob, struct ModifierData *md);
 
 void multires_stitch_grids(struct Object *);
 
index fcef00ae9b3231b769c2f1f42b138d20f60c7342..33a41821fe2637d8afd2da96607b738ac3ed8eb0 100644 (file)
@@ -255,9 +255,11 @@ void psys_threads_free(ParticleThread *threads);
 void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3]);
 
 /* particle_system.c */
+void psys_update_path_cache(struct ParticleSimulationData *sim, float cfra);
 struct ParticleSystem *psys_get_target_system(struct Object *ob, struct ParticleTarget *pt);
 void psys_count_keyed_targets(struct ParticleSimulationData *sim);
 void psys_update_particle_tree(struct ParticleSystem *psys, float cfra);
+void psys_update_children(struct ParticleSimulationData *sim);
 
 void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys);
 void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, int *sfra, int *efra);
index 0b3fce9408c5bacb8653d7e34a28e95abb0c9a2e..925b1d7171af817d59a5ed66788d6cc876f4a4d3 100644 (file)
@@ -38,6 +38,9 @@
 #define TRUE 1
 #endif
 
+/* Macro to convert a value to string in the preprocessor */
+#define QUOTE(x) #x
+
 /* these values need to be hardcoded in structs, dna does not recognize defines */
 /* also defined in DNA_space_types.h */
 #ifndef FILE_MAXDIR
 #define IMAG MAKE_ID('I','M','A','G')
 
 #define DNA1 MAKE_ID('D','N','A','1')
-#define TEST MAKE_ID('T','E','S','T')
+#define TEST MAKE_ID('T','E','S','T') /* used as preview between 'REND' and 'GLOB' */
 #define REND MAKE_ID('R','E','N','D')
 #define USER MAKE_ID('U','S','E','R')
 
index afb29fbcd628319ddd401156f9b81e4fb37ac216..68684bcc0a15203dcd9491b60d00ec357ce56f15 100644 (file)
@@ -50,6 +50,10 @@ IF(WITH_OPENEXR)
        ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
+IF(WITH_TIFF)
+       ADD_DEFINITIONS(-DWITH_TIFF)
+ENDIF(WITH_TIFF)
+
 IF(WITH_OPENJPEG)
        ADD_DEFINITIONS(-DWITH_OPENJPEG)
 ENDIF(WITH_OPENJPEG)
index 57d7e45d986545d03a0ddf3e9ba5cf9b74bd0d00..6198520c853a3b2a57dfd92b70f507dc2dac6ce6 100644 (file)
@@ -38,6 +38,9 @@ else:
 if env['WITH_BF_OPENEXR']:
        defs.append('WITH_OPENEXR')
 
+if env['WITH_BF_TIFF']:
+       defs.append('WITH_TIFF')
+
 if env['WITH_BF_OPENJPEG']:
        defs.append('WITH_OPENJPEG')
 
index 4e365f363c38e931658a6835f2dae26d2be56d08..15c022592f9a3f462f79c3ec62d879794b1fb73e 100644 (file)
@@ -132,6 +132,10 @@ ifeq ($(WITH_QUICKTIME), true)
        CPPFLAGS += -DWITH_QUICKTIME
 endif
 
+ifeq ($(WITH_TIFF), true)
+    CPPFLAGS += -DWITH_TIFF
+endif
+
 ifeq ($(OS), darwin)
     ifeq ($(WITH_BF_OPENMP), true)
       CPPFLAGS += -DPARALLEL=1
index 8619ab1eb1c8ea34140e257ea568e4673a25dd5c..20afc715c77d458a91afb64e24dfa602983c2c5f 100644 (file)
@@ -52,6 +52,7 @@
 #include "BKE_anim.h"
 #include "BKE_curve.h"
 #include "BKE_DerivedMesh.h"
+#include "BKE_depsgraph.h"
 #include "BKE_font.h"
 #include "BKE_group.h"
 #include "BKE_global.h"
@@ -63,6 +64,7 @@
 #include "BKE_particle.h"
 #include "BKE_scene.h"
 #include "BKE_utildefines.h"
+#include "BKE_depsgraph.h"
 
 // XXX bad level call...
 
@@ -187,6 +189,8 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *
        
        if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS)
                mpath->flag |= MOTIONPATH_FLAG_BHEAD;
+       else
+               mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
        
        /* allocate a cache */
        mpath->points= MEM_callocN(sizeof(bMotionPathVert)*mpath->length, "bMotionPathVerts");
@@ -250,6 +254,83 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
 
 /* ........ */
 
+/* Note on evaluation optimisations:
+ * Optimisations currently used here play tricks with the depsgraph in order to try and 
+ * evaluate as few objects as strictly necessary to get nicer performance under standard
+ * production conditions. For those people who really need the accurate version, 
+ * disable the ifdef (i.e. 1 -> 0) and comment out the call to motionpaths_calc_optimise_depsgraph()
+ */
+
+/* tweak the object ordering to trick depsgraph into making MotionPath calculations run faster */
+static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
+{
+       Base *base, *baseNext;
+       MPathTarget *mpt;
+       
+       /* make sure our temp-tag isn't already in use */
+       for (base= scene->base.first; base; base= base->next)
+               base->object->flag &= ~BA_TEMP_TAG;
+       
+       /* for each target, dump its object to the start of the list if it wasn't moved already */
+       for (mpt= targets->first; mpt; mpt= mpt->next) {
+               for (base=scene->base.first; base; base=baseNext) {
+                       baseNext = base->next;
+                       
+                       if ((base->object == mpt->ob) && !(mpt->ob->flag & BA_TEMP_TAG)) {
+                               BLI_remlink(&scene->base, base);
+                               BLI_addhead(&scene->base, base);
+                               
+                               mpt->ob->flag |= BA_TEMP_TAG;
+                               break; // we really don't need to continue anymore once this happens, but this line might really 'break'
+                       }
+               }
+       }
+       
+       /* "brew me a list that's sorted a bit faster now depsy" */
+       DAG_scene_sort(scene);
+}
+
+/* update scene for current frame */
+static void motionpaths_calc_update_scene(Scene *scene)
+{
+#if 1 // 'production' optimisations always on
+       Base *base, *last=NULL;
+       
+       /* only stuff that moves or needs display still */
+       DAG_scene_update_flags(scene, scene->lay);
+       
+       /* find the last object with the tag 
+        *      - all those afterwards are assumed to not be relevant for our calculations
+        */
+       // optimise further by moving out...
+       for (base=scene->base.first; base; base=base->next) {
+               if (base->object->flag & BA_TEMP_TAG)
+                       last = base;
+       }
+       
+       /* perform updates for tagged objects */
+       // XXX: this will break if rigs depend on scene or other data that 
+       // is animated but not attached to/updatable from objects
+       for (base=scene->base.first; base; base=base->next) {
+               /* update this object */
+               object_handle_update(scene, base->object);
+               
+               /* if this is the last one we need to update, let's stop to save some time */
+               if (base == last)
+                       break;
+       }
+#else // original, 'always correct' version
+       /* do all updates 
+        *      - if this is too slow, resort to using a more efficient way 
+        *        that doesn't force complete update, but for now, this is the
+        *        most accurate way!
+        */
+       scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving
+#endif
+}
+
+/* ........ */
+
 /* perform baking for the targets on the current frame */
 static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
 {
@@ -311,7 +392,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
        
        // TODO: this method could be improved...
        //      1) max range for standard baking
-       //      2) minimum range for recalc baking (i.e. between keyfames, but how?)
+       //      2) minimum range for recalc baking (i.e. between keyframes, but how?)
        for (mpt= targets->first; mpt; mpt= mpt->next) {
                /* try to increase area to do (only as much as needed) */
                sfra= MIN2(sfra, mpt->mpath->start_frame);
@@ -319,14 +400,14 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
        }
        if (efra <= sfra) return;
        
+       /* optimise the depsgraph for faster updates */
+       // TODO: whether this is used should depend on some setting for the level of optimisations used
+       motionpaths_calc_optimise_depsgraph(scene, targets);
+       
        /* calculate path over requested range */
        for (CFRA=sfra; CFRA<=efra; CFRA++) {
-               /* do all updates 
-                *      - if this is too slow, resort to using a more efficient way 
-                *        that doesn't force complete update, but for now, this is the
-                *        most accurate way!
-                */
-               scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving
+               /* update relevant data for new frame */
+               motionpaths_calc_update_scene(scene);
                
                /* perform baking for targets */
                motionpaths_calc_bake_targets(scene, targets);
@@ -334,7 +415,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
        
        /* reset original environment */
        CFRA= cfra;
-       scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving
+       motionpaths_calc_update_scene(scene);
        
        /* clear recalc flags from targets */
        for (mpt= targets->first; mpt; mpt= mpt->next) {
@@ -1107,11 +1188,21 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
        BLI_srandom(31415926 + psys->seed);
        
        lay= scene->lay;
-       if((psys->renderdata || part->draw_as==PART_DRAW_REND) &&
-               ((part->ren_as == PART_DRAW_OB && part->dup_ob) ||
-               (part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first))) {
+       if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
 
-               psys_check_group_weights(part);
+               /* first check for loops (particle system object used as dupli object) */
+               if(part->ren_as == PART_DRAW_OB) {
+                       if(ELEM(part->dup_ob, NULL, par))
+                               return;
+               }
+               else { /*PART_DRAW_GR */
+                       if(part->dup_group == NULL || part->dup_group->gobject.first == NULL)
+                               return;
+
+                       for(go=part->dup_group->gobject.first; go; go=go->next)
+                               if(go->ob == par)
+                                       return;
+               }
 
                /* if we have a hair particle system, use the path cache */
                if(part->type == PART_HAIR) {
@@ -1125,6 +1216,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                        totpart = psys->totcached;
                }
 
+               psys_check_group_weights(part);
+
                psys->lattice = psys_get_lattice(&sim);
 
                /* gather list of objects or single object */
index 4f9b9435a80dacbcf348e57af4251c30c036442f..557f3900d7b6ed444e8716f758310853d6212b18 100644 (file)
@@ -2055,7 +2055,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
                                        
                                        /* we need to clamp this within sensible values */
                                        // NOTE: these should be fine for now, but should get sanitised in future
-                                       scale= MIN2( MAX2(scale, 0.0001) , 100000);
+                                       scale= MIN2(MAX2(scale, 0.0001) , 100000);
                                }
                                else
                                        scale= 1.0f;
@@ -2127,8 +2127,6 @@ static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_
                                splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime);
                        }
                        
-                       // TODO: if another pass is needed to ensure the validity of the chain after blending, it should go here
-                       
                        /* free the tree info specific to SplineIK trees now */
                        if (tree->chain) MEM_freeN(tree->chain);
                        if (tree->free_points) MEM_freeN(tree->points);
index 5d12675952c5934693793e96aab89afec5884713..046b8de2431e863c477c58969d0ec46004d9fd98 100644 (file)
@@ -534,7 +534,7 @@ void BKE_write_undo(bContext *C, char *name)
                sprintf(numstr, "%d.blend", counter);
                BLI_make_file_string("/", tstr, btempdir, numstr);
        
-               success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL);
+               success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL, NULL);
                
                strcpy(curundo->str, tstr);
        }
index 2b11c4bdfa02c33afcbdf0f93d7fc8df65769736..ce5bca1da5684d2c9ef33dee1ff4053d4f9239d8 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include "BKE_cloth.h"
-
 #include "BKE_cdderivedmesh.h"
+#include "BKE_cloth.h"
 #include "BKE_effect.h"
 #include "BKE_global.h"
 #include "BKE_modifier.h"
-#include "BKE_utildefines.h"
-
 #include "BKE_pointcache.h"
-
+#include "BKE_utildefines.h"
 
 #ifdef _WIN32
 void tstart ( void )
index ffd504f5945e9e7e0aef7329d23c612b78f2efa6..a77ac9b8e24aec8b2196ca85426f0b4e7a227a68 100644 (file)
@@ -59,7 +59,7 @@ Collision modifier code start
 /* step is limited from 0 (frame start position) to 1 (frame end position) */
 void collision_move_object ( CollisionModifierData *collmd, float step, float prevstep )
 {
-       float tv[3] = {0,0,0};
+       float tv[3] = {0, 0, 0};
        unsigned int i = 0;
 
        for ( i = 0; i < collmd->numverts; i++ )
@@ -69,6 +69,7 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr
                VECADDS ( collmd->current_xnew[i].co, collmd->x[i].co, tv, step );
                VECSUB ( collmd->current_v[i].co, collmd->current_xnew[i].co, collmd->current_x[i].co );
        }
+
        bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 );
 }
 
@@ -527,7 +528,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
                        float magtangent = 0, repulse = 0, d = 0;
                        double impulse = 0.0;
                        float vrel_t_pre[3];
-                       float temp[3];
+                       float temp[3], spf;
 
                        // calculate tangential velocity
                        VECCOPY ( temp, collpair->normal );
@@ -565,10 +566,12 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
 
                        // Apply repulse impulse if distance too short
                        // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+                       spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
+
                        d = clmd->coll_parms->epsilon*8.0/9.0 + epsilon2*8.0/9.0 - collpair->distance;
-                       if ( ( magrelVel < 0.1*d*clmd->sim_parms->stepsPerFrame ) && ( d > ALMOST_ZERO ) )
+                       if ( ( magrelVel < 0.1*d*spf ) && ( d > ALMOST_ZERO ) )
                        {
-                               repulse = MIN2 ( d*1.0/clmd->sim_parms->stepsPerFrame, 0.1*d*clmd->sim_parms->stepsPerFrame - magrelVel );
+                               repulse = MIN2 ( d*1.0/spf, 0.1*d*spf - magrelVel );
 
                                // stay on the safe side and clamp repulse
                                if ( impulse > ALMOST_ZERO )
@@ -1541,20 +1544,15 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
                        overlap = BLI_bvhtree_overlap ( cloth_bvh, collmd->bvhtree, &result );
                                
                        // go to next object if no overlap is there
-                       if(!result || !overlap)
-                       {
-                               if ( overlap )
-                                       MEM_freeN ( overlap );
-                               continue;
-                       }
-                       
-                       /* check if collisions really happen (costly near check) */
-                       cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap);
-                       
-                       // resolve nearby collisions
-                       ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i],  collisions_index[i]);
-                       ret2 += ret;
+                       if( result && overlap ) {
+                               /* check if collisions really happen (costly near check) */
+                               cloth_bvh_objcollisions_nearcheck ( clmd, collmd, &collisions[i], &collisions_index[i], result, overlap);
                        
+                               // resolve nearby collisions
+                               ret += cloth_bvh_objcollisions_resolve ( clmd, collmd, collisions[i],  collisions_index[i]);
+                               ret2 += ret;
+                       }
+
                        if ( overlap )
                                MEM_freeN ( overlap );
                }
index a3f1cb0cb0c9d41388841fb36d47de217a12662d..171276d118ed572b75c6d49c1c92b8c5ccf1c2cd 100644 (file)
@@ -820,12 +820,12 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                
                /* extract components of both matrices */
                VECCOPY(loc, ct->matrix[3]);
-               mat4_to_eulO( eul, ct->rotOrder,ct->matrix);
-               mat4_to_size( size,ct->matrix);
+               mat4_to_eulO(eul, ct->rotOrder, ct->matrix);
+               mat4_to_size(size, ct->matrix);
                
                VECCOPY(loco, invmat[3]);
-               mat4_to_eulO( eulo, cob->rotOrder,invmat);
-               mat4_to_size( sizo,invmat);
+               mat4_to_eulO(eulo, cob->rotOrder, invmat);
+               mat4_to_size(sizo, invmat);
                
                /* disable channels not enabled */
                if (!(data->flag & CHILDOF_LOCX)) loc[0]= loco[0]= 0.0f;
@@ -1017,7 +1017,7 @@ static void trackto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                float tmat[4][4];
                
                /* Get size property, since ob->size is only the object's own relative size, not its global one */
-               mat4_to_size( size,cob->matrix);
+               mat4_to_size(size, cob->matrix);
                
                /* Clear the object's rotation */       
                cob->matrix[0][0]=size[0];
@@ -1385,9 +1385,9 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
        float size[3];
        
        VECCOPY(loc, cob->matrix[3]);
-       mat4_to_size( size,cob->matrix);
+       mat4_to_size(size, cob->matrix);
        
-       mat4_to_eulO( eul, cob->rotOrder,cob->matrix);
+       mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
        
        /* constraint data uses radians internally */
        
@@ -1638,11 +1638,11 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                float   size[3];
                
                VECCOPY(loc, cob->matrix[3]);
-               mat4_to_size( size,cob->matrix);
+               mat4_to_size(size, cob->matrix);
                
                /* to allow compatible rotations, must get both rotations in the order of the owner... */
-               mat4_to_eulO( eul, cob->rotOrder,ct->matrix);
-               mat4_to_eulO( obeul, cob->rotOrder,cob->matrix);
+               mat4_to_eulO(eul, cob->rotOrder, ct->matrix);
+               mat4_to_eulO(obeul, cob->rotOrder, cob->matrix);
                
                if ((data->flag & ROTLIKE_X)==0)
                        eul[0] = obeul[0];
@@ -1868,29 +1868,29 @@ static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
 {
        bSameVolumeConstraint *data= con->data;
 
+       float volume = data->volume;
+       float fac = 1.0f;
        float obsize[3];
-       float volume=data->volume;
 
        mat4_to_size(obsize, cob->matrix);
-
+       
+       /* calculate normalising scale factor for non-essential values */
+       if (obsize[data->flag] != 0) 
+               fac = sqrt(volume / obsize[data->flag]) / obsize[data->flag];
+       
+       /* apply scaling factor to the channels not being kept */
        switch (data->flag) {
                case SAMEVOL_X:
-                       if (obsize[0]!=0) {
-                               mul_v3_fl(cob->matrix[1], sqrt(volume/obsize[0])/obsize[0]);
-                               mul_v3_fl(cob->matrix[2], sqrt(volume/obsize[0])/obsize[0]);
-                       }
+                       mul_v3_fl(cob->matrix[1], fac);
+                       mul_v3_fl(cob->matrix[2], fac);
                        break;
                case SAMEVOL_Y:
-                       if (obsize[1]!=0) {
-                               mul_v3_fl(cob->matrix[0], sqrt(volume/obsize[1])/obsize[1]);
-                               mul_v3_fl(cob->matrix[2], sqrt(volume/obsize[1])/obsize[1]);
-                       }
+                       mul_v3_fl(cob->matrix[0], fac);
+                       mul_v3_fl(cob->matrix[2], fac);
                        break;
                case SAMEVOL_Z:
-                       if (obsize[2]!=0) {
-                               mul_v3_fl(cob->matrix[0], sqrt(volume/obsize[2])/obsize[2]);
-                               mul_v3_fl(cob->matrix[1], sqrt(volume/obsize[2])/obsize[2]);
-                       }
+                       mul_v3_fl(cob->matrix[0], fac);
+                       mul_v3_fl(cob->matrix[1], fac);
                        break;
        }
 }
@@ -2770,7 +2770,7 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                float dist;
                
                /* store scaling before destroying obmat */
-               mat4_to_size( size,cob->matrix);
+               mat4_to_size(size, cob->matrix);
                
                /* store X orientation before destroying obmat */
                xx[0] = cob->matrix[0][0];
@@ -3353,7 +3353,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                mat4_to_size( dvec,ct->matrix);
                                break;
                        case 1: /* rotation (convert to degrees first) */
-                               mat4_to_eulO( dvec, cob->rotOrder,ct->matrix);
+                               mat4_to_eulO(dvec, cob->rotOrder, ct->matrix);
                                for (i=0; i<3; i++)
                                        dvec[i] = (float)(dvec[i] / M_PI * 180);
                                break;
@@ -3364,8 +3364,8 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                
                /* extract components of owner's matrix */
                VECCOPY(loc, cob->matrix[3]);
-               mat4_to_eulO( eul, cob->rotOrder,cob->matrix);
-               mat4_to_size( size,cob->matrix);        
+               mat4_to_eulO(eul, cob->rotOrder, cob->matrix);
+               mat4_to_size(size, cob->matrix);        
                
                /* determine where in range current transforms lie */
                if (data->expo) {
@@ -3485,73 +3485,73 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                float co[3] = {0.0f, 0.0f, 0.0f};
                float no[3] = {0.0f, 0.0f, 0.0f};
                float dist;
-
+               
                SpaceTransform transform;
                DerivedMesh *target = object_get_derived_final(cob->scene, ct->tar, CD_MASK_BAREMESH);
                BVHTreeRayHit hit;
                BVHTreeNearest nearest;
-
+               
                BVHTreeFromMesh treeData;
-               memset( &treeData, 0, sizeof(treeData) );
-
+               memset(&treeData, 0, sizeof(treeData));
+               
                nearest.index = -1;
                nearest.dist = FLT_MAX;
-
+               
                hit.index = -1;
                hit.dist = 100000.0f;  //TODO should use FLT_MAX.. but normal projection doenst yet supports it
-
+               
                unit_m4(ct->matrix);
-
+               
                if(target != NULL)
                {
                        space_transform_from_matrixs(&transform, cob->matrix, ct->tar->obmat);
-
+                       
                        switch(scon->shrinkType)
                        {
                                case MOD_SHRINKWRAP_NEAREST_SURFACE:
                                case MOD_SHRINKWRAP_NEAREST_VERTEX:
-
+                                       
                                        if(scon->shrinkType == MOD_SHRINKWRAP_NEAREST_VERTEX)
                                                bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6);
                                        else
                                                bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6);
-
+                                       
                                        if(treeData.tree == NULL)
                                        {
                                                fail = TRUE;
                                                break;
                                        }
-
+                                       
                                        space_transform_apply(&transform, co);
-
+                                       
                                        BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData);
                                        
                                        dist = len_v3v3(co, nearest.co);
                                        interp_v3_v3v3(co, co, nearest.co, (dist - scon->dist)/dist);   /* linear interpolation */
                                        space_transform_invert(&transform, co);
                                break;
-
+                               
                                case MOD_SHRINKWRAP_PROJECT:
                                        if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) no[0] = 1.0f;
                                        if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) no[1] = 1.0f;
                                        if(scon->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) no[2] = 1.0f;
-
+                                       
                                        if(INPR(no,no) < FLT_EPSILON)
                                        {
                                                fail = TRUE;
                                                break;
                                        }
-
+                                       
                                        normalize_v3(no);
-
-
+                                       
+                                       
                                        bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6);
                                        if(treeData.tree == NULL)
                                        {
                                                fail = TRUE;
                                                break;
                                        }
-
+                                       
                                        if(normal_projection_project_vertex(0, co, no, &transform, treeData.tree, &hit, treeData.raycast_callback, &treeData) == FALSE)
                                        {
                                                fail = TRUE;
@@ -3560,17 +3560,17 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                        VECCOPY(co, hit.co);
                                break;
                        }
-
+                       
                        free_bvhtree_from_mesh(&treeData);
-
+                       
                        target->release(target);
-
+                       
                        if(fail == TRUE)
                        {
                                /* Don't move the point */
                                co[0] = co[1] = co[2] = 0.0f;
                        }
-
+                       
                        /* co is in local object coordinates, change it to global and update target position */
                        mul_m4_v3(cob->matrix, co);
                        VECCOPY(ct->matrix[3], co);
@@ -3704,7 +3704,7 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                /* construct rotation matrix from the axis-angle rotation found above 
                 *      - this call takes care to make sure that the axis provided is a unit vector first
                 */
-               axis_angle_to_mat3( rmat,raxis, rangle);
+               axis_angle_to_mat3(rmat, raxis, rangle);
                
                /* rotate the owner in the way defined by this rotation matrix, then reapply the location since
                 * we may have destroyed that in the process of multiplying the matrix
@@ -3831,6 +3831,118 @@ static bConstraintTypeInfo CTI_SPLINEIK = {
        NULL /* evaluate - solved as separate loop */
 };
 
+/* ----------- Pivot ------------- */
+
+static void pivotcon_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
+{
+       bPivotConstraint *data= con->data;
+       
+       /* target only */
+       func(con, (ID**)&data->tar, userdata);
+}
+
+static int pivotcon_get_tars (bConstraint *con, ListBase *list)
+{
+       if (con && list) {
+               bPivotConstraint *data= con->data;
+               bConstraintTarget *ct;
+               
+               /* standard target-getting macro for single-target constraints */
+               SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+               
+               return 1;
+       }
+       
+       return 0;
+}
+
+static void pivotcon_flush_tars (bConstraint *con, ListBase *list, short nocopy)
+{
+       if (con && list) {
+               bPivotConstraint *data= con->data;
+               bConstraintTarget *ct= list->first;
+               
+               /* the following macro is used for all standard single-target constraints */
+               SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+       }
+}
+
+static void pivotcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
+{
+       bPivotConstraint *data= con->data;
+       bConstraintTarget *ct= targets->first;
+       
+       float pivot[3], vec[3];
+       float rotMat[3][3];
+       
+       /* firstly, check if pivoting should take place based on the current rotation */
+       if (data->rotAxis != PIVOTCON_AXIS_NONE) {
+               float rot[3];
+               
+               /* extract euler-rotation of target */
+               mat4_to_eulO(rot, cob->rotOrder, cob->matrix);
+               
+               /* check which range might be violated */
+               if (data->rotAxis < PIVOTCON_AXIS_X) {
+                       /* negative rotations (data->rotAxis = 0 -> 2) */
+                       if (rot[data->rotAxis] > 0.0f)
+                               return;
+               }
+               else {
+                       /* positive rotations (data->rotAxis = 3 -> 5 */
+                       if (rot[data->rotAxis - PIVOTCON_AXIS_X] < 0.0f)
+                               return;
+               }
+       }
+       
+       /* find the pivot-point to use  */
+       if (VALID_CONS_TARGET(ct)) {
+               /* apply offset to target location */
+               add_v3_v3v3(pivot, ct->matrix[3], data->offset);
+       }
+       else {
+               /* no targets to worry about... */
+               if ((data->flag & PIVOTCON_FLAG_OFFSET_ABS) == 0) {
+                       /* offset is relative to owner */
+                       add_v3_v3v3(pivot, cob->matrix[3], data->offset);
+               }
+               else {
+                       /* directly use the 'offset' specified as an absolute position instead */
+                       VECCOPY(pivot, data->offset);
+               }
+       }
+       
+       /* get rotation matrix representing the rotation of the owner */
+       // TODO: perhaps we might want to include scaling based on the pivot too?
+       copy_m3_m4(rotMat, cob->matrix);
+       normalize_m3(rotMat);
+       
+       /* perform the pivoting... */
+               /* 1. take the vector from owner to the pivot */
+       sub_v3_v3v3(vec, pivot, cob->matrix[3]);
+               /* 2. rotate this vector by the rotation of the object... */
+       mul_m3_v3(rotMat, vec);
+               /* 3. make the rotation in terms of the pivot now */
+       add_v3_v3v3(cob->matrix[3], pivot, vec);
+}
+
+
+static bConstraintTypeInfo CTI_PIVOT = {
+       CONSTRAINT_TYPE_PIVOT, /* type */
+       sizeof(bPivotConstraint), /* size */
+       "Pivot", /* name */
+       "bPivotConstraint", /* struct name */
+       NULL, /* free data */
+       NULL, /* relink data */
+       pivotcon_id_looper, /* id looper */
+       NULL, /* copy data */
+       NULL, /* new data */ // XXX: might be needed to get 'normal' pivot behaviour...
+       pivotcon_get_tars, /* get constraint targets */
+       pivotcon_flush_tars, /* flush constraint targets */
+       default_get_tarmat, /* get target matrix */
+       pivotcon_evaluate /* evaluate */
+};
+
 /* ************************* Constraints Type-Info *************************** */
 /* All of the constraints api functions use bConstraintTypeInfo structs to carry out
  * and operations that involve constraint specific code.
@@ -3867,6 +3979,7 @@ static void constraints_init_typeinfo () {
        constraintsTypeInfo[22]= &CTI_SPLINEIK;                 /* Spline IK Constraint */
        constraintsTypeInfo[23]= &CTI_TRANSLIKE;                /* Copy Transforms Constraint */
        constraintsTypeInfo[24]= &CTI_SAMEVOL;                  /* Maintain Volume Constraint */
+       constraintsTypeInfo[25]= &CTI_PIVOT;                    /* Pivot Constraint */
 }
 
 /* This function should be used for getting the appropriate type-info when only
@@ -4149,9 +4262,9 @@ void copy_constraints (ListBase *dst, const ListBase *src, int do_extern)
                        /* perform custom copying operations if needed */
                        if (cti->copy_data)
                                cti->copy_data(con, srccon);
-
+                       
                        /* for proxies we dont want to make extern */
-                       if(do_extern) {
+                       if (do_extern) {
                                /* go over used ID-links for this constraint to ensure that they are valid for proxies */
                                if (cti->id_looper)
                                        cti->id_looper(con, con_extern_cb, NULL);
index 69327eccfaf317f147f7b37852fa6cef108af7b3..361e6f3fd228cb057265213740ccdcd1a9573634 100644 (file)
@@ -798,10 +798,12 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
 };
 
 const char *LAYERTYPENAMES[CD_NUMTYPES] = {
-       "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", "CDMTFace",
-       "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags","CDMFloatProperty",
-       "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV",
-       "CDMloopCol", "CDTangent", "CDMDisps", "CDWeightMCol", "CDClothOrco"};
+       /*   0-4 */ "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace",
+       /*   5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
+       /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
+       /* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
+       /* 20-23 */"CDWeightMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco"
+};
 
 const CustomDataMask CD_MASK_BAREMESH =
        CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE;
index 1e5f276ba95d5e242b85c0e67b8959c6a015b63c..bdeacdf6946e26854eb67b3fca03ed9048794146 100644 (file)
@@ -2250,6 +2250,16 @@ void DAG_on_load_update(void)
        }
 }
 
+static void dag_id_flush_update__isDependentTexture(void *userData, Object *ob, ID **idpoin)
+{
+       struct { ID *id; int is_dependent; } *data = userData;
+       
+       if(*idpoin && GS((*idpoin)->name)==ID_TE) {
+               if (data->id == (*idpoin))
+                       data->is_dependent = 1;
+       }
+}
+
 void DAG_id_flush_update(ID *id, short flag)
 {
        Main *bmain= G.main;
@@ -2276,11 +2286,7 @@ void DAG_id_flush_update(ID *id, short flag)
                        /* no point in trying in this cases */
                        if(!id || id->us <= 1)
                                id= NULL;
-                       /* curves and surfaces only need to mark one object, since
-                          otherwise cu->displist would be computed multiple times */
-                       else if(ob->type==OB_CURVE || ob->type==OB_SURF)
-                               id= NULL;
-                       /* also for locked shape keys we make an exception */
+                       /* for locked shape keys we make an exception */
                        else if(ob_get_key(ob) && (ob->shapeflag & OB_SHAPE_LOCK))
                                id= NULL;
                }
@@ -2291,19 +2297,38 @@ void DAG_id_flush_update(ID *id, short flag)
                idtype= GS(id->name);
 
                if(ELEM7(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR)) {
+                       int first_ob= 1;
                        for(obt=bmain->object.first; obt; obt= obt->id.next) {
                                if(!(ob && obt == ob) && obt->data == id) {
+
+                                       /* try to avoid displist recalculation for linked curves */
+                                       if (!first_ob && ELEM(obt->type, OB_CURVE, OB_SURF)) {
+                                               /* if curve object has got derivedFinal it means this
+                                                  object has got constructive modifiers and object
+                                                  should be recalculated anyhow */
+                                               if (!obt->derivedFinal)
+                                                       continue;
+                                       }
+
                                        obt->recalc |= OB_RECALC_DATA;
                                        BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
 
-                                       /* for these we only flag one object, otherwise cu->displist
-                                          would be computed multiple times */
-                                       if(obt->type==OB_CURVE || obt->type==OB_SURF)
-                                               break;
+                                       first_ob= 0;
                                }
                        }
                }
                
+               /* set flags based on textures - can influence depgraph via modifiers */
+               if(idtype == ID_TE) {
+                       for(obt=bmain->object.first; obt; obt= obt->id.next) {
+                               struct { ID *id; int is_dependent; } data = {id, 0};
+                               
+                               modifiers_foreachIDLink(obt, dag_id_flush_update__isDependentTexture, &data);
+                               if (data.is_dependent)
+                                       obt->recalc |= OB_RECALC_DATA;
+                       }
+               }
+               
                /* set flags based on ShapeKey */
                if(idtype == ID_KE) {
                        for(obt=bmain->object.first; obt; obt= obt->id.next) {
index 619bb1a58f9afa362d43cdfcb923f276880d3ab1..43f01199b6984bd731a2a1c1ed2998fbec7c0065 100644 (file)
@@ -1418,7 +1418,7 @@ static float evaluate_driver (ChannelDriver *driver, float evaltime)
                                /* this evaluates the expression using Python,and returns its result:
                                 *      - on errors it reports, then returns 0.0f
                                 */
-                               driver->curval= BPY_pydriver_eval(driver);
+                               driver->curval= BPY_eval_driver(driver);
                        }
 #endif /* DISABLE_PYTHON*/
                }
index 868b06f2348922bce1167d10ec605fe12a558726..6fcc49f9ec16b6faa739c193055d012a2e8613d0 100644 (file)
@@ -44,7 +44,7 @@
 #include "BKE_utildefines.h"
 
 #ifndef DISABLE_PYTHON
-#include "BPY_extern.h" /* for BPY_pydriver_eval() */
+#include "BPY_extern.h" /* for BPY_eval_driver() */
 #endif
 
 #define SMALL -1.0e-10
index eb478eaddf5c3180cf644b5c646681a5bf5f0e64..39efd9fe72e578ca395b2aa761363d22f9874ee2 100644 (file)
@@ -779,10 +779,12 @@ void BKE_add_image_extension(char *string, int imtype)
                if(!BLI_testextensie(string, ".bmp"))
                        extension= ".bmp";
        }
-       else if(G.have_libtiff && (imtype==R_TIFF)) {
+#ifdef WITH_TIFF
+       else if(imtype==R_TIFF) {
                if(!BLI_testextensie(string, ".tif") && 
                        !BLI_testextensie(string, ".tiff")) extension= ".tif";
        }
+#endif
 #ifdef WITH_OPENEXR
        else if( ELEM(imtype, R_OPENEXR, R_MULTILAYER)) {
                if(!BLI_testextensie(string, ".exr"))
@@ -980,6 +982,7 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        struct StampData stamp_data;
        float w, h, pad;
        int x, y;
+       float h_fixed;
        
        if (!rect && !rectf)
                return;
@@ -996,16 +999,24 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
        pad= BLF_width(mono, "--");
 
+       /* use 'h_fixed' rather then 'h', aligns better */
+       // BLF_width_and_height(mono, "^|/_AgPpJjlYy", &w, &h_fixed);
+       {
+               rctf box;
+               BLF_boundbox(mono, "^|/_AgPpJjlYy", &box);
+               h_fixed= box.ymax - box.ymin;
+       }
+
        x= 0;
        y= height;
 
        if (stamp_data.file[0]) {
                /* Top left corner */
-               BLF_width_and_height(mono, stamp_data.file, &w, &h);
+               BLF_width_and_height(mono, stamp_data.file, &w, &h); h= h_fixed;
                y -= h;
 
                /* also a little of space to the background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+2);
 
                /* and draw the text. */
                BLF_position(mono, x, y, 0.0);
@@ -1017,11 +1028,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
 
        /* Top left corner, below File */
        if (stamp_data.note[0]) {
-               BLF_width_and_height(mono, stamp_data.note, &w, &h);
+               BLF_width_and_height(mono, stamp_data.note, &w, &h); h= h_fixed;
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
 
                BLF_position(mono, x, y+1, 0.0);
                BLF_draw_buffer(mono, stamp_data.note);
@@ -1032,11 +1043,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        
        /* Top left corner, below File (or Note) */
        if (stamp_data.date[0]) {
-               BLF_width_and_height(mono, stamp_data.date, &w, &h);
+               BLF_width_and_height(mono, stamp_data.date, &w, &h); h= h_fixed;
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
 
                BLF_position(mono, x, y, 0.0);
                BLF_draw_buffer(mono, stamp_data.date);
@@ -1047,11 +1058,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
 
        /* Top left corner, below File, Date or Note */
        if (stamp_data.rendertime[0]) {
-               BLF_width_and_height(mono, stamp_data.rendertime, &w, &h);
+               BLF_width_and_height(mono, stamp_data.rendertime, &w, &h); h= h_fixed;
                y -= h;
 
                /* and space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
 
                BLF_position(mono, x, y, 0.0);
                BLF_draw_buffer(mono, stamp_data.rendertime);
@@ -1062,10 +1073,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
 
        /* Bottom left corner, leaving space for timing */
        if (stamp_data.marker[0]) {
-               BLF_width_and_height(mono, stamp_data.marker, &w, &h);
+               BLF_width_and_height(mono, stamp_data.marker, &w, &h); h= h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+2);
 
                /* and pad the text. */
                BLF_position(mono, x, y+3, 0.0);
@@ -1077,10 +1088,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        
        /* Left bottom corner */
        if (stamp_data.time[0]) {
-               BLF_width_and_height(mono, stamp_data.time, &w, &h);
+               BLF_width_and_height(mono, stamp_data.time, &w, &h); h= h_fixed;
 
                /* extra space for background */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
 
                /* and pad the text. */
                BLF_position(mono, x, y+3, 0.0);
@@ -1091,10 +1102,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        }
        
        if (stamp_data.frame[0]) {
-               BLF_width_and_height(mono, stamp_data.frame, &w, &h);
+               BLF_width_and_height(mono, stamp_data.frame, &w, &h); h= h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
 
                /* and pad the text. */
                BLF_position(mono, x, y+3, 0.0);
@@ -1105,22 +1116,22 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        }
 
        if (stamp_data.camera[0]) {
-               BLF_width_and_height(mono, stamp_data.camera, &w, &h);
+               BLF_width_and_height(mono, stamp_data.camera, &w, &h); h= h_fixed;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
                BLF_position(mono, x, y+3, 0.0);
                BLF_draw_buffer(mono, stamp_data.camera);
        }
        
        if (stamp_data.scene[0]) {
-               BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+               BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
 
                /* Bottom right corner, with an extra space because blenfont is too strict! */
                x= width - w - 2;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+2);
 
                /* and pad the text. */
                BLF_position(mono, x, y+3, 0.0);
@@ -1128,14 +1139,14 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
        }
        
        if (stamp_data.strip[0]) {
-               BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+               BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
 
                /* Top right corner, with an extra space because blenfont is too strict! */
                x= width - w - pad;
                y= height - h;
 
                /* extra space for background. */
-               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3);
+               buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+2);
 
                BLF_position(mono, x, y, 0.0);
                BLF_draw_buffer(mono, stamp_data.strip);
@@ -1187,12 +1198,14 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt
        else if ((imtype==R_BMP)) {
                ibuf->ftype= BMP;
        }
-       else if ((G.have_libtiff) && (imtype==R_TIFF)) {
+#ifdef WITH_TIFF
+       else if (imtype==R_TIFF) {
                ibuf->ftype= TIF;
 
                if(subimtype & R_TIFF_16BIT)
                        ibuf->ftype |= TIF_16BIT;
        }
+#endif
 #ifdef WITH_OPENEXR
        else if (imtype==R_OPENEXR || imtype==R_MULTILAYER) {
                ibuf->ftype= OPENEXR;
index c625fb28840cce72b13408eac772ee28c7ce86d3..902965bd2f6bcb1ba6f66edcfca2d6c6fd61908d 100644 (file)
 #include "BKE_global.h"
 #include "BKE_utildefines.h"
 
+#include "BLI_threads.h"
+
+#define CLOTH_OPENMP_LIMIT 25
+
 #ifdef _WIN32
 #include <windows.h>
 static LARGE_INTEGER _itstart, _itend;
@@ -230,8 +234,11 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
 {
        long i = 0;
        float temp = 0.0;
+// XXX brecht, disabled this for now (first schedule line was already disabled),
+// due to non-commutative nature of floating point ops this makes the sim give
+// different results each time you run it!
 // schedule(guided, 2)
-#pragma omp parallel for reduction(+: temp)
+//#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
        for(i = 0; i < (long)verts; i++)
        {
                temp += INPR(fLongVectorA[i], fLongVectorB[i]);
@@ -577,11 +584,12 @@ DO_INLINE void mul_bfmatrix_S(fmatrix3x3 *matrix, float scalar)
 DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector *fLongVector)
 {
        unsigned int i = 0;
-       lfVector *temp = create_lfvector(from[0].vcount);
+       unsigned int vcount = from[0].vcount;
+       lfVector *temp = create_lfvector(vcount);
        
-       zero_lfvector(to, from[0].vcount);
+       zero_lfvector(to, vcount);
 
-#pragma omp parallel sections private(i)
+#pragma omp parallel sections private(i) if(vcount > CLOTH_OPENMP_LIMIT)
        {
 #pragma omp section
                {
@@ -962,7 +970,7 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
        unsigned int i = 0;
        
        // Take only the diagonal blocks of A
-// #pragma omp parallel for private(i)
+// #pragma omp parallel for private(i) if(lA[0].vcount > CLOTH_OPENMP_LIMIT)
        for(i = 0; i<lA[0].vcount; i++)
        {
                // block diagonalizer
@@ -1460,6 +1468,8 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
                i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
                j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
                k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
+               if (i < 0 || j < 0 || k < 0 || i > 10 || j >= 10 || k >= 10)
+                       continue;
 
                grid[i][j][k].velocity[0] += lV[v][0];
                grid[i][j][k].velocity[1] += lV[v][1];
@@ -1523,6 +1533,8 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
                i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
                j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
                k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
+               if (i < 0 || j < 0 || k < 0 || i > 10 || j >= 10 || k >= 10)
+                       continue;
 
                lF[v][0] += smoothfac * (grid[i][j][k].velocity[0] - lV[v][0]);
                lF[v][1] += smoothfac * (grid[i][j][k].velocity[1] - lV[v][1]);
@@ -1537,6 +1549,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
 
        free_collider_cache(&colliders);
 }
+
 static void cloth_calc_force(ClothModifierData *clmd, float frame, lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M)
 {
        /* Collect forces and derivatives:  F,dFdX,dFdV */
@@ -1731,9 +1744,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
        ClothVertex *verts = cloth->verts;
        unsigned int numverts = cloth->numverts;
        float dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame;
+       float spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
        Implicit_Data *id = cloth->implicit;
-       int result = 0;
-       
+       int do_extra_solve;
+
        if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) /* do goal stuff */
        {
                for(i = 0; i < numverts; i++)
@@ -1778,60 +1792,50 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
 
                if(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED && clmd->clothObject->bvhtree)
                {
-                       float temp = clmd->sim_parms->stepsPerFrame;
-                       /* not too nice hack, but collisions need this correction -jahka */
-                       clmd->sim_parms->stepsPerFrame /= clmd->sim_parms->timescale;
-
                        // collisions 
                        // itstart();
                        
                        // update verts to current positions
                        for(i = 0; i < numverts; i++)
-                       {       
+                       {
                                VECCOPY(verts[i].tx, id->Xnew[i]);
-                               
+
                                VECSUB(verts[i].tv, verts[i].tx, verts[i].txold);
                                VECCOPY(verts[i].v, verts[i].tv);
                        }
-                       
+
                        // call collision function
                        // TODO: check if "step" or "step+dt" is correct - dg
-                       result = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
-                       
-                       // correct velocity again, just to be sure we had to change it due to adaptive collisions
-                       for(i = 0; i < numverts; i++)
-                       {
-                               VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
-                       }
+                       do_extra_solve = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
                        
                        // copy corrected positions back to simulation
                        for(i = 0; i < numverts; i++)
                        {               
-                               if(result)
+                               // correct velocity again, just to be sure we had to change it due to adaptive collisions
+                               VECSUB(verts[i].tv, verts[i].tx, id->X[i]);
+
+                               if(do_extra_solve)
                                {
                                        
                                        if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED))
                                                continue;
-                                       
+
                                        VECCOPY(id->Xnew[i], verts[i].tx);
                                        VECCOPY(id->Vnew[i], verts[i].tv);
-                                       mul_v3_fl(id->Vnew[i], clmd->sim_parms->stepsPerFrame);
+                                       mul_v3_fl(id->Vnew[i], spf);
                                }
                        }
                        
-                       /* restore original stepsPerFrame */
-                       clmd->sim_parms->stepsPerFrame = temp;
-                       
                        // X = Xnew;
                        cp_lfvector(id->X, id->Xnew, numverts);
-                       
+
                        // if there were collisions, advance the velocity from v_n+1/2 to v_n+1
                        
-                       if(result)
+                       if(do_extra_solve)
                        {
                                // V = Vnew;
                                cp_lfvector(id->V, id->Vnew, numverts);
-                               
+
                                // calculate 
                                cloth_calc_force(clmd, frame, id->F, id->X, id->V, id->dFdV, id->dFdX, effectors, step+dt, id->M);      
                                
@@ -1851,7 +1855,6 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
                cp_lfvector(id->V, id->Vnew, numverts);
                
                step += dt;
-               
        }
 
        for(i = 0; i < numverts; i++)
index 52c6f9355a38874415ac4c298c1c632b4969246d..d8c39abc44a8a1fb0a820812c002aa63499d3856 100644 (file)
@@ -207,7 +207,7 @@ void multiresModifier_join(Object *ob)
 }
 #endif
 
-int multiresModifier_reshapeFromDM(MultiresModifierData *mmd, Object *ob, DerivedMesh *srcdm)
+int multiresModifier_reshapeFromDM(Object *ob, DerivedMesh *srcdm)
 {
        DerivedMesh *mrdm = get_multires_dm (ob);
 
@@ -228,13 +228,13 @@ int multiresModifier_reshapeFromDM(MultiresModifierData *mmd, Object *ob, Derive
 }
 
 /* Returns 1 on success, 0 if the src's totvert doesn't match */
-int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src)
+int multiresModifier_reshape(Object *dst, Object *src)
 {
        DerivedMesh *srcdm = src->derivedFinal;
-       return multiresModifier_reshapeFromDM(mmd, dst, srcdm);
+       return multiresModifier_reshapeFromDM(dst, srcdm);
 }
 
-int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob, ModifierData *md)
+int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
 {
        ModifierTypeInfo *mti = modifierType_getInfo(md->type);
        DerivedMesh *dm, *ndm;
@@ -256,7 +256,7 @@ int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob,
        dm->release(dm);
 
        /* Reshaping */
-       result= multiresModifier_reshapeFromDM(mmd, ob, ndm);
+       result= multiresModifier_reshapeFromDM(ob, ndm);
 
        /* Cleanup */
        ndm->release(ndm);
index 3d49548cba76566c28872a9966cad9edc39867a9..13ea55ebf0f04eb80e2f4feb8477678941f9d743 100644 (file)
@@ -2434,7 +2434,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
        bNode *node;
        ListBase threads;
        ThreadData thdata;
-       int totnode, rendering= 1;
+       int totnode, curnode, rendering= 1;
        
        if(ntree==NULL) return;
        
@@ -2455,7 +2455,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
        BLI_srandom(rd->cfra);
 
        /* sets need_exec tags in nodes */
-       totnode= setExecutableNodes(ntree, &thdata);
+       curnode = totnode= setExecutableNodes(ntree, &thdata);
 
        BLI_init_threads(&threads, exec_composite_node, rd->threads);
        
@@ -2465,14 +2465,14 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
                        node= getExecutableNode(ntree);
                        if(node) {
                                
-                               if(ntree->timecursor)
-                                       ntree->timecursor(ntree->tch, totnode);
+                               if(ntree->progress)
+                                       ntree->progress(ntree->prh, (1.0 - curnode/(float)totnode));
                                if(ntree->stats_draw) {
                                        char str[64];
-                                       sprintf(str, "Compositing %d %s", totnode, node->name);
+                                       sprintf(str, "Compositing %d %s", curnode, node->name);
                                        ntree->stats_draw(ntree->sdh, str);
                                }
-                               totnode--;
+                               curnode--;
                                
                                node->threaddata = &thdata;
                                node->exec= NODE_PROCESSING;
index 24c23e5ea41ada903e4a33246cdb1a9556f47cb2..576b3481d07a62046f8a960b1245c52e261cefa7 100644 (file)
@@ -2879,15 +2879,18 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, char *name, int from_m
                newkey= 1;
        }
 
-       kb= add_keyblock(key, name);
-
        if(newkey || from_mix==FALSE) {
                /* create from mesh */
+               kb= add_keyblock(key, name);
                mesh_to_key(me, kb);
        }
        else {
                /* copy from current values */
-               kb->data= do_ob_key(scene, ob);
+               float *data= do_ob_key(scene, ob);
+
+               /* create new block with prepared data */
+               kb= add_keyblock(key, name);
+               kb->data= data;
                kb->totelem= me->totvert;
        }
 
@@ -2907,16 +2910,20 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, char *name, int from_m
                newkey= 1;
        }
 
-       kb= add_keyblock(key, name);
-
        if(newkey || from_mix==FALSE) {
+               kb= add_keyblock(key, name);
+
                /* create from lattice */
                latt_to_key(lt, kb);
        }
        else {
                /* copy from current values */
+               float *data= do_ob_key(scene, ob);
+
+               /* create new block with prepared data */
+               kb= add_keyblock(key, name);
                kb->totelem= lt->pntsu*lt->pntsv*lt->pntsw;
-               kb->data= do_ob_key(scene, ob);
+               kb->data= data;
        }
 
        return kb;
@@ -2936,16 +2943,19 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, char *name, int from_
                newkey= 1;
        }
 
-       kb= add_keyblock(key, name);
-
        if(newkey || from_mix==FALSE) {
                /* create from curve */
+               kb= add_keyblock(key, name);
                curve_to_key(cu, kb, lb);
        }
        else {
                /* copy from current values */
+               float *data= do_ob_key(scene, ob);
+
+               /* create new block with prepared data */
+               kb= add_keyblock(key, name);
                kb->totelem= count_curveverts(lb);
-               kb->data= do_ob_key(scene, ob);
+               kb->data= data;
        }
 
        return kb;
index fffbd31aa02806d642252c416590619262347283..0c55cc2aaacc2b4b3edbd4a0cd7577d254ab3668 100644 (file)
@@ -433,7 +433,7 @@ void free_keyed_keys(ParticleSystem *psys)
                }
        }
 }
-static void free_child_path_cache(ParticleSystem *psys)
+void psys_free_child_path_cache(ParticleSystem *psys)
 {
        psys_free_path_cache_buffers(psys->childcache, &psys->childcachebufs);
        psys->childcache = NULL;
@@ -451,7 +451,7 @@ void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
                psys->pathcache= NULL;
                psys->totcached= 0;
 
-               free_child_path_cache(psys);
+               psys_free_child_path_cache(psys);
        }
 }
 void psys_free_children(ParticleSystem *psys)
@@ -462,7 +462,7 @@ void psys_free_children(ParticleSystem *psys)
                psys->totchild=0;
        }
 
-       free_child_path_cache(psys);
+       psys_free_child_path_cache(psys);
 }
 void psys_free_particles(ParticleSystem *psys)
 {
@@ -1037,6 +1037,7 @@ typedef struct ParticleInterpolationData {
        ParticleKey *kkey[2];
 
        PointCache *cache;
+       PTCacheMem *pm;
 
        PTCacheEditPoint *epoint;
        PTCacheEditKey *ekey[2];
@@ -1045,31 +1046,74 @@ typedef struct ParticleInterpolationData {
        int bspline;
 } ParticleInterpolationData;
 /* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */
-static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, int index, float t, ParticleKey *key1, ParticleKey *key2)
+/* It uses ParticleInterpolationData->pm to store the current memory cache frame so it's thread safe. */
+static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2)
 {
-       static PTCacheMem *pm = NULL; /* not thread safe */
+       static PTCacheMem *pm = NULL;
 
        if(index < 0) { /* initialize */
-               pm = cache->mem_cache.first;
+               *cur = cache->mem_cache.first;
 
-               if(pm)
-                       pm = pm->next;
+               if(*cur)
+                       *cur = (*cur)->next;
        }
        else {
-               if(pm) {
-                       while(pm && pm->next && (float)pm->frame < t)
-                               pm = pm->next;
+               if(*cur) {
+                       while(*cur && (*cur)->next && (float)(*cur)->frame < t)
+                               *cur = (*cur)->next;
+
+                       pm = *cur;
 
                        BKE_ptcache_make_particle_key(key2, pm->index_array ? pm->index_array[index] - 1 : index, pm->data, (float)pm->frame);
-                       BKE_ptcache_make_particle_key(key1, pm->prev->index_array ? pm->prev->index_array[index] - 1 : index, pm->prev->data, (float)pm->prev->frame);
+                       if(pm->prev->index_array && pm->prev->index_array[index] == 0)
+                               copy_particle_key(key1, key2, 1);
+                       else
+                               BKE_ptcache_make_particle_key(key1, pm->prev->index_array ? pm->prev->index_array[index] - 1 : index, pm->prev->data, (float)pm->prev->frame);
                }
                else if(cache->mem_cache.first) {
-                       PTCacheMem *pm2 = cache->mem_cache.first;
-                       BKE_ptcache_make_particle_key(key2, pm2->index_array ? pm2->index_array[index] - 1 : index, pm2->data, (float)pm2->frame);
+                       pm = cache->mem_cache.first;
+                       BKE_ptcache_make_particle_key(key2, pm->index_array ? pm->index_array[index] - 1 : index, pm->data, (float)pm->frame);
                        copy_particle_key(key1, key2, 1);
                }
        }
 }
+static int get_pointcache_times_for_particle(PointCache *cache, int index, float *start, float *end)
+{
+       PTCacheMem *pm;
+       int ret = 0;
+
+       for(pm=cache->mem_cache.first; pm; pm=pm->next) {
+               if(pm->index_array) {
+                       if(pm->index_array[index]) {
+                               *start = pm->frame;
+                               ret++;
+                               break;
+                       }
+               }
+               else {
+                       *start = pm->frame;
+                       ret++;
+                       break;
+               }
+       }
+
+       for(pm=cache->mem_cache.last; pm; pm=pm->prev) {
+               if(pm->index_array) {
+                       if(pm->index_array[index]) {
+                               *end = pm->frame;
+                               ret++;
+                               break;
+                       }
+               }
+               else {
+                       *end = pm->frame;
+                       ret++;
+                       break;
+               }
+       }
+
+       return ret == 2;
+}
 static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
 {
 
@@ -1091,10 +1135,15 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
                pind->dietime = (key + pa->totkey - 1)->time;
        }
        else if(pind->cache) {
-               get_pointcache_keys_for_time(ob, pind->cache, -1, 0.0f, NULL, NULL);
-
+               float start, end;
+               get_pointcache_keys_for_time(ob, pind->cache, &pind->pm, -1, 0.0f, NULL, NULL);
                pind->birthtime = pa ? pa->time : pind->cache->startframe;
                pind->dietime = pa ? pa->dietime : pind->cache->endframe;
+
+               if(get_pointcache_times_for_particle(pind->cache, pa - psys->particles, &start, &end)) {
+                       pind->birthtime = MAX2(pind->birthtime, start);
+                       pind->dietime = MIN2(pind->dietime, end);
+               }
        }
        else {
                HairKey *key = pa->hair;
@@ -1224,7 +1273,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
                memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey));
        }
        else if(pind->cache) {
-               get_pointcache_keys_for_time(NULL, pind->cache, p, real_t, keys+1, keys+2);
+               get_pointcache_keys_for_time(NULL, pind->cache, &pind->pm, p, real_t, keys+1, keys+2);
        }
        else {
                hair_to_particle(keys + 1, pind->hkey[0]);
@@ -2672,7 +2721,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupd
        }
        else {
                /* clear out old and create new empty path cache */
-               free_child_path_cache(sim->psys);
+               psys_free_child_path_cache(sim->psys);
                sim->psys->childcache= psys_alloc_path_cache_buffers(&sim->psys->childcachebufs, totchild, ctx->steps+1);
                sim->psys->totchildcache = totchild;
        }
@@ -2743,7 +2792,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
        int keyed, baked;
 
        /* we don't have anything valid to create paths from so let's quit here */
-       if((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
+       if((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache)==0)
                return;
 
        if(psys_in_edit_mode(sim->scene, psys))
@@ -2753,7 +2802,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
        BLI_srandom(psys->seed);
 
        keyed = psys->flag & PSYS_KEYED;
-       baked = !hair_dm && psys->pointcache->flag & PTCACHE_BAKED;
+       baked = !hair_dm && psys->pointcache->mem_cache.first;
 
        /* clear out old and create new empty path cache */
        psys_free_path_cache(psys, psys->edit);
@@ -3148,7 +3197,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
 
        edit->totcached = totpart;
 
-       if(psys && psys->part->type == PART_HAIR) {
+       if(psys) {
                ParticleSimulationData sim = {scene, ob, psys, psys_get_modifier(ob, psys), NULL};
                psys_cache_child_paths(&sim, cfra, 1);
        }
index 25328a0632849e58b91dd8b8577b80d37cb070f1..ce84ee96d019b1a91df4b1a59e1ed8399b1df081 100644 (file)
@@ -3075,66 +3075,18 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
 /*                     Hair                                                            */
 /************************************************/
 /* check if path cache or children need updating and do it if needed */
-static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
+void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
 {
        ParticleSystem *psys = sim->psys;
        ParticleSettings *part = psys->part;
-       ParticleEditSettings *pset = &sim->scene->toolsettings->particle;
-       int distr=0, alloc=0, skip=0;
-
-       if((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET)
-               alloc=1;
-
-       if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT)))
-               distr=1;
-
-       if(distr){
-               if(alloc)
-                       realloc_particles(sim, sim->psys->totpart);
-
-               if(get_psys_tot_child(sim->scene, psys)) {
-                       /* don't generate children while computing the hair keys */
-                       if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) {
-                               distribute_particles(sim, PART_FROM_CHILD);
-
-                               if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES && part->parents!=0.0)
-                                       psys_find_parents(sim);
-                       }
-               }
-               else
-                       psys_free_children(psys);
-       }
-
-       if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED)==0)
-               skip = 1; /* only hair, keyed and baked stuff can have paths */
-       else if(part->ren_as != PART_DRAW_PATH && !(part->type==PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)))
-               skip = 1; /* particle visualization must be set as path */
-       else if(!psys->renderdata) {
-               if(part->draw_as != PART_DRAW_REND)
-                       skip = 1; /* draw visualization */
-               else if(psys->pointcache->flag & PTCACHE_BAKING)
-                       skip = 1; /* no need to cache paths while baking dynamics */
-               else if(psys_in_edit_mode(sim->scene, psys)) {
-                       if((pset->flag & PE_DRAW_PART)==0)
-                               skip = 1;
-                       else if(part->childtype==0 && (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED)==0)
-                               skip = 1; /* in edit mode paths are needed for child particles and dynamic hair */
-               }
-       }
-
-       if(!skip) {
+       
+       /* only hair, keyed and baked stuff can have paths */
+       if(part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->mem_cache.first) {
                psys_cache_paths(sim, cfra);
 
                /* for render, child particle paths are computed on the fly */
-               if(part->childtype) {
-                       if(!psys->totchild)
-                               skip = 1;
-                       else if((psys->part->type == PART_HAIR && psys->flag & PSYS_HAIR_DONE)==0)
-                               skip = 1;
-
-                       if(!skip)
-                               psys_cache_child_paths(sim, cfra, 0);
-               }
+               if(part->childtype && psys->totchild)
+                       psys_cache_child_paths(sim, cfra, 0);
        }
        else if(psys->pathcache)
                psys_free_path_cache(psys, NULL);
@@ -3249,6 +3201,8 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
        psys->hair_out_dm = clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, 0, 0);
 
        psys->clmd->sim_parms->effector_weights = NULL;
+
+       psys_free_path_cache(psys, NULL);
 }
 static void hair_step(ParticleSimulationData *sim, float cfra)
 {
@@ -3278,10 +3232,6 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
        if(psys->part->type==PART_HAIR && psys->flag & PSYS_HAIR_DYNAMICS)
                do_hair_dynamics(sim);
 
-       psys_update_effectors(sim);
-
-       psys_update_path_cache(sim, cfra);
-
        psys->flag |= PSYS_HAIR_UPDATED;
 }
 
@@ -3500,14 +3450,19 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
        }
 
        free_collider_cache(&sim->colliders);
+
+       if(psys->pathcache)
+               psys_free_path_cache(psys, NULL);
 }
-static void update_children(ParticleSimulationData *sim)
+void psys_update_children(ParticleSimulationData *sim)
 {
        if((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
        /* don't generate children while growing hair - waste of time */
                psys_free_children(sim->psys);
-       else if(sim->psys->part->childtype && sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
-               distribute_particles(sim, PART_FROM_CHILD);
+       else if(sim->psys->part->childtype) {
+               if(sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
+                       distribute_particles(sim, PART_FROM_CHILD);
+       }
        else
                psys_free_children(sim->psys);
 }
@@ -3762,8 +3717,6 @@ static void system_step(ParticleSimulationData *sim, float cfra)
 
                if(ELEM(cache_result, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) {
                        cached_step(sim, cfra);
-                       update_children(sim);
-                       psys_update_path_cache(sim, cfra);
 
                        BKE_ptcache_validate(cache, framenr);
 
@@ -3827,9 +3780,6 @@ static void system_step(ParticleSimulationData *sim, float cfra)
                        BKE_ptcache_write_cache(use_cache, framenr);
        }
 
-       if(init)
-               update_children(sim);
-
 /* cleanup */
        if(psys->lattice){
                end_latt_deform(psys->lattice);
@@ -3992,6 +3942,13 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
        /* execute drivers only, as animation has already been done */
        BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
 
+       /* TODO: only free child paths in case of PSYS_RECALC_CHILD */
+       if(psys->recalc & PSYS_RECALC)
+               psys_free_path_cache(psys, NULL);
+
+       if(psys->recalc & PSYS_RECALC_CHILD)
+               psys_free_children(psys);
+
        if(psys->recalc & PSYS_RECALC_TYPE)
                psys_changed_type(&sim);
        else if(psys->recalc & PSYS_RECALC_PHYS)
@@ -4048,7 +4005,6 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
                                        if(part->phystype == PART_PHYS_KEYED) {
                                                psys_count_keyed_targets(&sim);
                                                set_keyed_keys(&sim);
-                                               psys_update_path_cache(&sim,(int)cfra);
                                        }
                                        break;
                                }
index 6a43251efdd2d2c2fbc582c6ac9469cdd4d5038d..80904c1b1e76b6e66baec7086526ccd8265a8d34 100644 (file)
@@ -44,6 +44,7 @@
 #include "BKE_utildefines.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
+#include "BKE_library.h"
 
 /* ******************* SENSORS ************************ */
 
@@ -348,7 +349,19 @@ void unlink_actuators(ListBase *lb)
 
 void free_actuator(bActuator *act)
 {
-       if(act->data) MEM_freeN(act->data);
+       bSoundActuator *sa;
+
+       if(act->data) {
+               switch (act->type) {
+                       case ACT_SOUND:
+                               sa = (bSoundActuator *) act->data;
+                               if(sa->sound)
+                                       id_us_min((ID *) sa->sound);
+                               break;
+               }
+
+               MEM_freeN(act->data);
+       }
        MEM_freeN(act);
 }
 
@@ -365,6 +378,7 @@ void free_actuators(ListBase *lb)
 bActuator *copy_actuator(bActuator *act)
 {
        bActuator *actn;
+       bSoundActuator *sa;
        
        act->mynew=actn= MEM_dupallocN(act);
        actn->flag |= ACT_NEW;
@@ -372,6 +386,13 @@ bActuator *copy_actuator(bActuator *act)
                actn->data= MEM_dupallocN(act->data);
        }
        
+       switch (act->type) {
+               case ACT_SOUND:
+                       sa= (bSoundActuator *)act->data;
+                       if(sa->sound)
+                               id_us_plus((ID *) sa->sound);
+                       break;
+       }
        return actn;
 }
 
index 61f83ccf6f9fda5af983264b1994447dcc01b97a..cc4d65980c97656140c4db6c9972f3f77f28d389 100644 (file)
@@ -41,12 +41,18 @@ typedef int (*BA_ArgCallback)(int argc, char **argv, void *data);
 struct bArgs *BLI_argsInit(int argc, char **argv);
 void BLI_argsFree(struct bArgs *ba);
 
-/* pass starts at 1, -1 means valid all the time */
-void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data);
-void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data); /* not case specific */
+/* pass starts at 1, -1 means valid all the time
+ * short_arg or long_arg can be null to specify no short or long versions
+ * */
+void BLI_argsAdd(struct bArgs *ba, int pass, char *short_arg, char *long_arg, char *doc, BA_ArgCallback cb, void *data);
+/* short_case and long_case specify if those arguments are case specific */
+void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case, char *long_arg, int long_case, char *doc, BA_ArgCallback cb, void *data);
 
 void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);
 
+void BLI_argsPrintArgDoc(struct bArgs *ba, char *arg);
+void BLI_argsPrintOtherDoc(struct bArgs *ba);
+
 void BLI_argsPrint(struct bArgs *ba);
 char **BLI_argsArgv(struct bArgs *ba);
 
index 61ddf8314e56a573020e43a38f994c720efbd7d5..dc964639e6892b96dabb93e8e72c63f3f1782afe 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_listbase.h"
 #include "BLI_string.h"
 #include "BLI_args.h"
 #include "BLI_ghash.h"
 
+char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
+
+struct bArgDoc;
+typedef struct bArgDoc {
+       struct bArgDoc *next, *prev;
+       char *short_arg;
+       char *long_arg;
+       char *documentation;
+       int  done;
+} bArgDoc;
+
 typedef struct bAKey {
        char *arg;
        uintptr_t pass; /* cast easier */
@@ -47,9 +59,11 @@ typedef struct bArgument {
        bAKey *key;
        BA_ArgCallback func;
        void *data;
+       bArgDoc *doc;
 } bArgument;
 
 struct bArgs {
+       ListBase docs;
        GHash  *items;
        int     argc;
        char  **argv;
@@ -70,7 +84,7 @@ static unsigned int case_strhash(void *ptr) {
 static unsigned int    keyhash(void *ptr)
 {
        bAKey *k = ptr;
-       return case_strhash(k->arg) ^ BLI_ghashutil_inthash((void*)k->pass);
+       return case_strhash(k->arg); // ^ BLI_ghashutil_inthash((void*)k->pass);
 }
 
 static int keycmp(void *a, void *b)
@@ -103,6 +117,7 @@ bArgs *BLI_argsInit(int argc, char **argv)
        bArgs *ba = MEM_callocN(sizeof(bArgs), "bArgs");
        ba->passes = MEM_callocN(sizeof(int) * argc, "bArgs passes");
        ba->items = BLI_ghash_new(keyhash, keycmp, "bArgs passes gh");
+       ba->docs.first = ba->docs.last = NULL;
        ba->argc = argc;
        ba->argv = argv;
 
@@ -118,6 +133,7 @@ void BLI_argsFree(struct bArgs *ba)
 {
        BLI_ghash_free(ba->items, freeItem, freeItem);
        MEM_freeN(ba->passes);
+       BLI_freelistN(&ba->docs);
        MEM_freeN(ba);
 }
 
@@ -134,7 +150,25 @@ char **BLI_argsArgv(struct bArgs *ba)
        return ba->argv;
 }
 
-static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ArgCallback cb, void *data)
+static bArgDoc *internalDocs(struct bArgs *ba, char *short_arg, char *long_arg, char *doc)
+{
+       bArgDoc *d;
+
+       d = MEM_callocN(sizeof(bArgDoc), "bArgDoc");
+
+       if (doc == NULL)
+               doc = NO_DOCS;
+
+       d->short_arg = short_arg;
+       d->long_arg = long_arg;
+       d->documentation = doc;
+
+       BLI_addtail(&ba->docs, d);
+
+       return d;
+}
+
+static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
 {
        bArgument *a;
        bAKey *key;
@@ -157,30 +191,73 @@ static void internalAdd(struct bArgs *ba, char *arg, int pass, int case_str, BA_
        a->key = key;
        a->func = cb;
        a->data = data;
+       a->doc = d;
 
        BLI_ghash_insert(ba->items, key, a);
 }
 
-void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data)
+void BLI_argsAddCase(struct bArgs *ba, int pass, char *short_arg, int short_case, char *long_arg, int long_case, char *doc, BA_ArgCallback cb, void *data)
+{
+       bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc);
+
+       if (short_arg)
+               internalAdd(ba, short_arg, pass, short_case, cb, data, d);
+
+       if (long_arg)
+               internalAdd(ba, long_arg, pass, long_case, cb, data, d);
+
+
+}
+
+void BLI_argsAdd(struct bArgs *ba, int pass, char *short_arg, char *long_arg, char *doc, BA_ArgCallback cb, void *data)
 {
-       internalAdd(ba, arg, pass, 0, cb, data);
+       BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data);
 }
 
-void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data)
+static void internalDocPrint(bArgDoc *d)
 {
-       internalAdd(ba, arg, pass, 1, cb, data);
+       if (d->short_arg && d->long_arg)
+               printf("%s or %s", d->short_arg, d->long_arg);
+       else if (d->short_arg)
+               printf("%s", d->short_arg);
+       else if (d->long_arg)
+               printf("%s", d->long_arg);
+
+       printf(" %s\n\n", d->documentation);
 }
 
+void BLI_argsPrintArgDoc(struct bArgs *ba, char *arg)
+{
+       bArgument *a = lookUp(ba, arg, -1, -1);
+
+       if (a)
+       {
+               bArgDoc *d = a->doc;
+
+               internalDocPrint(d);
+
+               d->done = 1;
+       }
+}
+
+void BLI_argsPrintOtherDoc(struct bArgs *ba)
+{
+       bArgDoc *d;
+
+       for( d = ba->docs.first; d; d = d->next)
+       {
+               if (d->done == 0)
+               {
+                       internalDocPrint(d);
+               }
+       }
+}
 
 void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data)
 {
        int i = 0;
 
        for( i = 1; i < ba->argc; i++) { /* skip argv[0] */
-               /* stop on -- */
-               if (BLI_streq(ba->argv[i], "--"))
-                       break;
-
                if (ba->passes[i] == 0) {
                         /* -1 signal what side of the comparison it is */
                        bArgument *a = lookUp(ba, ba->argv[i], pass, -1);
index 8ce9511467c2e463f5e8a1aeae3119985ed6baf0..a2bdcfd007675ef05aeef5086c822b6780d98f7e 100644 (file)
@@ -62,7 +62,7 @@
 /* for sequence */
 //XXX #include "BSE_sequence.h"
 //XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
-#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE)
+#define SEQ_HAS_PATH(_seq) ( (_seq)->type==SEQ_MOVIE || (_seq)->type==SEQ_IMAGE || (_seq)->type==SEQ_SOUND )
 
 
 
@@ -262,7 +262,7 @@ static void seq_getpath(struct BPathIterator *bpi, char *path) {
        path[0] = '\0'; /* incase we cant get the path */
        if (seq==NULL) return;
        if (SEQ_HAS_PATH(seq)) {
-               if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
+               if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
                        BLI_strncpy(path, seq->strip->dir, FILE_MAX);
                        BLI_add_slash(path); /* incase its missing */
                        if (seq->strip->stripdata) { /* should always be true! */
@@ -281,7 +281,7 @@ static void seq_setpath(struct BPathIterator *bpi, char *path) {
        if (seq==NULL) return; 
        
        if (SEQ_HAS_PATH(seq)) {
-               if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
+               if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
                        BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
                } else {
                        /* simple case */
index c63ceb1e5b0534589d24ab37fac15b2365f78dcd..0ad6f84e8f05f97521f060471911b55b79ebe34f 100644 (file)
@@ -214,10 +214,7 @@ static void *tslot_thread_start(void *tslot_p)
 }
 
 int BLI_thread_is_main(void) {
-       pthread_t  tid;
-       tid = pthread_self();
-
-       return !memcmp(&tid, &mainid, sizeof(pthread_t));
+       return pthread_equal(pthread_self(), mainid);
 }
 
 void BLI_insert_thread(ListBase *threadbase, void *callerdata)
index a95e5867c7e3d75e208a407ec323a4e248ab8835..182c582cc0fa9f15f90313212b59c4dbafd7b406 100644 (file)
@@ -35,10 +35,12 @@ struct MemFile;
 struct Main;
 struct ReportList;
 
-extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports);
+extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports, int *thumb);
 extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current, 
                                                          int write_flags, struct ReportList *reports);
 extern int BLO_write_runtime(struct Main *mainvar, char *file, char *exename, struct ReportList *reports);
 
+#define BLEN_THUMB_SIZE 128
+
 #endif
 
index 5b732d5b1de1f7b9603e8fc165930a5fbeb484dd..4423758ba7f49e65f8967193069817e686f1be8a 100644 (file)
@@ -2082,7 +2082,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
        
        ntree->init= 0;         /* to set callbacks and force setting types */
        ntree->owntype= NULL;
-       ntree->timecursor= NULL;
+       ntree->progress= NULL;
        
        ntree->adt= newdataadr(fd, ntree->adt);
        direct_link_animdata(fd, ntree->adt);
@@ -4179,7 +4179,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                                if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
                                if(seq->scene) {
                                        seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
-                                       seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
+                                       seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
                                }
                                if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
                                if(seq->sound) {
@@ -4190,7 +4190,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                                                seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
                                        if (seq->sound) {
                                                seq->sound->id.us++;
-                                               seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs);
+                                               seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
                                        }
                                }
                                seq->anim= 0;
@@ -4218,8 +4218,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                                srl->light_override= newlibadr_us(fd, sce->id.lib, srl->light_override);
                        }
                        /*Game Settings: Dome Warp Text*/
-//                     sce->r.dometext= newlibadr_us(fd, sce->id.lib, sce->r.dometext); // XXX deprecated since 2.5
-                       sce->gm.dome.warptext= newlibadr_us(fd, sce->id.lib, sce->gm.dome.warptext);
+                       sce->gm.dome.warptext= newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
 
                        sce->id.flag -= LIB_NEEDLINK;
                }
@@ -10853,8 +10852,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
        
+
        /* put 2.50 compatibility code here until next subversion bump */
        {
+               Object *ob;
                bScreen *sc;
 
                for (sc= main->screen.first; sc; sc= sc->id.next) {
@@ -10876,6 +10877,41 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
 
                do_version_mdef_250(fd, lib, main);
+
+               /* parent type to modifier */
+               for(ob = main->object.first; ob; ob = ob->id.next) {
+                       if(ob->parent) {
+                               Object *parent= (Object *)newlibadr(fd, lib, ob->parent);
+                               if(parent) { /* parent may not be in group */
+                                       if(parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+                                               ArmatureModifierData *amd;
+                                               bArmature *arm= (bArmature *)newlibadr(fd, lib, parent->data);
+
+                                               amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature);
+                                               amd->object = ob->parent;
+                                               BLI_addtail((ListBase*)&ob->modifiers, amd);
+                                               amd->deformflag= arm->deformflag;
+                                               ob->partype = PAROBJECT;
+                                       }
+                                       else if(parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+                                               LatticeModifierData *lmd;
+
+                                               lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
+                                               lmd->object = ob->parent;
+                                               BLI_addtail((ListBase*)&ob->modifiers, lmd);
+                                               ob->partype = PAROBJECT;
+                                       }
+                                       else if(parent->type==OB_CURVE && ob->partype==PARCURVE) {
+                                               CurveModifierData *cmd;
+
+                                               cmd = (CurveModifierData*) modifier_new(eModifierType_Curve);
+                                               cmd->object = ob->parent;
+                                               BLI_addtail((ListBase*)&ob->modifiers, cmd);
+                                               ob->partype = PAROBJECT;
+                                       }
+                               }
+                       }
+               }
        }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@ -10976,7 +11012,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filename)
                switch(bhead->code) {
                case DATA:
                case DNA1:
-               case TEST:
+               case TEST: /* used as preview since 2.5x */
                case REND:
                        bhead = blo_nextbhead(fd, bhead);
                        break;
index 8e15601ff515b23d03f8a5a427a88c234eb35008..9f66d907ef5dfc3e2c237e750e092b8a9662a62b 100644 (file)
@@ -62,6 +62,7 @@ Any case: direct data is ALWAYS after the lib block
        - write library block
        - per LibBlock
                - write the ID of LibBlock
+- write TEST (128x128, blend file preview, optional)
 - write FileGlobal (some global vars)
 - write SDNA
 - write USER if filename is ~/.B.blend
@@ -2393,9 +2394,19 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
        writestruct(wd, GLOB, "FileGlobal", 1, &fg);
 }
 
+/* preview image, first 2 values are width and height
+ * second are an RGBA image (unsigned char)
+ * note, this uses 'TEST' since new types will segfault on file load for older blender versions.
+ */
+static void write_thumb(WriteData *wd, int *img)
+{
+       if(img)
+               writedata(wd, TEST, (2 + img[0] * img[1]) * sizeof(int), img);
+}
+
 /* if MemFile * there's filesave to memory */
 static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFile *current, 
-                                                        int write_user_block, int write_flags)
+                                                        int write_user_block, int write_flags, int *thumb)
 {
        BHead bhead;
        ListBase mainlist;
@@ -2410,6 +2421,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
        mywrite(wd, buf, 12);
 
        write_renderinfo(wd, mainvar);
+       write_thumb(wd, thumb);
        write_global(wd, write_flags, mainvar);
 
        /* no UI save in undo */
@@ -2461,7 +2473,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
 }
 
 /* return: success (1) */
-int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *reports)
+int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *reports, int *thumb)
 {
        char userfilename[FILE_MAXDIR+FILE_MAXFILE];
        char tempname[FILE_MAXDIR+FILE_MAXFILE+1];
@@ -2500,7 +2512,7 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report
                makeFilesRelative(dir, NULL); /* note, making relative to something OTHER then G.sce */
 
        /* actual file writing */
-       err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags);
+       err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags, thumb);
        close(file);
 
        /* rename/compress */
@@ -2553,7 +2565,7 @@ int BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int wr
 {
        int err;
 
-       err= write_file_handle(mainvar, 0, compare, current, 0, write_flags);
+       err= write_file_handle(mainvar, 0, compare, current, 0, write_flags, NULL);
        
        if(err==0) return 1;
        return 0;
@@ -2649,7 +2661,7 @@ int BLO_write_runtime(Main *mainvar, char *file, char *exename, ReportList *repo
        outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
        if (outfd != -1) {
 
-               write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags);
+               write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags, NULL);
 
                if (write(outfd, " ", 1) != 1) {
                        BKE_report(reports, RPT_ERROR, "Unable to write to output file.");
@@ -2735,7 +2747,7 @@ int BLO_write_runtime(Main *mainvar, char *file, char *exename, ReportList *repo
 
        datastart= lseek(outfd, 0, SEEK_CUR);
 
-       write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags);
+       write_file_handle(mainvar, outfd, NULL,NULL, 0, G.fileflags, NULL);
 
        if (!handle_write_msb_int(outfd, datastart) || (write(outfd, "BRUNTIME", 8)!=8)) {
                BKE_report(reports, RPT_ERROR, "Unable to write to output file.");
index 86085aa0573e494bbe52a36746e9b352f886453f..bf379ae3ca6ed1bc883a35f301d06e55580c237e 100644 (file)
@@ -57,6 +57,10 @@ IF(WITH_OPENEXR)
        ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
+IF(WITH_TIFF)
+       ADD_DEFINITIONS(-DWITH_TIFF)
+ENDIF(WITH_TIFF)
+
 IF(WITH_OPENJPEG)
        ADD_DEFINITIONS(-DWITH_OPENJPEG)
 ENDIF(WITH_OPENJPEG)
index 97c93c6a913ec3b268b94128b518aa8b09347ccc..bdaf0bf700a8304b277a6da9f0efcf3d6a8c4d64 100644 (file)
@@ -939,7 +939,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *op)
        /* do groups only first (unless in Drivers mode, where there are none) */
        if (ac.datatype != ANIMCONT_DRIVERS) {
                /* filter data */
-               filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CHANNELS | ANIMFILTER_FOREDIT);
+               filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CHANNELS | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
                ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
                
                /* delete selected groups and their associated channels */
@@ -978,7 +978,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *op)
        /* now do F-Curves */
        if (ac.datatype != ANIMCONT_GPENCIL) {
                /* filter data */
-               filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT);
+               filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
                ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
                
                /* delete selected F-Curves */
@@ -1038,7 +1038,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
        ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
        
        /* hide all channels not selected */
-       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_UNSEL);
+       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1054,7 +1054,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
        BLI_freelistN(&anim_data);
        
        /* make all the selected channels visible */
-       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL);
+       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1113,11 +1113,11 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
                
        /* get list of all channels that selection may need to be flushed to */
-       filter= ANIMFILTER_CHANNELS;
+       filter= (ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
                
        /* filter data */
-       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL);
+       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        /* See if we should be making showing all selected or hiding */
@@ -1215,7 +1215,8 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
        }
        
        /* filter data that we're working on */
-       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
+       // XXX: noduplis enabled so that results don't cancel, but will be problematic for some channels where only type differs
+       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS);
        if (onlysel) filter |= ANIMFILTER_SEL;
        ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
        
index 5ac7f6d411936cf675763a9e8e58c8df5f019114..67f2cb834e022e9c90ca32f58da145b4f0429977 100644 (file)
@@ -68,6 +68,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
+#include "BLI_ghash.h"
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
@@ -2512,6 +2513,65 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
        return 1;
 }  
 
+/* ----------- Cleanup API --------------- */
+
+/* Remove entries with invalid types in animation channel list */
+static int animdata_filter_remove_invalid (ListBase *anim_data)
+{
+       bAnimListElem *ale, *next;
+       int items = 0;
+       
+       /* only keep entries with valid types */
+       for (ale= anim_data->first; ale; ale= next) {
+               next= ale->next;
+               
+               if (ale->type == ANIMTYPE_NONE)
+                       BLI_freelinkN(anim_data, ale);
+               else
+                       items++;
+       }
+       
+       return items;
+}
+
+/* Remove duplicate entries in animation channel list */
+static int animdata_filter_remove_duplis (ListBase *anim_data)
+{
+       bAnimListElem *ale, *next;
+       GHash *gh;
+       int items = 0;
+       
+       /* build new hashtable to efficiently store and retrieve which entries have been 
+        * encountered already while searching
+        */
+       gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "animdata_filter_duplis_remove gh");
+       
+       /* loop through items, removing them from the list if a similar item occurs already */
+       for (ale = anim_data->first; ale; ale = next) {
+               next = ale->next;
+               
+               /* check if hash has any record of an entry like this 
+                *      - just use ale->data for now, though it would be nicer to involve 
+                *        ale->type in combination too to capture corner cases (where same data performs differently)
+                */
+               if (BLI_ghash_haskey(gh, ale->data) == 0) {
+                       /* this entry is 'unique' and can be kept */
+                       BLI_ghash_insert(gh, ale->data, NULL);
+                       items++;
+               }
+               else {
+                       /* this entry isn't needed anymore */
+                       BLI_freelinkN(anim_data, ale);
+               }
+       }
+       
+       /* free the hash... */
+       BLI_ghash_free(gh, NULL, NULL);
+       
+       /* return the number of items still in the list */
+       return items;
+}
+
 /* ----------- Public API --------------- */
 
 /* This function filters the active data source to leave only animation channels suitable for
@@ -2527,7 +2587,6 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
        
        /* only filter data if there's somewhere to put it */
        if (data && anim_data) {
-               bAnimListElem *ale, *next;
                Object *obact= (ac) ? ac->obact : NULL;
                
                /* firstly filter the data */
@@ -2572,16 +2631,12 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
                                break;
                }
                        
-               /* remove any weedy entries */
-               // XXX this is weedy code!
-               for (ale= anim_data->first; ale; ale= next) {
-                       next= ale->next;
-                       
-                       if (ale->type == ANIMTYPE_NONE) {
-                               items--;
-                               BLI_freelinkN(anim_data, ale);
-                       }
-               }
+               /* remove any 'weedy' entries */
+               items = animdata_filter_remove_invalid(anim_data);
+               
+               /* remove duplicates (if required) */
+               if (filter_mode & ANIMFILTER_NODUPLIS)
+                       items = animdata_filter_remove_duplis(anim_data);
        }
        
        /* return the number of items in the list */
index 71033fbe3eccd58e46382cf137614aecc92d5465..613a3bd99db11ded9fb3bdbb6f5adfd20de7d637 100644 (file)
@@ -854,7 +854,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
                        /* get search-string */
                        index= pld->search_cursor;
                        
-                       if (IN_RANGE(index, 0, 64)) {
+                       if (index >= 0 && index <= 64) {
                                memcpy(&tempstr[0], &pld->searchstr[0], index);
                                tempstr[index]= '|';
                                memcpy(&tempstr[index+1], &pld->searchstr[index], 64-index);
index a9f9aac70d51cd3151772ad05e3f8792441a6cc7..ac0825ae6120011e315c71f59adb281843d39069 100644 (file)
@@ -85,6 +85,12 @@ void CURVE_OT_tilt_clear(struct wmOperatorType *ot);
 void CURVE_OT_smooth(struct wmOperatorType *ot);
 void CURVE_OT_smooth_radius(struct wmOperatorType *ot);
 
+void CURVE_OT_primitive_bezier_curve_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_bezier_circle_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_curve_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_circle_add(struct wmOperatorType *ot);
+void CURVE_OT_primitive_nurbs_path_add(struct wmOperatorType *ot);
+
 void CURVE_OT_de_select_first(struct wmOperatorType *ot);
 void CURVE_OT_de_select_last(struct wmOperatorType *ot);
 void CURVE_OT_select_all(struct wmOperatorType *ot);
index fa341ee19ef80cac9d9186c19652e8126d82c0ac..59e4490a63e60c086874b2a3d348d350383fabba 100644 (file)
@@ -96,6 +96,12 @@ void ED_operatortypes_curve(void)
        WM_operatortype_append(CURVE_OT_shade_smooth);
        WM_operatortype_append(CURVE_OT_shade_flat);
        WM_operatortype_append(CURVE_OT_tilt_clear);
+       
+       WM_operatortype_append(CURVE_OT_primitive_bezier_curve_add);
+       WM_operatortype_append(CURVE_OT_primitive_bezier_circle_add);
+       WM_operatortype_append(CURVE_OT_primitive_nurbs_curve_add);
+       WM_operatortype_append(CURVE_OT_primitive_nurbs_circle_add);
+       WM_operatortype_append(CURVE_OT_primitive_nurbs_path_add);
 
        WM_operatortype_append(CURVE_OT_smooth);
        WM_operatortype_append(CURVE_OT_smooth_radius);
@@ -179,8 +185,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
        /* only set in editmode curve, by space_view3d listener */
        keymap= WM_keymap_find(keyconf, "Curve", 0, 0);
        keymap->poll= ED_operator_editsurfcurve;
-       
-       WM_keymap_add_item(keymap, "OBJECT_OT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
+
+    WM_keymap_add_menu(keymap, "INFO_MT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
 
        WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
index 5c64b82ec873450265db5ebd7f03b26d93c0591f..1b1af31095a113114862b40f0046a464206e6bf6 100644 (file)
@@ -4886,7 +4886,6 @@ int join_curve_exec(bContext *C, wmOperator *op)
 }
 
 /************ add primitive, used by object/ module ****************/
-
 Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
 {
        static int xzproj= 0;   /* this function calls itself... */
@@ -5258,6 +5257,165 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
        return nu;
 }
 
+static int curve_prim_add(bContext *C, wmOperator *op, int type){
+       
+       Object *obedit= CTX_data_edit_object(C);
+       ListBase *editnurb;
+       Nurb *nu;
+       int newob= 0;//, type= RNA_enum_get(op->ptr, "type");
+       int enter_editmode;
+       unsigned int layer;
+       float loc[3], rot[3];
+       float mat[4][4];
+       
+       //object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
+       ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+       
+       if(obedit==NULL || obedit->type!=OB_CURVE) {
+               Curve *cu;
+               obedit= ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
+               newob = 1;
+
+               cu= (Curve*)obedit->data;
+               cu->flag |= CU_DEFORM_FILL;
+               if(type & CU_PRIM_PATH)
+                       cu->flag |= CU_PATH|CU_3D;
+       }
+       else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
+       
+       ED_object_new_primitive_matrix(C, loc, rot, mat);
+       
+       nu= add_nurbs_primitive(C, mat, type, newob);
+       editnurb= curve_get_editcurve(obedit);
+       BLI_addtail(editnurb, nu);
+       
+       /* userdef */
+       if (newob && !enter_editmode) {
+               ED_object_exit_editmode(C, EM_FREEDATA);
+       }
+       
+       WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
+       
+       return OPERATOR_FINISHED;
+}
+
+static int add_primitive_bezier_exec(bContext *C, wmOperator *op)
+{
+       return curve_prim_add(C, op, CU_BEZIER|CU_PRIM_CURVE);
+}
+
+void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Add Bezier";
+       ot->description= "Construct a Bezier Curve";
+       ot->idname= "CURVE_OT_primitive_bezier_curve_add";
+       
+       /* api callbacks */
+       ot->invoke= ED_object_add_generic_invoke;
+       ot->exec= add_primitive_bezier_exec;
+       ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
+{
+       return curve_prim_add(C, op, CU_BEZIER|CU_PRIM_CIRCLE);
+}
+
+void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Add Circle";
+       ot->description= "Construct a Bezier Circle";
+       ot->idname= "CURVE_OT_primitive_bezier_circle_add";
+       
+       /* api callbacks */
+       ot->invoke= ED_object_add_generic_invoke;
+       ot->exec= add_primitive_bezier_circle_exec;
+       ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op)
+{
+       return curve_prim_add(C, op, CU_NURBS|CU_PRIM_CURVE);
+}
+
+void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Add Nurbs Curve";
+       ot->description= "Construct a Nurbs Curve";
+       ot->idname= "CURVE_OT_primitive_nurbs_curve_add";
+       
+       /* api callbacks */
+       ot->invoke= ED_object_add_generic_invoke;
+       ot->exec= add_primitive_nurbs_curve_exec;
+       ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op)
+{
+       return curve_prim_add(C, op, CU_NURBS|CU_PRIM_CIRCLE);
+}
+
+void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Add Nurbs Circle";
+       ot->description= "Construct a Nurbs Circle";
+       ot->idname= "CURVE_OT_primitive_nurbs_circle_add";
+       
+       /* api callbacks */
+       ot->invoke= ED_object_add_generic_invoke;
+       ot->exec= add_primitive_nurbs_circle_exec;
+       ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_curve_path_exec(bContext *C, wmOperator *op)
+{
+       return curve_prim_add(C, op, CU_NURBS|CU_PRIM_PATH);
+}
+
+void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Add Path";
+       ot->description= "Construct a Path";
+       ot->idname= "CURVE_OT_primitive_nurbs_path_add";
+       
+       /* api callbacks */
+       ot->invoke= ED_object_add_generic_invoke;
+       ot->exec= add_primitive_curve_path_exec;
+       ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       ED_object_add_generic_props(ot, TRUE);
+}
+
+
+
 /***************** clear tilt operator ********************/
 
 static int clear_tilt_exec(bContext *C, wmOperator *op)
index 8408bb813aed984f33e1a10a05f3f296bcfcfc65..f4afe8b025200c2fc32591033a9eb558fac231b3 100644 (file)
 /* DataToC output of file <blenderbuttons> */
 
-int datatoc_blenderbuttons_size= 209681;
+int datatoc_blenderbuttons_size= 209697;
 char datatoc_blenderbuttons[]= {
-137, 80, 78, 71, 13, 10, 26, 10,  0,  0,  0, 13, 73, 72, 68, 82,  0,
-  0,  2, 90,  0,  0,  2,128,  8,  6,  0,  0,  0, 68,254,214,163,  0,  0,  0,  9,112, 72, 89,115,  0,  0, 13,215,  0,  0, 13,215,
-  1, 66, 40,155,120,  0,  0, 10, 79,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,
-108,101,  0,  0,120,218,157, 83,103, 84, 83,233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82, 21,  8, 32, 82, 66,139,128,
- 20,145, 38, 42, 33,  9, 16, 74,136, 33,161,217, 21, 81,193, 17, 69, 69,  4, 27,200,160,136,  3,142,142,128,140, 21, 81, 44, 12,
-138, 10,216,  7,228, 33,162,142,131,163,136,138,202,251,225,123,163,107,214,188,247,230,205,254,181,215, 62,231,172,243,157,179,
-207,  7,192,  8, 12,150, 72, 51, 81, 53,128, 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,129, 10, 36,112,  0, 16,  8,
-179,100, 33,115,253, 35,  1,  0,248,126, 60, 60, 43, 34,192,  7,190,  0,  1,120,211, 11,  8,  0,192, 77,155,192, 48, 28,135,255,
- 15,234, 66,153, 92,  1,128,132,  1,192,116,145, 56, 75,  8,128, 20,  0, 64,122,142, 66,166,  0, 64, 70,  1,128,157,152, 38, 83,
-  0,160,  4,  0, 96,203, 99, 98,227,  0, 80, 45,  0, 96, 39,127,230,211,  0,128,157,248,153,123,  1,  0, 91,148, 33, 21,  1,160,
-145,  0, 32, 19,101,136, 68,  0,104, 59,  0,172,207, 86,138, 69,  0, 88, 48,  0, 20,102, 75,196, 57,  0,216, 45,  0, 48, 73, 87,
-102, 72,  0,176,183,  0,192,206, 16, 11,178,  0,  8, 12,  0, 48, 81,136,133, 41,  0,  4,123,  0, 96,200, 35, 35,120,  0,132,153,
-  0, 20, 70,242, 87, 60,241, 43,174, 16,231, 42,  0,  0,120,153,178, 60,185, 36, 57, 69,129, 91,  8, 45,113,  7, 87, 87, 46, 30,
- 40,206, 73, 23, 43, 20, 54, 97,  2, 97,154, 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204,  0,  0,160,145, 21, 17,224,131,
-243,253,120,206, 14,174,206,206, 54,142,182, 14, 95, 45,234,191,  6,255, 34, 98, 98,227,254,229,207,171,112, 64,  0,  0,225,116,
-126,209,254, 44, 47,179, 26,128, 59,  6,128,109,254,162, 37,238,  4,104, 94, 11,160,117,247,139,102,178, 15, 64,181,  0,160,233,
-218, 87,243,112,248,126, 60, 60, 69,161,144,185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,125,254,103,194, 95,192, 87,
-253,108,249,126, 60,252,247,245,224,190,226, 36,129, 50, 93,129, 71,  4,248,224,194,204,244, 76,165, 28,207,146,  9,132, 98,220,
-230,143, 71,252,183, 11,255,252, 29,211, 34,196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,140,243, 50,165, 34,137, 66,
-146, 41,197, 37,210,255,100,226,223, 44,251,  3, 62,223, 53,  0,176,106, 62,  1,123,145, 45,168, 93, 99,  3,246, 75, 39, 16, 88,
-116,192,226,247,  0,  0,242,187,111,193,212, 40,  8,  3,128,104,131,225,207,119,255,239, 63,253, 71,160, 37,  0,128,102, 73,146,
-113,  0,  0, 94, 68, 36, 46, 84,202,179, 63,199,  8,  0,  0, 68,160,129, 42,176, 65, 27,244,193, 24, 44,192,  6, 28,193,  5,220,
-193, 11,252, 96, 54,132, 66, 36,196,194, 66, 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,205,176, 29, 42, 96, 47,212,
- 64, 29, 52,192, 81,104,134,147,112, 14, 46,194, 85,184, 14, 61,112, 15,250, 97,  8,158,193, 40,188,129,  9,  4, 65,200,  8, 19,
- 97, 33,218,136,  1, 98,138, 88, 35,142,  8, 23,153,133,248, 33,193, 72,  4, 18,139, 36, 32,201,136, 20, 81, 34, 75,145, 53, 72,
- 49, 82,138, 84, 32, 85, 72, 29,242, 61,114,  2, 57,135, 92, 70,186,145, 59,200,  0, 50,130,252,134,188, 71, 49,148,129,178, 81,
- 61,212, 12,181, 67,185,168, 55, 26,132, 70,162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180, 26, 61,140, 54,161,231,208,
-171,104, 15,218,143, 62, 67,199, 48,192,232, 24,  7, 51,196,108, 48, 46,198,195, 66,177, 56, 44,  9,147, 99,203,177, 34,172, 12,
-171,198, 26,176, 86,172,  3,187,137,245, 99,207,177,119,  4, 18,129, 69,192,  9, 54,  4,119, 66, 32, 97, 30, 65, 72, 88, 76, 88,
- 78,216, 72,168, 32, 28, 36, 52, 17,218,  9, 55,  9,  3,132, 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,196, 24, 98, 50, 49,
-135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144,  2, 73,177,164, 84,210, 18,210,
- 70,210,110, 82, 35,233, 44,169,155, 52, 72, 26, 35,147,201,218,100,107,178,  7, 57,148, 44, 32, 43,200,133,228,157,228,195,228,
- 51,228, 27,228, 33,242, 91, 10,157, 98, 64,113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229, 52,229,  6,101,152, 50, 65,
- 85,163,154, 82,221,168,161, 84, 17, 53,143, 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154, 57,205,131, 22, 73, 75,165,
-173,162,149,211, 26,104, 23,104,247,105,175,232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233, 71,232,151,232,  3,244,119,
- 12, 13,134, 21,131,199,136,103, 40, 25,155, 24,  7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139, 25,199, 84, 48, 55, 49,235,
-152,231,153, 15,153,111, 85, 88, 42,182, 42,124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,166,170,222,170, 11,
- 85,243, 85,203, 84,143,169, 94, 83,125,174, 70, 85, 51, 83,227,169,  9,212,150,171, 85,170,157, 80,235, 83, 27, 83,103,169, 59,
-168,135,170,103,168,111, 84, 63,164,126, 89,253,137,  6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,227,188,198, 32, 11, 99, 25,
-179,120, 44, 33,107, 13,171,134,117,129, 53,196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139, 61,170,169,161, 57, 67, 51,
- 74, 51, 87,179, 82,243,148,102, 63,  7,227,152,113,248,156,116, 78,  9,231, 40,167,151,243,126,138,222, 20,239, 41,226, 41, 27,
-166, 52, 76,185, 49,101, 92,107,170,150,151,150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,157,166,189, 69,187, 89,251,
-129, 14, 65,199, 74, 39, 92, 39, 71,103,143,206,  5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,174, 46,170,107,165,
- 27,161,187, 68,119,191,110,167,238,152,158,190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125, 47,253, 84,253,109,250,167,
-245, 71, 12, 88,  6,179, 12, 36,  6,219, 12,206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,195, 64, 67,165, 97,
-149, 97,151,225,132,145,185,209, 60,163,213, 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,198,163, 38,  6, 38, 33, 38,
- 75, 77,234, 77,238,154, 82, 77,185,166, 41,166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,155, 61, 49,215, 50,231,155,
-231,155,215,155,223,183, 96, 90,120, 90, 44,182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,110,133, 90, 57, 89,165, 88,
- 85, 90, 93,179, 70,173,157,173, 37,214,187,173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,176,241,182,201,182,169,183,
- 25,176,229,216,  6,219,174,182,109,182,125, 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,186,125,141,253, 61,  7, 13,
-135,217, 14,171, 29, 90, 29,126,115,180,114, 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,233, 47,103, 88,207, 16,207,
-216, 51,227,182, 19,203, 41,196,105,157, 83,155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,130,203, 46,151, 62, 46,155,
- 27,198,221,200,189,228, 74,116,245,113, 93,225,122,210,245,157,155,179,155,194,237,168,219,175,238, 54,238,105,238,135,220,159,
-204, 52,159, 41,158, 89, 51,115,208,195,200, 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126, 79, 67, 79,129,103,181,231,
- 35, 47, 99, 47,145, 87,173,215,176,183,165,119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,222, 50,222, 89, 95,
-204, 55,192,183,200,183,203, 79,195,111,158, 95,133,223, 67,127, 35,255,100,255,122,255,209,  0,167,128, 37,  1,103,  3,137,129,
- 65,129, 91,  2,251,248,122,124, 33,191,142, 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21, 65,143,130,173,130,229,193,
-173, 33,104,200,236,144,173, 33,247,231,152,206,145,206,105, 14,133, 80,126,232,214,208,  7, 97,230, 97,139,195,126, 12, 39,133,
-135,133, 87,134, 63,142,112,136, 88, 26,209, 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,222,155,103, 49, 79, 57,175,
- 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,108, 75, 28, 57, 46, 42,174,
- 54,110,108,190,223,252,237,243,135,226,157,226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,244,133,167, 22,169, 46, 18,
- 44, 58,150, 64, 76,136, 78, 56,148,240, 65, 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194, 29,194,103, 34, 47,209, 54,
-209,136,216, 67, 92, 42, 30, 78,242, 72, 42, 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,185,132, 39,169,144,188, 76,
- 13, 76,221,155, 58,158, 22,154,118, 32,109, 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,147,182,103,234,103,230,102,
-118,203,172,101,133,178,254,197,110,139,183, 47, 30,149,  7,201,107,179,144,172,  5, 89, 45, 10,182, 66,166,232, 84, 90, 40,215,
- 42,  7,178,103,101, 87,102,191,205,137,202, 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,239,159,255,237, 18,194, 18,
-225,146,182,165,134, 75, 87, 45, 29, 88,230,189,172,106, 57,178, 60,113,121,219, 10,227, 21,  5, 43,134, 86,  6,172, 60,184,138,
-182, 42,109,213, 79,171,237, 87,151,174,126,189, 38,122, 77,107,129, 94,193,202,130,193,181,  1,107,235, 11, 85, 10,229,133,125,
-235,220,215,237, 93, 79, 88, 47, 89,223,181, 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,216, 40,220,120,229,
- 27,135,111,202,191,153,220,148,180,169,171,196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,150,170,151,230,151, 14,110,
- 13,217,218,180, 13,223, 86,180,237,245,246, 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191, 60,184,188,101,167,201,206,
-205, 59, 63, 84,164, 84,244, 84,250, 84, 54,238,210,221,181, 97,215,248,110,209,238, 27,123,188,246, 52,236,213,219, 91,188,247,
-253, 62,201,190,219, 85,  1, 85, 77,213,102,213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,251,109, 93,173, 78,109,113,
-237,199,  3,210,  3,253,  7, 35, 14,182,215,185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,190,254,157,239,119,
- 45, 13, 54, 13, 85,141,156,198,226, 35,112, 68,121,228,233,247,  9,223,247, 30, 13, 58,218,118,140,123,172,225,  7,211, 31,118,
- 29,103, 29, 47,106, 66,154,242,154, 70,155, 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,122,252, 71,219, 31, 15,156,
- 52, 60, 89,121, 74,243, 84,201,105,218,233,130,211,147,103,242,207,140,157,149,157,125,126, 46,249,220, 96,219,162,182,123,231,
- 99,206,223,106, 15,111,239,186, 16,116,225,210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,178,219,229, 19, 87,184, 87,
-154,175, 58, 95,109,234,116,234, 60,254,147,211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,189,181,123,102,247,233, 27,
-158, 55,206,221,244,189,121,241, 22,255,214,213,158, 57, 61,221,189,243,122,111,247,197,247,245,223, 22,221,126,114, 39,253,206,
-203,187,217,119, 39,238,173,188, 79,188, 95,244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,239,220,127,106,192,119,160,
-243,209,220, 71,247,  6,133,131,207,254,145,245,143, 15, 67,  5,143,153,143,203,134, 13,134,235,158, 56, 62, 57, 57,226, 63,114,
-253,233,252,167, 67,207,100,207, 38,158, 23,254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,209,152,209,161,151,242,151,
-147,191,109,124,165,253,234,192,235, 25,175,219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,237,193,119,220,119, 29,239,
-163,223, 15, 79,228,124, 32,127, 40,255,104,249,177,245, 83,208,167,251,147, 25,147,147,255,  4,  3,152,243,252, 99, 51, 45,219,
-  0,  0,  0, 32, 99, 72, 82, 77,  0,  0,122, 37,  0,  0,128,131,  0,  0,249,255,  0,  0,128,233,  0,  0,117, 48,  0,  0,234, 96,
-  0,  0, 58,152,  0,  0, 23,111,146, 95,197, 70,  0,  3, 40, 60, 73, 68, 65, 84,120,218,236, 93,119,120, 20,197,  3,125,187,183,
- 87,114,119,201,165, 55, 18, 72,161, 67,  0,105, 10, 72,239, 66, 40, 22,  4, 17, 69,108, 63,105, 22,  4, 65, 17,165,131, 34, 85,
- 69,196,  6, 40,210, 68, 16, 80,138, 72,239, 69,122,135,  0,233, 61,151,235,109,231,247, 71,110,207,203,113, 45, 16, 80, 96,222,
-247,237,119,183,237,237,204,206,236,236,219, 55,141, 33,132,128,130,130,130,130,130,130,130,130,162,242,193,210, 91, 64, 65, 65,
- 65, 65, 65, 65, 65,241, 31,193,134, 13, 27, 42, 98,129,117,246,151,211,190,180,251,175,115,222,197,184,147, 74,228,108,103,231,
-252,248, 62,  9,103,187,255, 42,167, 16,223, 10,240,118,174, 72, 62,170,172,251,233, 20, 78, 82,217,225,188, 91,156,149,245, 28,
-185,  9, 39,185, 11,233,254,241,125, 18,206,118,255, 53, 78,215,252,227, 39,111,133, 56,253,204, 83, 21, 13, 39,169,236,112,222,
- 45,206, 59,125,142,188,132,147,220,105, 94,242,144,246, 31,227, 33,  1, 33,  4,220, 93, 20, 89,126, 35, 53, 53,149,113,226,103,
-254,171,156,206,247, 65,224,175,204,176, 86, 34,118, 84, 54,167,203,253,172, 44,124,156,154,154,202,108,216,176, 97, 39,128,118,
-149, 25,247,202, 72,119,151,184, 86, 10,239,109,136,172, 10,113, 86, 86,190,191,219,156,149,245, 44,185,114, 86, 70,190,119,151,
-238,119, 49,141, 42, 43,156,149,242, 44,221,141, 60,239, 38,255,220, 49,175, 43,103,101, 60, 75,174,156,149,145,239,239,  5,103,
-101, 60, 75,238, 56, 43, 35,223,123, 74,251,135,205,160, 98,111,231,166,221, 69,167,172,253,127, 89, 16,221, 45,177, 89,  1,  7,
-230, 95,231,172,228, 52,250,216,206, 89,153, 95, 55,237, 43, 43,141,238, 70,126,119,230,172, 44,126, 87,158,202, 72, 39,119,156,
-119, 26, 94, 15,225,172,244,184,223,105,190,191, 87,156,149,156, 70,149,242, 44,185,112,182,175,228,143,129,246, 78,235, 31, 87,
- 38,103,101, 61, 75,110,194,121,199,233,228,142,243, 78,195,235, 33,156,149, 30,247,202,120,135,220, 45,222,  7, 26,119,171,250,
-172,178, 57, 43,200,253, 64,113, 86,176,122,166,243, 93, 72,251,127, 53,156,149,201,233, 26,198,202,172,238,185,155,225,172, 76,
-206, 10,132,245,129,227,188,223,210,253,191,120, 63, 61,241,221, 73,181,148, 39,119,244,110,132,179, 50, 57,253,228,126, 32, 56,
-239, 32,237, 31, 40, 84,184,234,240, 94,  8,184, 74,254, 50, 65, 37, 59, 48,119, 83,184, 86,102, 56,219,223, 13,135,240, 46,160,
-210,195,105,255, 82,254,232, 46,196,253,126,185,167,244, 89,162,207,210,127,238, 89,114,201,147,237, 43,209, 41,170, 84,231,217,
-149,179, 50,174,225,204, 81, 89,121,244,110,199,189, 50,159,165,187,145,246, 20,119,224, 66, 80, 78,202, 73, 57, 41, 39,229,164,
-156,148,243,161,229,124,224, 64,  8,161,195, 59, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,220, 71,240,
-218, 70,171, 74,149, 42, 27, 20, 10, 69, 13, 79,251,181, 90,109, 86, 86, 86, 86,  7,122, 27,255, 61,208, 52,162,184,143,192,226,
-159, 94,206, 60,  0, 98, 95, 40, 40, 40, 40, 30,104,120, 20, 90, 50,153, 44,249,220,185,115,181,120,158,135,205,102,131,213,106,
-117,252,154, 76, 38,180,109,219,182,194, 13,233,163,163,163,119,137, 68,162,196,138,156, 99,179,217,110,228,228,228,180,246,114,
-200, 62,  0,201, 12,243, 79,155, 64,225,191,167, 95,  0,153, 22,139,165,137, 55, 78,134, 97,146, 93,249, 60,112,  9,255,189,114,
-  6,  7,  7, 31,225, 56, 46,222, 29,151,167,255, 60,207, 95,205,203,203,107,117, 47,211,232, 97, 70,116,116,244, 46,142,227, 42,
-156, 63,179,179,179, 61,230,207,216,216,216,227, 44,203, 86,169,  0,165,136,231,249, 11, 89, 89, 89,173,189,  8,145,125,  0,146,
-189,145,184,230, 39,134, 97,210,109, 54, 91, 51, 95,207,145, 55, 46, 55,121,212, 23,167, 67,100,113, 28, 55, 35, 42, 42,234, 13,
-157, 78,103,  0, 64, 68, 34, 17,113, 10, 27,  0,192,106,181,230, 21, 23, 23, 55,160, 57,145,130,130,226,161, 16, 90, 60,207,179,
- 70,163, 17, 23, 47, 94,132,135,249, 16,109,183,113,189, 90, 71,255,220, 26, 21, 20, 21, 13,171,217, 12,101, 68,164,131, 59,231,
-236,105, 88, 45,102, 88, 77, 38, 84,107,222, 66,  8,  3,234,213,171, 39,242,193, 25, 63,115,230,204,168,160,160, 32, 24, 12,  6,
- 24, 12,  6, 24,141, 70, 24, 12,  6,152, 76, 38,152, 76, 38,152,205,102,152,205,102, 88,173, 86, 24,141, 70,108,219,182,205,102,
-177, 88,188,114, 78,157, 58, 53, 74,165, 82, 57,248,132, 69,224, 20,120, 45, 22, 11, 12,  6,  3,182,111,223,238,149,147,227,184,
-248,204,204,204, 40,137, 68,  2, 66,  8,120,158,  7, 33,164,220,226,138,234,213,171,155,189,  5,242, 46,165,209,195,140, 90, 83,
-151,111,140, 10,150,203, 96,229,121,164, 54,170,238,216,113,245,155, 85, 32, 86, 27,120,171, 21, 53,135, 15,114,108,175, 91,183,
-174,215,252, 73,  8, 73,152,186,124, 99,136,191,156,  5,  5,  5,250, 58,117,234,100,162,108,112, 63, 79, 66, 43, 94,175,215, 71,
-217,249,111, 17, 68, 44,203,150, 91, 54,111,222,140,212,212, 84, 95,113,143,127,251,237,183,163, 44, 22, 11, 76, 38, 19,140, 70,
- 35, 44, 22, 11,172, 86,171, 99,177,217,108,142,197,100, 50,225,224,193,131,254, 58, 89, 51,187,116,233, 50,100,227,198,141,202,
- 95,127,253, 85,153,152,152,  8,137, 68,  2,145, 72,  4,145, 72,  4,150,101,193,113, 28, 30,123,236, 49,134,102, 65, 10, 10,138,
-135, 70,104, 25,141,198,107,141, 27, 55, 38,246,255,113, 50,153, 76,226,242,149, 91,165,102,205,154, 23, 92,207,243, 85, 93, 21,
- 20, 21,141,113, 85,195,  0,  0, 19,174, 23, 56, 94, 16,159,180,122,196,113,204,164,140, 18,  0,128, 92, 46,  7,227,252, 25,237,
-  1, 74,165, 18, 93,186,116,129, 84, 42, 69,179,102,205, 32, 22,139,221, 46, 18,137,  4, 98,177,216,231, 77, 97, 24,  6,129,129,
-129,152, 56,113,162, 32,146,160, 12,144, 97, 68,171,102,  8,  0,193,215,167, 47,193,196, 19,112, 28,231, 88,252,225,148, 72, 36,
- 56,117,234, 20, 56,142,131, 72, 36,114,252, 10,255,215,175, 95,143,103,158,121,  6, 28,199, 65, 46,151,  3, 62, 70, 14,118, 78,
- 35,147,201, 20, 43,149, 74,205,  0,  4,113, 38, 97, 24, 38,230,118,210,232, 97, 70,176, 92,134, 23, 23,174,  5,  0,220,156, 51,
-220,145,118,  7,135, 78,112, 28,147,240,218,179, 96, 24,  6, 98,177, 24, 44,203, 86, 26,103, 97, 97,161,126,192,128,  1,123,130,
-130,130, 54,171,213,106,248, 16,112,184,121,243, 38, 56,142,243,152,223, 89,150,197,236,217,179,113,249,242,101,191,226,110, 48,
- 24,176,120,241, 98,216,108,182,114,188,194,127,215,109,126,138,172, 41, 93,187,118, 29,180,113,227,198, 80,134, 97,240,249,231,
-159, 67, 34,145,160, 71,143, 30,  8, 15, 15,199,150, 45, 91, 32,145, 72, 48,102,204, 24,154,249, 40, 40, 40,188,149,121, 98,  0,
-143,  0,136,180,155,  8,165,  0, 66,156, 14,201,179,255, 70, 10,235, 12,195, 28,118,195,211,220,126, 76, 30,195, 48,135,157,214,
- 77,  0,164,110,182, 23,  0,144,219, 23, 35,202,220,255, 20,167,235,  8,231,193,211,117, 57,160,108,254, 33,  0, 59,  0,180, 79,
- 77, 77,221,  9,  0,217,217,217, 79,100,103,103,  3,  0,146,147,147,207, 93,184,112,161,142,160,121,236,213, 83, 18,171,213, 90,
- 75,168,170, 18,220,162,206,157, 59,123,253,194,183,154,205,183,  8, 16,119, 90,202, 93,117,133, 39,  1, 99, 54,155,241,236,179,
-207,  2,128,199,151,142,243,226,135,118,131,201,100,  2,199,113,168, 93, 53, 18, 31,118,107,140, 71,137,  5, 90, 13,  3,107,137,
- 22,125,  2, 45, 56, 87,175,  9, 22,221,200,195,117,181,  6, 28,199,249,197,201,243,188, 71,145, 37, 18,137,176,112,225, 66, 12,
- 24, 48,  0, 34,145,200, 47, 62,231, 52, 74, 74, 74,218,120,225,194,133,112,134, 97,140,246, 52,146, 89,173, 86,149,213,106, 13,
-183,217,108,225, 21, 73,163,135, 25, 86,158,119,155, 15, 61,229, 89,127,210,201, 31,206,194,194, 66,125,106,106,234,  1,153, 76,
-182, 36, 58, 58, 58, 51, 61, 61,221,167,208,114, 21, 63,174, 31, 21,159,125,246, 25,230,207,159,143, 14, 29, 58,248, 21, 78,163,
-209,  8,134, 97,176,104,209,162, 91,246, 77,158, 60,249,150,235,249,224,100,  0,176, 85,170, 84, 25,250,199, 31,127,168,132, 99,
- 35, 34, 34, 32, 22,139,209,160, 65,  3,  4,  5,  5, 97,207,158, 61,176,217,108,126, 63,151, 20, 20, 20, 15, 46,220,105, 17, 39,
-180, 29, 55,110, 92,179, 25, 51,102, 76,107,217,178,229,207,251,246,237, 91,206, 48,204,  6,167, 50, 49,213, 94,190,110, 16,214,
-  9, 33,205,157, 69,143, 93,172, 69, 50, 12,179, 65, 56,222,121, 93,248, 37,132,116,  6, 32, 21,214,199,141, 27,151, 50, 99,198,
-140,105, 99,199,142,125,127,250,244,233,146,113,227,198, 53,156, 49, 99,198, 52,225, 58,238,194,225,206,209,242, 58,247,148, 80,
- 69,117,254,252,121, 79, 85, 84,206, 47,  0,175,165,165, 50, 34,210,225,100, 77, 74,  8,119,108,159,152, 94,236,120,129, 45,104,
- 90,  3, 74,165, 18,221, 38,125,234,151, 83,100, 50,153,144,155,155,235,112, 25,124, 45,254,114, 42,228,  1,216,246,118,  3,220,
- 44,144,226,227,253,133,216,248,247,101,136,197, 98,116,175,215,  0, 79, 72,130, 48, 62, 65,138,183, 47,165,193, 66,252,107,211,
- 75,  8,113, 43,176,132,255, 66, 21,138,191, 66,203, 37,141,110, 26, 12,134,130,139, 23, 47,234,249,178, 23,187,156, 16, 18,202,
- 48, 76,169,221,229,138,245, 55,141, 30,102,164, 54,170,238,112,157, 14,  6,117,114,108,127, 70,123,202,145, 38,163, 22,126,  2,
-  0,232,208,228, 49,159,207,131, 63,156,  5,  5,  5,250,214,157,218,239,180,233, 77, 63, 12, 26, 52,232,218, 95,127,253, 37,247,
- 39,172,238,132,150,224,218, 10, 34,139,227, 56,152, 76, 38,191,226,110, 50,153, 60, 62, 31, 18,137,228,118, 28, 45,104,181, 90,
-211,186,117,235,176, 96,193,  2,132,135,135,163,107,215,174,136,141,141,197,170, 85,171, 64,  8,193,240,225,195, 33,151,203,  5,
-247,154,102, 64, 10,138,135, 27,222,180,136,108,198,140, 25,211, 92,133,140,243,186,179,128,114, 17, 83,206, 98, 45,197,199,251,
-127,131,171,120, 18,174,203, 48,204,134,233,211,167,167,250,  8, 71,158, 39,161,229,117, 72,124,163,209,120,173, 81,163, 70,126,
-169,  9,157, 78,151,237, 75,108,184,251,170,119,118,  9,  2,  3,  3,161, 84,  5,130,245,179,220,181, 88, 44, 14,161,178,117,235,
- 86,200,229,114,244,232,209,227,142, 28, 45,179,217, 12,169, 68, 12, 54, 34, 26, 47,206,249, 11,  5,165,122,199, 11,102,199,213,
-107, 56,150,147,139,183, 91,118,130, 82,158, 11,141,201,228,151,243,198,243,252, 45, 34,139,227, 56, 60,251,236,179, 14, 55,193,
-185,221, 10,188, 84, 29,134,135,135, 31,225, 56, 46,222, 41,141,  2,146,147,147,129,127,218,245, 48, 60,207,107, 66, 66, 66,126,
-  1, 80,133, 16, 18, 15, 32,200,159, 52,162,112,159, 63, 93,183,243, 46, 78,213,237,112, 22, 20, 20,232, 83, 83, 83, 15,216,244,
-166, 31, 50, 50, 50, 14,  0,  8,120,244,209, 71, 43, 44,180,  4,129, 37, 22,139, 49,123,246,108,204,159, 63,223,177,223, 95,161,
-101,181, 90,203,  9,168, 75,151, 46,149,187,150,171,176,243, 81,109, 74, 80,214,187,144, 79, 78, 78,118,156, 19, 19, 19,131,144,
-144, 16,240, 60, 15,158,231, 17, 16, 16,  0,185, 92, 14,137, 68, 66, 51, 29,  5,  5,133, 55, 45,162, 31, 59,118,236,251, 12,195,
-108,176, 59, 75,167,189,  8, 42,119,218,163,185,139, 88,203,243,112, 92,170, 59,177,229,252, 95,192,184,113,227, 82, 92,195,225,
-174,186,210, 81,170,186, 12,187, 95, 14,206, 85, 84,149,245, 18,243,246, 34, 11, 12, 81, 65,174, 84, 66, 36, 98,193, 48, 12,241,
-197,101, 54,155, 29,  5,255, 27,111,188,225,181,221,138,191,237,169,204,102, 51, 88, 78,132,172,152, 36,216,216,221,142,115,133,
-133,229,196,184, 30, 83,  7,162,243,199, 33,246,243,133,235,234,104, 13, 31, 62, 28,139, 23, 47,  6,203,178,142,123,194,113, 28,
-106,214,172,137,107,215,174,121,229,226, 56, 46,254,250,245,235, 81,206,247, 81, 16,177,132, 16,216,108, 54, 84,175, 94,221,112,
-241,226,197, 55,233,163,123,103, 34,203,211,118,155,141,247,219,133,113,119, 92, 65, 65,129,190, 95,191,126, 59, 75, 74, 74,126,
-168, 95,191,254, 37,148, 31,  2,193, 39, 31,199,113,229,  4,150, 32,178,230,205,155, 87, 78, 20, 89, 44, 22,191, 62,  4, 44, 22,
-203, 45,130,103,214,172, 89,229,126,  1,160, 85,171, 86,126, 57,195,  0,  8,203,178, 68, 34,145,160, 75,151, 46,104,216,176, 33,
-126,253,245, 87,240, 60,143, 97,195,134, 65, 46,151, 99,238,220,185,176, 90,173,152, 57,115, 38,117,180, 40, 40, 40,188,105, 17,
-227,244,233,211, 79, 79,159, 62,221,225, 44,185, 58, 90, 30,222,187, 61,237,162, 42, 82, 16,105,  0,140,238,  4,145, 59,151,204,
- 85,128, 57,111,155, 49, 99,198, 52,215,112,184, 86, 87,150, 19, 90,247, 10,217,103, 78,225,211,199, 27,  3, 40, 95, 93,184,240,
-177, 58, 80,  6, 42,161, 12, 10, 68,191,245,187,  1,192, 94,232,143,245,203,209, 18,132, 86, 65, 65,129, 87,145, 85, 17, 71,139,
-149,114, 88, 29, 95,  4, 34, 21,131, 51, 89,202,  9, 45, 17, 39,198,205,240, 36,176, 98,  9, 56,155,213, 47, 78, 66,200, 45, 85,
-133,131,  7, 15,  6,195, 48,142, 30, 98,141, 26, 53,114,230, 98,124,189, 28, 71,135,149,181,193,115,173,142,157,153,111,160, 79,
-236,237,228,207, 35,223,224,220,154,161,  0,128,214, 90,173, 35, 45,166, 54,250,167,239,192,156, 83, 59, 29,238,227, 36,188,123,
- 91,156,  5,  5,  5,250, 71,235,166, 28,144,132,  5,255,112,227,198,141,  3,  0,216,254,253,251,135, 52,106,212,200,175,103, 82,
-232, 92,225, 42,178,156,157, 44,225,215, 71, 15, 91, 39,225,104,243, 75, 64,  9,213,136,126,228,121, 34,228,109,149, 74,133,192,
-192, 64, 71,143,219,128,128,  0, 40, 20, 10, 71,251, 78, 63,133, 27,  5,  5,197,195,139, 80, 65,232,216,197, 82, 57,167,201,222,
-182, 42,213,121,221,157,227,101,119,160,118,249, 40, 95, 55,218,  5,154, 91,  8,206,154,203, 57, 27, 60,137, 52, 78, 80,144,206,
-191, 49, 49, 49,191,  7,  6,  6, 38,249, 27,251,138,244, 98,179, 89,204,183, 56, 91, 12,195, 32, 48, 40, 16,242, 64, 37,228, 65,
-129, 30, 93, 47,111, 66, 75,112,138,132,151,206,146, 37, 75, 16, 24, 24,136,151, 94,122,169,194,109,180, 28, 66, 75,194, 98,139,
-108, 59, 68, 82,174,156,200,226, 56, 14, 34,177, 24,217,129,177, 96,197, 98,112, 86,255, 92,178,146,146, 18,112, 28,135, 15, 63,
-252,208,241,  5,239, 44,178, 42, 18,103,111, 96, 25, 70,112,183,100, 53,106,212,120,151, 97,152,  4,  0,137, 90,173, 86,150,149,
-149,213,145, 62,175, 94,148,129,205,114,139, 11,229,201,125,189, 93, 78,193,201,146,132,  5,255, 80,167, 78, 29,135,147,165, 80,
- 40,132,222,166,190,211,152,101,221,138, 44,215, 30,130, 28,199,149,229,101, 31,189, 35,157, 29,173,233,211,167, 59,120,157,157,
- 44,  1, 21,121,142,132,176,238,220,185, 19,199,142, 29,195, 27,111,188,  1,185, 92,142,249,243,231,195,106,181, 98,242,228,201,
-144,203,229,144, 74,165, 52,243, 81, 80, 80, 55,171,156, 22,113, 65,158, 75, 59, 40,198, 69,212,228,185, 19, 88,206,213,132,194,
-127,134, 97, 44,110,120, 77, 46, 85,138,174,219,133,223,130,233,211,167,255, 37, 56, 89, 78,219,203,133,195,167,163, 37,147,201,
-146, 46, 94,188,232, 24,  8,211,219,175,201,100, 66,135, 14, 29,252,118,198,132, 94,135, 28, 39, 42, 39, 44, 20, 65,129, 80,168,
-130, 32, 15, 12,116, 21, 28,140,175, 66, 92,248, 34,118, 22, 90, 31,125,244, 17, 56,142,195,226,197,139,  1,  0,239,190,251,174,
-223,109,180,  4, 78,216, 24,164,147, 43,104, 60,231, 25,152,126,180, 32,103,239,  9,112, 28,135,168, 22, 79,128,127,244, 25,232,
-228,129,224,108, 86,191,123, 29, 22, 22, 22,226,218,181,107, 16,137, 68,120,231,157,119,202,141,117,228,218,147,109,235,214,173,
- 62,227,238,206,201,250,232, 70,161,131, 71, 46,151,179, 39, 78,156, 72,226,121, 62, 89,175,215,215,104,213,170, 21, 79, 31,101,
- 31,162,136,183,250, 37,170,252,205,159,174,156, 66,155,172,146,146,146, 31,110,220,184,113, 16,  0, 59,104,208,160, 16,133, 66,
-129,111,191,253, 86,  7, 64,186,106,213, 42,185, 47, 81, 36,228, 27, 95, 34, 75, 44, 22,151,229,101,127,226, 78,202, 15, 89,226,
-171, 97,188, 63,121, 94,  8, 43,195, 48,176,217,108,144,203,229,229,156,172,128,128,  0,200,100, 50,154,241, 40, 40, 40,124,149,
- 37,135,253, 46,199,  9,105,238, 36,170, 14,223, 14,111, 69,174,231, 11,156, 39,161, 97, 52, 26,113,246,236, 89,127,121,252, 30,
- 24,179,106,179,199, 48, 41,163,  4, 12,195,224,235, 86,245,161, 84,  5, 66,161, 84,226,233, 95,119, 58, 10,238, 83,211,222,133,
- 76, 25,136, 42,109,186,250, 85,144, 11, 85,135,206, 66,171,184,184, 24, 98,177, 24, 83,166, 76,  1,203,178,152, 57,115, 38,226,
-226,226,144,149,149,133, 85,171, 86,249,229,104,137,108, 34,196,190, 80, 23,138,193,193, 80,189,208, 22,161, 93, 62, 66,134,137,
-195, 62,131,  2,109, 13,103, 32,221, 50, 15, 38,222,230,119, 15, 44,171,213,138,157, 59,119,186, 54,120,119,180,169,178, 90,173,
-176, 88, 44, 48,155,205,152, 57,115,166, 63, 61, 60,111, 73, 55,225, 30,218,  7, 65, 21, 93,184,112, 33,146, 16, 18,  6, 32, 24,
- 64, 62,125, 92,189, 35,182,197,112, 68, 54,251, 31,  0, 96,253,244,151, 29,219, 63, 60,245, 79,254,156,253, 99,217,  4,  0,117,
- 18,187, 86,136,179,160,160, 64,223,189, 67,171, 93,  6, 94,252,125,131,  6, 13,202, 57, 89,  1,  1,  1,140,125,221, 47,187,140,
-101, 89,136, 68,162, 91,170, 11, 61,137, 45,127,218,104, 89,173, 86,199, 64,162,222,218, 51,222,142,163,245,242,203, 47, 35, 54,
- 54,214,225,100, 77,154, 52,  9,114,185, 28,227,198,141,131,197, 98,193,188,121,243,104,230,163,160,160,184,231,162,236, 94,192,
-109, 73,106, 48, 24,210, 26, 54,108,  8, 15,251,226,  2,  2,  2,196, 46,145,170, 82,179,102,205, 11,110,170, 16, 59,  3,216,230,
-174, 80,103, 24,  6, 65,170, 32,  4,  4, 42,161,112,113,177,  2,130, 84,144,  5,  6,130,149,184, 45,204,111,225, 20,218,150, 56,
- 11, 45, 97, 41, 41, 41,129, 88, 44,198,130,  5, 11,160, 82,169, 96, 52, 26,125,114, 10, 47, 29,145, 72,  4,221,205, 82,156,155,
-182, 13,210,128,125,168,209,117,  0, 98,197,114, 72,246,252,  2,189,205,226,107,192,210, 91, 56,107,213,170,133,  9, 19, 38,220,
- 50,172,131, 39,196,197,197,249,140,187,171,147, 53,187,126, 53, 72,164, 18,140, 58,115, 19, 70,163,145, 25, 48, 96,  0, 15, 64,
- 15, 32, 79,175,215,223,240,231,126, 86,  2,238,123, 78,111,189, 98,  5,240,196,230, 78,192,184,229, 20,156, 44,  3, 47,254,254,
-218,181,107,130,147, 21,172, 80, 40,240,213, 87, 95,233,  0,176,147, 39, 79, 86, 36, 36, 36,136,252,201, 75, 34,145,  8,115,230,
-204,113,219, 38,203,157,232,170,200,115,228,124,110,187,118,237,220, 14, 88,234, 65,188,221,194, 41,132, 53, 60, 60,220,225,100,
-217,108, 54, 71,111, 67, 97,244,121, 47, 31, 21, 52,127, 82, 78,202,249,240,112, 62,144,112, 91,  2,103,101,101,117,247,116, 66,
-245,234,213, 47, 94,188,120,177,166, 48, 21,135,189,224,148, 24, 12,134, 90,173, 90,181,242,105,237,240, 60, 15,153, 76,  6, 66,
-  8, 58, 78,152,  1,134,  5, 88,148,127,137, 69, 61,222,  9, 34, 17,  7,190,108,170, 15,159,189, 14,245,122,125,185,151,131,187,
- 69,163,209,192,104, 52,250, 61,154,183,193, 96, 40, 55,  4,  3, 67,120, 92,255,115,229, 45,189, 15,133,197,223,118, 59,  1,  1,
-  1,229,170,126,124, 56, 86,140, 63,142,150,115,213,163, 68, 42,  1, 39, 17, 11,142, 86,233,165, 75,151,250,209,108,238, 63,132,
- 14, 11,  0, 80,187, 85, 15,240,188, 13,196,102, 43, 55, 77, 82,221,164,238,224,137, 13,102,139, 14, 70,163,209,215,176, 39, 76,
-126,126,190,190, 95,191,126, 59,  1,124,215,167, 79,159, 11, 40, 27, 93,152,  4,  6,  6,202,196, 98, 49, 15,160, 16,  0, 41, 42,
- 42, 10,206,200,200,224, 13,  6, 67, 53, 95,225,220,184,113, 35,206,158, 61,139, 54,109,218,148,155, 14, 74,112, 69,157, 71,119,
-247, 39,127, 10,213,229,238, 70,132,247, 36,228,252,133, 72, 36, 66,112,112, 48, 36, 18,  9,166, 76,153,  2,137, 68,  2,133, 66,
-  1,  0,152, 55,111,158, 99,240, 85, 10, 10, 10,138,135, 70,104,249, 42, 55,189, 84, 43,122,173, 66,180, 90,173,233,  9,  9,  9,
- 21,186,152,205,102,203,241, 33,220,210, 87,173, 90, 37,113,118, 33,124,253, 18, 66,114,124,188,108,211,215,175, 95, 47,113,231,
-110,120,154, 96,218, 23,167,205,102, 75, 79, 76, 76,244,232,152,184,131,197, 98,201,240, 37, 90,103,228,233,203,137,132, 81,103,
-110,122,156, 59,145,194,103, 94,243,146, 63, 63,184,221,252,121,169,118,237,218, 25, 33, 33, 33,155,162,163,163, 11,246,238,221,
- 27,222,188,121,243,112,231, 99,154, 55,111, 30,235,114,154,  9,158,231, 57,  4,195, 48,233,125,250,244,113,155,231,  5,209,228,
- 38,127,166,251,202,243,135, 14, 29,146, 56,159,239,137,223,233, 57, 74,247, 67,184, 94,111,220,184, 49,235,204,227, 41,239, 91,
- 44,150, 60,154, 11, 41, 40, 40, 30,122,161,165,215,235,111, 54,108,216,208,234, 97,223, 13,111,231, 22, 20, 20, 52,171,236,  8,
- 88, 44,150, 86,247,  3,103,126,126,126,165,198,221,106,181,166,219,  7, 40,245,122, 12,205,226,255, 94, 26,  1, 64,110,110,238,
-163,  0,160,213,106,225,107, 90,157, 10,  8,194, 74,207,159, 86,171,181,213,221,184,167,133,133,133, 45,105,206,162,160,160,160,
- 66,171,  2,160,147, 17,255, 55,112, 55, 68, 43,  5,  5,  5,  5,  5,  5, 69,229,130,165,183,128,130,130,130,130,130,130,130,226,
-238,128, 65, 89,207,  1,119,168, 72,111,130,206,183,113,237,109,148,147,114, 82, 78,202, 73, 57, 41, 39,229,124,232, 56,125,113,
- 63, 48,189, 25,239, 69,123,233,206,148,147,114, 82, 78,202, 73, 57, 41, 39,229,164,156, 15, 35,  8, 33,180,234,144,130,130,130,
-130,130,130,130,226,110,129,163,183,224, 95,131,  8, 21, 24, 81,223, 15,213, 28, 10,192,211,132,113, 38,134, 97,138,110,131,147,
-  1, 32,177, 47,194, 64, 71, 22,  0,102,  0,102,134, 97,136,111,142,143,217,204,204,208, 20, 98, 19, 55, 39, 12, 35,230,121,252,
- 93,173, 90,213,227, 12,243,132,  9,  0,148,209,117,235,  5, 42,229,157,141,102, 83,146, 76, 44, 61, 91,172,213,108, 53,230, 94,
- 76,163,217,131,130,226, 95, 65, 47,  0, 19, 81,214,172,100, 58,128,149,244,150, 80, 80,220, 37,161, 21, 24, 24,120,132,101,217,
-120, 95,227,243,  8,176,207,101,150, 94, 84, 84,212,172,  2,215,238, 23, 24, 24,216, 65, 44, 22, 63, 14,  0, 22,139,101,175, 70,
-163,249, 11,192, 42,  0,214,219,140,147, 10,192,179,  0,  6,218,215,127,178, 23, 22,234,219,228,107, 24, 28, 28,188, 70, 44, 22,
-147,252,252,252, 22,  0, 16, 30, 30,126,192, 98,177, 48,106,181,250,105,  0, 39, 43,200,199,138,197,226,217, 45, 90,180,104,187,
-123,247,238,239,  0, 44,168,164,180,148,177, 44,235, 86,160,240, 60,159,120, 27, 34, 75,  2, 32,120,193,130,  5,225,203,150, 45,
-107,156,158,158,222,  0,  0,226,227,227, 79, 13, 26, 52,232,248,136, 17, 35, 10,  8, 33, 37, 12,195,152,189,241,100,102,134,166,
-228,102, 95,125, 35, 39,247,236,179,  0, 16, 19,219, 96,165, 72,196, 74,  8, 57,186, 95, 17, 49, 48,162,102,141,196,255,253,252,
-237,  2, 73, 98, 82, 85,108,223,119,236,145, 17,111,190,159,146,  1,124, 70,197,214,189, 67, 80, 80,208, 17,150,101,227,189, 61,
-227,238,158,121,155,205,150, 94, 88, 88,216,204, 19, 39,199,113,241,222,202, 11,119,219,120,158,191,154,159,159,239,118,168,  9,
-149, 74,181,159,227,184, 36,127,185,132, 95,171,213,154,238,169,151,174, 74,165, 58, 34, 18,137,226,189,197,211,221, 62,158,231,
-175,230,229,229,121, 10,231, 45,113,175,140,112,222, 14,167,183,112, 10,229, 17,128,121,225,225,225,143, 21, 20, 20, 60, 15,224,
-125,181, 90,221, 72, 36, 18, 33, 44, 44,236,125,147,201,116, 57, 56, 56,248,155,146,146,146,125,  0,222,  4, 64,231, 75,165,160,
-168, 44,168, 84,170, 28,141, 70, 67,  4,240, 60, 79, 44, 22, 11, 49, 26,141, 68,175,215, 19,173, 86, 75, 52, 26, 13, 81,171,213,
-164,164,164,132, 20, 20, 20,144,200,200, 72,215,193, 27, 61,213,225, 54, 80,169, 84, 23,103,204,152, 97,188,118,237, 26, 49,155,
-205,196,108, 54,147,180,180, 52,242,233,167,159, 26, 85, 42,213, 69,  0, 13, 60,156,219,217, 67, 97,209,  5,192,242,198,141, 27,
-155, 54,110,220, 72, 12,  6,  3,209,106,181,100,229,202,149,164,126,253,250, 38,  0,203,237,199,176,126,114,  2, 64,235,152,152,
-152,244, 43, 87,174,216,182,110,221,106, 14, 14, 14,222, 22, 28, 28,188, 45, 45, 45,205,118,229,202, 21, 62, 34, 34, 34, 29, 64,
-235, 10,132, 19,  0,158, 25, 53,106, 84, 78, 90, 90, 26,105,215,174,221,223, 78,219, 25,248,158,231,174,179, 59, 39,139, 16, 18,
- 67,  8,137, 69,217, 32,151,183, 44,132,144, 88,251, 49,161,126,114, 42,175, 94,189, 90, 53, 58, 58,122,  6,195, 48, 38, 87, 62,
-134, 97, 76,209,209,209, 51,174, 94,189, 90,149, 16,162,244,198,153,126, 99,225,171,155, 54,118, 42,214, 22,157, 39,218,162,243,
-228,187,239,219,171, 95, 31,241,252,242,216,234, 77, 22,135,196,167, 44, 56,123,254,210, 34, 66,200,162,191, 14, 95, 92,244,209,
-151,191, 47,122,114,196,220,175,194, 19, 26,191, 94,129,251,121, 39,160,156,  0, 66, 66, 66,178,181, 90, 45, 33,132, 16,155,205,
- 70,204,102, 51, 49, 26,141, 68,167,211, 17,141, 70, 67, 74, 75, 75, 29,207,121, 73, 73,137,227,127, 84, 84,148,199,231, 61, 52,
- 52, 52, 71,175,215,151, 43, 59, 76, 38,147,163,252,208,233,116, 68,167,211, 17,173, 86,235, 88, 52, 26, 13,169, 82,165,202, 77,
- 47,225,204, 18,194,201,243, 60,177, 90,173,196,108, 54, 59,120, 13,  6, 67,185,197,104, 52, 18,163,209, 72, 18, 18, 18,252, 14,
-167, 63,156,  6,131,129,196,199,199,103,122,226, 12, 11, 11,203, 49, 24, 12,229, 56,157,227,239,202, 43,172,199,196,196,100, 87,
-132,211,159,112,122,187,159,118, 44,184,112,225,  2,209,235,245, 36, 46, 46,174,224,233,167,159,182,216,108, 54,178,113,227, 70,
-210,184,113, 99,190,125,251,246,230,252,252,124,242,210, 75, 47, 17, 47, 31,133,244, 57,162,156, 20,158, 77, 11,207,142, 22,195,
- 48, 80, 42,149, 88,177, 98,133,199,233, 56,156,255, 87,171, 86,205,223,235, 54, 75, 74, 74,218,185,103,207, 30,121,108,236, 63,
-  3, 98,155, 76, 38,132,134,134, 98,216,176, 97,210, 94,189,122,213,236,218,181,235,129,235,215,175,183,  3,112,196,  7,223, 83,
-145,145,145,159,127,248,225,135,209,253,251,247, 71,120,120,185, 65,183,209,175, 95, 63, 60,253,244,211,146, 11, 23, 46, 12, 88,
-178,100,201,128,133, 11, 23,102,107, 52,154, 17,  0,126,241, 70, 42,151,203,251, 84,169, 82,229,171, 61,123,246, 68, 69, 69, 69,
- 33, 57, 57,153, 29, 51,102, 76,205, 90,181,106,201,227,227,227,217,172,172, 44,252,250,235,175,113,207, 61,247,220,234,156,156,
-156,255,153,205,230,117,126,196, 93, 26, 30, 30,254,254,255,254,247,191,  8,181, 90,109, 61,122,244,232, 69, 97,187, 84, 42,157,
-220,178,101,203,230, 59,118,236,248, 17,192, 55,183,227,100, 17, 66,212,248,167,138, 79,128, 69,216,239,143,179, 69,  8,145,254,
-253,247,223, 97, 45, 91,182,252,197,104, 52, 54,121,227,141, 55,110, 76,155, 54, 77,174, 82,169, 84,  0, 24,181, 90, 93, 52,113,
-226, 68,211,220,185,115,223,171, 87,175, 94,167,253,251,247, 63, 69,  8,177,216,  5,217,173,124, 12,227,  8,207,205,140, 60,236,
-220,199, 75, 39,140,123, 55,254,147,169, 73,215, 15,159,185,201,115,114, 21,126,219,117, 26, 57,  5, 26,252,190,255, 12, 98,194,
-131, 24,137, 76,156, 18, 28, 87,191, 93, 73,198,153, 93,240, 50, 66, 58, 69,229,128, 97, 24, 40, 20, 10,252,246,219,111,183, 76,
- 93,229,110, 90, 43,142,227, 16, 18, 18,226,115,118,131,128,128,  0,108,221,186,213,237,220,139,238,166,244,  9, 14, 14,134,183,
-143, 13,134, 97, 16, 16, 16,128,189,123,247,130,101, 89,183, 83,  3,185,110, 83, 42,149, 96,189,204,117, 37,112,238,218,181,203,
- 39,151,240, 27, 24, 24,  8,148, 85,253,123,126, 40,101, 50,236,217,179,199, 99,156, 93,255,  7,218,231,123,245,197,185,119,239,
-222,114, 83,127,185, 78,  9,230,188,174, 84, 42,193,248, 32, 13, 13, 13,109, 17, 31, 31,143, 67,135, 14, 97,213,170, 85, 97, 41,
- 41, 41,184,116,233, 18, 24,134,193,180,105,211,152,250,245,235,139,179,179,179,209,166, 77, 27,172, 93,187,182,149, 90,173,166,
- 15, 12,197,191, 37, 88,196,  0, 30,  1, 16,137,178,102, 55,165,  0, 66, 80, 54,147,134, 20, 64,  1,  0,185,125, 49,  2,208,  0,
-136,176,159,158,111, 47, 91,156,  5, 66,158,243,228,211,132,144,230,118,110, 97,134,138, 72,167, 99,133,107,184,174,187,254,186,
-229,230,  0, 96,195,134, 13,194,203,172,125,106,106,234, 78,231,200,249, 35,178,132,121,202,220, 60,211,174, 93, 52,101, 74,165,
-114,205,129,  3,  7,228,145,145,255,196,193,104, 52,162,180,180, 20, 26,141,  6,165,165,165,  8, 10, 10,194,170, 85,171,228,157,
- 58,117, 90, 83, 90, 90, 90,203,126,211, 60,113,206,201,202,202,138,182, 90,173,144, 74,221, 55, 81, 98, 89, 22,117,235,214,197,
-251,239,191,143,110,221,186,197,116,232,208, 97,142,139,208,186,165, 43,169, 66,161,248,234,232,209,163, 81, 10,133,  2, 23, 47,
- 94, 68,122,122, 58, 70,141, 26, 85,149,231,121,220,188,121, 19,151, 46, 93, 66, 70, 70,  6,150, 44, 89, 18,213,183,111,223,175,
-220,