Compare commits
15 Commits
temp-D8915
...
mesh-to-vo
Author | SHA1 | Date | |
---|---|---|---|
6da9286cc8 | |||
4803466c01 | |||
f798a6c679 | |||
6501b05118 | |||
aad5a79a94 | |||
2629cf12f5 | |||
d525a541a2 | |||
e204f67cf0 | |||
d8d1344d96 | |||
9cbc874062 | |||
0e9e472bbe | |||
95e34d2ebf | |||
11f79038e1 | |||
076c913a3b | |||
c5fca660bc |
@@ -18,8 +18,6 @@ Checks: >
|
||||
-readability-redundant-member-init,
|
||||
-readability-use-anyofallof,
|
||||
|
||||
-readability-function-cognitive-complexity,
|
||||
|
||||
bugprone-*,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-unhandled-self-assignment,
|
||||
@@ -30,7 +28,4 @@ Checks: >
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-integer-division,
|
||||
|
||||
-bugprone-exception-escape,
|
||||
-bugprone-redundant-branch-condition,
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
|
@@ -43,8 +43,8 @@ endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Prefer LEGACY OpenGL to be compatible with all the existing releases and
|
||||
# platforms which don't have GLVND yet. Only do it if preference was not set
|
||||
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
|
||||
# platforms which don't hare GLVND yet. Only do it if preference was not set
|
||||
# externally.
|
||||
if(NOT DEFINED OpenGL_GL_PREFERENCE)
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
@@ -203,7 +203,6 @@ option(WITH_OPENVDB "Enable features relying on OpenVDB" ON)
|
||||
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ON)
|
||||
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
|
||||
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
||||
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for accelerated rendering on the GPU" OFF)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
|
||||
@@ -377,7 +376,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
||||
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
||||
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||
@@ -705,9 +704,6 @@ set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE OFF)
|
||||
set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF)
|
||||
set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
|
||||
|
||||
# NanoVDB requires OpenVDB to convert the data structure
|
||||
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
|
||||
|
||||
# OpenVDB uses 'half' type from OpenEXR & fails to link without OpenEXR enabled.
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
|
||||
|
||||
@@ -853,17 +849,11 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
if(WITH_COMPILER_ASAN)
|
||||
if(NOT APPLE)
|
||||
# Avoid passing address sanitizer compiler flags to `try_compile`.
|
||||
# Since linker flags are not set, all compiler checks and `find_package`
|
||||
# calls that rely on `try_compile` will fail.
|
||||
# See CMP0066 also.
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
if(MSVC)
|
||||
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
||||
endif()
|
||||
|
@@ -89,7 +89,7 @@ Spell Checkers
|
||||
* check_spelling_osl: Check for spelling errors (OSL only).
|
||||
* check_spelling_py: Check for spelling errors (Python only).
|
||||
|
||||
Note that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
|
||||
Note that spell checkers can tak a 'CHECK_SPELLING_CACHE' filepath argument,
|
||||
so re-running does not need to re-check unchanged files.
|
||||
|
||||
Example:
|
||||
@@ -517,7 +517,7 @@ doc_py: .FORCE
|
||||
ASAN_OPTIONS=halt_on_error=0 \
|
||||
$(BLENDER_BIN) --background -noaudio --factory-startup \
|
||||
--python doc/python_api/sphinx_doc_gen.py
|
||||
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
|
||||
|
||||
doc_doxy: .FORCE
|
||||
|
@@ -117,6 +117,7 @@ if(WIN32)
|
||||
include(cmake/yamlcpp.cmake)
|
||||
# LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
|
||||
# include(cmake/lcms.cmake)
|
||||
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 OR ENABLE_MINGW64)
|
||||
|
@@ -20,7 +20,7 @@ set(GMP_EXTRA_ARGS -enable-cxx)
|
||||
|
||||
if(WIN32)
|
||||
# Shared for windows because static libs will drag in a libgcc dependency.
|
||||
set(GMP_OPTIONS --disable-static --enable-shared --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
|
||||
set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
|
||||
else()
|
||||
set(GMP_OPTIONS --enable-static --disable-shared )
|
||||
endif()
|
||||
@@ -41,7 +41,6 @@ elseif(UNIX)
|
||||
set(GMP_OPTIONS
|
||||
${GMP_OPTIONS}
|
||||
--with-pic
|
||||
--enable-fat
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@@ -26,7 +26,6 @@ endif()
|
||||
message("HARVEST_TARGET = ${HARVEST_TARGET}")
|
||||
|
||||
if(WIN32)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
add_custom_target(Harvest_Release_Results
|
||||
COMMAND # jpeg rename libfile + copy include
|
||||
@@ -146,9 +145,6 @@ harvest(openjpeg/lib openjpeg/lib "*.a")
|
||||
harvest(opensubdiv/include opensubdiv/include "*.h")
|
||||
harvest(opensubdiv/lib opensubdiv/lib "*.a")
|
||||
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
|
||||
if(WITH_NANOVDB)
|
||||
harvest(openvdb/nanovdb nanovdb/include/nanovdb "*.h")
|
||||
endif()
|
||||
harvest(openvdb/lib openvdb/lib "*.a")
|
||||
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
|
||||
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
|
||||
|
@@ -59,4 +59,4 @@ else(WIN32)
|
||||
)
|
||||
|
||||
set(JPEG_LIBRARY libjpeg${LIBEXT})
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
@@ -54,20 +54,6 @@ set(OPENVDB_EXTRA_ARGS
|
||||
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
|
||||
-DOPENVDB_BUILD_BINARIES=Off
|
||||
-DCMAKE_DEBUG_POSTFIX=_d
|
||||
# NanoVDB is header-only, so only need the install target
|
||||
-DNANOVDB_BUILD_UNITTESTS=OFF
|
||||
-DNANOVDB_BUILD_EXAMPLES=OFF
|
||||
-DNANOVDB_BUILD_BENCHMARK=OFF
|
||||
-DNANOVDB_BUILD_DOCS=OFF
|
||||
-DNANOVDB_BUILD_TOOLS=OFF
|
||||
-DNANOVDB_CUDA_KEEP_PTX=OFF
|
||||
-DNANOVDB_USE_OPENGL=OFF
|
||||
-DNANOVDB_USE_OPENGL=OFF
|
||||
-DNANOVDB_USE_CUDA=OFF
|
||||
-DNANOVDB_USE_TBB=OFF
|
||||
-DNANOVDB_USE_OPTIX=OFF
|
||||
-DNANOVDB_USE_OPENVDB=OFF
|
||||
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
@@ -88,18 +74,12 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(OPENVDB_PATCH_FILE openvdb_nanovdb.diff)
|
||||
else()
|
||||
set(OPENVDB_PATCH_FILE openvdb.diff)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(openvdb
|
||||
URL ${OPENVDB_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH MD5=${OPENVDB_HASH}
|
||||
PREFIX ${BUILD_DIR}/openvdb
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/${OPENVDB_PATCH_FILE}
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openvdb
|
||||
)
|
||||
@@ -116,17 +96,11 @@ add_dependencies(
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(openvdb after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include/openvdb ${HARVEST_TARGET}/openvdb/include/openvdb
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
|
||||
DEPENDEES install
|
||||
)
|
||||
if(WITH_NANOVDB)
|
||||
ExternalProject_Add_Step(openvdb nanovdb_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
|
||||
DEPENDEES after_install
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
ExternalProject_Add_Step(openvdb after_install
|
||||
|
@@ -21,7 +21,6 @@ if(WIN32)
|
||||
endif()
|
||||
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
|
||||
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
|
||||
option(WITH_NANOVDB "Enable building of OpenVDB with NanoVDB included" OFF)
|
||||
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
|
||||
|
||||
if(NOT BUILD_MODE)
|
||||
|
@@ -145,15 +145,9 @@ set(TBB_VERSION 2019_U9)
|
||||
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
|
||||
set(TBB_HASH 26263622e9187212ec240dcf01b66207)
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(OPENVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
|
||||
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${OPENVDB_GIT_UID}.tar.gz)
|
||||
set(OPENVDB_HASH 90919510bc6ccd630fedc56f748cb199)
|
||||
else()
|
||||
set(OPENVDB_VERSION 7.0.0)
|
||||
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
||||
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
|
||||
endif()
|
||||
set(OPENVDB_VERSION 7.0.0)
|
||||
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
||||
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
|
||||
|
||||
set(IDNA_VERSION 2.9)
|
||||
set(CHARDET_VERSION 3.0.4)
|
||||
|
@@ -520,7 +520,7 @@ OIDN_FORCE_BUILD=false
|
||||
OIDN_FORCE_REBUILD=false
|
||||
OIDN_SKIP=false
|
||||
|
||||
ISPC_VERSION="1.14.1"
|
||||
ISPC_VERSION="1.14.0"
|
||||
|
||||
FFMPEG_VERSION="4.2.3"
|
||||
FFMPEG_VERSION_SHORT="4.2"
|
||||
@@ -1259,16 +1259,13 @@ version_match() {
|
||||
# ----------------------------------------------------------------------------
|
||||
# Generic compile helpers
|
||||
|
||||
prepare_inst() {
|
||||
prepare_opt() {
|
||||
INFO "Ensuring $INST exists and is writable by us"
|
||||
if [ ! $SUDO ]; then
|
||||
WARNING "--no-sudo enabled, might be impossible to create install dir..."
|
||||
fi
|
||||
|
||||
if [ ! -d $INST ]; then
|
||||
# Try to create normal user directory first to possibly avoid excessive
|
||||
# system operations
|
||||
mkdir -p $INST || $SUDO mkdir -p $INST
|
||||
$SUDO mkdir -p $INST
|
||||
fi
|
||||
|
||||
if [ ! -w $INST ]; then
|
||||
@@ -1369,7 +1366,7 @@ compile_Python() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_python
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -1455,7 +1452,7 @@ compile_Numpy() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_numpy
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -1544,7 +1541,7 @@ compile_Boost() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_boost
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading Boost-$BOOST_VERSION"
|
||||
@@ -1638,7 +1635,7 @@ compile_TBB() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_tbb
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
|
||||
@@ -1755,7 +1752,7 @@ compile_OCIO() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ocio
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading OpenColorIO-$OCIO_VERSION"
|
||||
@@ -1887,7 +1884,7 @@ compile_OPENEXR() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_openexr
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading OpenEXR-$OPENEXR_VERSION"
|
||||
@@ -2013,7 +2010,7 @@ compile_OIIO() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_oiio
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2168,7 +2165,7 @@ compile_LLVM() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_llvm
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src -o true ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2278,7 +2275,7 @@ compile_OSL() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_osl
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2422,7 +2419,7 @@ compile_OSD() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_osd
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2540,7 +2537,7 @@ compile_BLOSC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_blosc
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading Blosc-$OPENVDB_BLOSC_VERSION"
|
||||
@@ -2639,7 +2636,7 @@ compile_OPENVDB() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_openvdb
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src -o true ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2754,7 +2751,7 @@ compile_ALEMBIC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_alembic
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2859,7 +2856,7 @@ compile_USD() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_usd
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2958,7 +2955,7 @@ compile_OpenCOLLADA() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_collada
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3064,7 +3061,7 @@ compile_Embree() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_embree
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3174,7 +3171,7 @@ install_ISPC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ispc
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3253,7 +3250,7 @@ compile_OIDN() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_oidn
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3363,7 +3360,7 @@ compile_FFmpeg() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ffmpeg
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading ffmpeg-$FFMPEG_VERSION"
|
||||
@@ -3492,7 +3489,7 @@ compile_XR_OpenXR_SDK() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_xr_openxr_sdk
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3958,7 +3955,7 @@ install_DEB() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_DEB llvm-dev clang
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_DEB llvm-dev`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
@@ -4607,7 +4604,7 @@ install_RPM() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_RPM llvm-devel $CLANG_DEV
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_RPM llvm-devel`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
@@ -5129,7 +5126,7 @@ install_ARCH() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_ARCH llvm clang
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_ARCH llvm`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
|
@@ -1,135 +0,0 @@
|
||||
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
|
||||
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
|
||||
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
|
||||
@@ -217,6 +217,8 @@
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
|
||||
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
|
||||
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
|
||||
else()
|
||||
if(ILMBASE_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
|
||||
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
|
||||
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
|
||||
@@ -210,6 +210,8 @@
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
|
||||
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib")
|
||||
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib")
|
||||
else()
|
||||
if(OPENEXR_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
diff -Naur orig/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
|
||||
--- orig/openvdb/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
|
||||
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
|
||||
@@ -105,7 +105,9 @@
|
||||
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
|
||||
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
- set(Boost_USE_STATIC_LIBS OFF)
|
||||
+ if(NOT WIN32) # blender links boost statically on windows
|
||||
+ set(Boost_USE_STATIC_LIBS OFF)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
|
||||
@@ -193,6 +195,7 @@
|
||||
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
|
||||
add_definitions(-DBOOST_ALL_NO_LIB)
|
||||
endif()
|
||||
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB)
|
||||
endif()
|
||||
|
||||
# @todo Should be target definitions
|
||||
@@ -383,7 +386,12 @@
|
||||
# imported targets.
|
||||
|
||||
if(OPENVDB_CORE_SHARED)
|
||||
- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
|
||||
+ if(WIN32)
|
||||
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
|
||||
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||
+ else()
|
||||
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
if(OPENVDB_CORE_STATIC)
|
||||
diff -Naur orig/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in
|
||||
--- orig/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
|
||||
+++ openvdb/openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
|
||||
@@ -0,0 +1,48 @@
|
||||
+#include <winver.h>
|
||||
+
|
||||
+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
|
||||
+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0"
|
||||
+
|
||||
+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
|
||||
+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0"
|
||||
+
|
||||
+#ifndef DEBUG
|
||||
+#define VER_DEBUG 0
|
||||
+#else
|
||||
+#define VER_DEBUG VS_FF_DEBUG
|
||||
+#endif
|
||||
+
|
||||
+VS_VERSION_INFO VERSIONINFO
|
||||
+FILEVERSION VER_FILEVERSION
|
||||
+PRODUCTVERSION VER_PRODUCTVERSION
|
||||
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
+FILEFLAGS (VER_DEBUG)
|
||||
+FILEOS VOS__WINDOWS32
|
||||
+FILETYPE VFT_DLL
|
||||
+FILESUBTYPE VFT2_UNKNOWN
|
||||
+BEGIN
|
||||
+ BLOCK "StringFileInfo"
|
||||
+ BEGIN
|
||||
+ BLOCK "040904E4"
|
||||
+ BEGIN
|
||||
+ VALUE "FileDescription", "OpenVDB"
|
||||
+ VALUE "FileVersion", VER_FILEVERSION_STR
|
||||
+ VALUE "InternalName", "OpenVDB"
|
||||
+ VALUE "ProductName", "OpenVDB"
|
||||
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
|
||||
+ END
|
||||
+ END
|
||||
+
|
||||
+ BLOCK "VarFileInfo"
|
||||
+ BEGIN
|
||||
+ /* The following line should only be modified for localized versions. */
|
||||
+ /* It consists of any number of WORD,WORD pairs, with each pair */
|
||||
+ /* describing a language,codepage combination supported by the file. */
|
||||
+ /* */
|
||||
+ /* For example, a file might have values "0x409,1252" indicating that it */
|
||||
+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */
|
||||
+
|
||||
+ VALUE "Translation", 0x409, 1252
|
||||
+
|
||||
+ END
|
||||
+END
|
||||
diff -Naur openvdb-original/CMakeLists.txt openvdb/CMakeLists.txt
|
||||
--- openvdb-original/CMakeLists.txt 2020-08-27 03:34:02.000000000 +0200
|
||||
+++ openvdb/CMakeLists.txt 2020-09-02 10:56:21.665735244 +0200
|
||||
@@ -68,6 +68,7 @@
|
||||
option(OPENVDB_INSTALL_HOUDINI_PYTHONRC [=[Install a Houdini startup script that sets
|
||||
the visibilty of OpenVDB nodes and their native equivalents.]=] OFF)
|
||||
option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF)
|
||||
+option(OPENVDB_BUILD_NANOVDB "Build nanovdb" ON)
|
||||
option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON)
|
||||
option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF)
|
||||
option(OPENVDB_CODE_COVERAGE "Enable code coverage. This also overrides CMAKE_BUILD_TYPE to Debug" OFF)
|
||||
@@ -740,6 +741,10 @@
|
||||
add_subdirectory(openvdb_maya)
|
||||
endif()
|
||||
|
||||
+if(OPENVDB_BUILD_NANOVDB)
|
||||
+ add_subdirectory(nanovdb)
|
||||
+endif()
|
||||
+
|
||||
##########################################################################
|
||||
|
||||
add_custom_target(uninstall
|
||||
|
@@ -24,7 +24,6 @@ import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def is_tool(name):
|
||||
"""Check whether `name` is on PATH and marked as executable."""
|
||||
|
||||
@@ -33,7 +32,6 @@ def is_tool(name):
|
||||
|
||||
return which(name) is not None
|
||||
|
||||
|
||||
class Builder:
|
||||
def __init__(self, name, branch, codesign):
|
||||
self.name = name
|
||||
@@ -50,23 +48,22 @@ class Builder:
|
||||
# Detect platform
|
||||
if name.startswith('mac'):
|
||||
self.platform = 'mac'
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
elif name.startswith('linux'):
|
||||
self.platform = 'linux'
|
||||
if is_tool('scl'):
|
||||
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
|
||||
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
|
||||
else:
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
elif name.startswith('win'):
|
||||
self.platform = 'win'
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
else:
|
||||
raise ValueError('Unkonw platform for builder ' + self.platform)
|
||||
|
||||
# Always 64 bit now
|
||||
self.bits = 64
|
||||
|
||||
|
||||
def create_builder_from_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('builder_name')
|
||||
@@ -107,7 +104,7 @@ class VersionInfo:
|
||||
|
||||
def _parse_header_file(self, filename, define):
|
||||
import re
|
||||
regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
|
||||
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
|
||||
with open(filename, "r") as file:
|
||||
for l in file:
|
||||
match = regex.match(l)
|
||||
|
@@ -102,7 +102,7 @@ class ArchiveWithIndicator:
|
||||
|
||||
# Wait for until archive is fully stored.
|
||||
actual_archive_size = self.archive_filepath.stat().st_size
|
||||
if actual_archive_size != expected_archive_size:
|
||||
if actual_archive_size != expected_archive_size:
|
||||
print('Partial/invalid archive size (expected '
|
||||
f'{expected_archive_size} got {actual_archive_size})')
|
||||
return False
|
||||
|
@@ -23,7 +23,6 @@ import shutil
|
||||
|
||||
import buildbot_utils
|
||||
|
||||
|
||||
def get_cmake_options(builder):
|
||||
codesign_script = os.path.join(
|
||||
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
||||
@@ -45,24 +44,11 @@ def get_cmake_options(builder):
|
||||
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
|
||||
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
|
||||
|
||||
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
|
||||
if builder.platform == 'win':
|
||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1')
|
||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe')
|
||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1')
|
||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe')
|
||||
elif builder.platform == 'linux':
|
||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.1')
|
||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.1/bin/nvcc')
|
||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.1')
|
||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-11.1/bin/nvcc')
|
||||
|
||||
options.append("-C" + os.path.join(builder.blender_dir, config_file))
|
||||
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))
|
||||
|
||||
return options
|
||||
|
||||
|
||||
def update_git(builder):
|
||||
# Do extra git fetch because not all platform/git/buildbot combinations
|
||||
# update the origin remote, causing buildinfo to detect local changes.
|
||||
@@ -72,7 +58,6 @@ def update_git(builder):
|
||||
command = ['git', 'fetch', '--all']
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
def clean_directories(builder):
|
||||
# Make sure no garbage remained from the previous run
|
||||
if os.path.isdir(builder.install_dir):
|
||||
@@ -88,7 +73,6 @@ def clean_directories(builder):
|
||||
print("Removing {}" . format(buildinfo))
|
||||
os.remove(full_path)
|
||||
|
||||
|
||||
def cmake_configure(builder):
|
||||
# CMake configuration
|
||||
os.chdir(builder.build_dir)
|
||||
@@ -103,7 +87,6 @@ def cmake_configure(builder):
|
||||
command = ['cmake', builder.blender_dir] + cmake_options
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
def cmake_build(builder):
|
||||
# CMake build
|
||||
os.chdir(builder.build_dir)
|
||||
@@ -126,7 +109,6 @@ def cmake_build(builder):
|
||||
print("CMake build:")
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = buildbot_utils.create_builder_from_arguments()
|
||||
update_git(builder)
|
||||
|
@@ -29,20 +29,18 @@ from pathlib import Path
|
||||
|
||||
import buildbot_utils
|
||||
|
||||
|
||||
def get_package_name(builder, platform=None):
|
||||
info = buildbot_utils.VersionInfo(builder)
|
||||
|
||||
package_name = 'blender-' + info.full_version
|
||||
if platform:
|
||||
package_name += '-' + platform
|
||||
package_name += '-' + platform
|
||||
if not (builder.branch == 'master' or builder.is_release_branch):
|
||||
if info.is_development_build:
|
||||
package_name = builder.branch + "-" + package_name
|
||||
|
||||
return package_name
|
||||
|
||||
|
||||
def sign_file_or_directory(path):
|
||||
from codesign.simple_code_signer import SimpleCodeSigner
|
||||
code_signer = SimpleCodeSigner()
|
||||
@@ -66,7 +64,6 @@ def create_buildbot_upload_zip(builder, package_files):
|
||||
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def create_tar_xz(src, dest, package_name):
|
||||
# One extra to remove leading os.sep when cleaning root for package_root
|
||||
ln = len(src) + 1
|
||||
@@ -94,7 +91,6 @@ def create_tar_xz(src, dest, package_name):
|
||||
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
||||
package.close()
|
||||
|
||||
|
||||
def cleanup_files(dirpath, extension):
|
||||
for f in os.listdir(dirpath):
|
||||
filepath = os.path.join(dirpath, f)
|
||||
@@ -175,11 +171,7 @@ def pack_linux(builder):
|
||||
|
||||
print("Stripping python...")
|
||||
py_target = os.path.join(builder.install_dir, info.short_version)
|
||||
buildbot_utils.call(
|
||||
builder.command_prefix + [
|
||||
'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
|
||||
],
|
||||
)
|
||||
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
|
||||
|
||||
# Construct package name
|
||||
platform_name = 'linux64'
|
||||
|
@@ -22,21 +22,18 @@ import buildbot_utils
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def get_ctest_arguments(builder):
|
||||
args = ['--output-on-failure']
|
||||
if builder.platform == 'win':
|
||||
args += ['-C', 'Release']
|
||||
return args
|
||||
|
||||
|
||||
def test(builder):
|
||||
os.chdir(builder.build_dir)
|
||||
|
||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
||||
buildbot_utils.call(command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = buildbot_utils.create_builder_from_arguments()
|
||||
test(builder)
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_IN
|
||||
IF(ALEMBIC_FOUND)
|
||||
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
|
||||
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(ALEMBIC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ALEMBIC_INCLUDE_DIR
|
||||
|
@@ -30,7 +30,7 @@ SET(_audaspace_SEARCH_DIRS
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
|
||||
ENDIF()
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
# Include dir
|
||||
FIND_PATH(AUDASPACE_INCLUDE_DIR
|
||||
@@ -88,17 +88,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRAR
|
||||
IF(AUDASPACE_FOUND)
|
||||
SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
|
||||
SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_FOUND)
|
||||
|
||||
IF(AUDASPACE_C_FOUND)
|
||||
SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
|
||||
SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_C_FOUND)
|
||||
|
||||
IF(AUDASPACE_PY_FOUND)
|
||||
SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
|
||||
SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_PY_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
AUDASPACE_LIBRARY
|
||||
|
@@ -41,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
|
||||
|
||||
IF(EIGEN3_FOUND)
|
||||
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(EIGEN3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EIGEN3_INCLUDE_DIR
|
||||
|
@@ -80,7 +80,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Embree DEFAULT_MSG
|
||||
IF(EMBREE_FOUND)
|
||||
SET(EMBREE_LIBRARIES ${_embree_LIBRARIES})
|
||||
SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(EMBREE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EMBREE_INCLUDE_DIR
|
||||
|
@@ -1,83 +0,0 @@
|
||||
# - Find FFmpeg library and includes.
|
||||
# Set FFMPEG_FIND_COMPONENTS to the canonical names of the libraries
|
||||
# before using the module.
|
||||
# This module defines
|
||||
# FFMPEG_INCLUDE_DIRS, where to find libavcodec/ac3_parser.h.
|
||||
# FFMPEG_LIBRARIES, libraries to link against to use FFmpeg.
|
||||
# FFMPEG_ROOT_DIR, The base directory to search for FFmpeg.
|
||||
# This can also be an environment variable.
|
||||
# FFMPEG_FOUND, If false, do not try to use FFmpeg.
|
||||
# FFMPEG_<COMPONENT>_LIBRARY, the given individual component libraries.
|
||||
#=============================================================================
|
||||
# Copyright 2020 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If FFMPEG_ROOT_DIR was defined in the environment, use it.
|
||||
if(NOT FFMPEG_ROOT_DIR AND NOT $ENV{FFMPEG_ROOT_DIR} STREQUAL "")
|
||||
set(FFMPEG_ROOT_DIR $ENV{FFMPEG_ROOT_DIR})
|
||||
endif()
|
||||
|
||||
set(_ffmpeg_SEARCH_DIRS
|
||||
${FFMPEG_ROOT_DIR}
|
||||
/opt/lib/ffmpeg
|
||||
)
|
||||
|
||||
if(NOT FFMPEG_FIND_COMPONENTS)
|
||||
set(FFMPEG_FIND_COMPONENTS
|
||||
# List taken from http://ffmpeg.org/download.html#build-mac
|
||||
avcodec
|
||||
avdevice
|
||||
avfilter
|
||||
avformat
|
||||
avutil
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(_ffmpeg_INCLUDE_DIR
|
||||
NAMES
|
||||
libavcodec/ac3_parser.h
|
||||
HINTS
|
||||
${_ffmpeg_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
set(_ffmpeg_LIBRARIES)
|
||||
foreach(_component ${FFMPEG_FIND_COMPONENTS})
|
||||
string(TOUPPER ${_component} _upper_COMPONENT)
|
||||
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${_upper_COMPONENT}
|
||||
HINTS
|
||||
${LIBDIR}/ffmpeg
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
if(NOT FFMPEG_${_upper_COMPONENT}_LIBRARY)
|
||||
message(WARNING "Could NOT find FFmpeg ${_upper_COMPONENT}.")
|
||||
endif()
|
||||
list(APPEND _ffmpeg_LIBRARIES ${FFMPEG_${_upper_COMPONENT}_LIBRARY})
|
||||
mark_as_advanced(FFMPEG_${_upper_COMPONENT}_LIBRARY)
|
||||
endforeach()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG
|
||||
_ffmpeg_LIBRARIES _ffmpeg_INCLUDE_DIR)
|
||||
|
||||
IF(FFMPEG_FOUND)
|
||||
set(FFMPEG_LIBRARIES ${_ffmpeg_LIBRARIES})
|
||||
set(FFMPEG_INCLUDE_DIRS ${_ffmpeg_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
|
||||
mark_as_advanced(
|
||||
FFMPEG_INCLUDE_DIR
|
||||
)
|
||||
|
||||
unset(_ffmpeg_SEARCH_DIRS)
|
||||
unset(_ffmpeg_LIBRARIES)
|
||||
unset(_ffmpeg_INCLUDE_DIR)
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG
|
||||
IF(FFTW3_FOUND)
|
||||
SET(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
|
||||
SET(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(FFTW3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
FFTW3_INCLUDE_DIR
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
|
||||
|
||||
IF(GLEW_FOUND)
|
||||
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(GLEW_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
|
@@ -82,7 +82,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
|
||||
IF(GMP_FOUND)
|
||||
SET(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
|
||||
SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(GMP_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GMP_INCLUDE_DIR
|
||||
|
@@ -124,7 +124,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Icu DEFAULT_MSG
|
||||
IF(ICU_FOUND)
|
||||
SET(ICU_LIBRARIES ${ICU_LIBRARY_DATA} ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_IO} ${ICU_LIBRARY_LE} ${ICU_LIBRARY_LX} ${ICU_LIBRARY_TU} ${ICU_LIBRARY_UC})
|
||||
SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(ICU_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ICU_INCLUDE_DIR
|
||||
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG
|
||||
IF(JACK_FOUND)
|
||||
SET(JACK_LIBRARIES ${JACK_LIBRARY})
|
||||
SET(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(JACK_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JACK_INCLUDE_DIR
|
||||
|
@@ -64,7 +64,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
|
||||
IF(JEMALLOC_FOUND)
|
||||
SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
|
||||
SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(JEMALLOC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JEMALLOC_INCLUDE_DIR
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
|
||||
IF(LZO_FOUND)
|
||||
SET(LZO_LIBRARIES ${LZO_LIBRARY})
|
||||
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(LZO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LZO_INCLUDE_DIR
|
||||
|
@@ -1,49 +0,0 @@
|
||||
# - Find NanoVDB library
|
||||
# Find the native NanoVDB includes and library
|
||||
# This module defines
|
||||
# NANOVDB_INCLUDE_DIRS, where to find nanovdb.h, Set when
|
||||
# NANOVDB_INCLUDE_DIR is found.
|
||||
# NANOVDB_ROOT_DIR, The base directory to search for NanoVDB.
|
||||
# This can also be an environment variable.
|
||||
# NANOVDB_FOUND, If false, do not try to use NanoVDB.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2020 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If NANOVDB_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT NANOVDB_ROOT_DIR AND NOT $ENV{NANOVDB_ROOT_DIR} STREQUAL "")
|
||||
SET(NANOVDB_ROOT_DIR $ENV{NANOVDB_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_nanovdb_SEARCH_DIRS
|
||||
${NANOVDB_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(NANOVDB_INCLUDE_DIR
|
||||
NAMES
|
||||
nanovdb/NanoVDB.h
|
||||
HINTS
|
||||
${_nanovdb_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set NANOVDB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NanoVDB DEFAULT_MSG
|
||||
NANOVDB_INCLUDE_DIR)
|
||||
|
||||
IF(NANOVDB_FOUND)
|
||||
SET(NANOVDB_INCLUDE_DIRS ${NANOVDB_INCLUDE_DIR})
|
||||
ENDIF(NANOVDB_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
NANOVDB_INCLUDE_DIR
|
||||
)
|
||||
|
||||
UNSET(_nanovdb_SEARCH_DIRS)
|
@@ -95,7 +95,7 @@ IF(OSL_FOUND)
|
||||
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
|
||||
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
|
||||
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
|
||||
ENDIF()
|
||||
ENDIF(OSL_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OSL_INCLUDE_DIR
|
||||
|
@@ -129,7 +129,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA DEFAULT_MSG
|
||||
IF(OPENCOLLADA_FOUND)
|
||||
SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
|
||||
SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
|
||||
ENDIF()
|
||||
ENDIF(OPENCOLLADA_FOUND)
|
||||
|
||||
UNSET(COMPONENT)
|
||||
UNSET(UPPERCOMPONENT)
|
||||
|
@@ -70,7 +70,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG
|
||||
IF(OPENCOLORIO_FOUND)
|
||||
SET(OPENCOLORIO_LIBRARIES ${_opencolorio_LIBRARIES})
|
||||
SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENCOLORIO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENCOLORIO_INCLUDE_DIR
|
||||
|
@@ -65,7 +65,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG
|
||||
IF(OPENJPEG_FOUND)
|
||||
SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
|
||||
SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENJPEG_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENJPEG_INCLUDE_DIR
|
||||
|
@@ -90,7 +90,7 @@ IF(OPENSUBDIV_FOUND)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
|
||||
ENDIF()
|
||||
ENDIF(OPENSUBDIV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENSUBDIV_INCLUDE_DIR
|
||||
|
@@ -55,7 +55,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB DEFAULT_MSG
|
||||
IF(OPENVDB_FOUND)
|
||||
SET(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
|
||||
SET(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENVDB_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENVDB_INCLUDE_DIR
|
||||
|
@@ -41,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX DEFAULT_MSG
|
||||
|
||||
IF(OPTIX_FOUND)
|
||||
SET(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPTIX_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPTIX_INCLUDE_DIR
|
||||
|
@@ -57,7 +57,7 @@ SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
||||
|
||||
IF(PCRE_FOUND)
|
||||
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(PCRE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
PCRE_INCLUDE_DIR
|
||||
|
@@ -53,7 +53,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
|
||||
IF(SDL2_FOUND)
|
||||
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
|
||||
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SDL2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SDL2_INCLUDE_DIR
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
|
||||
IF(SNDFILE_FOUND)
|
||||
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
|
||||
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SNDFILE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LIBSNDFILE_INCLUDE_DIR
|
||||
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spacenav DEFAULT_MSG
|
||||
IF(SPACENAV_FOUND)
|
||||
SET(SPACENAV_LIBRARIES ${SPACENAV_LIBRARY})
|
||||
SET(SPACENAV_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SPACENAV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SPACENAV_INCLUDE_DIR
|
||||
|
@@ -59,7 +59,7 @@ ELSE()
|
||||
get_filename_component(USD_LIBRARY_DIR ${USD_LIBRARY} DIRECTORY)
|
||||
SET(USD_INCLUDE_DIRS ${USD_INCLUDE_DIR})
|
||||
set(USD_LIBRARIES ${USD_LIBRARY})
|
||||
ENDIF()
|
||||
ENDIF(USD_FOUND)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
|
||||
IF(XML2_FOUND)
|
||||
SET(XML2_LIBRARIES ${XML2_LIBRARY})
|
||||
SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(XML2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XML2_INCLUDE_DIR
|
||||
|
@@ -61,7 +61,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OpenXR_SDK DEFAULT_MSG
|
||||
IF(XR_OPENXR_SDK_FOUND)
|
||||
SET(XR_OPENXR_SDK_LIBRARIES ${XR_OPENXR_SDK_LOADER_LIBRARY})
|
||||
SET(XR_OPENXR_SDK_INCLUDE_DIRS ${XR_OPENXR_SDK_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(XR_OPENXR_SDK_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XR_OPENXR_SDK_INCLUDE_DIR
|
||||
|
@@ -355,8 +355,6 @@ def recursive_arg_sizes(node, ):
|
||||
# print("adding", node.spelling)
|
||||
for c in node.get_children():
|
||||
recursive_arg_sizes(c)
|
||||
|
||||
|
||||
# cache function sizes
|
||||
recursive_arg_sizes(tu.cursor)
|
||||
_defs.update(defs_precalc)
|
||||
|
@@ -182,7 +182,7 @@ def create_nb_project_main():
|
||||
f.write(' </logicalFolder>\n')
|
||||
# default, but this dir is infact not in blender dir so we can ignore it
|
||||
# f.write(' <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n')
|
||||
f.write(r' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
|
||||
f.write(' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
|
||||
|
||||
f.write(' <sourceRootList>\n')
|
||||
f.write(' <Elem>%s</Elem>\n' % SOURCE_DIR) # base_root_rel
|
||||
|
@@ -8,7 +8,6 @@ import sys
|
||||
|
||||
cmakelists_file = sys.argv[-1]
|
||||
|
||||
|
||||
def main():
|
||||
options = []
|
||||
for l in open(cmakelists_file, 'r').readlines():
|
||||
|
@@ -49,8 +49,8 @@ def main():
|
||||
check_commands = []
|
||||
for c, inc_dirs, defs in source_info:
|
||||
|
||||
# ~if "source/blender" not in c:
|
||||
# ~ continue
|
||||
#~if "source/blender" not in c:
|
||||
#~ continue
|
||||
|
||||
cmd = ([CHECKER_BIN] +
|
||||
CHECKER_ARGS +
|
||||
|
@@ -55,7 +55,7 @@ set(WITH_USD ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;sm_86;compute_75 CACHE STRING "" FORCE)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;compute_75 CACHE STRING "" FORCE)
|
||||
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
|
||||
|
||||
# platform dependent options
|
||||
|
@@ -114,6 +114,5 @@ def main():
|
||||
import subprocess
|
||||
subprocess.call(cmd)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -302,14 +302,14 @@ function(blender_add_lib__impl
|
||||
#
|
||||
# What this code does it traverses library_deps and extracts information about whether
|
||||
# library is to provided as general, debug or optimized. This is a little state machine which
|
||||
# keeps track of which build type library is to provided for:
|
||||
# keeps track of whiuch build type library is to provided for:
|
||||
#
|
||||
# - If "debug" or "optimized" word is found, the next element in the list is expected to be
|
||||
# a library which will be passed to target_link_libraries() under corresponding build type.
|
||||
#
|
||||
# - If there is no "debug" or "optimized" used library is specified for all build types.
|
||||
#
|
||||
# NOTE: If separated libraries for debug and release are needed every library is the list are
|
||||
# NOTE: If separated libraries for debug and release ar eneeded every library is the list are
|
||||
# to be prefixed explicitly.
|
||||
#
|
||||
# Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d"
|
||||
@@ -477,8 +477,8 @@ function(SETUP_LIBDIRS)
|
||||
|
||||
# NOTE: For all new libraries, use absolute library paths.
|
||||
# This should eventually be phased out.
|
||||
# APPLE plaform uses full paths for linking libraries, and avoids link_directories.
|
||||
if(NOT MSVC AND NOT APPLE)
|
||||
|
||||
if(NOT MSVC)
|
||||
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
|
||||
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
@@ -1241,16 +1241,8 @@ endmacro()
|
||||
|
||||
macro(without_system_libs_begin)
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
|
||||
if(APPLE)
|
||||
# Avoid searching for headers in frameworks (like Mono), and libraries in LIBDIR.
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(without_system_libs_end)
|
||||
unset(CMAKE_IGNORE_PATH)
|
||||
if(APPLE)
|
||||
# FIRST is the default.
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -30,36 +30,6 @@ macro(find_package_wrapper)
|
||||
# do nothing, just satisfy the macro
|
||||
endmacro()
|
||||
|
||||
function(print_found_status
|
||||
lib_name
|
||||
lib_path
|
||||
)
|
||||
|
||||
if(FIRST_RUN)
|
||||
if(lib_path)
|
||||
message(STATUS "Found ${lib_name}: ${lib_path}")
|
||||
else()
|
||||
message(WARNING "Could NOT find ${lib_name}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Find system provided libraries.
|
||||
|
||||
# Find system ZLIB, not the pre-compiled one supplied with OpenCollada.
|
||||
set(ZLIB_ROOT /usr)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(BZip2 REQUIRED)
|
||||
list(APPEND ZLIB_LIBRARIES ${BZIP2_LIBRARIES})
|
||||
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(NOT OPENAL_FOUND)
|
||||
set(WITH_OPENAL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
||||
# Prefer lib directory paths
|
||||
@@ -72,15 +42,22 @@ if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Find precompiled libraries, and avoid system or user-installed ones.
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_begin()
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(OPENAL_FOUND)
|
||||
set(WITH_OPENAL ON)
|
||||
else()
|
||||
set(WITH_OPENAL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_ALEMBIC)
|
||||
find_package(Alembic)
|
||||
set(ALEMBIC ${LIBDIR}/alembic)
|
||||
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
|
||||
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
|
||||
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
|
||||
set(ALEMBIC_LIBRARIES Alembic)
|
||||
set(ALEMBIC_FOUND ON)
|
||||
endif()
|
||||
|
||||
if(WITH_USD)
|
||||
@@ -91,38 +68,30 @@ if(WITH_USD)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
find_package(OpenSubdiv)
|
||||
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
|
||||
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
|
||||
find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
|
||||
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
|
||||
list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
find_library(JACK_FRAMEWORK
|
||||
NAMES jackmp
|
||||
)
|
||||
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
|
||||
if(NOT JACK_FRAMEWORK)
|
||||
set(WITH_JACK OFF)
|
||||
else()
|
||||
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
find_package(SndFile)
|
||||
find_library(_sndfile_FLAC_LIBRARY NAMES flac HINTS ${LIBDIR}/sndfile/lib)
|
||||
find_library(_sndfile_OGG_LIBRARY NAMES ogg HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
list(APPEND LIBSNDFILE_LIBRARIES
|
||||
${_sndfile_FLAC_LIBRARY}
|
||||
${_sndfile_OGG_LIBRARY}
|
||||
${_sndfile_VORBIS_LIBRARY}
|
||||
${_sndfile_VORBISENC_LIBRARY}
|
||||
)
|
||||
|
||||
print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
|
||||
unset(_sndfile_FLAC_LIBRARY)
|
||||
unset(_sndfile_OGG_LIBRARY)
|
||||
unset(_sndfile_VORBIS_LIBRARY)
|
||||
unset(_sndfile_VORBISENC_LIBRARY)
|
||||
set(LIBSNDFILE ${LIBDIR}/sndfile)
|
||||
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
|
||||
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
@@ -161,27 +130,54 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
find_package(Fftw3)
|
||||
set(FFTW3 ${LIBDIR}/fftw3)
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
||||
set(FFTW3_LIBRARIES fftw3)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
endif()
|
||||
|
||||
find_package(Freetype REQUIRED)
|
||||
set(ZLIB /usr)
|
||||
set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
|
||||
set(ZLIB_LIBRARIES z bz2)
|
||||
|
||||
set(PNG_LIBRARIES png ${ZLIB_LIBRARIES})
|
||||
set(JPEG_LIBRARIES jpeg)
|
||||
|
||||
set(FREETYPE ${LIBDIR}/freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
set(FREETYPE_LIBRARY freetype)
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
find_package(OpenEXR)
|
||||
set(OPENEXR ${LIBDIR}/openexr)
|
||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
|
||||
set(OPENEXR_LIBRARIES
|
||||
Iex
|
||||
Half
|
||||
IlmImf
|
||||
Imath
|
||||
IlmThread)
|
||||
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG_FIND_COMPONENTS
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
||||
set(FFMPEG_LIBRARIES
|
||||
avcodec avdevice avformat avutil
|
||||
mp3lame ogg opus swresample swscale
|
||||
theora theoradec theoraenc vorbis vorbisenc
|
||||
vorbisfile vpx x264 xvidcore)
|
||||
find_package(FFmpeg)
|
||||
mp3lame swscale x264 xvidcore
|
||||
theora theoradec theoraenc
|
||||
vorbis vorbisenc vorbisfile ogg opus
|
||||
vpx swresample)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
|
||||
# use openjpeg from libdir that is linked into ffmpeg
|
||||
find_package(OpenJPEG)
|
||||
set(OPENJPEG ${LIBDIR}/openjpeg)
|
||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
|
||||
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
|
||||
endif()
|
||||
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
@@ -211,58 +207,77 @@ if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
find_package(OpenCOLLADA)
|
||||
find_library(PCRE_LIBRARIES NAMES pcre HINTS ${LIBDIR}/opencollada/lib)
|
||||
find_library(XML2_LIBRARIES NAMES xml2 HINTS ${LIBDIR}/opencollada/lib)
|
||||
print_found_status("PCRE" "${PCRE_LIBRARIES}")
|
||||
print_found_status("XML2" "${XML2_LIBRARIES}")
|
||||
set(OPENCOLLADA ${LIBDIR}/opencollada)
|
||||
|
||||
set(OPENCOLLADA_INCLUDE_DIRS
|
||||
${LIBDIR}/opencollada/include/COLLADAStreamWriter
|
||||
${LIBDIR}/opencollada/include/COLLADABaseUtils
|
||||
${LIBDIR}/opencollada/include/COLLADAFramework
|
||||
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
|
||||
${LIBDIR}/opencollada/include/GeneratedSaxParser
|
||||
)
|
||||
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIBRARIES
|
||||
OpenCOLLADASaxFrameworkLoader
|
||||
-lOpenCOLLADAFramework
|
||||
-lOpenCOLLADABaseUtils
|
||||
-lOpenCOLLADAStreamWriter
|
||||
-lMathMLSolver
|
||||
-lGeneratedSaxParser
|
||||
-lbuffer -lftoa -lUTF
|
||||
)
|
||||
# PCRE and XML2 are bundled with OpenCollada.
|
||||
set(PCRE_LIBRARIES pcre)
|
||||
set(XML2_LIBRARIES xml2)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
find_package(SDL2)
|
||||
set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIRS})
|
||||
set(SDL_LIBRARY ${SDL2_LIBRARIES})
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
|
||||
endif()
|
||||
|
||||
set(PNG_ROOT ${LIBDIR}/png)
|
||||
find_package(PNG REQUIRED)
|
||||
set(PNG "${LIBDIR}/png")
|
||||
set(PNG_INCLUDE_DIRS "${PNG}/include")
|
||||
set(PNG_LIBPATH ${PNG}/lib)
|
||||
|
||||
set(JPEG_ROOT ${LIBDIR}/jpeg)
|
||||
find_package(JPEG REQUIRED)
|
||||
set(JPEG "${LIBDIR}/jpeg")
|
||||
set(JPEG_INCLUDE_DIR "${JPEG}/include")
|
||||
set(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
set(TIFF_ROOT ${LIBDIR}/tiff)
|
||||
find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
message(WARNING "TIFF not found, disabling WITH_IMAGE_TIFF")
|
||||
set(WITH_IMAGE_TIFF OFF)
|
||||
endif()
|
||||
set(TIFF ${LIBDIR}/tiff)
|
||||
set(TIFF_INCLUDE_DIR ${TIFF}/include)
|
||||
set(TIFF_LIBRARY tiff)
|
||||
set(TIFF_LIBPATH ${TIFF}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_BOOST)
|
||||
set(Boost_NO_BOOST_CMAKE ON)
|
||||
set(BOOST_ROOT ${LIBDIR}/boost)
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
set(_boost_FIND_COMPONENTS date_time filesystem regex system thread wave)
|
||||
set(BOOST ${LIBDIR}/boost)
|
||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||
set(BOOST_POSTFIX)
|
||||
set(BOOST_LIBRARIES
|
||||
boost_date_time${BOOST_POSTFIX}
|
||||
boost_filesystem${BOOST_POSTFIX}
|
||||
boost_regex${BOOST_POSTFIX}
|
||||
boost_system${BOOST_POSTFIX}
|
||||
boost_thread${BOOST_POSTFIX}
|
||||
boost_wave${BOOST_POSTFIX}
|
||||
)
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND _boost_FIND_COMPONENTS locale)
|
||||
list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
|
||||
endif()
|
||||
if(WITH_CYCLES_NETWORK)
|
||||
list(APPEND _boost_FIND_COMPONENTS serialization)
|
||||
list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
|
||||
endif()
|
||||
if(WITH_OPENVDB)
|
||||
list(APPEND _boost_FIND_COMPONENTS iostreams)
|
||||
list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
|
||||
endif()
|
||||
find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
|
||||
|
||||
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
|
||||
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
|
||||
set(BOOST_LIBPATH ${BOOST}/lib)
|
||||
set(BOOST_DEFINITIONS)
|
||||
|
||||
mark_as_advanced(Boost_LIBRARIES)
|
||||
mark_as_advanced(Boost_INCLUDE_DIRS)
|
||||
unset(_boost_FIND_COMPONENTS)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
||||
@@ -270,8 +285,10 @@ if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
find_package(OpenImageIO)
|
||||
list(APPEND OPENIMAGEIO_LIBRARIES
|
||||
set(OPENIMAGEIO ${LIBDIR}/openimageio)
|
||||
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
|
||||
set(OPENIMAGEIO_LIBRARIES
|
||||
${OPENIMAGEIO}/lib/libOpenImageIO.a
|
||||
${PNG_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${TIFF_LIBRARY}
|
||||
@@ -279,30 +296,69 @@ if(WITH_OPENIMAGEIO)
|
||||
${OPENJPEG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
set(OPENIMAGEIO_LIBPATH
|
||||
${OPENIMAGEIO}/lib
|
||||
${JPEG_LIBPATH}
|
||||
${PNG_LIBPATH}
|
||||
${TIFF_LIBPATH}
|
||||
${OPENEXR_LIBPATH}
|
||||
${ZLIB_LIBPATH}
|
||||
)
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
|
||||
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
find_package(OpenColorIO)
|
||||
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
|
||||
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENVDB)
|
||||
find_package(OpenVDB)
|
||||
find_library(BLOSC_LIBRARIES NAMES blosc HINTS ${LIBDIR}/openvdb/lib)
|
||||
print_found_status("Blosc" "${BLOSC_LIBRARIES}")
|
||||
list(APPEND OPENVDB_LIBRARIES ${BLOSC_LIBRARIES})
|
||||
set(OPENVDB ${LIBDIR}/openvdb)
|
||||
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
|
||||
set(OPENVDB_LIBRARIES openvdb blosc)
|
||||
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
|
||||
set(OPENVDB_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(NANOVDB ${LIBDIR}/nanovdb)
|
||||
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
find_package(LLVM)
|
||||
if(NOT LLVM_FOUND)
|
||||
set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
|
||||
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
else()
|
||||
set(LLVM_CONFIG llvm-config)
|
||||
endif()
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --version
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --includedir
|
||||
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libdir
|
||||
OUTPUT_VARIABLE LLVM_LIBPATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
find_library(LLVM_LIBRARY
|
||||
NAMES LLVMAnalysis # first of a whole bunch of libs to get
|
||||
PATHS ${LLVM_LIBPATH})
|
||||
|
||||
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
||||
if(LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
# way for LLVM_LIBRARY.
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||
else()
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "LLVM not found.")
|
||||
endif()
|
||||
endif()
|
||||
@@ -335,10 +391,7 @@ endif()
|
||||
|
||||
if(WITH_CYCLES_EMBREE)
|
||||
find_package(Embree 3.8.0 REQUIRED)
|
||||
# Increase stack size for Embree, only works for executables.
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
|
||||
endif()
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
|
||||
|
||||
# Embree static library linking can mix up SSE and AVX symbols, causing
|
||||
# crashes on macOS systems with older CPUs that don't have AVX. Using
|
||||
@@ -374,7 +427,7 @@ endif()
|
||||
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
||||
@@ -384,22 +437,14 @@ if(WITH_OPENMP)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
|
||||
|
||||
# Copy libomp.dylib to allow executables like datatoc and tests to work.
|
||||
# `@executable_path/../Resources/lib/` is a default dylib search path.
|
||||
# For single config generator datatoc, tests etc.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
|
||||
)
|
||||
# For multi-config generator datatoc, etc.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
|
||||
)
|
||||
# For multi-config generator tests.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -419,13 +464,6 @@ if(WITH_GMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Set compiler and linker flags.
|
||||
|
||||
set(EXETYPE MACOSX_BUNDLE)
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
|
@@ -264,7 +264,6 @@ endif()
|
||||
if(WITH_OPENVDB)
|
||||
find_package_wrapper(OpenVDB)
|
||||
find_package_wrapper(Blosc)
|
||||
|
||||
if(NOT OPENVDB_FOUND)
|
||||
set(WITH_OPENVDB OFF)
|
||||
set(WITH_OPENVDB_BLOSC OFF)
|
||||
@@ -275,15 +274,6 @@ if(WITH_OPENVDB)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
find_package_wrapper(NanoVDB)
|
||||
|
||||
if(NOT NANOVDB_FOUND)
|
||||
set(WITH_NANOVDB OFF)
|
||||
message(STATUS "NanoVDB not found, disabling it")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_ALEMBIC)
|
||||
find_package_wrapper(Alembic)
|
||||
|
||||
|
@@ -535,11 +535,6 @@ if(WITH_OPENVDB)
|
||||
set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(NANOVDB ${LIBDIR}/nanoVDB)
|
||||
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
|
||||
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
|
||||
@@ -720,24 +715,14 @@ if(WINDOWS_PYTHON_DEBUG)
|
||||
string(REPLACE "/" "\\" _group_path "${_source_path}")
|
||||
source_group("${_group_path}" FILES "${_source}")
|
||||
endforeach()
|
||||
|
||||
# If the user scripts env var is set, include scripts from there otherwise
|
||||
# include user scripts in the profile folder.
|
||||
if(DEFINED ENV{BLENDER_USER_SCRIPTS})
|
||||
message(STATUS "Including user scripts from environment BLENDER_USER_SCRIPTS=$ENV{BLENDER_USER_SCRIPTS}")
|
||||
set(USER_SCRIPTS_ROOT "$ENV{BLENDER_USER_SCRIPTS}")
|
||||
else()
|
||||
message(STATUS "Including user scripts from the profile folder")
|
||||
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
|
||||
set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}/scripts")
|
||||
endif()
|
||||
|
||||
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
|
||||
set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}")
|
||||
file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
|
||||
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
|
||||
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/scripts/*.*" )
|
||||
ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
|
||||
foreach(_source IN ITEMS ${inFiles})
|
||||
get_filename_component(_source_path "${_source}" PATH)
|
||||
string(REPLACE "${USER_SCRIPTS_ROOT}" "" _source_path "${_source_path}")
|
||||
string(REPLACE "${USER_SCRIPTS_ROOT}/scripts" "" _source_path "${_source_path}")
|
||||
string(REPLACE "/" "\\" _group_path "${_source_path}")
|
||||
source_group("${_group_path}" FILES "${_source}")
|
||||
endforeach()
|
||||
@@ -781,3 +766,4 @@ if(WITH_POTRACE)
|
||||
set(POTRACE_LIBRARIES ${LIBDIR}/potrace/lib/potrace.lib)
|
||||
set(POTRACE_FOUND On)
|
||||
endif()
|
||||
|
||||
|
@@ -25,7 +25,7 @@ __all__ = (
|
||||
|
||||
|
||||
import sys
|
||||
if sys.version_info.major < 3:
|
||||
if not sys.version_info.major < 3:
|
||||
print("\nPython3.x or newer needed, found %s.\nAborting!\n" %
|
||||
sys.version.partition(" ")[0])
|
||||
sys.exit(1)
|
||||
@@ -242,6 +242,5 @@ def main():
|
||||
for s in build_info():
|
||||
print(s)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -12,7 +12,6 @@ from make_utils import call
|
||||
|
||||
# Parse arguments
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--ctest-command", default="ctest")
|
||||
@@ -23,7 +22,6 @@ def parse_arguments():
|
||||
parser.add_argument("build_directory")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
args = parse_arguments()
|
||||
git_command = args.git_command
|
||||
svn_command = args.svn_command
|
||||
|
@@ -14,15 +14,12 @@ import sys
|
||||
import make_utils
|
||||
from make_utils import call, check_output
|
||||
|
||||
|
||||
def print_stage(text):
|
||||
print("")
|
||||
print(text)
|
||||
print("")
|
||||
|
||||
# Parse arguments
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--no-libraries", action="store_true")
|
||||
@@ -34,13 +31,10 @@ def parse_arguments():
|
||||
parser.add_argument("--use-centos-libraries", action="store_true")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def get_blender_git_root():
|
||||
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
|
||||
|
||||
# Setup for precompiled libraries and tests from svn.
|
||||
|
||||
|
||||
def svn_update(args, release_version):
|
||||
svn_non_interactive = [args.svn_command, '--non-interactive']
|
||||
|
||||
@@ -92,32 +86,30 @@ def svn_update(args, release_version):
|
||||
print_stage("Updating Precompiled Libraries and Tests")
|
||||
|
||||
if os.path.isdir(lib_dirpath):
|
||||
for dirname in os.listdir(lib_dirpath):
|
||||
dirpath = os.path.join(lib_dirpath, dirname)
|
||||
for dirname in os.listdir(lib_dirpath):
|
||||
dirpath = os.path.join(lib_dirpath, dirname)
|
||||
|
||||
if dirname == ".svn":
|
||||
# Cleanup must be run from svn root directory if it exists.
|
||||
if not make_utils.command_missing(args.svn_command):
|
||||
call(svn_non_interactive + ["cleanup", lib_dirpath])
|
||||
continue
|
||||
if dirname == ".svn":
|
||||
# Cleanup must be run from svn root directory if it exists.
|
||||
if not make_utils.command_missing(args.svn_command):
|
||||
call(svn_non_interactive + ["cleanup", lib_dirpath])
|
||||
continue
|
||||
|
||||
svn_dirpath = os.path.join(dirpath, ".svn")
|
||||
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
|
||||
svn_dirpath = os.path.join(dirpath, ".svn")
|
||||
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
|
||||
|
||||
if (
|
||||
os.path.isdir(dirpath) and
|
||||
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
|
||||
):
|
||||
if make_utils.command_missing(args.svn_command):
|
||||
sys.stderr.write("svn not found, can't update libraries\n")
|
||||
sys.exit(1)
|
||||
if os.path.isdir(dirpath) and \
|
||||
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
|
||||
if make_utils.command_missing(args.svn_command):
|
||||
sys.stderr.write("svn not found, can't update libraries\n")
|
||||
sys.exit(1)
|
||||
|
||||
# Cleanup to continue with interrupted downloads.
|
||||
if os.path.exists(svn_dirpath):
|
||||
call(svn_non_interactive + ["cleanup", dirpath])
|
||||
# Switch to appropriate branch and update.
|
||||
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
|
||||
call(svn_non_interactive + ["update", dirpath])
|
||||
# Cleanup to continue with interrupted downloads.
|
||||
if os.path.exists(svn_dirpath):
|
||||
call(svn_non_interactive + ["cleanup", dirpath])
|
||||
# Switch to appropriate branch and update.
|
||||
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
|
||||
call(svn_non_interactive + ["update", dirpath])
|
||||
|
||||
# Test if git repo can be updated.
|
||||
def git_update_skip(args, check_remote_exists=True):
|
||||
@@ -129,11 +121,9 @@ def git_update_skip(args, check_remote_exists=True):
|
||||
rebase_merge = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-merge'], exit_on_error=False)
|
||||
rebase_apply = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-apply'], exit_on_error=False)
|
||||
merge_head = check_output([args.git_command, 'rev-parse', '--git-path', 'MERGE_HEAD'], exit_on_error=False)
|
||||
if (
|
||||
os.path.exists(rebase_merge) or
|
||||
os.path.exists(rebase_apply) or
|
||||
os.path.exists(merge_head)
|
||||
):
|
||||
if os.path.exists(rebase_merge) or \
|
||||
os.path.exists(rebase_apply) or \
|
||||
os.path.exists(merge_head):
|
||||
return "rebase or merge in progress, complete it first"
|
||||
|
||||
# Abort if uncommitted changes.
|
||||
@@ -143,14 +133,13 @@ def git_update_skip(args, check_remote_exists=True):
|
||||
|
||||
# Test if there is an upstream branch configured
|
||||
if check_remote_exists:
|
||||
branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
|
||||
remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
|
||||
if len(remote) == 0:
|
||||
return "no remote branch to pull from"
|
||||
branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
|
||||
remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
|
||||
if len(remote) == 0:
|
||||
return "no remote branch to pull from"
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
# Update blender repository.
|
||||
def blender_update(args):
|
||||
print_stage("Updating Blender Git Repository")
|
||||
@@ -189,7 +178,7 @@ def submodules_update(args, release_version, branch):
|
||||
os.chdir(submodule_path)
|
||||
msg = git_update_skip(args, check_remote_exists=False)
|
||||
if msg:
|
||||
skip_msg += submodule_path + " skipped: " + msg + "\n"
|
||||
skip_msg += submodule_path + " skipped: " + msg + "\n"
|
||||
else:
|
||||
if make_utils.git_branch(args.git_command) != submodule_branch:
|
||||
call([args.git_command, "fetch", "origin"])
|
||||
|
@@ -7,7 +7,6 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def call(cmd, exit_on_error=True):
|
||||
print(" ".join(cmd))
|
||||
|
||||
@@ -20,7 +19,6 @@ def call(cmd, exit_on_error=True):
|
||||
sys.exit(retcode)
|
||||
return retcode
|
||||
|
||||
|
||||
def check_output(cmd, exit_on_error=True):
|
||||
# Flush to ensure correct order output on Windows.
|
||||
sys.stdout.flush()
|
||||
@@ -37,7 +35,6 @@ def check_output(cmd, exit_on_error=True):
|
||||
|
||||
return output.strip()
|
||||
|
||||
|
||||
def git_branch(git_command):
|
||||
# Get current branch name.
|
||||
try:
|
||||
@@ -48,7 +45,6 @@ def git_branch(git_command):
|
||||
|
||||
return branch.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_tag(git_command):
|
||||
# Get current tag name.
|
||||
try:
|
||||
@@ -58,18 +54,16 @@ def git_tag(git_command):
|
||||
|
||||
return tag.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_branch_release_version(branch, tag):
|
||||
release_version = re.search("^blender-v(.*)-release$", branch)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
elif tag:
|
||||
release_version = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
|
||||
release_version = re.search("^v([0-9]*\.[0-9]*).*", tag)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
return release_version
|
||||
|
||||
|
||||
def svn_libraries_base_url(release_version):
|
||||
if release_version:
|
||||
svn_branch = "tags/blender-" + release_version + "-release"
|
||||
@@ -77,7 +71,6 @@ def svn_libraries_base_url(release_version):
|
||||
svn_branch = "trunk"
|
||||
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
|
||||
|
||||
|
||||
def command_missing(command):
|
||||
# Support running with Python 2 for macOS
|
||||
if sys.version_info >= (3, 0):
|
||||
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.92"
|
||||
PROJECT_NUMBER = "V2.91"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
Introduction
|
||||
------------
|
||||
Intro
|
||||
-----
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -9,8 +9,9 @@ Introduction
|
||||
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
|
||||
should only be used in rare, specific cases (like e.g. complex "composited" UI strings...).
|
||||
|
||||
To add translations to your python script, you must define a dictionary formatted like that:
|
||||
``{locale: {msg_key: msg_translation, ...}, ...}`` where:
|
||||
| To add translations to your python script, you must define a dictionary formatted like that:
|
||||
| ``{locale: {msg_key: msg_translation, ...}, ...}``
|
||||
| where:
|
||||
|
||||
- locale is either a lang iso code (e.g. ``fr``), a lang+country code (e.g. ``pt_BR``),
|
||||
a lang+variant code (e.g. ``sr@latin``), or a full code (e.g. ``uz_UZ@cyrilic``).
|
||||
|
@@ -9,24 +9,15 @@ When calling an operator you may want to pass the execution context.
|
||||
This determines the context that is given for the operator to run in, and whether
|
||||
invoke() is called or only execute().
|
||||
|
||||
``EXEC_DEFAULT`` is used by default, running only the ``execute()`` method, but you may
|
||||
want the operator to take user interaction with ``INVOKE_DEFAULT`` which will also
|
||||
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
|
||||
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
|
||||
call invoke() if existing.
|
||||
|
||||
The execution context is one of:
|
||||
|
||||
- ``INVOKE_DEFAULT``
|
||||
- ``INVOKE_REGION_WIN``
|
||||
- ``INVOKE_REGION_CHANNELS``
|
||||
- ``INVOKE_REGION_PREVIEW``
|
||||
- ``INVOKE_AREA``
|
||||
- ``INVOKE_SCREEN``
|
||||
- ``EXEC_DEFAULT``
|
||||
- ``EXEC_REGION_WIN``
|
||||
- ``EXEC_REGION_CHANNELS``
|
||||
- ``EXEC_REGION_PREVIEW``
|
||||
- ``EXEC_AREA``
|
||||
- ``EXEC_SCREEN``
|
||||
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
|
||||
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
|
||||
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
|
||||
'EXEC_SCREEN')
|
||||
"""
|
||||
|
||||
# collection add popup
|
||||
|
@@ -33,12 +33,11 @@ fragment_shader = '''
|
||||
uniform float u_Scale;
|
||||
|
||||
in float v_ArcLength;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
|
||||
FragColor = vec4(1.0);
|
||||
gl_FragColor = vec4(1.0);
|
||||
}
|
||||
'''
|
||||
|
||||
|
@@ -23,11 +23,10 @@ fragment_shader = '''
|
||||
uniform float brightness;
|
||||
|
||||
in vec3 pos;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(pos * brightness, 1.0);
|
||||
gl_FragColor = vec4(pos * brightness, 1.0);
|
||||
}
|
||||
'''
|
||||
|
||||
|
@@ -56,11 +56,10 @@ fragment_shader = '''
|
||||
uniform sampler2D image;
|
||||
|
||||
in vec2 uvInterp;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = texture(image, uvInterp);
|
||||
gl_FragColor = texture(image, uvInterp);
|
||||
}
|
||||
'''
|
||||
|
||||
|
36
doc/python_api/examples/gpu.shader.py
Normal file
36
doc/python_api/examples/gpu.shader.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""
|
||||
Built-in shaders
|
||||
++++++++++++++++
|
||||
|
||||
All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.
|
||||
The value of it can only be modified using the :class:`gpu.matrix` module.
|
||||
|
||||
2D_UNIFORM_COLOR:
|
||||
attributes: vec3 pos
|
||||
uniforms: vec4 color
|
||||
|
||||
2D_FLAT_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
2D_SMOOTH_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
2D_IMAGE:
|
||||
attributes: vec3 pos, vec2 texCoord
|
||||
uniforms: sampler2D image
|
||||
|
||||
3D_UNIFORM_COLOR:
|
||||
attributes: vec3 pos
|
||||
uniforms: vec4 color
|
||||
|
||||
3D_FLAT_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
3D_SMOOTH_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
"""
|
@@ -13,15 +13,16 @@ than enough material to teach OpenGL programming, from books to many
|
||||
collections of tutorials.
|
||||
|
||||
Here is a comprehensive `list of books <https://www.khronos.org/developers/books/>`__ (non free).
|
||||
`Learn OpenGL <https://learnopengl.com/>`__ is one of the best resources to learn modern OpenGL and
|
||||
`opengl-tutorial.org <http://www.opengl-tutorial.org/>`__ offers a set of extensive examples,
|
||||
including advanced features.
|
||||
The `arcsynthesis tutorials <https://web.archive.org/web/20150225192611/http://www.arcsynthesis.org/gltut/index.html>`__
|
||||
is one of the best resources to learn modern OpenGL and
|
||||
`g-truc <http://www.g-truc.net/post-opengl-samples.html#menu>`__
|
||||
offers a set of extensive examples, including advanced features.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
You can use the :class:`bpy.types.Image` type to load and set textures.
|
||||
See :class:`bpy.types.Image.gl_load` and :class:`bpy.types.Image.gl_free`,
|
||||
You can use the :class:`Image` type to load and set textures.
|
||||
See :class:`Image.gl_load` and :class:`Image.gl_free`,
|
||||
for example.
|
||||
|
||||
|
||||
@@ -29,7 +30,7 @@ including advanced features.
|
||||
|
||||
Bind a named texture to a texturing target
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBindTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBindTexture.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target to which the texture is bound.
|
||||
@@ -41,7 +42,7 @@ including advanced features.
|
||||
|
||||
Specify pixel arithmetic
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml>`__
|
||||
|
||||
:type sfactor: Enumerated constant
|
||||
:arg sfactor: Specifies how the red, green, blue, and alpha source blending factors are
|
||||
@@ -55,7 +56,7 @@ including advanced features.
|
||||
|
||||
Clear buffers to preset values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClear.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml>`__
|
||||
|
||||
:type mask: Enumerated constant(s)
|
||||
:arg mask: Bitwise OR of masks that indicate the buffers to be cleared.
|
||||
@@ -65,7 +66,7 @@ including advanced features.
|
||||
|
||||
Specify clear values for the color buffers
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearColor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: float
|
||||
:arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
|
||||
@@ -76,7 +77,7 @@ including advanced features.
|
||||
|
||||
Specify the clear value for the depth buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearDepth.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearDepth.xml>`__
|
||||
|
||||
:type depth: int
|
||||
:arg depth: Specifies the depth value used when the depth buffer is cleared.
|
||||
@@ -87,7 +88,7 @@ including advanced features.
|
||||
|
||||
Specify the clear value for the stencil buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearStencil.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearStencil.xml>`__
|
||||
|
||||
:type s: int
|
||||
:arg s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
|
||||
@@ -97,7 +98,7 @@ including advanced features.
|
||||
|
||||
Specify a plane against which all geometry is clipped
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClipPlane.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClipPlane.xml>`__
|
||||
|
||||
:type plane: Enumerated constant
|
||||
:arg plane: Specifies which clipping plane is being positioned.
|
||||
@@ -116,7 +117,7 @@ including advanced features.
|
||||
|
||||
Set a new color.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColor.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: Depends on function prototype.
|
||||
:arg red, green, blue: Specify new red, green, and blue values for the current color.
|
||||
@@ -128,7 +129,7 @@ including advanced features.
|
||||
|
||||
Enable and disable writing of frame buffer color components
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColorMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColorMask.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: int (boolean)
|
||||
:arg red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
|
||||
@@ -140,7 +141,7 @@ including advanced features.
|
||||
|
||||
Copy pixels into a 2D texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCopyTexImage2D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCopyTexImage2D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -169,7 +170,7 @@ including advanced features.
|
||||
|
||||
Specify whether front- or back-facing facets can be culled
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCullFace.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCullFace.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies whether front- or back-facing facets are candidates for culling.
|
||||
@@ -179,7 +180,7 @@ including advanced features.
|
||||
|
||||
Delete named textures
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteTextures.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteTextures.xml>`__
|
||||
|
||||
:type n: int
|
||||
:arg n: Specifies the number of textures to be deleted
|
||||
@@ -191,7 +192,7 @@ including advanced features.
|
||||
|
||||
Specify the value used for depth buffer comparisons
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthFunc.xml>`__
|
||||
|
||||
:type func: Enumerated constant
|
||||
:arg func: Specifies the depth comparison function.
|
||||
@@ -201,7 +202,7 @@ including advanced features.
|
||||
|
||||
Enable or disable writing into the depth buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthMask.xml>`__
|
||||
|
||||
:type flag: int (boolean)
|
||||
:arg flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
|
||||
@@ -213,7 +214,7 @@ including advanced features.
|
||||
|
||||
Specify mapping of depth values from normalized device coordinates to window coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthRange.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthRange.xml>`__
|
||||
|
||||
:type zNear: int
|
||||
:arg zNear: Specifies the mapping of the near clipping plane to window coordinates.
|
||||
@@ -227,7 +228,7 @@ including advanced features.
|
||||
|
||||
Disable server-side GL capabilities
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a symbolic constant indicating a GL capability.
|
||||
@@ -237,7 +238,7 @@ including advanced features.
|
||||
|
||||
Specify which color buffers are to be drawn into
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDrawBuffer.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies up to four color buffers to be drawn into.
|
||||
@@ -249,7 +250,7 @@ including advanced features.
|
||||
|
||||
Flag edges as either boundary or non-boundary
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEdgeFlag.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEdgeFlag.xml>`__
|
||||
|
||||
:type flag: Depends of function prototype
|
||||
:arg flag: Specifies the current edge flag value.The initial value is GL_TRUE.
|
||||
@@ -259,7 +260,7 @@ including advanced features.
|
||||
|
||||
Enable server-side GL capabilities
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a symbolic constant indicating a GL capability.
|
||||
@@ -272,7 +273,7 @@ including advanced features.
|
||||
|
||||
Evaluate enabled one- and two-dimensional maps
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalCoord.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalCoord.xml>`__
|
||||
|
||||
:type u: Depends on function prototype.
|
||||
:arg u: Specifies a value that is the domain coordinate u to the basis function defined
|
||||
@@ -290,7 +291,7 @@ including advanced features.
|
||||
|
||||
Compute a one- or two-dimensional grid of points or lines
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalMesh.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalMesh.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: In glEvalMesh1, specifies whether to compute a one-dimensional
|
||||
@@ -305,7 +306,7 @@ including advanced features.
|
||||
|
||||
Generate and evaluate a single point in a mesh
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalPoint.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalPoint.xml>`__
|
||||
|
||||
:type i: int
|
||||
:arg i: Specifies the integer value for grid domain variable i.
|
||||
@@ -317,7 +318,7 @@ including advanced features.
|
||||
|
||||
Controls feedback mode
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFeedbackBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFeedbackBuffer.xml>`__
|
||||
|
||||
:type size: int
|
||||
:arg size: Specifies the maximum number of values that can be written into buffer.
|
||||
@@ -332,14 +333,14 @@ including advanced features.
|
||||
|
||||
Block until all GL execution is complete
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFinish.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFinish.xml>`__
|
||||
|
||||
|
||||
.. function:: glFlush():
|
||||
|
||||
Force Execution of GL commands in finite time
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFlush.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFlush.xml>`__
|
||||
|
||||
|
||||
.. function:: glFog (pname, param):
|
||||
@@ -348,7 +349,7 @@ including advanced features.
|
||||
|
||||
Specify fog parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFog.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies a single-valued fog parameter. If the function prototype
|
||||
@@ -363,7 +364,7 @@ including advanced features.
|
||||
|
||||
Define front- and back-facing polygons
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFrontFace.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies the orientation of front-facing polygons.
|
||||
@@ -373,7 +374,7 @@ including advanced features.
|
||||
|
||||
Generate texture names
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGenTextures.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGenTextures.xml>`__
|
||||
|
||||
:type n: int
|
||||
:arg n: Specifies the number of textures name to be generated.
|
||||
@@ -387,7 +388,7 @@ including advanced features.
|
||||
|
||||
Return the value or values of a selected parameter
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the parameter value to be returned.
|
||||
@@ -399,7 +400,7 @@ including advanced features.
|
||||
|
||||
Return error information
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetError.xml>`__
|
||||
|
||||
|
||||
.. function:: glGetLight (light, pname, params):
|
||||
@@ -408,7 +409,7 @@ including advanced features.
|
||||
|
||||
Return light source parameter values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetLight.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetLight.xml>`__
|
||||
|
||||
:type light: Enumerated constant
|
||||
:arg light: Specifies a light source. The number of possible lights depends on the
|
||||
@@ -426,7 +427,7 @@ including advanced features.
|
||||
|
||||
Return evaluator parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMap.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of a map.
|
||||
@@ -442,7 +443,7 @@ including advanced features.
|
||||
|
||||
Return material parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMaterial.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMaterial.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies which of the two materials is being queried.
|
||||
@@ -459,7 +460,7 @@ including advanced features.
|
||||
|
||||
Return the specified pixel map
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetPixelMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`__
|
||||
|
||||
:type map: Enumerated constant
|
||||
:arg map: Specifies the name of the pixel map to return.
|
||||
@@ -471,7 +472,7 @@ including advanced features.
|
||||
|
||||
Return a string describing the current GL connection
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetString.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml>`__
|
||||
|
||||
:type name: Enumerated constant
|
||||
:arg name: Specifies a symbolic constant.
|
||||
@@ -484,7 +485,7 @@ including advanced features.
|
||||
|
||||
Return texture environment parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexEnv.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexEnv.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
|
||||
@@ -500,7 +501,7 @@ including advanced features.
|
||||
|
||||
Return texture coordinate generation parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexGen.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexGen.xml>`__
|
||||
|
||||
:type coord: Enumerated constant
|
||||
:arg coord: Specifies a texture coordinate.
|
||||
@@ -514,7 +515,7 @@ including advanced features.
|
||||
|
||||
Return a texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexImage.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexImage.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies which texture is to be obtained.
|
||||
@@ -536,7 +537,7 @@ including advanced features.
|
||||
|
||||
return texture parameter values for a specific level of detail
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexLevelParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexLevelParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of the target texture.
|
||||
@@ -555,7 +556,7 @@ including advanced features.
|
||||
|
||||
Return texture parameter values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of the target texture.
|
||||
@@ -569,7 +570,7 @@ including advanced features.
|
||||
|
||||
Specify implementation-specific hints
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glHint.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glHint.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a symbolic constant indicating the behavior to be
|
||||
@@ -582,7 +583,7 @@ including advanced features.
|
||||
|
||||
Test whether a capability is enabled
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsEnabled.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsEnabled.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a constant representing a GL capability.
|
||||
@@ -592,7 +593,7 @@ including advanced features.
|
||||
|
||||
Determine if a name corresponds to a texture
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsTexture.xml>`__
|
||||
|
||||
:type texture: unsigned int
|
||||
:arg texture: Specifies a value that may be the name of a texture.
|
||||
@@ -604,7 +605,7 @@ including advanced features.
|
||||
|
||||
Set the light source parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLight.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml>`__
|
||||
|
||||
:type light: Enumerated constant
|
||||
:arg light: Specifies a light. The number of lights depends on the implementation,
|
||||
@@ -624,7 +625,7 @@ including advanced features.
|
||||
|
||||
Set the lighting model parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLightModel.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLightModel.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies a single-value light model parameter.
|
||||
@@ -637,7 +638,7 @@ including advanced features.
|
||||
|
||||
Specify the width of rasterized lines.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLineWidth.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLineWidth.xml>`__
|
||||
|
||||
:type width: float
|
||||
:arg width: Specifies the width of rasterized lines. The initial value is 1.
|
||||
@@ -649,7 +650,7 @@ including advanced features.
|
||||
|
||||
Replace the current matrix with the specified matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLoadMatrix.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLoadMatrix.xml>`__
|
||||
|
||||
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
|
||||
:arg m: Specifies a pointer to 16 consecutive values, which are used as the elements
|
||||
@@ -660,7 +661,7 @@ including advanced features.
|
||||
|
||||
Specify a logical pixel operation for color index rendering
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLogicOp.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLogicOp.xml>`__
|
||||
|
||||
:type opcode: Enumerated constant
|
||||
:arg opcode: Specifies a symbolic constant that selects a logical operation.
|
||||
@@ -672,7 +673,7 @@ including advanced features.
|
||||
|
||||
Define a one-dimensional evaluator
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap1.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap1.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the kind of values that are generated by the evaluator.
|
||||
@@ -697,7 +698,7 @@ including advanced features.
|
||||
|
||||
Define a two-dimensional evaluator
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap2.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap2.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the kind of values that are generated by the evaluator.
|
||||
@@ -738,7 +739,7 @@ including advanced features.
|
||||
|
||||
Define a one- or two-dimensional mesh
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMapGrid.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMapGrid.xml>`__
|
||||
|
||||
:type un: int
|
||||
:arg un: Specifies the number of partitions in the grid range interval
|
||||
@@ -757,7 +758,7 @@ including advanced features.
|
||||
|
||||
Specify material parameters for the lighting model.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMaterial.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMaterial.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies which face or faces are being updated. Must be one of:
|
||||
@@ -776,7 +777,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix with the specified matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMultMatrix.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml>`__
|
||||
|
||||
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
|
||||
:arg m: Points to 16 consecutive values that are used as the elements of a 4x4 column
|
||||
@@ -790,7 +791,7 @@ including advanced features.
|
||||
|
||||
Set the current normal vector
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glNormal.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glNormal.xml>`__
|
||||
|
||||
:type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
|
||||
:arg nx, ny, nz: Specify the x, y, and z coordinates of the new current normal.
|
||||
@@ -806,7 +807,7 @@ including advanced features.
|
||||
|
||||
Set up pixel transfer maps
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelMap.xml>`__
|
||||
|
||||
:type map: Enumerated constant
|
||||
:arg map: Specifies a symbolic map name.
|
||||
@@ -822,7 +823,7 @@ including advanced features.
|
||||
|
||||
Set pixel storage modes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelStore.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelStore.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the symbolic name of the parameter to be set.
|
||||
@@ -838,7 +839,7 @@ including advanced features.
|
||||
|
||||
Set pixel transfer modes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelTransfer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelTransfer.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the symbolic name of the pixel transfer parameter to be set.
|
||||
@@ -850,7 +851,7 @@ including advanced features.
|
||||
|
||||
Specify the diameter of rasterized points
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPointSize.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPointSize.xml>`__
|
||||
|
||||
:type size: float
|
||||
:arg size: Specifies the diameter of rasterized points. The initial value is 1.
|
||||
@@ -860,7 +861,7 @@ including advanced features.
|
||||
|
||||
Select a polygon rasterization mode
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonMode.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies the polygons that mode applies to.
|
||||
@@ -875,7 +876,7 @@ including advanced features.
|
||||
|
||||
Set the scale and units used to calculate depth values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonOffset.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonOffset.xml>`__
|
||||
|
||||
:type factor: float
|
||||
:arg factor: Specifies a scale factor that is used to create a variable depth
|
||||
@@ -895,7 +896,7 @@ including advanced features.
|
||||
|
||||
Specify the raster position for pixel operations
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRasterPos.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRasterPos.xml>`__
|
||||
|
||||
:type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
|
||||
:arg x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the
|
||||
@@ -927,7 +928,7 @@ including advanced features.
|
||||
|
||||
Select a color buffer source for pixels.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadBuffer.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies a color buffer.
|
||||
@@ -937,7 +938,7 @@ including advanced features.
|
||||
|
||||
Read a block of pixels from the frame buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadPixels.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the window coordinates of the first pixel that is read
|
||||
@@ -960,7 +961,7 @@ including advanced features.
|
||||
|
||||
Draw a rectangle
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRect.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml>`__
|
||||
|
||||
:type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
|
||||
:arg x1, y1: Specify one vertex of a rectangle
|
||||
@@ -977,7 +978,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a rotation matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRotate.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml>`__
|
||||
|
||||
:type angle: Depends on function prototype.
|
||||
:arg angle: Specifies the angle of rotation in degrees.
|
||||
@@ -991,7 +992,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a general scaling matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScale.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml>`__
|
||||
|
||||
:type x, y, z: Depends on function prototype.
|
||||
:arg x, y, z: Specify scale factors along the x, y, and z axes, respectively.
|
||||
@@ -1001,7 +1002,7 @@ including advanced features.
|
||||
|
||||
Define the scissor box
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScissor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScissor.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
|
||||
@@ -1015,7 +1016,7 @@ including advanced features.
|
||||
|
||||
Set function and reference value for stencil testing
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xml>`__
|
||||
|
||||
:type func: Enumerated constant
|
||||
:arg func: Specifies the test function.
|
||||
@@ -1032,7 +1033,7 @@ including advanced features.
|
||||
|
||||
Control the writing of individual bits in the stencil planes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilMask.xml>`__
|
||||
|
||||
:type mask: unsigned int
|
||||
:arg mask: Specifies a bit mask to enable and disable writing of individual bits
|
||||
@@ -1043,7 +1044,7 @@ including advanced features.
|
||||
|
||||
Set stencil test actions
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilOp.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilOp.xml>`__
|
||||
|
||||
:type fail: Enumerated constant
|
||||
:arg fail: Specifies the action to take when the stencil test fails.
|
||||
@@ -1071,7 +1072,7 @@ including advanced features.
|
||||
|
||||
Set the current texture coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexCoord.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexCoord.xml>`__
|
||||
|
||||
:type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
|
||||
:arg s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are
|
||||
@@ -1087,7 +1088,7 @@ including advanced features.
|
||||
|
||||
Set texture environment parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexEnv.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
|
||||
@@ -1106,7 +1107,7 @@ including advanced features.
|
||||
|
||||
Control the generation of texture coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexGen.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml>`__
|
||||
|
||||
:type coord: Enumerated constant
|
||||
:arg coord: Specifies a texture coordinate.
|
||||
@@ -1124,7 +1125,7 @@ including advanced features.
|
||||
|
||||
Specify a one-dimensional texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage1D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage1D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1151,7 +1152,7 @@ including advanced features.
|
||||
|
||||
Specify a two-dimensional texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1184,7 +1185,7 @@ including advanced features.
|
||||
|
||||
Set texture parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1201,7 +1202,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a translation matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTranslate.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml>`__
|
||||
|
||||
:type x, y, z: Depends on function prototype.
|
||||
:arg x, y, z: Specify the x, y, and z coordinates of a translation vector.
|
||||
@@ -1211,7 +1212,7 @@ including advanced features.
|
||||
|
||||
Set the viewport
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glViewport.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the lower left corner of the viewport rectangle,
|
||||
@@ -1226,7 +1227,7 @@ including advanced features.
|
||||
|
||||
Installs a program object as part of current rendering state
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glUseProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glUseProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object whose executables are to be used as part of current rendering state.
|
||||
@@ -1236,7 +1237,7 @@ including advanced features.
|
||||
|
||||
Validates a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glValidateProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glValidateProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object to be validated.
|
||||
@@ -1246,7 +1247,7 @@ including advanced features.
|
||||
|
||||
Links a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLinkProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLinkProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object to be linked.
|
||||
@@ -1256,7 +1257,7 @@ including advanced features.
|
||||
|
||||
Select active texture unit.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glActiveTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml>`__
|
||||
|
||||
:type texture: int
|
||||
:arg texture: Constant in ``GL_TEXTURE0`` 0 - 8
|
||||
@@ -1266,7 +1267,7 @@ including advanced features.
|
||||
|
||||
Attaches a shader object to a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glAttachShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glAttachShader.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to which a shader object will be attached.
|
||||
@@ -1278,7 +1279,7 @@ including advanced features.
|
||||
|
||||
Compiles a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCompileShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCompileShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be compiled.
|
||||
@@ -1288,7 +1289,7 @@ including advanced features.
|
||||
|
||||
Creates a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateProgram.xml>`__
|
||||
|
||||
:rtype: int
|
||||
:return: The new program or zero if an error occurs.
|
||||
@@ -1298,7 +1299,7 @@ including advanced features.
|
||||
|
||||
Creates a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateShader.xml>`__
|
||||
|
||||
:type shaderType: Specifies the type of shader to be created.
|
||||
Must be one of ``GL_VERTEX_SHADER``,
|
||||
@@ -1315,7 +1316,7 @@ including advanced features.
|
||||
|
||||
Deletes a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be deleted.
|
||||
@@ -1325,7 +1326,7 @@ including advanced features.
|
||||
|
||||
Deletes a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be deleted.
|
||||
@@ -1335,7 +1336,7 @@ including advanced features.
|
||||
|
||||
Detaches a shader object from a program object to which it is attached.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDetachShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDetachShader.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object from which to detach the shader object.
|
||||
@@ -1347,7 +1348,7 @@ including advanced features.
|
||||
|
||||
Returns the handles of the shader objects attached to a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetAttachedShaders.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetAttachedShaders.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be queried.
|
||||
@@ -1363,7 +1364,7 @@ including advanced features.
|
||||
|
||||
Returns the information log for a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgramInfoLog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgramInfoLog.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object whose information log is to be queried.
|
||||
@@ -1379,7 +1380,7 @@ including advanced features.
|
||||
|
||||
Returns the information log for a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderInfoLog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderInfoLog.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object whose information log is to be queried.
|
||||
@@ -1395,7 +1396,7 @@ including advanced features.
|
||||
|
||||
Returns a parameter from a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be queried.
|
||||
@@ -1409,7 +1410,7 @@ including advanced features.
|
||||
|
||||
Determines if a name corresponds to a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies a potential shader object.
|
||||
@@ -1419,7 +1420,7 @@ including advanced features.
|
||||
|
||||
Determines if a name corresponds to a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies a potential program object.
|
||||
@@ -1429,7 +1430,7 @@ including advanced features.
|
||||
|
||||
Returns the source code string from a shader object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderSource.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderSource.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be queried.
|
||||
|
@@ -5,6 +5,17 @@
|
||||
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
|
||||
|
||||
|
||||
Submodules:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
bmesh.ops.rst
|
||||
bmesh.types.rst
|
||||
bmesh.utils.rst
|
||||
bmesh.geometry.rst
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
|
@@ -677,7 +677,7 @@ Here are some general hints to avoid running into these problems:
|
||||
Undo/Redo
|
||||
---------
|
||||
|
||||
For safety, you should assume that undo and redo always invalidates all :class:`bpy.types.ID`
|
||||
For safety, you should assume that undo and redo always invalidates all :class:`bpy.types.ID`
|
||||
instances (Object, Scene, Mesh, Light, etc.), as weel obviously as all of their sub-data.
|
||||
|
||||
This example shows how you can tell undo changes the memory locations:
|
||||
@@ -701,7 +701,7 @@ interactively by the user is the only way to make sure that the script doesn't b
|
||||
Modern undo/redo system does not systematically invalidate all pointers anymore.
|
||||
Some data (in fact, most data, in typical cases), which were detected as unchanged for a
|
||||
particular history step, may remain unchanged and hence their pointers may remain valid.
|
||||
|
||||
|
||||
Be aware that if you want to take advantage of this behavior for some reason, there is no
|
||||
guarantee of any kind that it will be safe and consistent. Use it at your own risk.
|
||||
|
||||
|
@@ -49,6 +49,10 @@ This module gives access to low level bmesh operations.
|
||||
Most operators take input and return output, they can be chained together
|
||||
to perform useful operations.
|
||||
|
||||
.. note::
|
||||
|
||||
This API us new in 2.65 and not yet well tested.
|
||||
|
||||
|
||||
Operator Example
|
||||
++++++++++++++++
|
||||
|
@@ -41,7 +41,8 @@ Sphinx: HTML generation
|
||||
After you have built doc/python_api/sphinx-in (see above),
|
||||
generate html docs by running:
|
||||
|
||||
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api
|
||||
sphinx-build sphinx-in sphinx-out
|
||||
|
||||
|
||||
Sphinx: PDF generation
|
||||
@@ -92,13 +93,12 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
# For now, ignore add-ons and internal subclasses of 'bpy.types.PropertyGroup'.
|
||||
#
|
||||
# Besides disabling this line, the main change will be to add a
|
||||
# 'toctree' to 'write_rst_index' which contains the generated rst files.
|
||||
# 'toctree' to 'write_rst_contents' which contains the generated rst files.
|
||||
# This 'toctree' can be generated automatically.
|
||||
#
|
||||
# See: D6261 for reference.
|
||||
USE_ONLY_BUILTIN_RNA_TYPES = True
|
||||
|
||||
|
||||
def handle_args():
|
||||
'''
|
||||
Parse the args passed to Blender after "--", ignored by Blender
|
||||
@@ -173,7 +173,7 @@ def handle_args():
|
||||
dest="log",
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Log the output of the API dump and sphinx|latex "
|
||||
help="Log the output of the api dump and sphinx|latex "
|
||||
"warnings and errors (default=False).\n"
|
||||
"If given, save logs in:\n"
|
||||
"* OUTPUT_DIR/.bpy.log\n"
|
||||
@@ -244,7 +244,6 @@ else:
|
||||
"bpy.types", # supports filtering
|
||||
"bpy.utils",
|
||||
"bpy.utils.previews",
|
||||
"bpy.utils.units",
|
||||
"bpy_extras",
|
||||
"gpu",
|
||||
"gpu.types",
|
||||
@@ -351,9 +350,9 @@ RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
|
||||
# stored in ./rst/info_*
|
||||
INFO_DOCS = (
|
||||
("info_quickstart.rst",
|
||||
"Quickstart: New to Blender or scripting and want to get your feet wet?"),
|
||||
"Quickstart: new to Blender or scripting and want to get your feet wet?"),
|
||||
("info_overview.rst",
|
||||
"API Overview: A more complete explanation of Python integration"),
|
||||
"API Overview: a more complete explanation of Python integration"),
|
||||
("info_api_reference.rst",
|
||||
"API Reference Usage: examples of how to use the API reference docs"),
|
||||
("info_best_practice.rst",
|
||||
@@ -361,8 +360,8 @@ INFO_DOCS = (
|
||||
("info_tips_and_tricks.rst",
|
||||
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
|
||||
("info_gotcha.rst",
|
||||
"Gotcha's: Some of the problems you may encounter when writing scripts"),
|
||||
("change_log.rst", "Change Log: List of changes since last Blender release"),
|
||||
"Gotcha's: some of the problems you may encounter when writing scripts"),
|
||||
("change_log.rst", "List of changes since last Blender release"),
|
||||
)
|
||||
|
||||
# only support for properties atm.
|
||||
@@ -496,13 +495,6 @@ else:
|
||||
bpy_struct = None
|
||||
|
||||
|
||||
def import_value_from_module(module_name, import_name):
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as value" % (module_name, import_name)
|
||||
exec(exec_str, ns, ns)
|
||||
return ns["value"]
|
||||
|
||||
|
||||
def escape_rst(text):
|
||||
""" Escape plain text which may contain characters used by RST.
|
||||
"""
|
||||
@@ -752,12 +744,13 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
|
||||
else:
|
||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, py_prop.__doc__)
|
||||
fw("\n")
|
||||
if py_prop.fset is None:
|
||||
fw(ident + " (readonly)\n\n")
|
||||
else:
|
||||
fw("\n")
|
||||
|
||||
|
||||
def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
def pymodule2sphinx(basepath, module_name, module, title):
|
||||
import types
|
||||
attribute_set = set()
|
||||
filepath = os.path.join(basepath, module_name + ".rst")
|
||||
@@ -804,51 +797,42 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
fw(module.__doc__.strip())
|
||||
fw("\n\n")
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write submodules
|
||||
# we could also scan files but this ensures __all__ is used correctly
|
||||
if module_all or module_all_extra:
|
||||
if module_all is not None:
|
||||
submod_name = None
|
||||
submod = None
|
||||
submod_ls = []
|
||||
for submod_name in (module_all or ()):
|
||||
submod = import_value_from_module(module_name, submod_name)
|
||||
for submod_name in module_all:
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as submod" % (module.__name__, submod_name)
|
||||
exec(exec_str, ns, ns)
|
||||
submod = ns["submod"]
|
||||
if type(submod) == types.ModuleType:
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
for submod_name in module_all_extra:
|
||||
if submod_name in attribute_set:
|
||||
continue
|
||||
submod = import_value_from_module(module_name, submod_name)
|
||||
# No type checks, since there are non-module types we treat as modules
|
||||
# such as `bpy.app.translations` & `bpy.app.handlers`.
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
del submod_name
|
||||
del submod
|
||||
|
||||
if submod_ls:
|
||||
fw(".. toctree::\n")
|
||||
fw(" :maxdepth: 1\n")
|
||||
fw(" :caption: Submodules\n\n")
|
||||
fw(" :maxdepth: 1\n\n")
|
||||
|
||||
for submod_name, submod in submod_ls:
|
||||
submod_name_full = "%s.%s" % (module_name, submod_name)
|
||||
fw(" %s.rst\n" % submod_name_full)
|
||||
fw(" %s.rst\n\n" % submod_name_full)
|
||||
|
||||
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name, ())
|
||||
fw("\n")
|
||||
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name)
|
||||
del submod_ls
|
||||
# done writing submodules!
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write members of the module
|
||||
# only tested with PyStructs which are not exactly modules
|
||||
for key, descr in sorted(type(module).__dict__.items()):
|
||||
if key.startswith("__"):
|
||||
continue
|
||||
if key in module_all_extra:
|
||||
continue
|
||||
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
|
||||
|
||||
# type_name is only used for examples and messages
|
||||
@@ -871,8 +855,6 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
# sort by the valye type
|
||||
descr_sorted.sort(key=lambda descr_data: str(descr_data[3]))
|
||||
for key, descr, value, value_type in descr_sorted:
|
||||
if key in module_all_extra:
|
||||
continue
|
||||
|
||||
# must be documented as a submodule
|
||||
if is_struct_seq(value):
|
||||
@@ -914,9 +896,6 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
|
||||
|
||||
for attribute, value, value_type in module_dir_value_type:
|
||||
if attribute in module_all_extra:
|
||||
continue
|
||||
|
||||
if value_type == FunctionType:
|
||||
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
||||
# both the same at the moment but to be future proof
|
||||
@@ -1075,7 +1054,6 @@ context_type_map = {
|
||||
"selected_bones": ("EditBone", True),
|
||||
"selected_editable_bones": ("EditBone", True),
|
||||
"selected_editable_fcurves": ("FCurve", True),
|
||||
"selected_editable_keyframes": ("Keyframe", True),
|
||||
"selected_editable_objects": ("Object", True),
|
||||
"selected_editable_sequences": ("Sequence", True),
|
||||
"selected_nla_strips": ("NlaStrip", True),
|
||||
@@ -1117,7 +1095,7 @@ def pycontext2sphinx(basepath):
|
||||
fw("The context members available depend on the area of Blender which is currently being accessed.\n")
|
||||
fw("\n")
|
||||
fw("Note that all context values are readonly,\n")
|
||||
fw("but may be modified through the data API or by running operators\n\n")
|
||||
fw("but may be modified through the data api or by running operators\n\n")
|
||||
|
||||
def write_contex_cls():
|
||||
|
||||
@@ -1226,7 +1204,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
|
||||
identifier,
|
||||
# Account for multi-line enum descriptions, allowing this to be a block of text.
|
||||
indent(", ".join(escape_rst(val) for val in (name, description) if val) or "Undocumented", " "),
|
||||
)
|
||||
)
|
||||
for identifier, name, description in prop.enum_items
|
||||
])
|
||||
else:
|
||||
@@ -1334,7 +1312,7 @@ def pyrna2sphinx(basepath):
|
||||
|
||||
fw(title_string(title, "="))
|
||||
|
||||
fw(".. currentmodule:: %s\n\n" % struct_module_name)
|
||||
fw(".. module:: %s\n\n" % struct_module_name)
|
||||
|
||||
# docs first?, ok
|
||||
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
|
||||
@@ -1565,7 +1543,8 @@ def pyrna2sphinx(basepath):
|
||||
|
||||
fw(title_string(class_name, "="))
|
||||
|
||||
fw(".. currentmodule:: %s\n\n" % class_module_name)
|
||||
fw(".. module:: %s\n" % class_module_name)
|
||||
fw("\n")
|
||||
|
||||
if use_subclasses:
|
||||
subclass_ids = [
|
||||
@@ -1579,7 +1558,7 @@ def pyrna2sphinx(basepath):
|
||||
fw(".. class:: %s\n\n" % class_name)
|
||||
fw(" %s\n\n" % descr_str)
|
||||
fw(" .. note::\n\n")
|
||||
fw(" Note that :class:`%s.%s` is not actually available from within Blender,\n"
|
||||
fw(" Note that %s.%s is not actually available from within Blender,\n"
|
||||
" it only exists for the purpose of documentation.\n\n" % (class_module_name, class_name))
|
||||
|
||||
descr_items = [
|
||||
@@ -1694,26 +1673,15 @@ def write_sphinx_conf_py(basepath):
|
||||
fw("]\n\n")
|
||||
|
||||
fw("html_title = 'Blender Python API'\n")
|
||||
|
||||
fw("html_theme = 'default'\n")
|
||||
# The theme 'sphinx_rtd_theme' is no longer distributed with sphinx by default, only use when available.
|
||||
fw(r"""
|
||||
try:
|
||||
__import__('sphinx_rtd_theme')
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
""")
|
||||
|
||||
fw("if html_theme == 'sphinx_rtd_theme':\n")
|
||||
fw(" html_theme_options = {\n")
|
||||
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
|
||||
# fw(" 'analytics_id': '',\n")
|
||||
# fw(" 'collapse_navigation': True,\n")
|
||||
fw(" 'sticky_navigation': False,\n")
|
||||
fw(" 'navigation_depth': 1,\n")
|
||||
# fw(" 'includehidden': True,\n")
|
||||
# fw(" 'titles_only': False\n")
|
||||
fw("html_theme = 'sphinx_rtd_theme'\n")
|
||||
fw("html_theme_options = {\n")
|
||||
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
|
||||
# fw(" 'analytics_id': '',\n")
|
||||
# fw(" 'collapse_navigation': True,\n")
|
||||
fw(" 'sticky_navigation': False,\n")
|
||||
fw(" 'navigation_depth': 1,\n")
|
||||
# fw(" 'includehidden': True,\n")
|
||||
# fw(" 'titles_only': False\n")
|
||||
fw(" }\n\n")
|
||||
|
||||
# not helpful since the source is generated, adds to upload size.
|
||||
@@ -1762,7 +1730,7 @@ def execfile(filepath):
|
||||
file_handle.close()
|
||||
|
||||
|
||||
def write_rst_index(basepath):
|
||||
def write_rst_contents(basepath):
|
||||
'''
|
||||
Write the rst file of the main page, needed for sphinx (index.html)
|
||||
'''
|
||||
@@ -1802,6 +1770,7 @@ def write_rst_index(basepath):
|
||||
|
||||
# py modules
|
||||
"bpy.utils",
|
||||
"bpy.utils.previews",
|
||||
"bpy.path",
|
||||
"bpy.app",
|
||||
|
||||
@@ -1839,10 +1808,6 @@ def write_rst_index(basepath):
|
||||
fw(" %s\n" % mod)
|
||||
fw("\n")
|
||||
|
||||
fw(title_string("Indices", "="))
|
||||
fw("* :ref:`genindex`\n")
|
||||
fw("* :ref:`modindex`\n\n")
|
||||
|
||||
# special case, this 'bmesh.ops.rst' is extracted from C source
|
||||
if "bmesh.ops" not in EXCLUDE_MODULES:
|
||||
execfile(os.path.join(SCRIPT_DIR, "rst_from_bmesh_opdefines.py"))
|
||||
@@ -1878,7 +1843,6 @@ def write_rst_types_index(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Types (bpy.types)", "="))
|
||||
fw(".. module:: bpy.types\n\n")
|
||||
fw(".. toctree::\n")
|
||||
fw(" :glob:\n\n")
|
||||
fw(" bpy.types.*\n\n")
|
||||
@@ -1894,10 +1858,8 @@ def write_rst_ops_index(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Operators (bpy.ops)", "="))
|
||||
fw(".. module:: bpy.ops\n\n")
|
||||
write_example_ref("", fw, "bpy.ops")
|
||||
fw(".. toctree::\n")
|
||||
fw(" :caption: Submodules\n")
|
||||
fw(" :glob:\n\n")
|
||||
fw(" bpy.ops.*\n\n")
|
||||
file.close()
|
||||
@@ -1922,7 +1884,7 @@ def write_rst_msgbus(basepath):
|
||||
file.close()
|
||||
|
||||
# Write the contents.
|
||||
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus', ())
|
||||
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus')
|
||||
EXAMPLE_SET_USED.add("bpy.msgbus")
|
||||
|
||||
|
||||
@@ -1937,7 +1899,7 @@ def write_rst_data(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Data Access (bpy.data)", "="))
|
||||
fw(".. module:: bpy.data\n")
|
||||
fw(".. module:: bpy\n")
|
||||
fw("\n")
|
||||
fw("This module is used for all Blender/Python access.\n")
|
||||
fw("\n")
|
||||
@@ -1974,7 +1936,6 @@ def write_rst_importable_modules(basepath):
|
||||
"gpu.select": "GPU Select",
|
||||
"gpu.shader": "GPU Shader",
|
||||
"bmesh": "BMesh Module",
|
||||
"bmesh.ops": "BMesh Operators",
|
||||
"bmesh.types": "BMesh Types",
|
||||
"bmesh.utils": "BMesh Utilities",
|
||||
"bmesh.geometry": "BMesh Geometry Utilities",
|
||||
@@ -2000,32 +1961,11 @@ def write_rst_importable_modules(basepath):
|
||||
"freestyle.shaders": "Freestyle Shaders",
|
||||
"freestyle.utils": "Freestyle Utilities",
|
||||
}
|
||||
|
||||
# This is needed since some of the sub-modules listed above are not actual modules.
|
||||
# Examples include `bpy.app.translations` & `bpy.app.handlers`.
|
||||
#
|
||||
# Most of these are `PyStructSequence` internally,
|
||||
# however we don't want to document all of these as modules since some only contain
|
||||
# a few values (version number for e.g).
|
||||
#
|
||||
# If we remove this logic and document all `PyStructSequence` as sub-modules it means
|
||||
# `bpy.app.timers` for example would be presented on the same level as library information
|
||||
# access such as `bpy.app.sdl` which doesn't seem useful since it hides more useful
|
||||
# module-like objects among library data access.
|
||||
importable_modules_parent_map = {}
|
||||
for mod_name in importable_modules.keys():
|
||||
if mod_name in EXCLUDE_MODULES:
|
||||
continue
|
||||
if "." in mod_name:
|
||||
mod_name, submod_name = mod_name.rsplit(".", 1)
|
||||
importable_modules_parent_map.setdefault(mod_name, []).append(submod_name)
|
||||
|
||||
for mod_name, mod_descr in importable_modules.items():
|
||||
if mod_name in EXCLUDE_MODULES:
|
||||
continue
|
||||
module_all_extra = importable_modules_parent_map.get(mod_name, ())
|
||||
module = __import__(mod_name, fromlist=[mod_name.rsplit(".", 1)[-1]])
|
||||
pymodule2sphinx(basepath, mod_name, module, mod_descr, module_all_extra)
|
||||
if mod_name not in EXCLUDE_MODULES:
|
||||
module = __import__(mod_name,
|
||||
fromlist=[mod_name.rsplit(".", 1)[-1]])
|
||||
pymodule2sphinx(basepath, mod_name, module, mod_descr)
|
||||
|
||||
|
||||
def copy_handwritten_rsts(basepath):
|
||||
@@ -2090,7 +2030,7 @@ def rna2sphinx(basepath):
|
||||
write_sphinx_conf_py(basepath)
|
||||
|
||||
# main page
|
||||
write_rst_index(basepath)
|
||||
write_rst_contents(basepath)
|
||||
|
||||
# context
|
||||
if "bpy.context" not in EXCLUDE_MODULES:
|
||||
@@ -2287,7 +2227,7 @@ def main():
|
||||
shutil.rmtree(REFERENCE_PATH, True)
|
||||
|
||||
# copy SPHINX_OUT to the REFERENCE_PATH
|
||||
ignores = ('.doctrees', '.buildinfo')
|
||||
ignores = ('.doctrees', 'objects.inv', '.buildinfo')
|
||||
shutil.copytree(SPHINX_OUT,
|
||||
REFERENCE_PATH,
|
||||
ignore=shutil.ignore_patterns(*ignores))
|
||||
|
@@ -76,7 +76,11 @@ fi
|
||||
# Generate HTML (sphinx)
|
||||
|
||||
if $DO_OUT_HTML ; then
|
||||
sphinx-build -b html -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
# sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
|
||||
# annoying bug in sphinx makes it very slow unless we do this. should report.
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -b html sphinx-in sphinx-out
|
||||
|
||||
# XXX, saves space on upload and zip, should move HTML outside
|
||||
# and zip up there, for now this is OK
|
||||
@@ -103,7 +107,8 @@ fi
|
||||
# Generate PDF (sphinx/laytex)
|
||||
|
||||
if $DO_OUT_PDF ; then
|
||||
sphinx-build -n -b latex -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
make -C $SPHINX_WORKDIR/sphinx-out
|
||||
mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
|
||||
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
|
@@ -9,7 +9,3 @@
|
||||
/* Hide home icon in search area */
|
||||
.wy-side-nav-search > a:hover {background: none; opacity: 0.9}
|
||||
.wy-side-nav-search > a.icon::before {content: none}
|
||||
|
||||
.wy-nav-content {
|
||||
max-width: 1000px !important;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
|
||||
".. classmethod:: play(sound, catKey)\n\n"
|
||||
".. classmethod:: setVolume(sound, catKey)\n\n"
|
||||
" Plays a sound through the playback manager and assigns it to a category.\n\n"
|
||||
" :arg sound: The sound to play.\n"
|
||||
" :type sound: :class:`Sound`\n"
|
||||
|
11
extern/mantaflow/CMakeLists.txt
vendored
11
extern/mantaflow/CMakeLists.txt
vendored
@@ -31,17 +31,6 @@ if(MSVC_CLANG AND WITH_OPENMP AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.1
|
||||
remove_cc_flag("-fopenmp")
|
||||
endif()
|
||||
|
||||
# Exporting functions from the blender binary gives linker warnings on Apple arm64 systems.
|
||||
# For now and until Apple arm64 is officially supported, these will just be silenced here.
|
||||
# TODO (sebbas): Check if official arm64 devices give linker warnings without this block.
|
||||
|
||||
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(MANTAVERSION "0.13")
|
||||
|
||||
add_definitions(-DWITH_FLUID=1)
|
||||
|
39
extern/mantaflow/helper/util/randomstream.h
vendored
39
extern/mantaflow/helper/util/randomstream.h
vendored
@@ -377,6 +377,19 @@ class RandomStream {
|
||||
}
|
||||
|
||||
/*! get a random number from the stream */
|
||||
inline double getDouble(void)
|
||||
{
|
||||
return mtr.rand();
|
||||
};
|
||||
inline float getFloat(void)
|
||||
{
|
||||
return (float)mtr.rand();
|
||||
};
|
||||
|
||||
inline float getFloat(float min, float max)
|
||||
{
|
||||
return mtr.rand(max - min) + min;
|
||||
};
|
||||
inline float getRandNorm(float mean, float var)
|
||||
{
|
||||
return mtr.randNorm(mean, var);
|
||||
@@ -387,20 +400,12 @@ class RandomStream {
|
||||
{
|
||||
return getFloat();
|
||||
}
|
||||
inline Real getReal(float min, float max)
|
||||
{
|
||||
return getFloat(min, max);
|
||||
}
|
||||
|
||||
#else
|
||||
inline Real getReal()
|
||||
{
|
||||
return getDouble();
|
||||
}
|
||||
inline Real getReal(double min, double max)
|
||||
{
|
||||
return getDouble(min, max);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline Vec3 getVec3()
|
||||
@@ -417,24 +422,6 @@ class RandomStream {
|
||||
|
||||
private:
|
||||
MTRand mtr;
|
||||
|
||||
inline double getDouble(void)
|
||||
{
|
||||
return mtr.rand();
|
||||
};
|
||||
inline float getFloat(void)
|
||||
{
|
||||
return (float)mtr.rand();
|
||||
};
|
||||
|
||||
inline double getDouble(double min, double max)
|
||||
{
|
||||
return mtr.rand(max - min) + min;
|
||||
};
|
||||
inline float getFloat(float min, float max)
|
||||
{
|
||||
return (float)(mtr.rand(max - min) + min);
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Manta
|
||||
|
139
extern/mantaflow/preprocessed/fileio/iovdb.cpp
vendored
139
extern/mantaflow/preprocessed/fileio/iovdb.cpp
vendored
@@ -60,7 +60,7 @@ template<class GridType, class T> void importVDB(typename GridType::Ptr from, Gr
|
||||
template<class VDBType, class T>
|
||||
void importVDB(VDBType vdbValue, ParticleDataImpl<T> *to, int index, float voxelSize)
|
||||
{
|
||||
unusedParameter(voxelSize); // Unused for now
|
||||
(void)voxelSize; // Unused
|
||||
T toMantaValue;
|
||||
convertFrom(vdbValue, &toMantaValue);
|
||||
to->set(index, toMantaValue);
|
||||
@@ -165,12 +165,12 @@ static void setGridOptions(typename GridType::Ptr grid,
|
||||
string name,
|
||||
openvdb::GridClass cls,
|
||||
float voxelSize,
|
||||
int precision)
|
||||
bool precisionHalf)
|
||||
{
|
||||
grid->setTransform(openvdb::math::Transform::createLinearTransform(voxelSize));
|
||||
grid->setGridClass(cls);
|
||||
grid->setName(name);
|
||||
grid->setSaveFloatAsHalf(precision == PRECISION_MINI || precision == PRECISION_HALF);
|
||||
grid->setSaveFloatAsHalf(precisionHalf);
|
||||
}
|
||||
|
||||
template<class T, class GridType> typename GridType::Ptr exportVDB(Grid<T> *from)
|
||||
@@ -194,8 +194,7 @@ template<class MantaType, class VDBType>
|
||||
void exportVDB(ParticleDataImpl<MantaType> *from,
|
||||
openvdb::points::PointDataGrid::Ptr to,
|
||||
openvdb::tools::PointIndexGrid::Ptr pIndex,
|
||||
bool skipDeletedParts,
|
||||
int precision)
|
||||
bool skipDeletedParts)
|
||||
{
|
||||
std::vector<VDBType> vdbValues;
|
||||
std::string name = from->getName();
|
||||
@@ -213,21 +212,8 @@ void exportVDB(ParticleDataImpl<MantaType> *from,
|
||||
vdbValues.push_back(vdbValue);
|
||||
}
|
||||
|
||||
// Use custom codec for precision of the attribute
|
||||
openvdb::NamePair attribute;
|
||||
if (precision == PRECISION_FULL) {
|
||||
attribute =
|
||||
openvdb::points::TypedAttributeArray<VDBType, openvdb::points::NullCodec>::attributeType();
|
||||
}
|
||||
else if (precision == PRECISION_HALF ||
|
||||
precision == PRECISION_MINI) { // Mini uses same precision as half for now
|
||||
attribute =
|
||||
openvdb::points::TypedAttributeArray<VDBType,
|
||||
openvdb::points::TruncateCodec>::attributeType();
|
||||
}
|
||||
else {
|
||||
errMsg("exportVDB: invalid precision level");
|
||||
}
|
||||
openvdb::NamePair attribute =
|
||||
openvdb::points::TypedAttributeArray<VDBType, openvdb::points::NullCodec>::attributeType();
|
||||
openvdb::points::appendAttribute(to->tree(), name, attribute);
|
||||
|
||||
// Create a wrapper around the vdb values vector.
|
||||
@@ -243,8 +229,7 @@ void exportVDB(ParticleDataImpl<MantaType> *from,
|
||||
openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
|
||||
std::vector<ParticleDataBase *> &fromPData,
|
||||
bool skipDeletedParts,
|
||||
float voxelSize,
|
||||
int precision)
|
||||
float voxelSize)
|
||||
{
|
||||
std::vector<openvdb::Vec3s> positions;
|
||||
std::vector<int> flags;
|
||||
@@ -272,34 +257,16 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
|
||||
openvdb::tools::createPointIndexGrid<openvdb::tools::PointIndexGrid>(positionsWrapper,
|
||||
*transform);
|
||||
|
||||
openvdb::points::PointDataGrid::Ptr to;
|
||||
openvdb::NamePair flagAttribute;
|
||||
|
||||
using CodecNull = openvdb::points::NullCodec;
|
||||
using CodecTrunc = openvdb::points::TruncateCodec;
|
||||
using CodecFixPoint = openvdb::points::FixedPointCodec<true, openvdb::points::PositionRange>;
|
||||
|
||||
// Use custom codec for precision of the particle position and the flag attribute
|
||||
if (precision == PRECISION_FULL) {
|
||||
to = openvdb::points::createPointDataGrid<CodecNull, openvdb::points::PointDataGrid>(
|
||||
*pointIndexGrid, positionsWrapper, *transform);
|
||||
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecNull>::attributeType();
|
||||
}
|
||||
else if (precision == PRECISION_HALF) {
|
||||
to = openvdb::points::createPointDataGrid<CodecTrunc, openvdb::points::PointDataGrid>(
|
||||
*pointIndexGrid, positionsWrapper, *transform);
|
||||
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecTrunc>::attributeType();
|
||||
}
|
||||
else if (precision == PRECISION_MINI) {
|
||||
to = openvdb::points::createPointDataGrid<CodecFixPoint, openvdb::points::PointDataGrid>(
|
||||
*pointIndexGrid, positionsWrapper, *transform);
|
||||
flagAttribute = openvdb::points::TypedAttributeArray<int, CodecTrunc>::
|
||||
attributeType(); // Use 16 bit trunc for flag for now
|
||||
}
|
||||
else {
|
||||
errMsg("exportVDB: invalid precision level");
|
||||
}
|
||||
// TODO (sebbas): Use custom codec for attributes?
|
||||
// using Codec = openvdb::points::FixedPointCodec</*1-byte=*/false, openvdb::points::UnitRange>;
|
||||
openvdb::points::PointDataGrid::Ptr to =
|
||||
openvdb::points::createPointDataGrid<openvdb::points::NullCodec /*Codec*/,
|
||||
openvdb::points::PointDataGrid>(
|
||||
*pointIndexGrid, positionsWrapper, *transform);
|
||||
|
||||
openvdb::NamePair flagAttribute =
|
||||
openvdb::points::TypedAttributeArray<int,
|
||||
openvdb::points::NullCodec /*Codec*/>::attributeType();
|
||||
openvdb::points::appendAttribute(to->tree(), FLAG_NAME, flagAttribute);
|
||||
// Create a wrapper around the flag vector.
|
||||
openvdb::points::PointAttributeVector<int> flagWrapper(flags);
|
||||
@@ -314,17 +281,17 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
|
||||
if (pdb->getType() == ParticleDataBase::TypeInt) {
|
||||
debMsg("Writing int particle data '" << pdb->getName() << "'", 1);
|
||||
ParticleDataImpl<int> *pdi = dynamic_cast<ParticleDataImpl<int> *>(pdb);
|
||||
exportVDB<int, int>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
|
||||
exportVDB<int, int>(pdi, to, pointIndexGrid, skipDeletedParts);
|
||||
}
|
||||
else if (pdb->getType() == ParticleDataBase::TypeReal) {
|
||||
debMsg("Writing real particle data '" << pdb->getName() << "'", 1);
|
||||
ParticleDataImpl<Real> *pdi = dynamic_cast<ParticleDataImpl<Real> *>(pdb);
|
||||
exportVDB<Real, float>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
|
||||
exportVDB<Real, float>(pdi, to, pointIndexGrid, skipDeletedParts);
|
||||
}
|
||||
else if (pdb->getType() == ParticleDataBase::TypeVec3) {
|
||||
debMsg("Writing Vec3 particle data '" << pdb->getName() << "'", 1);
|
||||
ParticleDataImpl<Vec3> *pdi = dynamic_cast<ParticleDataImpl<Vec3> *>(pdb);
|
||||
exportVDB<Vec3, openvdb::Vec3s>(pdi, to, pointIndexGrid, skipDeletedParts, precision);
|
||||
exportVDB<Vec3, openvdb::Vec3s>(pdi, to, pointIndexGrid, skipDeletedParts);
|
||||
}
|
||||
else {
|
||||
errMsg("exportVDB: unknown ParticleDataBase type");
|
||||
@@ -335,10 +302,8 @@ openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
|
||||
|
||||
static void registerCustomCodecs()
|
||||
{
|
||||
openvdb::points::TypedAttributeArray<int, openvdb::points::TruncateCodec>::registerType();
|
||||
openvdb::points::TypedAttributeArray<float, openvdb::points::TruncateCodec>::registerType();
|
||||
openvdb::points::TypedAttributeArray<openvdb::Vec3s,
|
||||
openvdb::points::TruncateCodec>::registerType();
|
||||
using Codec = openvdb::points::FixedPointCodec</*1-byte=*/false, openvdb::points::UnitRange>;
|
||||
openvdb::points::TypedAttributeArray<int, Codec>::registerType();
|
||||
}
|
||||
|
||||
int writeObjectsVDB(const string &filename,
|
||||
@@ -346,14 +311,15 @@ int writeObjectsVDB(const string &filename,
|
||||
float worldSize,
|
||||
bool skipDeletedParts,
|
||||
int compression,
|
||||
int precision)
|
||||
bool precisionHalf)
|
||||
{
|
||||
openvdb::initialize();
|
||||
openvdb::io::File file(filename);
|
||||
openvdb::GridPtrVec gridsVDB;
|
||||
|
||||
// Register custom codecs, this makes sure custom attributes can be read
|
||||
registerCustomCodecs();
|
||||
// TODO (sebbas): Use custom codec for flag attribute?
|
||||
// Register codecs one, this makes sure custom attributes can be read
|
||||
// registerCustomCodecs();
|
||||
|
||||
std::vector<ParticleDataBase *> pdbBuffer;
|
||||
|
||||
@@ -399,7 +365,7 @@ int writeObjectsVDB(const string &filename,
|
||||
debMsg("Writing particle system '" << mantaPP->getName()
|
||||
<< "' (and buffered pData) to vdb file " << filename,
|
||||
1);
|
||||
vdbGrid = exportVDB(mantaPP, pdbBuffer, skipDeletedParts, voxelSize, precision);
|
||||
vdbGrid = exportVDB(mantaPP, pdbBuffer, skipDeletedParts, voxelSize);
|
||||
gridsVDB.push_back(vdbGrid);
|
||||
pdbBuffer.clear();
|
||||
}
|
||||
@@ -416,7 +382,7 @@ int writeObjectsVDB(const string &filename,
|
||||
|
||||
// Set additional grid attributes, e.g. name, grid class, compression level, etc.
|
||||
if (vdbGrid) {
|
||||
setGridOptions<openvdb::GridBase>(vdbGrid, objectName, gClass, voxelSize, precision);
|
||||
setGridOptions<openvdb::GridBase>(vdbGrid, objectName, gClass, voxelSize, precisionHalf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +405,6 @@ int writeObjectsVDB(const string &filename,
|
||||
vdb_flags = openvdb::io::COMPRESS_NONE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
case COMPRESSION_ZIP: {
|
||||
vdb_flags |= openvdb::io::COMPRESS_ZIP;
|
||||
break;
|
||||
@@ -468,18 +433,18 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
|
||||
openvdb::io::File file(filename);
|
||||
openvdb::GridPtrVec gridsVDB;
|
||||
|
||||
// Register custom codecs, this makes sure custom attributes can be read
|
||||
registerCustomCodecs();
|
||||
// TODO (sebbas): Use custom codec for flag attribute?
|
||||
// Register codecs one, this makes sure custom attributes can be read
|
||||
// registerCustomCodecs();
|
||||
|
||||
try {
|
||||
file.setCopyMaxBytes(0);
|
||||
file.open();
|
||||
gridsVDB = *(file.getGrids());
|
||||
openvdb::MetaMap::Ptr metadata = file.getMetadata();
|
||||
unusedParameter(metadata); // Unused for now
|
||||
(void)metadata; // Unused for now
|
||||
}
|
||||
catch (const openvdb::IoError &e) {
|
||||
unusedParameter(e); // Unused for now
|
||||
debMsg("readObjectsVDB: Could not open vdb file " << filename, 1);
|
||||
file.close();
|
||||
return 0;
|
||||
@@ -527,36 +492,27 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
|
||||
if (GridBase *mantaGrid = dynamic_cast<GridBase *>(*iter)) {
|
||||
|
||||
if (mantaGrid->getType() & GridBase::TypeInt) {
|
||||
openvdb::Int32Grid::Ptr vdbIntGrid = openvdb::gridPtrCast<openvdb::Int32Grid>(vdbGrid);
|
||||
if (!vdbIntGrid)
|
||||
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
|
||||
|
||||
Grid<int> *mantaIntGrid = (Grid<int> *)mantaGrid;
|
||||
debMsg("Reading into grid '" << mantaGrid->getName() << "' from int grid '"
|
||||
<< vdbGrid->getName() << "' in vdb file " << filename,
|
||||
1);
|
||||
openvdb::Int32Grid::Ptr vdbIntGrid = openvdb::gridPtrCast<openvdb::Int32Grid>(vdbGrid);
|
||||
Grid<int> *mantaIntGrid = (Grid<int> *)mantaGrid;
|
||||
importVDB<openvdb::Int32Grid, int>(vdbIntGrid, mantaIntGrid);
|
||||
}
|
||||
else if (mantaGrid->getType() & GridBase::TypeReal) {
|
||||
openvdb::FloatGrid::Ptr vdbFloatGrid = openvdb::gridPtrCast<openvdb::FloatGrid>(vdbGrid);
|
||||
if (!vdbFloatGrid)
|
||||
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
|
||||
|
||||
Grid<Real> *mantaRealGrid = (Grid<Real> *)mantaGrid;
|
||||
debMsg("Reading into grid '" << mantaGrid->getName() << "' from real grid '"
|
||||
<< vdbGrid->getName() << "' in vdb file " << filename,
|
||||
1);
|
||||
openvdb::FloatGrid::Ptr vdbFloatGrid = openvdb::gridPtrCast<openvdb::FloatGrid>(vdbGrid);
|
||||
Grid<Real> *mantaRealGrid = (Grid<Real> *)mantaGrid;
|
||||
importVDB<openvdb::FloatGrid, Real>(vdbFloatGrid, mantaRealGrid);
|
||||
}
|
||||
else if (mantaGrid->getType() & GridBase::TypeVec3) {
|
||||
openvdb::Vec3SGrid::Ptr vdbVec3Grid = openvdb::gridPtrCast<openvdb::Vec3SGrid>(vdbGrid);
|
||||
if (!vdbVec3Grid)
|
||||
continue; // Sanity check: Cast can fail if onlyGrid is true but object count > 1
|
||||
|
||||
Grid<Vec3> *mantaVec3Grid = (Grid<Vec3> *)mantaGrid;
|
||||
debMsg("Reading into grid '" << mantaGrid->getName() << "' from vec3 grid '"
|
||||
<< vdbGrid->getName() << "' in vdb file " << filename,
|
||||
1);
|
||||
openvdb::Vec3SGrid::Ptr vdbVec3Grid = openvdb::gridPtrCast<openvdb::Vec3SGrid>(vdbGrid);
|
||||
Grid<Vec3> *mantaVec3Grid = (Grid<Vec3> *)mantaGrid;
|
||||
importVDB<openvdb::Vec3SGrid, Vec3>(vdbVec3Grid, mantaVec3Grid);
|
||||
}
|
||||
else {
|
||||
@@ -565,15 +521,12 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
|
||||
}
|
||||
}
|
||||
else if (BasicParticleSystem *mantaPP = dynamic_cast<BasicParticleSystem *>(*iter)) {
|
||||
openvdb::points::PointDataGrid::Ptr vdbPointGrid =
|
||||
openvdb::gridPtrCast<openvdb::points::PointDataGrid>(vdbGrid);
|
||||
if (!vdbPointGrid)
|
||||
continue; // Sanity check: Cast can fail if onlyGrid is true but objects > 1
|
||||
|
||||
debMsg("Reading into particle system '" << mantaPP->getName() << "' from particle system '"
|
||||
<< vdbGrid->getName() << "' in vdb file "
|
||||
<< filename,
|
||||
1);
|
||||
openvdb::points::PointDataGrid::Ptr vdbPointGrid =
|
||||
openvdb::gridPtrCast<openvdb::points::PointDataGrid>(vdbGrid);
|
||||
importVDB(vdbPointGrid, mantaPP, pdbBuffer, voxelSize);
|
||||
pdbBuffer.clear();
|
||||
}
|
||||
@@ -627,23 +580,19 @@ template openvdb::Vec3SGrid::Ptr exportVDB<Vec3, openvdb::Vec3SGrid>(Grid<Vec3>
|
||||
openvdb::points::PointDataGrid::Ptr exportVDB(BasicParticleSystem *from,
|
||||
std::vector<ParticleDataBase *> &fromPData,
|
||||
bool skipDeletedParts = false,
|
||||
float voxelSize = 1.0,
|
||||
int precision = PRECISION_HALF);
|
||||
float voxelSize = 1.0);
|
||||
template void exportVDB<int, int>(ParticleDataImpl<int> *from,
|
||||
openvdb::points::PointDataGrid::Ptr to,
|
||||
openvdb::tools::PointIndexGrid::Ptr pIndex,
|
||||
bool skipDeletedParts = false,
|
||||
int precision = PRECISION_HALF);
|
||||
bool skipDeletedParts = false);
|
||||
template void exportVDB<Real, float>(ParticleDataImpl<Real> *from,
|
||||
openvdb::points::PointDataGrid::Ptr to,
|
||||
openvdb::tools::PointIndexGrid::Ptr pIndex,
|
||||
bool skipDeletedParts = false,
|
||||
int precision = PRECISION_HALF);
|
||||
bool skipDeletedParts = false);
|
||||
template void exportVDB<Vec3, openvdb::Vec3s>(ParticleDataImpl<Vec3> *from,
|
||||
openvdb::points::PointDataGrid::Ptr to,
|
||||
openvdb::tools::PointIndexGrid::Ptr pIndex,
|
||||
bool skipDeletedParts = false,
|
||||
int precision = PRECISION_HALF);
|
||||
bool skipDeletedParts = false);
|
||||
|
||||
#else
|
||||
|
||||
@@ -652,7 +601,7 @@ int writeObjectsVDB(const string &filename,
|
||||
float worldSize,
|
||||
bool skipDeletedParts,
|
||||
int compression,
|
||||
int precision)
|
||||
bool precisionHalf)
|
||||
{
|
||||
errMsg("Cannot save to .vdb file. Mantaflow has not been built with OpenVDB support.");
|
||||
return 0;
|
||||
|
16
extern/mantaflow/preprocessed/fileio/mantaio.cpp
vendored
16
extern/mantaflow/preprocessed/fileio/mantaio.cpp
vendored
@@ -82,15 +82,8 @@ int save(const string &name,
|
||||
float worldSize = 1.0,
|
||||
bool skipDeletedParts = false,
|
||||
int compression = COMPRESSION_ZIP,
|
||||
bool precisionHalf = true,
|
||||
int precision = PRECISION_HALF)
|
||||
bool precisionHalf = true)
|
||||
{
|
||||
|
||||
if (!precisionHalf) {
|
||||
debMsg("Warning: precisionHalf argument is deprecated. Please use precision level instead", 0);
|
||||
precision = PRECISION_HALF; // for backwards compatibility
|
||||
}
|
||||
|
||||
if (name.find_last_of('.') == string::npos)
|
||||
errMsg("file '" + name + "' does not have an extension");
|
||||
string ext = name.substr(name.find_last_of('.'));
|
||||
@@ -102,7 +95,8 @@ int save(const string &name,
|
||||
else if (ext == ".vol")
|
||||
return writeGridsVol(name, &objects);
|
||||
if (ext == ".vdb")
|
||||
return writeObjectsVDB(name, &objects, worldSize, skipDeletedParts, compression, precision);
|
||||
return writeObjectsVDB(
|
||||
name, &objects, worldSize, skipDeletedParts, compression, precisionHalf);
|
||||
else if (ext == ".npz")
|
||||
return writeGridsNumpy(name, &objects);
|
||||
else if (ext == ".txt")
|
||||
@@ -128,9 +122,7 @@ static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
bool skipDeletedParts = _args.getOpt<bool>("skipDeletedParts", 3, false, &_lock);
|
||||
int compression = _args.getOpt<int>("compression", 4, COMPRESSION_ZIP, &_lock);
|
||||
bool precisionHalf = _args.getOpt<bool>("precisionHalf", 5, true, &_lock);
|
||||
int precision = _args.getOpt<int>("precision", 6, PRECISION_HALF, &_lock);
|
||||
_retval = toPy(
|
||||
save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf, precision));
|
||||
_retval = toPy(save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf));
|
||||
_args.check();
|
||||
}
|
||||
pbFinalizePlugin(parent, "save", !noTiming);
|
||||
|
@@ -28,11 +28,6 @@
|
||||
#define COMPRESSION_ZIP 1
|
||||
#define COMPRESSION_BLOSC 2
|
||||
|
||||
// OpenVDB precision flags
|
||||
#define PRECISION_FULL 0
|
||||
#define PRECISION_HALF 1
|
||||
#define PRECISION_MINI 2
|
||||
|
||||
namespace Manta {
|
||||
|
||||
// Forward declations
|
||||
@@ -75,7 +70,7 @@ int writeObjectsVDB(const std::string &filename,
|
||||
float scale = 1.0,
|
||||
bool skipDeletedParts = false,
|
||||
int compression = COMPRESSION_ZIP,
|
||||
int precision = PRECISION_HALF);
|
||||
bool precisionHalf = true);
|
||||
int readObjectsVDB(const std::string &filename,
|
||||
std::vector<PbClass *> *objects,
|
||||
float scale = 1.0);
|
||||
|
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@@ -1,3 +1,3 @@
|
||||
|
||||
|
||||
#define MANTA_GIT_VERSION "commit dffc3481b835dfa048effcbb8a9e613294ecae14"
|
||||
#define MANTA_GIT_VERSION "commit e2f6e59e3679f88e5100ae2145410cca4971b9df"
|
||||
|
2
extern/mantaflow/preprocessed/grid.h
vendored
2
extern/mantaflow/preprocessed/grid.h
vendored
@@ -355,6 +355,7 @@ class GridBase : public PbClass {
|
||||
return isInBounds(Vec3i(i, j, k), bnd);
|
||||
}
|
||||
|
||||
#ifdef BLENDER
|
||||
//! expose name field to Python for Blender
|
||||
void setName(const std::string &name)
|
||||
{
|
||||
@@ -385,6 +386,7 @@ class GridBase : public PbClass {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
protected:
|
||||
GridType mType;
|
||||
Vec3i mSize;
|
||||
|
199
extern/mantaflow/preprocessed/levelset.cpp
vendored
199
extern/mantaflow/preprocessed/levelset.cpp
vendored
@@ -639,207 +639,8 @@ void LevelsetGrid::initFromFlags(const FlagGrid &flags, bool ignoreWalls)
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper variables that are used in flood-fill functions. */
|
||||
static const int ID_UNKNOWN = 0;
|
||||
static const int ID_VISITED = 1;
|
||||
|
||||
/* Fills all cells in the target grid that have not been marked during a flood-fill. */
|
||||
|
||||
struct KnFillApply : public KernelBase {
|
||||
KnFillApply(Grid<Real> &target,
|
||||
Grid<int> &visited,
|
||||
const Real value,
|
||||
const int boundaryWidth,
|
||||
const bool outside)
|
||||
: KernelBase(&target, boundaryWidth),
|
||||
target(target),
|
||||
visited(visited),
|
||||
value(value),
|
||||
boundaryWidth(boundaryWidth),
|
||||
outside(outside)
|
||||
{
|
||||
runMessage();
|
||||
run();
|
||||
}
|
||||
inline void op(int i,
|
||||
int j,
|
||||
int k,
|
||||
Grid<Real> &target,
|
||||
Grid<int> &visited,
|
||||
const Real value,
|
||||
const int boundaryWidth,
|
||||
const bool outside) const
|
||||
{
|
||||
|
||||
if (visited(i, j, k) == ID_VISITED)
|
||||
return;
|
||||
if (outside && target(i, j, k) < 0)
|
||||
return;
|
||||
if (!outside && target(i, j, k) >= 0)
|
||||
return;
|
||||
|
||||
/* Actual flood-fill override. */
|
||||
target(i, j, k) = value;
|
||||
}
|
||||
inline Grid<Real> &getArg0()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
typedef Grid<Real> type0;
|
||||
inline Grid<int> &getArg1()
|
||||
{
|
||||
return visited;
|
||||
}
|
||||
typedef Grid<int> type1;
|
||||
inline const Real &getArg2()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
typedef Real type2;
|
||||
inline const int &getArg3()
|
||||
{
|
||||
return boundaryWidth;
|
||||
}
|
||||
typedef int type3;
|
||||
inline const bool &getArg4()
|
||||
{
|
||||
return outside;
|
||||
}
|
||||
typedef bool type4;
|
||||
void runMessage()
|
||||
{
|
||||
debMsg("Executing kernel KnFillApply ", 3);
|
||||
debMsg("Kernel range"
|
||||
<< " x " << maxX << " y " << maxY << " z " << minZ << " - " << maxZ << " ",
|
||||
4);
|
||||
};
|
||||
void operator()(const tbb::blocked_range<IndexInt> &__r) const
|
||||
{
|
||||
const int _maxX = maxX;
|
||||
const int _maxY = maxY;
|
||||
if (maxZ > 1) {
|
||||
for (int k = __r.begin(); k != (int)__r.end(); k++)
|
||||
for (int j = boundaryWidth; j < _maxY; j++)
|
||||
for (int i = boundaryWidth; i < _maxX; i++)
|
||||
op(i, j, k, target, visited, value, boundaryWidth, outside);
|
||||
}
|
||||
else {
|
||||
const int k = 0;
|
||||
for (int j = __r.begin(); j != (int)__r.end(); j++)
|
||||
for (int i = boundaryWidth; i < _maxX; i++)
|
||||
op(i, j, k, target, visited, value, boundaryWidth, outside);
|
||||
}
|
||||
}
|
||||
void run()
|
||||
{
|
||||
if (maxZ > 1)
|
||||
tbb::parallel_for(tbb::blocked_range<IndexInt>(minZ, maxZ), *this);
|
||||
else
|
||||
tbb::parallel_for(tbb::blocked_range<IndexInt>(boundaryWidth, maxY), *this);
|
||||
}
|
||||
Grid<Real> ⌖
|
||||
Grid<int> &visited;
|
||||
const Real value;
|
||||
const int boundaryWidth;
|
||||
const bool outside;
|
||||
};
|
||||
|
||||
/* Basic flood fill implementation used to fill inside / outside areas of levelset.
|
||||
* Calling this function will ensure that there are no fluid cells inside obstacles.
|
||||
* I.e. starting from walls, cells will be tagged in flood-fill fashion, stopping at 0 borders.
|
||||
* All remaining cells will be filled with the fill value. Outside mode inverts search behavior. */
|
||||
void LevelsetGrid::floodFill(const Real value, const bool outside, const int boundaryWidth)
|
||||
{
|
||||
|
||||
/* Sanity check: Filling mode and filling value need to "match". */
|
||||
if (outside) {
|
||||
assertMsg(value < 0, "Cannot fill outside with (positive) value " << value);
|
||||
}
|
||||
else {
|
||||
assertMsg(value >= 0, "Cannot fill inside with (negative) value " << value);
|
||||
}
|
||||
|
||||
Grid<Real> levelsetCopy(this->getParent());
|
||||
Grid<int> visited(this->getParent());
|
||||
std::stack<Vec3i> todoPos;
|
||||
|
||||
const int maxNeighbors = this->is3D() ? 6 : 4;
|
||||
const Vec3i maxSize(this->getSize() - 1);
|
||||
|
||||
Vec3i bnd(2 * boundaryWidth);
|
||||
if (!this->is3D())
|
||||
bnd.z = 0;
|
||||
const int cellCntNoBnd = (this->getSizeX() - bnd.x) * (this->getSizeY() - bnd.y) *
|
||||
(this->getSizeZ() - bnd.z);
|
||||
|
||||
/* Initialize temporary helper grids. */
|
||||
levelsetCopy.copyFrom(*this);
|
||||
visited.setConst(ID_UNKNOWN);
|
||||
|
||||
FOR_IJK_BND(visited, boundaryWidth)
|
||||
{
|
||||
|
||||
/* Skip inside / outside cells depending on search mode. */
|
||||
if (outside && levelsetCopy(i, j, k) < 0)
|
||||
continue;
|
||||
if (!outside && levelsetCopy(i, j, k) >= 0)
|
||||
continue;
|
||||
/* Skip cell if it already has been visited. */
|
||||
if (visited(i, j, k) == ID_VISITED)
|
||||
continue;
|
||||
|
||||
Vec3i c(i, j, k);
|
||||
|
||||
bool isWallCell = (c.x - boundaryWidth == 0 || c.x == maxSize.x - boundaryWidth);
|
||||
isWallCell |= (c.y - boundaryWidth == 0 || c.y == maxSize.y - boundaryWidth);
|
||||
if (this->is3D())
|
||||
isWallCell |= (c.z - boundaryWidth == 0 || c.z == maxSize.z - boundaryWidth);
|
||||
|
||||
/* Only start searching from borders. */
|
||||
if (!isWallCell)
|
||||
continue;
|
||||
|
||||
/* Start flood-fill loop by initializing todo stack with current cell. */
|
||||
todoPos.push(c);
|
||||
visited(c) = ID_VISITED;
|
||||
|
||||
while (!todoPos.empty()) {
|
||||
c = todoPos.top();
|
||||
todoPos.pop();
|
||||
|
||||
/* Add all neighbor cells to search stack. */
|
||||
for (int nb = 0; nb < maxNeighbors; nb++) {
|
||||
const Vec3i neigh(c + neighbors[nb]);
|
||||
|
||||
if (!visited.isInBounds(neigh, boundaryWidth))
|
||||
continue;
|
||||
/* Skip inside / outside area depening on what we search for. */
|
||||
if (outside && levelsetCopy(neigh) < 0)
|
||||
continue;
|
||||
if (!outside && levelsetCopy(neigh) >= 0)
|
||||
continue;
|
||||
/* Skip neighbor if it already has been visited. */
|
||||
if (visited(neigh) == ID_VISITED)
|
||||
continue;
|
||||
|
||||
assertMsg(visited(neigh) == ID_UNKNOWN,
|
||||
"Cell must be of type 'unknown' at this point in the loop");
|
||||
todoPos.push(neigh);
|
||||
visited(neigh) = ID_VISITED;
|
||||
}
|
||||
assertMsg(todoPos.size() <= cellCntNoBnd,
|
||||
"Flood-fill todo stack cannot be greater than domain cell count - "
|
||||
<< todoPos.size() << " vs " << cellCntNoBnd);
|
||||
}
|
||||
}
|
||||
KnFillApply(*this, visited, value, boundaryWidth, outside);
|
||||
}
|
||||
|
||||
/* Deprecated: Use floodFill() function instead. */
|
||||
void LevelsetGrid::fillHoles(int maxDepth, int boundaryWidth)
|
||||
{
|
||||
debMsg("Deprecated - do not use fillHoles() ... use floodFill() instead", 1);
|
||||
|
||||
Real curVal, i1, i2, j1, j2, k1, k2;
|
||||
Vec3i c, cTmp;
|
||||
std::stack<Vec3i> undoPos;
|
||||
|
29
extern/mantaflow/preprocessed/levelset.h
vendored
29
extern/mantaflow/preprocessed/levelset.h
vendored
@@ -234,35 +234,6 @@ class LevelsetGrid : public Grid<Real> {
|
||||
}
|
||||
}
|
||||
|
||||
//! flood-fill the levelset to ensure that closed obstacles are filled inside
|
||||
void floodFill(const Real value = -0.5, const bool outside = true, const int boundaryWidth = 1);
|
||||
static PyObject *_W_7(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
{
|
||||
try {
|
||||
PbArgs _args(_linargs, _kwds);
|
||||
LevelsetGrid *pbo = dynamic_cast<LevelsetGrid *>(Pb::objFromPy(_self));
|
||||
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
|
||||
pbPreparePlugin(pbo->getParent(), "LevelsetGrid::floodFill", !noTiming);
|
||||
PyObject *_retval = 0;
|
||||
{
|
||||
ArgLocker _lock;
|
||||
const Real value = _args.getOpt<Real>("value", 0, -0.5, &_lock);
|
||||
const bool outside = _args.getOpt<bool>("outside", 1, true, &_lock);
|
||||
const int boundaryWidth = _args.getOpt<int>("boundaryWidth", 2, 1, &_lock);
|
||||
pbo->_args.copy(_args);
|
||||
_retval = getPyNone();
|
||||
pbo->floodFill(value, outside, boundaryWidth);
|
||||
pbo->_args.check();
|
||||
}
|
||||
pbFinalizePlugin(pbo->getParent(), "LevelsetGrid::floodFill", !noTiming);
|
||||
return _retval;
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
pbSetError("LevelsetGrid::floodFill", e.what());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static Real invalidTimeValue();
|
||||
public:
|
||||
PbArgs _args;
|
||||
|
@@ -15,7 +15,6 @@ static const Pb::Register _R_15("LevelsetGrid", "join", LevelsetGrid::_W_3);
|
||||
static const Pb::Register _R_16("LevelsetGrid", "subtract", LevelsetGrid::_W_4);
|
||||
static const Pb::Register _R_17("LevelsetGrid", "initFromFlags", LevelsetGrid::_W_5);
|
||||
static const Pb::Register _R_18("LevelsetGrid", "fillHoles", LevelsetGrid::_W_6);
|
||||
static const Pb::Register _R_19("LevelsetGrid", "floodFill", LevelsetGrid::_W_7);
|
||||
#endif
|
||||
extern "C" {
|
||||
void PbRegister_file_11()
|
||||
@@ -28,7 +27,6 @@ void PbRegister_file_11()
|
||||
KEEP_UNUSED(_R_16);
|
||||
KEEP_UNUSED(_R_17);
|
||||
KEEP_UNUSED(_R_18);
|
||||
KEEP_UNUSED(_R_19);
|
||||
}
|
||||
}
|
||||
} // namespace Manta
|
@@ -16,8 +16,7 @@ static const Pb::Register _reg(
|
||||
"integration mode\nIntEuler = 0\nIntRK2 = 1\nIntRK4 = 2\n\n# CG preconditioner\nPcNone "
|
||||
" = 0\nPcMIC = 1\nPcMGDynamic = 2\nPcMGStatic = 3\n\n# particles\nPtypeSpray = "
|
||||
"2\nPtypeBubble = 4\nPtypeFoam = 8\nPtypeTracer = 16\n\n# OpenVDB export "
|
||||
"flags\nCompression_None = 0\nCompression_Zip = 1\nCompression_Blosc = 2\n\n# OpenVDB "
|
||||
"precision flags\nPrecision_Full = 0\nPrecision_Half = 1\nPrecision_Mini = 2\n\n\n\n");
|
||||
"flags\nCompression_None = 0\nCompression_Zip = 1\nCompression_Blosc = 2\n\n\n\n\n");
|
||||
extern "C" {
|
||||
void PbRegister_file_0()
|
||||
{
|
||||
|
@@ -57,7 +57,7 @@
|
||||
#if defined(__arm__)
|
||||
/* Attempt to fix compilation error on Debian armel kernel.
|
||||
* arm7 architecture does have both 32 and 64bit atomics, however
|
||||
* its gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
|
||||
* it's gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
|
||||
*/
|
||||
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
|
||||
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_4
|
||||
|
@@ -150,8 +150,6 @@ void CLG_level_set(int level);
|
||||
|
||||
void CLG_logref_init(CLG_LogRef *clg_ref);
|
||||
|
||||
int CLG_color_support_get(CLG_LogRef *clg_ref);
|
||||
|
||||
/** Declare outside function, declare as extern in header. */
|
||||
#define CLG_LOGREF_DECLARE_GLOBAL(var, id) \
|
||||
static CLG_LogRef _static_##var = {id}; \
|
||||
|
@@ -755,12 +755,4 @@ void CLG_logref_init(CLG_LogRef *clg_ref)
|
||||
#endif
|
||||
}
|
||||
|
||||
int CLG_color_support_get(CLG_LogRef *clg_ref)
|
||||
{
|
||||
if (clg_ref->type == NULL) {
|
||||
CLG_logref_init(clg_ref);
|
||||
}
|
||||
return clg_ref->type->ctx->use_color;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@@ -270,14 +270,6 @@ if(WITH_CYCLES_EMBREE)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
add_definitions(-DWITH_NANOVDB)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${NANOVDB_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
add_definitions(-DWITH_OPENSUBDIV)
|
||||
include_directories(
|
||||
@@ -352,7 +344,7 @@ if(WITH_CYCLES_CUDA_BINARIES AND (NOT WITH_CYCLES_CUBIN_COMPILER))
|
||||
set(MAX_MSVC 1910)
|
||||
elseif(${CUDA_VERSION} EQUAL "9.1")
|
||||
set(MAX_MSVC 1911)
|
||||
elseif(${CUDA_VERSION} VERSION_GREATER_EQUAL 10.0)
|
||||
elseif(${CUDA_VERSION} LESS "11.0")
|
||||
set(MAX_MSVC 1999)
|
||||
endif()
|
||||
if(NOT MSVC_VERSION LESS ${MAX_MSVC} OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
@@ -70,11 +70,6 @@ def _configure_argument_parser():
|
||||
parser.add_argument("--cycles-print-stats",
|
||||
help="Print rendering statistics to stderr",
|
||||
action='store_true')
|
||||
parser.add_argument("--cycles-device",
|
||||
help="Set the device to use for Cycles, overriding user preferences and the scene setting."
|
||||
"Valid options are 'CPU', 'CUDA', 'OPTIX' or 'OPENCL'."
|
||||
"Additionally, you can append '+CPU' to any GPU type for hybrid rendering.",
|
||||
default=None)
|
||||
return parser
|
||||
|
||||
|
||||
@@ -107,10 +102,6 @@ def _parse_command_line():
|
||||
import _cycles
|
||||
_cycles.enable_print_stats()
|
||||
|
||||
if args.cycles_device:
|
||||
import _cycles
|
||||
_cycles.set_device_override(args.cycles_device)
|
||||
|
||||
|
||||
def init():
|
||||
import bpy
|
||||
@@ -159,7 +150,8 @@ def create(engine, data, region=None, v3d=None, rv3d=None, preview_osl=False):
|
||||
screen = screen or rv3d.id_data.as_pointer()
|
||||
rv3d = rv3d.as_pointer()
|
||||
|
||||
engine.session = _cycles.create(engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl)
|
||||
engine.session = _cycles.create(
|
||||
engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl)
|
||||
|
||||
|
||||
def free(engine):
|
||||
@@ -232,7 +224,6 @@ def system_info():
|
||||
import _cycles
|
||||
return _cycles.system_info()
|
||||
|
||||
|
||||
def list_render_passes(scene, srl):
|
||||
# Builtin Blender passes.
|
||||
yield ("Combined", "RGBA", 'COLOR')
|
||||
@@ -307,7 +298,6 @@ def list_render_passes(scene, srl):
|
||||
else:
|
||||
yield (aov.name, "RGBA", 'COLOR')
|
||||
|
||||
|
||||
def register_passes(engine, scene, view_layer):
|
||||
# Detect duplicate render pass names, first one wins.
|
||||
listed = set()
|
||||
@@ -316,7 +306,6 @@ def register_passes(engine, scene, view_layer):
|
||||
engine.register_pass(scene, view_layer, name, len(channelids), channelids, channeltype)
|
||||
listed.add(name)
|
||||
|
||||
|
||||
def detect_conflicting_passes(scene, view_layer):
|
||||
# Detect conflicting render pass names for UI.
|
||||
counter = {}
|
||||
|
@@ -46,8 +46,8 @@ class CYCLES_OT_use_shading_nodes(Operator):
|
||||
|
||||
class CYCLES_OT_add_aov(bpy.types.Operator):
|
||||
"""Add an AOV pass"""
|
||||
bl_idname = "cycles.add_aov"
|
||||
bl_label = "Add AOV"
|
||||
bl_idname="cycles.add_aov"
|
||||
bl_label="Add AOV"
|
||||
|
||||
def execute(self, context):
|
||||
view_layer = context.view_layer
|
||||
@@ -61,8 +61,8 @@ class CYCLES_OT_add_aov(bpy.types.Operator):
|
||||
|
||||
class CYCLES_OT_remove_aov(bpy.types.Operator):
|
||||
"""Remove an AOV pass"""
|
||||
bl_idname = "cycles.remove_aov"
|
||||
bl_label = "Remove AOV"
|
||||
bl_idname="cycles.remove_aov"
|
||||
bl_label="Remove AOV"
|
||||
|
||||
def execute(self, context):
|
||||
view_layer = context.view_layer
|
||||
@@ -203,7 +203,6 @@ classes = (
|
||||
CYCLES_OT_merge_images
|
||||
)
|
||||
|
||||
|
||||
def register():
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
|
@@ -31,6 +31,7 @@ from math import pi
|
||||
|
||||
# enums
|
||||
|
||||
import _cycles
|
||||
from . import engine
|
||||
|
||||
enum_devices = (
|
||||
@@ -38,10 +39,8 @@ enum_devices = (
|
||||
('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in the system tab in the user preferences"),
|
||||
)
|
||||
|
||||
from _cycles import with_network
|
||||
if with_network:
|
||||
if _cycles.with_network:
|
||||
enum_devices += (('NETWORK', "Networked Device", "Use networked device for rendering"),)
|
||||
del with_network
|
||||
|
||||
enum_feature_set = (
|
||||
('SUPPORTED', "Supported", "Only use finished and supported features"),
|
||||
@@ -144,7 +143,7 @@ enum_texture_limit = (
|
||||
('8192', "8192", "Limit texture size to 8192 pixels", 7),
|
||||
)
|
||||
|
||||
enum_view3d_shading_render_pass = (
|
||||
enum_view3d_shading_render_pass= (
|
||||
('', "General", ""),
|
||||
|
||||
('COMBINED', "Combined", "Show the Combined Render pass", 1),
|
||||
@@ -185,18 +184,15 @@ enum_aov_types = (
|
||||
|
||||
|
||||
def enum_openimagedenoise_denoiser(self, context):
|
||||
import _cycles
|
||||
if _cycles.with_openimagedenoise:
|
||||
return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)]
|
||||
return []
|
||||
|
||||
|
||||
def enum_optix_denoiser(self, context):
|
||||
if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')):
|
||||
return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs", 2)]
|
||||
return []
|
||||
|
||||
|
||||
def enum_preview_denoiser(self, context):
|
||||
optix_items = enum_optix_denoiser(self, context)
|
||||
oidn_items = enum_openimagedenoise_denoiser(self, context)
|
||||
@@ -210,14 +206,12 @@ def enum_preview_denoiser(self, context):
|
||||
items += oidn_items
|
||||
return items
|
||||
|
||||
|
||||
def enum_denoiser(self, context):
|
||||
items = [('NLM', "NLM", "Cycles native non-local means denoiser, running on any compute device", 1)]
|
||||
items += enum_optix_denoiser(self, context)
|
||||
items += enum_openimagedenoise_denoiser(self, context)
|
||||
return items
|
||||
|
||||
|
||||
enum_denoising_input_passes = (
|
||||
('RGB', "Color", "Use only color as input", 1),
|
||||
('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data as input", 2),
|
||||
@@ -419,18 +413,18 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
)
|
||||
|
||||
min_light_bounces: IntProperty(
|
||||
name="Min Light Bounces",
|
||||
description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
name="Min Light Bounces",
|
||||
description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
)
|
||||
min_transparent_bounces: IntProperty(
|
||||
name="Min Transparent Bounces",
|
||||
description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
name="Min Transparent Bounces",
|
||||
description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
)
|
||||
|
||||
caustics_reflective: BoolProperty(
|
||||
@@ -1331,7 +1325,6 @@ class CyclesAOVPass(bpy.types.PropertyGroup):
|
||||
default=""
|
||||
)
|
||||
|
||||
|
||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
|
||||
pass_debug_bvh_traversed_nodes: BoolProperty(
|
||||
@@ -1475,31 +1468,31 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
description="Render cryptomatte object pass, for isolating objects in compositing",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
)
|
||||
use_pass_crypto_material: BoolProperty(
|
||||
name="Cryptomatte Material",
|
||||
description="Render cryptomatte material pass, for isolating materials in compositing",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
)
|
||||
use_pass_crypto_asset: BoolProperty(
|
||||
name="Cryptomatte Asset",
|
||||
description="Render cryptomatte asset pass, for isolating groups of objects with the same parent",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
)
|
||||
pass_crypto_depth: IntProperty(
|
||||
name="Cryptomatte Levels",
|
||||
description="Sets how many unique objects can be distinguished per pixel",
|
||||
default=6, min=2, max=16, step=2,
|
||||
update=update_render_passes,
|
||||
)
|
||||
)
|
||||
pass_crypto_accurate: BoolProperty(
|
||||
name="Cryptomatte Accurate",
|
||||
description="Generate a more accurate Cryptomatte pass. CPU only, may render slower and use more memory",
|
||||
default=True,
|
||||
update=update_render_passes,
|
||||
)
|
||||
)
|
||||
|
||||
aovs: CollectionProperty(
|
||||
type=CyclesAOVPass,
|
||||
@@ -1601,20 +1594,15 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
||||
elif entry.type == 'CPU':
|
||||
cpu_devices.append(entry)
|
||||
# Extend all GPU devices with CPU.
|
||||
if compute_device_type in {'CUDA', 'OPENCL'}:
|
||||
if compute_device_type in ('CUDA', 'OPENCL'):
|
||||
devices.extend(cpu_devices)
|
||||
return devices
|
||||
|
||||
# For backwards compatibility, only returns CUDA and OpenCL but still
|
||||
# refreshes all devices.
|
||||
def get_devices(self, compute_device_type=''):
|
||||
import _cycles
|
||||
# Ensure `self.devices` is not re-allocated when the second call to
|
||||
# get_devices_for_type is made, freeing items from the first list.
|
||||
for device_type in ('CUDA', 'OPTIX', 'OPENCL'):
|
||||
self.update_device_entries(_cycles.available_devices(device_type))
|
||||
|
||||
cuda_devices = self.get_devices_for_type('CUDA')
|
||||
self.get_devices_for_type('OPTIX')
|
||||
opencl_devices = self.get_devices_for_type('OPENCL')
|
||||
return cuda_devices, opencl_devices
|
||||
|
||||
@@ -1656,6 +1644,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
||||
col.label(text="OptiX support is experimental", icon='INFO')
|
||||
col.label(text="Not all Cycles features are supported yet", icon='BLANK1')
|
||||
|
||||
|
||||
def draw_impl(self, layout, context):
|
||||
row = layout.row()
|
||||
row.prop(self, "compute_device_type", expand=True)
|
||||
|
@@ -711,9 +711,9 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
|
||||
if use_cpu(context):
|
||||
use_embree = _cycles.with_embree
|
||||
if not use_embree:
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Cycles built without Embree support")
|
||||
sub.label(text="CPU raytracing performance will be poor")
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Cycles built without Embree support")
|
||||
sub.label(text="CPU raytracing performance will be poor")
|
||||
|
||||
col.prop(cscene, "debug_use_spatial_splits")
|
||||
sub = col.column()
|
||||
@@ -843,6 +843,8 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel):
|
||||
col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time")
|
||||
col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count")
|
||||
|
||||
|
||||
|
||||
layout.prop(view_layer, "pass_alpha_threshold")
|
||||
|
||||
|
||||
@@ -957,15 +959,7 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel):
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.template_list(
|
||||
"CYCLES_RENDER_UL_aov",
|
||||
"aovs",
|
||||
cycles_view_layer,
|
||||
"aovs",
|
||||
cycles_view_layer,
|
||||
"active_aov",
|
||||
rows=2,
|
||||
)
|
||||
col.template_list("CYCLES_RENDER_UL_aov", "aovs", cycles_view_layer, "aovs", cycles_view_layer, "active_aov", rows=2)
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
@@ -973,9 +967,9 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel):
|
||||
sub.operator("cycles.remove_aov", icon='REMOVE', text="")
|
||||
|
||||
if cycles_view_layer.active_aov < len(cycles_view_layer.aovs):
|
||||
active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov]
|
||||
if active_aov.conflict:
|
||||
layout.label(text=active_aov.conflict, icon='ERROR')
|
||||
active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov]
|
||||
if active_aov.conflict:
|
||||
layout.label(text=active_aov.conflict, icon='ERROR')
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||
@@ -1228,7 +1222,7 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
|
||||
def has_geometry_visibility(ob):
|
||||
return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
|
||||
(ob.instance_type == 'COLLECTION' and ob.instance_collection))
|
||||
(ob.instance_type == 'COLLECTION' and ob.instance_collection))
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
|
||||
@@ -1238,7 +1232,7 @@ class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1261,7 +1255,7 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1271,7 +1265,7 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.prop(ob, "hide_select", text="Selectable", invert_checkbox=True, toggle=False)
|
||||
|
||||
col = layout.column(heading="Show In")
|
||||
col = layout.column(heading="Show in")
|
||||
col.prop(ob, "hide_viewport", text="Viewports", invert_checkbox=True, toggle=False)
|
||||
col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False)
|
||||
|
||||
@@ -1871,7 +1865,6 @@ class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel):
|
||||
bl_context = "render"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_bake"
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
@@ -2089,7 +2082,6 @@ class CYCLES_RENDER_PT_simplify_viewport(CyclesButtonsPanel, Panel):
|
||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||
col.prop(cscene, "texture_limit", text="Texture Limit")
|
||||
col.prop(cscene, "ao_bounces", text="AO Bounces")
|
||||
col.prop(rd, "simplify_volumes", text="Volume Resolution")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_simplify_render(CyclesButtonsPanel, Panel):
|
||||
@@ -2157,10 +2149,8 @@ class CYCLES_VIEW3D_PT_shading_render_pass(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (
|
||||
context.engine in cls.COMPAT_ENGINES and
|
||||
context.space_data.shading.type == 'RENDERED'
|
||||
)
|
||||
return (context.engine in cls.COMPAT_ENGINES
|
||||
and context.space_data.shading.type == 'RENDERED')
|
||||
|
||||
def draw(self, context):
|
||||
shading = context.space_data.shading
|
||||
@@ -2178,10 +2168,8 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (
|
||||
context.engine in cls.COMPAT_ENGINES and
|
||||
context.space_data.shading.type == 'RENDERED'
|
||||
)
|
||||
return (context.engine in cls.COMPAT_ENGINES
|
||||
and context.space_data.shading.type == 'RENDERED')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -2210,14 +2198,12 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel):
|
||||
col.prop(shading, "studiolight_intensity")
|
||||
col.prop(shading, "studiolight_background_alpha")
|
||||
|
||||
|
||||
class CYCLES_VIEW3D_PT_simplify_greasepencil(CyclesButtonsPanel, Panel, GreasePencilSimplifyPanel):
|
||||
bl_label = "Grease Pencil"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_simplify"
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
|
||||
def draw_device(self, context):
|
||||
scene = context.scene
|
||||
layout = self.layout
|
||||
|
@@ -137,11 +137,9 @@ def do_versions(self):
|
||||
# Caustics Reflective/Refractive separation in 272
|
||||
if version <= (2, 72, 0):
|
||||
cscene = scene.cycles
|
||||
if (
|
||||
cscene.get("no_caustics", False) and
|
||||
not cscene.is_property_set("caustics_reflective") and
|
||||
not cscene.is_property_set("caustics_refractive")
|
||||
):
|
||||
if (cscene.get("no_caustics", False) and
|
||||
not cscene.is_property_set("caustics_reflective") and
|
||||
not cscene.is_property_set("caustics_refractive")):
|
||||
cscene.caustics_reflective = False
|
||||
cscene.caustics_refractive = False
|
||||
|
||||
|
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include "blender/blender_device.h"
|
||||
#include "blender/blender_session.h"
|
||||
#include "blender/blender_util.h"
|
||||
|
||||
#include "util/util_foreach.h"
|
||||
@@ -43,18 +42,6 @@ int blender_device_threads(BL::Scene &b_scene)
|
||||
|
||||
DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scene, bool background)
|
||||
{
|
||||
if (BlenderSession::device_override != DEVICE_MASK_ALL) {
|
||||
vector<DeviceInfo> devices = Device::available_devices(BlenderSession::device_override);
|
||||
|
||||
if (devices.empty()) {
|
||||
printf("Found no Cycles device of the specified type, falling back to CPU...\n");
|
||||
return Device::available_devices(DEVICE_MASK_CPU).front();
|
||||
}
|
||||
|
||||
int threads = blender_device_threads(b_scene);
|
||||
return Device::get_multi_device(devices, threads, background);
|
||||
}
|
||||
|
||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||
|
||||
/* Default to CPU device. */
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include "blender/blender_util.h"
|
||||
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_task.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@@ -46,17 +45,16 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
||||
BL::Object &b_ob,
|
||||
BL::Object &b_ob_instance,
|
||||
bool object_updated,
|
||||
bool use_particle_hair,
|
||||
TaskPool *task_pool)
|
||||
bool use_particle_hair)
|
||||
{
|
||||
/* Test if we can instance or if the object is modified. */
|
||||
BL::ID b_ob_data = b_ob.data();
|
||||
BL::ID b_key_id = (BKE_object_is_modified(b_ob)) ? b_ob_instance : b_ob_data;
|
||||
GeometryKey key(b_key_id.ptr.data, use_particle_hair);
|
||||
BL::Material material_override = view_layer.material_override;
|
||||
Shader *default_shader = (b_ob.type() == BL::Object::type_VOLUME) ? scene->default_volume :
|
||||
scene->default_surface;
|
||||
Geometry::Type geom_type = determine_geom_type(b_ob, use_particle_hair);
|
||||
GeometryKey key(b_key_id.ptr.data, geom_type);
|
||||
|
||||
/* Find shader indices. */
|
||||
vector<Shader *> used_shaders;
|
||||
@@ -79,15 +77,8 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
||||
used_shaders.push_back(default_shader);
|
||||
}
|
||||
|
||||
/* Ensure we only sync instanced geometry once. */
|
||||
Geometry *geom = geometry_map.find(key);
|
||||
if (geom) {
|
||||
if (geometry_synced.find(geom) != geometry_synced.end()) {
|
||||
return geom;
|
||||
}
|
||||
}
|
||||
|
||||
/* Test if we need to sync. */
|
||||
Geometry *geom = geometry_map.find(key);
|
||||
bool sync = true;
|
||||
if (geom == NULL) {
|
||||
/* Add new geometry if it did not exist yet. */
|
||||
@@ -134,36 +125,28 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure we only sync instanced geometry once. */
|
||||
if (geometry_synced.find(geom) != geometry_synced.end()) {
|
||||
return geom;
|
||||
}
|
||||
|
||||
progress.set_sync_status("Synchronizing object", b_ob.name());
|
||||
|
||||
geometry_synced.insert(geom);
|
||||
|
||||
geom->name = ustring(b_ob_data.name().c_str());
|
||||
|
||||
auto sync_func = [=]() mutable {
|
||||
if (progress.get_cancel())
|
||||
return;
|
||||
|
||||
progress.set_sync_status("Synchronizing object", b_ob.name());
|
||||
|
||||
if (geom_type == Geometry::HAIR) {
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair(b_depsgraph, b_ob, hair, used_shaders);
|
||||
}
|
||||
else if (geom_type == Geometry::VOLUME) {
|
||||
Volume *volume = static_cast<Volume *>(geom);
|
||||
sync_volume(b_ob, volume, used_shaders);
|
||||
}
|
||||
else {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
|
||||
}
|
||||
};
|
||||
|
||||
/* Defer the actual geometry sync to the task_pool for multithreading */
|
||||
if (task_pool) {
|
||||
task_pool->push(sync_func);
|
||||
if (geom_type == Geometry::HAIR) {
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair(b_depsgraph, b_ob, hair, used_shaders);
|
||||
}
|
||||
else if (geom_type == Geometry::VOLUME) {
|
||||
Volume *volume = static_cast<Volume *>(geom);
|
||||
sync_volume(b_ob, volume, used_shaders);
|
||||
}
|
||||
else {
|
||||
sync_func();
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
|
||||
}
|
||||
|
||||
return geom;
|
||||
@@ -173,8 +156,7 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
|
||||
BL::Object &b_ob,
|
||||
Object *object,
|
||||
float motion_time,
|
||||
bool use_particle_hair,
|
||||
TaskPool *task_pool)
|
||||
bool use_particle_hair)
|
||||
{
|
||||
/* Ensure we only sync instanced geometry once. */
|
||||
Geometry *geom = object->geometry;
|
||||
@@ -195,29 +177,16 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
|
||||
return;
|
||||
}
|
||||
|
||||
auto sync_func = [=]() mutable {
|
||||
if (progress.get_cancel())
|
||||
return;
|
||||
|
||||
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
|
||||
}
|
||||
else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
|
||||
/* No volume motion blur support yet. */
|
||||
}
|
||||
else {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_mesh_motion(b_depsgraph, b_ob, mesh, motion_step);
|
||||
}
|
||||
};
|
||||
|
||||
/* Defer the actual geometry sync to the task_pool for multithreading */
|
||||
if (task_pool) {
|
||||
task_pool->push(sync_func);
|
||||
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
|
||||
}
|
||||
else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
|
||||
/* No volume motion blur support yet. */
|
||||
}
|
||||
else {
|
||||
sync_func();
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
sync_mesh_motion(b_depsgraph, b_ob, mesh, motion_step);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "render/geometry.h"
|
||||
#include "render/scene.h"
|
||||
|
||||
#include "util/util_map.h"
|
||||
@@ -231,9 +230,9 @@ struct ObjectKey {
|
||||
|
||||
struct GeometryKey {
|
||||
void *id;
|
||||
Geometry::Type geometry_type;
|
||||
bool use_particle_hair;
|
||||
|
||||
GeometryKey(void *id, Geometry::Type geometry_type) : id(id), geometry_type(geometry_type)
|
||||
GeometryKey(void *id, bool use_particle_hair) : id(id), use_particle_hair(use_particle_hair)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -243,7 +242,7 @@ struct GeometryKey {
|
||||
return true;
|
||||
}
|
||||
else if (id == k.id) {
|
||||
if (geometry_type < k.geometry_type) {
|
||||
if (use_particle_hair < k.use_particle_hair) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_hash.h"
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_task.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@@ -104,8 +103,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
bool use_particle_hair,
|
||||
bool show_lights,
|
||||
BlenderObjectCulling &culling,
|
||||
bool *use_portal,
|
||||
TaskPool *geom_task_pool)
|
||||
bool *use_portal)
|
||||
{
|
||||
const bool is_instance = b_instance.is_instance();
|
||||
BL::Object b_ob = b_instance.object();
|
||||
@@ -183,10 +181,6 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Use task pool only for non-instances, since sync_dupli_particle accesses
|
||||
* geometry. This restriction should be removed for better performance. */
|
||||
TaskPool *object_geom_task_pool = (is_instance) ? NULL : geom_task_pool;
|
||||
|
||||
/* key to lookup object */
|
||||
ObjectKey key(b_parent, persistent_id, b_ob_instance, use_particle_hair);
|
||||
Object *object;
|
||||
@@ -204,12 +198,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
|
||||
/* mesh deformation */
|
||||
if (object->geometry)
|
||||
sync_geometry_motion(b_depsgraph,
|
||||
b_ob_instance,
|
||||
object,
|
||||
motion_time,
|
||||
use_particle_hair,
|
||||
object_geom_task_pool);
|
||||
sync_geometry_motion(b_depsgraph, b_ob, object, motion_time, use_particle_hair);
|
||||
}
|
||||
|
||||
return object;
|
||||
@@ -222,15 +211,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
object_updated = true;
|
||||
|
||||
/* mesh sync */
|
||||
/* b_ob is owned by the iterator and will go out of scope at the end of the block.
|
||||
* b_ob_instance is the original object and will remain valid for deferred geometry
|
||||
* sync. */
|
||||
object->geometry = sync_geometry(b_depsgraph,
|
||||
b_ob_instance,
|
||||
b_ob_instance,
|
||||
object_updated,
|
||||
use_particle_hair,
|
||||
object_geom_task_pool);
|
||||
object->geometry = sync_geometry(
|
||||
b_depsgraph, b_ob, b_ob_instance, object_updated, use_particle_hair);
|
||||
|
||||
/* special case not tracked by object update flags */
|
||||
|
||||
@@ -349,9 +331,6 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
BL::SpaceView3D &b_v3d,
|
||||
float motion_time)
|
||||
{
|
||||
/* Task pool for multithreaded geometry sync. */
|
||||
TaskPool geom_task_pool;
|
||||
|
||||
/* layer data */
|
||||
bool motion = motion_time != 0.0f;
|
||||
|
||||
@@ -376,8 +355,8 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
const bool show_lights = BlenderViewportParameters(b_v3d).use_scene_lights;
|
||||
|
||||
BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
|
||||
BL::Depsgraph::object_instances_iterator b_instance_iter;
|
||||
|
||||
BL::Depsgraph::object_instances_iterator b_instance_iter;
|
||||
for (b_depsgraph.object_instances.begin(b_instance_iter);
|
||||
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
|
||||
++b_instance_iter) {
|
||||
@@ -393,11 +372,6 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
/* Load per-object culling data. */
|
||||
culling.init_object(scene, b_ob);
|
||||
|
||||
/* Ensure the object geom supporting the hair is processed before adding
|
||||
* the hair processing task to the task pool, calling .to_mesh() on the
|
||||
* same object in parallel does not work. */
|
||||
const bool sync_hair = b_instance.show_particles() && object_has_particle_hair(b_ob);
|
||||
|
||||
/* Object itself. */
|
||||
if (b_instance.show_self()) {
|
||||
sync_object(b_depsgraph,
|
||||
@@ -407,12 +381,11 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
false,
|
||||
show_lights,
|
||||
culling,
|
||||
&use_portal,
|
||||
sync_hair ? NULL : &geom_task_pool);
|
||||
&use_portal);
|
||||
}
|
||||
|
||||
/* Particle hair as separate object. */
|
||||
if (sync_hair) {
|
||||
if (b_instance.show_particles() && object_has_particle_hair(b_ob)) {
|
||||
sync_object(b_depsgraph,
|
||||
b_view_layer,
|
||||
b_instance,
|
||||
@@ -420,15 +393,12 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
true,
|
||||
show_lights,
|
||||
culling,
|
||||
&use_portal,
|
||||
&geom_task_pool);
|
||||
&use_portal);
|
||||
}
|
||||
|
||||
cancel = progress.get_cancel();
|
||||
}
|
||||
|
||||
geom_task_pool.wait_work();
|
||||
|
||||
progress.set_sync_status("");
|
||||
|
||||
if (!cancel && !motion) {
|
||||
|
@@ -410,12 +410,6 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args)
|
||||
}
|
||||
|
||||
DeviceType type = Device::type_from_string(type_name);
|
||||
/* "NONE" is defined by the add-on, see: `CyclesPreferences.get_device_types`. */
|
||||
if ((type == DEVICE_NONE) && (strcmp(type_name, "NONE") != 0)) {
|
||||
PyErr_Format(PyExc_ValueError, "Device \"%s\" not known.", type_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint mask = (type == DEVICE_NONE) ? DEVICE_MASK_ALL : DEVICE_MASK(type);
|
||||
mask |= DEVICE_MASK_CPU;
|
||||
|
||||
@@ -974,44 +968,6 @@ static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/)
|
||||
return list;
|
||||
}
|
||||
|
||||
static PyObject *set_device_override_func(PyObject * /*self*/, PyObject *arg)
|
||||
{
|
||||
PyObject *override_string = PyObject_Str(arg);
|
||||
string override = PyUnicode_AsUTF8(override_string);
|
||||
Py_DECREF(override_string);
|
||||
|
||||
bool include_cpu = false;
|
||||
const string cpu_suffix = "+CPU";
|
||||
if (string_endswith(override, cpu_suffix)) {
|
||||
include_cpu = true;
|
||||
override = override.substr(0, override.length() - cpu_suffix.length());
|
||||
}
|
||||
|
||||
if (override == "CPU") {
|
||||
BlenderSession::device_override = DEVICE_MASK_CPU;
|
||||
}
|
||||
else if (override == "OPENCL") {
|
||||
BlenderSession::device_override = DEVICE_MASK_OPENCL;
|
||||
}
|
||||
else if (override == "CUDA") {
|
||||
BlenderSession::device_override = DEVICE_MASK_CUDA;
|
||||
}
|
||||
else if (override == "OPTIX") {
|
||||
BlenderSession::device_override = DEVICE_MASK_OPTIX;
|
||||
}
|
||||
else {
|
||||
printf("\nError: %s is not a valid Cycles device.\n", override.c_str());
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (include_cpu) {
|
||||
BlenderSession::device_override = (DeviceTypeMask)(BlenderSession::device_override |
|
||||
DEVICE_MASK_CPU);
|
||||
}
|
||||
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
static PyMethodDef methods[] = {
|
||||
{"init", init_func, METH_VARARGS, ""},
|
||||
{"exit", exit_func, METH_VARARGS, ""},
|
||||
@@ -1051,7 +1007,6 @@ static PyMethodDef methods[] = {
|
||||
|
||||
/* Compute Device selection */
|
||||
{"get_device_types", get_device_types_func, METH_VARARGS, ""},
|
||||
{"set_device_override", set_device_override_func, METH_O, ""},
|
||||
|
||||
{NULL, NULL, 0, NULL},
|
||||
};
|
||||
|
@@ -47,7 +47,6 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
DeviceTypeMask BlenderSession::device_override = DEVICE_MASK_ALL;
|
||||
bool BlenderSession::headless = false;
|
||||
int BlenderSession::num_resumable_chunks = 0;
|
||||
int BlenderSession::current_resumable_chunk = 0;
|
||||
@@ -563,10 +562,6 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
|
||||
session->reset(buffer_params, effective_layer_samples);
|
||||
|
||||
/* render */
|
||||
if (!b_engine.is_preview() && background && print_render_stats) {
|
||||
scene->enable_update_stats();
|
||||
}
|
||||
|
||||
session->start();
|
||||
session->wait();
|
||||
|
||||
|
@@ -126,7 +126,6 @@ class BlenderSession {
|
||||
/* Global state which is common for all render sessions created from Blender.
|
||||
* Usually denotes command line arguments.
|
||||
*/
|
||||
static DeviceTypeMask device_override;
|
||||
|
||||
/* Blender is running from the command line, no windows are shown and some
|
||||
* extra render optimization is possible (possible to free draw-only data and
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user