Compare commits
377 Commits
tmp-Timeli
...
temp-volum
Author | SHA1 | Date | |
---|---|---|---|
74f7cdcf6b | |||
ab9bd557ad | |||
edbb2d2279 | |||
83a4e1aaf9 | |||
4697604331 | |||
ceba8e28b7 | |||
50e3cd0bb3 | |||
43973410f3 | |||
7d73ba904e | |||
87535dd73d | |||
a6ec402f5a | |||
f6367ecfb6 | |||
8ff3f7f601 | |||
30bffb5a3a | |||
f4213c1408 | |||
252ebf6bfd | |||
8c957468bc | |||
fb5597540d | |||
e77d2b4e3f | |||
753a600e35 | |||
9a5fb0209e | |||
d75b8e5f01 | |||
0108ce1fe5 | |||
b328a59373 | |||
1db47a2ccd | |||
b843753ad5 | |||
08274433e1 | |||
59b4c67536 | |||
2b963ecb81 | |||
0ed54cf9ba | |||
d0920fba16 | |||
c17cb50ae2 | |||
80373bc4d2 | |||
719629f2aa | |||
f9107eae6a | |||
f51c6efbc1 | |||
8c528a4f0a | |||
6793aebad2 | |||
70e2824126 | |||
9856dd9fec | |||
5480de3fca | |||
97cd8bfae1 | |||
4b373ed086 | |||
252207cc7a | |||
b94222b090 | |||
22150eb409 | |||
3527857cdc | |||
0987c11c76 | |||
12ce0cfb21 | |||
7691040166 | |||
3cc2a9b934 | |||
![]() |
df30b50f2f | ||
![]() |
d20d2bcb7f | ||
1daa20ad9f | |||
62fbb7d4a1 | |||
d56b90705e | |||
52655f5161 | |||
0e2915b292 | |||
![]() |
4d00e95ee3 | ||
cd17b32583 | |||
c960804747 | |||
f1525cf534 | |||
9db8bdbc65 | |||
97a0d6fcc7 | |||
b10c64bd2f | |||
969111f9b5 | |||
eb7286bfd2 | |||
8c15d612a5 | |||
b66aa0b0a6 | |||
dbe1b07e05 | |||
73c577d46a | |||
e5767eaad1 | |||
c6416ae653 | |||
b88e51dd55 | |||
bfbfb1c47e | |||
26c5a1c301 | |||
71e65daf5c | |||
9c5203c98f | |||
ddee0931b8 | |||
3ec6f2172d | |||
fadad17c58 | |||
9738de820a | |||
bea62c5c1a | |||
bdc1108e8c | |||
a42fd3de5d | |||
b26e9f0000 | |||
5c0d8bcdc7 | |||
728e92422e | |||
ccacf3ae3c | |||
b372766816 | |||
af36dd4664 | |||
46dceefc35 | |||
![]() |
aa6247a385 | ||
f22ef1706d | |||
274bde23fb | |||
d5a8c0c414 | |||
597122d72b | |||
9536f67e7e | |||
b633d760a2 | |||
532c8ac583 | |||
ecb56eac57 | |||
599e979d90 | |||
![]() |
73eb1bfd55 | ||
df237b964b | |||
a69f985f40 | |||
87f598fd3f | |||
![]() |
d53093953f | ||
8a7f317666 | |||
f33cb522dd | |||
b09387c388 | |||
f3b9fa5393 | |||
574c716f2d | |||
e61bbc00b7 | |||
f8a3636374 | |||
6cd0484de8 | |||
ec27776d8e | |||
38247fc80b | |||
0d7e758c91 | |||
a5f046f449 | |||
2fe528424d | |||
101fd7ec06 | |||
cbf5c738d6 | |||
1870a1adc7 | |||
a0dce6810d | |||
68f4a4641e | |||
51f6b25afd | |||
84dbf949d7 | |||
cd6cb55ff3 | |||
a4f08297ed | |||
52aa963f0e | |||
a283333cd8 | |||
d6313f47af | |||
f1bc9331b1 | |||
3995b33a42 | |||
d312dbea2d | |||
372754c164 | |||
5cad6afac6 | |||
daaf315bf2 | |||
fd48e685c3 | |||
d4519f54b3 | |||
0a8af46707 | |||
![]() |
9ff135d85d | ||
b5893b1ba3 | |||
668f39519c | |||
b09a8203e9 | |||
64a2f98062 | |||
751189e9d6 | |||
f0c6f5ee77 | |||
38b72fb64b | |||
ab59f9e65d | |||
b7b7468bef | |||
ce7c87fbda | |||
579631819f | |||
b66ae8259e | |||
86e20a2e63 | |||
e7a68ef843 | |||
2ceff8bd63 | |||
a24b4e6090 | |||
76c2203f9c | |||
6fc8a74886 | |||
a262ea8c47 | |||
410880552b | |||
e74bd46ede | |||
1eed46c788 | |||
78fbd146f3 | |||
4be752a93c | |||
5513da65b2 | |||
f19ecdeec6 | |||
a0a1fc8938 | |||
6453814ec0 | |||
42103a3eb8 | |||
2f1e34cfcc | |||
36e82b7759 | |||
ace8ad861d | |||
35c71aed25 | |||
73abca1da0 | |||
b955747875 | |||
799779d432 | |||
2b9edbc98b | |||
d645b1a78a | |||
49915e3241 | |||
da9b1b14ed | |||
2e25a48b05 | |||
b84fad2ba3 | |||
284e0ea756 | |||
8148d549bb | |||
cbc7ee28d7 | |||
3ee606621c | |||
064e701472 | |||
716e138a1b | |||
fd19069999 | |||
66407e15cb | |||
0eb3246713 | |||
4d58fac1b4 | |||
3102833962 | |||
90e6323ed8 | |||
57cd52a4ab | |||
f61c30f804 | |||
5ff1d845ea | |||
2002fe27d9 | |||
5788f24337 | |||
67e8c1e1c7 | |||
2788202417 | |||
f27ecd56ef | |||
b00d840359 | |||
760e79d809 | |||
ec4ce908db | |||
a6585fa4b1 | |||
d617a6c85b | |||
be57cf9b2a | |||
5508b572ea | |||
75bcb70c60 | |||
7bf4023689 | |||
78a8d3685b | |||
b763c34e80 | |||
a6e582164f | |||
d0956e9cb3 | |||
8055ed2741 | |||
13d238729b | |||
28c34ae7e2 | |||
4d339f56fe | |||
9e8bd3a072 | |||
1d8d4e03f5 | |||
7ac0272b77 | |||
474a145d78 | |||
d0a16772ad | |||
ae01df5779 | |||
2e14b7fb97 | |||
83cb34ccd1 | |||
638de72277 | |||
fb565ddb68 | |||
56a47e58f4 | |||
9bcced83ee | |||
6f4c7f1f01 | |||
f3427cbc98 | |||
5165d62931 | |||
1857823839 | |||
2dc7555522 | |||
540e85d567 | |||
4127aeb7a5 | |||
fb1915d870 | |||
7b6af843c2 | |||
55606dbdbc | |||
dff8a7db73 | |||
20367898fe | |||
e3fe8ce00b | |||
a25c11fd8d | |||
009c38df53 | |||
8f49299134 | |||
cfc1ddeff7 | |||
80dcb2ced8 | |||
d274c64d22 | |||
df4525d1d9 | |||
863e395ad8 | |||
e19686a35a | |||
8a2db3ed21 | |||
6242940639 | |||
5330f1c5d1 | |||
b3a7a75a26 | |||
16017178b2 | |||
54f9cd5283 | |||
409cfba1a3 | |||
0e68751b8a | |||
70b705b5fe | |||
de702a4803 | |||
bfbd85e9d6 | |||
713027b832 | |||
983811607d | |||
cd58ce85c2 | |||
5e44324b79 | |||
1628a6858e | |||
481cdb08ed | |||
1d97e948d2 | |||
c68429bc03 | |||
d860d23e1a | |||
88b46a6ce9 | |||
6fee105943 | |||
58e8c71cbd | |||
f6740993f7 | |||
747534af00 | |||
7277f8973b | |||
44505b38df | |||
6654e109df | |||
2d3d76693a | |||
7719c11006 | |||
854db8951b | |||
ba65f7093b | |||
38eb91c848 | |||
335b193336 | |||
6221180963 | |||
815b1f24fa | |||
2ef695fabf | |||
![]() |
fec317de8d | ||
c140f11946 | |||
75fc1c3507 | |||
051e186d5c | |||
7c75c2db4f | |||
cfea9c261c | |||
da11e33b26 | |||
16100f8261 | |||
b53d358261 | |||
28369f725c | |||
24d1829243 | |||
84a9647f22 | |||
d9324b61d5 | |||
![]() |
6c0705009e | ||
c0f42a7526 | |||
10a2562bc5 | |||
18c12803bd | |||
2c03d6a12b | |||
f7af08b5fe | |||
c72a204001 | |||
d6a4b23f8b | |||
9450792bf2 | |||
81060ff6b2 | |||
dc0eed178a | |||
fd2c48726f | |||
38cb29d67e | |||
edce44d693 | |||
56254a42e0 | |||
bc3727a943 | |||
06cb460cd7 | |||
12a9e9ae33 | |||
7a0699db34 | |||
48155c210a | |||
ef502854fe | |||
c9db7ceff2 | |||
bae880dc9e | |||
857e4e04d8 | |||
4dee702332 | |||
9dca74f0e5 | |||
9812943931 | |||
e31b8303ed | |||
d02335a195 | |||
5e2f9c5c67 | |||
b4a8b81399 | |||
6862762685 | |||
8d9faf840b | |||
1318660b04 | |||
3e9b592b08 | |||
54f2e58452 | |||
176e18436c | |||
d886e32270 | |||
103a31f712 | |||
3ada840e65 | |||
76ece90d4a | |||
28c20fc393 | |||
9f66d00287 | |||
605e184167 | |||
882daeffc5 | |||
6d8aa85051 | |||
9f2ae547c0 | |||
4198c18f15 | |||
12a60265cd | |||
d712dd2f19 | |||
e077285745 | |||
4d19f24ba7 | |||
5e7a21a5f5 | |||
1cc4ab481e | |||
cb50c288d4 | |||
278e3f7d5f | |||
96fba1e101 | |||
0e0d99161a | |||
b290048257 | |||
4461be1b72 | |||
91504ed26e | |||
3eb9cc69f2 | |||
9636cab009 | |||
ae8225ba6d | |||
43ee4d5d7c | |||
c1d737eb95 | |||
b99d064e91 | |||
c84b8d4801 | |||
f197134426 | |||
925e775818 | |||
73a7885ab3 | |||
d5c1c0b10d |
44
.editorconfig
Normal file
44
.editorconfig
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# C/C++
|
||||||
|
[*.{c,cc,h,hh,inl,glsl}]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
max_line_length = 120
|
||||||
|
|
||||||
|
# CMake & Text
|
||||||
|
[*.{cmake,txt}]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
max_line_length = 120
|
||||||
|
|
||||||
|
# Python
|
||||||
|
[*.py]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
max_line_length = 120
|
||||||
|
|
||||||
|
# Shell
|
||||||
|
[*.sh]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
max_line_length = 120
|
||||||
|
|
||||||
|
# reStructuredText
|
||||||
|
[*.rst]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 3
|
||||||
|
max_line_length = 120
|
131
CMakeLists.txt
131
CMakeLists.txt
@@ -66,21 +66,12 @@ endif()
|
|||||||
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||||
|
|
||||||
# global compile definitions since add_definitions() adds for all.
|
# global compile definitions since add_definitions() adds for all.
|
||||||
|
|
||||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||||
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
||||||
$<$<CONFIG:Release>:NDEBUG>
|
$<$<CONFIG:Release>:NDEBUG>
|
||||||
$<$<CONFIG:MinSizeRel>:NDEBUG>
|
$<$<CONFIG:MinSizeRel>:NDEBUG>
|
||||||
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
|
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
# keep until CMake-3.0 is min requirement
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG)
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG)
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG)
|
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Set policy
|
# Set policy
|
||||||
@@ -453,7 +444,7 @@ mark_as_advanced(WITH_MEM_VALGRIND)
|
|||||||
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
|
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
|
||||||
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
|
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
|
||||||
|
|
||||||
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
|
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
|
||||||
mark_as_advanced(WITH_ASSERT_ABORT)
|
mark_as_advanced(WITH_ASSERT_ABORT)
|
||||||
|
|
||||||
option(WITH_BOOST "Enable features depending on boost" ON)
|
option(WITH_BOOST "Enable features depending on boost" ON)
|
||||||
@@ -536,6 +527,49 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
mark_as_advanced(WITH_LINKER_GOLD)
|
mark_as_advanced(WITH_LINKER_GOLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
|
||||||
|
mark_as_advanced(WITH_COMPILER_ASAN)
|
||||||
|
|
||||||
|
if(WITH_COMPILER_ASAN)
|
||||||
|
set(_asan_defaults "\
|
||||||
|
-fsanitize=address \
|
||||||
|
-fsanitize=bool \
|
||||||
|
-fsanitize=bounds \
|
||||||
|
-fsanitize=enum \
|
||||||
|
-fsanitize=float-cast-overflow \
|
||||||
|
-fsanitize=float-divide-by-zero \
|
||||||
|
-fsanitize=nonnull-attribute \
|
||||||
|
-fsanitize=returns-nonnull-attribute \
|
||||||
|
-fsanitize=signed-integer-overflow \
|
||||||
|
-fsanitize=undefined \
|
||||||
|
-fsanitize=vla-bound \
|
||||||
|
-fno-sanitize=alignment \
|
||||||
|
")
|
||||||
|
|
||||||
|
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
|
||||||
|
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
|
||||||
|
endif()
|
||||||
|
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
||||||
|
mark_as_advanced(COMPILER_ASAN_CFLAGS)
|
||||||
|
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
|
||||||
|
mark_as_advanced(COMPILER_ASAN_CXXFLAGS)
|
||||||
|
|
||||||
|
unset(_asan_defaults)
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||||
|
else()
|
||||||
|
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
||||||
|
PATHS
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Dependency graph
|
# Dependency graph
|
||||||
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
|
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
|
||||||
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
|
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
|
||||||
@@ -604,10 +638,12 @@ endif()
|
|||||||
|
|
||||||
if(NOT WITH_AUDASPACE)
|
if(NOT WITH_AUDASPACE)
|
||||||
if(WITH_OPENAL)
|
if(WITH_OPENAL)
|
||||||
message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
|
message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
|
||||||
|
set(WITH_OPENAL OFF)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_JACK)
|
if(WITH_JACK)
|
||||||
message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
|
message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
|
||||||
|
set(WITH_JACK OFF)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_GAMEENGINE)
|
if(WITH_GAMEENGINE)
|
||||||
message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
|
message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
|
||||||
@@ -819,7 +855,8 @@ set(C_WARNINGS)
|
|||||||
set(CXX_WARNINGS)
|
set(CXX_WARNINGS)
|
||||||
|
|
||||||
# for gcc -Wno-blah-blah
|
# for gcc -Wno-blah-blah
|
||||||
set(CC_REMOVE_STRICT_FLAGS)
|
set(C_REMOVE_STRICT_FLAGS)
|
||||||
|
set(CXX_REMOVE_STRICT_FLAGS)
|
||||||
|
|
||||||
# libraries to link the binary with passed to target_link_libraries()
|
# libraries to link the binary with passed to target_link_libraries()
|
||||||
# known as LLIBS to scons
|
# known as LLIBS to scons
|
||||||
@@ -831,6 +868,21 @@ set(PLATFORM_LINKLIBS "")
|
|||||||
set(PLATFORM_LINKFLAGS "")
|
set(PLATFORM_LINKFLAGS "")
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "")
|
set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||||
|
|
||||||
|
if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
|
if(WITH_COMPILER_ASAN)
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
|
||||||
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||||
|
if(MSVC)
|
||||||
|
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
||||||
|
endif()
|
||||||
|
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
||||||
|
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||||
|
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#Platform specifics
|
#Platform specifics
|
||||||
@@ -1431,16 +1483,22 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# flags to undo strict flags
|
# flags to undo strict flags
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS -Wno-type-limits)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
|
||||||
|
|
||||||
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
@@ -1469,23 +1527,23 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|||||||
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
||||||
|
|
||||||
# flags to undo strict flags
|
# flags to undo strict flags
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||||
|
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
|
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
|
||||||
|
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
|
||||||
|
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
|
|
||||||
@@ -1577,7 +1635,12 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Visual Studio has all standards it supports available by default
|
# Visual Studio has all standards it supports available by default
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
|
# Clang on windows copies this behavior and does not support these switches
|
||||||
|
if(
|
||||||
|
CMAKE_COMPILER_IS_GNUCC OR
|
||||||
|
(CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
|
||||||
|
(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
|
)
|
||||||
# Use C99 + GNU extensions, works with GCC, Clang, ICC
|
# Use C99 + GNU extensions, works with GCC, Clang, ICC
|
||||||
if(WITH_C11)
|
if(WITH_C11)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||||
|
@@ -236,7 +236,9 @@ help: .FORCE
|
|||||||
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Utilities (not associated with building blender)"
|
@echo "Utilities (not associated with building blender)"
|
||||||
@echo " * icons - updates PNG icons from SVG files."
|
@echo " * icons - Updates PNG icons from SVG files."
|
||||||
|
@echo " Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'"
|
||||||
|
@echo " to define your own commands."
|
||||||
@echo " * tgz - create a compressed archive of the source code."
|
@echo " * tgz - create a compressed archive of the source code."
|
||||||
@echo " * update - updates git and all submodules"
|
@echo " * update - updates git and all submodules"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
@@ -58,4 +58,3 @@ if(MSVC)
|
|||||||
DEPENDEES mkdir update patch download configure build install
|
DEPENDEES mkdir update patch download configure build install
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -39,5 +39,6 @@ if(BUILD_MODE STREQUAL Release)
|
|||||||
PREFIX ${BUILD_DIR}/openal
|
PREFIX ${BUILD_DIR}/openal
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/openal
|
INSTALL_DIR ${LIBDIR}/openal
|
||||||
|
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -56,24 +56,27 @@ if(WIN32)
|
|||||||
# For OIIO and OSL
|
# For OIIO and OSL
|
||||||
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
||||||
|
|
||||||
# TODO FIXME highly MSVC specific
|
if(MSVC_VERSION GREATER 1909)
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
else()
|
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
endif()
|
endif()
|
||||||
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
|
||||||
|
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
else()
|
else()
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
endif()
|
endif()
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
else()
|
||||||
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
endif()
|
||||||
|
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
set(PLATFORM_FLAGS)
|
set(PLATFORM_FLAGS)
|
||||||
set(PLATFORM_CXX_FLAGS)
|
set(PLATFORM_CXX_FLAGS)
|
||||||
|
@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
|
|||||||
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
|
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
|
|||||||
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
|
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -37,4 +37,3 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
|
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -13,3 +13,25 @@
|
|||||||
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
||||||
-# endif
|
-# endif
|
||||||
-#endif
|
-#endif
|
||||||
|
--- a/boost/type_traits/has_nothrow_assign.hpp 2015-12-13 05:49:42 -0700
|
||||||
|
+++ b/boost/type_traits/has_nothrow_assign.hpp 2018-05-27 11:11:02 -0600
|
||||||
|
@@ -24,7 +24,7 @@
|
||||||
|
#include <boost/type_traits/remove_reference.hpp>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
-#if defined(__GNUC__) || defined(__SUNPRO_CC)
|
||||||
|
+#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__)
|
||||||
|
#include <boost/type_traits/is_const.hpp>
|
||||||
|
#include <boost/type_traits/is_volatile.hpp>
|
||||||
|
#include <boost/type_traits/is_assignable.hpp>
|
||||||
|
--- a/boost/type_traits/has_nothrow_constructor.hpp 2015-12-13 05:49:42 -0700
|
||||||
|
+++ b/boost/type_traits/has_nothrow_constructor.hpp 2018-05-27 11:11:02 -0600
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
|
||||||
|
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||||
|
#endif
|
||||||
|
-#if defined(__GNUC__ ) || defined(__SUNPRO_CC)
|
||||||
|
+#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__)
|
||||||
|
#include <boost/type_traits/is_default_constructible.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -79,4 +79,3 @@ macro( select_library_configurations basename )
|
|||||||
${basename}_LIBRARY_DEBUG
|
${basename}_LIBRARY_DEBUG
|
||||||
)
|
)
|
||||||
endmacro( select_library_configurations )
|
endmacro( select_library_configurations )
|
||||||
|
|
||||||
|
13
build_files/build_environment/patches/openal.diff
Normal file
13
build_files/build_environment/patches/openal.diff
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
|
||||||
|
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
|
||||||
|
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
|
||||||
|
@@ -885,7 +885,8 @@
|
||||||
|
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
|
||||||
|
IF(HAVE_WINDOWS_H)
|
||||||
|
# Check MMSystem backend
|
||||||
|
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
|
||||||
|
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
|
||||||
|
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
|
||||||
|
IF(HAVE_MMSYSTEM_H)
|
||||||
|
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
|
||||||
|
IF(HAVE_LIBWINMM)
|
@@ -10,3 +10,29 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
|
|||||||
MAIN_DEPENDENCY ${flexsrc}
|
MAIN_DEPENDENCY ${flexsrc}
|
||||||
DEPENDS ${${compiler_headers}}
|
DEPENDS ${${compiler_headers}}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
|
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
|
||||||
|
+++ osl/src/external_osl/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
|
||||||
|
@@ -44,12 +44,18 @@
|
||||||
|
// same if another packages is compiling against OSL and using these headers
|
||||||
|
// (OSL may be C++11 but the client package may be older, or vice versa --
|
||||||
|
// use these two symbols to differentiate these cases, when important).
|
||||||
|
-#if (__cplusplus >= 201402L)
|
||||||
|
-# define OSL_CPLUSPLUS_VERSION 14
|
||||||
|
-#elif (__cplusplus >= 201103L)
|
||||||
|
-# define OSL_CPLUSPLUS_VERSION 11
|
||||||
|
+
|
||||||
|
+// Force C++03 for MSVC in blender since svn the libraries are build with that
|
||||||
|
+#if !defined(_MSC_VER)
|
||||||
|
+ #if (__cplusplus >= 201402L)
|
||||||
|
+ # define OSL_CPLUSPLUS_VERSION 14
|
||||||
|
+ #elif (__cplusplus >= 201103L)
|
||||||
|
+ # define OSL_CPLUSPLUS_VERSION 11
|
||||||
|
+ #else
|
||||||
|
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
||||||
|
+ #endif
|
||||||
|
#else
|
||||||
|
-# define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
||||||
|
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Symbol export defines
|
||||||
|
@@ -14,10 +14,18 @@ if NOT "%1" == "" (
|
|||||||
set BuildDir=VS14
|
set BuildDir=VS14
|
||||||
goto par2
|
goto par2
|
||||||
)
|
)
|
||||||
|
if "%1" == "2017" (
|
||||||
|
echo "Building for VS2017"
|
||||||
|
set VSVER=15.0
|
||||||
|
set VSVER_SHORT=15
|
||||||
|
set BuildDir=VS15
|
||||||
|
goto par2
|
||||||
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
:usage
|
:usage
|
||||||
|
|
||||||
Echo Usage build_deps 2013/2015 x64/x86
|
Echo Usage build_deps 2013/2015/2017 x64/x86
|
||||||
goto exit
|
goto exit
|
||||||
:par2
|
:par2
|
||||||
if NOT "%2" == "" (
|
if NOT "%2" == "" (
|
||||||
@@ -31,6 +39,10 @@ if NOT "%2" == "" (
|
|||||||
if "%1" == "2015" (
|
if "%1" == "2015" (
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015
|
set CMAKE_BUILDER=Visual Studio 14 2015
|
||||||
)
|
)
|
||||||
|
if "%1" == "2017" (
|
||||||
|
set CMAKE_BUILDER=Visual Studio 15 2017
|
||||||
|
)
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
)
|
)
|
||||||
if "%2" == "x64" (
|
if "%2" == "x64" (
|
||||||
@@ -43,6 +55,10 @@ if NOT "%2" == "" (
|
|||||||
if "%1" == "2015" (
|
if "%1" == "2015" (
|
||||||
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
||||||
)
|
)
|
||||||
|
if "%1" == "2017" (
|
||||||
|
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
||||||
|
)
|
||||||
|
|
||||||
goto start
|
goto start
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@@ -78,7 +78,13 @@ if 'cmake' in builder:
|
|||||||
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
|
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
|
||||||
|
|
||||||
elif builder.startswith('win'):
|
elif builder.startswith('win'):
|
||||||
if builder.endswith('_vc2015'):
|
if builder.endswith('_vc2017'):
|
||||||
|
if builder.startswith('win64'):
|
||||||
|
cmake_options.extend(['-G', 'Visual Studio 15 2017 Win64'])
|
||||||
|
elif builder.startswith('win32'):
|
||||||
|
bits = 32
|
||||||
|
cmake_options.extend(['-G', 'Visual Studio 15 2017'])
|
||||||
|
elif builder.endswith('_vc2015'):
|
||||||
if builder.startswith('win64'):
|
if builder.startswith('win64'):
|
||||||
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
||||||
elif builder.startswith('win32'):
|
elif builder.startswith('win32'):
|
||||||
|
@@ -93,4 +93,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
|
|||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
LLVM_LIBRARY
|
LLVM_LIBRARY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
macro(setup_platform_linker_flags)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
function(setup_liblinks
|
function(setup_liblinks
|
||||||
target
|
target
|
||||||
)
|
)
|
||||||
@@ -1036,13 +1041,19 @@ macro(remove_cc_flag
|
|||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(add_cc_flag
|
macro(add_c_flag
|
||||||
flag)
|
flag)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(add_cxx_flag
|
||||||
|
flag)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro(remove_strict_flags)
|
macro(remove_strict_flags)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
@@ -1065,7 +1076,8 @@ macro(remove_strict_flags)
|
|||||||
)
|
)
|
||||||
|
|
||||||
# negate flags implied by '-Wall'
|
# negate flags implied by '-Wall'
|
||||||
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
|
||||||
|
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
@@ -1077,7 +1089,8 @@ macro(remove_strict_flags)
|
|||||||
)
|
)
|
||||||
|
|
||||||
# negate flags implied by '-Wall'
|
# negate flags implied by '-Wall'
|
||||||
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
|
||||||
|
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -1107,28 +1120,39 @@ endmacro()
|
|||||||
# note, we can only append flags on a single file so we need to negate the options.
|
# note, we can only append flags on a single file so we need to negate the options.
|
||||||
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
||||||
# probably add more removals here.
|
# probably add more removals here.
|
||||||
macro(remove_strict_flags_file
|
macro(remove_strict_c_flags_file
|
||||||
filenames)
|
filenames)
|
||||||
|
|
||||||
foreach(_SOURCE ${ARGV})
|
foreach(_SOURCE ${ARGV})
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR
|
if(CMAKE_COMPILER_IS_GNUCC OR
|
||||||
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||||
|
|
||||||
set_source_files_properties(${_SOURCE}
|
set_source_files_properties(${_SOURCE}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
|
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# TODO
|
# TODO
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
unset(_SOURCE)
|
unset(_SOURCE)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(remove_strict_cxx_flags_file
|
||||||
|
filenames)
|
||||||
|
remove_strict_c_flags_file(${filenames} ${ARHV})
|
||||||
|
foreach(_SOURCE ${ARGV})
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC OR
|
||||||
|
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||||
|
set_source_files_properties(${_SOURCE}
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
# TODO
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
unset(_SOURCE)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# External libs may need 'signed char' to be default.
|
# External libs may need 'signed char' to be default.
|
||||||
|
@@ -356,7 +356,7 @@ if(WITH_LLVM)
|
|||||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
|
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||||
else()
|
else()
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||||
endif()
|
endif()
|
||||||
@@ -416,7 +416,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
|||||||
endif()
|
endif()
|
||||||
# Get rid of eventually clashes, we export some symbols explicite as local
|
# Get rid of eventually clashes, we export some symbols explicite as local
|
||||||
set(PLATFORM_LINKFLAGS
|
set(PLATFORM_LINKFLAGS
|
||||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
|
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
|
@@ -29,7 +29,16 @@ if(NOT MSVC)
|
|||||||
message(FATAL_ERROR "Compiler is unsupported")
|
message(FATAL_ERROR "Compiler is unsupported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Libraries configuration for Windows when compiling with MSVC.
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
set(MSVC_CLANG On)
|
||||||
|
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
|
||||||
|
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
|
||||||
|
if (DEFINED MSVC_REDIST_DIR)
|
||||||
|
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
|
||||||
|
else()
|
||||||
|
message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
|
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
|
||||||
|
|
||||||
@@ -119,8 +128,18 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
|||||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
remove_cc_flag("/MDd" "/MD")
|
||||||
|
|
||||||
|
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
|
||||||
|
if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings.
|
||||||
|
set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
|
||||||
|
else()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
|
||||||
@@ -131,7 +150,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
|
|||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
||||||
|
|
||||||
# Ignore meaningless for us linker warnings.
|
# Ignore meaningless for us linker warnings.
|
||||||
@@ -144,7 +163,7 @@ else()
|
|||||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||||
|
|
||||||
if(NOT DEFINED LIBDIR)
|
if(NOT DEFINED LIBDIR)
|
||||||
|
|
||||||
|
17
build_files/windows/autodetect_msvc.cmd
Normal file
17
build_files/windows/autodetect_msvc.cmd
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
echo No explicit msvc version requested, autodetecting version.
|
||||||
|
|
||||||
|
call "%~dp0\detect_msvc2013.cmd"
|
||||||
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
|
call "%~dp0\detect_msvc2015.cmd"
|
||||||
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
|
call "%~dp0\detect_msvc2017.cmd"
|
||||||
|
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||||
|
|
||||||
|
echo Compiler Detection failed. Use verbose switch for more information.
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:DetectionComplete
|
||||||
|
echo Compiler Detection successfull, detected VS%BUILD_VS_YEAR%
|
||||||
|
exit /b 0
|
26
build_files/windows/build_msbuild.cmd
Normal file
26
build_files/windows/build_msbuild.cmd
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
if "%NOBUILD%"=="1" goto EOF
|
||||||
|
echo %TIME% > %BUILD_DIR%\buildtime.txt
|
||||||
|
msbuild ^
|
||||||
|
%BUILD_DIR%\Blender.sln ^
|
||||||
|
/target:build ^
|
||||||
|
/property:Configuration=%BUILD_TYPE% ^
|
||||||
|
/maxcpucount:2 ^
|
||||||
|
/verbosity:minimal ^
|
||||||
|
/p:platform=%MSBUILD_PLATFORM% ^
|
||||||
|
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo Error during build, see %BUILD_DIR%\Build.log for details
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
msbuild ^
|
||||||
|
%BUILD_DIR%\INSTALL.vcxproj ^
|
||||||
|
/property:Configuration=%BUILD_TYPE% ^
|
||||||
|
/verbosity:minimal ^
|
||||||
|
/p:platform=%MSBUILD_PLATFORM%
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo Error during install phase
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
echo %TIME% >> %BUILD_DIR%\buildtime.txt
|
||||||
|
:EOF
|
16
build_files/windows/build_ninja.cmd
Normal file
16
build_files/windows/build_ninja.cmd
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if "%NOBUILD%"=="1" goto EOF
|
||||||
|
set HAS_ERROR=
|
||||||
|
cd %BUILD_DIR%
|
||||||
|
echo %TIME% > buildtime.txt
|
||||||
|
ninja install
|
||||||
|
if errorlevel 1 (
|
||||||
|
set HAS_ERROR=1
|
||||||
|
)
|
||||||
|
echo %TIME% >>buildtime.txt
|
||||||
|
cd %BLENDER_DIR%
|
||||||
|
|
||||||
|
if "%HAS_ERROR%" == "1" (
|
||||||
|
echo Error during build
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
:EOF
|
54
build_files/windows/check_libraries.cmd
Normal file
54
build_files/windows/check_libraries.cmd
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
if "%BUILD_VS_YEAR%"=="2013" set BUILD_VS_LIBDIRPOST=vc12
|
||||||
|
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
|
||||||
|
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
|
||||||
|
|
||||||
|
if "%BUILD_ARCH%"=="x64" (
|
||||||
|
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
||||||
|
) else if "%BUILD_ARCH%"=="x86" (
|
||||||
|
set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST%
|
||||||
|
)
|
||||||
|
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Library Directory = "%BUILD_VS_LIBDIR%"
|
||||||
|
)
|
||||||
|
if NOT EXIST %BUILD_VS_LIBDIR% (
|
||||||
|
rem libs not found, but svn is on the system
|
||||||
|
echo
|
||||||
|
if not "%SVN%"=="" (
|
||||||
|
echo.
|
||||||
|
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
|
||||||
|
echo.
|
||||||
|
set /p GetLibs= "Would you like to download them? (y/n)"
|
||||||
|
if /I "!GetLibs!"=="Y" (
|
||||||
|
echo.
|
||||||
|
echo Downloading %BUILD_VS_SVNDIR% libraries, please wait.
|
||||||
|
echo.
|
||||||
|
:RETRY
|
||||||
|
"%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR%
|
||||||
|
if errorlevel 1 (
|
||||||
|
set /p LibRetry= "Error during donwload, retry? y/n"
|
||||||
|
if /I "!LibRetry!"=="Y" (
|
||||||
|
cd %BUILD_VS_LIBDIR%
|
||||||
|
"%SVN%" cleanup
|
||||||
|
cd %BLENDER_DIR%
|
||||||
|
goto RETRY
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
echo Error: Download of external libraries failed.
|
||||||
|
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
|
||||||
|
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successfull blender build
|
||||||
|
echo.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %BUILD_VS_LIBDIR% (
|
||||||
|
echo.
|
||||||
|
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
|
||||||
|
echo This is needed for building, aborting!
|
||||||
|
echo.
|
||||||
|
exit /b 1
|
||||||
|
)
|
6
build_files/windows/check_spaces_in_path.cmd
Normal file
6
build_files/windows/check_spaces_in_path.cmd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
set BLENDER_DIR_NOSPACES=%BLENDER_DIR: =%
|
||||||
|
|
||||||
|
if not "%BLENDER_DIR%"=="%BLENDER_DIR_NOSPACES%" (
|
||||||
|
echo There are spaces detected in the build path "%BLENDER_DIR%", this is currently not supported, exiting....
|
||||||
|
exit /b 1
|
||||||
|
)
|
20
build_files/windows/check_submodules.cmd
Normal file
20
build_files/windows/check_submodules.cmd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
if NOT exist "%BLENDER_DIR%/source/tools" (
|
||||||
|
echo Checking out sub-modules
|
||||||
|
if not "%GIT%" == "" (
|
||||||
|
"%GIT%" submodule update --init --recursive --progress
|
||||||
|
if errorlevel 1 goto FAIL
|
||||||
|
"%GIT%" submodule foreach git checkout master
|
||||||
|
if errorlevel 1 goto FAIL
|
||||||
|
"%GIT%" submodule foreach git pull --rebase origin master
|
||||||
|
if errorlevel 1 goto FAIL
|
||||||
|
goto EOF
|
||||||
|
) else (
|
||||||
|
echo Blender submodules not found, and git not found in path to retrieve them.
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
)
|
||||||
|
goto EOF
|
||||||
|
|
||||||
|
:FAIL
|
||||||
|
exit /b 1
|
||||||
|
:EOF
|
74
build_files/windows/configure_msbuild.cmd
Normal file
74
build_files/windows/configure_msbuild.cmd
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
if "%BUILD_ARCH%"=="x64" (
|
||||||
|
set MSBUILD_PLATFORM=x64
|
||||||
|
) else if "%BUILD_ARCH%"=="x86" (
|
||||||
|
set MSBUILD_PLATFORM=win32
|
||||||
|
if "%WITH_CLANG%"=="1" (
|
||||||
|
echo Clang not supported for X86
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%WITH_CLANG%"=="1" (
|
||||||
|
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
|
||||||
|
if "%WITH_ASAN%"=="1" (
|
||||||
|
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if "%WITH_ASAN%"=="1" (
|
||||||
|
echo ASAN is only supported with clang.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
|
||||||
|
|
||||||
|
if NOT EXIST %BUILD_DIR%\nul (
|
||||||
|
mkdir %BUILD_DIR%
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%MUST_CLEAN%"=="1" (
|
||||||
|
echo Cleaning %BUILD_DIR%
|
||||||
|
msbuild ^
|
||||||
|
%BUILD_DIR%\Blender.sln ^
|
||||||
|
/target:clean ^
|
||||||
|
/property:Configuration=%BUILD_TYPE% ^
|
||||||
|
/verbosity:minimal ^
|
||||||
|
/p:platform=%MSBUILD_PLATFORM%
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
|
||||||
|
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
|
||||||
|
|
||||||
|
if "%MUST_CONFIGURE%"=="1" (
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR%
|
||||||
|
)
|
||||||
|
|
||||||
|
cmake ^
|
||||||
|
%BUILD_CMAKE_ARGS% ^
|
||||||
|
-H%BLENDER_DIR% ^
|
||||||
|
-B%BUILD_DIR%
|
||||||
|
|
||||||
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo "Configuration Failed"
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo msbuild ^
|
||||||
|
%BUILD_DIR%\Blender.sln ^
|
||||||
|
/target:build ^
|
||||||
|
/property:Configuration=%BUILD_TYPE% ^
|
||||||
|
/maxcpucount:2 ^
|
||||||
|
/verbosity:minimal ^
|
||||||
|
/p:platform=%MSBUILD_PLATFORM% ^
|
||||||
|
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo msbuild ^
|
||||||
|
%BUILD_DIR%\INSTALL.vcxproj ^
|
||||||
|
/property:Configuration=%BUILD_TYPE% ^
|
||||||
|
/verbosity:minimal ^
|
||||||
|
/p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
80
build_files/windows/configure_ninja.cmd
Normal file
80
build_files/windows/configure_ninja.cmd
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
ninja --version 1>NUL 2>&1
|
||||||
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo "Ninja not detected in the path"
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
|
||||||
|
|
||||||
|
if "%WITH_CLANG%" == "1" (
|
||||||
|
set LLVM_DIR=
|
||||||
|
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
|
||||||
|
if DEFINED LLVM_DIR (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo LLVM Detected at "%LLVM_DIR%"
|
||||||
|
)
|
||||||
|
goto DetectionComplete
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Check 32 bits
|
||||||
|
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
|
||||||
|
if DEFINED LLVM_DIR (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo LLVM Detected at "%LLVM_DIR%"
|
||||||
|
)
|
||||||
|
goto DetectionComplete
|
||||||
|
)
|
||||||
|
echo LLVM not found
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:DetectionComplete
|
||||||
|
set CC=%LLVM_DIR%\bin\clang-cl
|
||||||
|
set CXX=%LLVM_DIR%\bin\clang-cl
|
||||||
|
rem build and tested against 2017 15.7
|
||||||
|
set CFLAGS=-m64 -fmsc-version=1914
|
||||||
|
set CXXFLAGS=-m64 -fmsc-version=1914
|
||||||
|
if "%WITH_ASAN%"=="1" (
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%WITH_ASAN%"=="1" (
|
||||||
|
if "%WITH_CLANG%" == "" (
|
||||||
|
echo ASAN is only supported with clang.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %BUILD_DIR%\nul (
|
||||||
|
mkdir %BUILD_DIR%
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%MUST_CLEAN%"=="1" (
|
||||||
|
echo Cleaning %BUILD_DIR%
|
||||||
|
cd %BUILD_DIR%
|
||||||
|
%CMAKE% cmake --build . --config Clean
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
|
||||||
|
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
|
||||||
|
|
||||||
|
if "%MUST_CONFIGURE%"=="1" (
|
||||||
|
cmake ^
|
||||||
|
%BUILD_CMAKE_ARGS% ^
|
||||||
|
-H%BLENDER_DIR% ^
|
||||||
|
-B%BUILD_DIR%
|
||||||
|
|
||||||
|
if %ERRORLEVEL% NEQ 0 (
|
||||||
|
echo "Configuration Failed"
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo ninja install >> %BUILD_DIR%\rebuild.cmd
|
||||||
|
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
|
16
build_files/windows/detect_architecture.cmd
Normal file
16
build_files/windows/detect_architecture.cmd
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if "%BUILD_ARCH%"=="" (
|
||||||
|
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
|
||||||
|
set WINDOWS_ARCH= Win64
|
||||||
|
set BUILD_ARCH=x64
|
||||||
|
) else if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
|
||||||
|
set WINDOWS_ARCH= Win64
|
||||||
|
set BUILD_ARCH=x64
|
||||||
|
) else (
|
||||||
|
set WINDOWS_ARCH=
|
||||||
|
set BUILD_ARCH=x86
|
||||||
|
)
|
||||||
|
) else if "%BUILD_ARCH%"=="x64" (
|
||||||
|
set WINDOWS_ARCH= Win64
|
||||||
|
) else if "%BUILD_ARCH%"=="x86" (
|
||||||
|
set WINDOWS_ARCH=
|
||||||
|
)
|
3
build_files/windows/detect_msvc2013.cmd
Normal file
3
build_files/windows/detect_msvc2013.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
set BUILD_VS_VER=12
|
||||||
|
set BUILD_VS_YEAR=2013
|
||||||
|
call "%~dp0\detect_msvc_classic.cmd"
|
3
build_files/windows/detect_msvc2015.cmd
Normal file
3
build_files/windows/detect_msvc2015.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
set BUILD_VS_VER=14
|
||||||
|
set BUILD_VS_YEAR=2015
|
||||||
|
call "%~dp0\detect_msvc_classic.cmd"
|
76
build_files/windows/detect_msvc2017.cmd
Normal file
76
build_files/windows/detect_msvc2017.cmd
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Detecting msvc 2017
|
||||||
|
)
|
||||||
|
set BUILD_VS_VER=15
|
||||||
|
set BUILD_VS_YEAR=2017
|
||||||
|
set ProgramFilesX86=%ProgramFiles(x86)%
|
||||||
|
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
|
||||||
|
|
||||||
|
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
|
||||||
|
if not exist "%vs_where%" (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
|
||||||
|
)
|
||||||
|
|
||||||
|
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
|
||||||
|
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%VS_InstallDir%"=="" (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
|
||||||
|
if exist "%VCVARS%" (
|
||||||
|
call "%VCVARS%" %BUILD_ARCH%
|
||||||
|
) else (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo "%VCVARS%" not found
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
rem try msbuild
|
||||||
|
msbuild /version > NUL
|
||||||
|
if errorlevel 1 (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% msbuild found
|
||||||
|
)
|
||||||
|
|
||||||
|
REM try the c++ compiler
|
||||||
|
cl 2> NUL 1>&2
|
||||||
|
if errorlevel 1 (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio 2017 is detected successfully
|
||||||
|
)
|
||||||
|
goto EOF
|
||||||
|
|
||||||
|
:FAIL
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:EOF
|
69
build_files/windows/detect_msvc_classic.cmd
Normal file
69
build_files/windows/detect_msvc_classic.cmd
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Detecting msvc %BUILD_VS_YEAR%
|
||||||
|
)
|
||||||
|
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
|
||||||
|
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
|
||||||
|
if DEFINED MSVC_VC_DIR (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% on Win64 detected at "%MSVC_VC_DIR%"
|
||||||
|
)
|
||||||
|
goto msvc_detect_finally
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Check 32 bits
|
||||||
|
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
|
||||||
|
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
|
||||||
|
if DEFINED MSVC_VC_DIR (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% on Win32 detected at "%MSVC_VC_DIR%"
|
||||||
|
)
|
||||||
|
goto msvc_detect_finally
|
||||||
|
)
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% not found.
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
:msvc_detect_finally
|
||||||
|
set VCVARS=%MSVC_VC_DIR%\vcvarsall.bat
|
||||||
|
if not exist "%VCVARS%" (
|
||||||
|
echo "%VCVARS%" not found.
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
call "%vcvars%" %BUILD_ARCH%
|
||||||
|
|
||||||
|
rem try msbuild
|
||||||
|
msbuild /version > NUL
|
||||||
|
if errorlevel 1 (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% msbuild found
|
||||||
|
)
|
||||||
|
|
||||||
|
REM try the c++ compiler
|
||||||
|
cl 2> NUL 1>&2
|
||||||
|
if errorlevel 1 (
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
|
||||||
|
)
|
||||||
|
goto FAIL
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
|
||||||
|
)
|
||||||
|
goto DetectionComplete
|
||||||
|
|
||||||
|
:FAIL
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:DetectionComplete
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo Visual Studio %BUILD_VS_YEAR% Detected successfuly
|
||||||
|
)
|
||||||
|
exit /b 0
|
13
build_files/windows/find_dependencies.cmd
Normal file
13
build_files/windows/find_dependencies.cmd
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
REM find all dependencies and set the corresponding environement variables.
|
||||||
|
for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
|
||||||
|
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
||||||
|
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
||||||
|
if NOT "%verbose%" == "" (
|
||||||
|
echo svn : %SVN%
|
||||||
|
echo cmake : %CMAKE%
|
||||||
|
echo git : %GIT%
|
||||||
|
)
|
||||||
|
if "%CMAKE%" == "" (
|
||||||
|
echo Cmake not found in path, required for building, exiting...
|
||||||
|
exit /b 1
|
||||||
|
)
|
88
build_files/windows/parse_arguments.cmd
Normal file
88
build_files/windows/parse_arguments.cmd
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
set BUILD_DIR=%BLENDER_DIR%..\build_windows
|
||||||
|
set BUILD_TYPE=Release
|
||||||
|
:argv_loop
|
||||||
|
if NOT "%1" == "" (
|
||||||
|
|
||||||
|
REM Help Message
|
||||||
|
if "%1" == "help" (
|
||||||
|
set SHOW_HELP=1
|
||||||
|
goto EOF
|
||||||
|
)
|
||||||
|
REM Build Types
|
||||||
|
if "%1" == "debug" (
|
||||||
|
set BUILD_TYPE=Debug
|
||||||
|
REM Build Configurations
|
||||||
|
) else if "%1" == "noge" (
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
|
||||||
|
set BUILD_NGE=_noge
|
||||||
|
) else if "%1" == "builddir" (
|
||||||
|
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
|
||||||
|
shift /1
|
||||||
|
) else if "%1" == "with_tests" (
|
||||||
|
set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
|
||||||
|
) else if "%1" == "full" (
|
||||||
|
set TARGET=Full
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
|
||||||
|
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
|
||||||
|
) else if "%1" == "lite" (
|
||||||
|
set TARGET=Lite
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
|
||||||
|
) else if "%1" == "cycles" (
|
||||||
|
set TARGET=Cycles
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
|
||||||
|
) else if "%1" == "headless" (
|
||||||
|
set TARGET=Headless
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
|
||||||
|
) else if "%1" == "bpy" (
|
||||||
|
set TARGET=Bpy
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
|
||||||
|
) else if "%1" == "clang" (
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
|
||||||
|
set WITH_CLANG=1
|
||||||
|
) else if "%1" == "release" (
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
|
||||||
|
set TARGET=Release
|
||||||
|
) else if "%1" == "asan" (
|
||||||
|
set WITH_ASAN=1
|
||||||
|
) else if "%1" == "x86" (
|
||||||
|
set BUILD_ARCH=x86
|
||||||
|
) else if "%1" == "x64" (
|
||||||
|
set BUILD_ARCH=x64
|
||||||
|
) else if "%1" == "2017" (
|
||||||
|
set BUILD_VS_YEAR=2017
|
||||||
|
) else if "%1" == "2017pre" (
|
||||||
|
set BUILD_VS_YEAR=2017
|
||||||
|
set VSWHERE_ARGS=-prerelease
|
||||||
|
set BUILD_VS_YEAR=2017
|
||||||
|
) else if "%1" == "2017b" (
|
||||||
|
set BUILD_VS_YEAR=2017
|
||||||
|
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
||||||
|
) else if "%1" == "2015" (
|
||||||
|
set BUILD_VS_YEAR=2015
|
||||||
|
) else if "%1" == "2013" (
|
||||||
|
set BUILD_VS_YEAR=2013
|
||||||
|
) else if "%1" == "packagename" (
|
||||||
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
|
||||||
|
shift /1
|
||||||
|
) else if "%1" == "nobuild" (
|
||||||
|
set NOBUILD=1
|
||||||
|
) else if "%1" == "showhash" (
|
||||||
|
SET BUILD_SHOW_HASHES=1
|
||||||
|
REM Non-Build Commands
|
||||||
|
) else if "%1" == "update" (
|
||||||
|
SET BUILD_UPDATE=1
|
||||||
|
) else if "%1" == "ninja" (
|
||||||
|
SET BUILD_WITH_NINJA=1
|
||||||
|
) else if "%1" == "clean" (
|
||||||
|
set MUST_CLEAN=1
|
||||||
|
) else if "%1" == "verbose" (
|
||||||
|
set VERBOSE=1
|
||||||
|
) else (
|
||||||
|
echo Command "%1" unknown, aborting!
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
shift /1
|
||||||
|
goto argv_loop
|
||||||
|
)
|
||||||
|
:EOF
|
||||||
|
exit /b 0
|
27
build_files/windows/reset_variables.cmd
Normal file
27
build_files/windows/reset_variables.cmd
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
rem reset all variables so they do not get accidentally get carried over from previous builds
|
||||||
|
set BUILD_DIR_OVERRRIDE=
|
||||||
|
set BUILD_CMAKE_ARGS=
|
||||||
|
set BUILD_ARCH=
|
||||||
|
set BUILD_VS_VER=
|
||||||
|
set BUILD_VS_YEAR=
|
||||||
|
set BUILD_VS_LIBDIRPOST=
|
||||||
|
set BUILD_VS_LIBDIR=
|
||||||
|
set BUILD_VS_SVNDIR=
|
||||||
|
set BUILD_NGE=
|
||||||
|
set KEY_NAME=
|
||||||
|
set MSBUILD_PLATFORM=
|
||||||
|
set MUST_CLEAN=
|
||||||
|
set NOBUILD=
|
||||||
|
set TARGET=
|
||||||
|
set VERBOSE=
|
||||||
|
set WINDOWS_ARCH=
|
||||||
|
set TESTS_CMAKE_ARGS=
|
||||||
|
set VSWHERE_ARGS=
|
||||||
|
set BUILD_UPDATE=
|
||||||
|
set BUILD_SHOW_HASHES=
|
||||||
|
set SHOW_HELP=
|
||||||
|
set BUILD_WITH_NINJA=
|
||||||
|
set WITH_CLANG=
|
||||||
|
set WITH_ASAN=
|
||||||
|
set CLANG_CMAKE_ARGS=
|
||||||
|
set ASAN_CMAKE_ARGS=
|
4
build_files/windows/set_build_dir.cmd
Normal file
4
build_files/windows/set_build_dir.cmd
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
set BUILD_DIR=%BUILD_DIR%_%TARGET%%BUILD_NGE%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
|
||||||
|
if NOT "%BUILD_DIR_OVERRRIDE%"=="" (
|
||||||
|
set BUILD_DIR=%BUILD_DIR_OVERRRIDE%
|
||||||
|
)
|
12
build_files/windows/show_hashes.cmd
Normal file
12
build_files/windows/show_hashes.cmd
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
if "%GIT%" == "" (
|
||||||
|
echo Git not found, cannot show hashes.
|
||||||
|
goto EOF
|
||||||
|
)
|
||||||
|
cd "%BLENDER_DIR%"
|
||||||
|
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Branch_hash=%%i
|
||||||
|
cd "%BLENDER_DIR%/release/datafiles/locale"
|
||||||
|
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Locale_hash=%%i
|
||||||
|
cd "%BLENDER_DIR%/release/scripts/addons"
|
||||||
|
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Addons_Hash=%%i
|
||||||
|
cd "%BLENDER_DIR%"
|
||||||
|
:EOF
|
35
build_files/windows/show_help.cmd
Normal file
35
build_files/windows/show_help.cmd
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
echo.
|
||||||
|
echo Convenience targets
|
||||||
|
echo - release ^(identical to the official blender.org builds^)
|
||||||
|
echo - full ^(same as release minus the cuda kernels^)
|
||||||
|
echo - lite
|
||||||
|
echo - headless
|
||||||
|
echo - cycles
|
||||||
|
echo - bpy
|
||||||
|
echo.
|
||||||
|
echo Utilities ^(not associated with building^)
|
||||||
|
echo - clean ^(Target must be set^)
|
||||||
|
echo - update
|
||||||
|
echo - nobuild ^(only generate project files^)
|
||||||
|
echo - showhash ^(Show git hashes of source tree^)
|
||||||
|
echo.
|
||||||
|
echo Configuration options
|
||||||
|
echo - verbose ^(enable diagnostic output during configuration^)
|
||||||
|
echo - with_tests ^(enable building unit tests^)
|
||||||
|
echo - noge ^(disable building game enginge and player^)
|
||||||
|
echo - debug ^(Build an unoptimized debuggable build^)
|
||||||
|
echo - packagename [newname] ^(override default cpack package name^)
|
||||||
|
echo - buildir [newdir] ^(override default build folder^)
|
||||||
|
echo - x86 ^(override host auto-detect and build 32 bit code^)
|
||||||
|
echo - x64 ^(override host auto-detect and build 64 bit code^)
|
||||||
|
echo - 2013 ^(build with visual studio 2013^)
|
||||||
|
echo.
|
||||||
|
echo Experimental options
|
||||||
|
echo - 2015 ^(build with visual studio 2015^)
|
||||||
|
echo - 2017 ^(build with visual studio 2017^)
|
||||||
|
echo - 2017pre ^(build with visual studio 2017 pre-release^)
|
||||||
|
echo - 2017b ^(build with visual studio 2017 Build Tools^)
|
||||||
|
echo - clang ^(enable building with clang^)
|
||||||
|
echo - asan ^(enable asan when building with clang^)
|
||||||
|
echo - ninja ^(enable building with ninja instead of msbuild^)
|
||||||
|
echo.
|
16
build_files/windows/update_sources.cmd
Normal file
16
build_files/windows/update_sources.cmd
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if "%SVN%" == "" (
|
||||||
|
echo svn not found, cannot update libraries
|
||||||
|
goto UPDATE_GIT
|
||||||
|
)
|
||||||
|
"%SVN%" up "%BLENDER_DIR%/../lib/*"
|
||||||
|
|
||||||
|
:UPDATE_GIT
|
||||||
|
|
||||||
|
if "%GIT%" == "" (
|
||||||
|
echo Git not found, cannot update code
|
||||||
|
goto EOF
|
||||||
|
)
|
||||||
|
"%GIT%" pull --rebase
|
||||||
|
"%GIT%" submodule foreach git pull --rebase origin master
|
||||||
|
|
||||||
|
:EOF
|
@@ -34,6 +34,7 @@ log = logging.getLogger("BlendFileReader")
|
|||||||
# module global routines
|
# module global routines
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
|
|
||||||
def ReadString(handle, length):
|
def ReadString(handle, length):
|
||||||
'''
|
'''
|
||||||
ReadString reads a String of given length or a zero terminating String
|
ReadString reads a String of given length or a zero terminating String
|
||||||
@@ -338,7 +339,7 @@ class DNAName:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def ShortName(self):
|
def ShortName(self):
|
||||||
result = self.Name;
|
result = self.Name
|
||||||
result = result.replace("*", "")
|
result = result.replace("*", "")
|
||||||
result = result.replace("(", "")
|
result = result.replace("(", "")
|
||||||
result = result.replace(")", "")
|
result = result.replace(")", "")
|
||||||
@@ -398,7 +399,7 @@ class DNAStructure:
|
|||||||
splitted = path.partition(".")
|
splitted = path.partition(".")
|
||||||
name = splitted[0]
|
name = splitted[0]
|
||||||
rest = splitted[2]
|
rest = splitted[2]
|
||||||
offset = 0;
|
offset = 0
|
||||||
for field in self.Fields:
|
for field in self.Fields:
|
||||||
if field.Name.ShortName() == name:
|
if field.Name.ShortName() == name:
|
||||||
log.debug("found " + name + "@" + str(offset))
|
log.debug("found " + name + "@" + str(offset))
|
||||||
@@ -443,4 +444,3 @@ class DNAField:
|
|||||||
return ReadString(handle, self.Name.ArraySize())
|
return ReadString(handle, self.Name.ArraySize())
|
||||||
else:
|
else:
|
||||||
return self.Type.Structure.GetField(header, handle, path)
|
return self.Type.Structure.GetField(header, handle, path)
|
||||||
|
|
||||||
|
@@ -42,6 +42,7 @@ def man_format(data):
|
|||||||
data = data.replace("\t", " ")
|
data = data.replace("\t", " ")
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
import getopt
|
import getopt
|
||||||
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])
|
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])
|
||||||
|
@@ -220,6 +220,8 @@ def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
|
|||||||
# Attach this function to an object that has a material with texture
|
# Attach this function to an object that has a material with texture
|
||||||
# and call it once to initialize the object
|
# and call it once to initialize the object
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
def init(cont):
|
def init(cont):
|
||||||
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
|
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
|
||||||
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
|
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
|
||||||
|
@@ -15,6 +15,7 @@ font_info = {
|
|||||||
"handler": None,
|
"handler": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""init function - runs once"""
|
"""init function - runs once"""
|
||||||
import os
|
import os
|
||||||
|
@@ -17,4 +17,5 @@ from bpy.app.handlers import persistent
|
|||||||
def load_handler(dummy):
|
def load_handler(dummy):
|
||||||
print("Load Handler:", bpy.data.filepath)
|
print("Load Handler:", bpy.data.filepath)
|
||||||
|
|
||||||
|
|
||||||
bpy.app.handlers.load_post.append(load_handler)
|
bpy.app.handlers.load_post.append(load_handler)
|
||||||
|
@@ -11,4 +11,5 @@ import bpy
|
|||||||
def my_handler(scene):
|
def my_handler(scene):
|
||||||
print("Frame Change", scene.frame_current)
|
print("Frame Change", scene.frame_current)
|
||||||
|
|
||||||
|
|
||||||
bpy.app.handlers.frame_change_pre.append(my_handler)
|
bpy.app.handlers.frame_change_pre.append(my_handler)
|
||||||
|
@@ -81,6 +81,7 @@ for msg in translations_tuple:
|
|||||||
|
|
||||||
# Define remaining addon (operators, UI...) here.
|
# Define remaining addon (operators, UI...) here.
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
# Usual operator/UI/etc. registration...
|
# Usual operator/UI/etc. registration...
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ class MaterialSettings(bpy.types.PropertyGroup):
|
|||||||
my_float = bpy.props.FloatProperty()
|
my_float = bpy.props.FloatProperty()
|
||||||
my_string = bpy.props.StringProperty()
|
my_string = bpy.props.StringProperty()
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(MaterialSettings)
|
bpy.utils.register_class(MaterialSettings)
|
||||||
|
|
||||||
bpy.types.Material.my_settings = \
|
bpy.types.Material.my_settings = \
|
||||||
|
@@ -14,6 +14,7 @@ class SceneSettingItem(bpy.types.PropertyGroup):
|
|||||||
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
|
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
|
||||||
value = bpy.props.IntProperty(name="Test Prop", default=22)
|
value = bpy.props.IntProperty(name="Test Prop", default=22)
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(SceneSettingItem)
|
bpy.utils.register_class(SceneSettingItem)
|
||||||
|
|
||||||
bpy.types.Scene.my_settings = \
|
bpy.types.Scene.my_settings = \
|
||||||
|
@@ -14,6 +14,7 @@ import bpy
|
|||||||
def update_func(self, context):
|
def update_func(self, context):
|
||||||
print("my test function", self)
|
print("my test function", self)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
||||||
|
|
||||||
bpy.context.scene.testprop = 11.0
|
bpy.context.scene.testprop = 11.0
|
||||||
|
@@ -19,6 +19,7 @@ def get_float(self):
|
|||||||
def set_float(self, value):
|
def set_float(self, value):
|
||||||
self["testprop"] = value
|
self["testprop"] = value
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
|
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
|
||||||
|
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ def get_date(self):
|
|||||||
import datetime
|
import datetime
|
||||||
return str(datetime.datetime.now())
|
return str(datetime.datetime.now())
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
|
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
|
||||||
|
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ def get_array(self):
|
|||||||
def set_array(self, values):
|
def set_array(self, values):
|
||||||
self["somebool"] = values[0] and values[1]
|
self["somebool"] = values[0] and values[1]
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
|
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +64,7 @@ def get_enum(self):
|
|||||||
def set_enum(self, value):
|
def set_enum(self, value):
|
||||||
print("setting value", value)
|
print("setting value", value)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)
|
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -14,4 +14,5 @@ import bpy
|
|||||||
def menu_draw(self, context):
|
def menu_draw(self, context):
|
||||||
self.layout.operator("wm.save_homefile")
|
self.layout.operator("wm.save_homefile")
|
||||||
|
|
||||||
|
|
||||||
bpy.types.INFO_MT_file.append(menu_draw)
|
bpy.types.INFO_MT_file.append(menu_draw)
|
||||||
|
@@ -60,6 +60,7 @@ def menu_func(self, context):
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator(WM_OT_button_context_test.bl_idname)
|
layout.operator(WM_OT_button_context_test.bl_idname)
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
WM_OT_button_context_test,
|
WM_OT_button_context_test,
|
||||||
WM_MT_button_context,
|
WM_MT_button_context,
|
||||||
@@ -77,5 +78,6 @@ def unregister():
|
|||||||
bpy.utils.unregister_class(cls)
|
bpy.utils.unregister_class(cls)
|
||||||
bpy.types.WM_MT_button_context.remove(menu_func)
|
bpy.types.WM_MT_button_context.remove(menu_func)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
@@ -21,4 +21,5 @@ class CyclesNodeTree(bpy.types.NodeTree):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return context.scene.render.engine == 'CYCLES'
|
return context.scene.render.engine == 'CYCLES'
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(CyclesNodeTree)
|
bpy.utils.register_class(CyclesNodeTree)
|
||||||
|
@@ -42,6 +42,7 @@ class SimpleMouseOperator(bpy.types.Operator):
|
|||||||
self.y = event.mouse_y
|
self.y = event.mouse_y
|
||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(SimpleMouseOperator)
|
bpy.utils.register_class(SimpleMouseOperator)
|
||||||
|
|
||||||
# Test call to the newly defined operator.
|
# Test call to the newly defined operator.
|
||||||
|
@@ -42,6 +42,7 @@ def menu_func(self, context):
|
|||||||
self.layout.operator_context = 'INVOKE_DEFAULT'
|
self.layout.operator_context = 'INVOKE_DEFAULT'
|
||||||
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
|
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
|
||||||
|
|
||||||
|
|
||||||
# Register and add to the file selector
|
# Register and add to the file selector
|
||||||
bpy.utils.register_class(ExportSomeData)
|
bpy.utils.register_class(ExportSomeData)
|
||||||
bpy.types.INFO_MT_file_export.append(menu_func)
|
bpy.types.INFO_MT_file_export.append(menu_func)
|
||||||
|
@@ -41,6 +41,7 @@ class CustomDrawOperator(bpy.types.Operator):
|
|||||||
|
|
||||||
col.prop(self, "my_string")
|
col.prop(self, "my_string")
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(CustomDrawOperator)
|
bpy.utils.register_class(CustomDrawOperator)
|
||||||
|
|
||||||
# test call
|
# test call
|
||||||
|
@@ -22,6 +22,7 @@ class HelloWorldOperator(bpy.types.Operator):
|
|||||||
print("Hello World")
|
print("Hello World")
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(HelloWorldOperator)
|
bpy.utils.register_class(HelloWorldOperator)
|
||||||
|
|
||||||
# test call to the newly defined operator
|
# test call to the newly defined operator
|
||||||
|
@@ -31,6 +31,7 @@ class MyPropertyGroup(bpy.types.PropertyGroup):
|
|||||||
custom_1 = bpy.props.FloatProperty(name="My Float")
|
custom_1 = bpy.props.FloatProperty(name="My Float")
|
||||||
custom_2 = bpy.props.IntProperty(name="My Int")
|
custom_2 = bpy.props.IntProperty(name="My Int")
|
||||||
|
|
||||||
|
|
||||||
bpy.utils.register_class(MyPropertyGroup)
|
bpy.utils.register_class(MyPropertyGroup)
|
||||||
|
|
||||||
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)
|
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)
|
||||||
|
@@ -10,4 +10,5 @@ import bpy
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.layout.label("Hello World")
|
self.layout.label("Hello World")
|
||||||
|
|
||||||
|
|
||||||
bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')
|
bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')
|
||||||
|
@@ -12,6 +12,7 @@ from bpy.props import PointerProperty
|
|||||||
class MyPropGroup(bpy.types.PropertyGroup):
|
class MyPropGroup(bpy.types.PropertyGroup):
|
||||||
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
|
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
|
||||||
|
|
||||||
|
|
||||||
# register it so its available for all bones
|
# register it so its available for all bones
|
||||||
bpy.utils.register_class(MyPropGroup)
|
bpy.utils.register_class(MyPropGroup)
|
||||||
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
|
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
|
||||||
|
@@ -73,6 +73,8 @@ def rna_info_BuildRNAInfo_cache():
|
|||||||
if rna_info_BuildRNAInfo_cache.ret is None:
|
if rna_info_BuildRNAInfo_cache.ret is None:
|
||||||
rna_info_BuildRNAInfo_cache.ret = rna_info.BuildRNAInfo()
|
rna_info_BuildRNAInfo_cache.ret = rna_info.BuildRNAInfo()
|
||||||
return rna_info_BuildRNAInfo_cache.ret
|
return rna_info_BuildRNAInfo_cache.ret
|
||||||
|
|
||||||
|
|
||||||
rna_info_BuildRNAInfo_cache.ret = None
|
rna_info_BuildRNAInfo_cache.ret = None
|
||||||
# --- end rna_info cache
|
# --- end rna_info cache
|
||||||
|
|
||||||
@@ -513,6 +515,8 @@ def escape_rst(text):
|
|||||||
""" Escape plain text which may contain characters used by RST.
|
""" Escape plain text which may contain characters used by RST.
|
||||||
"""
|
"""
|
||||||
return text.translate(escape_rst.trans)
|
return text.translate(escape_rst.trans)
|
||||||
|
|
||||||
|
|
||||||
escape_rst.trans = str.maketrans({
|
escape_rst.trans = str.maketrans({
|
||||||
"`": "\\`",
|
"`": "\\`",
|
||||||
"|": "\\|",
|
"|": "\\|",
|
||||||
@@ -1015,6 +1019,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
# Changes in Blender will force errors here
|
# Changes in Blender will force errors here
|
||||||
context_type_map = {
|
context_type_map = {
|
||||||
"active_base": ("ObjectBase", False),
|
"active_base": ("ObjectBase", False),
|
||||||
|
@@ -107,14 +107,16 @@ def main():
|
|||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
# II) Generate doc source in temp dir.
|
# II) Generate doc source in temp dir.
|
||||||
doc_gen_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
doc_gen_cmd = (
|
||||||
|
args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||||
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
|
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
|
||||||
"--output", tmp_dir)
|
"--output", tmp_dir
|
||||||
|
)
|
||||||
subprocess.run(doc_gen_cmd)
|
subprocess.run(doc_gen_cmd)
|
||||||
|
|
||||||
# III) Get Blender version info.
|
# III) Get Blender version info.
|
||||||
getver_file = os.path.join(tmp_dir, "blendver.txt")
|
getver_file = os.path.join(tmp_dir, "blendver.txt")
|
||||||
getver_script = (""
|
getver_script = (
|
||||||
"import sys, bpy\n"
|
"import sys, bpy\n"
|
||||||
"with open(sys.argv[-1], 'w') as f:\n"
|
"with open(sys.argv[-1], 'w') as f:\n"
|
||||||
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
|
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
|
||||||
@@ -124,7 +126,8 @@ def main():
|
|||||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||||
" if is_release else '%s\\n' % branch)\n"
|
" if is_release else '%s\\n' % branch)\n"
|
||||||
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
||||||
" if is_release else '%d_%d_%d' % bpy.app.version)\n")
|
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
|
||||||
|
)
|
||||||
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||||
"--python-expr", getver_script, "--", getver_file)
|
"--python-expr", getver_script, "--", getver_file)
|
||||||
subprocess.run(get_ver_cmd)
|
subprocess.run(get_ver_cmd)
|
||||||
|
@@ -335,7 +335,7 @@ template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { _mm_p
|
|||||||
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER)
|
#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
||||||
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
||||||
// Direct of the struct members fixed bug #62.
|
// Direct of the struct members fixed bug #62.
|
||||||
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
||||||
|
12
extern/Eigen3/patches/blender.diff
vendored
Normal file
12
extern/Eigen3/patches/blender.diff
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff -Naur c:\blender-git\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h k:\BlenderGit\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h
|
||||||
|
--- c:\blender-git\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h 2018-05-25 13:29:14 -0600
|
||||||
|
+++ k:\BlenderGit\blender\extern\Eigen3/Eigen/src/Core/arch/SSE/PacketMath.h 2018-05-26 19:56:36 -0600
|
||||||
|
@@ -335,7 +335,7 @@
|
||||||
|
template<> EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
|
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
|
||||||
|
|
||||||
|
-#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER)
|
||||||
|
+#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
||||||
|
// The temporary variable fixes an internal compilation error in vs <= 2008 and a wrong-result bug in vs 2010
|
||||||
|
// Direct of the struct members fixed bug #62.
|
||||||
|
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { return a.m128_f32[0]; }
|
31
extern/bullet2/patches/blender.patch
vendored
31
extern/bullet2/patches/blender.patch
vendored
@@ -1,3 +1,34 @@
|
|||||||
|
diff --git a/extern/bullet2/src/LinearMath/btScalar.h b/extern/bullet2/src/LinearMath/btScalar.h
|
||||||
|
--- a/extern/bullet2/src/LinearMath/btScalar.h
|
||||||
|
+++ b/extern/bullet2/src/LinearMath/btScalar.h
|
||||||
|
@@ -16,6 +16,9 @@
|
||||||
|
|
||||||
|
#ifndef BT_SCALAR_H
|
||||||
|
#define BT_SCALAR_H
|
||||||
|
+#if defined(_MSC_VER) && defined(__clang__) /* clang supplies it's own overloads already */
|
||||||
|
+#define BT_NO_SIMD_OPERATOR_OVERLOADS
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifdef BT_MANAGED_CODE
|
||||||
|
//Aligned data types not supported in managed code
|
||||||
|
@@ -83,7 +86,7 @@
|
||||||
|
#ifdef BT_USE_SSE
|
||||||
|
|
||||||
|
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
||||||
|
- #define BT_ALLOW_SSE4
|
||||||
|
+ //#define BT_ALLOW_SSE4 //disable this cause blender targets sse2
|
||||||
|
#endif //(_MSC_FULL_VER >= 160040219)
|
||||||
|
|
||||||
|
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
||||||
|
@@ -102,7 +105,7 @@
|
||||||
|
#endif //__MINGW32__
|
||||||
|
|
||||||
|
#ifdef BT_DEBUG
|
||||||
|
- #ifdef _MSC_VER
|
||||||
|
+ #if defined(_MSC_VER) && !defined(__clang__)
|
||||||
|
#include <stdio.h>
|
||||||
|
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
||||||
|
#else//_MSC_VER
|
||||||
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
||||||
index be9eca6..ec40c96 100644
|
index be9eca6..ec40c96 100644
|
||||||
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
|
||||||
|
7
extern/bullet2/src/LinearMath/btScalar.h
vendored
7
extern/bullet2/src/LinearMath/btScalar.h
vendored
@@ -16,6 +16,9 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
#ifndef BT_SCALAR_H
|
#ifndef BT_SCALAR_H
|
||||||
#define BT_SCALAR_H
|
#define BT_SCALAR_H
|
||||||
|
#if defined(_MSC_VER) && defined(__clang__) /* clang supplies it's own overloads already */
|
||||||
|
#define BT_NO_SIMD_OPERATOR_OVERLOADS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BT_MANAGED_CODE
|
#ifdef BT_MANAGED_CODE
|
||||||
//Aligned data types not supported in managed code
|
//Aligned data types not supported in managed code
|
||||||
@@ -83,7 +86,7 @@ inline int btGetVersion()
|
|||||||
#ifdef BT_USE_SSE
|
#ifdef BT_USE_SSE
|
||||||
|
|
||||||
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
#if (_MSC_FULL_VER >= 170050727)//Visual Studio 2012 can compile SSE4/FMA3 (but SSE4/FMA3 is not enabled by default)
|
||||||
#define BT_ALLOW_SSE4
|
//#define BT_ALLOW_SSE4 //disable this cause blender targets sse2
|
||||||
#endif //(_MSC_FULL_VER >= 160040219)
|
#endif //(_MSC_FULL_VER >= 160040219)
|
||||||
|
|
||||||
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
//BT_USE_SSE_IN_API is disabled under Windows by default, because
|
||||||
@@ -102,7 +105,7 @@ inline int btGetVersion()
|
|||||||
#endif //__MINGW32__
|
#endif //__MINGW32__
|
||||||
|
|
||||||
#ifdef BT_DEBUG
|
#ifdef BT_DEBUG
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
|
||||||
#else//_MSC_VER
|
#else//_MSC_VER
|
||||||
|
1
extern/rangetree/CMakeLists.txt
vendored
1
extern/rangetree/CMakeLists.txt
vendored
@@ -28,4 +28,3 @@ set(SRC
|
|||||||
)
|
)
|
||||||
|
|
||||||
blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")
|
blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")
|
||||||
|
|
||||||
|
8
extern/xdnd/xdnd.c
vendored
8
extern/xdnd/xdnd.c
vendored
@@ -121,10 +121,10 @@ char *xdnd_debug_milliseconds (void)
|
|||||||
#define dnd_debug3(a,b,c) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c)
|
#define dnd_debug3(a,b,c) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c)
|
||||||
#define dnd_debug4(a,b,c,d) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c, d)
|
#define dnd_debug4(a,b,c,d) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c, d)
|
||||||
#else
|
#else
|
||||||
#define dnd_debug1(a)
|
#define dnd_debug1(a) do {} while (0)
|
||||||
#define dnd_debug2(a,b)
|
#define dnd_debug2(a,b) do {} while (0)
|
||||||
#define dnd_debug3(a,b,c)
|
#define dnd_debug3(a,b,c) do {} while (0)
|
||||||
#define dnd_debug4(a,b,c,d)
|
#define dnd_debug4(a,b,c,d) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define dnd_warning(a) fprintf (stderr, a)
|
#define dnd_warning(a) fprintf (stderr, a)
|
||||||
|
@@ -40,7 +40,11 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
||||||
/******************************************************************************/
|
#if defined (__clang__)
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* 64-bit operations. */
|
/* 64-bit operations. */
|
||||||
#if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8)
|
#if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8)
|
||||||
/* Unsigned */
|
/* Unsigned */
|
||||||
@@ -205,4 +209,9 @@ ATOMIC_INLINE int8_t atomic_fetch_and_or_int8(int8_t *p, int8_t b)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (__clang__)
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ATOMIC_OPS_MSVC_H__ */
|
#endif /* __ATOMIC_OPS_MSVC_H__ */
|
||||||
|
@@ -243,7 +243,7 @@ if(WITH_CODEC_FFMPEG)
|
|||||||
ffmpeg/AUD_FFMPEGWriter.h
|
ffmpeg/AUD_FFMPEGWriter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
remove_strict_flags_file(
|
remove_strict_cxx_flags_file(
|
||||||
ffmpeg/AUD_FFMPEGFactory.cpp
|
ffmpeg/AUD_FFMPEGFactory.cpp
|
||||||
ffmpeg/AUD_FFMPEGReader.cpp
|
ffmpeg/AUD_FFMPEGReader.cpp
|
||||||
ffmpeg/AUD_FFMPEGWriter.cpp
|
ffmpeg/AUD_FFMPEGWriter.cpp
|
||||||
|
@@ -146,6 +146,7 @@ void CLG_exit(void);
|
|||||||
void CLG_output_set(void *file_handle);
|
void CLG_output_set(void *file_handle);
|
||||||
void CLG_output_use_basename_set(int value);
|
void CLG_output_use_basename_set(int value);
|
||||||
void CLG_fatal_fn_set(void (*fatal_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));
|
||||||
|
|
||||||
void CLG_type_filter_include(const char *type_filter, int type_filter_len);
|
void CLG_type_filter_include(const char *type_filter, int type_filter_len);
|
||||||
void CLG_type_filter_exclude(const char *type_filter, int type_filter_len);
|
void CLG_type_filter_exclude(const char *type_filter, int type_filter_len);
|
||||||
|
@@ -81,6 +81,7 @@ typedef struct CLogContext {
|
|||||||
|
|
||||||
struct {
|
struct {
|
||||||
void (*fatal_fn)(void *file_handle);
|
void (*fatal_fn)(void *file_handle);
|
||||||
|
void (*backtrace_fn)(void *file_handle);
|
||||||
} callbacks;
|
} callbacks;
|
||||||
} CLogContext;
|
} CLogContext;
|
||||||
|
|
||||||
@@ -328,15 +329,23 @@ static CLG_LogType *clg_ctx_type_register(CLogContext *ctx, const char *identifi
|
|||||||
return ty;
|
return ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clg_ctx_fatal_action(CLogContext *ctx, FILE *file_handle)
|
static void clg_ctx_fatal_action(CLogContext *ctx)
|
||||||
{
|
{
|
||||||
if (ctx->callbacks.fatal_fn != NULL) {
|
if (ctx->callbacks.fatal_fn != NULL) {
|
||||||
ctx->callbacks.fatal_fn(file_handle);
|
ctx->callbacks.fatal_fn(ctx->output_file);
|
||||||
}
|
}
|
||||||
fflush(file_handle);
|
fflush(ctx->output_file);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clg_ctx_backtrace(CLogContext *ctx)
|
||||||
|
{
|
||||||
|
/* Note: we avoid writing fo 'FILE', for backtrace we make an exception,
|
||||||
|
* if necessary we could have a version of the callback that writes to file descriptor all at once. */
|
||||||
|
ctx->callbacks.backtrace_fn(ctx->output_file);
|
||||||
|
fflush(ctx->output_file);
|
||||||
|
}
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
@@ -408,8 +417,12 @@ void CLG_log_str(
|
|||||||
|
|
||||||
clg_str_free(&cstr);
|
clg_str_free(&cstr);
|
||||||
|
|
||||||
|
if (lg->ctx->callbacks.backtrace_fn) {
|
||||||
|
clg_ctx_backtrace(lg->ctx);
|
||||||
|
}
|
||||||
|
|
||||||
if (severity == CLG_SEVERITY_FATAL) {
|
if (severity == CLG_SEVERITY_FATAL) {
|
||||||
clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file);
|
clg_ctx_fatal_action(lg->ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,8 +452,12 @@ void CLG_logf(
|
|||||||
|
|
||||||
clg_str_free(&cstr);
|
clg_str_free(&cstr);
|
||||||
|
|
||||||
|
if (lg->ctx->callbacks.backtrace_fn) {
|
||||||
|
clg_ctx_backtrace(lg->ctx);
|
||||||
|
}
|
||||||
|
|
||||||
if (severity == CLG_SEVERITY_FATAL) {
|
if (severity == CLG_SEVERITY_FATAL) {
|
||||||
clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file);
|
clg_ctx_fatal_action(lg->ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,6 +487,11 @@ static void CLG_ctx_fatal_fn_set(CLogContext *ctx, void (*fatal_fn)(void *file_h
|
|||||||
ctx->callbacks.fatal_fn = fatal_fn;
|
ctx->callbacks.fatal_fn = fatal_fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CLG_ctx_backtrace_fn_set(CLogContext *ctx, void (*backtrace_fn)(void *file_handle))
|
||||||
|
{
|
||||||
|
ctx->callbacks.backtrace_fn = backtrace_fn;
|
||||||
|
}
|
||||||
|
|
||||||
static void clg_ctx_type_filter_append(CLG_IDFilter **flt_list, const char *type_match, int type_match_len)
|
static void clg_ctx_type_filter_append(CLG_IDFilter **flt_list, const char *type_match, int type_match_len)
|
||||||
{
|
{
|
||||||
if (type_match_len == 0) {
|
if (type_match_len == 0) {
|
||||||
@@ -567,6 +589,11 @@ void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle))
|
|||||||
CLG_ctx_fatal_fn_set(g_ctx, fatal_fn);
|
CLG_ctx_fatal_fn_set(g_ctx, fatal_fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle))
|
||||||
|
{
|
||||||
|
CLG_ctx_backtrace_fn_set(g_ctx, fatal_fn);
|
||||||
|
}
|
||||||
|
|
||||||
void CLG_type_filter_exclude(const char *type_match, int type_match_len)
|
void CLG_type_filter_exclude(const char *type_match, int type_match_len)
|
||||||
{
|
{
|
||||||
CLG_ctx_type_filter_exclude(g_ctx, type_match, type_match_len);
|
CLG_ctx_type_filter_exclude(g_ctx, type_match, type_match_len);
|
||||||
|
@@ -31,7 +31,7 @@ elseif(NOT WITH_CPU_SSE)
|
|||||||
set(CXX_HAS_SSE FALSE)
|
set(CXX_HAS_SSE FALSE)
|
||||||
set(CXX_HAS_AVX FALSE)
|
set(CXX_HAS_AVX FALSE)
|
||||||
set(CXX_HAS_AVX2 FALSE)
|
set(CXX_HAS_AVX2 FALSE)
|
||||||
elseif(WIN32 AND MSVC)
|
elseif(WIN32 AND MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(CXX_HAS_SSE TRUE)
|
set(CXX_HAS_SSE TRUE)
|
||||||
set(CXX_HAS_AVX TRUE)
|
set(CXX_HAS_AVX TRUE)
|
||||||
set(CXX_HAS_AVX2 TRUE)
|
set(CXX_HAS_AVX2 TRUE)
|
||||||
@@ -306,7 +306,7 @@ if(WITH_CYCLES_CUDA_BINARIES AND (NOT WITH_CYCLES_CUBIN_COMPILER))
|
|||||||
elseif(${CUDA_VERSION} EQUAL "9.1")
|
elseif(${CUDA_VERSION} EQUAL "9.1")
|
||||||
set(MAX_MSVC 1911)
|
set(MAX_MSVC 1911)
|
||||||
endif()
|
endif()
|
||||||
if(NOT MSVC_VERSION LESS ${MAX_MSVC})
|
if(NOT MSVC_VERSION LESS ${MAX_MSVC} OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
message(STATUS "nvcc not supported for this compiler version, using cycles_cubin_cc instead.")
|
message(STATUS "nvcc not supported for this compiler version, using cycles_cubin_cc instead.")
|
||||||
set(WITH_CYCLES_CUBIN_COMPILER ON)
|
set(WITH_CYCLES_CUBIN_COMPILER ON)
|
||||||
endif()
|
endif()
|
||||||
@@ -326,6 +326,14 @@ if(WITH_CYCLES_NETWORK)
|
|||||||
add_definitions(-DWITH_NETWORK)
|
add_definitions(-DWITH_NETWORK)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_OPENCOLORIO)
|
||||||
|
add_definitions(-DWITH_OCIO)
|
||||||
|
include_directories(
|
||||||
|
SYSTEM
|
||||||
|
${OPENCOLORIO_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK OR WITH_CYCLES_CUBIN_COMPILER)
|
if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK OR WITH_CYCLES_CUBIN_COMPILER)
|
||||||
add_subdirectory(app)
|
add_subdirectory(app)
|
||||||
endif()
|
endif()
|
||||||
@@ -347,4 +355,3 @@ endif()
|
|||||||
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
|
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
|
||||||
delayed_do_install(${CMAKE_BINARY_DIR}/bin)
|
delayed_do_install(${CMAKE_BINARY_DIR}/bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -80,6 +80,10 @@ macro(cycles_target_link_libraries target)
|
|||||||
if(WITH_CYCLES_OPENSUBDIV)
|
if(WITH_CYCLES_OPENSUBDIV)
|
||||||
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
|
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_OPENCOLORIO)
|
||||||
|
link_directories(${OPENCOLORIO_LIBPATH})
|
||||||
|
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
|
||||||
|
endif()
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${target}
|
${target}
|
||||||
${OPENIMAGEIO_LIBRARIES}
|
${OPENIMAGEIO_LIBRARIES}
|
||||||
|
@@ -112,4 +112,3 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -524,4 +524,3 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -697,4 +697,3 @@ void xml_read_file(Scene *scene, const char *filepath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -148,5 +148,3 @@ def unregister():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
register()
|
register()
|
||||||
|
|
||||||
|
|
||||||
|
@@ -63,4 +63,3 @@ endif()
|
|||||||
add_dependencies(bf_intern_cycles bf_rna)
|
add_dependencies(bf_intern_cycles bf_rna)
|
||||||
|
|
||||||
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})
|
||||||
|
|
||||||
|
@@ -83,14 +83,16 @@ def _parse_command_line():
|
|||||||
import _cycles
|
import _cycles
|
||||||
_cycles.set_resumable_chunk(
|
_cycles.set_resumable_chunk(
|
||||||
int(args.cycles_resumable_num_chunks),
|
int(args.cycles_resumable_num_chunks),
|
||||||
int(args.cycles_resumable_current_chunk))
|
int(args.cycles_resumable_current_chunk),
|
||||||
|
)
|
||||||
elif args.cycles_resumable_start_chunk is not None and \
|
elif args.cycles_resumable_start_chunk is not None and \
|
||||||
args.cycles_resumable_end_chunk:
|
args.cycles_resumable_end_chunk:
|
||||||
import _cycles
|
import _cycles
|
||||||
_cycles.set_resumable_chunk_range(
|
_cycles.set_resumable_chunk_range(
|
||||||
int(args.cycles_resumable_num_chunks),
|
int(args.cycles_resumable_num_chunks),
|
||||||
int(args.cycles_resumable_start_chunk),
|
int(args.cycles_resumable_start_chunk),
|
||||||
int(args.cycles_resumable_end_chunk))
|
int(args.cycles_resumable_end_chunk),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
@@ -206,6 +208,7 @@ def system_info():
|
|||||||
import _cycles
|
import _cycles
|
||||||
return _cycles.system_info()
|
return _cycles.system_info()
|
||||||
|
|
||||||
|
|
||||||
def register_passes(engine, scene, srl):
|
def register_passes(engine, scene, srl):
|
||||||
engine.register_pass(scene, srl, "Combined", 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "Combined", 4, "RGBA", 'COLOR')
|
||||||
|
|
||||||
|
@@ -112,7 +112,8 @@ def update_script_node(node, report):
|
|||||||
|
|
||||||
if ok:
|
if ok:
|
||||||
# now update node with new sockets
|
# now update node with new sockets
|
||||||
ok = _cycles.osl_update_node(node.id_data.as_pointer(), node.as_pointer(), oso_path)
|
data = bpy.data.as_pointer()
|
||||||
|
ok = _cycles.osl_update_node(data, node.id_data.as_pointer(), node.as_pointer(), oso_path)
|
||||||
|
|
||||||
if not ok:
|
if not ok:
|
||||||
report({'ERROR'}, "OSL query failed to open " + oso_path)
|
report({'ERROR'}, "OSL query failed to open " + oso_path)
|
||||||
|
@@ -128,6 +128,12 @@ enum_volume_interpolation = (
|
|||||||
('CUBIC', "Cubic", "Smoothed high quality interpolation, but slower")
|
('CUBIC', "Cubic", "Smoothed high quality interpolation, but slower")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
enum_world_mis = (
|
||||||
|
('NONE', "None", "Don't sample the background, faster but might cause noise for non-solid backgrounds"),
|
||||||
|
('AUTOMATIC', "Auto", "Automatically try to determine the best setting"),
|
||||||
|
('MANUAL', "Manual", "Manually set the resolution of the sampling map, higher values are slower and require more memory but reduce noise")
|
||||||
|
)
|
||||||
|
|
||||||
enum_device_type = (
|
enum_device_type = (
|
||||||
('CPU', "CPU", "CPU", 0),
|
('CPU', "CPU", "CPU", 0),
|
||||||
('CUDA', "CUDA", "CUDA", 1),
|
('CUDA', "CUDA", "CUDA", 1),
|
||||||
@@ -145,6 +151,7 @@ enum_texture_limit = (
|
|||||||
('8192', "8192", "Limit texture size to 8192 pixels", 7),
|
('8192', "8192", "Limit texture size to 8192 pixels", 7),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class CyclesRenderSettings(bpy.types.PropertyGroup):
|
class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(cls):
|
def register(cls):
|
||||||
@@ -938,15 +945,15 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
|
|||||||
description="Cycles world settings",
|
description="Cycles world settings",
|
||||||
type=cls,
|
type=cls,
|
||||||
)
|
)
|
||||||
cls.sample_as_light = BoolProperty(
|
cls.sampling_method = EnumProperty(
|
||||||
name="Multiple Importance Sample",
|
name="Sampling method",
|
||||||
description="Use multiple importance sampling for the environment, "
|
description="How to sample the background light",
|
||||||
"enabling for non-solid colors is recommended",
|
items=enum_world_mis,
|
||||||
default=True,
|
default='AUTOMATIC',
|
||||||
)
|
)
|
||||||
cls.sample_map_resolution = IntProperty(
|
cls.sample_map_resolution = IntProperty(
|
||||||
name="Map Resolution",
|
name="Map Resolution",
|
||||||
description="Importance map size is resolution x resolution; "
|
description="Importance map size is resolution x resolution/2; "
|
||||||
"higher values potentially produce less noise, at the cost of memory and speed",
|
"higher values potentially produce less noise, at the cost of memory and speed",
|
||||||
min=4, max=8192,
|
min=4, max=8192,
|
||||||
default=1024,
|
default=1024,
|
||||||
@@ -1133,7 +1140,6 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
|
|||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def unregister(cls):
|
def unregister(cls):
|
||||||
del bpy.types.Object.cycles
|
del bpy.types.Object.cycles
|
||||||
@@ -1198,12 +1204,14 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
|||||||
def unregister(cls):
|
def unregister(cls):
|
||||||
del bpy.types.Scene.cycles_curves
|
del bpy.types.Scene.cycles_curves
|
||||||
|
|
||||||
|
|
||||||
def update_render_passes(self, context):
|
def update_render_passes(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rd = scene.render
|
rd = scene.render
|
||||||
rl = rd.layers.active
|
rl = rd.layers.active
|
||||||
rl.update_render_passes()
|
rl.update_render_passes()
|
||||||
|
|
||||||
|
|
||||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(cls):
|
def register(cls):
|
||||||
@@ -1415,7 +1423,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
return device_entry
|
return device_entry
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def update_device_entries(self, device_list):
|
def update_device_entries(self, device_list):
|
||||||
for device in device_list:
|
for device in device_list:
|
||||||
if not device[1] in {'CUDA', 'OPENCL', 'CPU'}:
|
if not device[1] in {'CUDA', 'OPENCL', 'CPU'}:
|
||||||
@@ -1433,7 +1440,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
# Update name in case it changed
|
# Update name in case it changed
|
||||||
entry.name = device[0]
|
entry.name = device[0]
|
||||||
|
|
||||||
|
|
||||||
def get_devices(self):
|
def get_devices(self):
|
||||||
import _cycles
|
import _cycles
|
||||||
# Layout of the device tuples: (Name, Type, Persistent ID)
|
# Layout of the device tuples: (Name, Type, Persistent ID)
|
||||||
@@ -1459,7 +1465,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
opencl_devices.extend(cpu_devices)
|
opencl_devices.extend(cpu_devices)
|
||||||
return cuda_devices, opencl_devices
|
return cuda_devices, opencl_devices
|
||||||
|
|
||||||
|
|
||||||
def get_num_gpu_devices(self):
|
def get_num_gpu_devices(self):
|
||||||
import _cycles
|
import _cycles
|
||||||
device_list = _cycles.available_devices()
|
device_list = _cycles.available_devices()
|
||||||
@@ -1472,11 +1477,9 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
num += 1
|
num += 1
|
||||||
return num
|
return num
|
||||||
|
|
||||||
|
|
||||||
def has_active_device(self):
|
def has_active_device(self):
|
||||||
return self.get_num_gpu_devices() > 0
|
return self.get_num_gpu_devices() > 0
|
||||||
|
|
||||||
|
|
||||||
def draw_impl(self, layout, context):
|
def draw_impl(self, layout, context):
|
||||||
layout.label(text="Cycles Compute Device:")
|
layout.label(text="Cycles Compute Device:")
|
||||||
layout.row().prop(self, "compute_device_type", expand=True)
|
layout.row().prop(self, "compute_device_type", expand=True)
|
||||||
@@ -1494,7 +1497,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
for device in opencl_devices:
|
for device in opencl_devices:
|
||||||
box.prop(device, "use", text=device.name)
|
box.prop(device, "use", text=device.name)
|
||||||
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_impl(self.layout, context)
|
self.draw_impl(self.layout, context)
|
||||||
|
|
||||||
|
@@ -86,6 +86,7 @@ def use_sample_all_lights(context):
|
|||||||
|
|
||||||
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
|
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
|
||||||
|
|
||||||
|
|
||||||
def show_device_active(context):
|
def show_device_active(context):
|
||||||
cscene = context.scene.cycles
|
cscene = context.scene.cycles
|
||||||
if cscene.device != 'GPU':
|
if cscene.device != 'GPU':
|
||||||
@@ -1214,11 +1215,13 @@ class CYCLES_WORLD_PT_settings(CyclesButtonsPanel, Panel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
|
|
||||||
col.label(text="Surface:")
|
col.label(text="Surface:")
|
||||||
col.prop(cworld, "sample_as_light", text="Multiple Importance")
|
col.prop(cworld, "sampling_method", text="Sampling")
|
||||||
|
|
||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
sub.active = cworld.sample_as_light
|
sub.active = cworld.sampling_method != 'NONE'
|
||||||
sub.prop(cworld, "sample_map_resolution")
|
subsub = sub.row(align=True)
|
||||||
|
subsub.active = cworld.sampling_method == 'MANUAL'
|
||||||
|
subsub.prop(cworld, "sample_map_resolution")
|
||||||
if use_branched_path(context):
|
if use_branched_path(context):
|
||||||
subsub = sub.row(align=True)
|
subsub = sub.row(align=True)
|
||||||
subsub.active = use_sample_all_lights(context)
|
subsub.active = use_sample_all_lights(context)
|
||||||
@@ -1739,6 +1742,7 @@ class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.prop(cscene, "ao_bounces_render")
|
col.prop(cscene, "ao_bounces_render")
|
||||||
|
|
||||||
|
|
||||||
def draw_device(self, context):
|
def draw_device(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
@@ -75,19 +75,25 @@ def foreach_cycles_node(callback):
|
|||||||
traversed = set()
|
traversed = set()
|
||||||
for material in bpy.data.materials:
|
for material in bpy.data.materials:
|
||||||
if check_is_new_shading_material(material):
|
if check_is_new_shading_material(material):
|
||||||
foreach_notree_node(material.node_tree,
|
foreach_notree_node(
|
||||||
|
material.node_tree,
|
||||||
callback,
|
callback,
|
||||||
traversed)
|
traversed,
|
||||||
|
)
|
||||||
for world in bpy.data.worlds:
|
for world in bpy.data.worlds:
|
||||||
if check_is_new_shading_world(world):
|
if check_is_new_shading_world(world):
|
||||||
foreach_notree_node(world.node_tree,
|
foreach_notree_node(
|
||||||
|
world.node_tree,
|
||||||
callback,
|
callback,
|
||||||
traversed)
|
traversed,
|
||||||
|
)
|
||||||
for lamp in bpy.data.lamps:
|
for lamp in bpy.data.lamps:
|
||||||
if check_is_new_shading_world(lamp):
|
if check_is_new_shading_world(lamp):
|
||||||
foreach_notree_node(lamp.node_tree,
|
foreach_notree_node(
|
||||||
|
lamp.node_tree,
|
||||||
callback,
|
callback,
|
||||||
traversed)
|
traversed,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def displacement_node_insert(material, nodetree, traversed):
|
def displacement_node_insert(material, nodetree, traversed):
|
||||||
@@ -102,9 +108,11 @@ def displacement_node_insert(material, nodetree, traversed):
|
|||||||
# Gather links to replace
|
# Gather links to replace
|
||||||
displacement_links = []
|
displacement_links = []
|
||||||
for link in nodetree.links:
|
for link in nodetree.links:
|
||||||
if link.to_node.bl_idname == 'ShaderNodeOutputMaterial' and \
|
if (
|
||||||
link.from_node.bl_idname != 'ShaderNodeDisplacement' and \
|
link.to_node.bl_idname == 'ShaderNodeOutputMaterial' and
|
||||||
link.to_socket.identifier == 'Displacement':
|
link.from_node.bl_idname != 'ShaderNodeDisplacement' and
|
||||||
|
link.to_socket.identifier == 'Displacement'
|
||||||
|
):
|
||||||
displacement_links.append(link)
|
displacement_links.append(link)
|
||||||
|
|
||||||
# Replace links with displacement node
|
# Replace links with displacement node
|
||||||
@@ -117,20 +125,22 @@ def displacement_node_insert(material, nodetree, traversed):
|
|||||||
nodetree.links.remove(link)
|
nodetree.links.remove(link)
|
||||||
|
|
||||||
node = nodetree.nodes.new(type='ShaderNodeDisplacement')
|
node = nodetree.nodes.new(type='ShaderNodeDisplacement')
|
||||||
node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0]);
|
node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0])
|
||||||
node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1]);
|
node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1])
|
||||||
node.inputs['Scale'].default_value = 0.1
|
node.inputs['Scale'].default_value = 0.1
|
||||||
node.inputs['Midlevel'].default_value = 0.0
|
node.inputs['Midlevel'].default_value = 0.0
|
||||||
|
|
||||||
nodetree.links.new(from_socket, node.inputs['Height'])
|
nodetree.links.new(from_socket, node.inputs['Height'])
|
||||||
nodetree.links.new(node.outputs['Displacement'], to_socket)
|
nodetree.links.new(node.outputs['Displacement'], to_socket)
|
||||||
|
|
||||||
|
|
||||||
def displacement_nodes_insert():
|
def displacement_nodes_insert():
|
||||||
traversed = set()
|
traversed = set()
|
||||||
for material in bpy.data.materials:
|
for material in bpy.data.materials:
|
||||||
if check_is_new_shading_material(material):
|
if check_is_new_shading_material(material):
|
||||||
displacement_node_insert(material, material.node_tree, traversed)
|
displacement_node_insert(material, material.node_tree, traversed)
|
||||||
|
|
||||||
|
|
||||||
def displacement_principled_nodes(node):
|
def displacement_principled_nodes(node):
|
||||||
if node.bl_idname == 'ShaderNodeDisplacement':
|
if node.bl_idname == 'ShaderNodeDisplacement':
|
||||||
if node.space != 'WORLD':
|
if node.space != 'WORLD':
|
||||||
@@ -139,6 +149,7 @@ def displacement_principled_nodes(node):
|
|||||||
if node.subsurface_method != 'RANDOM_WALK':
|
if node.subsurface_method != 'RANDOM_WALK':
|
||||||
node.subsurface_method = 'BURLEY'
|
node.subsurface_method = 'BURLEY'
|
||||||
|
|
||||||
|
|
||||||
def square_roughness_node_insert(material, nodetree, traversed):
|
def square_roughness_node_insert(material, nodetree, traversed):
|
||||||
if nodetree in traversed:
|
if nodetree in traversed:
|
||||||
return
|
return
|
||||||
@@ -176,13 +187,14 @@ def square_roughness_node_insert(material, nodetree, traversed):
|
|||||||
|
|
||||||
node = nodetree.nodes.new(type='ShaderNodeMath')
|
node = nodetree.nodes.new(type='ShaderNodeMath')
|
||||||
node.operation = 'POWER'
|
node.operation = 'POWER'
|
||||||
node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0]);
|
node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0])
|
||||||
node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1]);
|
node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1])
|
||||||
|
|
||||||
nodetree.links.new(from_socket, node.inputs[0])
|
nodetree.links.new(from_socket, node.inputs[0])
|
||||||
node.inputs[1].default_value = 0.5
|
node.inputs[1].default_value = 0.5
|
||||||
nodetree.links.new(node.outputs['Value'], to_socket)
|
nodetree.links.new(node.outputs['Value'], to_socket)
|
||||||
|
|
||||||
|
|
||||||
def square_roughness_nodes_insert():
|
def square_roughness_nodes_insert():
|
||||||
traversed = set()
|
traversed = set()
|
||||||
for material in bpy.data.materials:
|
for material in bpy.data.materials:
|
||||||
@@ -271,6 +283,41 @@ def custom_bake_remap(scene):
|
|||||||
scene.render.bake.use_pass_indirect = False
|
scene.render.bake.use_pass_indirect = False
|
||||||
|
|
||||||
|
|
||||||
|
def ambient_occlusion_node_relink(material, nodetree, traversed):
|
||||||
|
if nodetree in traversed:
|
||||||
|
return
|
||||||
|
traversed.add(nodetree)
|
||||||
|
|
||||||
|
for node in nodetree.nodes:
|
||||||
|
if node.bl_idname == 'ShaderNodeAmbientOcclusion':
|
||||||
|
node.samples = 1
|
||||||
|
node.only_local = False
|
||||||
|
node.inputs['Distance'].default_value = 0.0
|
||||||
|
elif node.bl_idname == 'ShaderNodeGroup':
|
||||||
|
ambient_occlusion_node_relink(material, node.node_tree, traversed)
|
||||||
|
|
||||||
|
# Gather links to replace
|
||||||
|
ao_links = []
|
||||||
|
for link in nodetree.links:
|
||||||
|
if link.from_node.bl_idname == 'ShaderNodeAmbientOcclusion':
|
||||||
|
ao_links.append(link)
|
||||||
|
|
||||||
|
# Replace links
|
||||||
|
for link in ao_links:
|
||||||
|
from_node = link.from_node
|
||||||
|
to_socket = link.to_socket
|
||||||
|
|
||||||
|
nodetree.links.remove(link)
|
||||||
|
nodetree.links.new(from_node.outputs['Color'], to_socket)
|
||||||
|
|
||||||
|
|
||||||
|
def ambient_occlusion_nodes_relink():
|
||||||
|
traversed = set()
|
||||||
|
for material in bpy.data.materials:
|
||||||
|
if check_is_new_shading_material(material):
|
||||||
|
ambient_occlusion_node_relink(material, material.node_tree, traversed)
|
||||||
|
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def do_versions(self):
|
def do_versions(self):
|
||||||
if bpy.context.user_preferences.version <= (2, 78, 1):
|
if bpy.context.user_preferences.version <= (2, 78, 1):
|
||||||
@@ -301,9 +348,11 @@ def do_versions(self):
|
|||||||
for scene in bpy.data.scenes:
|
for scene in bpy.data.scenes:
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
sample_clamp = cscene.get("sample_clamp", False)
|
sample_clamp = cscene.get("sample_clamp", False)
|
||||||
if (sample_clamp and
|
if (
|
||||||
|
sample_clamp and
|
||||||
not cscene.is_property_set("sample_clamp_direct") and
|
not cscene.is_property_set("sample_clamp_direct") and
|
||||||
not cscene.is_property_set("sample_clamp_indirect")):
|
not cscene.is_property_set("sample_clamp_indirect")
|
||||||
|
):
|
||||||
|
|
||||||
cscene.sample_clamp_direct = sample_clamp
|
cscene.sample_clamp_direct = sample_clamp
|
||||||
cscene.sample_clamp_indirect = sample_clamp
|
cscene.sample_clamp_indirect = sample_clamp
|
||||||
@@ -319,10 +368,11 @@ def do_versions(self):
|
|||||||
if bpy.data.version <= (2, 72, 0):
|
if bpy.data.version <= (2, 72, 0):
|
||||||
for scene in bpy.data.scenes:
|
for scene in bpy.data.scenes:
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
if (cscene.get("no_caustics", False) and
|
if (
|
||||||
|
cscene.get("no_caustics", False) and
|
||||||
not cscene.is_property_set("caustics_reflective") and
|
not cscene.is_property_set("caustics_reflective") and
|
||||||
not cscene.is_property_set("caustics_refractive")):
|
not cscene.is_property_set("caustics_refractive")
|
||||||
|
):
|
||||||
cscene.caustics_reflective = False
|
cscene.caustics_reflective = False
|
||||||
cscene.caustics_refractive = False
|
cscene.caustics_refractive = False
|
||||||
|
|
||||||
@@ -377,10 +427,6 @@ def do_versions(self):
|
|||||||
for world in bpy.data.worlds:
|
for world in bpy.data.worlds:
|
||||||
cworld = world.cycles
|
cworld = world.cycles
|
||||||
|
|
||||||
# World MIS
|
|
||||||
if not cworld.is_property_set("sample_as_light"):
|
|
||||||
cworld.sample_as_light = False
|
|
||||||
|
|
||||||
# World MIS Samples
|
# World MIS Samples
|
||||||
if not cworld.is_property_set("samples"):
|
if not cworld.is_property_set("samples"):
|
||||||
cworld.samples = 4
|
cworld.samples = 4
|
||||||
@@ -431,3 +477,15 @@ def do_versions(self):
|
|||||||
if bpy.data.version <= (2, 79, 3):
|
if bpy.data.version <= (2, 79, 3):
|
||||||
# Switch to squared roughness convention
|
# Switch to squared roughness convention
|
||||||
square_roughness_nodes_insert()
|
square_roughness_nodes_insert()
|
||||||
|
|
||||||
|
if bpy.data.version <= (2, 79, 4):
|
||||||
|
for world in bpy.data.worlds:
|
||||||
|
cworld = world.cycles
|
||||||
|
# World MIS
|
||||||
|
if not cworld.is_property_set("sampling_method"):
|
||||||
|
if cworld.get("sample_as_light", True):
|
||||||
|
cworld.sampling_method = 'MANUAL'
|
||||||
|
else:
|
||||||
|
cworld.sampling_method = 'NONE'
|
||||||
|
|
||||||
|
ambient_occlusion_nodes_relink()
|
||||||
|
@@ -90,7 +90,7 @@ struct BlenderCamera {
|
|||||||
static void blender_camera_init(BlenderCamera *bcam,
|
static void blender_camera_init(BlenderCamera *bcam,
|
||||||
BL::RenderSettings& b_render)
|
BL::RenderSettings& b_render)
|
||||||
{
|
{
|
||||||
memset(bcam, 0, sizeof(BlenderCamera));
|
memset((void *)bcam, 0, sizeof(BlenderCamera));
|
||||||
|
|
||||||
bcam->type = CAMERA_PERSPECTIVE;
|
bcam->type = CAMERA_PERSPECTIVE;
|
||||||
bcam->zoom = 1.0f;
|
bcam->zoom = 1.0f;
|
||||||
@@ -457,6 +457,7 @@ static void blender_camera_sync(Camera *cam,
|
|||||||
cam->matrix = blender_camera_matrix(bcam->matrix,
|
cam->matrix = blender_camera_matrix(bcam->matrix,
|
||||||
bcam->type,
|
bcam->type,
|
||||||
bcam->panorama_type);
|
bcam->panorama_type);
|
||||||
|
cam->motion.clear();
|
||||||
cam->motion.resize(bcam->motion_steps, cam->matrix);
|
cam->motion.resize(bcam->motion_steps, cam->matrix);
|
||||||
cam->use_perspective_motion = false;
|
cam->use_perspective_motion = false;
|
||||||
cam->shuttertime = bcam->shuttertime;
|
cam->shuttertime = bcam->shuttertime;
|
||||||
@@ -894,4 +895,3 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings& b_render,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -326,14 +326,14 @@ static bool ObtainCacheParticleVcol(Mesh *mesh,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_resolution(BL::Object *b_ob, BL::Scene *scene, bool render)
|
static void set_resolution(BL::BlendData *b_data, BL::Object *b_ob, BL::Scene *scene, bool render)
|
||||||
{
|
{
|
||||||
BL::Object::modifiers_iterator b_mod;
|
BL::Object::modifiers_iterator b_mod;
|
||||||
for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
|
for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
|
||||||
if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) {
|
if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) {
|
||||||
BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr);
|
BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr);
|
||||||
BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
|
BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
|
||||||
b_psys.set_resolution(*scene, *b_ob, (render)? 2: 1);
|
b_psys.set_resolution(*b_data, *scene, *b_ob, (render)? 2: 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -784,17 +784,18 @@ static void ExportCurveTriangleVcol(ParticleCurveData *CData,
|
|||||||
|
|
||||||
for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1; curvekey++) {
|
for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1; curvekey++) {
|
||||||
for(int section = 0; section < resol; section++) {
|
for(int section = 0; section < resol; section++) {
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
/* Encode vertex color using the sRGB curve. */
|
||||||
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
cdata[vertexindex] = color_float_to_byte(color_srgb_to_scene_linear_v3(CData->curve_vcol[curve]));
|
cdata[vertexindex] = color_float_to_byte(color_srgb_to_linear_v3(CData->curve_vcol[curve]));
|
||||||
vertexindex++;
|
vertexindex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -920,7 +921,7 @@ void BlenderSync::sync_curves(Mesh *mesh,
|
|||||||
ParticleCurveData CData;
|
ParticleCurveData CData;
|
||||||
|
|
||||||
if(!preview)
|
if(!preview)
|
||||||
set_resolution(&b_ob, &b_scene, true);
|
set_resolution(&b_data, &b_ob, &b_scene, true);
|
||||||
|
|
||||||
ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview);
|
ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview);
|
||||||
|
|
||||||
@@ -1010,9 +1011,10 @@ void BlenderSync::sync_curves(Mesh *mesh,
|
|||||||
if(fdata) {
|
if(fdata) {
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
|
/* Encode vertex color using the sRGB curve. */
|
||||||
for(size_t curve = 0; curve < CData.curve_vcol.size(); curve++)
|
for(size_t curve = 0; curve < CData.curve_vcol.size(); curve++)
|
||||||
if(!(CData.curve_keynum[curve] <= 1 || CData.curve_length[curve] == 0.0f))
|
if(!(CData.curve_keynum[curve] <= 1 || CData.curve_length[curve] == 0.0f))
|
||||||
fdata[i++] = color_srgb_to_scene_linear_v3(CData.curve_vcol[curve]);
|
fdata[i++] = color_srgb_to_linear_v3(CData.curve_vcol[curve]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1065,7 +1067,7 @@ void BlenderSync::sync_curves(Mesh *mesh,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!preview)
|
if(!preview)
|
||||||
set_resolution(&b_ob, &b_scene, false);
|
set_resolution(&b_data, &b_ob, &b_scene, false);
|
||||||
|
|
||||||
mesh->compute_bounds();
|
mesh->compute_bounds();
|
||||||
}
|
}
|
||||||
|
@@ -401,7 +401,8 @@ static void attr_create_vertex_color(Scene *scene,
|
|||||||
int n = p->loop_total();
|
int n = p->loop_total();
|
||||||
for(int i = 0; i < n; i++) {
|
for(int i = 0; i < n; i++) {
|
||||||
float3 color = get_float3(l->data[p->loop_start() + i].color());
|
float3 color = get_float3(l->data[p->loop_start() + i].color());
|
||||||
*(cdata++) = color_float_to_byte(color_srgb_to_scene_linear_v3(color));
|
/* Encode vertex color using the sRGB curve. */
|
||||||
|
*(cdata++) = color_float_to_byte(color_srgb_to_linear_v3(color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -424,12 +425,13 @@ static void attr_create_vertex_color(Scene *scene,
|
|||||||
int tri_a[3], tri_b[3];
|
int tri_a[3], tri_b[3];
|
||||||
face_split_tri_indices(face_flags[i], tri_a, tri_b);
|
face_split_tri_indices(face_flags[i], tri_a, tri_b);
|
||||||
|
|
||||||
|
/* Encode vertex color using the sRGB curve. */
|
||||||
uchar4 colors[4];
|
uchar4 colors[4];
|
||||||
colors[0] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color1())));
|
colors[0] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color1())));
|
||||||
colors[1] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color2())));
|
colors[1] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color2())));
|
||||||
colors[2] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color3())));
|
colors[2] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color3())));
|
||||||
if(nverts[i] == 4) {
|
if(nverts[i] == 4) {
|
||||||
colors[3] = color_float_to_byte(color_srgb_to_scene_linear_v3(get_float3(c->color4())));
|
colors[3] = color_float_to_byte(color_srgb_to_linear_v3(get_float3(c->color4())));
|
||||||
}
|
}
|
||||||
|
|
||||||
cdata[0] = colors[tri_a[0]];
|
cdata[0] = colors[tri_a[0]];
|
||||||
@@ -1171,7 +1173,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
|
|||||||
* freed data from the blender side.
|
* freed data from the blender side.
|
||||||
*/
|
*/
|
||||||
if(preview && b_ob.type() != BL::Object::type_MESH)
|
if(preview && b_ob.type() != BL::Object::type_MESH)
|
||||||
b_ob.update_from_editmode();
|
b_ob.update_from_editmode(b_data);
|
||||||
|
|
||||||
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
|
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
|
||||||
|
|
||||||
|
@@ -227,7 +227,15 @@ void BlenderSync::sync_background_light(bool use_portal)
|
|||||||
if(b_world) {
|
if(b_world) {
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
|
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
|
||||||
bool sample_as_light = get_boolean(cworld, "sample_as_light");
|
|
||||||
|
enum SamplingMethod {
|
||||||
|
SAMPLING_NONE = 0,
|
||||||
|
SAMPLING_AUTOMATIC,
|
||||||
|
SAMPLING_MANUAL,
|
||||||
|
SAMPLING_NUM
|
||||||
|
};
|
||||||
|
int sampling_method = get_enum(cworld, "sampling_method", SAMPLING_NUM, SAMPLING_AUTOMATIC);
|
||||||
|
bool sample_as_light = (sampling_method != SAMPLING_NONE);
|
||||||
|
|
||||||
if(sample_as_light || use_portal) {
|
if(sample_as_light || use_portal) {
|
||||||
/* test if we need to sync */
|
/* test if we need to sync */
|
||||||
@@ -239,7 +247,12 @@ void BlenderSync::sync_background_light(bool use_portal)
|
|||||||
b_world.ptr.data != world_map)
|
b_world.ptr.data != world_map)
|
||||||
{
|
{
|
||||||
light->type = LIGHT_BACKGROUND;
|
light->type = LIGHT_BACKGROUND;
|
||||||
|
if(sampling_method == SAMPLING_MANUAL) {
|
||||||
light->map_resolution = get_int(cworld, "sample_map_resolution");
|
light->map_resolution = get_int(cworld, "sample_map_resolution");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
light->map_resolution = 0;
|
||||||
|
}
|
||||||
light->shader = scene->default_background;
|
light->shader = scene->default_background;
|
||||||
light->use_mis = sample_as_light;
|
light->use_mis = sample_as_light;
|
||||||
light->max_bounces = get_int(cworld, "max_bounces");
|
light->max_bounces = get_int(cworld, "max_bounces");
|
||||||
@@ -401,6 +414,7 @@ Object *BlenderSync::sync_object(BL::Object& b_parent,
|
|||||||
mesh->motion_steps = motion_steps;
|
mesh->motion_steps = motion_steps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object->motion.clear();
|
||||||
object->motion.resize(motion_steps, transform_empty());
|
object->motion.resize(motion_steps, transform_empty());
|
||||||
|
|
||||||
if(motion_steps) {
|
if(motion_steps) {
|
||||||
@@ -567,7 +581,7 @@ void BlenderSync::sync_objects(float motion_time)
|
|||||||
|
|
||||||
if(b_ob.is_duplicator() && !object_render_hide_duplis(b_ob)) {
|
if(b_ob.is_duplicator() && !object_render_hide_duplis(b_ob)) {
|
||||||
/* dupli objects */
|
/* dupli objects */
|
||||||
b_ob.dupli_list_create(b_scene, dupli_settings);
|
b_ob.dupli_list_create(b_data, b_scene, dupli_settings);
|
||||||
|
|
||||||
BL::Object::dupli_list_iterator b_dup;
|
BL::Object::dupli_list_iterator b_dup;
|
||||||
|
|
||||||
@@ -741,4 +755,3 @@ void BlenderSync::sync_motion(BL::RenderSettings& b_render,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -146,4 +146,3 @@ bool BlenderObjectCulling::test_distance(Scene *scene, float3 bb[8])
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -406,13 +406,17 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject * /*args*/
|
|||||||
|
|
||||||
static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject *pynodegroup, *pynode;
|
PyObject *pydata, *pynodegroup, *pynode;
|
||||||
const char *filepath = NULL;
|
const char *filepath = NULL;
|
||||||
|
|
||||||
if(!PyArg_ParseTuple(args, "OOs", &pynodegroup, &pynode, &filepath))
|
if(!PyArg_ParseTuple(args, "OOOs", &pydata, &pynodegroup, &pynode, &filepath))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* RNA */
|
/* RNA */
|
||||||
|
PointerRNA dataptr;
|
||||||
|
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||||
|
BL::BlendData b_data(dataptr);
|
||||||
|
|
||||||
PointerRNA nodeptr;
|
PointerRNA nodeptr;
|
||||||
RNA_pointer_create((ID*)PyLong_AsVoidPtr(pynodegroup), &RNA_ShaderNodeScript, (void*)PyLong_AsVoidPtr(pynode), &nodeptr);
|
RNA_pointer_create((ID*)PyLong_AsVoidPtr(pynodegroup), &RNA_ShaderNodeScript, (void*)PyLong_AsVoidPtr(pynode), &nodeptr);
|
||||||
BL::ShaderNodeScript b_node(nodeptr);
|
BL::ShaderNodeScript b_node(nodeptr);
|
||||||
@@ -510,7 +514,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||||||
b_sock = b_node.outputs[param->name.string()];
|
b_sock = b_node.outputs[param->name.string()];
|
||||||
/* remove if type no longer matches */
|
/* remove if type no longer matches */
|
||||||
if(b_sock && b_sock.bl_idname() != socket_type) {
|
if(b_sock && b_sock.bl_idname() != socket_type) {
|
||||||
b_node.outputs.remove(b_sock);
|
b_node.outputs.remove(b_data, b_sock);
|
||||||
b_sock = BL::NodeSocket(PointerRNA_NULL);
|
b_sock = BL::NodeSocket(PointerRNA_NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -518,7 +522,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||||||
b_sock = b_node.inputs[param->name.string()];
|
b_sock = b_node.inputs[param->name.string()];
|
||||||
/* remove if type no longer matches */
|
/* remove if type no longer matches */
|
||||||
if(b_sock && b_sock.bl_idname() != socket_type) {
|
if(b_sock && b_sock.bl_idname() != socket_type) {
|
||||||
b_node.inputs.remove(b_sock);
|
b_node.inputs.remove(b_data, b_sock);
|
||||||
b_sock = BL::NodeSocket(PointerRNA_NULL);
|
b_sock = BL::NodeSocket(PointerRNA_NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -526,9 +530,9 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||||||
if(!b_sock) {
|
if(!b_sock) {
|
||||||
/* create new socket */
|
/* create new socket */
|
||||||
if(param->isoutput)
|
if(param->isoutput)
|
||||||
b_sock = b_node.outputs.create(socket_type.c_str(), param->name.c_str(), param->name.c_str());
|
b_sock = b_node.outputs.create(b_data, socket_type.c_str(), param->name.c_str(), param->name.c_str());
|
||||||
else
|
else
|
||||||
b_sock = b_node.inputs.create(socket_type.c_str(), param->name.c_str(), param->name.c_str());
|
b_sock = b_node.inputs.create(b_data, socket_type.c_str(), param->name.c_str(), param->name.c_str());
|
||||||
|
|
||||||
/* set default value */
|
/* set default value */
|
||||||
if(data_type == BL::NodeSocket::type_VALUE) {
|
if(data_type == BL::NodeSocket::type_VALUE) {
|
||||||
@@ -562,7 +566,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
for(b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
|
for(b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
|
||||||
if(used_sockets.find(b_input->ptr.data) == used_sockets.end()) {
|
if(used_sockets.find(b_input->ptr.data) == used_sockets.end()) {
|
||||||
b_node.inputs.remove(*b_input);
|
b_node.inputs.remove(b_data, *b_input);
|
||||||
removed = true;
|
removed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -570,7 +574,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||||||
|
|
||||||
for(b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
|
for(b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
|
||||||
if(used_sockets.find(b_output->ptr.data) == used_sockets.end()) {
|
if(used_sockets.find(b_output->ptr.data) == used_sockets.end()) {
|
||||||
b_node.outputs.remove(*b_output);
|
b_node.outputs.remove(b_data, *b_output);
|
||||||
removed = true;
|
removed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -558,7 +558,12 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
node = new EmissionNode();
|
node = new EmissionNode();
|
||||||
}
|
}
|
||||||
else if(b_node.is_a(&RNA_ShaderNodeAmbientOcclusion)) {
|
else if(b_node.is_a(&RNA_ShaderNodeAmbientOcclusion)) {
|
||||||
node = new AmbientOcclusionNode();
|
BL::ShaderNodeAmbientOcclusion b_ao_node(b_node);
|
||||||
|
AmbientOcclusionNode *ao = new 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)) {
|
else if(b_node.is_a(&RNA_ShaderNodeVolumeScatter)) {
|
||||||
node = new ScatterVolumeNode();
|
node = new ScatterVolumeNode();
|
||||||
@@ -743,6 +748,8 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
BL::ShaderNodeTexVoronoi b_voronoi_node(b_node);
|
BL::ShaderNodeTexVoronoi b_voronoi_node(b_node);
|
||||||
VoronoiTextureNode *voronoi = new VoronoiTextureNode();
|
VoronoiTextureNode *voronoi = new VoronoiTextureNode();
|
||||||
voronoi->coloring = (NodeVoronoiColoring)b_voronoi_node.coloring();
|
voronoi->coloring = (NodeVoronoiColoring)b_voronoi_node.coloring();
|
||||||
|
voronoi->metric = (NodeVoronoiDistanceMetric)b_voronoi_node.distance();
|
||||||
|
voronoi->feature = (NodeVoronoiFeature)b_voronoi_node.feature();
|
||||||
BL::TexMapping b_texture_mapping(b_voronoi_node.texture_mapping());
|
BL::TexMapping b_texture_mapping(b_voronoi_node.texture_mapping());
|
||||||
get_tex_mapping(&voronoi->tex_mapping, b_texture_mapping);
|
get_tex_mapping(&voronoi->tex_mapping, b_texture_mapping);
|
||||||
node = voronoi;
|
node = voronoi;
|
||||||
@@ -818,6 +825,22 @@ static ShaderNode *add_node(Scene *scene,
|
|||||||
get_tex_mapping(&sky->tex_mapping, b_texture_mapping);
|
get_tex_mapping(&sky->tex_mapping, b_texture_mapping);
|
||||||
node = sky;
|
node = sky;
|
||||||
}
|
}
|
||||||
|
else if(b_node.is_a(&RNA_ShaderNodeTexIES)) {
|
||||||
|
BL::ShaderNodeTexIES b_ies_node(b_node);
|
||||||
|
IESLightNode *ies = new IESLightNode();
|
||||||
|
switch(b_ies_node.mode()) {
|
||||||
|
case BL::ShaderNodeTexIES::mode_EXTERNAL:
|
||||||
|
ies->filename = blender_absolute_path(b_data, b_ntree, b_ies_node.filepath());
|
||||||
|
break;
|
||||||
|
case BL::ShaderNodeTexIES::mode_INTERNAL:
|
||||||
|
ies->ies = get_text_datablock_content(b_ies_node.ies().ptr);
|
||||||
|
if(ies->ies.empty()) {
|
||||||
|
ies->ies = "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
node = ies;
|
||||||
|
}
|
||||||
else if(b_node.is_a(&RNA_ShaderNodeNormalMap)) {
|
else if(b_node.is_a(&RNA_ShaderNodeNormalMap)) {
|
||||||
BL::ShaderNodeNormalMap b_normal_map_node(b_node);
|
BL::ShaderNodeNormalMap b_normal_map_node(b_node);
|
||||||
NormalMapNode *nmap = new NormalMapNode();
|
NormalMapNode *nmap = new NormalMapNode();
|
||||||
@@ -1460,4 +1483,3 @@ void BlenderSync::sync_shaders()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -894,4 +894,3 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -214,4 +214,3 @@ private:
|
|||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __BLENDER_SYNC_H__ */
|
#endif /* __BLENDER_SYNC_H__ */
|
||||||
|
|
||||||
|
@@ -251,7 +251,7 @@ static inline Transform get_transform(const BL::Array<float, 16>& array)
|
|||||||
|
|
||||||
/* We assume both types to be just 16 floats, and transpose because blender
|
/* We assume both types to be just 16 floats, and transpose because blender
|
||||||
* use column major matrix order while we use row major. */
|
* use column major matrix order while we use row major. */
|
||||||
memcpy(&projection, &array, sizeof(float)*16);
|
memcpy((void *)&projection, &array, sizeof(float)*16);
|
||||||
projection = projection_transpose(projection);
|
projection = projection_transpose(projection);
|
||||||
|
|
||||||
/* Drop last row, matrix is assumed to be affine transform. */
|
/* Drop last row, matrix is assumed to be affine transform. */
|
||||||
@@ -293,7 +293,7 @@ static inline int4 get_int4(const BL::Array<int, 4>& array)
|
|||||||
return make_int4(array[0], array[1], array[2], array[3]);
|
return make_int4(array[0], array[1], array[2], array[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint get_layer(const BL::Array<int, 20>& array)
|
static inline uint get_layer(const BL::Array<bool, 20>& array)
|
||||||
{
|
{
|
||||||
uint layer = 0;
|
uint layer = 0;
|
||||||
|
|
||||||
@@ -304,8 +304,8 @@ static inline uint get_layer(const BL::Array<int, 20>& array)
|
|||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint get_layer(const BL::Array<int, 20>& array,
|
static inline uint get_layer(const BL::Array<bool, 20>& array,
|
||||||
const BL::Array<int, 8>& local_array,
|
const BL::Array<bool, 8>& local_array,
|
||||||
bool is_light = false,
|
bool is_light = false,
|
||||||
uint scene_layers = (1 << 20) - 1)
|
uint scene_layers = (1 << 20) - 1)
|
||||||
{
|
{
|
||||||
@@ -468,6 +468,21 @@ static inline string blender_absolute_path(BL::BlendData& b_data,
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline string get_text_datablock_content(const PointerRNA& ptr)
|
||||||
|
{
|
||||||
|
if(ptr.data == NULL) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
string content;
|
||||||
|
BL::Text::lines_iterator iter;
|
||||||
|
for(iter.begin(ptr); iter; ++iter) {
|
||||||
|
content += iter->body() + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
/* Texture Space */
|
/* Texture Space */
|
||||||
|
|
||||||
static inline void mesh_texture_space(BL::Mesh& b_mesh,
|
static inline void mesh_texture_space(BL::Mesh& b_mesh,
|
||||||
|
@@ -251,4 +251,3 @@ void BVHObjectBinning::split(BVHReference* prims,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -224,4 +224,3 @@ void LeafNode::print(int depth) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -182,7 +182,10 @@ public:
|
|||||||
|
|
||||||
BVHReference& operator=(const BVHReference &arg) {
|
BVHReference& operator=(const BVHReference &arg) {
|
||||||
if(&arg != this) {
|
if(&arg != this) {
|
||||||
memcpy(this, &arg, sizeof(BVHReference));
|
/* TODO(sergey): Check if it is still faster to memcpy() with
|
||||||
|
* modern compilers.
|
||||||
|
*/
|
||||||
|
memcpy((void *)this, &arg, sizeof(BVHReference));
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@@ -201,4 +201,3 @@ void bvh_reference_sort(int start,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
|
@@ -97,6 +97,12 @@ if(CYCLES_STANDALONE_REPOSITORY)
|
|||||||
find_package(LLVM REQUIRED)
|
find_package(LLVM REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
####
|
||||||
|
# OpenColorIO
|
||||||
|
if(WITH_OPENCOLORIO)
|
||||||
|
find_package(OpenColorIO REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
####
|
####
|
||||||
# Boost
|
# Boost
|
||||||
set(__boost_packages filesystem regex system thread date_time)
|
set(__boost_packages filesystem regex system thread date_time)
|
||||||
|
@@ -362,4 +362,3 @@ private:
|
|||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __DEVICE_H__ */
|
#endif /* __DEVICE_H__ */
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user