Compare commits
323 Commits
fail-on-me
...
active-fcu
Author | SHA1 | Date | |
---|---|---|---|
baca8611e5 | |||
2930d4fcea | |||
d6a9783b71 | |||
7edd60b35b | |||
3c54db4a4e | |||
a92ab93c7d | |||
23767937ef | |||
fef1a6c54e | |||
f1b10477c2 | |||
907a718ebe | |||
eb911610d0 | |||
ee393f9821 | |||
fec522be6a | |||
a708cdabe6 | |||
7e3967ed37 | |||
998b680e5b | |||
31004ef48e | |||
c7287ffaec | |||
8170c92ed4 | |||
26d5c24f0a | |||
9259052e15 | |||
![]() |
526fbdec3b | ||
![]() |
17cf500101 | ||
07899ddd22 | |||
d6d2897ef0 | |||
991eb5f79c | |||
a6185e4fa5 | |||
53a806f6df | |||
5ec0250df9 | |||
ccf476f8af | |||
f818d1d636 | |||
![]() |
45da7ce177 | ||
e8be55a485 | |||
c2df6658ee | |||
114150e80c | |||
1449ae042e | |||
c78c425266 | |||
06ba233374 | |||
87aa13d025 | |||
76f513f6dc | |||
a241948ad9 | |||
d9d0a386cb | |||
8c86c55035 | |||
bb4478f2fd | |||
12c0ecc934 | |||
4e06afb0a1 | |||
7f95d780e8 | |||
9d932b426f | |||
82a197cc7f | |||
058d29ed9a | |||
13b0a697a0 | |||
052538edc1 | |||
3e7feaff44 | |||
fc8533a3c9 | |||
7056f180d3 | |||
3014b5efc8 | |||
f5866f484f | |||
![]() |
546b900194 | ||
a1df2fc443 | |||
1804eb57fd | |||
1b3a0ae231 | |||
a54fb081ba | |||
![]() |
a440060142 | ||
c83ef9d7b2 | |||
e9da71ae2d | |||
c5b9bf32e9 | |||
1c2ade053a | |||
6879798202 | |||
596b30a080 | |||
429afe0c62 | |||
19363880a6 | |||
3fa1280132 | |||
19c9b27ffe | |||
ade8d84fe3 | |||
0299817e0e | |||
3699d6fe34 | |||
dee665b462 | |||
ad5d5d3f3b | |||
d98c722a5a | |||
8527d84d35 | |||
4f395c84fe | |||
0f372f3966 | |||
bb530a77b6 | |||
83f144b176 | |||
832a975c2c | |||
f69c7a7ff9 | |||
807817c0c4 | |||
f3a65a1b4a | |||
0850afb34e | |||
6e901fd8fc | |||
ed7dbaa5a7 | |||
b1b1be1754 | |||
12bc34b0b8 | |||
1a623c183f | |||
530ccde909 | |||
1a650fdcb2 | |||
47908f0155 | |||
2778937fb6 | |||
e06050945e | |||
3abbae2d7c | |||
3789aa8506 | |||
d8585e184a | |||
014276a11c | |||
bfa78aceed | |||
141a3e6d47 | |||
f34653e498 | |||
5c5d43fd66 | |||
91bbf96c1d | |||
![]() |
d8283a1f89 | ||
744eb1172e | |||
b78a439e90 | |||
8f5b9fb519 | |||
c0eb6faa47 | |||
285353c252 | |||
79e82dbc05 | |||
7844486e47 | |||
1cb7267a9f | |||
4749bd2277 | |||
9e09b5c418 | |||
4a17508c6d | |||
62e2d92aed | |||
ddbf41d88d | |||
5086bdfe0b | |||
368f8f7404 | |||
7b2fe4c9ec | |||
8815996418 | |||
5db5ac611a | |||
b8f990b0b4 | |||
0ed7aedc71 | |||
b4a608c11c | |||
4fdd8452a6 | |||
8726354d46 | |||
df8a63bb9c | |||
![]() |
0852ecd844 | ||
![]() |
2654e9c9c1 | ||
![]() |
922aac999d | ||
![]() |
3198fec1fe | ||
df8e2c76c9 | |||
![]() |
c284326809 | ||
a48d78ce07 | |||
3dc222ea7b | |||
65dcf812a5 | |||
2bb60db94a | |||
0e021414fe | |||
a443287908 | |||
d3f2037966 | |||
346023b457 | |||
94d6b54826 | |||
1725e46cee | |||
bc2830a3ce | |||
84ae44138d | |||
5ee60c9815 | |||
e726ed3c6b | |||
2a0e996d77 | |||
770cc66f75 | |||
a8766de5d5 | |||
714dbf273c | |||
f1565e7f73 | |||
0649ed7fa2 | |||
e74a24f0bb | |||
9d6789115a | |||
eed8ea1b73 | |||
9b0ef34534 | |||
8a984ddd0f | |||
e51c721315 | |||
1131328aeb | |||
91aeb452ab | |||
54b47da565 | |||
8b82693898 | |||
bbf00a6231 | |||
7f3febf4c0 | |||
489b5790cf | |||
6438fc4f79 | |||
![]() |
479ce00809 | ||
8a9912eaf8 | |||
d8cf6ee316 | |||
f807b27b67 | |||
0498feb0df | |||
bd678918ae | |||
f699ba3d30 | |||
9de18c361b | |||
70151e41dc | |||
b028a43245 | |||
3185e17844 | |||
14608c5e86 | |||
![]() |
2ef5fabec9 | ||
239b0ba750 | |||
08ec9b71df | |||
e0772c6607 | |||
826bd46e66 | |||
d4f7c7f4cc | |||
a7e1963b63 | |||
7773663eb7 | |||
70d48255ae | |||
e414afbaf6 | |||
c44251c7d7 | |||
![]() |
8ddf8cfa6f | ||
0e50b6529c | |||
6a10e69d27 | |||
8f545375f9 | |||
7fb11f22a2 | |||
add48c0074 | |||
88ada5e218 | |||
be4abb42c1 | |||
bbb6ec9e51 | |||
396d39c6b9 | |||
![]() |
6e06936c0e | ||
72bcb900d0 | |||
999667a8c5 | |||
97f75ca87f | |||
2c34e09b08 | |||
21cb6f09ff | |||
949d92ad5d | |||
b2b4f9fc9b | |||
c336947dbb | |||
33ac3582bb | |||
9dd4d87f18 | |||
b43f4fda19 | |||
e51c428be6 | |||
5f86a10477 | |||
8657c6cb71 | |||
![]() |
3ea324488a | ||
ac8825621f | |||
263cf2ea94 | |||
024a9d17d2 | |||
8bb93ca80a | |||
![]() |
141a8ff6b3 | ||
189ba40e9b | |||
5eb7aa5ebb | |||
96401e2ef8 | |||
46eca3366e | |||
5a634735e6 | |||
ed4c83f61f | |||
f5ca34d0b4 | |||
975fc39457 | |||
1bced5884c | |||
dc74d60915 | |||
8e18a99845 | |||
5303509354 | |||
734abaa252 | |||
950d857505 | |||
9498eb2692 | |||
39a09b536e | |||
5b021dff41 | |||
ee2e2f14ac | |||
![]() |
95cc709612 | ||
1cac6fe542 | |||
be920fe786 | |||
7ce764c9ec | |||
cb8da6efce | |||
4883cc5728 | |||
![]() |
afbc727da2 | ||
6b1b2ded77 | |||
35ef42d967 | |||
40edb84dcf | |||
e4932d1167 | |||
e74ba9e09e | |||
833bc70399 | |||
f18e537451 | |||
846cac94db | |||
72e78df464 | |||
ed288a5786 | |||
8f8ed8f567 | |||
2cf930adf3 | |||
010c1370af | |||
8f48a32f9f | |||
1885bf77b6 | |||
e26301f4d1 | |||
a204324966 | |||
a1f54be042 | |||
53d1f89322 | |||
70500121b4 | |||
74ded456b3 | |||
ebf10b72b0 | |||
661ba642f2 | |||
eed43a89dd | |||
c00707c18d | |||
995725c681 | |||
0de48f8550 | |||
bed634c4f9 | |||
71634d94ca | |||
79d678e677 | |||
76689e8517 | |||
2e630297af | |||
3a6e981bcd | |||
220fbdf593 | |||
1e95a7402c | |||
c4f122ac8f | |||
7edd8a7738 | |||
4f0a749489 | |||
933f0caec6 | |||
27f0a19bdc | |||
3bc09c1c1e | |||
e7767ba6be | |||
7aeaf5da0e | |||
31705201dd | |||
ea4c327c97 | |||
e18fdef39f | |||
1fbd713265 | |||
736636ca49 | |||
ff155a6677 | |||
d2a07a0bbf | |||
b890b97b67 | |||
ce170bdd4c | |||
fc1fee9916 | |||
9d9efbb2f8 | |||
21d542d068 | |||
aa5ad440a3 | |||
3fe313b954 | |||
2a7b44e33d | |||
598cac0ce6 | |||
1fc49878f5 | |||
30a4fbf57b | |||
b49bcbe68e | |||
7ac3dc69a8 | |||
81bdaefbd7 | |||
ba1efe851e | |||
dc68db427a | |||
03a8e74405 | |||
c452c66b70 | |||
d4ddba4b59 | |||
83c9b99e76 | |||
09d9ef45c6 |
@@ -253,8 +253,8 @@ ForEachMacros:
|
||||
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
|
||||
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
|
||||
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
|
||||
- SEQP_BEGIN
|
||||
- SEQ_BEGIN
|
||||
- SEQ_ALL_BEGIN
|
||||
- SEQ_CURRENT_BEGIN
|
||||
- SURFACE_QUAD_ITER_BEGIN
|
||||
- foreach
|
||||
- ED_screen_areas_iter
|
||||
|
@@ -102,6 +102,11 @@ if(POLICY CMP0068)
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
endif()
|
||||
|
||||
# find_package() uses <PackageName>_ROOT variables.
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
include(build_files/cmake/macros.cmake)
|
||||
@@ -183,6 +188,7 @@ if(APPLE)
|
||||
else()
|
||||
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
|
||||
endif()
|
||||
option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON)
|
||||
|
||||
# Compositor
|
||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||
@@ -1566,6 +1572,12 @@ endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above
|
||||
if(MSVC_VERSION GREATER 1913)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
|
||||
endif()
|
||||
elseif(
|
||||
CMAKE_COMPILER_IS_GNUCC OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
|
||||
@@ -1728,6 +1740,7 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_QUADRIFLOW)
|
||||
info_cfg_option(WITH_USD)
|
||||
info_cfg_option(WITH_TBB)
|
||||
info_cfg_option(WITH_GMP)
|
||||
|
||||
info_cfg_text("Compiler Options:")
|
||||
info_cfg_option(WITH_BUILDINFO)
|
||||
|
@@ -312,6 +312,7 @@ set(NASM_HASH f4fd1329b1713e1ccd34b2fc121c4bcd278c9f91cc4cb205ae8fcd2e4728dd14)
|
||||
set(XR_OPENXR_SDK_VERSION 1.0.8)
|
||||
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
|
||||
set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
|
||||
|
||||
set(ISPC_VERSION v1.13.0)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
|
||||
|
@@ -1087,7 +1087,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
||||
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
||||
* libsdl2, libglew, [libgmp], [libglewmx].\""
|
||||
* libsdl2, libglew, [libgmp], [libglewmx], fontconfig.\""
|
||||
|
||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||
|
||||
@@ -3654,7 +3654,7 @@ install_DEB() {
|
||||
THEORA_DEV="libtheora-dev"
|
||||
|
||||
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
|
||||
git libfreetype6-dev libx11-dev flex bison libxxf86vm-dev \
|
||||
git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \
|
||||
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
@@ -4320,7 +4320,7 @@ install_RPM() {
|
||||
OGG_DEV="libogg-devel"
|
||||
THEORA_DEV="libtheora-devel"
|
||||
|
||||
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
|
||||
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison fontconfig-devel \
|
||||
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
|
||||
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
@@ -4898,7 +4898,7 @@ install_ARCH() {
|
||||
BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
|
||||
fi
|
||||
|
||||
_packages="$BASE_DEVEL git cmake \
|
||||
_packages="$BASE_DEVEL git cmake fontconfig \
|
||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp"
|
||||
@@ -5577,7 +5577,7 @@ print_info() {
|
||||
|
||||
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
|
||||
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
|
||||
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
|
||||
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
|
||||
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
|
||||
|
||||
_1="-D WITH_CODEC_SNDFILE=ON"
|
||||
|
@@ -1,11 +0,0 @@
|
||||
--- UserMacros.cmake
|
||||
+++ UserMacros.cmake
|
||||
@@ -16,6 +16,8 @@
|
||||
if (BUILD_USER_DEFINED_LIBS)
|
||||
MACRO_USER_DEFINED_LIBS ()
|
||||
endif (BUILD_USER_DEFINED_LIBS)
|
||||
+
|
||||
+include(Config/cmake/usermacros/windows_mt.cmake)
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------- E X A M P L E E N D -----------------------------------
|
||||
#-----------------------------------------------------------------------------
|
@@ -10,77 +10,6 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
|
||||
add_definitions(${TBB_DEFINITIONS})
|
||||
|
||||
# --math
|
||||
diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plug/initConfig.cpp
|
||||
--- usd.orig/pxr/base/plug/initConfig.cpp.orig 2020-06-12 17:20:07.478199779 +0200
|
||||
+++ external_usd/pxr/base/plug/initConfig.cpp 2020-06-12 17:25:28.648588552 +0200
|
||||
@@ -69,10 +69,40 @@
|
||||
|
||||
ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void)
|
||||
{
|
||||
+ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */
|
||||
+}
|
||||
+
|
||||
+}; // end of anonymous namespace
|
||||
+
|
||||
+/**
|
||||
+ * The contents of this function used to be in the static constructor Plug_InitConfig.
|
||||
+ * This static constructor made it impossible for Blender to pass a path to the USD
|
||||
+ * library at runtime, as the constructor would run before Blender's main() function.
|
||||
+ *
|
||||
+ * This function is wrapped in a C function of the same name (defined below),
|
||||
+ * so that it can be called from Blender's main() function.
|
||||
+ *
|
||||
+ * The datafiles_usd_path path is used to point to the USD plugin path when Blender
|
||||
+ * has been installed. The fallback_usd_path path should point to the build-time
|
||||
+ * location of the USD plugin files so that Blender can be run on a development machine
|
||||
+ * without requiring an installation step.
|
||||
+ */
|
||||
+void
|
||||
+usd_initialise_plugin_path(const char *datafiles_usd_path)
|
||||
+{
|
||||
std::vector<std::string> result;
|
||||
|
||||
std::vector<std::string> debugMessages;
|
||||
|
||||
+ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory.
|
||||
+ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') {
|
||||
+ std::string datafiles_usd_path_str(datafiles_usd_path);
|
||||
+ if (datafiles_usd_path_str.back() != '/') {
|
||||
+ datafiles_usd_path_str += "/";
|
||||
+ }
|
||||
+ result.push_back(datafiles_usd_path_str);
|
||||
+ }
|
||||
+
|
||||
// Determine the absolute path to the Plug shared library. Any relative
|
||||
// paths specified in the plugin search path will be anchored to this
|
||||
// directory, to allow for relocatability. Note that this can fail when pxr
|
||||
@@ -114,9 +144,24 @@
|
||||
_AppendPathList(&result, installLocation, binaryPath);
|
||||
#endif // PXR_INSTALL_LOCATION
|
||||
|
||||
- Plug_SetPaths(result, debugMessages);
|
||||
-}
|
||||
+ if (!TfGetenv("PXR_PATH_DEBUG").empty()) {
|
||||
+ printf("USD Plugin paths: (%zu in total):\n", result.size());
|
||||
+ for(const std::string &path : result) {
|
||||
+ printf(" %s\n", path.c_str());
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ Plug_SetPaths(result, debugMessages);
|
||||
}
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
+
|
||||
+/* Workaround to make it possible to pass a path at runtime to USD. */
|
||||
+extern "C" {
|
||||
+void
|
||||
+usd_initialise_plugin_path(
|
||||
+ const char *datafiles_usd_path)
|
||||
+{
|
||||
+ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path);
|
||||
+}
|
||||
+}
|
||||
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
|
||||
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
|
||||
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
|
||||
|
@@ -59,6 +59,14 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
IF (NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
|
||||
IF (EMBREE_EMBREE3_LIBRARY)
|
||||
# If we can't find all the static libraries, try to fall back to the shared library if found.
|
||||
# This allows building with a shared embree library
|
||||
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
|
||||
BREAK()
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
|
@@ -80,7 +80,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
|
||||
GMP_LIBRARY GMPXX_LIBRARY GMP_INCLUDE_DIR GMPXX_INCLUDE_DIR)
|
||||
|
||||
IF(GMP_FOUND)
|
||||
SET(GMP_LIBRARIES ${GMP_LIBRARY} ${GMPXX_LIBRARY})
|
||||
SET(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
|
||||
SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
|
||||
ENDIF(GMP_FOUND)
|
||||
|
||||
|
@@ -70,6 +70,9 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
if(WITH_TBB)
|
||||
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_GMP)
|
||||
target_link_libraries(${TARGET_NAME} ${GMP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
|
@@ -15,11 +15,12 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
|
@@ -25,6 +25,7 @@ set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -16,11 +16,12 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
|
@@ -496,6 +496,10 @@ function(SETUP_LIBDIRS)
|
||||
link_directories(${ALEMBIC_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_GMP)
|
||||
link_directories(${GMP_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
link_directories(
|
||||
${wayland-client_LIBRARY_DIRS}
|
||||
|
@@ -407,6 +407,15 @@ if(WITH_TBB)
|
||||
find_package(TBB)
|
||||
endif()
|
||||
|
||||
if(WITH_GMP)
|
||||
find_package(GMP)
|
||||
|
||||
if(NOT GMP_FOUND)
|
||||
set(WITH_GMP OFF)
|
||||
message(STATUS "GMP not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
|
@@ -427,6 +427,15 @@ if(WITH_TBB)
|
||||
find_package_wrapper(TBB)
|
||||
endif()
|
||||
|
||||
if(WITH_GMP)
|
||||
find_package(GMP)
|
||||
|
||||
if(NOT GMP_FOUND)
|
||||
set(WITH_GMP OFF)
|
||||
message(STATUS "GMP not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_XR_OPENXR)
|
||||
find_package(XR_OpenXR_SDK)
|
||||
if(NOT XR_OPENXR_SDK_FOUND)
|
||||
|
@@ -136,6 +136,13 @@ add_definitions(
|
||||
# MSVC11 needs _ALLOW_KEYWORD_MACROS to build
|
||||
add_definitions(-D_ALLOW_KEYWORD_MACROS)
|
||||
|
||||
# RTTI is on by default even without this switch
|
||||
# however having it in the CXX Flags makes it difficult
|
||||
# to remove for individual files that want to disable it
|
||||
# using the /GR- flag without generating a build warning
|
||||
# that both /GR and /GR- are specified.
|
||||
remove_cc_flag("/GR")
|
||||
|
||||
# We want to support Windows 7 level ABI
|
||||
add_definitions(-D_WIN32_WINNT=0x601)
|
||||
include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
|
||||
|
File diff suppressed because it is too large
Load Diff
2
extern/audaspace/bindings/python/PySound.cpp
vendored
2
extern/audaspace/bindings/python/PySound.cpp
vendored
@@ -2016,7 +2016,7 @@ AUD_API Sound* checkSound(PyObject* sound)
|
||||
|
||||
bool initializeSound()
|
||||
{
|
||||
import_array();
|
||||
import_array1(false);
|
||||
|
||||
return PyType_Ready(&SoundType) >= 0;
|
||||
}
|
||||
|
3
extern/bullet2/CMakeLists.txt
vendored
3
extern/bullet2/CMakeLists.txt
vendored
@@ -419,7 +419,8 @@ if(MSVC)
|
||||
# bullet is responsible for quite a few silly warnings
|
||||
# suppress all of them. Not great, but they really needed
|
||||
# to sort that out themselves.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
|
||||
remove_cc_flag("/W3")
|
||||
add_c_flag("/W0")
|
||||
endif()
|
||||
|
||||
blender_add_lib(extern_bullet "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
3
extern/mantaflow/CMakeLists.txt
vendored
3
extern/mantaflow/CMakeLists.txt
vendored
@@ -64,9 +64,6 @@ endif()
|
||||
|
||||
if(WITH_OPENVDB)
|
||||
add_definitions(-DOPENVDB=1)
|
||||
if(NOT WIN32)
|
||||
add_definitions(-DOPENVDB_STATICLIB)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENVDB_BLOSC)
|
||||
|
3
extern/quadriflow/CMakeLists.txt
vendored
3
extern/quadriflow/CMakeLists.txt
vendored
@@ -28,9 +28,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
12
extern/quadriflow/patches/blender.patch
vendored
12
extern/quadriflow/patches/blender.patch
vendored
@@ -1,3 +1,15 @@
|
||||
diff --git a/extern/quadriflow/src/loader.cpp b/extern/quadriflow/src/loader.cpp
|
||||
--- a/extern/quadriflow/src/loader.cpp
|
||||
+++ b/extern/quadriflow/src/loader.cpp
|
||||
@@ -69,7 +69,7 @@
|
||||
};
|
||||
|
||||
/// Hash function for obj_vertex
|
||||
- struct obj_vertexHash : std::unary_function<obj_vertex, size_t> {
|
||||
+ struct obj_vertexHash {
|
||||
std::size_t operator()(const obj_vertex &v) const {
|
||||
size_t hash = std::hash<uint32_t>()(v.p);
|
||||
hash = hash * 37 + std::hash<uint32_t>()(v.uv);
|
||||
diff --git a/extern/quadriflow/src/config.hpp b/extern/quadriflow/src/config.hpp
|
||||
index 842b885..bf597ad 100644
|
||||
--- a/extern/quadriflow/src/config.hpp
|
||||
|
2
extern/quadriflow/src/loader.cpp
vendored
2
extern/quadriflow/src/loader.cpp
vendored
@@ -69,7 +69,7 @@ void load(const char* filename, MatrixXd& V, MatrixXi& F)
|
||||
};
|
||||
|
||||
/// Hash function for obj_vertex
|
||||
struct obj_vertexHash : std::unary_function<obj_vertex, size_t> {
|
||||
struct obj_vertexHash {
|
||||
std::size_t operator()(const obj_vertex &v) const {
|
||||
size_t hash = std::hash<uint32_t>()(v.p);
|
||||
hash = hash * 37 + std::hash<uint32_t>()(v.uv);
|
||||
|
@@ -132,13 +132,14 @@ void CLG_logf(CLG_LogType *lg,
|
||||
const char *format,
|
||||
...) _CLOG_ATTR_NONNULL(1, 3, 4, 5) _CLOG_ATTR_PRINTF_FORMAT(5, 6);
|
||||
|
||||
/* Main initializer and distructor (per session, not logger). */
|
||||
/* Main initializer and destructor (per session, not logger). */
|
||||
void CLG_init(void);
|
||||
void CLG_exit(void);
|
||||
|
||||
void CLG_output_set(void *file_handle);
|
||||
void CLG_output_use_basename_set(int value);
|
||||
void CLG_output_use_timestamp_set(int value);
|
||||
void CLG_error_fn_set(void (*error_fn)(void *file_handle));
|
||||
void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle));
|
||||
void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle));
|
||||
|
||||
|
@@ -98,6 +98,7 @@ typedef struct CLogContext {
|
||||
} default_type;
|
||||
|
||||
struct {
|
||||
void (*error_fn)(void *file_handle);
|
||||
void (*fatal_fn)(void *file_handle);
|
||||
void (*backtrace_fn)(void *file_handle);
|
||||
} callbacks;
|
||||
@@ -352,6 +353,13 @@ static CLG_LogType *clg_ctx_type_register(CLogContext *ctx, const char *identifi
|
||||
return ty;
|
||||
}
|
||||
|
||||
static void clg_ctx_error_action(CLogContext *ctx)
|
||||
{
|
||||
if (ctx->callbacks.error_fn != NULL) {
|
||||
ctx->callbacks.error_fn(ctx->output_file);
|
||||
}
|
||||
}
|
||||
|
||||
static void clg_ctx_fatal_action(CLogContext *ctx)
|
||||
{
|
||||
if (ctx->callbacks.fatal_fn != NULL) {
|
||||
@@ -522,6 +530,10 @@ void CLG_logf(CLG_LogType *lg,
|
||||
clg_ctx_backtrace(lg->ctx);
|
||||
}
|
||||
|
||||
if (severity == CLG_SEVERITY_ERROR) {
|
||||
clg_ctx_error_action(lg->ctx);
|
||||
}
|
||||
|
||||
if (severity == CLG_SEVERITY_FATAL) {
|
||||
clg_ctx_fatal_action(lg->ctx);
|
||||
}
|
||||
@@ -555,6 +567,12 @@ static void CLG_ctx_output_use_timestamp_set(CLogContext *ctx, int value)
|
||||
}
|
||||
}
|
||||
|
||||
/** Action on error severity. */
|
||||
static void CLT_ctx_error_fn_set(CLogContext *ctx, void (*error_fn)(void *file_handle))
|
||||
{
|
||||
ctx->callbacks.error_fn = error_fn;
|
||||
}
|
||||
|
||||
/** Action on fatal severity. */
|
||||
static void CLG_ctx_fatal_fn_set(CLogContext *ctx, void (*fatal_fn)(void *file_handle))
|
||||
{
|
||||
@@ -674,6 +692,11 @@ void CLG_output_use_timestamp_set(int value)
|
||||
CLG_ctx_output_use_timestamp_set(g_ctx, value);
|
||||
}
|
||||
|
||||
void CLG_error_fn_set(void (*error_fn)(void *file_handle))
|
||||
{
|
||||
CLT_ctx_error_fn_set(g_ctx, error_fn);
|
||||
}
|
||||
|
||||
void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle))
|
||||
{
|
||||
CLG_ctx_fatal_fn_set(g_ctx, fatal_fn);
|
||||
|
@@ -292,7 +292,7 @@ static void xml_read_shader_graph(XMLReadState &state, Shader *shader, xml_node
|
||||
filepath = path_join(state.base, filepath);
|
||||
}
|
||||
|
||||
snode = OSLShaderManager::osl_node(manager, filepath);
|
||||
snode = OSLShaderManager::osl_node(graph, manager, filepath, "");
|
||||
|
||||
if (!snode) {
|
||||
fprintf(stderr, "Failed to create OSL node from \"%s\".\n", filepath.c_str());
|
||||
|
@@ -83,13 +83,13 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
||||
if (geom == NULL) {
|
||||
/* Add new geometry if it did not exist yet. */
|
||||
if (geom_type == Geometry::HAIR) {
|
||||
geom = new Hair();
|
||||
geom = scene->create_node<Hair>();
|
||||
}
|
||||
else if (geom_type == Geometry::VOLUME) {
|
||||
geom = new Volume();
|
||||
geom = scene->create_node<Volume>();
|
||||
}
|
||||
else {
|
||||
geom = new Mesh();
|
||||
geom = scene->create_node<Mesh>();
|
||||
}
|
||||
geometry_map.add(key, geom);
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "render/scene.h"
|
||||
|
||||
#include "util/util_map.h"
|
||||
#include "util/util_set.h"
|
||||
#include "util/util_vector.h"
|
||||
@@ -32,9 +34,8 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
template<typename K, typename T> class id_map {
|
||||
public:
|
||||
id_map(vector<T *> *scene_data_)
|
||||
id_map()
|
||||
{
|
||||
scene_data = scene_data_;
|
||||
}
|
||||
|
||||
T *find(const BL::ID &id)
|
||||
@@ -76,7 +77,6 @@ template<typename K, typename T> class id_map {
|
||||
void add(const K &key, T *data)
|
||||
{
|
||||
assert(find(key) == NULL);
|
||||
scene_data->push_back(data);
|
||||
b_map[key] = data;
|
||||
used(data);
|
||||
}
|
||||
@@ -97,22 +97,23 @@ template<typename K, typename T> class id_map {
|
||||
}
|
||||
|
||||
/* Combined add and update as needed. */
|
||||
bool add_or_update(T **r_data, const BL::ID &id)
|
||||
bool add_or_update(Scene *scene, T **r_data, const BL::ID &id)
|
||||
{
|
||||
return add_or_update(r_data, id, id, id.ptr.owner_id);
|
||||
return add_or_update(scene, r_data, id, id, id.ptr.owner_id);
|
||||
}
|
||||
bool add_or_update(T **r_data, const BL::ID &id, const K &key)
|
||||
bool add_or_update(Scene *scene, T **r_data, const BL::ID &id, const K &key)
|
||||
{
|
||||
return add_or_update(r_data, id, id, key);
|
||||
return add_or_update(scene, r_data, id, id, key);
|
||||
}
|
||||
bool add_or_update(T **r_data, const BL::ID &id, const BL::ID &parent, const K &key)
|
||||
bool add_or_update(
|
||||
Scene *scene, T **r_data, const BL::ID &id, const BL::ID &parent, const K &key)
|
||||
{
|
||||
T *data = find(key);
|
||||
bool recalc;
|
||||
|
||||
if (!data) {
|
||||
/* Add data if it didn't exist yet. */
|
||||
data = new T();
|
||||
data = scene->create_node<T>();
|
||||
add(key, data);
|
||||
recalc = true;
|
||||
}
|
||||
@@ -144,27 +145,8 @@ template<typename K, typename T> class id_map {
|
||||
b_map[NULL] = data;
|
||||
}
|
||||
|
||||
bool post_sync(bool do_delete = true)
|
||||
void post_sync(Scene *scene, bool do_delete = true)
|
||||
{
|
||||
/* remove unused data */
|
||||
vector<T *> new_scene_data;
|
||||
typename vector<T *>::iterator it;
|
||||
bool deleted = false;
|
||||
|
||||
for (it = scene_data->begin(); it != scene_data->end(); it++) {
|
||||
T *data = *it;
|
||||
|
||||
if (do_delete && used_set.find(data) == used_set.end()) {
|
||||
delete data;
|
||||
deleted = true;
|
||||
}
|
||||
else
|
||||
new_scene_data.push_back(data);
|
||||
}
|
||||
|
||||
*scene_data = new_scene_data;
|
||||
|
||||
/* update mapping */
|
||||
map<K, T *> new_map;
|
||||
typedef pair<const K, T *> TMapPair;
|
||||
typename map<K, T *>::iterator jt;
|
||||
@@ -172,15 +154,17 @@ template<typename K, typename T> class id_map {
|
||||
for (jt = b_map.begin(); jt != b_map.end(); jt++) {
|
||||
TMapPair &pair = *jt;
|
||||
|
||||
if (used_set.find(pair.second) != used_set.end())
|
||||
if (do_delete && used_set.find(pair.second) == used_set.end()) {
|
||||
scene->delete_node(pair.second);
|
||||
}
|
||||
else {
|
||||
new_map[pair.first] = pair.second;
|
||||
}
|
||||
}
|
||||
|
||||
used_set.clear();
|
||||
b_recalc.clear();
|
||||
b_map = new_map;
|
||||
|
||||
return deleted;
|
||||
}
|
||||
|
||||
const map<K, T *> &key_to_scene_data()
|
||||
@@ -189,7 +173,6 @@ template<typename K, typename T> class id_map {
|
||||
}
|
||||
|
||||
protected:
|
||||
vector<T *> *scene_data;
|
||||
map<K, T *> b_map;
|
||||
set<T *> used_set;
|
||||
set<void *> b_recalc;
|
||||
|
@@ -39,9 +39,9 @@ void BlenderSync::sync_light(BL::Object &b_parent,
|
||||
BL::Light b_light(b_ob.data());
|
||||
|
||||
/* Update if either object or light data changed. */
|
||||
if (!light_map.add_or_update(&light, b_ob, b_parent, key)) {
|
||||
if (!light_map.add_or_update(scene, &light, b_ob, b_parent, key)) {
|
||||
Shader *shader;
|
||||
if (!shader_map.add_or_update(&shader, b_light)) {
|
||||
if (!shader_map.add_or_update(scene, &shader, b_light)) {
|
||||
if (light->is_portal)
|
||||
*use_portal = true;
|
||||
return;
|
||||
@@ -176,7 +176,7 @@ void BlenderSync::sync_background_light(BL::SpaceView3D &b_v3d, bool use_portal)
|
||||
Light *light;
|
||||
ObjectKey key(b_world, 0, b_world, false);
|
||||
|
||||
if (light_map.add_or_update(&light, b_world, b_world, key) || world_recalc ||
|
||||
if (light_map.add_or_update(scene, &light, b_world, b_world, key) || world_recalc ||
|
||||
b_world.ptr.data != world_map) {
|
||||
light->type = LIGHT_BACKGROUND;
|
||||
if (sampling_method == SAMPLING_MANUAL) {
|
||||
|
@@ -923,48 +923,34 @@ static void create_subd_mesh(Scene *scene,
|
||||
|
||||
/* Sync */
|
||||
|
||||
static BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob,
|
||||
BL::Scene /*b_scene*/)
|
||||
static BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob)
|
||||
{
|
||||
BL::Object::modifiers_iterator b_mod;
|
||||
if (b_ob.modifiers.length() > 0) {
|
||||
BL::Modifier b_mod = b_ob.modifiers[b_ob.modifiers.length() - 1];
|
||||
|
||||
for (b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); ++b_mod) {
|
||||
if (!b_mod->is_a(&RNA_MeshSequenceCacheModifier)) {
|
||||
continue;
|
||||
}
|
||||
if (b_mod.type() == BL::Modifier::type_MESH_SEQUENCE_CACHE) {
|
||||
BL::MeshSequenceCacheModifier mesh_cache = BL::MeshSequenceCacheModifier(b_mod);
|
||||
|
||||
BL::MeshSequenceCacheModifier mesh_cache = BL::MeshSequenceCacheModifier(*b_mod);
|
||||
|
||||
if (MeshSequenceCacheModifier_has_velocity_get(&mesh_cache.ptr)) {
|
||||
return mesh_cache;
|
||||
if (MeshSequenceCacheModifier_has_velocity_get(&mesh_cache.ptr)) {
|
||||
return mesh_cache;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return BL::MeshSequenceCacheModifier(PointerRNA_NULL);
|
||||
}
|
||||
|
||||
static void sync_mesh_cached_velocities(BL::Object &b_ob,
|
||||
BL::Scene b_scene,
|
||||
Scene *scene,
|
||||
Mesh *mesh)
|
||||
static void sync_mesh_cached_velocities(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
||||
{
|
||||
if (scene->need_motion() == Scene::MOTION_NONE)
|
||||
return;
|
||||
|
||||
BL::MeshSequenceCacheModifier b_mesh_cache = object_mesh_cache_find(b_ob, b_scene);
|
||||
BL::MeshSequenceCacheModifier b_mesh_cache = object_mesh_cache_find(b_ob);
|
||||
|
||||
if (!b_mesh_cache) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find or add attribute */
|
||||
float3 *P = &mesh->verts[0];
|
||||
Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
|
||||
if (!attr_mP) {
|
||||
attr_mP = mesh->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
}
|
||||
|
||||
if (!MeshSequenceCacheModifier_read_velocity_get(&b_mesh_cache.ptr)) {
|
||||
return;
|
||||
}
|
||||
@@ -975,6 +961,14 @@ static void sync_mesh_cached_velocities(BL::Object &b_ob,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Find or add attribute */
|
||||
float3 *P = &mesh->verts[0];
|
||||
Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
|
||||
if (!attr_mP) {
|
||||
attr_mP = mesh->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
}
|
||||
|
||||
/* Only export previous and next frame, we don't have any in between data. */
|
||||
float motion_times[2] = {-1.0f, 1.0f};
|
||||
for (int step = 0; step < 2; step++) {
|
||||
@@ -1071,7 +1065,7 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph,
|
||||
}
|
||||
|
||||
/* cached velocities (e.g. from alembic archive) */
|
||||
sync_mesh_cached_velocities(b_ob, b_depsgraph.scene(), scene, mesh);
|
||||
sync_mesh_cached_velocities(b_ob, scene, mesh);
|
||||
|
||||
/* mesh fluid motion mantaflow */
|
||||
sync_mesh_fluid_motion(b_ob, scene, mesh);
|
||||
@@ -1095,7 +1089,7 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph b_depsgraph,
|
||||
}
|
||||
|
||||
/* Cached motion blur already exported. */
|
||||
BL::MeshSequenceCacheModifier mesh_cache = object_mesh_cache_find(b_ob, b_scene);
|
||||
BL::MeshSequenceCacheModifier mesh_cache = object_mesh_cache_find(b_ob);
|
||||
if (mesh_cache) {
|
||||
return;
|
||||
}
|
||||
|
@@ -207,7 +207,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
/* test if we need to sync */
|
||||
bool object_updated = false;
|
||||
|
||||
if (object_map.add_or_update(&object, b_ob, b_parent, key))
|
||||
if (object_map.add_or_update(scene, &object, b_ob, b_parent, key))
|
||||
object_updated = true;
|
||||
|
||||
/* mesh sync */
|
||||
@@ -405,14 +405,10 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
|
||||
sync_background_light(b_v3d, use_portal);
|
||||
|
||||
/* handle removed data and modified pointers */
|
||||
if (light_map.post_sync())
|
||||
scene->light_manager->tag_update(scene);
|
||||
if (geometry_map.post_sync())
|
||||
scene->geometry_manager->tag_update(scene);
|
||||
if (object_map.post_sync())
|
||||
scene->object_manager->tag_update(scene);
|
||||
if (particle_system_map.post_sync())
|
||||
scene->particle_system_manager->tag_update(scene);
|
||||
light_map.post_sync(scene);
|
||||
geometry_map.post_sync(scene);
|
||||
object_map.post_sync(scene);
|
||||
particle_system_map.post_sync(scene);
|
||||
}
|
||||
|
||||
if (motion)
|
||||
|
@@ -53,7 +53,8 @@ bool BlenderSync::sync_dupli_particle(BL::Object &b_ob,
|
||||
ParticleSystem *psys;
|
||||
|
||||
bool first_use = !particle_system_map.is_used(key);
|
||||
bool need_update = particle_system_map.add_or_update(&psys, b_ob, b_instance.object(), key);
|
||||
bool need_update = particle_system_map.add_or_update(
|
||||
scene, &psys, b_ob, b_instance.object(), key);
|
||||
|
||||
/* no update needed? */
|
||||
if (!need_update && !object->geometry->need_update && !scene->object_manager->need_update)
|
||||
|
@@ -363,7 +363,8 @@ void BlenderSession::do_write_update_render_tile(RenderTile &rtile,
|
||||
PassType pass_type = BlenderSync::get_pass_type(b_pass);
|
||||
int components = b_pass.channels();
|
||||
|
||||
rtile.buffers->set_pass_rect(pass_type, components, (float *)b_pass.rect());
|
||||
rtile.buffers->set_pass_rect(
|
||||
pass_type, components, (float *)b_pass.rect(), rtile.num_samples);
|
||||
}
|
||||
|
||||
end_render_result(b_engine, b_rr, false, false, false);
|
||||
|
@@ -224,7 +224,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
if (b_node.is_a(&RNA_ShaderNodeRGBCurve)) {
|
||||
BL::ShaderNodeRGBCurve b_curve_node(b_node);
|
||||
BL::CurveMapping mapping(b_curve_node.mapping());
|
||||
RGBCurvesNode *curves = new RGBCurvesNode();
|
||||
RGBCurvesNode *curves = graph->create_node<RGBCurvesNode>();
|
||||
curvemapping_color_to_array(mapping, curves->curves, RAMP_TABLE_SIZE, true);
|
||||
curvemapping_minmax(mapping, true, &curves->min_x, &curves->max_x);
|
||||
node = curves;
|
||||
@@ -232,13 +232,13 @@ static ShaderNode *add_node(Scene *scene,
|
||||
if (b_node.is_a(&RNA_ShaderNodeVectorCurve)) {
|
||||
BL::ShaderNodeVectorCurve b_curve_node(b_node);
|
||||
BL::CurveMapping mapping(b_curve_node.mapping());
|
||||
VectorCurvesNode *curves = new VectorCurvesNode();
|
||||
VectorCurvesNode *curves = graph->create_node<VectorCurvesNode>();
|
||||
curvemapping_color_to_array(mapping, curves->curves, RAMP_TABLE_SIZE, false);
|
||||
curvemapping_minmax(mapping, false, &curves->min_x, &curves->max_x);
|
||||
node = curves;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeValToRGB)) {
|
||||
RGBRampNode *ramp = new RGBRampNode();
|
||||
RGBRampNode *ramp = graph->create_node<RGBRampNode>();
|
||||
BL::ShaderNodeValToRGB b_ramp_node(b_node);
|
||||
BL::ColorRamp b_color_ramp(b_ramp_node.color_ramp());
|
||||
colorramp_to_array(b_color_ramp, ramp->ramp, ramp->ramp_alpha, RAMP_TABLE_SIZE);
|
||||
@@ -246,94 +246,94 @@ static ShaderNode *add_node(Scene *scene,
|
||||
node = ramp;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeRGB)) {
|
||||
ColorNode *color = new ColorNode();
|
||||
ColorNode *color = graph->create_node<ColorNode>();
|
||||
color->value = get_node_output_rgba(b_node, "Color");
|
||||
node = color;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeValue)) {
|
||||
ValueNode *value = new ValueNode();
|
||||
ValueNode *value = graph->create_node<ValueNode>();
|
||||
value->value = get_node_output_value(b_node, "Value");
|
||||
node = value;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeCameraData)) {
|
||||
node = new CameraNode();
|
||||
node = graph->create_node<CameraNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeInvert)) {
|
||||
node = new InvertNode();
|
||||
node = graph->create_node<InvertNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeGamma)) {
|
||||
node = new GammaNode();
|
||||
node = graph->create_node<GammaNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBrightContrast)) {
|
||||
node = new BrightContrastNode();
|
||||
node = graph->create_node<BrightContrastNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeMixRGB)) {
|
||||
BL::ShaderNodeMixRGB b_mix_node(b_node);
|
||||
MixNode *mix = new MixNode();
|
||||
MixNode *mix = graph->create_node<MixNode>();
|
||||
mix->type = (NodeMix)b_mix_node.blend_type();
|
||||
mix->use_clamp = b_mix_node.use_clamp();
|
||||
node = mix;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeSeparateRGB)) {
|
||||
node = new SeparateRGBNode();
|
||||
node = graph->create_node<SeparateRGBNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeCombineRGB)) {
|
||||
node = new CombineRGBNode();
|
||||
node = graph->create_node<CombineRGBNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeSeparateHSV)) {
|
||||
node = new SeparateHSVNode();
|
||||
node = graph->create_node<SeparateHSVNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeCombineHSV)) {
|
||||
node = new CombineHSVNode();
|
||||
node = graph->create_node<CombineHSVNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeSeparateXYZ)) {
|
||||
node = new SeparateXYZNode();
|
||||
node = graph->create_node<SeparateXYZNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeCombineXYZ)) {
|
||||
node = new CombineXYZNode();
|
||||
node = graph->create_node<CombineXYZNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeHueSaturation)) {
|
||||
node = new HSVNode();
|
||||
node = graph->create_node<HSVNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeRGBToBW)) {
|
||||
node = new RGBToBWNode();
|
||||
node = graph->create_node<RGBToBWNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeMapRange)) {
|
||||
BL::ShaderNodeMapRange b_map_range_node(b_node);
|
||||
MapRangeNode *map_range_node = new MapRangeNode();
|
||||
MapRangeNode *map_range_node = graph->create_node<MapRangeNode>();
|
||||
map_range_node->clamp = b_map_range_node.clamp();
|
||||
map_range_node->type = (NodeMapRangeType)b_map_range_node.interpolation_type();
|
||||
node = map_range_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeClamp)) {
|
||||
BL::ShaderNodeClamp b_clamp_node(b_node);
|
||||
ClampNode *clamp_node = new ClampNode();
|
||||
ClampNode *clamp_node = graph->create_node<ClampNode>();
|
||||
clamp_node->type = (NodeClampType)b_clamp_node.clamp_type();
|
||||
node = clamp_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeMath)) {
|
||||
BL::ShaderNodeMath b_math_node(b_node);
|
||||
MathNode *math_node = new MathNode();
|
||||
MathNode *math_node = graph->create_node<MathNode>();
|
||||
math_node->type = (NodeMathType)b_math_node.operation();
|
||||
math_node->use_clamp = b_math_node.use_clamp();
|
||||
node = math_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVectorMath)) {
|
||||
BL::ShaderNodeVectorMath b_vector_math_node(b_node);
|
||||
VectorMathNode *vector_math_node = new VectorMathNode();
|
||||
VectorMathNode *vector_math_node = graph->create_node<VectorMathNode>();
|
||||
vector_math_node->type = (NodeVectorMathType)b_vector_math_node.operation();
|
||||
node = vector_math_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVectorRotate)) {
|
||||
BL::ShaderNodeVectorRotate b_vector_rotate_node(b_node);
|
||||
VectorRotateNode *vector_rotate_node = new VectorRotateNode();
|
||||
VectorRotateNode *vector_rotate_node = graph->create_node<VectorRotateNode>();
|
||||
vector_rotate_node->type = (NodeVectorRotateType)b_vector_rotate_node.rotation_type();
|
||||
vector_rotate_node->invert = b_vector_rotate_node.invert();
|
||||
node = vector_rotate_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVectorTransform)) {
|
||||
BL::ShaderNodeVectorTransform b_vector_transform_node(b_node);
|
||||
VectorTransformNode *vtransform = new VectorTransformNode();
|
||||
VectorTransformNode *vtransform = graph->create_node<VectorTransformNode>();
|
||||
vtransform->type = (NodeVectorTransformType)b_vector_transform_node.vector_type();
|
||||
vtransform->convert_from = (NodeVectorTransformConvertSpace)
|
||||
b_vector_transform_node.convert_from();
|
||||
@@ -344,43 +344,43 @@ static ShaderNode *add_node(Scene *scene,
|
||||
BL::Node::outputs_iterator out_it;
|
||||
b_node.outputs.begin(out_it);
|
||||
|
||||
NormalNode *norm = new NormalNode();
|
||||
NormalNode *norm = graph->create_node<NormalNode>();
|
||||
norm->direction = get_node_output_vector(b_node, "Normal");
|
||||
node = norm;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeMapping)) {
|
||||
BL::ShaderNodeMapping b_mapping_node(b_node);
|
||||
MappingNode *mapping = new MappingNode();
|
||||
MappingNode *mapping = graph->create_node<MappingNode>();
|
||||
mapping->type = (NodeMappingType)b_mapping_node.vector_type();
|
||||
node = mapping;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeFresnel)) {
|
||||
node = new FresnelNode();
|
||||
node = graph->create_node<FresnelNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeLayerWeight)) {
|
||||
node = new LayerWeightNode();
|
||||
node = graph->create_node<LayerWeightNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeAddShader)) {
|
||||
node = new AddClosureNode();
|
||||
node = graph->create_node<AddClosureNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeMixShader)) {
|
||||
node = new MixClosureNode();
|
||||
node = graph->create_node<MixClosureNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeAttribute)) {
|
||||
BL::ShaderNodeAttribute b_attr_node(b_node);
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
AttributeNode *attr = graph->create_node<AttributeNode>();
|
||||
attr->attribute = b_attr_node.attribute_name();
|
||||
node = attr;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBackground)) {
|
||||
node = new BackgroundNode();
|
||||
node = graph->create_node<BackgroundNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeHoldout)) {
|
||||
node = new HoldoutNode();
|
||||
node = graph->create_node<HoldoutNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfAnisotropic)) {
|
||||
BL::ShaderNodeBsdfAnisotropic b_aniso_node(b_node);
|
||||
AnisotropicBsdfNode *aniso = new AnisotropicBsdfNode();
|
||||
AnisotropicBsdfNode *aniso = graph->create_node<AnisotropicBsdfNode>();
|
||||
|
||||
switch (b_aniso_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfAnisotropic::distribution_BECKMANN:
|
||||
@@ -400,12 +400,12 @@ static ShaderNode *add_node(Scene *scene,
|
||||
node = aniso;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfDiffuse)) {
|
||||
node = new DiffuseBsdfNode();
|
||||
node = graph->create_node<DiffuseBsdfNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeSubsurfaceScattering)) {
|
||||
BL::ShaderNodeSubsurfaceScattering b_subsurface_node(b_node);
|
||||
|
||||
SubsurfaceScatteringNode *subsurface = new SubsurfaceScatteringNode();
|
||||
SubsurfaceScatteringNode *subsurface = graph->create_node<SubsurfaceScatteringNode>();
|
||||
|
||||
switch (b_subsurface_node.falloff()) {
|
||||
case BL::ShaderNodeSubsurfaceScattering::falloff_CUBIC:
|
||||
@@ -426,7 +426,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfGlossy)) {
|
||||
BL::ShaderNodeBsdfGlossy b_glossy_node(b_node);
|
||||
GlossyBsdfNode *glossy = new GlossyBsdfNode();
|
||||
GlossyBsdfNode *glossy = graph->create_node<GlossyBsdfNode>();
|
||||
|
||||
switch (b_glossy_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfGlossy::distribution_SHARP:
|
||||
@@ -449,7 +449,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfGlass)) {
|
||||
BL::ShaderNodeBsdfGlass b_glass_node(b_node);
|
||||
GlassBsdfNode *glass = new GlassBsdfNode();
|
||||
GlassBsdfNode *glass = graph->create_node<GlassBsdfNode>();
|
||||
switch (b_glass_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfGlass::distribution_SHARP:
|
||||
glass->distribution = CLOSURE_BSDF_SHARP_GLASS_ID;
|
||||
@@ -468,7 +468,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfRefraction)) {
|
||||
BL::ShaderNodeBsdfRefraction b_refraction_node(b_node);
|
||||
RefractionBsdfNode *refraction = new RefractionBsdfNode();
|
||||
RefractionBsdfNode *refraction = graph->create_node<RefractionBsdfNode>();
|
||||
switch (b_refraction_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfRefraction::distribution_SHARP:
|
||||
refraction->distribution = CLOSURE_BSDF_REFRACTION_ID;
|
||||
@@ -484,7 +484,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfToon)) {
|
||||
BL::ShaderNodeBsdfToon b_toon_node(b_node);
|
||||
ToonBsdfNode *toon = new ToonBsdfNode();
|
||||
ToonBsdfNode *toon = graph->create_node<ToonBsdfNode>();
|
||||
switch (b_toon_node.component()) {
|
||||
case BL::ShaderNodeBsdfToon::component_DIFFUSE:
|
||||
toon->component = CLOSURE_BSDF_DIFFUSE_TOON_ID;
|
||||
@@ -497,7 +497,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfHair)) {
|
||||
BL::ShaderNodeBsdfHair b_hair_node(b_node);
|
||||
HairBsdfNode *hair = new HairBsdfNode();
|
||||
HairBsdfNode *hair = graph->create_node<HairBsdfNode>();
|
||||
switch (b_hair_node.component()) {
|
||||
case BL::ShaderNodeBsdfHair::component_Reflection:
|
||||
hair->component = CLOSURE_BSDF_HAIR_REFLECTION_ID;
|
||||
@@ -510,7 +510,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfHairPrincipled)) {
|
||||
BL::ShaderNodeBsdfHairPrincipled b_principled_hair_node(b_node);
|
||||
PrincipledHairBsdfNode *principled_hair = new PrincipledHairBsdfNode();
|
||||
PrincipledHairBsdfNode *principled_hair = graph->create_node<PrincipledHairBsdfNode>();
|
||||
principled_hair->parametrization = (NodePrincipledHairParametrization)get_enum(
|
||||
b_principled_hair_node.ptr,
|
||||
"parametrization",
|
||||
@@ -520,7 +520,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfPrincipled)) {
|
||||
BL::ShaderNodeBsdfPrincipled b_principled_node(b_node);
|
||||
PrincipledBsdfNode *principled = new PrincipledBsdfNode();
|
||||
PrincipledBsdfNode *principled = graph->create_node<PrincipledBsdfNode>();
|
||||
switch (b_principled_node.distribution()) {
|
||||
case BL::ShaderNodeBsdfPrincipled::distribution_GGX:
|
||||
principled->distribution = CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID;
|
||||
@@ -540,77 +540,77 @@ static ShaderNode *add_node(Scene *scene,
|
||||
node = principled;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfTranslucent)) {
|
||||
node = new TranslucentBsdfNode();
|
||||
node = graph->create_node<TranslucentBsdfNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfTransparent)) {
|
||||
node = new TransparentBsdfNode();
|
||||
node = graph->create_node<TransparentBsdfNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBsdfVelvet)) {
|
||||
node = new VelvetBsdfNode();
|
||||
node = graph->create_node<VelvetBsdfNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeEmission)) {
|
||||
node = new EmissionNode();
|
||||
node = graph->create_node<EmissionNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeAmbientOcclusion)) {
|
||||
BL::ShaderNodeAmbientOcclusion b_ao_node(b_node);
|
||||
AmbientOcclusionNode *ao = new AmbientOcclusionNode();
|
||||
AmbientOcclusionNode *ao = graph->create_node<AmbientOcclusionNode>();
|
||||
ao->samples = b_ao_node.samples();
|
||||
ao->inside = b_ao_node.inside();
|
||||
ao->only_local = b_ao_node.only_local();
|
||||
node = ao;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVolumeScatter)) {
|
||||
node = new ScatterVolumeNode();
|
||||
node = graph->create_node<ScatterVolumeNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVolumeAbsorption)) {
|
||||
node = new AbsorptionVolumeNode();
|
||||
node = graph->create_node<AbsorptionVolumeNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVolumePrincipled)) {
|
||||
PrincipledVolumeNode *principled = new PrincipledVolumeNode();
|
||||
PrincipledVolumeNode *principled = graph->create_node<PrincipledVolumeNode>();
|
||||
node = principled;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeNewGeometry)) {
|
||||
node = new GeometryNode();
|
||||
node = graph->create_node<GeometryNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeWireframe)) {
|
||||
BL::ShaderNodeWireframe b_wireframe_node(b_node);
|
||||
WireframeNode *wire = new WireframeNode();
|
||||
WireframeNode *wire = graph->create_node<WireframeNode>();
|
||||
wire->use_pixel_size = b_wireframe_node.use_pixel_size();
|
||||
node = wire;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeWavelength)) {
|
||||
node = new WavelengthNode();
|
||||
node = graph->create_node<WavelengthNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBlackbody)) {
|
||||
node = new BlackbodyNode();
|
||||
node = graph->create_node<BlackbodyNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeLightPath)) {
|
||||
node = new LightPathNode();
|
||||
node = graph->create_node<LightPathNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeLightFalloff)) {
|
||||
node = new LightFalloffNode();
|
||||
node = graph->create_node<LightFalloffNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeObjectInfo)) {
|
||||
node = new ObjectInfoNode();
|
||||
node = graph->create_node<ObjectInfoNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeParticleInfo)) {
|
||||
node = new ParticleInfoNode();
|
||||
node = graph->create_node<ParticleInfoNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeHairInfo)) {
|
||||
node = new HairInfoNode();
|
||||
node = graph->create_node<HairInfoNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVolumeInfo)) {
|
||||
node = new VolumeInfoNode();
|
||||
node = graph->create_node<VolumeInfoNode>();
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVertexColor)) {
|
||||
BL::ShaderNodeVertexColor b_vertex_color_node(b_node);
|
||||
VertexColorNode *vertex_color_node = new VertexColorNode();
|
||||
VertexColorNode *vertex_color_node = graph->create_node<VertexColorNode>();
|
||||
vertex_color_node->layer_name = b_vertex_color_node.layer_name();
|
||||
node = vertex_color_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBump)) {
|
||||
BL::ShaderNodeBump b_bump_node(b_node);
|
||||
BumpNode *bump = new BumpNode();
|
||||
BumpNode *bump = graph->create_node<BumpNode>();
|
||||
bump->invert = b_bump_node.invert();
|
||||
node = bump;
|
||||
}
|
||||
@@ -624,12 +624,13 @@ static ShaderNode *add_node(Scene *scene,
|
||||
string bytecode_hash = b_script_node.bytecode_hash();
|
||||
|
||||
if (!bytecode_hash.empty()) {
|
||||
node = OSLShaderManager::osl_node(manager, "", bytecode_hash, b_script_node.bytecode());
|
||||
node = OSLShaderManager::osl_node(
|
||||
graph, manager, "", bytecode_hash, b_script_node.bytecode());
|
||||
}
|
||||
else {
|
||||
string absolute_filepath = blender_absolute_path(
|
||||
b_data, b_ntree, b_script_node.filepath());
|
||||
node = OSLShaderManager::osl_node(manager, absolute_filepath, "");
|
||||
node = OSLShaderManager::osl_node(graph, manager, absolute_filepath, "");
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -641,7 +642,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
BL::ShaderNodeTexImage b_image_node(b_node);
|
||||
BL::Image b_image(b_image_node.image());
|
||||
BL::ImageUser b_image_user(b_image_node.image_user());
|
||||
ImageTextureNode *image = new ImageTextureNode();
|
||||
ImageTextureNode *image = graph->create_node<ImageTextureNode>();
|
||||
|
||||
image->interpolation = get_image_interpolation(b_image_node);
|
||||
image->extension = get_image_extension(b_image_node);
|
||||
@@ -693,7 +694,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
BL::ShaderNodeTexEnvironment b_env_node(b_node);
|
||||
BL::Image b_image(b_env_node.image());
|
||||
BL::ImageUser b_image_user(b_env_node.image_user());
|
||||
EnvironmentTextureNode *env = new EnvironmentTextureNode();
|
||||
EnvironmentTextureNode *env = graph->create_node<EnvironmentTextureNode>();
|
||||
|
||||
env->interpolation = get_image_interpolation(b_env_node);
|
||||
env->projection = (NodeEnvironmentProjection)b_env_node.projection();
|
||||
@@ -726,7 +727,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexGradient)) {
|
||||
BL::ShaderNodeTexGradient b_gradient_node(b_node);
|
||||
GradientTextureNode *gradient = new GradientTextureNode();
|
||||
GradientTextureNode *gradient = graph->create_node<GradientTextureNode>();
|
||||
gradient->type = (NodeGradientType)b_gradient_node.gradient_type();
|
||||
BL::TexMapping b_texture_mapping(b_gradient_node.texture_mapping());
|
||||
get_tex_mapping(&gradient->tex_mapping, b_texture_mapping);
|
||||
@@ -734,7 +735,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexVoronoi)) {
|
||||
BL::ShaderNodeTexVoronoi b_voronoi_node(b_node);
|
||||
VoronoiTextureNode *voronoi = new VoronoiTextureNode();
|
||||
VoronoiTextureNode *voronoi = graph->create_node<VoronoiTextureNode>();
|
||||
voronoi->dimensions = b_voronoi_node.voronoi_dimensions();
|
||||
voronoi->feature = (NodeVoronoiFeature)b_voronoi_node.feature();
|
||||
voronoi->metric = (NodeVoronoiDistanceMetric)b_voronoi_node.distance();
|
||||
@@ -744,7 +745,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexMagic)) {
|
||||
BL::ShaderNodeTexMagic b_magic_node(b_node);
|
||||
MagicTextureNode *magic = new MagicTextureNode();
|
||||
MagicTextureNode *magic = graph->create_node<MagicTextureNode>();
|
||||
magic->depth = b_magic_node.turbulence_depth();
|
||||
BL::TexMapping b_texture_mapping(b_magic_node.texture_mapping());
|
||||
get_tex_mapping(&magic->tex_mapping, b_texture_mapping);
|
||||
@@ -752,7 +753,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexWave)) {
|
||||
BL::ShaderNodeTexWave b_wave_node(b_node);
|
||||
WaveTextureNode *wave = new WaveTextureNode();
|
||||
WaveTextureNode *wave = graph->create_node<WaveTextureNode>();
|
||||
wave->type = (NodeWaveType)b_wave_node.wave_type();
|
||||
wave->bands_direction = (NodeWaveBandsDirection)b_wave_node.bands_direction();
|
||||
wave->rings_direction = (NodeWaveRingsDirection)b_wave_node.rings_direction();
|
||||
@@ -763,14 +764,14 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexChecker)) {
|
||||
BL::ShaderNodeTexChecker b_checker_node(b_node);
|
||||
CheckerTextureNode *checker = new CheckerTextureNode();
|
||||
CheckerTextureNode *checker = graph->create_node<CheckerTextureNode>();
|
||||
BL::TexMapping b_texture_mapping(b_checker_node.texture_mapping());
|
||||
get_tex_mapping(&checker->tex_mapping, b_texture_mapping);
|
||||
node = checker;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexBrick)) {
|
||||
BL::ShaderNodeTexBrick b_brick_node(b_node);
|
||||
BrickTextureNode *brick = new BrickTextureNode();
|
||||
BrickTextureNode *brick = graph->create_node<BrickTextureNode>();
|
||||
brick->offset = b_brick_node.offset();
|
||||
brick->offset_frequency = b_brick_node.offset_frequency();
|
||||
brick->squash = b_brick_node.squash();
|
||||
@@ -781,7 +782,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexNoise)) {
|
||||
BL::ShaderNodeTexNoise b_noise_node(b_node);
|
||||
NoiseTextureNode *noise = new NoiseTextureNode();
|
||||
NoiseTextureNode *noise = graph->create_node<NoiseTextureNode>();
|
||||
noise->dimensions = b_noise_node.noise_dimensions();
|
||||
BL::TexMapping b_texture_mapping(b_noise_node.texture_mapping());
|
||||
get_tex_mapping(&noise->tex_mapping, b_texture_mapping);
|
||||
@@ -789,7 +790,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexMusgrave)) {
|
||||
BL::ShaderNodeTexMusgrave b_musgrave_node(b_node);
|
||||
MusgraveTextureNode *musgrave_node = new MusgraveTextureNode();
|
||||
MusgraveTextureNode *musgrave_node = graph->create_node<MusgraveTextureNode>();
|
||||
musgrave_node->type = (NodeMusgraveType)b_musgrave_node.musgrave_type();
|
||||
musgrave_node->dimensions = b_musgrave_node.musgrave_dimensions();
|
||||
BL::TexMapping b_texture_mapping(b_musgrave_node.texture_mapping());
|
||||
@@ -798,7 +799,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexCoord)) {
|
||||
BL::ShaderNodeTexCoord b_tex_coord_node(b_node);
|
||||
TextureCoordinateNode *tex_coord = new TextureCoordinateNode();
|
||||
TextureCoordinateNode *tex_coord = graph->create_node<TextureCoordinateNode>();
|
||||
tex_coord->from_dupli = b_tex_coord_node.from_instancer();
|
||||
if (b_tex_coord_node.object()) {
|
||||
tex_coord->use_transform = true;
|
||||
@@ -808,7 +809,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexSky)) {
|
||||
BL::ShaderNodeTexSky b_sky_node(b_node);
|
||||
SkyTextureNode *sky = new SkyTextureNode();
|
||||
SkyTextureNode *sky = graph->create_node<SkyTextureNode>();
|
||||
sky->type = (NodeSkyType)b_sky_node.sky_type();
|
||||
sky->sun_direction = normalize(get_float3(b_sky_node.sun_direction()));
|
||||
sky->turbidity = b_sky_node.turbidity();
|
||||
@@ -828,7 +829,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexIES)) {
|
||||
BL::ShaderNodeTexIES b_ies_node(b_node);
|
||||
IESLightNode *ies = new IESLightNode();
|
||||
IESLightNode *ies = graph->create_node<IESLightNode>();
|
||||
switch (b_ies_node.mode()) {
|
||||
case BL::ShaderNodeTexIES::mode_EXTERNAL:
|
||||
ies->filename = blender_absolute_path(b_data, b_ntree, b_ies_node.filepath());
|
||||
@@ -844,20 +845,20 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexWhiteNoise)) {
|
||||
BL::ShaderNodeTexWhiteNoise b_tex_white_noise_node(b_node);
|
||||
WhiteNoiseTextureNode *white_noise_node = new WhiteNoiseTextureNode();
|
||||
WhiteNoiseTextureNode *white_noise_node = graph->create_node<WhiteNoiseTextureNode>();
|
||||
white_noise_node->dimensions = b_tex_white_noise_node.noise_dimensions();
|
||||
node = white_noise_node;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeNormalMap)) {
|
||||
BL::ShaderNodeNormalMap b_normal_map_node(b_node);
|
||||
NormalMapNode *nmap = new NormalMapNode();
|
||||
NormalMapNode *nmap = graph->create_node<NormalMapNode>();
|
||||
nmap->space = (NodeNormalMapSpace)b_normal_map_node.space();
|
||||
nmap->attribute = b_normal_map_node.uv_map();
|
||||
node = nmap;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTangent)) {
|
||||
BL::ShaderNodeTangent b_tangent_node(b_node);
|
||||
TangentNode *tangent = new TangentNode();
|
||||
TangentNode *tangent = graph->create_node<TangentNode>();
|
||||
tangent->direction_type = (NodeTangentDirectionType)b_tangent_node.direction_type();
|
||||
tangent->axis = (NodeTangentAxis)b_tangent_node.axis();
|
||||
tangent->attribute = b_tangent_node.uv_map();
|
||||
@@ -865,14 +866,14 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeUVMap)) {
|
||||
BL::ShaderNodeUVMap b_uvmap_node(b_node);
|
||||
UVMapNode *uvm = new UVMapNode();
|
||||
UVMapNode *uvm = graph->create_node<UVMapNode>();
|
||||
uvm->attribute = b_uvmap_node.uv_map();
|
||||
uvm->from_dupli = b_uvmap_node.from_instancer();
|
||||
node = uvm;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeTexPointDensity)) {
|
||||
BL::ShaderNodeTexPointDensity b_point_density_node(b_node);
|
||||
PointDensityTextureNode *point_density = new PointDensityTextureNode();
|
||||
PointDensityTextureNode *point_density = graph->create_node<PointDensityTextureNode>();
|
||||
point_density->space = (NodeTexVoxelSpace)b_point_density_node.space();
|
||||
point_density->interpolation = get_image_interpolation(b_point_density_node);
|
||||
point_density->handle = scene->image_manager->add_image(
|
||||
@@ -897,26 +898,26 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeBevel)) {
|
||||
BL::ShaderNodeBevel b_bevel_node(b_node);
|
||||
BevelNode *bevel = new BevelNode();
|
||||
BevelNode *bevel = graph->create_node<BevelNode>();
|
||||
bevel->samples = b_bevel_node.samples();
|
||||
node = bevel;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeDisplacement)) {
|
||||
BL::ShaderNodeDisplacement b_disp_node(b_node);
|
||||
DisplacementNode *disp = new DisplacementNode();
|
||||
DisplacementNode *disp = graph->create_node<DisplacementNode>();
|
||||
disp->space = (NodeNormalMapSpace)b_disp_node.space();
|
||||
node = disp;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeVectorDisplacement)) {
|
||||
BL::ShaderNodeVectorDisplacement b_disp_node(b_node);
|
||||
VectorDisplacementNode *disp = new VectorDisplacementNode();
|
||||
VectorDisplacementNode *disp = graph->create_node<VectorDisplacementNode>();
|
||||
disp->space = (NodeNormalMapSpace)b_disp_node.space();
|
||||
disp->attribute = "";
|
||||
node = disp;
|
||||
}
|
||||
else if (b_node.is_a(&RNA_ShaderNodeOutputAOV)) {
|
||||
BL::ShaderNodeOutputAOV b_aov_node(b_node);
|
||||
OutputAOVNode *aov = new OutputAOVNode();
|
||||
OutputAOVNode *aov = graph->create_node<OutputAOVNode>();
|
||||
aov->name = b_aov_node.name();
|
||||
node = aov;
|
||||
}
|
||||
@@ -1038,7 +1039,7 @@ static void add_nodes(Scene *scene,
|
||||
continue;
|
||||
}
|
||||
|
||||
ConvertNode *proxy = new ConvertNode(to_socket_type, to_socket_type, true);
|
||||
ConvertNode *proxy = graph->create_node<ConvertNode>(to_socket_type, to_socket_type, true);
|
||||
|
||||
input_map[b_link->from_socket().ptr.data] = proxy->inputs[0];
|
||||
output_map[b_link->to_socket().ptr.data] = proxy->outputs[0];
|
||||
@@ -1069,7 +1070,7 @@ static void add_nodes(Scene *scene,
|
||||
continue;
|
||||
}
|
||||
|
||||
ConvertNode *proxy = new ConvertNode(input_type, input_type, true);
|
||||
ConvertNode *proxy = graph->create_node<ConvertNode>(input_type, input_type, true);
|
||||
graph->add(proxy);
|
||||
|
||||
/* register the proxy node for internal binding */
|
||||
@@ -1085,7 +1086,7 @@ static void add_nodes(Scene *scene,
|
||||
continue;
|
||||
}
|
||||
|
||||
ConvertNode *proxy = new ConvertNode(output_type, output_type, true);
|
||||
ConvertNode *proxy = graph->create_node<ConvertNode>(output_type, output_type, true);
|
||||
graph->add(proxy);
|
||||
|
||||
/* register the proxy node for internal binding */
|
||||
@@ -1240,7 +1241,7 @@ void BlenderSync::sync_materials(BL::Depsgraph &b_depsgraph, bool update_all)
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if (shader_map.add_or_update(&shader, b_mat) || update_all) {
|
||||
if (shader_map.add_or_update(scene, &shader, b_mat) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
shader->name = b_mat.name().c_str();
|
||||
@@ -1253,7 +1254,7 @@ void BlenderSync::sync_materials(BL::Depsgraph &b_depsgraph, bool update_all)
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
DiffuseBsdfNode *diffuse = graph->create_node<DiffuseBsdfNode>();
|
||||
diffuse->color = get_float3(b_mat.diffuse_color());
|
||||
graph->add(diffuse);
|
||||
|
||||
@@ -1336,7 +1337,7 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
||||
shader->volume_step_rate = get_float(cworld, "volume_step_size");
|
||||
}
|
||||
else if (new_viewport_parameters.use_scene_world && b_world) {
|
||||
BackgroundNode *background = new BackgroundNode();
|
||||
BackgroundNode *background = graph->create_node<BackgroundNode>();
|
||||
background->color = get_float3(b_world.color());
|
||||
graph->add(background);
|
||||
|
||||
@@ -1352,23 +1353,23 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
||||
world_color = make_float3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
BackgroundNode *background = new BackgroundNode();
|
||||
BackgroundNode *background = graph->create_node<BackgroundNode>();
|
||||
graph->add(background);
|
||||
|
||||
LightPathNode *light_path = new LightPathNode();
|
||||
LightPathNode *light_path = graph->create_node<LightPathNode>();
|
||||
graph->add(light_path);
|
||||
|
||||
MixNode *mix_scene_with_background = new MixNode();
|
||||
MixNode *mix_scene_with_background = graph->create_node<MixNode>();
|
||||
mix_scene_with_background->color2 = world_color;
|
||||
graph->add(mix_scene_with_background);
|
||||
|
||||
EnvironmentTextureNode *texture_environment = new EnvironmentTextureNode();
|
||||
EnvironmentTextureNode *texture_environment = graph->create_node<EnvironmentTextureNode>();
|
||||
texture_environment->tex_mapping.type = TextureMapping::VECTOR;
|
||||
texture_environment->tex_mapping.rotation[2] = new_viewport_parameters.studiolight_rotate_z;
|
||||
texture_environment->filename = new_viewport_parameters.studiolight_path;
|
||||
graph->add(texture_environment);
|
||||
|
||||
MixNode *mix_intensity = new MixNode();
|
||||
MixNode *mix_intensity = graph->create_node<MixNode>();
|
||||
mix_intensity->type = NODE_MIX_MUL;
|
||||
mix_intensity->fac = 1.0f;
|
||||
mix_intensity->color2 = make_float3(new_viewport_parameters.studiolight_intensity,
|
||||
@@ -1376,10 +1377,10 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
|
||||
new_viewport_parameters.studiolight_intensity);
|
||||
graph->add(mix_intensity);
|
||||
|
||||
TextureCoordinateNode *texture_coordinate = new TextureCoordinateNode();
|
||||
TextureCoordinateNode *texture_coordinate = graph->create_node<TextureCoordinateNode>();
|
||||
graph->add(texture_coordinate);
|
||||
|
||||
MixNode *mix_background_with_environment = new MixNode();
|
||||
MixNode *mix_background_with_environment = graph->create_node<MixNode>();
|
||||
mix_background_with_environment->fac = new_viewport_parameters.studiolight_background_alpha;
|
||||
mix_background_with_environment->color1 = world_color;
|
||||
graph->add(mix_background_with_environment);
|
||||
@@ -1466,7 +1467,7 @@ void BlenderSync::sync_lights(BL::Depsgraph &b_depsgraph, bool update_all)
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if (shader_map.add_or_update(&shader, b_light) || update_all) {
|
||||
if (shader_map.add_or_update(scene, &shader, b_light) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
/* create nodes */
|
||||
@@ -1478,7 +1479,7 @@ void BlenderSync::sync_lights(BL::Depsgraph &b_depsgraph, bool update_all)
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
EmissionNode *emission = graph->create_node<EmissionNode>();
|
||||
emission->color = make_float3(1.0f, 1.0f, 1.0f);
|
||||
emission->strength = 1.0f;
|
||||
graph->add(emission);
|
||||
|
@@ -55,11 +55,11 @@ BlenderSync::BlenderSync(BL::RenderEngine &b_engine,
|
||||
: b_engine(b_engine),
|
||||
b_data(b_data),
|
||||
b_scene(b_scene),
|
||||
shader_map(&scene->shaders),
|
||||
object_map(&scene->objects),
|
||||
geometry_map(&scene->geometry),
|
||||
light_map(&scene->lights),
|
||||
particle_system_map(&scene->particle_systems),
|
||||
shader_map(),
|
||||
object_map(),
|
||||
geometry_map(),
|
||||
light_map(),
|
||||
particle_system_map(),
|
||||
world_map(NULL),
|
||||
world_recalc(false),
|
||||
scene(scene),
|
||||
@@ -239,7 +239,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render,
|
||||
|
||||
/* Shader sync done at the end, since object sync uses it.
|
||||
* false = don't delete unused shaders, not supported. */
|
||||
shader_map.post_sync(false);
|
||||
shader_map.post_sync(scene, false);
|
||||
|
||||
free_data_after_sync(b_depsgraph);
|
||||
}
|
||||
|
@@ -67,6 +67,7 @@ set(LIB
|
||||
cycles_render
|
||||
cycles_kernel
|
||||
cycles_util
|
||||
${BLENDER_GL_LIBRARIES}
|
||||
)
|
||||
|
||||
if(WITH_CUDA_DYNLOAD)
|
||||
|
@@ -864,6 +864,11 @@ void OpenCLDevice::load_preview_kernels()
|
||||
|
||||
bool OpenCLDevice::wait_for_availability(const DeviceRequestedFeatures &requested_features)
|
||||
{
|
||||
if (requested_features.use_baking) {
|
||||
/* For baking, kernels have already been loaded in load_required_kernels(). */
|
||||
return true;
|
||||
}
|
||||
|
||||
if (background) {
|
||||
load_kernel_task_pool.wait_work();
|
||||
use_preview_kernels = false;
|
||||
@@ -1933,13 +1938,12 @@ void OpenCLDevice::bake(DeviceTask &task, RenderTile &rtile)
|
||||
kernel_set_args(kernel, start_arg_index, sample);
|
||||
|
||||
enqueue_kernel(kernel, d_w, d_h);
|
||||
clFinish(cqCommandQueue);
|
||||
|
||||
rtile.sample = sample + 1;
|
||||
|
||||
task.update_progress(&rtile, rtile.w * rtile.h);
|
||||
}
|
||||
|
||||
clFinish(cqCommandQueue);
|
||||
}
|
||||
|
||||
static bool kernel_build_opencl_2(cl_device_id cdDevice)
|
||||
|
@@ -26,10 +26,16 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Node Type */
|
||||
|
||||
NodeOwner::~NodeOwner()
|
||||
{
|
||||
}
|
||||
|
||||
Node::Node(const NodeType *type_, ustring name_) : name(name_), type(type_)
|
||||
{
|
||||
assert(type);
|
||||
|
||||
owner = nullptr;
|
||||
|
||||
/* assign non-empty name, convenient for debugging */
|
||||
if (name.empty()) {
|
||||
name = type->name;
|
||||
@@ -679,4 +685,15 @@ bool Node::is_a(const NodeType *type_)
|
||||
return false;
|
||||
}
|
||||
|
||||
const NodeOwner *Node::get_owner() const
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
void Node::set_owner(const NodeOwner *owner_)
|
||||
{
|
||||
assert(owner_);
|
||||
owner = owner_;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -31,6 +31,10 @@ struct Transform;
|
||||
|
||||
/* Node */
|
||||
|
||||
struct NodeOwner {
|
||||
virtual ~NodeOwner();
|
||||
};
|
||||
|
||||
struct Node {
|
||||
explicit Node(const NodeType *type, ustring name = ustring());
|
||||
virtual ~Node() = 0;
|
||||
@@ -99,6 +103,12 @@ struct Node {
|
||||
|
||||
ustring name;
|
||||
const NodeType *type;
|
||||
|
||||
const NodeOwner *get_owner() const;
|
||||
void set_owner(const NodeOwner *owner_);
|
||||
|
||||
protected:
|
||||
const NodeOwner *owner;
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -47,7 +47,7 @@ ccl_device float4 film_get_pass_result(KernelGlobals *kg,
|
||||
|
||||
if (kernel_data.film.use_display_exposure) {
|
||||
float exposure = kernel_data.film.exposure;
|
||||
pass_result *= make_float4(exposure, exposure, exposure, alpha);
|
||||
pass_result *= make_float4(exposure, exposure, exposure, 1.0f);
|
||||
}
|
||||
}
|
||||
else if (display_pass_components == 1) {
|
||||
|
@@ -12,12 +12,11 @@
|
||||
|
||||
__kernel void kernel_ocl_bake(
|
||||
ccl_constant KernelData *data,
|
||||
ccl_global uint4 *input,
|
||||
ccl_global float4 *output,
|
||||
ccl_global float *buffer,
|
||||
|
||||
KERNEL_BUFFER_PARAMS,
|
||||
|
||||
int type, int filter, int sx, int sw, int offset, int sample)
|
||||
int sx, int sy, int sw, int sh, int offset, int stride, int sample)
|
||||
{
|
||||
KernelGlobals kglobals, *kg = &kglobals;
|
||||
|
||||
@@ -27,12 +26,11 @@ __kernel void kernel_ocl_bake(
|
||||
kernel_set_buffer_info(kg);
|
||||
|
||||
int x = sx + ccl_global_id(0);
|
||||
int y = sy + ccl_global_id(1);
|
||||
|
||||
if(x < sx + sw) {
|
||||
#ifdef __NO_BAKING__
|
||||
output[x] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
#else
|
||||
kernel_bake_evaluate(kg, input, output, (ShaderEvalType)type, filter, x, offset, sample);
|
||||
if(x < sx + sw && y < sy + sh) {
|
||||
#ifndef __NO_BAKING__
|
||||
kernel_bake_evaluate(kg, buffer, sample, x, y, offset, stride);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -90,6 +90,7 @@ struct OSLTraceData {
|
||||
ShaderData sd;
|
||||
bool setup;
|
||||
bool init;
|
||||
bool hit;
|
||||
};
|
||||
|
||||
/* thread key for thread specific data lookup */
|
||||
|
@@ -1481,6 +1481,7 @@ bool OSLRenderServices::trace(TraceOpt &options,
|
||||
tracedata->ray = ray;
|
||||
tracedata->setup = false;
|
||||
tracedata->init = true;
|
||||
tracedata->hit = false;
|
||||
tracedata->sd.osl_globals = sd->osl_globals;
|
||||
|
||||
KernelGlobals *kg = sd->osl_globals;
|
||||
@@ -1492,7 +1493,8 @@ bool OSLRenderServices::trace(TraceOpt &options,
|
||||
|
||||
/* Raytrace, leaving out shadow opaque to avoid early exit. */
|
||||
uint visibility = PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE;
|
||||
return scene_intersect(kg, &ray, visibility, &tracedata->isect);
|
||||
tracedata->hit = scene_intersect(kg, &ray, visibility, &tracedata->isect);
|
||||
return tracedata->hit;
|
||||
}
|
||||
|
||||
bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg,
|
||||
@@ -1506,9 +1508,9 @@ bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg,
|
||||
|
||||
if (source == u_trace && tracedata->init) {
|
||||
if (name == u_hit) {
|
||||
return set_attribute_int((tracedata->isect.prim != PRIM_NONE), type, derivatives, val);
|
||||
return set_attribute_int(tracedata->hit, type, derivatives, val);
|
||||
}
|
||||
else if (tracedata->isect.prim != PRIM_NONE) {
|
||||
else if (tracedata->hit) {
|
||||
if (name == u_hitdist) {
|
||||
float f[3] = {tracedata->isect.t, 0.0f, 0.0f};
|
||||
return set_attribute_float(f, type, derivatives, val);
|
||||
|
@@ -459,7 +459,7 @@ bool RenderBuffers::get_pass_rect(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RenderBuffers::set_pass_rect(PassType type, int components, float *pixels)
|
||||
bool RenderBuffers::set_pass_rect(PassType type, int components, float *pixels, int samples)
|
||||
{
|
||||
if (buffer.data() == NULL) {
|
||||
return false;
|
||||
@@ -482,8 +482,17 @@ bool RenderBuffers::set_pass_rect(PassType type, int components, float *pixels)
|
||||
assert(pass.components == components);
|
||||
|
||||
for (int i = 0; i < size; i++, out += pass_stride, pixels += components) {
|
||||
for (int j = 0; j < components; j++) {
|
||||
out[j] = pixels[j];
|
||||
if (pass.filter) {
|
||||
/* Scale by the number of samples, inverse of what we do in get_pass_rect.
|
||||
* A better solution would be to remove the need for set_pass_rect entirely,
|
||||
* and change baking to bake multiple objects in a tile at once. */
|
||||
for (int j = 0; j < components; j++) {
|
||||
out[j] = pixels[j] * samples;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* For non-filtered passes just straight copy, these may contain non-float data. */
|
||||
memcpy(out, pixels, sizeof(float) * components);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,7 @@ class RenderBuffers {
|
||||
const string &name, float exposure, int sample, int components, float *pixels);
|
||||
bool get_denoising_pass_rect(
|
||||
int offset, float exposure, int sample, int components, float *pixels);
|
||||
bool set_pass_rect(PassType type, int components, float *pixels);
|
||||
bool set_pass_rect(PassType type, int components, float *pixels, int samples);
|
||||
};
|
||||
|
||||
/* Display Buffer
|
||||
|
@@ -253,6 +253,8 @@ void Pass::add(PassType type, vector<Pass> &passes, const char *name)
|
||||
case PASS_BAKE_PRIMITIVE:
|
||||
case PASS_BAKE_DIFFERENTIAL:
|
||||
pass.components = 4;
|
||||
pass.exposure = false;
|
||||
pass.filter = false;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
|
@@ -221,7 +221,7 @@ ShaderGraph::ShaderGraph()
|
||||
finalized = false;
|
||||
simplified = false;
|
||||
num_node_ids = 0;
|
||||
add(new OutputNode());
|
||||
add(create_node<OutputNode>());
|
||||
}
|
||||
|
||||
ShaderGraph::~ShaderGraph()
|
||||
@@ -272,7 +272,7 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
|
||||
ShaderInput *convert_in;
|
||||
|
||||
if (to->type() == SocketType::CLOSURE) {
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
EmissionNode *emission = create_node<EmissionNode>();
|
||||
emission->color = make_float3(1.0f, 1.0f, 1.0f);
|
||||
emission->strength = 1.0f;
|
||||
convert = add(emission);
|
||||
@@ -285,7 +285,7 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
|
||||
}
|
||||
}
|
||||
else {
|
||||
convert = add(new ConvertNode(from->type(), to->type(), true));
|
||||
convert = add(create_node<ConvertNode>(from->type(), to->type(), true));
|
||||
convert_in = convert->inputs[0];
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ void ShaderGraph::find_dependencies(ShaderNodeSet &dependencies, ShaderInput *in
|
||||
void ShaderGraph::clear_nodes()
|
||||
{
|
||||
foreach (ShaderNode *node, nodes) {
|
||||
delete node;
|
||||
delete_node(node);
|
||||
}
|
||||
nodes.clear();
|
||||
}
|
||||
@@ -428,7 +428,7 @@ void ShaderGraph::copy_nodes(ShaderNodeSet &nodes, ShaderNodeMap &nnodemap)
|
||||
|
||||
/* copy nodes */
|
||||
foreach (ShaderNode *node, nodes) {
|
||||
ShaderNode *nnode = node->clone();
|
||||
ShaderNode *nnode = node->clone(this);
|
||||
nnodemap[node] = nnode;
|
||||
|
||||
/* create new inputs and outputs to recreate links and ensure
|
||||
@@ -523,7 +523,7 @@ void ShaderGraph::remove_proxy_nodes()
|
||||
if (!removed[node->id])
|
||||
newnodes.push_back(node);
|
||||
else
|
||||
delete node;
|
||||
delete_node(node);
|
||||
}
|
||||
|
||||
nodes = newnodes;
|
||||
@@ -585,7 +585,7 @@ void ShaderGraph::constant_fold(Scene *scene)
|
||||
* that happens to ensure there is still a valid graph for displacement.
|
||||
*/
|
||||
if (has_displacement && !output()->input("Displacement")->link) {
|
||||
ColorNode *value = (ColorNode *)add(new ColorNode());
|
||||
ColorNode *value = (ColorNode *)add(create_node<ColorNode>());
|
||||
value->value = output()->displacement;
|
||||
|
||||
connect(value->output("Color"), output()->input("Displacement"));
|
||||
@@ -821,7 +821,7 @@ void ShaderGraph::clean(Scene *scene)
|
||||
if (visited[node->id])
|
||||
newnodes.push_back(node);
|
||||
else
|
||||
delete node;
|
||||
delete_node(node);
|
||||
}
|
||||
|
||||
nodes = newnodes;
|
||||
@@ -848,43 +848,43 @@ void ShaderGraph::default_inputs(bool do_osl)
|
||||
if (!input->link && (!(input->flags() & SocketType::OSL_INTERNAL) || do_osl)) {
|
||||
if (input->flags() & SocketType::LINK_TEXTURE_GENERATED) {
|
||||
if (!texco)
|
||||
texco = new TextureCoordinateNode();
|
||||
texco = create_node<TextureCoordinateNode>();
|
||||
|
||||
connect(texco->output("Generated"), input);
|
||||
}
|
||||
if (input->flags() & SocketType::LINK_TEXTURE_NORMAL) {
|
||||
if (!texco)
|
||||
texco = new TextureCoordinateNode();
|
||||
texco = create_node<TextureCoordinateNode>();
|
||||
|
||||
connect(texco->output("Normal"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_TEXTURE_UV) {
|
||||
if (!texco)
|
||||
texco = new TextureCoordinateNode();
|
||||
texco = create_node<TextureCoordinateNode>();
|
||||
|
||||
connect(texco->output("UV"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_INCOMING) {
|
||||
if (!geom)
|
||||
geom = new GeometryNode();
|
||||
geom = create_node<GeometryNode>();
|
||||
|
||||
connect(geom->output("Incoming"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_NORMAL) {
|
||||
if (!geom)
|
||||
geom = new GeometryNode();
|
||||
geom = create_node<GeometryNode>();
|
||||
|
||||
connect(geom->output("Normal"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_POSITION) {
|
||||
if (!geom)
|
||||
geom = new GeometryNode();
|
||||
geom = create_node<GeometryNode>();
|
||||
|
||||
connect(geom->output("Position"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_TANGENT) {
|
||||
if (!geom)
|
||||
geom = new GeometryNode();
|
||||
geom = create_node<GeometryNode>();
|
||||
|
||||
connect(geom->output("Tangent"), input);
|
||||
}
|
||||
@@ -999,10 +999,10 @@ void ShaderGraph::bump_from_displacement(bool use_object_space)
|
||||
* output, so it can finally set the shader normal, note we are only doing
|
||||
* this for bump from displacement, this will be the only bump allowed to
|
||||
* overwrite the shader normal */
|
||||
ShaderNode *set_normal = add(new SetNormalNode());
|
||||
ShaderNode *set_normal = add(create_node<SetNormalNode>());
|
||||
|
||||
/* add bump node and connect copied graphs to it */
|
||||
BumpNode *bump = (BumpNode *)add(new BumpNode());
|
||||
BumpNode *bump = (BumpNode *)add(create_node<BumpNode>());
|
||||
bump->use_object_space = use_object_space;
|
||||
bump->distance = 1.0f;
|
||||
|
||||
@@ -1012,15 +1012,15 @@ void ShaderGraph::bump_from_displacement(bool use_object_space)
|
||||
ShaderOutput *out_dy = nodes_dy[out->parent]->output(out->name());
|
||||
|
||||
/* convert displacement vector to height */
|
||||
VectorMathNode *dot_center = (VectorMathNode *)add(new VectorMathNode());
|
||||
VectorMathNode *dot_dx = (VectorMathNode *)add(new VectorMathNode());
|
||||
VectorMathNode *dot_dy = (VectorMathNode *)add(new VectorMathNode());
|
||||
VectorMathNode *dot_center = (VectorMathNode *)add(create_node<VectorMathNode>());
|
||||
VectorMathNode *dot_dx = (VectorMathNode *)add(create_node<VectorMathNode>());
|
||||
VectorMathNode *dot_dy = (VectorMathNode *)add(create_node<VectorMathNode>());
|
||||
|
||||
dot_center->type = NODE_VECTOR_MATH_DOT_PRODUCT;
|
||||
dot_dx->type = NODE_VECTOR_MATH_DOT_PRODUCT;
|
||||
dot_dy->type = NODE_VECTOR_MATH_DOT_PRODUCT;
|
||||
|
||||
GeometryNode *geom = (GeometryNode *)add(new GeometryNode());
|
||||
GeometryNode *geom = (GeometryNode *)add(create_node<GeometryNode>());
|
||||
connect(geom->output("Normal"), dot_center->input("Vector2"));
|
||||
connect(geom->output("Normal"), dot_dx->input("Vector2"));
|
||||
connect(geom->output("Normal"), dot_dy->input("Vector2"));
|
||||
@@ -1064,7 +1064,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
|
||||
|
||||
if (fin) {
|
||||
/* mix closure: add node to mix closure weights */
|
||||
MixClosureWeightNode *mix_node = new MixClosureWeightNode();
|
||||
MixClosureWeightNode *mix_node = create_node<MixClosureWeightNode>();
|
||||
add(mix_node);
|
||||
ShaderInput *fac_in = mix_node->input("Fac");
|
||||
ShaderInput *weight_in = mix_node->input("Weight");
|
||||
@@ -1101,7 +1101,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
|
||||
/* already has a weight connected to it? add weights */
|
||||
float weight_value = node->get_float(weight_in->socket_type);
|
||||
if (weight_in->link || weight_value != 0.0f) {
|
||||
MathNode *math_node = new MathNode();
|
||||
MathNode *math_node = create_node<MathNode>();
|
||||
add(math_node);
|
||||
|
||||
if (weight_in->link)
|
||||
|
@@ -159,7 +159,7 @@ class ShaderNode : public Node {
|
||||
ShaderInput *input(ustring name);
|
||||
ShaderOutput *output(ustring name);
|
||||
|
||||
virtual ShaderNode *clone() const = 0;
|
||||
virtual ShaderNode *clone(ShaderGraph *graph) const = 0;
|
||||
virtual void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
virtual void compile(SVMCompiler &compiler) = 0;
|
||||
virtual void compile(OSLCompiler &compiler) = 0;
|
||||
@@ -275,9 +275,9 @@ class ShaderNode : public Node {
|
||||
#define SHADER_NODE_CLASS(type) \
|
||||
NODE_DECLARE \
|
||||
type(); \
|
||||
virtual ShaderNode *clone() const \
|
||||
virtual ShaderNode *clone(ShaderGraph *graph) const \
|
||||
{ \
|
||||
return new type(*this); \
|
||||
return graph->create_node<type>(*this); \
|
||||
} \
|
||||
virtual void compile(SVMCompiler &compiler); \
|
||||
virtual void compile(OSLCompiler &compiler);
|
||||
@@ -289,9 +289,9 @@ class ShaderNode : public Node {
|
||||
virtual void compile(OSLCompiler &compiler);
|
||||
|
||||
#define SHADER_NODE_BASE_CLASS(type) \
|
||||
virtual ShaderNode *clone() const \
|
||||
virtual ShaderNode *clone(ShaderGraph *graph) const \
|
||||
{ \
|
||||
return new type(*this); \
|
||||
return graph->create_node<type>(*this); \
|
||||
} \
|
||||
virtual void compile(SVMCompiler &compiler); \
|
||||
virtual void compile(OSLCompiler &compiler);
|
||||
@@ -312,7 +312,7 @@ typedef map<ShaderNode *, ShaderNode *, ShaderNodeIDComparator> ShaderNodeMap;
|
||||
* Shader graph of nodes. Also does graph manipulations for default inputs,
|
||||
* bump mapping from displacement, and possibly other things in the future. */
|
||||
|
||||
class ShaderGraph {
|
||||
class ShaderGraph : public NodeOwner {
|
||||
public:
|
||||
list<ShaderNode *> nodes;
|
||||
size_t num_node_ids;
|
||||
@@ -345,6 +345,24 @@ class ShaderGraph {
|
||||
|
||||
void dump_graph(const char *filename);
|
||||
|
||||
/* This function is used to create a node of a specified type instead of
|
||||
* calling 'new', and sets the graph as the owner of the node.
|
||||
*/
|
||||
template<typename T, typename... Args> T *create_node(Args &&... args)
|
||||
{
|
||||
T *node = new T(args...);
|
||||
node->set_owner(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
/* This function is used to delete a node created and owned by the graph.
|
||||
*/
|
||||
template<typename T> void delete_node(T *node)
|
||||
{
|
||||
assert(node->get_owner() == this);
|
||||
delete node;
|
||||
}
|
||||
|
||||
protected:
|
||||
typedef pair<ShaderNode *const, ShaderNode *> NodePair;
|
||||
|
||||
|
@@ -262,9 +262,9 @@ ImageTextureNode::ImageTextureNode() : ImageSlotTextureNode(node_type)
|
||||
tiles.push_back(1001);
|
||||
}
|
||||
|
||||
ShaderNode *ImageTextureNode::clone() const
|
||||
ShaderNode *ImageTextureNode::clone(ShaderGraph *graph) const
|
||||
{
|
||||
ImageTextureNode *node = new ImageTextureNode(*this);
|
||||
ImageTextureNode *node = graph->create_node<ImageTextureNode>(*this);
|
||||
node->handle = handle;
|
||||
return node;
|
||||
}
|
||||
@@ -525,9 +525,9 @@ EnvironmentTextureNode::EnvironmentTextureNode() : ImageSlotTextureNode(node_typ
|
||||
animated = false;
|
||||
}
|
||||
|
||||
ShaderNode *EnvironmentTextureNode::clone() const
|
||||
ShaderNode *EnvironmentTextureNode::clone(ShaderGraph *graph) const
|
||||
{
|
||||
EnvironmentTextureNode *node = new EnvironmentTextureNode(*this);
|
||||
EnvironmentTextureNode *node = graph->create_node<EnvironmentTextureNode>(*this);
|
||||
node->handle = handle;
|
||||
return node;
|
||||
}
|
||||
@@ -1234,9 +1234,9 @@ IESLightNode::IESLightNode() : TextureNode(node_type)
|
||||
slot = -1;
|
||||
}
|
||||
|
||||
ShaderNode *IESLightNode::clone() const
|
||||
ShaderNode *IESLightNode::clone(ShaderGraph *graph) const
|
||||
{
|
||||
IESLightNode *node = new IESLightNode(*this);
|
||||
IESLightNode *node = graph->create_node<IESLightNode>(*this);
|
||||
|
||||
node->light_manager = NULL;
|
||||
node->slot = -1;
|
||||
@@ -1782,12 +1782,12 @@ PointDensityTextureNode::~PointDensityTextureNode()
|
||||
{
|
||||
}
|
||||
|
||||
ShaderNode *PointDensityTextureNode::clone() const
|
||||
ShaderNode *PointDensityTextureNode::clone(ShaderGraph *graph) const
|
||||
{
|
||||
/* Increase image user count for new node. We need to ensure to not call
|
||||
* add_image again, to work around access of freed data on the Blender
|
||||
* side. A better solution should be found to avoid this. */
|
||||
PointDensityTextureNode *node = new PointDensityTextureNode(*this);
|
||||
PointDensityTextureNode *node = graph->create_node<PointDensityTextureNode>(*this);
|
||||
node->handle = handle; /* TODO: not needed? */
|
||||
return node;
|
||||
}
|
||||
@@ -2783,8 +2783,8 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph)
|
||||
ShaderInput *emission_in = input("Emission");
|
||||
if (emission_in->link || emission != make_float3(0.0f, 0.0f, 0.0f)) {
|
||||
/* Create add closure and emission. */
|
||||
AddClosureNode *add = new AddClosureNode();
|
||||
EmissionNode *emission_node = new EmissionNode();
|
||||
AddClosureNode *add = graph->create_node<AddClosureNode>();
|
||||
EmissionNode *emission_node = graph->create_node<EmissionNode>();
|
||||
ShaderOutput *new_out = add->output("Closure");
|
||||
|
||||
graph->add(add);
|
||||
@@ -2802,8 +2802,8 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph)
|
||||
ShaderInput *alpha_in = input("Alpha");
|
||||
if (alpha_in->link || alpha != 1.0f) {
|
||||
/* Create mix and transparent BSDF for alpha transparency. */
|
||||
MixClosureNode *mix = new MixClosureNode();
|
||||
TransparentBsdfNode *transparent = new TransparentBsdfNode();
|
||||
MixClosureNode *mix = graph->create_node<MixClosureNode>();
|
||||
TransparentBsdfNode *transparent = graph->create_node<TransparentBsdfNode>();
|
||||
|
||||
graph->add(mix);
|
||||
graph->add(transparent);
|
||||
@@ -4475,7 +4475,7 @@ void VolumeInfoNode::expand(ShaderGraph *graph)
|
||||
{
|
||||
ShaderOutput *color_out = output("Color");
|
||||
if (!color_out->links.empty()) {
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
AttributeNode *attr = graph->create_node<AttributeNode>();
|
||||
attr->attribute = "color";
|
||||
graph->add(attr);
|
||||
graph->relink(color_out, attr->output("Color"));
|
||||
@@ -4483,7 +4483,7 @@ void VolumeInfoNode::expand(ShaderGraph *graph)
|
||||
|
||||
ShaderOutput *density_out = output("Density");
|
||||
if (!density_out->links.empty()) {
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
AttributeNode *attr = graph->create_node<AttributeNode>();
|
||||
attr->attribute = "density";
|
||||
graph->add(attr);
|
||||
graph->relink(density_out, attr->output("Fac"));
|
||||
@@ -4491,7 +4491,7 @@ void VolumeInfoNode::expand(ShaderGraph *graph)
|
||||
|
||||
ShaderOutput *flame_out = output("Flame");
|
||||
if (!flame_out->links.empty()) {
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
AttributeNode *attr = graph->create_node<AttributeNode>();
|
||||
attr->attribute = "flame";
|
||||
graph->add(attr);
|
||||
graph->relink(flame_out, attr->output("Fac"));
|
||||
@@ -4499,7 +4499,7 @@ void VolumeInfoNode::expand(ShaderGraph *graph)
|
||||
|
||||
ShaderOutput *temperature_out = output("Temperature");
|
||||
if (!temperature_out->links.empty()) {
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
AttributeNode *attr = graph->create_node<AttributeNode>();
|
||||
attr->attribute = "temperature";
|
||||
graph->add(attr);
|
||||
graph->relink(temperature_out, attr->output("Fac"));
|
||||
@@ -5768,7 +5768,7 @@ void MapRangeNode::expand(ShaderGraph *graph)
|
||||
if (clamp) {
|
||||
ShaderOutput *result_out = output("Result");
|
||||
if (!result_out->links.empty()) {
|
||||
ClampNode *clamp_node = new ClampNode();
|
||||
ClampNode *clamp_node = graph->create_node<ClampNode>();
|
||||
clamp_node->type = NODE_CLAMP_RANGE;
|
||||
graph->add(clamp_node);
|
||||
graph->relink(result_out, clamp_node->output("Result"));
|
||||
@@ -6009,7 +6009,7 @@ void MathNode::expand(ShaderGraph *graph)
|
||||
if (use_clamp) {
|
||||
ShaderOutput *result_out = output("Value");
|
||||
if (!result_out->links.empty()) {
|
||||
ClampNode *clamp_node = new ClampNode();
|
||||
ClampNode *clamp_node = graph->create_node<ClampNode>();
|
||||
clamp_node->type = NODE_CLAMP_MINMAX;
|
||||
clamp_node->min = 0.0f;
|
||||
clamp_node->max = 1.0f;
|
||||
@@ -6337,7 +6337,7 @@ void BumpNode::constant_fold(const ConstantFolder &folder)
|
||||
|
||||
if (height_in->link == NULL) {
|
||||
if (normal_in->link == NULL) {
|
||||
GeometryNode *geom = new GeometryNode();
|
||||
GeometryNode *geom = folder.graph->create_node<GeometryNode>();
|
||||
folder.graph->add(geom);
|
||||
folder.bypass(geom->output("Normal"));
|
||||
}
|
||||
@@ -6620,12 +6620,12 @@ OSLNode::~OSLNode()
|
||||
delete type;
|
||||
}
|
||||
|
||||
ShaderNode *OSLNode::clone() const
|
||||
ShaderNode *OSLNode::clone(ShaderGraph *graph) const
|
||||
{
|
||||
return OSLNode::create(this->inputs.size(), this);
|
||||
return OSLNode::create(graph, this->inputs.size(), this);
|
||||
}
|
||||
|
||||
OSLNode *OSLNode::create(size_t num_inputs, const OSLNode *from)
|
||||
OSLNode *OSLNode::create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from)
|
||||
{
|
||||
/* allocate space for the node itself and parameters, aligned to 16 bytes
|
||||
* assuming that's the most parameter types need */
|
||||
@@ -6636,7 +6636,9 @@ OSLNode *OSLNode::create(size_t num_inputs, const OSLNode *from)
|
||||
memset(node_memory, 0, node_size + inputs_size);
|
||||
|
||||
if (!from) {
|
||||
return new (node_memory) OSLNode();
|
||||
OSLNode *node = new (node_memory) OSLNode();
|
||||
node->set_owner(graph);
|
||||
return node;
|
||||
}
|
||||
else {
|
||||
/* copy input default values and node type for cloning */
|
||||
@@ -6644,6 +6646,7 @@ OSLNode *OSLNode::create(size_t num_inputs, const OSLNode *from)
|
||||
|
||||
OSLNode *node = new (node_memory) OSLNode(*from);
|
||||
node->type = new NodeType(*(from->type));
|
||||
node->set_owner(from->owner);
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ class ImageSlotTextureNode : public TextureNode {
|
||||
class ImageTextureNode : public ImageSlotTextureNode {
|
||||
public:
|
||||
SHADER_NODE_NO_CLONE_CLASS(ImageTextureNode)
|
||||
ShaderNode *clone() const;
|
||||
ShaderNode *clone(ShaderGraph *graph) const;
|
||||
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
bool has_attribute_dependency()
|
||||
{
|
||||
@@ -126,7 +126,7 @@ class ImageTextureNode : public ImageSlotTextureNode {
|
||||
class EnvironmentTextureNode : public ImageSlotTextureNode {
|
||||
public:
|
||||
SHADER_NODE_NO_CLONE_CLASS(EnvironmentTextureNode)
|
||||
ShaderNode *clone() const;
|
||||
ShaderNode *clone(ShaderGraph *graph) const;
|
||||
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
bool has_attribute_dependency()
|
||||
{
|
||||
@@ -364,7 +364,7 @@ class PointDensityTextureNode : public ShaderNode {
|
||||
}
|
||||
|
||||
~PointDensityTextureNode();
|
||||
ShaderNode *clone() const;
|
||||
ShaderNode *clone(ShaderGraph *graph) const;
|
||||
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
bool has_attribute_dependency()
|
||||
{
|
||||
@@ -400,7 +400,7 @@ class IESLightNode : public TextureNode {
|
||||
SHADER_NODE_NO_CLONE_CLASS(IESLightNode)
|
||||
|
||||
~IESLightNode();
|
||||
ShaderNode *clone() const;
|
||||
ShaderNode *clone(ShaderGraph *graph) const;
|
||||
virtual int get_group()
|
||||
{
|
||||
return NODE_GROUP_LEVEL_2;
|
||||
@@ -1501,10 +1501,10 @@ class SetNormalNode : public ShaderNode {
|
||||
|
||||
class OSLNode : public ShaderNode {
|
||||
public:
|
||||
static OSLNode *create(size_t num_inputs, const OSLNode *from = NULL);
|
||||
static OSLNode *create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from = NULL);
|
||||
~OSLNode();
|
||||
|
||||
ShaderNode *clone() const;
|
||||
ShaderNode *clone(ShaderGraph *graph) const;
|
||||
|
||||
char *input_default_value();
|
||||
void add_input(ustring name, SocketType::Type type);
|
||||
|
@@ -439,7 +439,8 @@ const char *OSLShaderManager::shader_load_bytecode(const string &hash, const str
|
||||
|
||||
/* This is a static function to avoid RTTI link errors with only this
|
||||
* file being compiled without RTTI to match OSL and LLVM libraries. */
|
||||
OSLNode *OSLShaderManager::osl_node(ShaderManager *manager,
|
||||
OSLNode *OSLShaderManager::osl_node(ShaderGraph *graph,
|
||||
ShaderManager *manager,
|
||||
const std::string &filepath,
|
||||
const std::string &bytecode_hash,
|
||||
const std::string &bytecode)
|
||||
@@ -482,7 +483,7 @@ OSLNode *OSLShaderManager::osl_node(ShaderManager *manager,
|
||||
}
|
||||
|
||||
/* create node */
|
||||
OSLNode *node = OSLNode::create(num_inputs);
|
||||
OSLNode *node = OSLNode::create(graph, num_inputs);
|
||||
|
||||
/* add new sockets from parameters */
|
||||
set<void *> used_sockets;
|
||||
|
@@ -93,7 +93,8 @@ class OSLShaderManager : public ShaderManager {
|
||||
OSLShaderInfo *shader_loaded_info(const string &hash);
|
||||
|
||||
/* create OSL node using OSLQuery */
|
||||
static OSLNode *osl_node(ShaderManager *manager,
|
||||
static OSLNode *osl_node(ShaderGraph *graph,
|
||||
ShaderManager *manager,
|
||||
const std::string &filepath,
|
||||
const std::string &bytecode_hash = "",
|
||||
const std::string &bytecode = "");
|
||||
|
@@ -29,7 +29,13 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Particle System */
|
||||
|
||||
ParticleSystem::ParticleSystem()
|
||||
NODE_DEFINE(ParticleSystem)
|
||||
{
|
||||
NodeType *type = NodeType::add("particle_system", create);
|
||||
return type;
|
||||
}
|
||||
|
||||
ParticleSystem::ParticleSystem() : Node(node_type)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_types.h"
|
||||
|
||||
#include "graph/node.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
class Device;
|
||||
@@ -40,8 +42,10 @@ struct Particle {
|
||||
float3 angular_velocity;
|
||||
};
|
||||
|
||||
class ParticleSystem {
|
||||
class ParticleSystem : public Node {
|
||||
public:
|
||||
NODE_DECLARE
|
||||
|
||||
ParticleSystem();
|
||||
~ParticleSystem();
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "render/shader.h"
|
||||
#include "render/svm.h"
|
||||
#include "render/tables.h"
|
||||
#include "render/volume.h"
|
||||
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_guarded_allocator.h"
|
||||
@@ -98,15 +99,15 @@ Scene::Scene(const SceneParams ¶ms_, Device *device)
|
||||
{
|
||||
memset((void *)&dscene.data, 0, sizeof(dscene.data));
|
||||
|
||||
camera = new Camera();
|
||||
dicing_camera = new Camera();
|
||||
camera = create_node<Camera>();
|
||||
dicing_camera = create_node<Camera>();
|
||||
lookup_tables = new LookupTables();
|
||||
film = new Film();
|
||||
background = new Background();
|
||||
film = create_node<Film>();
|
||||
background = create_node<Background>();
|
||||
light_manager = new LightManager();
|
||||
geometry_manager = new GeometryManager();
|
||||
object_manager = new ObjectManager();
|
||||
integrator = new Integrator();
|
||||
integrator = create_node<Integrator>();
|
||||
image_manager = new ImageManager(device->info);
|
||||
particle_system_manager = new ParticleSystemManager();
|
||||
bake_manager = new BakeManager();
|
||||
@@ -560,4 +561,127 @@ int Scene::get_max_closure_count()
|
||||
return max_closure_global;
|
||||
}
|
||||
|
||||
template<> Light *Scene::create_node<Light>()
|
||||
{
|
||||
Light *node = new Light();
|
||||
node->set_owner(this);
|
||||
lights.push_back(node);
|
||||
light_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> Mesh *Scene::create_node<Mesh>()
|
||||
{
|
||||
Mesh *node = new Mesh();
|
||||
node->set_owner(this);
|
||||
geometry.push_back(node);
|
||||
geometry_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> Hair *Scene::create_node<Hair>()
|
||||
{
|
||||
Hair *node = new Hair();
|
||||
node->set_owner(this);
|
||||
geometry.push_back(node);
|
||||
geometry_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> Volume *Scene::create_node<Volume>()
|
||||
{
|
||||
Volume *node = new Volume();
|
||||
node->set_owner(this);
|
||||
geometry.push_back(node);
|
||||
geometry_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> Object *Scene::create_node<Object>()
|
||||
{
|
||||
Object *node = new Object();
|
||||
node->set_owner(this);
|
||||
objects.push_back(node);
|
||||
object_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> ParticleSystem *Scene::create_node<ParticleSystem>()
|
||||
{
|
||||
ParticleSystem *node = new ParticleSystem();
|
||||
node->set_owner(this);
|
||||
particle_systems.push_back(node);
|
||||
particle_system_manager->tag_update(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
template<> Shader *Scene::create_node<Shader>()
|
||||
{
|
||||
Shader *node = new Shader();
|
||||
node->set_owner(this);
|
||||
shaders.push_back(node);
|
||||
shader_manager->need_update = true;
|
||||
return node;
|
||||
}
|
||||
|
||||
template<typename T> void delete_node_from_array(vector<T> &nodes, T node)
|
||||
{
|
||||
for (size_t i = 0; i < nodes.size(); ++i) {
|
||||
if (nodes[i] == node) {
|
||||
std::swap(nodes[i], nodes[nodes.size() - 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nodes.resize(nodes.size() - 1);
|
||||
delete node;
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Light *node)
|
||||
{
|
||||
delete_node_from_array(lights, node);
|
||||
light_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Mesh *node)
|
||||
{
|
||||
delete_node_from_array(geometry, static_cast<Geometry *>(node));
|
||||
geometry_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Hair *node)
|
||||
{
|
||||
delete_node_from_array(geometry, static_cast<Geometry *>(node));
|
||||
geometry_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Volume *node)
|
||||
{
|
||||
delete_node_from_array(geometry, static_cast<Geometry *>(node));
|
||||
geometry_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Geometry *node)
|
||||
{
|
||||
delete_node_from_array(geometry, node);
|
||||
geometry_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Object *node)
|
||||
{
|
||||
delete_node_from_array(objects, node);
|
||||
object_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(ParticleSystem *node)
|
||||
{
|
||||
delete_node_from_array(particle_systems, node);
|
||||
particle_system_manager->tag_update(this);
|
||||
}
|
||||
|
||||
template<> void Scene::delete_node_impl(Shader * /*node*/)
|
||||
{
|
||||
/* don't delete unused shaders, not supported */
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -59,6 +59,7 @@ class Progress;
|
||||
class BakeManager;
|
||||
class BakeData;
|
||||
class RenderStats;
|
||||
class Volume;
|
||||
|
||||
/* Scene Device Data */
|
||||
|
||||
@@ -212,7 +213,7 @@ class SceneParams {
|
||||
|
||||
/* Scene */
|
||||
|
||||
class Scene {
|
||||
class Scene : public NodeOwner {
|
||||
public:
|
||||
/* Optional name. Is used for logging and reporting. */
|
||||
string name;
|
||||
@@ -281,6 +282,40 @@ class Scene {
|
||||
|
||||
bool update(Progress &progress, bool &kernel_switch_needed);
|
||||
|
||||
/* This function is used to create a node of a specified type instead of
|
||||
* calling 'new', and sets the scene as the owner of the node.
|
||||
* The function has overloads that will also add the created node to the right
|
||||
* node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate
|
||||
* manager for an update.
|
||||
*/
|
||||
template<typename T, typename... Args> T *create_node(Args &&... args)
|
||||
{
|
||||
T *node = new T(args...);
|
||||
node->set_owner(this);
|
||||
return node;
|
||||
}
|
||||
|
||||
/* This function is used to delete a node from the scene instead of calling 'delete'
|
||||
* and manually removing the node from the data array. It also tags the
|
||||
* appropriate manager for an update, if any, and checks that the scene is indeed
|
||||
* the owner of the node. Calling this function on a node not owned by the scene
|
||||
* will likely cause a crash which we want in order to detect such cases.
|
||||
*/
|
||||
template<typename T> void delete_node(T *node)
|
||||
{
|
||||
assert(node->get_owner() == this);
|
||||
delete_node_impl(node);
|
||||
}
|
||||
|
||||
/* Same as above, but specify the actual owner.
|
||||
*/
|
||||
template<typename T> void delete_node(T *node, const NodeOwner *owner)
|
||||
{
|
||||
assert(node->get_owner() == owner);
|
||||
delete_node_impl(node);
|
||||
(void)owner;
|
||||
}
|
||||
|
||||
protected:
|
||||
/* Check if some heavy data worth logging was updated.
|
||||
* Mainly used to suppress extra annoying logging.
|
||||
@@ -303,8 +338,43 @@ class Scene {
|
||||
|
||||
/* Get maximum number of closures to be used in kernel. */
|
||||
int get_max_closure_count();
|
||||
|
||||
template<typename T> void delete_node_impl(T *node)
|
||||
{
|
||||
delete node;
|
||||
}
|
||||
};
|
||||
|
||||
template<> Light *Scene::create_node<Light>();
|
||||
|
||||
template<> Mesh *Scene::create_node<Mesh>();
|
||||
|
||||
template<> Object *Scene::create_node<Object>();
|
||||
|
||||
template<> Hair *Scene::create_node<Hair>();
|
||||
|
||||
template<> Volume *Scene::create_node<Volume>();
|
||||
|
||||
template<> ParticleSystem *Scene::create_node<ParticleSystem>();
|
||||
|
||||
template<> Shader *Scene::create_node<Shader>();
|
||||
|
||||
template<> void Scene::delete_node_impl(Light *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Mesh *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Volume *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Hair *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Geometry *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Object *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(ParticleSystem *node);
|
||||
|
||||
template<> void Scene::delete_node_impl(Shader *node);
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __SCENE_H__ */
|
||||
|
@@ -624,16 +624,15 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
DiffuseBsdfNode *diffuse = graph->create_node<DiffuseBsdfNode>();
|
||||
diffuse->color = make_float3(0.8f, 0.8f, 0.8f);
|
||||
graph->add(diffuse);
|
||||
|
||||
graph->connect(diffuse->output("BSDF"), graph->output()->input("Surface"));
|
||||
|
||||
Shader *shader = new Shader();
|
||||
Shader *shader = scene->create_node<Shader>();
|
||||
shader->name = "default_surface";
|
||||
shader->set_graph(graph);
|
||||
scene->shaders.push_back(shader);
|
||||
scene->default_surface = shader;
|
||||
shader->tag_update(scene);
|
||||
}
|
||||
@@ -642,15 +641,14 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
PrincipledVolumeNode *principled = new PrincipledVolumeNode();
|
||||
PrincipledVolumeNode *principled = graph->create_node<PrincipledVolumeNode>();
|
||||
graph->add(principled);
|
||||
|
||||
graph->connect(principled->output("Volume"), graph->output()->input("Volume"));
|
||||
|
||||
Shader *shader = new Shader();
|
||||
Shader *shader = scene->create_node<Shader>();
|
||||
shader->name = "default_volume";
|
||||
shader->set_graph(graph);
|
||||
scene->shaders.push_back(shader);
|
||||
scene->default_volume = shader;
|
||||
shader->tag_update(scene);
|
||||
}
|
||||
@@ -659,17 +657,16 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
EmissionNode *emission = graph->create_node<EmissionNode>();
|
||||
emission->color = make_float3(0.8f, 0.8f, 0.8f);
|
||||
emission->strength = 0.0f;
|
||||
graph->add(emission);
|
||||
|
||||
graph->connect(emission->output("Emission"), graph->output()->input("Surface"));
|
||||
|
||||
Shader *shader = new Shader();
|
||||
Shader *shader = scene->create_node<Shader>();
|
||||
shader->name = "default_light";
|
||||
shader->set_graph(graph);
|
||||
scene->shaders.push_back(shader);
|
||||
scene->default_light = shader;
|
||||
shader->tag_update(scene);
|
||||
}
|
||||
@@ -678,10 +675,9 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
Shader *shader = new Shader();
|
||||
Shader *shader = scene->create_node<Shader>();
|
||||
shader->name = "default_background";
|
||||
shader->set_graph(graph);
|
||||
scene->shaders.push_back(shader);
|
||||
scene->default_background = shader;
|
||||
shader->tag_update(scene);
|
||||
}
|
||||
@@ -690,10 +686,9 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
Shader *shader = new Shader();
|
||||
Shader *shader = scene->create_node<Shader>();
|
||||
shader->name = "default_empty";
|
||||
shader->set_graph(graph);
|
||||
scene->shaders.push_back(shader);
|
||||
scene->default_empty = shader;
|
||||
shader->tag_update(scene);
|
||||
}
|
||||
|
@@ -202,7 +202,8 @@ extern GHOST_WindowHandle GHOST_CreateDialogWindow(GHOST_SystemHandle systemhand
|
||||
* \param platform_support_callback An optional callback to check platform support
|
||||
* \return A handle to the new context ( == NULL if creation failed).
|
||||
*/
|
||||
extern GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle);
|
||||
extern GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle,
|
||||
GHOST_GLSettings glSettings);
|
||||
|
||||
/**
|
||||
* Dispose of a context.
|
||||
|
@@ -265,7 +265,7 @@ class GHOST_ISystem {
|
||||
* Never explicitly delete the context, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
virtual GHOST_IContext *createOffscreenContext() = 0;
|
||||
virtual GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) = 0;
|
||||
|
||||
/**
|
||||
* Dispose of a context.
|
||||
|
@@ -135,11 +135,12 @@ void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
|
||||
system->getAllDisplayDimensions(*width, *height);
|
||||
}
|
||||
|
||||
GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle)
|
||||
GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle,
|
||||
GHOST_GLSettings glSettings)
|
||||
{
|
||||
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
|
||||
|
||||
return (GHOST_ContextHandle)system->createOffscreenContext();
|
||||
return (GHOST_ContextHandle)system->createOffscreenContext(glSettings);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_DisposeOpenGLContext(GHOST_SystemHandle systemhandle,
|
||||
|
@@ -115,7 +115,7 @@ class GHOST_System : public GHOST_ISystem {
|
||||
* Never explicitly delete the context, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
virtual GHOST_IContext *createOffscreenContext() = 0;
|
||||
virtual GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether a window is valid.
|
||||
|
@@ -116,7 +116,7 @@ class GHOST_SystemCocoa : public GHOST_System {
|
||||
* Never explicitly delete the context, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *createOffscreenContext();
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
|
||||
|
||||
/**
|
||||
* Dispose of a context.
|
||||
|
@@ -765,7 +765,7 @@ GHOST_IWindow *GHOST_SystemCocoa::createWindow(const char *title,
|
||||
* Never explicitly delete the context, use #disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext()
|
||||
GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
GHOST_Context *context = new GHOST_ContextCGL(false, NULL, NULL, NULL);
|
||||
if (context->initializeDrawingContext())
|
||||
|
@@ -81,7 +81,7 @@ class GHOST_SystemNULL : public GHOST_System {
|
||||
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
|
||||
{ /* nop */
|
||||
}
|
||||
GHOST_IContext *createOffscreenContext()
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -139,7 +139,7 @@ GHOST_TUns8 GHOST_SystemSDL::getNumDisplays() const
|
||||
return SDL_GetNumVideoDisplays();
|
||||
}
|
||||
|
||||
GHOST_IContext *GHOST_SystemSDL::createOffscreenContext()
|
||||
GHOST_IContext *GHOST_SystemSDL::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
GHOST_Context *context = new GHOST_ContextSDL(0,
|
||||
NULL,
|
||||
|
@@ -72,7 +72,7 @@ class GHOST_SystemSDL : public GHOST_System {
|
||||
|
||||
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const;
|
||||
|
||||
GHOST_IContext *createOffscreenContext();
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
|
||||
|
||||
GHOST_TSuccess disposeContext(GHOST_IContext *context);
|
||||
|
||||
|
@@ -1481,7 +1481,7 @@ void GHOST_SystemWayland::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUn
|
||||
getMainDisplayDimensions(width, height);
|
||||
}
|
||||
|
||||
GHOST_IContext *GHOST_SystemWayland::createOffscreenContext()
|
||||
GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
/* Create new off-screen window. */
|
||||
wl_surface *os_surface = wl_compositor_create_surface(compositor());
|
||||
|
@@ -62,7 +62,7 @@ class GHOST_SystemWayland : public GHOST_System {
|
||||
|
||||
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const override;
|
||||
|
||||
GHOST_IContext *createOffscreenContext() override;
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) override;
|
||||
|
||||
GHOST_TSuccess disposeContext(GHOST_IContext *context) override;
|
||||
|
||||
|
@@ -328,9 +328,9 @@ GHOST_IWindow *GHOST_SystemWin32::createWindow(const char *title,
|
||||
* Never explicitly delete the window, use #disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *GHOST_SystemWin32::createOffscreenContext()
|
||||
GHOST_IContext *GHOST_SystemWin32::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
bool debug_context = false; /* TODO: inform as a parameter */
|
||||
const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0;
|
||||
|
||||
GHOST_Context *context;
|
||||
|
||||
|
@@ -142,7 +142,7 @@ class GHOST_SystemWin32 : public GHOST_System {
|
||||
* Never explicitly delete the window, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *createOffscreenContext();
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
|
||||
|
||||
/**
|
||||
* Dispose of a context.
|
||||
|
@@ -394,7 +394,7 @@ GHOST_IWindow *GHOST_SystemX11::createWindow(const char *title,
|
||||
* Never explicitly delete the context, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
{
|
||||
// During development:
|
||||
// try 4.x compatibility profile
|
||||
@@ -406,6 +406,8 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
// try 3.3 core profile
|
||||
// no fallbacks
|
||||
|
||||
const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0;
|
||||
|
||||
#if defined(WITH_GL_PROFILE_CORE)
|
||||
{
|
||||
const char *version_major = (char *)glewGetString(GLEW_VERSION_MAJOR);
|
||||
@@ -446,7 +448,7 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
4,
|
||||
minor,
|
||||
GHOST_OPENGL_EGL_CONTEXT_FLAGS |
|
||||
(false ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0),
|
||||
(debug_context ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0),
|
||||
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
|
||||
EGL_OPENGL_API);
|
||||
#else
|
||||
@@ -458,7 +460,7 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
4,
|
||||
minor,
|
||||
GHOST_OPENGL_GLX_CONTEXT_FLAGS |
|
||||
(false ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
|
||||
(debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
|
||||
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
|
||||
#endif
|
||||
|
||||
@@ -476,7 +478,7 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
3,
|
||||
3,
|
||||
GHOST_OPENGL_EGL_CONTEXT_FLAGS |
|
||||
(false ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0),
|
||||
(debug_context ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0),
|
||||
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
|
||||
EGL_OPENGL_API);
|
||||
#else
|
||||
@@ -488,7 +490,7 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext()
|
||||
3,
|
||||
3,
|
||||
GHOST_OPENGL_GLX_CONTEXT_FLAGS |
|
||||
(false ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
|
||||
(debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
|
||||
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
|
||||
#endif
|
||||
|
||||
|
@@ -153,7 +153,7 @@ class GHOST_SystemX11 : public GHOST_System {
|
||||
* Never explicitly delete the context, use disposeContext() instead.
|
||||
* \return The new context (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IContext *createOffscreenContext();
|
||||
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
|
||||
|
||||
/**
|
||||
* Dispose of a context.
|
||||
|
@@ -415,7 +415,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
||||
[parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
|
||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
|
||||
}
|
||||
else if (state != GHOST_kWindowStateFullScreen) {
|
||||
else {
|
||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
}
|
||||
|
||||
|
@@ -215,6 +215,11 @@ extern const char *(*MEM_name_ptr)(void *vmemh);
|
||||
* about memory leaks will be printed on exit. */
|
||||
void MEM_init_memleak_detection(void);
|
||||
|
||||
/** When this has been called and memory leaks have been detected, the process will have an exit
|
||||
* code that indicates failure. This can be used for when checking for memory leaks with automated
|
||||
* tests. */
|
||||
void MEM_enable_fail_on_memleak(void);
|
||||
|
||||
/* Switch allocator to slower but fully guarded mode. */
|
||||
void MEM_use_guarded_allocator(void);
|
||||
|
||||
|
@@ -18,6 +18,8 @@
|
||||
* \ingroup MEM
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "mallocn_intern.h"
|
||||
|
||||
@@ -28,6 +30,9 @@ char free_after_leak_detection_message[] =
|
||||
"error, use the 'construct on first use' idiom.";
|
||||
|
||||
namespace {
|
||||
|
||||
bool fail_on_memleak = false;
|
||||
|
||||
class MemLeakPrinter {
|
||||
public:
|
||||
~MemLeakPrinter()
|
||||
@@ -42,6 +47,15 @@ class MemLeakPrinter {
|
||||
leaked_blocks,
|
||||
(double)mem_in_use / 1024 / 1024);
|
||||
MEM_printmemlist();
|
||||
|
||||
if (fail_on_memleak) {
|
||||
/* There are many other ways to change the exit code to failure here:
|
||||
* - Make the destructor noexcept(false) and throw an exception.
|
||||
* - Call exit(EXIT_FAILURE).
|
||||
* - Call terminate().
|
||||
*/
|
||||
abort();
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
@@ -59,3 +73,8 @@ void MEM_init_memleak_detection(void)
|
||||
*/
|
||||
static MemLeakPrinter printer;
|
||||
}
|
||||
|
||||
void MEM_enable_fail_on_memleak(void)
|
||||
{
|
||||
fail_on_memleak = true;
|
||||
}
|
||||
|
@@ -1086,15 +1086,19 @@ string MANTA::parseScript(const string &setup_string, FluidModifierData *fmd)
|
||||
}
|
||||
|
||||
/* Dirty hack: Needed to format paths from python code that is run via PyRun_SimpleString */
|
||||
static string escapeSlashes(string const &s)
|
||||
static string escapePath(string const &s)
|
||||
{
|
||||
string result = "";
|
||||
for (string::const_iterator i = s.begin(), end = s.end(); i != end; ++i) {
|
||||
unsigned char c = *i;
|
||||
if (c == '\\')
|
||||
for (char c : s) {
|
||||
if (c == '\\') {
|
||||
result += "\\\\";
|
||||
else
|
||||
}
|
||||
else if (c == '\'') {
|
||||
result += "\\\'";
|
||||
}
|
||||
else {
|
||||
result += c;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1155,13 +1159,13 @@ bool MANTA::writeData(FluidModifierData *fmd, int framenr)
|
||||
|
||||
if (mUsingSmoke) {
|
||||
ss.str("");
|
||||
ss << "smoke_save_data_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "smoke_save_data_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
}
|
||||
if (mUsingLiquid) {
|
||||
ss.str("");
|
||||
ss << "liquid_save_data_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "liquid_save_data_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
}
|
||||
@@ -1183,7 +1187,7 @@ bool MANTA::writeNoise(FluidModifierData *fmd, int framenr)
|
||||
|
||||
if (mUsingSmoke && mUsingNoise) {
|
||||
ss.str("");
|
||||
ss << "smoke_save_noise_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "smoke_save_noise_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
}
|
||||
@@ -1256,7 +1260,7 @@ bool MANTA::readData(FluidModifierData *fmd, int framenr, bool resumable)
|
||||
|
||||
if (mUsingSmoke) {
|
||||
ss.str("");
|
||||
ss << "smoke_load_data_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "smoke_load_data_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
result &= runPythonString(pythonCommands);
|
||||
@@ -1264,7 +1268,7 @@ bool MANTA::readData(FluidModifierData *fmd, int framenr, bool resumable)
|
||||
}
|
||||
if (mUsingLiquid) {
|
||||
ss.str("");
|
||||
ss << "liquid_load_data_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "liquid_load_data_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
result &= runPythonString(pythonCommands);
|
||||
@@ -1298,7 +1302,7 @@ bool MANTA::readNoise(FluidModifierData *fmd, int framenr, bool resumable)
|
||||
return false;
|
||||
|
||||
ss.str("");
|
||||
ss << "smoke_load_noise_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "smoke_load_noise_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
@@ -1326,14 +1330,14 @@ bool MANTA::readMesh(FluidModifierData *fmd, int framenr)
|
||||
return false;
|
||||
|
||||
ss.str("");
|
||||
ss << "liquid_load_mesh_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "liquid_load_mesh_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << mesh_format << "')";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
if (mUsingMVel) {
|
||||
ss.str("");
|
||||
ss << "liquid_load_meshvel_" << mCurrentID << "('" << escapeSlashes(directory) << "', "
|
||||
<< framenr << ", '" << volume_format << "')";
|
||||
ss << "liquid_load_meshvel_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "')";
|
||||
pythonCommands.push_back(ss.str());
|
||||
}
|
||||
|
||||
@@ -1367,8 +1371,8 @@ bool MANTA::readParticles(FluidModifierData *fmd, int framenr, bool resumable)
|
||||
return false;
|
||||
|
||||
ss.str("");
|
||||
ss << "liquid_load_particles_" << mCurrentID << "('" << escapeSlashes(directory) << "', "
|
||||
<< framenr << ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
ss << "liquid_load_particles_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
return (mParticlesFromFile = runPythonString(pythonCommands));
|
||||
@@ -1399,13 +1403,13 @@ bool MANTA::readGuiding(FluidModifierData *fmd, int framenr, bool sourceDomain)
|
||||
|
||||
if (sourceDomain) {
|
||||
ss.str("");
|
||||
ss << "fluid_load_vel_" << mCurrentID << "('" << escapeSlashes(directory) << "', " << framenr
|
||||
ss << "fluid_load_vel_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "')";
|
||||
}
|
||||
else {
|
||||
ss.str("");
|
||||
ss << "fluid_load_guiding_" << mCurrentID << "('" << escapeSlashes(directory) << "', "
|
||||
<< framenr << ", '" << volume_format << "')";
|
||||
ss << "fluid_load_guiding_" << mCurrentID << "('" << escapePath(directory) << "', " << framenr
|
||||
<< ", '" << volume_format << "')";
|
||||
}
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
@@ -1439,7 +1443,7 @@ bool MANTA::bakeData(FluidModifierData *fmd, int framenr)
|
||||
BLI_path_make_safe(cacheDirGuiding);
|
||||
|
||||
ss.str("");
|
||||
ss << "bake_fluid_data_" << mCurrentID << "('" << escapeSlashes(cacheDirData) << "', " << framenr
|
||||
ss << "bake_fluid_data_" << mCurrentID << "('" << escapePath(cacheDirData) << "', " << framenr
|
||||
<< ", '" << volume_format << "')";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
@@ -1465,7 +1469,7 @@ bool MANTA::bakeNoise(FluidModifierData *fmd, int framenr)
|
||||
BLI_path_make_safe(cacheDirNoise);
|
||||
|
||||
ss.str("");
|
||||
ss << "bake_noise_" << mCurrentID << "('" << escapeSlashes(cacheDirNoise) << "', " << framenr
|
||||
ss << "bake_noise_" << mCurrentID << "('" << escapePath(cacheDirNoise) << "', " << framenr
|
||||
<< ", '" << volume_format << "')";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
@@ -1492,8 +1496,8 @@ bool MANTA::bakeMesh(FluidModifierData *fmd, int framenr)
|
||||
BLI_path_make_safe(cacheDirMesh);
|
||||
|
||||
ss.str("");
|
||||
ss << "bake_mesh_" << mCurrentID << "('" << escapeSlashes(cacheDirMesh) << "', " << framenr
|
||||
<< ", '" << volume_format << "', '" << mesh_format << "')";
|
||||
ss << "bake_mesh_" << mCurrentID << "('" << escapePath(cacheDirMesh) << "', " << framenr << ", '"
|
||||
<< volume_format << "', '" << mesh_format << "')";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
return runPythonString(pythonCommands);
|
||||
@@ -1522,7 +1526,7 @@ bool MANTA::bakeParticles(FluidModifierData *fmd, int framenr)
|
||||
BLI_path_make_safe(cacheDirParticles);
|
||||
|
||||
ss.str("");
|
||||
ss << "bake_particles_" << mCurrentID << "('" << escapeSlashes(cacheDirParticles) << "', "
|
||||
ss << "bake_particles_" << mCurrentID << "('" << escapePath(cacheDirParticles) << "', "
|
||||
<< framenr << ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
@@ -1552,7 +1556,7 @@ bool MANTA::bakeGuiding(FluidModifierData *fmd, int framenr)
|
||||
BLI_path_make_safe(cacheDirGuiding);
|
||||
|
||||
ss.str("");
|
||||
ss << "bake_guiding_" << mCurrentID << "('" << escapeSlashes(cacheDirGuiding) << "', " << framenr
|
||||
ss << "bake_guiding_" << mCurrentID << "('" << escapePath(cacheDirGuiding) << "', " << framenr
|
||||
<< ", '" << volume_format << "', " << resumable_cache << ")";
|
||||
pythonCommands.push_back(ss.str());
|
||||
|
||||
|
@@ -456,7 +456,7 @@ int manta_smoke_ensure_fire(MANTA *smoke, struct FluidModifierData *fmd)
|
||||
if (!smoke || !fmd)
|
||||
return 0;
|
||||
|
||||
int result = smoke->initFire(fmd);
|
||||
bool result = smoke->initFire(fmd);
|
||||
if (smoke->usingNoise()) {
|
||||
result &= smoke->initFireHigh(fmd);
|
||||
}
|
||||
@@ -468,7 +468,7 @@ int manta_smoke_ensure_colors(MANTA *smoke, struct FluidModifierData *fmd)
|
||||
if (!smoke || !fmd)
|
||||
return 0;
|
||||
|
||||
int result = smoke->initColors(fmd);
|
||||
bool result = smoke->initColors(fmd);
|
||||
if (smoke->usingNoise()) {
|
||||
result &= smoke->initColorsHigh(fmd);
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@
|
||||
#elif defined(__QNXNTO__)
|
||||
# define OS_QNX 1
|
||||
#elif defined(__asmjs__) || defined(__wasm__)
|
||||
# define OS_ASMJS
|
||||
# define OS_ASMJS 1
|
||||
#else
|
||||
# error Please add support for your platform in build_config.h
|
||||
#endif
|
||||
|
@@ -47,6 +47,7 @@
|
||||
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
|
||||
using namespace OCIO_NAMESPACE;
|
||||
|
||||
@@ -119,8 +120,8 @@ struct OCIO_GLSLLut3d {
|
||||
struct OCIO_GLSLCurveMappping {
|
||||
/** Cache IDs */
|
||||
size_t cacheId;
|
||||
/** OpenGL Uniform Buffer handle. 0 if not allocated. */
|
||||
GLuint buffer;
|
||||
/** GPU Uniform Buffer handle. 0 if not allocated. */
|
||||
GPUUniformBuf *buffer;
|
||||
/** OpenGL Texture handles. 0 if not allocated. */
|
||||
GLuint texture;
|
||||
/** Error checking. */
|
||||
@@ -370,10 +371,7 @@ static void ensureGLSLCurveMapping(OCIO_GLSLCurveMappping **curvemap_ptr,
|
||||
allocateCurveMappingTexture(curvemap, curve_mapping_settings);
|
||||
|
||||
/* Uniform buffer object. */
|
||||
glGenBuffers(1, &curvemap->buffer);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, curvemap->buffer);
|
||||
glBufferData(GL_UNIFORM_BUFFER, sizeof(OCIO_GLSLCurveMappingParameters), 0, GL_DYNAMIC_DRAW);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
curvemap->buffer = GPU_uniformbuf_create(sizeof(OCIO_GLSLCurveMappingParameters));
|
||||
|
||||
curvemap->valid = (curvemap->texture != 0);
|
||||
curvemap->cacheId = 0;
|
||||
@@ -384,7 +382,7 @@ static void ensureGLSLCurveMapping(OCIO_GLSLCurveMappping **curvemap_ptr,
|
||||
static void freeGLSLCurveMapping(OCIO_GLSLCurveMappping *curvemap)
|
||||
{
|
||||
glDeleteTextures(1, &curvemap->texture);
|
||||
glDeleteBuffers(1, &curvemap->buffer);
|
||||
GPU_uniformbuf_free(curvemap->buffer);
|
||||
|
||||
OBJECT_GUARDED_DELETE(curvemap, OCIO_GLSLCurveMappping);
|
||||
}
|
||||
@@ -438,9 +436,7 @@ static void updateGLSLCurveMapping(OCIO_GLSLCurveMappping *curvemap,
|
||||
data.curve_mapping_lut_size = curve_mapping_settings->lut_size;
|
||||
data.curve_mapping_use_extend_extrapolate = curve_mapping_settings->use_extend_extrapolate;
|
||||
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, curvemap->buffer);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(OCIO_GLSLCurveMappingParameters), &data);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
GPU_uniformbuf_update(curvemap->buffer, &data);
|
||||
|
||||
curvemap->cacheId = cacheId;
|
||||
}
|
||||
@@ -597,7 +593,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
||||
/* Bind UBO. */
|
||||
glBindBufferBase(GL_UNIFORM_BUFFER, shader->ubo_bind, shader_curvemap->buffer);
|
||||
GPU_uniformbuf_bind(shader_curvemap->buffer, shader->ubo_bind);
|
||||
|
||||
/* TODO(fclem) remove remains of IMM. */
|
||||
immBindShader(shader->shader);
|
||||
|
@@ -81,7 +81,7 @@ struct rbRigidBody {
|
||||
};
|
||||
|
||||
struct rbVert {
|
||||
float x, y, z;
|
||||
btScalar x, y, z;
|
||||
};
|
||||
struct rbTri {
|
||||
int v0, v1, v2;
|
||||
@@ -356,8 +356,8 @@ void RB_body_delete(rbRigidBody *object)
|
||||
|
||||
/* motion state */
|
||||
btMotionState *ms = body->getMotionState();
|
||||
if (ms)
|
||||
delete ms;
|
||||
|
||||
delete ms;
|
||||
|
||||
/* collision shape is done elsewhere... */
|
||||
|
||||
@@ -399,8 +399,9 @@ float RB_body_get_mass(rbRigidBody *object)
|
||||
*/
|
||||
float value = (float)body->getInvMass();
|
||||
|
||||
if (value)
|
||||
if (value) {
|
||||
value = 1.0f / value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -551,10 +552,12 @@ void RB_body_set_angular_factor(rbRigidBody *object, float x, float y, float z)
|
||||
void RB_body_set_kinematic_state(rbRigidBody *object, int kinematic)
|
||||
{
|
||||
btRigidBody *body = object->body;
|
||||
if (kinematic)
|
||||
if (kinematic) {
|
||||
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
|
||||
else
|
||||
}
|
||||
else {
|
||||
body->setCollisionFlags(body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
|
||||
}
|
||||
}
|
||||
|
||||
/* ............ */
|
||||
@@ -562,10 +565,12 @@ void RB_body_set_kinematic_state(rbRigidBody *object, int kinematic)
|
||||
void RB_body_set_activation_state(rbRigidBody *object, int use_deactivation)
|
||||
{
|
||||
btRigidBody *body = object->body;
|
||||
if (use_deactivation)
|
||||
if (use_deactivation) {
|
||||
body->forceActivationState(ACTIVE_TAG);
|
||||
else
|
||||
}
|
||||
else {
|
||||
body->setActivationState(DISABLE_DEACTIVATION);
|
||||
}
|
||||
}
|
||||
void RB_body_activate(rbRigidBody *object)
|
||||
{
|
||||
@@ -621,8 +626,9 @@ void RB_body_set_scale(rbRigidBody *object, const float scale[3])
|
||||
cshape->setLocalScaling(btVector3(scale[0], scale[1], scale[2]));
|
||||
|
||||
/* GIimpact shapes have to be updated to take scaling into account */
|
||||
if (cshape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE)
|
||||
if (cshape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE) {
|
||||
((btGImpactMeshShape *)cshape)->updateBound();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,7 +784,7 @@ void RB_trimesh_finish(rbMeshData *mesh)
|
||||
(int *)mesh->triangles,
|
||||
sizeof(rbTri),
|
||||
mesh->num_vertices,
|
||||
(float *)mesh->vertices,
|
||||
(btScalar *)mesh->vertices,
|
||||
sizeof(rbVert));
|
||||
}
|
||||
|
||||
@@ -805,8 +811,9 @@ void RB_shape_trimesh_update(rbCollisionShape *shape,
|
||||
float min[3],
|
||||
float max[3])
|
||||
{
|
||||
if (shape->mesh == NULL || num_verts != shape->mesh->num_vertices)
|
||||
if (shape->mesh == NULL || num_verts != shape->mesh->num_vertices) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_verts; i++) {
|
||||
float *vert = (float *)(((char *)vertices + i * vert_stride));
|
||||
@@ -882,11 +889,12 @@ void RB_shape_delete(rbCollisionShape *shape)
|
||||
if (shape->cshape->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE) {
|
||||
btBvhTriangleMeshShape *child_shape =
|
||||
((btScaledBvhTriangleMeshShape *)shape->cshape)->getChildShape();
|
||||
if (child_shape)
|
||||
delete child_shape;
|
||||
|
||||
delete child_shape;
|
||||
}
|
||||
if (shape->mesh)
|
||||
if (shape->mesh) {
|
||||
RB_trimesh_data_delete(shape->mesh);
|
||||
}
|
||||
delete shape->cshape;
|
||||
|
||||
/* Delete compound child shapes if there are any */
|
||||
|
Submodule release/datafiles/locale updated: bc6623180a...2b3c19f5f6
@@ -238,11 +238,11 @@ const bTheme U_theme_default = {
|
||||
.menu_shadow_fac = 0.3f,
|
||||
.menu_shadow_width = 4,
|
||||
.editor_outline = RGBA(0x1f1f1fff),
|
||||
.icon_alpha = 1.0f,
|
||||
.icon_saturation = 0.5f,
|
||||
.transparent_checker_primary = RGBA(0x333333ff),
|
||||
.transparent_checker_secondary = RGBA(0x262626ff),
|
||||
.transparent_checker_size = 8,
|
||||
.icon_alpha = 1.0f,
|
||||
.icon_saturation = 0.5f,
|
||||
.widget_text_cursor = RGBA(0x3399e6ff),
|
||||
.xaxis = RGBA(0xff3352ff),
|
||||
.yaxis = RGBA(0x8bdc00ff),
|
||||
@@ -250,9 +250,9 @@ const bTheme U_theme_default = {
|
||||
.gizmo_hi = RGBA(0xffffffff),
|
||||
.gizmo_primary = RGBA(0xf5f14dff),
|
||||
.gizmo_secondary = RGBA(0x63ffffff),
|
||||
.gizmo_view_align = RGBA(0xffffffff),
|
||||
.gizmo_a = RGBA(0x4da84dff),
|
||||
.gizmo_b = RGBA(0xa33535ff),
|
||||
.gizmo_view_align = RGBA(0xffffffff),
|
||||
.icon_scene = RGBA(0xe6e6e6ff),
|
||||
.icon_collection = RGBA(0xf4f4f4ff),
|
||||
.icon_object = RGBA(0xee9e5dff),
|
||||
@@ -379,7 +379,7 @@ const bTheme U_theme_default = {
|
||||
.paint_curve_handle = RGBA(0x7fff7f7f),
|
||||
},
|
||||
.space_file = {
|
||||
.back = RGBA(0x33333300),
|
||||
.back = RGBA(0x28282800),
|
||||
.title = RGBA(0xffffffff),
|
||||
.text = RGBA(0xe6e6e6ff),
|
||||
.text_hi = RGBA(0xffffffff),
|
||||
@@ -404,6 +404,7 @@ const bTheme U_theme_default = {
|
||||
.vertex_size = 3,
|
||||
.outline_width = 1,
|
||||
.facedot_size = 4,
|
||||
.row_alternate = RGBA(0xffffff07),
|
||||
},
|
||||
.space_graph = {
|
||||
.back = RGBA(0x42424200),
|
||||
@@ -437,6 +438,7 @@ const bTheme U_theme_default = {
|
||||
.group_active = RGBA(0x368024ff),
|
||||
.vertex = RGBA(0x000000ff),
|
||||
.vertex_select = RGBA(0xff8500ff),
|
||||
.vertex_active = RGBA(0xffffffff),
|
||||
.cframe = RGBA(0x5680c2ff),
|
||||
.time_scrub_background = RGBA(0x292929e6),
|
||||
.time_marker_line = RGBA(0x00000060),
|
||||
@@ -710,7 +712,6 @@ const bTheme U_theme_default = {
|
||||
.preview_stitch_unstitchable = RGBA(0xff0000ff),
|
||||
.preview_stitch_active = RGBA(0xe1d2c323),
|
||||
.uv_shadow = RGBA(0x707070ff),
|
||||
.uv_others = RGBA(0x606060ff),
|
||||
.paint_curve_pivot = RGBA(0xff7f7f7f),
|
||||
.paint_curve_handle = RGBA(0x7fff7f7f),
|
||||
.metadatatext = RGBA(0xffffffff),
|
||||
|
@@ -40,6 +40,31 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="2.90" date="2020-08-31">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Nishita sky texture for Cycles</li>
|
||||
<li>EEVEE motion blur</li>
|
||||
<li>Cloth filter</li>
|
||||
<li>Ocean modifier spray</li>
|
||||
<li>Correct face attributes modeling</li>
|
||||
<li>OpenVDB fluid integration with mantaflow</li>
|
||||
<li>Nuke lens distortion model for motion tracking</li>
|
||||
</ul>
|
||||
<p>Enhancements:</p>
|
||||
<ul>
|
||||
<li>Intel Embree for faster motion blur in Cycles</li>
|
||||
<li>Viewport Intel OpenImageDenoise</li>
|
||||
<li>Shadow terminator offset setting</li>
|
||||
<li>NVLink support for CUDA and Optix</li>
|
||||
<li>Multires unsubdivide, rebuild and modes</li>
|
||||
<li>Pose brush transformations</li>
|
||||
<li>Correct face attributes modeling</li>
|
||||
<li>User interface improvements: new search, modifiers, headings, stats</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2.83" date="2020-06-03">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
|
Submodule release/scripts/addons updated: 1bc96468a1...49c39f59fb
Submodule release/scripts/addons_contrib updated: f2f4a8b3bf...a52733b58d
@@ -27,6 +27,7 @@ op_poll = ops_module.poll
|
||||
op_call = ops_module.call
|
||||
op_as_string = ops_module.as_string
|
||||
op_get_rna_type = ops_module.get_rna_type
|
||||
op_get_bl_options = ops_module.get_bl_options
|
||||
|
||||
|
||||
class BPyOps:
|
||||
@@ -209,6 +210,10 @@ class BPyOpsSubModOp:
|
||||
"""Internal function for introspection"""
|
||||
return op_get_rna_type(self.idname())
|
||||
|
||||
@property
|
||||
def bl_options(self):
|
||||
return op_get_bl_options(self.idname())
|
||||
|
||||
def __repr__(self): # useful display, repr(op)
|
||||
# import bpy
|
||||
return op_as_string(self.idname())
|
||||
|
@@ -534,13 +534,14 @@
|
||||
</graph_editor>
|
||||
<file_browser>
|
||||
<ThemeFileBrowser
|
||||
row_alternate="#ffffff0f"
|
||||
selected_file="#5680c2"
|
||||
>
|
||||
<space>
|
||||
<ThemeSpaceGeneric
|
||||
back="#404040"
|
||||
back="#999999"
|
||||
title="#000000"
|
||||
text="#eeeeee"
|
||||
text="#000000"
|
||||
text_hi="#ffffff"
|
||||
header="#adadadff"
|
||||
header_text="#000000"
|
||||
@@ -735,7 +736,6 @@
|
||||
preview_stitch_unstitchable="#ff0000ff"
|
||||
preview_stitch_active="#e1d2c323"
|
||||
uv_shadow="#707070ff"
|
||||
uv_others="#606060ff"
|
||||
frame_current="#5680c2"
|
||||
metadatabg="#000000"
|
||||
metadatatext="#ffffff"
|
||||
|
@@ -4952,6 +4952,7 @@ def km_transform_modal_map(_params):
|
||||
("CONFIRM", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
|
||||
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
|
||||
("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
|
||||
("AXIS_X", {"type": 'X', "value": 'PRESS', "repeat": False}, None),
|
||||
@@ -4970,6 +4971,7 @@ def km_transform_modal_map(_params):
|
||||
("SNAP_INV_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
|
||||
("SNAP_INV_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
|
||||
("ADD_SNAP", {"type": 'A', "value": 'PRESS', "repeat": False}, None),
|
||||
("ADD_SNAP", {"type": 'A', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
|
||||
("REMOVE_SNAP", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": False}, None),
|
||||
("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
|
||||
("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
|
||||
@@ -4982,11 +4984,17 @@ def km_transform_modal_map(_params):
|
||||
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
|
||||
("EDGESLIDE_EDGE_NEXT", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
|
||||
("EDGESLIDE_PREV_NEXT", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
|
||||
("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS', "repeat": False}, None),
|
||||
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "repeat": False}, None),
|
||||
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "repeat": False, "shift": True}, None),
|
||||
])
|
||||
|
||||
return keymap
|
||||
|
@@ -3894,6 +3894,7 @@ def km_transform_modal_map(_params):
|
||||
("CONFIRM", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
|
||||
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
|
||||
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
|
||||
("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
|
||||
("AXIS_X", {"type": 'X', "value": 'PRESS'}, None),
|
||||
@@ -3912,6 +3913,7 @@ def km_transform_modal_map(_params):
|
||||
("SNAP_INV_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
|
||||
("SNAP_INV_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
|
||||
("ADD_SNAP", {"type": 'A', "value": 'PRESS'}, None),
|
||||
("ADD_SNAP", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
|
||||
("REMOVE_SNAP", {"type": 'A', "value": 'PRESS', "alt": True}, None),
|
||||
("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
|
||||
("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
|
||||
@@ -3924,11 +3926,17 @@ def km_transform_modal_map(_params):
|
||||
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
|
||||
("EDGESLIDE_EDGE_NEXT", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
|
||||
("EDGESLIDE_PREV_NEXT", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
|
||||
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
|
||||
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
|
||||
("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS'}, None),
|
||||
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
|
||||
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None),
|
||||
])
|
||||
|
||||
return keymap
|
||||
|
@@ -151,7 +151,13 @@ class SequencerFadesClear(Operator):
|
||||
return context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip
|
||||
|
||||
def execute(self, context):
|
||||
fcurves = context.scene.animation_data.action.fcurves
|
||||
animation_data = context.scene.animation_data
|
||||
if animation_data is None:
|
||||
return {'CANCELLED'}
|
||||
action = animation_data.action
|
||||
if action is None:
|
||||
return {'CANCELLED'}
|
||||
fcurves = action.fcurves
|
||||
fcurve_map = {
|
||||
curve.data_path: curve
|
||||
for curve in fcurves
|
||||
|
@@ -1284,18 +1284,11 @@ class WM_OT_properties_edit(Operator):
|
||||
prop_type_old = type(item[prop_old])
|
||||
|
||||
rna_idprop_ui_prop_clear(item, prop_old)
|
||||
exec_str = "del item[%r]" % prop_old
|
||||
# print(exec_str)
|
||||
exec(exec_str)
|
||||
del item[prop_old]
|
||||
|
||||
# Reassign
|
||||
exec_str = "item[%r] = %s" % (prop, repr(value_eval))
|
||||
# print(exec_str)
|
||||
exec(exec_str)
|
||||
|
||||
exec_str = "item.property_overridable_library_set('[\"%s\"]', %s)" % (prop, self.is_overridable_library)
|
||||
exec(exec_str)
|
||||
|
||||
item[prop] = value_eval
|
||||
item.property_overridable_library_set('["%s"]' % prop, self.is_overridable_library)
|
||||
rna_idprop_ui_prop_update(item, prop)
|
||||
|
||||
self._last_prop[:] = [prop]
|
||||
@@ -1385,8 +1378,9 @@ class WM_OT_properties_edit(Operator):
|
||||
return {'CANCELLED'}
|
||||
|
||||
# retrieve overridable static
|
||||
exec_str = "item.is_property_overridable_library('[\"%s\"]')" % (self.property)
|
||||
self.is_overridable_library = bool(eval(exec_str))
|
||||
is_overridable = item.is_property_overridable_library('["%s"]' % self.property)
|
||||
self.is_overridable_library = bool(is_overridable)
|
||||
|
||||
|
||||
# default default value
|
||||
prop_type, is_array = rna_idprop_value_item_type(self.get_value_eval())
|
||||
|
@@ -385,6 +385,15 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
col = layout.column(align=False, heading="Passepartout")
|
||||
col.use_property_decorate = False
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.prop(cam, "show_passepartout", text="")
|
||||
sub = sub.row(align=True)
|
||||
sub.active = cam.show_passepartout
|
||||
sub.prop(cam, "passepartout_alpha", text="")
|
||||
row.prop_decorator(cam, "passepartout_alpha")
|
||||
|
||||
class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
|
||||
bl_label = "Composition Guides"
|
||||
@@ -414,27 +423,6 @@ class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
|
||||
col.prop(cam, "show_composition_harmony_tri_b", text="Triangle B")
|
||||
|
||||
|
||||
class DATA_PT_camera_display_passepartout(CameraButtonsPanel, Panel):
|
||||
bl_label = "Passepartout"
|
||||
bl_parent_id = "DATA_PT_camera_display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
||||
|
||||
def draw_header(self, context):
|
||||
cam = context.camera
|
||||
|
||||
self.layout.prop(cam, "show_passepartout", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.active = cam.show_passepartout
|
||||
layout.prop(cam, "passepartout_alpha", text="Opacity", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
bl_label = "Safe Areas"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -534,7 +522,6 @@ classes = (
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_camera_display,
|
||||
DATA_PT_camera_display_composition_guides,
|
||||
DATA_PT_camera_display_passepartout,
|
||||
DATA_PT_custom_props_camera,
|
||||
)
|
||||
|
||||
|
@@ -920,9 +920,8 @@ class ShowHideMenu:
|
||||
layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
|
||||
|
||||
|
||||
# Standard transforms which apply to all cases
|
||||
# NOTE: this doesn't seem to be able to be used directly
|
||||
class VIEW3D_MT_transform_base(Menu):
|
||||
# Standard transforms which apply to all cases (mix-in class, not used directly).
|
||||
class VIEW3D_MT_transform_base:
|
||||
bl_label = "Transform"
|
||||
bl_category = "View"
|
||||
|
||||
@@ -949,7 +948,7 @@ class VIEW3D_MT_transform_base(Menu):
|
||||
|
||||
|
||||
# Generic transform menu - geometry types
|
||||
class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
|
||||
class VIEW3D_MT_transform(VIEW3D_MT_transform_base, Menu):
|
||||
def draw(self, context):
|
||||
# base menu
|
||||
VIEW3D_MT_transform_base.draw(self, context)
|
||||
@@ -969,7 +968,7 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
|
||||
|
||||
|
||||
# Object-specific extensions to Transform menu
|
||||
class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
|
||||
class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base, Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -1001,7 +1000,7 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
|
||||
|
||||
|
||||
# Armature EditMode extensions to Transform menu
|
||||
class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
|
||||
class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base, Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -2287,6 +2286,7 @@ class VIEW3D_MT_object(Menu):
|
||||
layout.separator()
|
||||
|
||||
layout.menu("VIEW3D_MT_object_showhide")
|
||||
layout.menu("VIEW3D_MT_object_cleanup")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -2726,6 +2726,20 @@ class VIEW3D_MT_object_showhide(Menu):
|
||||
layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
|
||||
|
||||
|
||||
class VIEW3D_MT_object_cleanup(Menu):
|
||||
bl_label = "Clean Up"
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.vertex_group_clean", text="Clean Vertex Group Weights").group_select_mode = 'ALL'
|
||||
layout.operator("object.vertex_group_limit_total", text="Limit Total Vertex Groups").group_select_mode = 'ALL'
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("object.material_slot_remove_unused", text="Remove Unused Material Slots")
|
||||
|
||||
|
||||
class VIEW3D_MT_make_single_user(Menu):
|
||||
bl_label = "Make Single User"
|
||||
|
||||
@@ -6486,7 +6500,7 @@ class VIEW3D_PT_overlay_vertex_paint(Panel):
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
col.prop(overlay, "vertex_paint_mode_opacity", text="Opacity")
|
||||
col.prop(overlay, "vertex_paint_mode_opacity")
|
||||
col.prop(overlay, "show_paint_wire")
|
||||
|
||||
|
||||
@@ -7384,7 +7398,6 @@ classes = (
|
||||
VIEW3D_HT_tool_header,
|
||||
VIEW3D_MT_editor_menus,
|
||||
VIEW3D_MT_transform,
|
||||
VIEW3D_MT_transform_base,
|
||||
VIEW3D_MT_transform_object,
|
||||
VIEW3D_MT_transform_armature,
|
||||
VIEW3D_MT_mirror,
|
||||
@@ -7447,6 +7460,7 @@ classes = (
|
||||
VIEW3D_MT_object_constraints,
|
||||
VIEW3D_MT_object_quick_effects,
|
||||
VIEW3D_MT_object_showhide,
|
||||
VIEW3D_MT_object_cleanup,
|
||||
VIEW3D_MT_make_single_user,
|
||||
VIEW3D_MT_make_links,
|
||||
VIEW3D_MT_brush_paint_modes,
|
||||
|
@@ -478,7 +478,7 @@ texture_node_categories = [
|
||||
def not_implemented_node(idname):
|
||||
NodeType = getattr(bpy.types, idname)
|
||||
name = NodeType.bl_rna.name
|
||||
label = f"{name} (mockup)"
|
||||
label = "%s (mockup)" % name
|
||||
return NodeItem(idname, label=label)
|
||||
|
||||
simulation_node_categories = [
|
||||
|
@@ -35,6 +35,10 @@ struct LibraryForeachIDData;
|
||||
struct Main;
|
||||
struct ReportList;
|
||||
struct bAction;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
struct BlendLibReader;
|
||||
struct BlendExpander;
|
||||
|
||||
/* ************************************* */
|
||||
/* AnimData API */
|
||||
@@ -94,6 +98,13 @@ void BKE_animdata_merge_copy(struct Main *bmain,
|
||||
eAnimData_MergeCopy_Modes action_mode,
|
||||
bool fix_drivers);
|
||||
|
||||
void BKE_animdata_blend_write(struct BlendWriter *writer, struct AnimData *adt);
|
||||
void BKE_animdata_blend_read_data(struct BlendDataReader *reader, struct AnimData *adt);
|
||||
void BKE_animdata_blend_read_lib(struct BlendLibReader *reader,
|
||||
struct ID *id,
|
||||
struct AnimData *adt);
|
||||
void BKE_animdata_blend_read_expand(struct BlendExpander *expander, struct AnimData *adt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -37,6 +37,8 @@ struct BMesh;
|
||||
struct CustomData;
|
||||
struct CustomData_MeshMasks;
|
||||
struct ID;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
typedef uint64_t CustomDataMask;
|
||||
|
||||
/*a data type large enough to hold 1 element from any customdata layer type*/
|
||||
@@ -571,6 +573,14 @@ typedef struct CustomDataTransferLayerMap {
|
||||
void CustomData_data_transfer(const struct MeshPairRemap *me_remap,
|
||||
const CustomDataTransferLayerMap *laymap);
|
||||
|
||||
/* .blend file I/O */
|
||||
void CustomData_blend_write(struct BlendWriter *writer,
|
||||
struct CustomData *data,
|
||||
int count,
|
||||
CustomDataMask cddata_mask,
|
||||
struct ID *id);
|
||||
void CustomData_blend_read(struct BlendDataReader *reader, struct CustomData *data, int count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -35,6 +35,8 @@ struct MLoop;
|
||||
struct MPoly;
|
||||
struct Object;
|
||||
struct bDeformGroup;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
|
||||
struct bDeformGroup *BKE_object_defgroup_new(struct Object *ob, const char *name);
|
||||
void BKE_defgroup_copy_list(struct ListBase *lb1, const struct ListBase *lb2);
|
||||
@@ -162,6 +164,11 @@ void BKE_defvert_extract_vgroup_to_polyweights(struct MDeformVert *dvert,
|
||||
|
||||
void BKE_defvert_weight_to_rgb(float r_rgb[3], const float weight);
|
||||
|
||||
void BKE_defvert_blend_write(struct BlendWriter *writer, int count, struct MDeformVert *dvlist);
|
||||
void BKE_defvert_blend_read(struct BlendDataReader *reader,
|
||||
int count,
|
||||
struct MDeformVert *mdverts);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -44,6 +44,10 @@ struct PropertyRNA;
|
||||
struct StructRNA;
|
||||
struct bAction;
|
||||
struct bContext;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
struct BlendLibReader;
|
||||
struct BlendExpander;
|
||||
|
||||
/* ************** Keyframe Tools ***************** */
|
||||
|
||||
@@ -311,6 +315,24 @@ float fcurve_samplingcb_evalcurve(struct FCurve *fcu, void *data, float evaltime
|
||||
void fcurve_store_samples(
|
||||
struct FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb);
|
||||
|
||||
/* ************* F-Curve .blend file API ******************** */
|
||||
|
||||
void BKE_fmodifiers_blend_write(struct BlendWriter *writer, struct ListBase *fmodifiers);
|
||||
void BKE_fmodifiers_blend_read_data(struct BlendDataReader *reader,
|
||||
ListBase *fmodifiers,
|
||||
struct FCurve *curve);
|
||||
void BKE_fmodifiers_blend_read_lib(struct BlendLibReader *reader,
|
||||
struct ID *id,
|
||||
struct ListBase *fmodifiers);
|
||||
void BKE_fmodifiers_blend_read_expand(struct BlendExpander *expander, struct ListBase *fmodifiers);
|
||||
|
||||
void BKE_fcurve_blend_write(struct BlendWriter *writer, struct ListBase *fcurves);
|
||||
void BKE_fcurve_blend_read_data(struct BlendDataReader *reader, struct ListBase *fcurves);
|
||||
void BKE_fcurve_blend_read_lib(struct BlendLibReader *reader,
|
||||
struct ID *id,
|
||||
struct ListBase *fcurves);
|
||||
void BKE_fcurve_blend_read_expand(struct BlendExpander *expander, struct ListBase *fcurves);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -71,7 +71,6 @@ typedef struct Global {
|
||||
* * -1: Disable faster motion paths computation (since 08/2018).
|
||||
* * 1 - 30: EEVEE debug/stats values (01/2018).
|
||||
* * 101: Enable UI debug drawing of fullscreen area's corner widget (10/2014).
|
||||
* * 527: Old mysterious switch in behavior of MeshDeform modifier (before 04/2010).
|
||||
* * 666: Use quicker batch delete for outliners' delete hierarchy (01/2019).
|
||||
* * 777: Enable UI node panel's sockets polling (11/2011).
|
||||
* * 799: Enable some mysterious new depsgraph behavior (05/2015).
|
||||
|
@@ -30,6 +30,10 @@ extern "C" {
|
||||
|
||||
struct ID;
|
||||
struct IDProperty;
|
||||
struct BlendWriter;
|
||||
struct BlendDataReader;
|
||||
struct BlendLibReader;
|
||||
struct BlendExpander;
|
||||
|
||||
typedef union IDPropertyTemplate {
|
||||
int i;
|
||||
@@ -196,6 +200,14 @@ void IDP_repr_fn(const IDProperty *prop,
|
||||
void *user_data);
|
||||
void IDP_print(const struct IDProperty *prop);
|
||||
|
||||
void IDP_BlendWrite(struct BlendWriter *writer, const struct IDProperty *prop);
|
||||
void IDP_BlendReadData_impl(struct BlendDataReader *reader,
|
||||
IDProperty **prop,
|
||||
const char *caller_func_id);
|
||||
#define IDP_BlendDataRead(reader, prop) IDP_BlendReadData_impl(reader, prop, __func__)
|
||||
void IDP_BlendReadLib(struct BlendLibReader *reader, IDProperty *prop);
|
||||
void IDP_BlendReadExpand(struct BlendExpander *expander, IDProperty *prop);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user