Merge branch 'master' into blender2.8
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 15 Aug 2017 16:51:25 +0000 (18:51 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 15 Aug 2017 16:51:25 +0000 (18:51 +0200)
build_files/build_environment/cmake/harvest.cmake
build_files/build_environment/cmake/numpy.cmake
build_files/build_environment/cmake/python.cmake
build_files/build_environment/cmake/requests.cmake
build_files/cmake/platform/platform_apple.cmake
release/scripts/presets/cycles/integrator/direct_light.py
release/scripts/presets/cycles/integrator/full_global_illumination.py
release/scripts/presets/cycles/integrator/limited_global_illumination.py
release/scripts/presets/cycles/sampling/final.py
release/scripts/presets/cycles/sampling/preview.py
source/creator/CMakeLists.txt

index dfdfe50ab493a21b10a97ce6f642e5f389273e9c..fbc9f8687f9a4e1041651cc6eac5dc9deacf65a4 100644 (file)
@@ -208,7 +208,9 @@ function(harvest from to)
                        FILES_MATCHING PATTERN ${pattern}
                        PATTERN "pkgconfig" EXCLUDE
                        PATTERN "cmake" EXCLUDE
-                       PATTERN "clang" EXCLUDE)
+                       PATTERN "clang" EXCLUDE
+                       PATTERN "__pycache__" EXCLUDE
+                       PATTERN "tests" EXCLUDE)
        endif()
 endfunction()
 
@@ -267,17 +269,7 @@ harvest(png/include png/include "*.h")
 harvest(png/lib png/lib "*.a")
 harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
 harvest(python/include python/include "*h")
-if(UNIX AND NOT APPLE)
-       harvest(python/lib/libpython${PYTHON_SHORT_VERSION}m.a python/lib/libpython${PYTHON_SHORT_VERSION}m.a)
-       harvest(python/lib/python${PYTHON_SHORT_VERSION} python/lib/python${PYTHON_SHORT_VERSION} "*")
-       harvest(requests python/lib/python${PYTHON_SHORT_VERSION}/site-packages/requests "*")
-       harvest(numpy python/lib/python${PYTHON_SHORT_VERSION}/site-packages/numpy "*")
-else()
-       harvest(python/lib/libpython${PYTHON_SHORT_VERSION}m.a python/lib/python${PYTHON_SHORT_VERSION}/libpython${PYTHON_SHORT_VERSION}m.a)
-       harvest(python/release release "*")
-       harvest(requests release/site-packages/requests "*")
-       harvest(numpy release/site-packages/numpy "*")
-endif()
+harvest(python/lib python/lib "*")
 harvest(schroedinger/lib/libschroedinger-1.0.a ffmpeg/lib/libschroedinger.a)
 harvest(sdl/include/SDL2 sdl/include "*.h")
 harvest(sdl/lib sdl/lib "libSDL2.a")
index ab196dc5eec95edab265013d323d7f4caef3eb8a..b1bf1691a2836d3b9d17f8d6b172207f78b83882 100644 (file)
@@ -37,9 +37,7 @@ if(WIN32)
                ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python35_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "." 
        )
 else()
-       set(NUMPY_INSTALL
-               ${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-3.5/numpy/" "${LIBDIR}/numpy/"
-       )
+       set(NUMPY_INSTALL echo .)
 endif()
 
 ExternalProject_Add(external_numpy
index a24bbbb6aea0fbd8ee23f775beaf99ceb14c455d..c1c7bf7001c2e31cf38eee3fc24e4118135fcf13 100644 (file)
@@ -82,13 +82,7 @@ else()
                INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
                INSTALL_DIR ${LIBDIR}/python)
 
-       add_custom_command(
-               OUTPUT ${LIBDIR}/python/release/python_x86_64.zip
-               WORKING_DIRECTORY ${LIBDIR}/python
-               COMMAND mkdir -p release
-               COMMAND zip -r release/python_x86_64.zip lib/python${PYTHON_SHORT_VERSION} lib/pkgconfig --exclude *__pycache__*)
-       add_custom_target(Package_Python ALL DEPENDS external_python ${LIBDIR}/python/release/python_x86_64.zip)
-       add_custom_target(Make_Python_Environment ALL DEPENDS Package_Python)
+       add_custom_target(Make_Python_Environment ALL DEPENDS external_python)
 endif()
 
 if(MSVC)
index 399bfe4009ff5e122e26163feb4d8d09e776d3f6..f5aa26b0615eb050027e96897ead4c6ed2583835 100644 (file)
 # ***** END GPL LICENSE BLOCK *****
 
 if(BUILD_MODE STREQUAL Release)
+       if(WIN32)
+               set(REQUESTS_INSTALL_DIR ${LIBDIR}/requests)
+       else()
+               set(REQUESTS_INSTALL_DIR ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION}/site-packages/requests)
+       endif()
+
        ExternalProject_Add(external_requests
                URL ${REQUESTS_URI}
                DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -24,6 +30,8 @@ if(BUILD_MODE STREQUAL Release)
                PREFIX ${BUILD_DIR}/requests
                CONFIGURE_COMMAND ""
                BUILD_COMMAND ""
-               INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/requests/src/external_requests/requests ${LIBDIR}/requests
+               INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/requests/src/external_requests/requests ${REQUESTS_INSTALL_DIR}
        )
+
+       add_dependencies(external_requests Make_Python_Environment)
 endif(BUILD_MODE STREQUAL Release)
index 5336024b75ce31be6cae9811159642682b3abf94..17118e4672a749e8db77a07d53e27b0938c99624 100644 (file)
@@ -95,7 +95,11 @@ if(WITH_PYTHON)
                # normally cached but not since we include them with blender
                set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
                set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
-               set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
+               if(WITH_CXX11)
+                       set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a)
+               else()
+                       set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
+               endif()
                set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
                # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
        else()
@@ -115,6 +119,9 @@ if(WITH_PYTHON)
        set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
        set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
 
+       # needed for Audaspace, numpy is installed into python site-packages
+       set(NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
+
        if(NOT EXISTS "${PYTHON_EXECUTABLE}")
                message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
        endif()
index 12b332cb4318fc3f3ae5348a34dc5f1d42457be3..701aa10d5564ada856570ef7218834b801c81d72 100644 (file)
@@ -2,12 +2,10 @@ import bpy
 cycles = bpy.context.scene.cycles
 
 cycles.max_bounces = 8
-cycles.min_bounces = 8
 cycles.caustics_reflective = False
 cycles.caustics_refractive = False
 cycles.diffuse_bounces = 0
 cycles.glossy_bounces = 1
 cycles.transmission_bounces = 2
 cycles.volume_bounces = 0
-cycles.transparent_min_bounces = 8
 cycles.transparent_max_bounces = 8
index 69fa6e735bd33371f75123edcb8cc4f6ab0823a4..a03c6c8bd649e5341dcf24eaba02d057312a91a9 100644 (file)
@@ -2,12 +2,10 @@ import bpy
 cycles = bpy.context.scene.cycles
 
 cycles.max_bounces = 128
-cycles.min_bounces = 3
 cycles.caustics_reflective = True
 cycles.caustics_refractive = True
 cycles.diffuse_bounces = 128
 cycles.glossy_bounces = 128
 cycles.transmission_bounces = 128
 cycles.volume_bounces = 128
-cycles.transparent_min_bounces = 8
 cycles.transparent_max_bounces = 128
index 22a8478d23b07f655bec8bac8fe2cbcc99306e17..d37bf46c70524b6315ac244b60c07d09ddf6aed4 100644 (file)
@@ -2,12 +2,10 @@ import bpy
 cycles = bpy.context.scene.cycles
 
 cycles.max_bounces = 8
-cycles.min_bounces = 3
 cycles.caustics_reflective = False
 cycles.caustics_refractive = False
 cycles.diffuse_bounces = 1
 cycles.glossy_bounces = 4
 cycles.transmission_bounces = 8
 cycles.volume_bounces = 2
-cycles.transparent_min_bounces = 8
 cycles.transparent_max_bounces = 8
index d03423b6c2e53afee038cec6d2efd143628e512d..f1222d927c105db1809f892ae8d93a4baba0552c 100644 (file)
@@ -1,20 +1,18 @@
 import bpy
 cycles = bpy.context.scene.cycles
 
-cycles.use_square_samples = True
-
 # Path Trace
-cycles.samples = 24
-cycles.preview_samples = 12
+cycles.samples = 512
+cycles.preview_samples = 128
 
 # Branched Path Trace
-cycles.aa_samples = 8
-cycles.preview_aa_samples = 4
+cycles.aa_samples = 128
+cycles.preview_aa_samples = 32
 
-cycles.diffuse_samples = 3
-cycles.glossy_samples = 2
-cycles.transmission_samples = 2
+cycles.diffuse_samples = 4
+cycles.glossy_samples = 4
+cycles.transmission_samples = 4
 cycles.ao_samples = 1
-cycles.mesh_light_samples = 2
-cycles.subsurface_samples = 2
-cycles.volume_samples = 2
+cycles.mesh_light_samples = 4
+cycles.subsurface_samples = 4
+cycles.volume_samples = 4
index 5f071c7474db37907a16f7d5dd30f421eab84774..c16449e2c8f929c4092b056143bee3fb4fb3d305 100644 (file)
@@ -1,20 +1,18 @@
 import bpy
 cycles = bpy.context.scene.cycles
 
-cycles.use_square_samples = True
-
 # Path Trace
-cycles.samples = 12
-cycles.preview_samples = 6
+cycles.samples = 128
+cycles.preview_samples = 32
 
 # Branched Path Trace
-cycles.aa_samples = 4
-cycles.preview_aa_samples = 2
+cycles.aa_samples = 32
+cycles.preview_aa_samples = 4
 
-cycles.diffuse_samples = 3
-cycles.glossy_samples = 2
-cycles.transmission_samples = 2
+cycles.diffuse_samples = 4
+cycles.glossy_samples = 4
+cycles.transmission_samples = 4
 cycles.ao_samples = 1
-cycles.mesh_light_samples = 2
-cycles.subsurface_samples = 2
-cycles.volume_samples = 2
+cycles.mesh_light_samples = 4
+cycles.subsurface_samples = 4
+cycles.volume_samples = 4
index 11e22fffa4d88d51169aeae724e48e98a3b1d1f0..023d04f5da7a95e36957bd182e5cd260ea5f09d1 100644 (file)
@@ -851,6 +851,13 @@ elseif(APPLE)
                        PATTERN "__MACOSX" EXCLUDE
                        PATTERN ".DS_Store" EXCLUDE
                        PATTERN "config-${PYTHON_VERSION}m/*.a" EXCLUDE  # static lib
+                       PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
+                       PATTERN "tkinter" EXCLUDE                   # ./tkinter
+                       PATTERN "lib-dynload/_tkinter.*" EXCLUDE    # ./lib-dynload/_tkinter.co
+                       PATTERN "idlelib" EXCLUDE                   # ./idlelib
+                       PATTERN "test" EXCLUDE                      # ./test
+                       PATTERN "turtledemo" EXCLUDE                # ./turtledemo
+                       PATTERN "turtle.py" EXCLUDE                 # ./turtle.py
                )
        endmacro()
 
@@ -914,41 +921,49 @@ elseif(APPLE)
 
        # python
        if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
-               # the python zip is first extracted as part of the build process,
-               # and then later installed as part of make install. this is much
-               # quicker, and means we can easily exclude files on copy
-               # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
-               # use a hash of the .zip path to handle switching between different
-               # lib directories without needing a clean build
-               string(SHA1 PYTHON_ZIP_HASH ${LIBDIR}/release/${PYTHON_ZIP})
-               set(PYTHON_EXTRACT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_ZIP_HASH}/python)
-
-               add_custom_target(
-                       extractpyzip
-                       DEPENDS ${PYTHON_EXTRACT_DIR})
-
-               set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
-
-               add_custom_command(
-                       OUTPUT ${PYTHON_EXTRACT_DIR}
-                       COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
-                       COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
-                       COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
-                               ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
-                       DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
-
-               add_dependencies(blender extractpyzip)
-
-               # copy extracted python files
-               install_dir(
-                       ${PYTHON_EXTRACT_DIR}
-                       \${TARGETDIR_VER}
-               )
-               # copy site-packages files
-               install_dir(
-                       ${LIBDIR}/release/site-packages
-                       \${TARGETDIR_VER}/python/lib/python${PYTHON_VERSION}
-               )
+               if(WITH_CXX11)
+                       # Copy the python libs into the install directory
+                       install_dir(
+                               ${PYTHON_LIBPATH}
+                               ${TARGETDIR_VER}/python/lib
+                       )
+               else()
+                       # the python zip is first extracted as part of the build process,
+                       # and then later installed as part of make install. this is much
+                       # quicker, and means we can easily exclude files on copy
+                       # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
+                       # use a hash of the .zip path to handle switching between different
+                       # lib directories without needing a clean build
+                       string(SHA1 PYTHON_ZIP_HASH ${LIBDIR}/release/${PYTHON_ZIP})
+                       set(PYTHON_EXTRACT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_ZIP_HASH}/python)
+
+                       add_custom_target(
+                               extractpyzip
+                               DEPENDS ${PYTHON_EXTRACT_DIR})
+
+                       set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
+
+                       add_custom_command(
+                               OUTPUT ${PYTHON_EXTRACT_DIR}
+                               COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
+                               COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
+                               COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
+                                               ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
+                               DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
+
+                       add_dependencies(blender extractpyzip)
+
+                       # copy extracted python files
+                       install_dir(
+                               ${PYTHON_EXTRACT_DIR}
+                               \${TARGETDIR_VER}
+                       )
+                       # copy site-packages files
+                       install_dir(
+                               ${LIBDIR}/release/site-packages
+                               \${TARGETDIR_VER}/python/lib/python${PYTHON_VERSION}
+                       )
+               endif()
 
                install(DIRECTORY ${LIBDIR}/python/bin
                        DESTINATION ${TARGETDIR_VER}/python
@@ -1003,19 +1018,27 @@ elseif(APPLE)
 
                # python
                if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
-                       add_custom_command(
-                               OUTPUT ${PYTHON_EXTRACT_DIR}
-                               COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
-                               COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
-                               COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
-                                       ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
-                               DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
-
-                       # copy extracted python files
-                       install_dir(
-                               ${PYTHON_EXTRACT_DIR}
-                               \${PLAYER_TARGETDIR_VER}
-                       )
+                       if(WITH_CXX11)
+                               # Copy the python libs into the install directory
+                               install_dir(
+                                       ${PYTHON_LIBPATH}
+                                       ${PLAYER_TARGETDIR_VER}/python/lib
+                               )
+                       else()
+                               add_custom_command(
+                                       OUTPUT ${PYTHON_EXTRACT_DIR}
+                                       COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/"
+                                       COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/"
+                                       COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/"
+                                                       ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
+                                       DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
+
+                               # copy extracted python files
+                               install_dir(
+                                       ${PYTHON_EXTRACT_DIR}
+                                       \${PLAYER_TARGETDIR_VER}
+                               )
+                       endif()
                endif()
 
        endif()