Compare commits
501 Commits
tmp-Timeli
...
cloth-impr
Author | SHA1 | Date | |
---|---|---|---|
ceddd2bcd9 | |||
f47ace53f2 | |||
7eb44c2f1b | |||
13818c47cf | |||
51f14cfa43 | |||
20191980f4 | |||
e81dc0b7bc | |||
![]() |
5078b9d2d0 | ||
566b319335 | |||
![]() |
bdda0964e0 | ||
41045478ab | |||
efe94793c0 | |||
b85be88655 | |||
e6af8758c8 | |||
1e1c858cf1 | |||
72d1fb9934 | |||
20f3cbfb78 | |||
43f0af734e | |||
96b4e43e8d | |||
80795ff897 | |||
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 | |||
d7f5520fdf | |||
bbf2f3ac2a | |||
320771dc74 | |||
607a2d80d3 | |||
bc738592df | |||
6b818dcf79 | |||
102b2a7418 | |||
5d07a070cb | |||
87825084d5 | |||
d6a6417e3b | |||
03412896f6 | |||
87625ccce9 | |||
666a9385c4 | |||
6249fb68e0 | |||
6edd60d959 | |||
fe9debc47b | |||
84213a3ce1 | |||
3f0b3a4fb0 | |||
5ad6bdb021 | |||
d6bee4bffd | |||
b034660643 | |||
dbb20c3913 | |||
5315339162 | |||
7fa9ab01d6 | |||
c6f05db912 | |||
a87cd01425 | |||
77df327fa8 | |||
0607cd2e15 | |||
9f0176d795 | |||
215df08c0f | |||
7b6d09e9bd | |||
5e28df26de | |||
e3b5229da2 | |||
bc3b482b9d | |||
6f9cddec21 | |||
1cc8f2d79b | |||
fdea8ecb5b | |||
06090d7a31 | |||
8d1b6b76a2 | |||
a32251b4ed | |||
4e42d01c65 | |||
ade28fe8a2 | |||
115aea5f2f | |||
5de2fc2679 | |||
e735eda393 | |||
6054fff2a6 | |||
7d99e1418b | |||
983d671df8 | |||
0018eae5ed | |||
add9835df6 | |||
309b12ac27 | |||
0f5dc7ad80 | |||
82d3cd586c | |||
73b9899c92 | |||
b2dc669ee7 | |||
8d454ff13a | |||
998900794d | |||
61f8a1cfd7 | |||
403b835992 | |||
8759ec4eae | |||
80ed76cb66 | |||
2d48769a8b | |||
c8d1bbf31c | |||
d4a46809d0 | |||
9596871292 | |||
22f67557d1 | |||
63f023111d | |||
66d19ebeb3 | |||
69e8ee7851 | |||
5aacca55fa | |||
a6c0ab8cb5 | |||
fb542eadd4 | |||
f30048504b | |||
e3df66f1b7 | |||
d1b25a08d7 | |||
3fb5d20cc0 | |||
63aaa7c84a | |||
929aa7c046 | |||
55b9eebede | |||
887dfc298d | |||
a2dbe9f340 | |||
81a8a015b8 | |||
4cbb4bc6be | |||
85af281f85 | |||
d12c650349 | |||
bb32d9240f | |||
eca3877ac4 | |||
e843c10ad5 | |||
dc526671c7 | |||
1d8a08fb9f | |||
54186c5aa9 | |||
f9dad94d9e | |||
8a0d8ddf27 | |||
cb4d349803 | |||
ce6227b6be | |||
04e157e44a | |||
5d2a092f40 | |||
73fd331025 | |||
56c21ff707 | |||
c03db4c501 | |||
fa5669164b | |||
5721918848 | |||
dc6fd8a257 | |||
fe5735c6cf | |||
97b232ec70 |
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"project_id" : "Blender",
|
||||
"conduit_uri" : "https://developer.blender.org/",
|
||||
"git.default-relative-commit" : "origin/blender2.8",
|
||||
"arc.land.update.default" : "rebase",
|
||||
"arc.land.onto.default" : "blender2.8"
|
||||
"git.default-relative-commit" : "origin/master",
|
||||
"arc.land.update.default" : "rebase"
|
||||
}
|
||||
|
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
|
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -1,20 +1,20 @@
|
||||
[submodule "release/scripts/addons"]
|
||||
path = release/scripts/addons
|
||||
url = ../blender-addons.git
|
||||
branch = blender2.8
|
||||
ignore = all
|
||||
branch = master
|
||||
[submodule "release/scripts/addons_contrib"]
|
||||
path = release/scripts/addons_contrib
|
||||
url = ../blender-addons-contrib.git
|
||||
branch = master
|
||||
ignore = all
|
||||
branch = master
|
||||
[submodule "release/datafiles/locale"]
|
||||
path = release/datafiles/locale
|
||||
url = ../blender-translations.git
|
||||
branch = master
|
||||
ignore = all
|
||||
branch = master
|
||||
[submodule "source/tools"]
|
||||
path = source/tools
|
||||
url = ../blender-dev-tools.git
|
||||
branch = master
|
||||
ignore = all
|
||||
branch = master
|
||||
|
306
CMakeLists.txt
306
CMakeLists.txt
@@ -66,21 +66,12 @@ endif()
|
||||
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||
|
||||
# global compile definitions since add_definitions() adds for all.
|
||||
|
||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
||||
$<$<CONFIG:Release>:NDEBUG>
|
||||
$<$<CONFIG:MinSizeRel>: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_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
|
||||
$<$<CONFIG:Release>:NDEBUG>
|
||||
$<$<CONFIG:MinSizeRel>:NDEBUG>
|
||||
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set policy
|
||||
@@ -165,6 +156,7 @@ option_defaults_init(
|
||||
_init_OPENCOLORIO
|
||||
_init_SDL
|
||||
_init_FFTW3
|
||||
_init_GAMEENGINE
|
||||
_init_OPENSUBDIV
|
||||
)
|
||||
|
||||
@@ -234,10 +226,15 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
|
||||
if(APPLE)
|
||||
set(WITH_GAMEENGINE_DECKLINK OFF)
|
||||
else()
|
||||
option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
|
||||
endif()
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||
|
||||
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
|
||||
|
||||
# Compositor
|
||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||
|
||||
@@ -319,6 +316,7 @@ option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
||||
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
||||
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
|
||||
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
||||
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
|
||||
|
||||
# Audio/Video format support
|
||||
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
||||
@@ -381,14 +379,10 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
|
||||
if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
|
||||
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
|
||||
mark_as_advanced(PYTHON_NUMPY_PATH)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
|
||||
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(WITH_PYTHON_INSTALL)
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
|
||||
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
|
||||
mark_as_advanced(PYTHON_NUMPY_PATH)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
|
||||
@@ -450,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)
|
||||
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)
|
||||
|
||||
option(WITH_BOOST "Enable features depending on boost" ON)
|
||||
@@ -469,16 +463,28 @@ endif()
|
||||
|
||||
# OpenGL
|
||||
|
||||
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
|
||||
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
||||
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
|
||||
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
|
||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||
|
||||
mark_as_advanced(
|
||||
WITH_GLEW_MX
|
||||
WITH_GLEW_ES
|
||||
WITH_GL_EGL
|
||||
WITH_GL_PROFILE_COMPAT
|
||||
WITH_GL_PROFILE_CORE
|
||||
WITH_GL_PROFILE_ES20
|
||||
)
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
set(WITH_GLU ON)
|
||||
else()
|
||||
set(WITH_GLU OFF)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
|
||||
mark_as_advanced(WITH_GL_ANGLE)
|
||||
@@ -504,10 +510,11 @@ if(APPLE)
|
||||
set(WITH_CXX11 ON)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
|
||||
set(_c11_init ON)
|
||||
set(_cxx11_init ON)
|
||||
else()
|
||||
set(_c11_init OFF)
|
||||
set(_cxx11_init OFF)
|
||||
endif()
|
||||
set(_cxx11_init ON)
|
||||
|
||||
option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
|
||||
mark_as_advanced(WITH_C11)
|
||||
@@ -520,6 +527,53 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
mark_as_advanced(WITH_LINKER_GOLD)
|
||||
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
|
||||
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
|
||||
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
|
||||
|
||||
if(WIN32)
|
||||
# Use hardcoded paths or find_package to find externals
|
||||
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
||||
@@ -571,25 +625,28 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for conflicting/unsupported configurations
|
||||
|
||||
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
|
||||
if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE)
|
||||
message(FATAL_ERROR
|
||||
"At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
|
||||
"must be enabled, nothing to do!"
|
||||
"At least one of WITH_BLENDER or WITH_PLAYER or "
|
||||
"WITH_CYCLES_STANDALONE must be enabled, nothing to do!"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_CXX11)
|
||||
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
|
||||
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
|
||||
endif()
|
||||
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
|
||||
endif()
|
||||
|
||||
if(NOT WITH_AUDASPACE)
|
||||
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()
|
||||
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()
|
||||
if(WITH_GAMEENGINE)
|
||||
message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -598,6 +655,10 @@ if(NOT WITH_SDL AND WITH_GHOST_SDL)
|
||||
endif()
|
||||
|
||||
# python module, needs some different options
|
||||
if(WITH_PYTHON_MODULE AND WITH_PLAYER)
|
||||
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
|
||||
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
|
||||
endif()
|
||||
@@ -625,10 +686,15 @@ if(NOT WITH_BOOST)
|
||||
endmacro()
|
||||
|
||||
set_and_warn(WITH_CYCLES OFF)
|
||||
set_and_warn(WITH_AUDASPACE OFF)
|
||||
set_and_warn(WITH_INTERNATIONAL OFF)
|
||||
set_and_warn(WITH_OPENVDB OFF)
|
||||
set_and_warn(WITH_OPENCOLORIO OFF)
|
||||
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
|
||||
|
||||
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
|
||||
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
|
||||
set_and_warn(WITH_PLAYER OFF) # depends on GAMEENGINE
|
||||
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
|
||||
WITH_OPENVDB OR WITH_OPENCOLORIO)
|
||||
# Keep enabled
|
||||
else()
|
||||
@@ -697,9 +763,30 @@ TEST_SHARED_PTR_SUPPORT()
|
||||
TEST_UNORDERED_MAP_SUPPORT()
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
if(NOT WITH_SYSTEM_AUDASPACE)
|
||||
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
|
||||
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
|
||||
if(WITH_SYSTEM_AUDASPACE)
|
||||
set(AUDASPACE_DEFINITIONS
|
||||
-DWITH_AUDASPACE
|
||||
-DWITH_SYSTEM_AUDASPACE
|
||||
"-DAUD_DEVICE_H=<AUD_Device.h>"
|
||||
"-DAUD_SPECIAL_H=<AUD_Special.h>"
|
||||
"-DAUD_SOUND_H=<AUD_Sound.h>"
|
||||
"-DAUD_HANDLE_H=<AUD_Handle.h>"
|
||||
"-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
|
||||
"-DAUD_TYPES_H=<AUD_Types.h>"
|
||||
"-DAUD_PYTHON_H=<python/PyAPI.h>"
|
||||
)
|
||||
else()
|
||||
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
|
||||
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
|
||||
set(AUDASPACE_DEFINITIONS
|
||||
-DWITH_AUDASPACE
|
||||
"-DAUD_DEVICE_H=<AUD_C-API.h>"
|
||||
"-DAUD_SPECIAL_H=<AUD_C-API.h>"
|
||||
"-DAUD_SOUND_H=<AUD_C-API.h>"
|
||||
"-DAUD_HANDLE_H=<AUD_C-API.h>"
|
||||
"-DAUD_SEQUENCE_H=<AUD_C-API.h>"
|
||||
"-DAUD_TYPES_H=<AUD_Space.h>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -768,7 +855,8 @@ set(C_WARNINGS)
|
||||
set(CXX_WARNINGS)
|
||||
|
||||
# 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()
|
||||
# known as LLIBS to scons
|
||||
@@ -780,6 +868,21 @@ set(PLATFORM_LINKLIBS "")
|
||||
set(PLATFORM_LINKFLAGS "")
|
||||
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
|
||||
@@ -952,11 +1055,19 @@ endif()
|
||||
find_package(OpenGL)
|
||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||
|
||||
if(WITH_GLU)
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GLU)
|
||||
endif()
|
||||
|
||||
if(WITH_SYSTEM_GLES)
|
||||
find_package_wrapper(OpenGLES)
|
||||
endif()
|
||||
|
||||
if(WITH_GL_PROFILE_ES20)
|
||||
if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
|
||||
elseif(WITH_GL_PROFILE_ES20)
|
||||
if(WITH_SYSTEM_GLES)
|
||||
if(NOT OPENGLES_LIBRARY)
|
||||
message(FATAL_ERROR
|
||||
@@ -1016,9 +1127,6 @@ if(WITH_GL_PROFILE_ES20)
|
||||
|
||||
endif()
|
||||
|
||||
else()
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_GL_EGL)
|
||||
@@ -1066,10 +1174,16 @@ if(WITH_GL_EGL)
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
|
||||
endif()
|
||||
|
||||
if(WITH_GL_PROFILE_CORE)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
|
||||
endif()
|
||||
|
||||
if(WITH_GL_PROFILE_ES20)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
|
||||
else()
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
|
||||
endif()
|
||||
|
||||
if(WITH_GL_EGL)
|
||||
@@ -1106,6 +1220,10 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure GLEW
|
||||
|
||||
if(WITH_GLEW_MX)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
|
||||
endif()
|
||||
|
||||
if(WITH_SYSTEM_GLEW)
|
||||
find_package(GLEW)
|
||||
|
||||
@@ -1115,7 +1233,11 @@ if(WITH_SYSTEM_GLEW)
|
||||
message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
|
||||
endif()
|
||||
|
||||
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||
if(WITH_GLEW_MX)
|
||||
set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
|
||||
else()
|
||||
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
if(WITH_GLEW_ES)
|
||||
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
|
||||
@@ -1123,11 +1245,12 @@ else()
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
|
||||
|
||||
# These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
|
||||
if(WITH_GL_PROFILE_ES20)
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
|
||||
else()
|
||||
if(NOT WITH_GL_PROFILE_ES20)
|
||||
# No ES functions are needed
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
|
||||
elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
|
||||
# ES is enabled, but the other functions are all disabled
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
|
||||
endif()
|
||||
|
||||
if(WITH_GL_PROFILE_ES20)
|
||||
@@ -1164,7 +1287,9 @@ else()
|
||||
|
||||
endif()
|
||||
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
|
||||
if(NOT WITH_GLU)
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure Bullet
|
||||
@@ -1358,16 +1483,22 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
endif()
|
||||
|
||||
# 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(CC_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_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||
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"))
|
||||
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()
|
||||
|
||||
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()
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
@@ -1396,23 +1527,23 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
|
||||
|
||||
# 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(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_PARAMETER -Wno-unused-parameter)
|
||||
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(CC_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(CC_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(CC_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(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_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
||||
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(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
|
||||
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(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
||||
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(CC_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(CC_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_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_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_UNUSED_MACROS -Wno-unused-macros)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
|
||||
@@ -1470,15 +1601,10 @@ if(WITH_PYTHON)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR APPLE)
|
||||
# pass, we have this in an archive to extract
|
||||
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
|
||||
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
|
||||
find_python_package(numpy)
|
||||
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
|
||||
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
|
||||
endif()
|
||||
elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
|
||||
find_python_package(numpy)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
@@ -1509,7 +1635,12 @@ else()
|
||||
endif()
|
||||
|
||||
# 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
|
||||
if(WITH_C11)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
@@ -1563,7 +1694,7 @@ if(WITH_GTESTS)
|
||||
include(GTestTesting)
|
||||
endif()
|
||||
|
||||
if(WITH_BLENDER)
|
||||
if(WITH_BLENDER OR WITH_PLAYER)
|
||||
add_subdirectory(intern)
|
||||
add_subdirectory(extern)
|
||||
|
||||
@@ -1588,6 +1719,13 @@ if(WITH_BLENDER)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender Player
|
||||
if(WITH_PLAYER)
|
||||
add_subdirectory(source/blenderplayer)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Testing
|
||||
add_subdirectory(tests)
|
||||
@@ -1602,6 +1740,9 @@ include(build_files/cmake/packaging.cmake)
|
||||
if(WITH_BLENDER)
|
||||
openmp_delayload(blender)
|
||||
endif()
|
||||
if(WITH_PLAYER)
|
||||
openmp_delayload(blenderplayer)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Print Final Configuration
|
||||
@@ -1635,6 +1776,8 @@ if(FIRST_RUN)
|
||||
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
|
||||
|
||||
info_cfg_text("Build Options:")
|
||||
info_cfg_option(WITH_GAMEENGINE)
|
||||
info_cfg_option(WITH_PLAYER)
|
||||
info_cfg_option(WITH_BULLET)
|
||||
info_cfg_option(WITH_IK_SOLVER)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
@@ -1703,7 +1846,10 @@ if(FIRST_RUN)
|
||||
|
||||
info_cfg_text("OpenGL:")
|
||||
info_cfg_option(WITH_GLEW_ES)
|
||||
info_cfg_option(WITH_GLU)
|
||||
info_cfg_option(WITH_GL_EGL)
|
||||
info_cfg_option(WITH_GL_PROFILE_COMPAT)
|
||||
info_cfg_option(WITH_GL_PROFILE_CORE)
|
||||
info_cfg_option(WITH_GL_PROFILE_ES20)
|
||||
if(WIN32)
|
||||
info_cfg_option(WITH_GL_ANGLE)
|
||||
|
13
GNUmakefile
13
GNUmakefile
@@ -236,10 +236,11 @@ help: .FORCE
|
||||
@echo " * check_descriptions - check for duplicate/invalid descriptions"
|
||||
@echo ""
|
||||
@echo "Utilities (not associated with building blender)"
|
||||
@echo " * icons - updates PNG icons from SVG files."
|
||||
@echo " * icons_geom - updates Geometry icons from BLEND file."
|
||||
@echo " * tgz - create a compressed archive of the source code."
|
||||
@echo " * update - updates git and all submodules"
|
||||
@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 " * update - updates git and all submodules"
|
||||
@echo ""
|
||||
@echo "Environment Variables"
|
||||
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
|
||||
@@ -424,10 +425,6 @@ icons: .FORCE
|
||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||
|
||||
icons_geom: .FORCE
|
||||
BLENDER_BIN="$(BUILD_DIR)/bin/blender" \
|
||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
|
||||
|
||||
update: .FORCE
|
||||
if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
|
||||
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
|
||||
|
@@ -58,4 +58,3 @@ if(MSVC)
|
||||
DEPENDEES mkdir update patch download configure build install
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@@ -39,5 +39,6 @@ if(BUILD_MODE STREQUAL Release)
|
||||
PREFIX ${BUILD_DIR}/openal
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openal
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
|
||||
)
|
||||
endif()
|
||||
|
@@ -56,24 +56,27 @@ if(WIN32)
|
||||
# For OIIO and OSL
|
||||
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
|
||||
|
||||
# TODO FIXME highly MSVC specific
|
||||
if(WITH_OPTIMIZED_DEBUG)
|
||||
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")
|
||||
if(MSVC_VERSION GREATER 1909)
|
||||
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
|
||||
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)
|
||||
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()
|
||||
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()
|
||||
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_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /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_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /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_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_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"
|
||||
)
|
||||
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"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@@ -37,4 +37,3 @@ endif()
|
||||
if(MSVC)
|
||||
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
|
||||
endif()
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
ARGS=$( \
|
||||
getopt \
|
||||
-o s:i:t:h \
|
||||
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
|
||||
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
|
||||
with-all,with-opencollada,with-jack,\
|
||||
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
|
||||
force-all,force-python,force-numpy,force-boost,\
|
||||
@@ -104,6 +104,11 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--no-confirm
|
||||
Disable any interaction with user (suitable for automated run).
|
||||
|
||||
--use-cxx11
|
||||
Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
|
||||
NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
|
||||
standard starting from this version).
|
||||
|
||||
--with-all
|
||||
By default, a number of optional and not-so-often needed libraries are not installed.
|
||||
This option will try to install them, at the cost of potential conflicts (depending on
|
||||
@@ -285,7 +290,7 @@ SUDO="sudo"
|
||||
|
||||
NO_BUILD=false
|
||||
NO_CONFIRM=false
|
||||
USE_CXX11=true # Mandatory in blender2.8
|
||||
USE_CXX11=false
|
||||
|
||||
PYTHON_VERSION="3.6.2"
|
||||
PYTHON_VERSION_MIN="3.6"
|
||||
@@ -496,6 +501,9 @@ while true; do
|
||||
--no-confirm)
|
||||
NO_CONFIRM=true; shift; continue
|
||||
;;
|
||||
--use-cxx11)
|
||||
USE_CXX11=true; shift; continue
|
||||
;;
|
||||
--with-all)
|
||||
WITH_ALL=true; shift; continue
|
||||
;;
|
||||
@@ -796,7 +804,7 @@ FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
||||
|
||||
CXXFLAGS_BACK=$CXXFLAGS
|
||||
if [ "$USE_CXX11" = true ]; then
|
||||
WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
|
||||
WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
|
||||
However, if you are experiencing linking errors (also when building Blender itself), please try the following:
|
||||
* Re-run this script with '--build-all --force-all' options.
|
||||
* Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
|
||||
@@ -2677,10 +2685,10 @@ install_DEB() {
|
||||
install_packages_DEB $_packages
|
||||
|
||||
PRINT""
|
||||
LIBSNDFILE_DEV="libsndfile1-dev"
|
||||
check_package_DEB $LIBSNDFILE_DEV
|
||||
SNDFILE_DEV="libsndfile1-dev"
|
||||
check_package_DEB $SNDFILE_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_DEB $LIBSNDFILE_DEV
|
||||
install_packages_DEB $SNDFILE_DEV
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
@@ -3275,10 +3283,10 @@ install_RPM() {
|
||||
fi
|
||||
|
||||
PRINT""
|
||||
LIBSNDFILE_DEV="libsndfile-devel"
|
||||
check_package_RPM $LIBSNDFILE_DEV
|
||||
SNDFILE_DEV="libsndfile-devel"
|
||||
check_package_RPM $SNDFILE_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_RPM $LIBSNDFILE_DEV
|
||||
install_packages_RPM $SNDFILE_DEV
|
||||
fi
|
||||
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
@@ -3682,10 +3690,10 @@ install_ARCH() {
|
||||
install_packages_ARCH $_packages
|
||||
|
||||
PRINT""
|
||||
LIBSNDFILE_DEV="libsndfile"
|
||||
check_package_ARCH $LIBSNDFILE_DEV
|
||||
SNDFILE_DEV="libsndfile"
|
||||
check_package_ARCH $SNDFILE_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_ARCH $LIBSNDFILE_DEV
|
||||
install_packages_ARCH $SNDFILE_DEV
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
|
@@ -13,3 +13,25 @@
|
||||
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
||||
-# 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
|
||||
)
|
||||
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}
|
||||
DEPENDS ${${compiler_headers}}
|
||||
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
|
||||
goto par2
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
echo "Building for VS2017"
|
||||
set VSVER=15.0
|
||||
set VSVER_SHORT=15
|
||||
set BuildDir=VS15
|
||||
goto par2
|
||||
)
|
||||
|
||||
)
|
||||
:usage
|
||||
|
||||
Echo Usage build_deps 2013/2015 x64/x86
|
||||
Echo Usage build_deps 2013/2015/2017 x64/x86
|
||||
goto exit
|
||||
:par2
|
||||
if NOT "%2" == "" (
|
||||
@@ -31,6 +39,10 @@ if NOT "%2" == "" (
|
||||
if "%1" == "2015" (
|
||||
set CMAKE_BUILDER=Visual Studio 14 2015
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
set CMAKE_BUILDER=Visual Studio 15 2017
|
||||
)
|
||||
|
||||
goto start
|
||||
)
|
||||
if "%2" == "x64" (
|
||||
@@ -43,6 +55,10 @@ if NOT "%2" == "" (
|
||||
if "%1" == "2015" (
|
||||
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
|
||||
)
|
||||
if "%1" == "2017" (
|
||||
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
|
||||
)
|
||||
|
||||
goto start
|
||||
)
|
||||
)
|
||||
|
@@ -21,8 +21,9 @@ else()
|
||||
message(FATAL_ERROR "Unknown build environment")
|
||||
endif()
|
||||
|
||||
# Default to only build Blender
|
||||
# Default to only build Blender, not the player
|
||||
set(WITH_BLENDER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# ######## Linux-specific build options ########
|
||||
# Options which are specific to Linux-only platforms
|
||||
@@ -73,7 +74,7 @@ set(SNDFILE_LIBRARY "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILI
|
||||
|
||||
# OpenAL libraries
|
||||
set(OPENAL_ROOT_DIR "/opt/lib/openal" CACHE STRING "" FORCE)
|
||||
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
|
||||
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include" CACHE STRING "" FORCE)
|
||||
set(OPENAL_LIBRARY
|
||||
${OPENAL_ROOT_DIR}/lib/libopenal.a
|
||||
${OPENAL_ROOT_DIR}/lib/libcommon.a
|
||||
|
12
build_files/buildbot/config/blender_linux_player.cmake
Normal file
12
build_files/buildbot/config/blender_linux_player.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
# This is applied as an override on top of blender_linux.config
|
||||
# Disables all the areas which are not needed for the player.
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
|
@@ -60,6 +60,7 @@ if 'cmake' in builder:
|
||||
|
||||
# Config file to be used (relative to blender's sources root)
|
||||
cmake_config_file = "build_files/cmake/config/blender_full.cmake"
|
||||
cmake_player_config_file = None
|
||||
cmake_cuda_config_file = None
|
||||
|
||||
# Set build options.
|
||||
@@ -77,7 +78,13 @@ if 'cmake' in builder:
|
||||
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
|
||||
|
||||
elif builder.startswith('win'):
|
||||
if builder.endswith('_vc2015'):
|
||||
if builder.endswith('_vs2017'):
|
||||
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'):
|
||||
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
||||
elif builder.startswith('win32'):
|
||||
@@ -100,13 +107,14 @@ if 'cmake' in builder:
|
||||
elif glibc == 'glibc211':
|
||||
deb_name = "squeeze"
|
||||
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
|
||||
cmake_player_config_file = "build_files/buildbot/config/blender_linux_player.cmake"
|
||||
if builder.endswith('x86_64_cmake'):
|
||||
chroot_name = 'buildbot_' + deb_name + '_x86_64'
|
||||
targets = ['blender']
|
||||
targets = ['player', 'blender']
|
||||
elif builder.endswith('i686_cmake'):
|
||||
bits = 32
|
||||
chroot_name = 'buildbot_' + deb_name + '_i686'
|
||||
targets = ['blender']
|
||||
targets = ['player', 'blender']
|
||||
cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7",
|
||||
"-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"])
|
||||
|
||||
@@ -157,7 +165,9 @@ if 'cmake' in builder:
|
||||
os.chdir(target_build_dir)
|
||||
# Tweaking CMake options to respect the target
|
||||
target_cmake_options = cmake_options[:]
|
||||
if target == 'cuda':
|
||||
if target == 'player':
|
||||
target_cmake_options.append("-C" + os.path.join(blender_dir, cmake_player_config_file))
|
||||
elif target == 'cuda':
|
||||
target_cmake_options += cuda_cmake_options
|
||||
target_chroot_prefix = cuda_chroot_prefix[:]
|
||||
target_name = 'cycles_kernel_cuda'
|
||||
|
@@ -126,6 +126,7 @@ if builder.find('cmake') != -1:
|
||||
|
||||
elif builder.startswith('linux_'):
|
||||
blender = os.path.join(install_dir, 'blender')
|
||||
blenderplayer = os.path.join(install_dir, 'blenderplayer')
|
||||
|
||||
buildinfo_h = os.path.join(build_dir, "source", "creator", "buildinfo.h")
|
||||
blender_h = os.path.join(blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
|
||||
@@ -148,7 +149,7 @@ if builder.find('cmake') != -1:
|
||||
# Strip all unused symbols from the binaries
|
||||
print("Stripping binaries...")
|
||||
chroot_prefix = ['schroot', '-c', chroot_name, '--']
|
||||
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender])
|
||||
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender, blenderplayer])
|
||||
|
||||
print("Stripping python...")
|
||||
py_target = os.path.join(install_dir, blender_version)
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#
|
||||
# also defined,
|
||||
# GLEW_LIBRARY, where to find the Glew library.
|
||||
# GLEW_MX_LIBRARY, where to find the GlewMX library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Blender Foundation.
|
||||
@@ -49,6 +50,16 @@ FIND_LIBRARY(GLEW_LIBRARY
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
|
||||
FIND_LIBRARY(GLEW_MX_LIBRARY
|
||||
NAMES
|
||||
GLEWmx
|
||||
HINTS
|
||||
${_glew_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
@@ -62,6 +73,7 @@ ENDIF(GLEW_FOUND)
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
GLEW_LIBRARY
|
||||
GLEW_MX_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(_glew_SEARCH_DIRS)
|
||||
|
@@ -93,4 +93,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
|
||||
MARK_AS_ADVANCED(
|
||||
LLVM_LIBRARY
|
||||
)
|
||||
|
||||
|
@@ -1,15 +1,15 @@
|
||||
# - Find SndFile library
|
||||
# Find the native SndFile includes and library
|
||||
# This module defines
|
||||
# LIBSNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
|
||||
# LIBSNDFILE_INCLUDE_DIR is found.
|
||||
# LIBSNDFILE_LIBRARIES, libraries to link against to use SndFile.
|
||||
# LIBSNDFILE_ROOT_DIR, The base directory to search for SndFile.
|
||||
# SNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
|
||||
# SNDFILE_INCLUDE_DIR is found.
|
||||
# SNDFILE_LIBRARIES, libraries to link against to use SndFile.
|
||||
# SNDFILE_ROOT_DIR, The base directory to search for SndFile.
|
||||
# This can also be an environment variable.
|
||||
# LIBSNDFILE_FOUND, If false, do not try to use SndFile.
|
||||
# SNDFILE_FOUND, If false, do not try to use SndFile.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# LIBSNDFILE_LIBRARY, where to find the SndFile library.
|
||||
# SNDFILE_LIBRARY, where to find the SndFile library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
@@ -22,26 +22,26 @@
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT LIBSNDFILE_ROOT_DIR AND NOT $ENV{LIBSNDFILE_ROOT_DIR} STREQUAL "")
|
||||
SET(LIBSNDFILE_ROOT_DIR $ENV{LIBSNDFILE_ROOT_DIR})
|
||||
# If SNDFILE_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT SNDFILE_ROOT_DIR AND NOT $ENV{SNDFILE_ROOT_DIR} STREQUAL "")
|
||||
SET(SNDFILE_ROOT_DIR $ENV{SNDFILE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_sndfile_SEARCH_DIRS
|
||||
${LIBSNDFILE_ROOT_DIR}
|
||||
${SNDFILE_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
)
|
||||
|
||||
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h
|
||||
FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h
|
||||
HINTS
|
||||
${_sndfile_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBSNDFILE_LIBRARY
|
||||
FIND_LIBRARY(SNDFILE_LIBRARY
|
||||
NAMES
|
||||
sndfile
|
||||
HINTS
|
||||
@@ -50,18 +50,18 @@ FIND_LIBRARY(LIBSNDFILE_LIBRARY
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if
|
||||
# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
|
||||
LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
|
||||
SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
|
||||
|
||||
IF(LIBSNDFILE_FOUND)
|
||||
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
|
||||
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
|
||||
ENDIF(LIBSNDFILE_FOUND)
|
||||
IF(SNDFILE_FOUND)
|
||||
SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
|
||||
SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
|
||||
ENDIF(SNDFILE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LIBSNDFILE_INCLUDE_DIR
|
||||
LIBSNDFILE_LIBRARY
|
||||
SNDFILE_INCLUDE_DIR
|
||||
SNDFILE_LIBRARY
|
||||
)
|
||||
|
@@ -16,6 +16,7 @@ set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
||||
@@ -23,6 +24,7 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
@@ -49,6 +51,7 @@ set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#
|
||||
|
||||
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# disable audio, its possible some devs may want this but for now disable
|
||||
# so the python module doesnt hold the audio device and loads quickly.
|
||||
|
@@ -21,6 +21,7 @@ set(WITH_CYCLES_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
|
||||
@@ -28,6 +29,7 @@ set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_FRAMESERVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -16,6 +16,7 @@ set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
||||
@@ -23,6 +24,7 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
@@ -49,6 +51,7 @@ set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61 CACHE STRING "" FORCE)
|
||||
|
@@ -12,6 +12,9 @@ set(WITH_INSTALL_PORTABLE OFF CACHE BOOL "" FORCE)
|
||||
# no point int copying python into python
|
||||
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# dont build the game engine
|
||||
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# disable audio, its possible some devs may want this but for now disable
|
||||
# so the python module doesnt hold the audio device and loads quickly.
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -6,6 +6,7 @@
|
||||
|
||||
# disable Blender
|
||||
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_BLENDER OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# build Cycles
|
||||
|
@@ -326,7 +326,7 @@ function(SETUP_LIBDIRS)
|
||||
link_directories(${JACK_LIBPATH})
|
||||
endif()
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
link_directories(${LIBSNDFILE_LIBPATH})
|
||||
link_directories(${SNDFILE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_FFTW3)
|
||||
link_directories(${FFTW3_LIBPATH})
|
||||
@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
|
||||
endif()
|
||||
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
|
||||
target
|
||||
)
|
||||
@@ -407,7 +412,7 @@ function(setup_liblinks
|
||||
target_link_libraries(${target} ${JACK_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
target_link_libraries(${target} ${LIBSNDFILE_LIBRARIES})
|
||||
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
|
||||
target_link_libraries(${target} ${SDL_LIBRARY})
|
||||
@@ -555,12 +560,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
|
||||
list(APPEND BLENDER_LINK_LIBS
|
||||
audaspace
|
||||
audaspace-py)
|
||||
endif()
|
||||
|
||||
# Sort libraries
|
||||
set(BLENDER_SORTED_LIBS
|
||||
bf_windowmanager
|
||||
@@ -583,7 +582,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_editor_space_sequencer
|
||||
bf_editor_space_text
|
||||
bf_editor_space_time
|
||||
bf_editor_space_topbar
|
||||
bf_editor_space_userpref
|
||||
bf_editor_space_view3d
|
||||
bf_editor_space_clip
|
||||
@@ -594,7 +592,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_editor_curve
|
||||
bf_editor_gpencil
|
||||
bf_editor_interface
|
||||
bf_editor_manipulator_library
|
||||
bf_editor_mesh
|
||||
bf_editor_metaball
|
||||
bf_editor_object
|
||||
@@ -602,7 +599,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_editor_armature
|
||||
bf_editor_physics
|
||||
bf_editor_render
|
||||
bf_editor_scene
|
||||
bf_editor_screen
|
||||
bf_editor_sculpt_paint
|
||||
bf_editor_sound
|
||||
@@ -615,7 +611,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_python
|
||||
bf_python_ext
|
||||
bf_python_mathutils
|
||||
bf_python_gawain
|
||||
bf_python_bmesh
|
||||
bf_freestyle
|
||||
bf_ikplugin
|
||||
@@ -623,14 +618,11 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_alembic
|
||||
bf_bmesh
|
||||
bf_gpu
|
||||
bf_draw
|
||||
bf_blenloader
|
||||
bf_blenkernel
|
||||
bf_physics
|
||||
bf_nodes
|
||||
bf_rna
|
||||
bf_editor_manipulator_library # rna -> manipulator bad-level calls
|
||||
bf_python
|
||||
bf_imbuf
|
||||
bf_blenlib
|
||||
bf_depsgraph
|
||||
@@ -671,8 +663,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_blenfont
|
||||
bf_blentranslation
|
||||
bf_intern_audaspace
|
||||
audaspace
|
||||
audaspace-py
|
||||
bf_intern_mikktspace
|
||||
bf_intern_dualcon
|
||||
bf_intern_cycles
|
||||
@@ -684,7 +674,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
cycles_util
|
||||
cycles_subd
|
||||
bf_intern_opencolorio
|
||||
bf_intern_gawain
|
||||
bf_intern_eigen
|
||||
extern_rangetree
|
||||
extern_wcwidth
|
||||
@@ -761,6 +750,10 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
|
||||
endif()
|
||||
|
||||
if(WITH_GAMEENGINE_DECKLINK)
|
||||
list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
|
||||
endif()
|
||||
@@ -1048,13 +1041,19 @@ macro(remove_cc_flag
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(add_cc_flag
|
||||
macro(add_c_flag
|
||||
flag)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endmacro()
|
||||
|
||||
macro(add_cxx_flag
|
||||
flag)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endmacro()
|
||||
|
||||
macro(remove_strict_flags)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
@@ -1077,7 +1076,8 @@ macro(remove_strict_flags)
|
||||
)
|
||||
|
||||
# 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()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
@@ -1089,7 +1089,8 @@ macro(remove_strict_flags)
|
||||
)
|
||||
|
||||
# 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()
|
||||
|
||||
if(MSVC)
|
||||
@@ -1119,28 +1120,39 @@ endmacro()
|
||||
# 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
|
||||
# probably add more removals here.
|
||||
macro(remove_strict_flags_file
|
||||
macro(remove_strict_c_flags_file
|
||||
filenames)
|
||||
|
||||
foreach(_SOURCE ${ARGV})
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR
|
||||
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
|
||||
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
set_source_files_properties(${_SOURCE}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
|
||||
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# TODO
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
|
||||
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()
|
||||
|
||||
# External libs may need 'signed char' to be default.
|
||||
@@ -1522,7 +1534,6 @@ function(find_python_package
|
||||
NAMES
|
||||
${package}
|
||||
HINTS
|
||||
"${PYTHON_LIBPATH}/"
|
||||
"${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
|
||||
"${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
|
||||
PATH_SUFFIXES
|
||||
|
@@ -23,8 +23,6 @@
|
||||
|
||||
# Libraries configuration for Apple.
|
||||
|
||||
set(MACOSX_DEPLOYMENT_TARGET "10.9")
|
||||
|
||||
macro(find_package_wrapper)
|
||||
# do nothing, just satisfy the macro
|
||||
endmacro()
|
||||
@@ -45,7 +43,7 @@ if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(OPENAL_FOUND)
|
||||
set(WITH_OPENAL ON)
|
||||
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include/AL")
|
||||
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
|
||||
else()
|
||||
set(WITH_OPENAL OFF)
|
||||
endif()
|
||||
@@ -81,10 +79,10 @@ if(WITH_JACK)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
set(LIBSNDFILE ${LIBDIR}/sndfile)
|
||||
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
|
||||
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
|
||||
set(SNDFILE ${LIBDIR}/sndfile)
|
||||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
|
||||
set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
@@ -358,7 +356,7 @@ if(WITH_LLVM)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||
else()
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||
endif()
|
||||
@@ -418,7 +416,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
||||
endif()
|
||||
# Get rid of eventually clashes, we export some symbols explicite as local
|
||||
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++")
|
||||
|
@@ -148,7 +148,7 @@ endif()
|
||||
# Codecs
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
find_package_wrapper(SndFile)
|
||||
if(NOT LIBSNDFILE_FOUND)
|
||||
if(NOT SNDFILE_FOUND)
|
||||
set(WITH_CODEC_SNDFILE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -29,7 +29,16 @@ if(NOT MSVC)
|
||||
message(FATAL_ERROR "Compiler is unsupported")
|
||||
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})
|
||||
|
||||
@@ -119,8 +128,18 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
||||
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_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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_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 ")
|
||||
|
||||
# Ignore meaningless for us linker warnings.
|
||||
@@ -144,7 +163,7 @@ else()
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||
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)
|
||||
|
||||
@@ -532,7 +551,7 @@ set(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
if(WITH_OPENAL)
|
||||
set(OPENAL ${LIBDIR}/openal)
|
||||
set(OPENALDIR ${LIBDIR}/openal)
|
||||
set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
|
||||
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
|
||||
set(OPENAL_LIBPATH ${OPENAL}/lib)
|
||||
if(MSVC)
|
||||
set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
|
||||
@@ -543,10 +562,11 @@ if(WITH_OPENAL)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
set(LIBSNDFILE ${LIBDIR}/sndfile)
|
||||
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
|
||||
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib) # TODO, deprecate
|
||||
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
|
||||
set(SNDFILE ${LIBDIR}/sndfile)
|
||||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
|
||||
set(SNDFILE_LIBRARIES ${SNDFILE_LIBPATH}/libsndfile-1.lib)
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
|
14
build_files/windows/autodetect_msvc.cmd
Normal file
14
build_files/windows/autodetect_msvc.cmd
Normal file
@@ -0,0 +1,14 @@
|
||||
echo No explicit msvc version requested, autodetecting version.
|
||||
|
||||
call "%~dp0\detect_msvc2017.cmd"
|
||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||
|
||||
call "%~dp0\detect_msvc2015.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
|
53
build_files/windows/check_libraries.cmd
Normal file
53
build_files/windows/check_libraries.cmd
Normal file
@@ -0,0 +1,53 @@
|
||||
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_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
|
||||
)
|
86
build_files/windows/parse_arguments.cmd
Normal file
86
build_files/windows/parse_arguments.cmd
Normal file
@@ -0,0 +1,86 @@
|
||||
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" == "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 - 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.
|
||||
echo Experimental options
|
||||
echo - 2015 ^(build with visual studio 2015^)
|
||||
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
|
@@ -76,7 +76,7 @@ class DNACatalogHTML:
|
||||
DNACatalog is a catalog of all information in the DNA1 file-block
|
||||
'''
|
||||
|
||||
def __init__(self, catalog, bpy_module = None):
|
||||
def __init__(self, catalog, bpy_module=None):
|
||||
self.Catalog = catalog
|
||||
self.bpy = bpy_module
|
||||
|
||||
@@ -125,9 +125,9 @@ class DNACatalogHTML:
|
||||
|
||||
# ${endianness}
|
||||
if header.LittleEndianness:
|
||||
endianess= 'Little endianness'
|
||||
endianess = 'Little endianness'
|
||||
else:
|
||||
endianess= 'Big endianness'
|
||||
endianess = 'Big endianness'
|
||||
|
||||
# ${structs_list}
|
||||
log.debug("Creating structs index")
|
||||
@@ -136,7 +136,7 @@ class DNACatalogHTML:
|
||||
structureIndex = 0
|
||||
for structure in self.Catalog.Structs:
|
||||
structs_list += list_item.format(structureIndex, structure.Type.Name)
|
||||
structureIndex+=1
|
||||
structureIndex += 1
|
||||
|
||||
# ${structs_content}
|
||||
log.debug("Creating structs content")
|
||||
@@ -146,12 +146,12 @@ class DNACatalogHTML:
|
||||
structs_content += self.Structure(structure)
|
||||
|
||||
d = dict(
|
||||
version = version,
|
||||
revision = revision,
|
||||
bitness = bitness,
|
||||
endianness = endianess,
|
||||
structs_list = structs_list,
|
||||
structs_content = structs_content
|
||||
version=version,
|
||||
revision=revision,
|
||||
bitness=bitness,
|
||||
endianness=endianess,
|
||||
structs_list=structs_list,
|
||||
structs_content=structs_content
|
||||
)
|
||||
|
||||
dna_html = Template(dna_html_template).substitute(d)
|
||||
@@ -180,9 +180,9 @@ class DNACatalogHTML:
|
||||
<label>(<a href="#top">top</a>)</label><br/>"""
|
||||
|
||||
d = dict(
|
||||
struct_name = structure.Type.Name,
|
||||
fields = self.StructureFields(structure, None, 0),
|
||||
size = str(structure.Type.Size)
|
||||
struct_name=structure.Type.Name,
|
||||
fields=self.StructureFields(structure, None, 0),
|
||||
size=str(structure.Type.Size)
|
||||
)
|
||||
|
||||
struct_table = Template(struct_table_template).substitute(d)
|
||||
@@ -230,12 +230,12 @@ class DNACatalogHTML:
|
||||
size = field.Size(self.Catalog.Header)
|
||||
|
||||
d = dict(
|
||||
reference = reference,
|
||||
struct = struct,
|
||||
type = type,
|
||||
name = name,
|
||||
offset = offset,
|
||||
size = size
|
||||
reference=reference,
|
||||
struct=struct,
|
||||
type=type,
|
||||
name=name,
|
||||
offset=offset,
|
||||
size=size
|
||||
)
|
||||
|
||||
structure_field = Template(structure_field_template).substitute(d)
|
||||
@@ -246,7 +246,7 @@ class DNACatalogHTML:
|
||||
|
||||
return structure_field
|
||||
|
||||
def indent(self, input, dent, startswith = ''):
|
||||
def indent(self, input, dent, startswith=''):
|
||||
output = ''
|
||||
if dent < 0:
|
||||
for line in input.split('\n'):
|
||||
@@ -257,19 +257,19 @@ class DNACatalogHTML:
|
||||
output += line.lstrip() + '\n' # remove indentation completely
|
||||
elif dent > 0:
|
||||
for line in input.split('\n'):
|
||||
output += ' '* dent + line + '\n'
|
||||
output += ' ' * dent + line + '\n'
|
||||
return output
|
||||
|
||||
def format(self, input):
|
||||
diff = {
|
||||
'\n<!DOCTYPE':'<!DOCTYPE',
|
||||
'\n</ul>' :'</ul>',
|
||||
'<a name' :'\n<a name',
|
||||
'<tr>\n' :'<tr>',
|
||||
'<tr>' :' <tr>',
|
||||
'</th>\n' :'</th>',
|
||||
'</td>\n' :'</td>',
|
||||
'<tbody>\n' :'<tbody>'
|
||||
'\n<!DOCTYPE': '<!DOCTYPE',
|
||||
'\n</ul>': '</ul>',
|
||||
'<a name': '\n<a name',
|
||||
'<tr>\n': '<tr>',
|
||||
'<tr>': ' <tr>',
|
||||
'</th>\n': '</th>',
|
||||
'</td>\n': '</td>',
|
||||
'<tbody>\n': '<tbody>'
|
||||
}
|
||||
output = self.indent(input, 0)
|
||||
for key, value in diff.items():
|
||||
@@ -408,16 +408,16 @@ def main():
|
||||
else:
|
||||
filename = 'dna'
|
||||
dir = os.path.dirname(__file__)
|
||||
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
|
||||
Path_HTML = os.path.join(dir, filename + '.html') # output html file
|
||||
Path_CSS = os.path.join(dir, 'dna.css') # output css file
|
||||
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
|
||||
Path_HTML = os.path.join(dir, filename + '.html') # output html file
|
||||
Path_CSS = os.path.join(dir, 'dna.css') # output css file
|
||||
|
||||
# create a blend file for dna parsing
|
||||
if not os.path.exists(Path_Blend):
|
||||
log.info("1: write temp blend file with SDNA info")
|
||||
log.info(" saving to: " + Path_Blend)
|
||||
try:
|
||||
bpy.ops.wm.save_as_mainfile(filepath = Path_Blend, copy = True, compress = False)
|
||||
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
|
||||
except:
|
||||
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
|
||||
return
|
||||
|
@@ -34,6 +34,7 @@ log = logging.getLogger("BlendFileReader")
|
||||
# module global routines
|
||||
######################################################
|
||||
|
||||
|
||||
def ReadString(handle, length):
|
||||
'''
|
||||
ReadString reads a String of given length or a zero terminating String
|
||||
@@ -45,7 +46,7 @@ def ReadString(handle, length):
|
||||
# length == 0 means we want a zero terminating string
|
||||
result = ""
|
||||
s = ReadString(handle, 1)
|
||||
while s!="\0":
|
||||
while s != "\0":
|
||||
result += s
|
||||
s = ReadString(handle, 1)
|
||||
return result
|
||||
@@ -94,10 +95,10 @@ def openBlendFile(filename):
|
||||
log.debug("decompressing started")
|
||||
fs = gzip.open(filename, "rb")
|
||||
handle = tempfile.TemporaryFile()
|
||||
data = fs.read(1024*1024)
|
||||
data = fs.read(1024 * 1024)
|
||||
while data:
|
||||
handle.write(data)
|
||||
data = fs.read(1024*1024)
|
||||
data = fs.read(1024 * 1024)
|
||||
log.debug("decompressing finished")
|
||||
fs.close()
|
||||
log.debug("resetting decompressed file")
|
||||
@@ -112,7 +113,7 @@ def Align(handle):
|
||||
offset = handle.tell()
|
||||
trim = offset % 4
|
||||
if trim != 0:
|
||||
handle.seek(4-trim, os.SEEK_CUR)
|
||||
handle.seek(4 - trim, os.SEEK_CUR)
|
||||
|
||||
|
||||
######################################################
|
||||
@@ -266,9 +267,9 @@ class DNACatalog:
|
||||
|
||||
def __init__(self, fileheader, handle):
|
||||
log.debug("building DNA catalog")
|
||||
self.Names=[]
|
||||
self.Types=[]
|
||||
self.Structs=[]
|
||||
self.Names = []
|
||||
self.Types = []
|
||||
self.Structs = []
|
||||
self.Header = fileheader
|
||||
|
||||
SDNA = ReadString(handle, 4)
|
||||
@@ -278,7 +279,7 @@ class DNACatalog:
|
||||
numberOfNames = Read('uint', handle, fileheader)
|
||||
log.debug("building #{0} names".format(numberOfNames))
|
||||
for i in range(numberOfNames):
|
||||
name = ReadString(handle,0)
|
||||
name = ReadString(handle, 0)
|
||||
self.Names.append(DNAName(name))
|
||||
Align(handle)
|
||||
|
||||
@@ -287,7 +288,7 @@ class DNACatalog:
|
||||
numberOfTypes = Read('uint', handle, fileheader)
|
||||
log.debug("building #{0} types".format(numberOfTypes))
|
||||
for i in range(numberOfTypes):
|
||||
type = ReadString(handle,0)
|
||||
type = ReadString(handle, 0)
|
||||
self.Types.append(DNAType(type))
|
||||
Align(handle)
|
||||
|
||||
@@ -332,13 +333,13 @@ class DNAName:
|
||||
if parent is None:
|
||||
result = ""
|
||||
else:
|
||||
result = parent+"."
|
||||
result = parent + "."
|
||||
|
||||
result = result + self.ShortName()
|
||||
return result
|
||||
|
||||
def ShortName(self):
|
||||
result = self.Name;
|
||||
result = self.Name
|
||||
result = result.replace("*", "")
|
||||
result = result.replace("(", "")
|
||||
result = result.replace(")", "")
|
||||
@@ -348,10 +349,10 @@ class DNAName:
|
||||
return result
|
||||
|
||||
def IsPointer(self):
|
||||
return self.Name.find("*")>-1
|
||||
return self.Name.find("*") > -1
|
||||
|
||||
def IsMethodPointer(self):
|
||||
return self.Name.find("(*")>-1
|
||||
return self.Name.find("(*") > -1
|
||||
|
||||
def ArraySize(self):
|
||||
result = 1
|
||||
@@ -360,8 +361,8 @@ class DNAName:
|
||||
|
||||
while Index != -1:
|
||||
Index2 = Temp.find("]")
|
||||
result*=int(Temp[Index+1:Index2])
|
||||
Temp = Temp[Index2+1:]
|
||||
result *= int(Temp[Index + 1:Index2])
|
||||
Temp = Temp[Index2 + 1:]
|
||||
Index = Temp.find("[")
|
||||
|
||||
return result
|
||||
@@ -378,7 +379,7 @@ class DNAType:
|
||||
|
||||
def __init__(self, aName):
|
||||
self.Name = aName
|
||||
self.Structure=None
|
||||
self.Structure = None
|
||||
|
||||
|
||||
class DNAStructure:
|
||||
@@ -392,22 +393,22 @@ class DNAStructure:
|
||||
def __init__(self, aType):
|
||||
self.Type = aType
|
||||
self.Type.Structure = self
|
||||
self.Fields=[]
|
||||
self.Fields = []
|
||||
|
||||
def GetField(self, header, handle, path):
|
||||
splitted = path.partition(".")
|
||||
name = splitted[0]
|
||||
rest = splitted[2]
|
||||
offset = 0;
|
||||
offset = 0
|
||||
for field in self.Fields:
|
||||
if field.Name.ShortName() == name:
|
||||
log.debug("found "+name+"@"+str(offset))
|
||||
log.debug("found " + name + "@" + str(offset))
|
||||
handle.seek(offset, os.SEEK_CUR)
|
||||
return field.DecodeField(header, handle, rest)
|
||||
else:
|
||||
offset += field.Size(header)
|
||||
|
||||
log.debug("error did not find "+path)
|
||||
log.debug("error did not find " + path)
|
||||
return None
|
||||
|
||||
|
||||
@@ -425,22 +426,21 @@ class DNAField:
|
||||
|
||||
def Size(self, header):
|
||||
if self.Name.IsPointer() or self.Name.IsMethodPointer():
|
||||
return header.PointerSize*self.Name.ArraySize()
|
||||
return header.PointerSize * self.Name.ArraySize()
|
||||
else:
|
||||
return self.Type.Size*self.Name.ArraySize()
|
||||
return self.Type.Size * self.Name.ArraySize()
|
||||
|
||||
def DecodeField(self, header, handle, path):
|
||||
if path == "":
|
||||
if self.Name.IsPointer():
|
||||
return Read('pointer', handle, header)
|
||||
if self.Type.Name=="int":
|
||||
if self.Type.Name == "int":
|
||||
return Read('int', handle, header)
|
||||
if self.Type.Name=="short":
|
||||
if self.Type.Name == "short":
|
||||
return Read('short', handle, header)
|
||||
if self.Type.Name=="float":
|
||||
if self.Type.Name == "float":
|
||||
return Read('float', handle, header)
|
||||
if self.Type.Name=="char":
|
||||
if self.Type.Name == "char":
|
||||
return ReadString(handle, self.Name.ArraySize())
|
||||
else:
|
||||
return self.Type.Structure.GetField(header, handle, path)
|
||||
|
||||
|
@@ -36,6 +36,62 @@
|
||||
|
||||
/* ================================ */
|
||||
|
||||
/** \defgroup bge Game Engine */
|
||||
/** \defgroup gamelogic Game Logic
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup bgeconv Converter
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup blroutines Blender Routines
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup expressions Expressions
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup player Game Player
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup ketsji Ketsji
|
||||
* \ingroup bge
|
||||
* \todo check all headers and code files for proper licenses
|
||||
*/
|
||||
/** \defgroup ketsjinet Ketsji Network
|
||||
* \ingroup ketsji
|
||||
*/
|
||||
/** \defgroup bgenet Network
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup bgenetlb Loopback Network
|
||||
* \ingroup bgenet
|
||||
*/
|
||||
/** \defgroup phys Physics
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup physbullet Bullet Physics
|
||||
* \ingroup phys
|
||||
*/
|
||||
/** \defgroup physdummy Dummy Physics (none)
|
||||
* \ingroup phys
|
||||
*/
|
||||
/** \defgroup bgerast Rasterizer
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup bgerastoglfilters OpenGL Filters
|
||||
* \ingroup bgerast
|
||||
*/
|
||||
/** \defgroup bgerastogl OpenGL Rasterizer
|
||||
* \ingroup bgerast
|
||||
*/
|
||||
/** \defgroup bgesg BGE SceneGraph
|
||||
* \ingroup bge
|
||||
*/
|
||||
/** \defgroup bgevideotex BGE Video Texture
|
||||
* \ingroup bge
|
||||
*/
|
||||
|
||||
/* ================================ */
|
||||
|
||||
/** \defgroup blender Blender */
|
||||
|
||||
/** \defgroup blt BlenTranslation
|
||||
@@ -168,10 +224,6 @@
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup edscene scene
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup edsculpt sculpt and paint
|
||||
* \ingroup editors
|
||||
*/
|
||||
@@ -212,6 +264,10 @@
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup splogic game logic editor
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
||||
/** \defgroup spnla NLA editor
|
||||
* \ingroup editors
|
||||
*/
|
||||
|
@@ -42,6 +42,7 @@ def man_format(data):
|
||||
data = data.replace("\t", " ")
|
||||
return data
|
||||
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
import getopt
|
||||
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])
|
||||
|
37
doc/python_api/examples/bge.constraints.py
Normal file
37
doc/python_api/examples/bge.constraints.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
Basic Physics Constraint
|
||||
++++++++++++++++++++++++
|
||||
Example of how to create a hinge Physics Constraint between two objects.
|
||||
"""
|
||||
from bge import logic
|
||||
from bge import constraints
|
||||
|
||||
# get object list
|
||||
objects = logic.getCurrentScene().objects
|
||||
|
||||
# get object named Object1 and Object 2
|
||||
object_1 = objects["Object1"]
|
||||
object_2 = objects["Object2"]
|
||||
|
||||
# want to use Edge constraint type
|
||||
constraint_type = 2
|
||||
|
||||
# get Object1 and Object2 physics IDs
|
||||
physics_id_1 = object_1.getPhysicsId()
|
||||
physics_id_2 = object_2.getPhysicsId()
|
||||
|
||||
# use bottom right edge of Object1 for hinge position
|
||||
edge_position_x = 1.0
|
||||
edge_position_y = 0.0
|
||||
edge_position_z = -1.0
|
||||
|
||||
# rotate the pivot z axis about 90 degrees
|
||||
edge_angle_x = 0.0
|
||||
edge_angle_y = 0.0
|
||||
edge_angle_z = 90.0
|
||||
|
||||
# create an edge constraint
|
||||
constraints.createConstraint(physics_id_1, physics_id_2,
|
||||
constraint_type,
|
||||
edge_position_x, edge_position_y, edge_position_z,
|
||||
edge_angle_x, edge_angle_y, edge_angle_z)
|
40
doc/python_api/examples/bge.texture.1.py
Normal file
40
doc/python_api/examples/bge.texture.1.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
Texture Replacement
|
||||
+++++++++++++++++++
|
||||
|
||||
Example of how to replace a texture in game with an external image.
|
||||
``createTexture()`` and ``removeTexture()`` are to be called from a
|
||||
module Python Controller.
|
||||
"""
|
||||
from bge import logic
|
||||
from bge import texture
|
||||
|
||||
|
||||
def createTexture(cont):
|
||||
"""Create a new Dynamic Texture"""
|
||||
obj = cont.owner
|
||||
|
||||
# get the reference pointer (ID) of the internal texture
|
||||
ID = texture.materialID(obj, 'IMoriginal.png')
|
||||
|
||||
# create a texture object
|
||||
object_texture = texture.Texture(obj, ID)
|
||||
|
||||
# create a new source with an external image
|
||||
url = logic.expandPath("//newtexture.jpg")
|
||||
new_source = texture.ImageFFmpeg(url)
|
||||
|
||||
# the texture has to be stored in a permanent Python object
|
||||
logic.texture = object_texture
|
||||
|
||||
# update/replace the texture
|
||||
logic.texture.source = new_source
|
||||
logic.texture.refresh(False)
|
||||
|
||||
|
||||
def removeTexture(cont):
|
||||
"""Delete the Dynamic Texture, reversing back the final to its original state."""
|
||||
try:
|
||||
del logic.texture
|
||||
except:
|
||||
pass
|
239
doc/python_api/examples/bge.texture.2.py
Normal file
239
doc/python_api/examples/bge.texture.2.py
Normal file
@@ -0,0 +1,239 @@
|
||||
"""
|
||||
Video Capture with DeckLink
|
||||
+++++++++++++++++++++++++++
|
||||
Video frames captured with DeckLink cards have pixel formats that are generally not directly
|
||||
usable by OpenGL, they must be processed by a shader. The three shaders presented here should
|
||||
cover all common video capture cases.
|
||||
|
||||
This file reflects the current video transfer method implemented in the Decklink module:
|
||||
whenever possible the video images are transferred as float texture because this is more
|
||||
compatible with GPUs. Of course, only the pixel formats that have a correspondant GL format
|
||||
can be transferred as float. Look for fg_shaders in this file for an exhaustive list.
|
||||
|
||||
Other pixel formats will be transferred as 32 bits integer red-channel texture but this
|
||||
won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here.
|
||||
However, it should not be necessary to use any of them as the list below covers all practical
|
||||
cases of video capture with all types of Decklink product.
|
||||
|
||||
In other words, only use one of the pixel format below and you will be fine. Note that depending
|
||||
on the video stream, only certain pixel formats will be allowed (others will throw an exception).
|
||||
For example, to capture a PAL video stream, you must use one of the YUV formats.
|
||||
|
||||
To find which pixel format is suitable for a particular video stream, use the 'Media Express'
|
||||
utility that comes with the Decklink software : if you see the video in the 'Log and Capture'
|
||||
Window, you have selected the right pixel format and you can use the same in Blender.
|
||||
|
||||
Notes: * these shaders only decode the RGB channel and set the alpha channel to a fixed
|
||||
value (look for color.a = ). It's up to you to add postprocessing to the color.
|
||||
* these shaders are compatible with 2D and 3D video stream
|
||||
"""
|
||||
import bge
|
||||
from bge import logic
|
||||
from bge import texture as vt
|
||||
|
||||
# The default vertex shader, because we need one
|
||||
#
|
||||
VertexShader = """
|
||||
#version 130
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
# For use with RGB video stream: the pixel is directly usable
|
||||
#
|
||||
FragmentShader_R10l = """
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
|
||||
uniform float stereo;
|
||||
// eye = 0.0 for the left eye, 0.5 for the right eye
|
||||
uniform float eye;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 color;
|
||||
float tx, ty;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
color = texture(tex, vec2(tx,ty));
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
# For use with YUV video stream
|
||||
#
|
||||
FragmentShader_2vuy = """
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
|
||||
uniform float stereo;
|
||||
// eye = 0.0 for the left eye, 0.5 for the right eye
|
||||
uniform float eye;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 color;
|
||||
float tx, ty, width, Y, Cb, Cr;
|
||||
int px;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
width = float(textureSize(tex, 0).x);
|
||||
color = texture(tex, vec2(tx, ty));
|
||||
px = int(floor(fract(tx*width)*2.0));
|
||||
switch (px) {
|
||||
case 0:
|
||||
Y = color.g;
|
||||
break;
|
||||
case 1:
|
||||
Y = color.a;
|
||||
break;
|
||||
}
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (color.b - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (color.r - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
|
||||
color.b = Y + 1.8556 * Cb;
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
# For use with high resolution YUV
|
||||
#
|
||||
FragmentShader_v210 = """
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
|
||||
uniform float stereo;
|
||||
// eye = 0.0 for the left eye, 0.5 for the right eye
|
||||
uniform float eye;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 color, color1, color2, color3;
|
||||
int px;
|
||||
float tx, ty, width, sx, dx, bx, Y, Cb, Cr;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
width = float(textureSize(tex, 0).x);
|
||||
// to sample macro pixels (6 pixels in 4 words)
|
||||
sx = tx*width*0.25+0.01;
|
||||
// index of display pixel in the macro pixel 0..5
|
||||
px = int(floor(fract(sx)*6.0));
|
||||
// increment as we sample the macro pixel
|
||||
dx = 1.0/width;
|
||||
// base x coord of macro pixel
|
||||
bx = (floor(sx)+0.01)*dx*4.0;
|
||||
color = texture(tex, vec2(bx, ty));
|
||||
color1 = texture(tex, vec2(bx+dx, ty));
|
||||
color2 = texture(tex, vec2(bx+dx*2.0, ty));
|
||||
color3 = texture(tex, vec2(bx+dx*3.0, ty));
|
||||
switch (px) {
|
||||
case 0:
|
||||
case 1:
|
||||
Cb = color.b;
|
||||
Cr = color.r;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
Cb = color1.g;
|
||||
Cr = color2.b;
|
||||
break;
|
||||
default:
|
||||
Cb = color2.r;
|
||||
Cr = color3.g;
|
||||
break;
|
||||
}
|
||||
switch (px) {
|
||||
case 0:
|
||||
Y = color.g;
|
||||
break;
|
||||
case 1:
|
||||
Y = color1.b;
|
||||
break;
|
||||
case 2:
|
||||
Y = color1.r;
|
||||
break;
|
||||
case 3:
|
||||
Y = color2.g;
|
||||
break;
|
||||
case 4:
|
||||
Y = color3.b;
|
||||
break;
|
||||
default:
|
||||
Y = color3.r;
|
||||
break;
|
||||
}
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (Cb - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (Cr - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
|
||||
color.b = Y + 1.8556 * Cb;
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
# The exhausitve list of pixel formats that are transferred as float texture
|
||||
# Only use those for greater efficiency and compatiblity.
|
||||
#
|
||||
fg_shaders = {
|
||||
'2vuy': FragmentShader_2vuy,
|
||||
'8BitYUV': FragmentShader_2vuy,
|
||||
'v210': FragmentShader_v210,
|
||||
'10BitYUV': FragmentShader_v210,
|
||||
'8BitBGRA': FragmentShader_R10l,
|
||||
'BGRA': FragmentShader_R10l,
|
||||
'8BitARGB': FragmentShader_R10l,
|
||||
'10BitRGBXLE': FragmentShader_R10l,
|
||||
'R10l': FragmentShader_R10l
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Helper function to attach a pixel shader to the material that receives the video frame.
|
||||
#
|
||||
|
||||
def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
|
||||
if pixel not in fg_shaders:
|
||||
raise('Unsuported shader')
|
||||
shader = obj.meshes[0].materials[mat].getShader()
|
||||
if shader is not None and not shader.isValid():
|
||||
shader.setSource(VertexShader, fg_shaders[pixel], True)
|
||||
shader.setSampler('tex', 0)
|
||||
shader.setUniformEyef("eye")
|
||||
shader.setUniform1f("stereo", 0.5 if is3D else 1.0)
|
||||
tex = vt.Texture(obj, mat)
|
||||
tex.source = vt.VideoDeckLink(format + "/" + pixel + ("/3D" if is3D else ""), card)
|
||||
print("frame rate: ", tex.source.framerate)
|
||||
tex.source.play()
|
||||
obj["video"] = tex
|
||||
|
||||
#
|
||||
# Attach this function to an object that has a material with texture
|
||||
# and call it once to initialize the object
|
||||
#
|
||||
|
||||
|
||||
def init(cont):
|
||||
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
|
||||
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
|
||||
# config_video(cont.owner, 'pal ', '10BitYUV')
|
||||
config_video(cont.owner, 'pal ', '8BitYUV')
|
||||
|
||||
|
||||
#
|
||||
# To be called on every frame
|
||||
#
|
||||
def play(cont):
|
||||
obj = cont.owner
|
||||
video = obj.get("video")
|
||||
if video is not None:
|
||||
video.refresh(True)
|
46
doc/python_api/examples/bge.texture.py
Normal file
46
doc/python_api/examples/bge.texture.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""
|
||||
Basic Video Playback
|
||||
++++++++++++++++++++
|
||||
Example of how to replace a texture in game with a video.
|
||||
It needs to run everyframe.
|
||||
To avoid any confusion with the location of the file,
|
||||
we will use ``GameLogic.expandPath()`` to build an absolute file name,
|
||||
assuming the video file is in the same directory as the blend-file.
|
||||
"""
|
||||
import bge
|
||||
from bge import texture
|
||||
from bge import logic
|
||||
|
||||
cont = logic.getCurrentController()
|
||||
obj = cont.owner
|
||||
|
||||
# the creation of the texture must be done once: save the
|
||||
# texture object in an attribute of bge.logic module makes it persistent
|
||||
if not hasattr(logic, 'video'):
|
||||
|
||||
# identify a static texture by name
|
||||
matID = texture.materialID(obj, 'IMvideo.png')
|
||||
|
||||
# create a dynamic texture that will replace the static texture
|
||||
logic.video = texture.Texture(obj, matID)
|
||||
|
||||
# define a source of image for the texture, here a movie
|
||||
movie = logic.expandPath('//trailer_400p.ogg')
|
||||
logic.video.source = texture.VideoFFmpeg(movie)
|
||||
logic.video.source.scale = True
|
||||
|
||||
# Note that we can change the ``Texture`` source at any time.
|
||||
# Suppose we want to switch between two movies during the game:
|
||||
logic.mySources[0] = texture.VideoFFmpeg('movie1.avi')
|
||||
logic.mySources[1] = texture.VideoFFmpeg('movie2.avi')
|
||||
|
||||
# And then assign (and reassign) the source during the game
|
||||
logic.video.source = logic.mySources[movieSel]
|
||||
|
||||
# quick off the movie, but it wont play in the background
|
||||
logic.video.source.play()
|
||||
|
||||
|
||||
# Video playback is not a background process: it happens only when we refresh the texture.
|
||||
# So you need to call this function every frame to ensure update of the texture.
|
||||
logic.video.refresh(True)
|
@@ -15,6 +15,7 @@ font_info = {
|
||||
"handler": None,
|
||||
}
|
||||
|
||||
|
||||
def init():
|
||||
"""init function - runs once"""
|
||||
import os
|
||||
|
@@ -10,22 +10,22 @@ bm = bmesh.new()
|
||||
|
||||
# Add a circle XXX, should return all geometry created, not just verts.
|
||||
bmesh.ops.create_circle(
|
||||
bm,
|
||||
cap_ends=False,
|
||||
radius=0.2,
|
||||
segments=8)
|
||||
bm,
|
||||
cap_ends=False,
|
||||
radius=0.2,
|
||||
segments=8)
|
||||
|
||||
|
||||
# Spin and deal with geometry on side 'a'
|
||||
edges_start_a = bm.edges[:]
|
||||
geom_start_a = bm.verts[:] + edges_start_a
|
||||
ret = bmesh.ops.spin(
|
||||
bm,
|
||||
geom=geom_start_a,
|
||||
angle=math.radians(180.0),
|
||||
steps=8,
|
||||
axis=(1.0, 0.0, 0.0),
|
||||
cent=(0.0, 1.0, 0.0))
|
||||
bm,
|
||||
geom=geom_start_a,
|
||||
angle=math.radians(180.0),
|
||||
steps=8,
|
||||
axis=(1.0, 0.0, 0.0),
|
||||
cent=(0.0, 1.0, 0.0))
|
||||
edges_end_a = [ele for ele in ret["geom_last"]
|
||||
if isinstance(ele, bmesh.types.BMEdge)]
|
||||
del ret
|
||||
@@ -33,8 +33,8 @@ del ret
|
||||
|
||||
# Extrude and create geometry on side 'b'
|
||||
ret = bmesh.ops.extrude_edge_only(
|
||||
bm,
|
||||
edges=edges_start_a)
|
||||
bm,
|
||||
edges=edges_start_a)
|
||||
geom_extrude_mid = ret["geom"]
|
||||
del ret
|
||||
|
||||
@@ -45,19 +45,19 @@ verts_extrude_b = [ele for ele in geom_extrude_mid
|
||||
edges_extrude_b = [ele for ele in geom_extrude_mid
|
||||
if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary]
|
||||
bmesh.ops.translate(
|
||||
bm,
|
||||
verts=verts_extrude_b,
|
||||
vec=(0.0, 0.0, 1.0))
|
||||
bm,
|
||||
verts=verts_extrude_b,
|
||||
vec=(0.0, 0.0, 1.0))
|
||||
|
||||
|
||||
# Create the circle on side 'b'
|
||||
ret = bmesh.ops.spin(
|
||||
bm,
|
||||
geom=verts_extrude_b + edges_extrude_b,
|
||||
angle=-math.radians(180.0),
|
||||
steps=8,
|
||||
axis=(1.0, 0.0, 0.0),
|
||||
cent=(0.0, 1.0, 1.0))
|
||||
bm,
|
||||
geom=verts_extrude_b + edges_extrude_b,
|
||||
angle=-math.radians(180.0),
|
||||
steps=8,
|
||||
axis=(1.0, 0.0, 0.0),
|
||||
cent=(0.0, 1.0, 1.0))
|
||||
edges_end_b = [ele for ele in ret["geom_last"]
|
||||
if isinstance(ele, bmesh.types.BMEdge)]
|
||||
del ret
|
||||
@@ -65,30 +65,30 @@ del ret
|
||||
|
||||
# Bridge the resulting edge loops of both spins 'a & b'
|
||||
bmesh.ops.bridge_loops(
|
||||
bm,
|
||||
edges=edges_end_a + edges_end_b)
|
||||
bm,
|
||||
edges=edges_end_a + edges_end_b)
|
||||
|
||||
|
||||
# Now we have made a links of the chain, make a copy and rotate it
|
||||
# (so this looks something like a chain)
|
||||
|
||||
ret = bmesh.ops.duplicate(
|
||||
bm,
|
||||
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
|
||||
bm,
|
||||
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
|
||||
geom_dupe = ret["geom"]
|
||||
verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)]
|
||||
del ret
|
||||
|
||||
# position the new link
|
||||
bmesh.ops.translate(
|
||||
bm,
|
||||
verts=verts_dupe,
|
||||
vec=(0.0, 0.0, 2.0))
|
||||
bm,
|
||||
verts=verts_dupe,
|
||||
vec=(0.0, 0.0, 2.0))
|
||||
bmesh.ops.rotate(
|
||||
bm,
|
||||
verts=verts_dupe,
|
||||
cent=(0.0, 1.0, 0.0),
|
||||
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
|
||||
bm,
|
||||
verts=verts_dupe,
|
||||
cent=(0.0, 1.0, 0.0),
|
||||
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
|
||||
|
||||
# Done with creating the mesh, simply link it into the scene so we can see it
|
||||
|
||||
|
@@ -17,4 +17,5 @@ from bpy.app.handlers import persistent
|
||||
def load_handler(dummy):
|
||||
print("Load Handler:", bpy.data.filepath)
|
||||
|
||||
|
||||
bpy.app.handlers.load_post.append(load_handler)
|
||||
|
@@ -11,4 +11,5 @@ import bpy
|
||||
def my_handler(scene):
|
||||
print("Frame Change", scene.frame_current)
|
||||
|
||||
|
||||
bpy.app.handlers.frame_change_pre.append(my_handler)
|
||||
|
@@ -54,19 +54,19 @@ translations_tuple = (
|
||||
"Copyright (C) 2013 The Blender Foundation.",
|
||||
"This file is distributed under the same license as the Blender package.",
|
||||
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
|
||||
),
|
||||
),
|
||||
(("Operator", "Render: Copy Settings"),
|
||||
(("bpy.types.SCENE_OT_render_copy_settings",),
|
||||
()),
|
||||
("fr_FR", "Rendu : copier réglages",
|
||||
(False, ())),
|
||||
),
|
||||
),
|
||||
(("*", "Copy render settings from current scene to others"),
|
||||
(("bpy.types.SCENE_OT_render_copy_settings",),
|
||||
()),
|
||||
("fr_FR", "Copier les réglages de rendu depuis la scène courante vers d’autres",
|
||||
(False, ())),
|
||||
),
|
||||
),
|
||||
# ... etc, all messages from your addon.
|
||||
)
|
||||
|
||||
@@ -81,6 +81,7 @@ for msg in translations_tuple:
|
||||
|
||||
# Define remaining addon (operators, UI...) here.
|
||||
|
||||
|
||||
def register():
|
||||
# Usual operator/UI/etc. registration...
|
||||
|
||||
|
@@ -14,6 +14,7 @@ class MaterialSettings(bpy.types.PropertyGroup):
|
||||
my_float = bpy.props.FloatProperty()
|
||||
my_string = bpy.props.StringProperty()
|
||||
|
||||
|
||||
bpy.utils.register_class(MaterialSettings)
|
||||
|
||||
bpy.types.Material.my_settings = \
|
||||
|
@@ -14,6 +14,7 @@ class SceneSettingItem(bpy.types.PropertyGroup):
|
||||
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
|
||||
value = bpy.props.IntProperty(name="Test Prop", default=22)
|
||||
|
||||
|
||||
bpy.utils.register_class(SceneSettingItem)
|
||||
|
||||
bpy.types.Scene.my_settings = \
|
||||
|
@@ -14,6 +14,7 @@ import bpy
|
||||
def update_func(self, context):
|
||||
print("my test function", self)
|
||||
|
||||
|
||||
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
||||
|
||||
bpy.context.scene.testprop = 11.0
|
||||
|
@@ -19,6 +19,7 @@ def get_float(self):
|
||||
def set_float(self, value):
|
||||
self["testprop"] = value
|
||||
|
||||
|
||||
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
|
||||
|
||||
|
||||
@@ -27,6 +28,7 @@ def get_date(self):
|
||||
import datetime
|
||||
return str(datetime.datetime.now())
|
||||
|
||||
|
||||
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
|
||||
|
||||
|
||||
@@ -40,6 +42,7 @@ def get_array(self):
|
||||
def set_array(self, values):
|
||||
self["somebool"] = values[0] and values[1]
|
||||
|
||||
|
||||
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
|
||||
|
||||
|
||||
@@ -50,7 +53,7 @@ test_items = [
|
||||
("GREEN", "Green", "", 2),
|
||||
("BLUE", "Blue", "", 3),
|
||||
("YELLOW", "Yellow", "", 4),
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
def get_enum(self):
|
||||
@@ -61,6 +64,7 @@ def get_enum(self):
|
||||
def set_enum(self, value):
|
||||
print("setting value", value)
|
||||
|
||||
|
||||
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@ bl_info = {
|
||||
"wiki_url": "",
|
||||
"tracker_url": "",
|
||||
"category": "Object",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
import bpy
|
||||
@@ -23,17 +23,17 @@ class ExampleAddonPreferences(AddonPreferences):
|
||||
bl_idname = __name__
|
||||
|
||||
filepath = StringProperty(
|
||||
name="Example File Path",
|
||||
subtype='FILE_PATH',
|
||||
)
|
||||
name="Example File Path",
|
||||
subtype='FILE_PATH',
|
||||
)
|
||||
number = IntProperty(
|
||||
name="Example Number",
|
||||
default=4,
|
||||
)
|
||||
name="Example Number",
|
||||
default=4,
|
||||
)
|
||||
boolean = BoolProperty(
|
||||
name="Example Boolean",
|
||||
default=False,
|
||||
)
|
||||
name="Example Boolean",
|
||||
default=False,
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@@ -14,4 +14,5 @@ import bpy
|
||||
def menu_draw(self, context):
|
||||
self.layout.operator("wm.save_homefile")
|
||||
|
||||
|
||||
bpy.types.INFO_MT_file.append(menu_draw)
|
||||
|
@@ -32,7 +32,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
|
||||
# variable used for all preset values
|
||||
preset_defines = [
|
||||
"obj = bpy.context.object"
|
||||
]
|
||||
]
|
||||
|
||||
# properties to store in the preset
|
||||
preset_values = [
|
||||
@@ -42,7 +42,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
|
||||
"obj.show_name",
|
||||
"obj.show_axis",
|
||||
"obj.show_wire",
|
||||
]
|
||||
]
|
||||
|
||||
# where to store the preset
|
||||
preset_subdir = "object/draw"
|
||||
@@ -61,7 +61,7 @@ def panel_func(self, context):
|
||||
classes = (
|
||||
OBJECT_MT_draw_presets,
|
||||
AddPresetObjectDraw,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def register():
|
||||
|
@@ -60,6 +60,7 @@ def menu_func(self, context):
|
||||
layout.separator()
|
||||
layout.operator(WM_OT_button_context_test.bl_idname)
|
||||
|
||||
|
||||
classes = (
|
||||
WM_OT_button_context_test,
|
||||
WM_MT_button_context,
|
||||
@@ -77,5 +78,6 @@ def unregister():
|
||||
bpy.utils.unregister_class(cls)
|
||||
bpy.types.WM_MT_button_context.remove(menu_func)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
@@ -21,4 +21,5 @@ class CyclesNodeTree(bpy.types.NodeTree):
|
||||
def poll(cls, context):
|
||||
return context.scene.render.engine == 'CYCLES'
|
||||
|
||||
|
||||
bpy.utils.register_class(CyclesNodeTree)
|
||||
|
@@ -42,6 +42,7 @@ class SimpleMouseOperator(bpy.types.Operator):
|
||||
self.y = event.mouse_y
|
||||
return self.execute(context)
|
||||
|
||||
|
||||
bpy.utils.register_class(SimpleMouseOperator)
|
||||
|
||||
# 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(ExportSomeData.bl_idname, text="Text Export Operator")
|
||||
|
||||
|
||||
# Register and add to the file selector
|
||||
bpy.utils.register_class(ExportSomeData)
|
||||
bpy.types.INFO_MT_file_export.append(menu_func)
|
||||
|
@@ -41,6 +41,7 @@ class CustomDrawOperator(bpy.types.Operator):
|
||||
|
||||
col.prop(self, "my_string")
|
||||
|
||||
|
||||
bpy.utils.register_class(CustomDrawOperator)
|
||||
|
||||
# test call
|
||||
|
@@ -22,6 +22,7 @@ class HelloWorldOperator(bpy.types.Operator):
|
||||
print("Hello World")
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
bpy.utils.register_class(HelloWorldOperator)
|
||||
|
||||
# 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_2 = bpy.props.IntProperty(name="My Int")
|
||||
|
||||
|
||||
bpy.utils.register_class(MyPropertyGroup)
|
||||
|
||||
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)
|
||||
|
@@ -10,4 +10,5 @@ import bpy
|
||||
def draw(self, context):
|
||||
self.layout.label("Hello World")
|
||||
|
||||
|
||||
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):
|
||||
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
|
||||
|
||||
|
||||
# register it so its available for all bones
|
||||
bpy.utils.register_class(MyPropGroup)
|
||||
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,
|
||||
|
@@ -23,9 +23,9 @@ class OffScreenDraw(bpy.types.Operator):
|
||||
@staticmethod
|
||||
def handle_add(self, context):
|
||||
OffScreenDraw._handle_draw = bpy.types.SpaceView3D.draw_handler_add(
|
||||
self.draw_callback_px, (self, context),
|
||||
'WINDOW', 'POST_PIXEL',
|
||||
)
|
||||
self.draw_callback_px, (self, context),
|
||||
'WINDOW', 'POST_PIXEL',
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def handle_remove():
|
||||
@@ -52,26 +52,24 @@ class OffScreenDraw(bpy.types.Operator):
|
||||
@staticmethod
|
||||
def _update_offscreen(context, offscreen):
|
||||
scene = context.scene
|
||||
render_layer = context.render_layer
|
||||
render = scene.render
|
||||
camera = scene.camera
|
||||
|
||||
modelview_matrix = camera.matrix_world.inverted()
|
||||
projection_matrix = camera.calc_matrix_camera(
|
||||
render.resolution_x,
|
||||
render.resolution_y,
|
||||
render.pixel_aspect_x,
|
||||
render.pixel_aspect_y,
|
||||
)
|
||||
render.resolution_x,
|
||||
render.resolution_y,
|
||||
render.pixel_aspect_x,
|
||||
render.pixel_aspect_y,
|
||||
)
|
||||
|
||||
offscreen.draw_view3d(
|
||||
scene,
|
||||
render_layer,
|
||||
context.space_data,
|
||||
context.region,
|
||||
projection_matrix,
|
||||
modelview_matrix,
|
||||
)
|
||||
scene,
|
||||
context.space_data,
|
||||
context.region,
|
||||
projection_matrix,
|
||||
modelview_matrix,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _opengl_draw(context, texture, aspect_ratio, scale):
|
||||
|
49
doc/python_api/rst/bge.app.rst
Normal file
49
doc/python_api/rst/bge.app.rst
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
Application Data (bge.app)
|
||||
==========================
|
||||
|
||||
Module to access application values that remain unchanged during runtime.
|
||||
|
||||
.. module:: bge.app
|
||||
|
||||
.. data:: version
|
||||
|
||||
The Blender/BGE version as a tuple of 3 ints, eg. (2, 75, 1).
|
||||
|
||||
.. note::
|
||||
|
||||
Version tuples can be compared simply with (in)equality symbols;
|
||||
for example, ``(2, 74, 5) <= (2, 75, 0)`` returns True (lexical order).
|
||||
|
||||
:type: tuple of three ints
|
||||
|
||||
.. data:: version_string
|
||||
|
||||
The Blender/BGE version formatted as a string, eg. "2.75 (sub 1)".
|
||||
|
||||
:type: str
|
||||
|
||||
.. data:: version_char
|
||||
|
||||
The Blender/BGE version character (for minor releases).
|
||||
|
||||
:type: str
|
||||
|
||||
.. data:: has_texture_ffmpeg
|
||||
|
||||
True if the BGE has been built with FFmpeg support,
|
||||
enabling use of :class:`~bge.texture.ImageFFmpeg` and :class:`~bge.texture.VideoFFmpeg`.
|
||||
|
||||
:type: bool
|
||||
|
||||
.. data:: has_joystick
|
||||
|
||||
True if the BGE has been built with joystick support.
|
||||
|
||||
:type: bool
|
||||
|
||||
.. data:: has_physics
|
||||
|
||||
True if the BGE has been built with physics support.
|
||||
|
||||
:type: bool
|
356
doc/python_api/rst/bge.constraints.rst
Normal file
356
doc/python_api/rst/bge.constraints.rst
Normal file
@@ -0,0 +1,356 @@
|
||||
|
||||
Physics Constraints (bge.constraints)
|
||||
=====================================
|
||||
|
||||
Bullet Physics provides collision detection
|
||||
and rigid body dynamics for the Blender Game Engine.
|
||||
|
||||
Features:
|
||||
|
||||
- Vehicle simulation.
|
||||
- Rigid body constraints: hinge and point to point (ball socket).
|
||||
- Access to internal physics settings,
|
||||
like deactivation time, and debugging features
|
||||
|
||||
.. module:: bge.constraints
|
||||
|
||||
.. note:: Note about parameter settings
|
||||
|
||||
Since this API is not well documented, it can be unclear what kind of values to use for setting parameters.
|
||||
In general, damping settings should be in the range of 0 to 1 and
|
||||
stiffness settings should not be much higher than about 10.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. seealso::
|
||||
|
||||
For more examples of Bullet physics and how to use them
|
||||
see the `pybullet forum <https://pybullet.org/Bullet/phpBB3/viewforum.php?f=17>`__.
|
||||
|
||||
.. include:: __/examples/bge.constraints.py
|
||||
:start-line: 1
|
||||
:end-line: 4
|
||||
|
||||
.. literalinclude:: __/examples/bge.constraints.py
|
||||
:lines: 6-
|
||||
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. function:: createConstraint( \
|
||||
physicsid_1, physicsid_2, constraint_type, \
|
||||
pivot_x=0.0, pivot_y=0.0, pivot_z=0.0, \
|
||||
axis_x=0.0, axis_y=0.0, axis_z=0.0, flag=0)
|
||||
|
||||
Creates a constraint.
|
||||
|
||||
:arg physicsid_1: The physics id of the first object in constraint.
|
||||
:type physicsid_1: int
|
||||
|
||||
:arg physicsid_2: The physics id of the second object in constraint.
|
||||
:type physicsid_2: int
|
||||
|
||||
:arg constraint_type: The type of the constraint, see `Create Constraint Constants`_.
|
||||
|
||||
:type constraint_type: int
|
||||
|
||||
:arg pivot_x: Pivot X position. (optional)
|
||||
:type pivot_x: float
|
||||
|
||||
:arg pivot_y: Pivot Y position. (optional)
|
||||
:type pivot_y: float
|
||||
|
||||
:arg pivot_z: Pivot Z position. (optional)
|
||||
:type pivot_z: float
|
||||
|
||||
:arg axis_x: X axis angle in degrees. (optional)
|
||||
:type axis_x: float
|
||||
|
||||
:arg axis_y: Y axis angle in degrees. (optional)
|
||||
:type axis_y: float
|
||||
|
||||
:arg axis_z: Z axis angle in degrees. (optional)
|
||||
:type axis_z: float
|
||||
|
||||
:arg flag: 128 to disable collision between linked bodies. (optional)
|
||||
:type flag: int
|
||||
|
||||
:return: A constraint wrapper.
|
||||
:rtype: :class:`~bge.types.KX_ConstraintWrapper`
|
||||
|
||||
.. function:: exportBulletFile(filename)
|
||||
|
||||
Exports a file representing the dynamics world (usually using ``.bullet`` extension).
|
||||
|
||||
See `Bullet binary serialization <http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization>`__.
|
||||
|
||||
:arg filename: File path.
|
||||
:type filename: str
|
||||
|
||||
.. function:: getAppliedImpulse(constraintId)
|
||||
|
||||
:arg constraintId: The id of the constraint.
|
||||
:type constraintId: int
|
||||
|
||||
:return: The most recent applied impulse.
|
||||
:rtype: float
|
||||
|
||||
.. function:: getVehicleConstraint(constraintId)
|
||||
|
||||
:arg constraintId: The id of the vehicle constraint.
|
||||
:type constraintId: int
|
||||
|
||||
:return: A vehicle constraint object.
|
||||
:rtype: :class:`~bge.types.KX_VehicleWrapper`
|
||||
|
||||
.. function:: getCharacter(gameobj)
|
||||
|
||||
:arg gameobj: The game object with the character physics.
|
||||
:type gameobj: :class:`~bge.types.KX_GameObject`
|
||||
|
||||
:return: Character wrapper.
|
||||
:rtype: :class:`~bge.types.KX_CharacterWrapper`
|
||||
|
||||
.. function:: removeConstraint(constraintId)
|
||||
|
||||
Removes a constraint.
|
||||
|
||||
:arg constraintId: The id of the constraint to be removed.
|
||||
:type constraintId: int
|
||||
|
||||
.. function:: setCcdMode(ccdMode)
|
||||
|
||||
.. note::
|
||||
Very experimental, not recommended
|
||||
|
||||
Sets the CCD (Continous Colision Detection) mode in the Physics Environment.
|
||||
|
||||
:arg ccdMode: The new CCD mode.
|
||||
:type ccdMode: int
|
||||
|
||||
.. function:: setContactBreakingTreshold(breakingTreshold)
|
||||
|
||||
.. note::
|
||||
Reasonable default is 0.02 (if units are meters)
|
||||
|
||||
Sets tresholds to do with contact point management.
|
||||
|
||||
:arg breakingTreshold: The new contact breaking treshold.
|
||||
:type breakingTreshold: float
|
||||
|
||||
.. function:: setDeactivationAngularTreshold(angularTreshold)
|
||||
|
||||
Sets the angular velocity treshold.
|
||||
|
||||
:arg angularTreshold: New deactivation angular treshold.
|
||||
:type angularTreshold: float
|
||||
|
||||
.. function:: setDeactivationLinearTreshold(linearTreshold)
|
||||
|
||||
Sets the linear velocity treshold.
|
||||
|
||||
:arg linearTreshold: New deactivation linear treshold.
|
||||
:type linearTreshold: float
|
||||
|
||||
.. function:: setDeactivationTime(time)
|
||||
|
||||
Sets the time after which a resting rigidbody gets deactived.
|
||||
|
||||
:arg time: The deactivation time.
|
||||
:type time: float
|
||||
|
||||
.. function:: setDebugMode(mode)
|
||||
|
||||
Sets the debug mode.
|
||||
|
||||
:arg mode: The new debug mode, see `Debug Mode Constants`_.
|
||||
|
||||
:type mode: int
|
||||
|
||||
.. function:: setGravity(x, y, z)
|
||||
|
||||
Sets the gravity force.
|
||||
|
||||
:arg x: Gravity X force.
|
||||
:type x: float
|
||||
|
||||
:arg y: Gravity Y force.
|
||||
:type y: float
|
||||
|
||||
:arg z: Gravity Z force.
|
||||
:type z: float
|
||||
|
||||
.. function:: setLinearAirDamping(damping)
|
||||
|
||||
.. note::
|
||||
|
||||
Not implemented
|
||||
|
||||
Sets the linear air damping for rigidbodies.
|
||||
|
||||
.. function:: setNumIterations(numiter)
|
||||
|
||||
Sets the number of iterations for an iterative constraint solver.
|
||||
|
||||
:arg numiter: New number of iterations.
|
||||
:type numiter: int
|
||||
|
||||
.. function:: setNumTimeSubSteps(numsubstep)
|
||||
|
||||
Sets the number of substeps for each physics proceed. Tradeoff quality for performance.
|
||||
|
||||
:arg numsubstep: New number of substeps.
|
||||
:type numsubstep: int
|
||||
|
||||
.. function:: setSolverDamping(damping)
|
||||
|
||||
.. note::
|
||||
Very experimental, not recommended
|
||||
|
||||
Sets the damper constant of a penalty based solver.
|
||||
|
||||
:arg damping: New damping for the solver.
|
||||
:type damping: float
|
||||
|
||||
.. function:: setSolverTau(tau)
|
||||
|
||||
.. note::
|
||||
Very experimental, not recommended
|
||||
|
||||
Sets the spring constant of a penalty based solver.
|
||||
|
||||
:arg tau: New tau for the solver.
|
||||
:type tau: float
|
||||
|
||||
.. function:: setSolverType(solverType)
|
||||
|
||||
.. note::
|
||||
Very experimental, not recommended
|
||||
|
||||
Sets the solver type.
|
||||
|
||||
:arg solverType: The new type of the solver.
|
||||
:type solverType: int
|
||||
|
||||
.. function:: setSorConstant(sor)
|
||||
|
||||
.. note::
|
||||
Very experimental, not recommended
|
||||
|
||||
Sets the successive overrelaxation constant.
|
||||
|
||||
:arg sor: New sor value.
|
||||
:type sor: float
|
||||
|
||||
.. function:: setUseEpa(epa)
|
||||
|
||||
.. note::
|
||||
|
||||
Not implemented
|
||||
|
||||
|
||||
Constants
|
||||
+++++++++
|
||||
|
||||
.. attribute:: error
|
||||
|
||||
Symbolic constant string that indicates error.
|
||||
|
||||
:type: str
|
||||
|
||||
|
||||
Debug Mode Constants
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Debug mode to be used with :func:`setDebugMode`.
|
||||
|
||||
|
||||
.. data:: DBG_NODEBUG
|
||||
|
||||
No debug.
|
||||
|
||||
.. data:: DBG_DRAWWIREFRAME
|
||||
|
||||
Draw wireframe in debug.
|
||||
|
||||
.. data:: DBG_DRAWAABB
|
||||
|
||||
Draw Axis Aligned Bounding Box in debug.
|
||||
|
||||
.. data:: DBG_DRAWFREATURESTEXT
|
||||
|
||||
Draw features text in debug.
|
||||
|
||||
.. data:: DBG_DRAWCONTACTPOINTS
|
||||
|
||||
Draw contact points in debug.
|
||||
|
||||
.. data:: DBG_NOHELPTEXT
|
||||
|
||||
Debug without help text.
|
||||
|
||||
.. data:: DBG_DRAWTEXT
|
||||
|
||||
Draw text in debug.
|
||||
|
||||
.. data:: DBG_PROFILETIMINGS
|
||||
|
||||
Draw profile timings in debug.
|
||||
|
||||
.. data:: DBG_ENABLESATCOMPARISION
|
||||
|
||||
Enable sat comparision in debug.
|
||||
|
||||
.. data:: DBG_DISABLEBULLETLCP
|
||||
|
||||
Disable Bullet LCP.
|
||||
|
||||
.. data:: DBG_ENABLECCD
|
||||
|
||||
Enable Continous Collision Detection in debug.
|
||||
|
||||
.. data:: DBG_DRAWCONSTRAINTS
|
||||
|
||||
Draw constraints in debug.
|
||||
|
||||
.. data:: DBG_DRAWCONSTRAINTLIMITS
|
||||
|
||||
Draw constraint limits in debug.
|
||||
|
||||
.. data:: DBG_FASTWIREFRAME
|
||||
|
||||
Draw a fast wireframe in debug.
|
||||
|
||||
|
||||
Create Constraint Constants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Constraint type to be used with :func:`createConstraint`.
|
||||
|
||||
|
||||
.. data:: POINTTOPOINT_CONSTRAINT
|
||||
|
||||
.. to do
|
||||
|
||||
.. data:: LINEHINGE_CONSTRAINT
|
||||
|
||||
.. to do
|
||||
|
||||
.. data:: ANGULAR_CONSTRAINT
|
||||
|
||||
.. to do
|
||||
|
||||
.. data:: CONETWIST_CONSTRAINT
|
||||
|
||||
.. to do
|
||||
|
||||
.. data:: VEHICLE_CONSTRAINT
|
||||
|
||||
.. to do
|
||||
|
||||
.. data:: GENERIC_6DOF_CONSTRAINT
|
||||
|
||||
.. to do
|
250
doc/python_api/rst/bge.events.rst
Normal file
250
doc/python_api/rst/bge.events.rst
Normal file
@@ -0,0 +1,250 @@
|
||||
|
||||
Game Keys (bge.events)
|
||||
======================
|
||||
|
||||
*****
|
||||
Intro
|
||||
*****
|
||||
|
||||
This module holds key constants for the SCA_KeyboardSensor.
|
||||
|
||||
.. module:: bge.events
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Set a connected keyboard sensor to accept F1
|
||||
import bge
|
||||
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
sensor.key = bge.events.F1KEY
|
||||
|
||||
code-block:: python
|
||||
|
||||
# Do the all keys thing
|
||||
import bge
|
||||
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
|
||||
for key,status in sensor.events:
|
||||
# key[0] == bge.events.keycode, key[1] = status
|
||||
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
|
||||
if key == bge.events.WKEY:
|
||||
# Activate Forward!
|
||||
if key == bge.events.SKEY:
|
||||
# Activate Backward!
|
||||
if key == bge.events.AKEY:
|
||||
# Activate Left!
|
||||
if key == bge.events.DKEY:
|
||||
# Activate Right!
|
||||
|
||||
code-block:: python
|
||||
|
||||
# The all keys thing without a keyboard sensor (but you will
|
||||
# need an always sensor with pulse mode on)
|
||||
import bge
|
||||
|
||||
# Just shortening names here
|
||||
keyboard = bge.logic.keyboard
|
||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||
|
||||
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
|
||||
print("Activate Forward!")
|
||||
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
|
||||
print("Activate Backward!")
|
||||
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
|
||||
print("Activate Left!")
|
||||
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
|
||||
print("Activate Right!")
|
||||
|
||||
|
||||
*********
|
||||
Functions
|
||||
*********
|
||||
|
||||
.. function:: EventToString(event)
|
||||
|
||||
Return the string name of a key event. Will raise a ValueError error if its invalid.
|
||||
|
||||
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
|
||||
:type event: int
|
||||
:rtype: string
|
||||
|
||||
.. function:: EventToCharacter(event, shift)
|
||||
|
||||
Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
|
||||
|
||||
:type event: int
|
||||
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
|
||||
:type shift: bool
|
||||
:arg shift: set to true if shift is held.
|
||||
:rtype: string
|
||||
|
||||
****************
|
||||
Keys (Constants)
|
||||
****************
|
||||
|
||||
.. _mouse-keys:
|
||||
|
||||
==========
|
||||
Mouse Keys
|
||||
==========
|
||||
|
||||
.. data:: LEFTMOUSE
|
||||
.. data:: MIDDLEMOUSE
|
||||
.. data:: RIGHTMOUSE
|
||||
.. data:: WHEELUPMOUSE
|
||||
.. data:: WHEELDOWNMOUSE
|
||||
.. data:: MOUSEX
|
||||
.. data:: MOUSEY
|
||||
|
||||
.. _keyboard-keys:
|
||||
|
||||
=============
|
||||
Keyboard Keys
|
||||
=============
|
||||
|
||||
-------------
|
||||
Alphabet keys
|
||||
-------------
|
||||
|
||||
.. data:: AKEY
|
||||
.. data:: BKEY
|
||||
.. data:: CKEY
|
||||
.. data:: DKEY
|
||||
.. data:: EKEY
|
||||
.. data:: FKEY
|
||||
.. data:: GKEY
|
||||
.. data:: HKEY
|
||||
.. data:: IKEY
|
||||
.. data:: JKEY
|
||||
.. data:: KKEY
|
||||
.. data:: LKEY
|
||||
.. data:: MKEY
|
||||
.. data:: NKEY
|
||||
.. data:: OKEY
|
||||
.. data:: PKEY
|
||||
.. data:: QKEY
|
||||
.. data:: RKEY
|
||||
.. data:: SKEY
|
||||
.. data:: TKEY
|
||||
.. data:: UKEY
|
||||
.. data:: VKEY
|
||||
.. data:: WKEY
|
||||
.. data:: XKEY
|
||||
.. data:: YKEY
|
||||
.. data:: ZKEY
|
||||
|
||||
-----------
|
||||
Number keys
|
||||
-----------
|
||||
|
||||
.. data:: ZEROKEY
|
||||
.. data:: ONEKEY
|
||||
.. data:: TWOKEY
|
||||
.. data:: THREEKEY
|
||||
.. data:: FOURKEY
|
||||
.. data:: FIVEKEY
|
||||
.. data:: SIXKEY
|
||||
.. data:: SEVENKEY
|
||||
.. data:: EIGHTKEY
|
||||
.. data:: NINEKEY
|
||||
|
||||
--------------
|
||||
Modifiers Keys
|
||||
--------------
|
||||
|
||||
.. data:: CAPSLOCKKEY
|
||||
.. data:: LEFTCTRLKEY
|
||||
.. data:: LEFTALTKEY
|
||||
.. data:: RIGHTALTKEY
|
||||
.. data:: RIGHTCTRLKEY
|
||||
.. data:: RIGHTSHIFTKEY
|
||||
.. data:: LEFTSHIFTKEY
|
||||
|
||||
----------
|
||||
Arrow Keys
|
||||
----------
|
||||
|
||||
.. data:: LEFTARROWKEY
|
||||
.. data:: DOWNARROWKEY
|
||||
.. data:: RIGHTARROWKEY
|
||||
.. data:: UPARROWKEY
|
||||
|
||||
--------------
|
||||
Numberpad Keys
|
||||
--------------
|
||||
|
||||
.. data:: PAD0
|
||||
.. data:: PAD1
|
||||
.. data:: PAD2
|
||||
.. data:: PAD3
|
||||
.. data:: PAD4
|
||||
.. data:: PAD5
|
||||
.. data:: PAD6
|
||||
.. data:: PAD7
|
||||
.. data:: PAD8
|
||||
.. data:: PAD9
|
||||
.. data:: PADPERIOD
|
||||
.. data:: PADSLASHKEY
|
||||
.. data:: PADASTERKEY
|
||||
.. data:: PADMINUS
|
||||
.. data:: PADENTER
|
||||
.. data:: PADPLUSKEY
|
||||
|
||||
-------------
|
||||
Function Keys
|
||||
-------------
|
||||
|
||||
.. data:: F1KEY
|
||||
.. data:: F2KEY
|
||||
.. data:: F3KEY
|
||||
.. data:: F4KEY
|
||||
.. data:: F5KEY
|
||||
.. data:: F6KEY
|
||||
.. data:: F7KEY
|
||||
.. data:: F8KEY
|
||||
.. data:: F9KEY
|
||||
.. data:: F10KEY
|
||||
.. data:: F11KEY
|
||||
.. data:: F12KEY
|
||||
.. data:: F13KEY
|
||||
.. data:: F14KEY
|
||||
.. data:: F15KEY
|
||||
.. data:: F16KEY
|
||||
.. data:: F17KEY
|
||||
.. data:: F18KEY
|
||||
.. data:: F19KEY
|
||||
|
||||
----------
|
||||
Other Keys
|
||||
----------
|
||||
|
||||
.. data:: ACCENTGRAVEKEY
|
||||
.. data:: BACKSLASHKEY
|
||||
.. data:: BACKSPACEKEY
|
||||
.. data:: COMMAKEY
|
||||
.. data:: DELKEY
|
||||
.. data:: ENDKEY
|
||||
.. data:: EQUALKEY
|
||||
.. data:: ESCKEY
|
||||
.. data:: HOMEKEY
|
||||
.. data:: INSERTKEY
|
||||
.. data:: LEFTBRACKETKEY
|
||||
.. data:: LINEFEEDKEY
|
||||
.. data:: MINUSKEY
|
||||
.. data:: PAGEDOWNKEY
|
||||
.. data:: PAGEUPKEY
|
||||
.. data:: PAUSEKEY
|
||||
.. data:: PERIODKEY
|
||||
.. data:: QUOTEKEY
|
||||
.. data:: RIGHTBRACKETKEY
|
||||
.. data:: RETKEY (Deprecated: use bge.events.ENTERKEY)
|
||||
.. data:: ENTERKEY
|
||||
.. data:: SEMICOLONKEY
|
||||
.. data:: SLASHKEY
|
||||
.. data:: SPACEKEY
|
||||
.. data:: TABKEY
|
1407
doc/python_api/rst/bge.logic.rst
Normal file
1407
doc/python_api/rst/bge.logic.rst
Normal file
File diff suppressed because it is too large
Load Diff
425
doc/python_api/rst/bge.render.rst
Normal file
425
doc/python_api/rst/bge.render.rst
Normal file
@@ -0,0 +1,425 @@
|
||||
|
||||
Rasterizer (bge.render)
|
||||
=======================
|
||||
|
||||
*****
|
||||
Intro
|
||||
*****
|
||||
|
||||
.. module:: bge.render
|
||||
|
||||
Example of using a :class:`bge.types.SCA_MouseSensor`,
|
||||
and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
|
||||
|
||||
.. note::
|
||||
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# To use a mouse movement sensor "Mouse" and a
|
||||
# motion actuator to mouse look:
|
||||
import bge
|
||||
|
||||
# scale sets the speed of motion
|
||||
scale = 1.0, 0.5
|
||||
|
||||
co = bge.logic.getCurrentController()
|
||||
obj = co.owner
|
||||
mouse = co.sensors["Mouse"]
|
||||
lmotion = co.actuators["LMove"]
|
||||
wmotion = co.actuators["WMove"]
|
||||
|
||||
# Transform the mouse coordinates to see how far the mouse has moved.
|
||||
def mousePos():
|
||||
x = (bge.render.getWindowWidth() / 2 - mouse.position[0]) * scale[0]
|
||||
y = (bge.render.getWindowHeight() / 2 - mouse.position[1]) * scale[1]
|
||||
return (x, y)
|
||||
|
||||
pos = mousePos()
|
||||
|
||||
# Set the amount of motion: X is applied in world coordinates...
|
||||
wmotion.useLocalTorque = False
|
||||
wmotion.torque = ((0.0, 0.0, pos[0]))
|
||||
|
||||
# ...Y is applied in local coordinates
|
||||
lmotion.useLocalTorque = True
|
||||
lmotion.torque = ((-pos[1], 0.0, 0.0))
|
||||
|
||||
# Activate both actuators
|
||||
co.activate(lmotion)
|
||||
co.activate(wmotion)
|
||||
|
||||
# Centre the mouse
|
||||
bge.render.setMousePosition(int(bge.render.getWindowWidth() / 2), int(bge.render.getWindowHeight() / 2))
|
||||
|
||||
*********
|
||||
Constants
|
||||
*********
|
||||
|
||||
.. data:: KX_TEXFACE_MATERIAL
|
||||
|
||||
Materials as defined by the texture face settings.
|
||||
|
||||
.. data:: KX_BLENDER_MULTITEX_MATERIAL
|
||||
|
||||
Materials approximating blender materials with multitexturing.
|
||||
|
||||
.. data:: KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
Materials approximating blender materials with GLSL.
|
||||
|
||||
.. DATA:: VSYNC_OFF
|
||||
|
||||
Disables vsync
|
||||
|
||||
.. DATA:: VSYNC_ON
|
||||
|
||||
Enables vsync
|
||||
|
||||
.. DATA:: VSYNC_ADAPTIVE
|
||||
|
||||
Enables adaptive vsync if supported.
|
||||
Adaptive vsync enables vsync if the framerate is above the monitors refresh rate.
|
||||
Otherwise, vsync is diabled if the framerate is too low.
|
||||
|
||||
.. data:: LEFT_EYE
|
||||
|
||||
Left eye being used during stereoscopic rendering.
|
||||
|
||||
.. data:: RIGHT_EYE
|
||||
|
||||
Right eye being used during stereoscopic rendering.
|
||||
|
||||
.. data:: RAS_OFS_RENDER_BUFFER
|
||||
|
||||
The pixel buffer for offscreen render is a RenderBuffer. Argument to :func:`offScreenCreate`
|
||||
|
||||
.. data:: RAS_OFS_RENDER_TEXTURE
|
||||
|
||||
The pixel buffer for offscreen render is a Texture. Argument to :func:`offScreenCreate`
|
||||
|
||||
|
||||
*****
|
||||
Types
|
||||
*****
|
||||
|
||||
.. class:: RASOffScreen
|
||||
|
||||
An off-screen render buffer object.
|
||||
|
||||
Use :func:`offScreenCreate` to create it.
|
||||
Currently it can only be used in the :class:`bge.texture.ImageRender`
|
||||
constructor to render on a FBO rather than the default viewport.
|
||||
|
||||
.. attribute:: width
|
||||
|
||||
The width in pixel of the FBO
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: height
|
||||
|
||||
The height in pixel of the FBO
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: color
|
||||
|
||||
The underlying OpenGL bind code of the texture object that holds
|
||||
the rendered image, 0 if the FBO is using RenderBuffer.
|
||||
The choice between RenderBuffer and Texture is determined
|
||||
by the target argument of :func:`offScreenCreate`.
|
||||
|
||||
:type: integer
|
||||
|
||||
|
||||
*********
|
||||
Functions
|
||||
*********
|
||||
|
||||
.. function:: getWindowWidth()
|
||||
|
||||
Gets the width of the window (in pixels)
|
||||
|
||||
:rtype: integer
|
||||
|
||||
.. function:: getWindowHeight()
|
||||
|
||||
Gets the height of the window (in pixels)
|
||||
|
||||
:rtype: integer
|
||||
|
||||
.. function:: setWindowSize(width, height)
|
||||
|
||||
Set the width and height of the window (in pixels). This also works for fullscreen applications.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player.
|
||||
|
||||
:arg width: width in pixels
|
||||
:type width: integer
|
||||
:arg height: height in pixels
|
||||
:type height: integer
|
||||
|
||||
.. function:: setFullScreen(enable)
|
||||
|
||||
Set whether or not the window should be fullscreen.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player.
|
||||
|
||||
:arg enable: ``True`` to set full screen, ``False`` to set windowed.
|
||||
:type enable: bool
|
||||
|
||||
.. function:: getFullScreen()
|
||||
|
||||
Returns whether or not the window is fullscreen.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player; there it always returns False.
|
||||
|
||||
:rtype: bool
|
||||
|
||||
.. function:: getDisplayDimensions()
|
||||
|
||||
Get the display dimensions, in pixels, of the display (e.g., the
|
||||
monitor). Can return the size of the entire view, so the
|
||||
combination of all monitors; for example, ``(3840, 1080)`` for two
|
||||
side-by-side 1080p monitors.
|
||||
|
||||
:rtype: tuple (width, height)
|
||||
|
||||
.. function:: makeScreenshot(filename)
|
||||
|
||||
Writes an image file with the current displayed frame.
|
||||
|
||||
The image is written to *'filename'*.
|
||||
The path may be absolute (eg. ``/home/foo/image``) or relative when started with
|
||||
``//`` (eg. ``//image``). Note that absolute paths are not portable between platforms.
|
||||
If the filename contains a ``#``,
|
||||
it will be replaced by an incremental index so that screenshots can be taken multiple
|
||||
times without overwriting the previous ones (eg. ``image-#``).
|
||||
|
||||
Settings for the image are taken from the render settings (file format and respective settings,
|
||||
gamma and colospace conversion, etc).
|
||||
The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
|
||||
When running from the standalone player, instead of the embedded player, only PNG files are supported.
|
||||
Additional color conversions are also not supported.
|
||||
|
||||
:arg filename: path and name of the file to write
|
||||
:type filename: string
|
||||
|
||||
|
||||
.. function:: enableVisibility(visible)
|
||||
|
||||
Deprecated; doesn't do anything.
|
||||
|
||||
|
||||
.. function:: showMouse(visible)
|
||||
|
||||
Enables or disables the operating system mouse cursor.
|
||||
|
||||
:arg visible:
|
||||
:type visible: boolean
|
||||
|
||||
|
||||
.. function:: setMousePosition(x, y)
|
||||
|
||||
Sets the mouse cursor position.
|
||||
|
||||
:arg x: X-coordinate in screen pixel coordinates.
|
||||
:type x: integer
|
||||
:arg y: Y-coordinate in screen pixel coordinates.
|
||||
:type y: integer
|
||||
|
||||
|
||||
.. function:: setBackgroundColor(rgba)
|
||||
|
||||
Deprecated and no longer functional. Use :py:meth:`bge.types.KX_WorldInfo.backgroundColor` instead.
|
||||
|
||||
|
||||
.. function:: setEyeSeparation(eyesep)
|
||||
|
||||
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
|
||||
|
||||
:arg eyesep: The distance between the left and right eye.
|
||||
:type eyesep: float
|
||||
|
||||
|
||||
.. function:: getEyeSeparation()
|
||||
|
||||
Gets the current eye separation for stereo mode.
|
||||
|
||||
:rtype: float
|
||||
|
||||
|
||||
.. function:: setFocalLength(focallength)
|
||||
|
||||
Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
|
||||
|
||||
:arg focallength: The focal length.
|
||||
:type focallength: float
|
||||
|
||||
.. function:: getFocalLength()
|
||||
|
||||
Gets the current focal length for stereo mode.
|
||||
|
||||
:rtype: float
|
||||
|
||||
.. function:: getStereoEye()
|
||||
|
||||
Gets the current stereoscopy eye being rendered.
|
||||
This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback
|
||||
function to customize the camera projection matrices for each
|
||||
stereoscopic eye.
|
||||
|
||||
:rtype: LEFT_EYE, RIGHT_EYE
|
||||
|
||||
.. function:: setMaterialMode(mode)
|
||||
|
||||
Set the material mode to use for OpenGL rendering.
|
||||
|
||||
:arg mode: material mode
|
||||
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
.. note:: Changes will only affect newly created scenes.
|
||||
|
||||
|
||||
.. function:: getMaterialMode(mode)
|
||||
|
||||
Get the material mode to use for OpenGL rendering.
|
||||
|
||||
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
|
||||
.. function:: setGLSLMaterialSetting(setting, enable)
|
||||
|
||||
Enables or disables a GLSL material setting.
|
||||
|
||||
:arg setting:
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
|
||||
.. function:: getGLSLMaterialSetting(setting)
|
||||
|
||||
Get the state of a GLSL material setting.
|
||||
|
||||
:arg setting:
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:rtype: boolean
|
||||
|
||||
.. function:: setAnisotropicFiltering(level)
|
||||
|
||||
Set the anisotropic filtering level for textures.
|
||||
|
||||
:arg level: The new anisotropic filtering level to use
|
||||
:type level: integer (must be one of 1, 2, 4, 8, 16)
|
||||
|
||||
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
|
||||
|
||||
.. function:: getAnisotropicFiltering()
|
||||
|
||||
Get the anisotropic filtering level used for textures.
|
||||
|
||||
:rtype: integer (one of 1, 2, 4, 8, 16)
|
||||
|
||||
.. function:: setMipmapping(value)
|
||||
|
||||
Change how to use mipmapping.
|
||||
|
||||
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
|
||||
|
||||
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
|
||||
|
||||
.. function:: getMipmapping()
|
||||
|
||||
Get the current mipmapping setting.
|
||||
|
||||
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
|
||||
|
||||
.. function:: drawLine(fromVec,toVec,color)
|
||||
|
||||
Draw a line in the 3D scene.
|
||||
|
||||
:arg fromVec: the origin of the line
|
||||
:type fromVec: list [x, y, z]
|
||||
:arg toVec: the end of the line
|
||||
:type toVec: list [x, y, z]
|
||||
:arg color: the color of the line
|
||||
:type color: list [r, g, b]
|
||||
|
||||
|
||||
.. function:: enableMotionBlur(factor)
|
||||
|
||||
Enable the motion blur effect.
|
||||
|
||||
:arg factor: the ammount of motion blur to display.
|
||||
:type factor: float [0.0 - 1.0]
|
||||
|
||||
|
||||
.. function:: disableMotionBlur()
|
||||
|
||||
Disable the motion blur effect.
|
||||
|
||||
.. function:: showFramerate(enable)
|
||||
|
||||
Show or hide the framerate.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: showProfile(enable)
|
||||
|
||||
Show or hide the profile.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: showProperties(enable)
|
||||
|
||||
Show or hide the debug properties.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: autoDebugList(enable)
|
||||
|
||||
Enable or disable auto adding debug properties to the debug list.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: clearDebugList()
|
||||
|
||||
Clears the debug property list.
|
||||
|
||||
.. function:: setVsync(value)
|
||||
|
||||
Set the vsync value
|
||||
|
||||
:arg value: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
|
||||
:type value: integer
|
||||
|
||||
.. function:: getVsync()
|
||||
|
||||
Get the current vsync value
|
||||
|
||||
:rtype: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
|
||||
|
||||
.. function:: offScreenCreate(width,height[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
|
||||
|
||||
Create a Off-screen render buffer object.
|
||||
|
||||
:arg width: the width of the buffer in pixels
|
||||
:type width: integer
|
||||
:arg height: the height of the buffer in pixels
|
||||
:type height: integer
|
||||
:arg samples: the number of multisample for anti-aliasing (MSAA), 0 to disable MSAA
|
||||
:type samples: integer
|
||||
:arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default),
|
||||
:data:`RAS_OFS_RENDER_TEXTURE` to render on texture.
|
||||
The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`).
|
||||
Otherwise the default is preferable as it's more widely supported by GPUs and more efficient.
|
||||
If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled.
|
||||
:type target: integer
|
||||
:rtype: :class:`RASOffScreen`
|
||||
|
1557
doc/python_api/rst/bge.texture.rst
Normal file
1557
doc/python_api/rst/bge.texture.rst
Normal file
File diff suppressed because it is too large
Load Diff
37
doc/python_api/rst/bge.types.rst
Normal file
37
doc/python_api/rst/bge.types.rst
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
Game Types (bge.types)
|
||||
======================
|
||||
|
||||
.. module:: bge.types
|
||||
|
||||
************
|
||||
Introduction
|
||||
************
|
||||
|
||||
This module contains the classes that appear as instances in the Game Engine. A
|
||||
script must interact with these classes if it is to affect the behaviour of
|
||||
objects in a game.
|
||||
|
||||
The following example would move an object (i.e. an instance of
|
||||
:class:`KX_GameObject`) one unit up.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# bge.types.SCA_PythonController
|
||||
cont = bge.logic.getCurrentController()
|
||||
|
||||
# bge.types.KX_GameObject
|
||||
obj = cont.owner
|
||||
obj.worldPosition.z += 1
|
||||
|
||||
To run the code, it could be placed in a Blender text block and executed with
|
||||
a :class:`SCA_PythonController` logic brick.
|
||||
|
||||
*****
|
||||
Types
|
||||
*****
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
|
||||
bge.types.*
|
75
doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst
Normal file
75
doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst
Normal file
@@ -0,0 +1,75 @@
|
||||
BL_ActionActuator(SCA_IActuator)
|
||||
================================
|
||||
|
||||
base class --- :class:`SCA_IActuator`
|
||||
|
||||
.. class:: BL_ActionActuator(SCA_IActuator)
|
||||
|
||||
Action Actuators apply an action to an actor.
|
||||
|
||||
.. attribute:: action
|
||||
|
||||
The name of the action to set as the current action.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: frameStart
|
||||
|
||||
Specifies the starting frame of the animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: frameEnd
|
||||
|
||||
Specifies the ending frame of the animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: blendIn
|
||||
|
||||
Specifies the number of frames of animation to generate when making transitions between actions.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: priority
|
||||
|
||||
Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: frame
|
||||
|
||||
Sets the current frame for the animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: propName
|
||||
|
||||
Sets the property to be used in FromProp playback mode.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: blendTime
|
||||
|
||||
Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: mode
|
||||
|
||||
The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: useContinue
|
||||
|
||||
The actions continue option, True or False. When True, the action will always play from where last left off,
|
||||
otherwise negative events to this actuator will reset it to its start frame.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: framePropName
|
||||
|
||||
The name of the property that is set to the current frame number.
|
||||
|
||||
:type: string
|
@@ -0,0 +1,58 @@
|
||||
BL_ArmatureActuator(SCA_IActuator)
|
||||
==================================
|
||||
|
||||
base class --- :class:`SCA_IActuator`
|
||||
|
||||
.. class:: BL_ArmatureActuator(SCA_IActuator)
|
||||
|
||||
Armature Actuators change constraint condition on armatures.
|
||||
|
||||
.. attribute:: type
|
||||
|
||||
The type of action that the actuator executes when it is active.
|
||||
|
||||
Can be one of :ref:`these constants <armatureactuator-constants-type>`
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: constraint
|
||||
|
||||
The constraint object this actuator is controlling.
|
||||
|
||||
:type: :class:`BL_ArmatureConstraint`
|
||||
|
||||
.. attribute:: target
|
||||
|
||||
The object that this actuator will set as primary target to the constraint it controls.
|
||||
|
||||
:type: :class:`KX_GameObject`
|
||||
|
||||
.. attribute:: subtarget
|
||||
|
||||
The object that this actuator will set as secondary target to the constraint it controls.
|
||||
|
||||
:type: :class:`KX_GameObject`.
|
||||
|
||||
.. note::
|
||||
|
||||
Currently, the only secondary target is the pole target for IK constraint.
|
||||
|
||||
.. attribute:: weight
|
||||
|
||||
The weight this actuator will set on the constraint it controls.
|
||||
|
||||
:type: float.
|
||||
|
||||
.. note::
|
||||
|
||||
Currently only the IK constraint has a weight. It must be a value between 0 and 1.
|
||||
|
||||
.. note::
|
||||
|
||||
A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
|
||||
|
||||
.. attribute:: influence
|
||||
|
||||
The influence this actuator will set on the constraint it controls.
|
||||
|
||||
:type: float.
|
103
doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst
Normal file
103
doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst
Normal file
@@ -0,0 +1,103 @@
|
||||
BL_ArmatureBone(PyObjectPlus)
|
||||
=============================
|
||||
|
||||
base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: BL_ArmatureBone(PyObjectPlus)
|
||||
|
||||
Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
|
||||
All space attribute correspond to the rest pose.
|
||||
|
||||
.. attribute:: name
|
||||
|
||||
bone name.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: connected
|
||||
|
||||
true when the bone head is struck to the parent's tail.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: hinge
|
||||
|
||||
true when bone doesn't inherit rotation or scale from parent bone.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: inherit_scale
|
||||
|
||||
true when bone inherits scaling from parent bone.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: bbone_segments
|
||||
|
||||
number of B-bone segments.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: roll
|
||||
|
||||
bone rotation around head-tail axis.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: head
|
||||
|
||||
location of head end of the bone in parent bone space.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: tail
|
||||
|
||||
location of head end of the bone in parent bone space.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: length
|
||||
|
||||
bone length.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: arm_head
|
||||
|
||||
location of head end of the bone in armature space.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: arm_tail
|
||||
|
||||
location of tail end of the bone in armature space.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: arm_mat
|
||||
|
||||
matrix of the bone head in armature space.
|
||||
|
||||
:type: matrix [4][4]
|
||||
|
||||
.. note::
|
||||
|
||||
This matrix has no scale part.
|
||||
|
||||
.. attribute:: bone_mat
|
||||
|
||||
rotation matrix of the bone in parent bone space.
|
||||
|
||||
:type: matrix [3][3]
|
||||
|
||||
.. attribute:: parent
|
||||
|
||||
parent bone, or None for root bone.
|
||||
|
||||
:type: :class:`BL_ArmatureBone`
|
||||
|
||||
.. attribute:: children
|
||||
|
||||
list of bone's children.
|
||||
|
||||
:type: list of :class:`BL_ArmatureBone`
|
275
doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst
Normal file
275
doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst
Normal file
@@ -0,0 +1,275 @@
|
||||
BL_ArmatureChannel(PyObjectPlus)
|
||||
================================
|
||||
|
||||
base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: BL_ArmatureChannel(PyObjectPlus)
|
||||
|
||||
Proxy to armature pose channel. Allows to read and set armature pose.
|
||||
The attributes are identical to RNA attributes, but mostly in read-only mode.
|
||||
|
||||
.. attribute:: name
|
||||
|
||||
channel name (=bone name), read-only.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: bone
|
||||
|
||||
return the bone object corresponding to this pose channel, read-only.
|
||||
|
||||
:type: :class:`BL_ArmatureBone`
|
||||
|
||||
.. attribute:: parent
|
||||
|
||||
return the parent channel object, None if root channel, read-only.
|
||||
|
||||
:type: :class:`BL_ArmatureChannel`
|
||||
|
||||
.. attribute:: has_ik
|
||||
|
||||
true if the bone is part of an active IK chain, read-only.
|
||||
This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_dof_x
|
||||
|
||||
true if the bone is free to rotation in the X axis, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_dof_y
|
||||
|
||||
true if the bone is free to rotation in the Y axis, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_dof_z
|
||||
|
||||
true if the bone is free to rotation in the Z axis, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_limit_x
|
||||
|
||||
true if a limit is imposed on X rotation, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_limit_y
|
||||
|
||||
true if a limit is imposed on Y rotation, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_limit_z
|
||||
|
||||
true if a limit is imposed on Z rotation, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_rot_control
|
||||
|
||||
true if channel rotation should applied as IK constraint, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: ik_lin_control
|
||||
|
||||
true if channel size should applied as IK constraint, read-only.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: location
|
||||
|
||||
displacement of the bone head in armature local space, read-write.
|
||||
|
||||
:type: vector [X, Y, Z].
|
||||
|
||||
.. note::
|
||||
|
||||
You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
|
||||
|
||||
.. note::
|
||||
|
||||
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
|
||||
|
||||
.. attribute:: scale
|
||||
|
||||
scale of the bone relative to its parent, read-write.
|
||||
|
||||
:type: vector [sizeX, sizeY, sizeZ].
|
||||
|
||||
.. note::
|
||||
|
||||
An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
|
||||
|
||||
.. note::
|
||||
|
||||
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
|
||||
|
||||
.. attribute:: rotation_quaternion
|
||||
|
||||
rotation of the bone relative to its parent expressed as a quaternion, read-write.
|
||||
|
||||
:type: vector [qr, qi, qj, qk].
|
||||
|
||||
.. note::
|
||||
|
||||
This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
|
||||
|
||||
.. note::
|
||||
|
||||
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
|
||||
|
||||
.. attribute:: rotation_euler
|
||||
|
||||
rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
|
||||
|
||||
:type: vector [X, Y, Z].
|
||||
|
||||
.. note::
|
||||
|
||||
This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
|
||||
|
||||
.. note::
|
||||
|
||||
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
|
||||
|
||||
.. attribute:: rotation_mode
|
||||
|
||||
Method of updating the bone rotation, read-write.
|
||||
|
||||
:type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
|
||||
|
||||
.. attribute:: channel_matrix
|
||||
|
||||
pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
|
||||
This field is updated after the graphic render, it represents the current pose.
|
||||
|
||||
:type: matrix [4][4]
|
||||
|
||||
.. attribute:: pose_matrix
|
||||
|
||||
pose matrix in armature space, read-only,
|
||||
This field is updated after the graphic render, it represents the current pose.
|
||||
|
||||
:type: matrix [4][4]
|
||||
|
||||
.. attribute:: pose_head
|
||||
|
||||
position of bone head in armature space, read-only.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: pose_tail
|
||||
|
||||
position of bone tail in armature space, read-only.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. attribute:: ik_min_x
|
||||
|
||||
minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_max_x
|
||||
|
||||
maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_min_y
|
||||
|
||||
minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_max_y
|
||||
|
||||
maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_min_z
|
||||
|
||||
minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_max_z
|
||||
|
||||
maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_stiffness_x
|
||||
|
||||
bone rotation stiffness in X axis, read-only.
|
||||
|
||||
:type: float between 0 and 1
|
||||
|
||||
.. attribute:: ik_stiffness_y
|
||||
|
||||
bone rotation stiffness in Y axis, read-only.
|
||||
|
||||
:type: float between 0 and 1
|
||||
|
||||
.. attribute:: ik_stiffness_z
|
||||
|
||||
bone rotation stiffness in Z axis, read-only.
|
||||
|
||||
:type: float between 0 and 1
|
||||
|
||||
.. attribute:: ik_stretch
|
||||
|
||||
ratio of scale change that is allowed, 0=bone can't change size, read-only.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_rot_weight
|
||||
|
||||
weight of rotation constraint when ik_rot_control is set, read-write.
|
||||
|
||||
:type: float between 0 and 1
|
||||
|
||||
.. attribute:: ik_lin_weight
|
||||
|
||||
weight of size constraint when ik_lin_control is set, read-write.
|
||||
|
||||
:type: float between 0 and 1
|
||||
|
||||
.. attribute:: joint_rotation
|
||||
|
||||
Control bone rotation in term of joint angle (for robotic applications), read-write.
|
||||
|
||||
When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
|
||||
|
||||
When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
|
||||
|
||||
The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
|
||||
|
||||
* 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
|
||||
* 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
|
||||
* 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
|
||||
* 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
|
||||
|
||||
:type: vector [x, y, z]
|
||||
|
||||
.. note::
|
||||
|
||||
The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
|
||||
|
||||
.. note::
|
||||
|
||||
[0, 0, 0] always corresponds to the rest pose.
|
||||
|
||||
.. note::
|
||||
|
||||
You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
|
||||
|
||||
.. note::
|
||||
|
||||
You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
|
126
doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst
Normal file
126
doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst
Normal file
@@ -0,0 +1,126 @@
|
||||
BL_ArmatureConstraint(PyObjectPlus)
|
||||
===================================
|
||||
|
||||
base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: BL_ArmatureConstraint(PyObjectPlus)
|
||||
|
||||
Proxy to Armature Constraint. Allows to change constraint on the fly.
|
||||
Obtained through :class:`BL_ArmatureObject`.constraints.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all armature constraints are supported in the GE.
|
||||
|
||||
|
||||
.. attribute:: type
|
||||
|
||||
Type of constraint, (read-only).
|
||||
|
||||
Use one of :ref:`these constants<armatureconstraint-constants-type>`.
|
||||
|
||||
:type: integer, one of CONSTRAINT_TYPE_* constants
|
||||
|
||||
.. attribute:: name
|
||||
|
||||
Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
|
||||
|
||||
:type: string
|
||||
|
||||
This name is also the key subscript on :class:`BL_ArmatureObject`.
|
||||
|
||||
.. attribute:: enforce
|
||||
|
||||
fraction of constraint effect that is enforced. Between 0 and 1.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: headtail
|
||||
|
||||
Position of target between head and tail of the target bone: 0=head, 1=tail.
|
||||
|
||||
:type: float.
|
||||
|
||||
.. note::
|
||||
|
||||
Only used if the target is a bone (i.e target object is an armature.
|
||||
|
||||
.. attribute:: lin_error
|
||||
|
||||
runtime linear error (in Blender units) on constraint at the current frame.
|
||||
|
||||
This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: rot_error
|
||||
|
||||
Runtime rotation error (in radiant) on constraint at the current frame.
|
||||
|
||||
:type: float.
|
||||
|
||||
This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
|
||||
|
||||
It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
|
||||
|
||||
.. attribute:: target
|
||||
|
||||
Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
|
||||
|
||||
:type: :class:`KX_GameObject`.
|
||||
|
||||
.. attribute:: subtarget
|
||||
|
||||
Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
|
||||
|
||||
:type: :class:`KX_GameObject`.
|
||||
|
||||
Currently this is only used for pole target on IK constraint.
|
||||
|
||||
.. attribute:: active
|
||||
|
||||
True if the constraint is active.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. note::
|
||||
|
||||
An inactive constraint does not update lin_error and rot_error.
|
||||
|
||||
.. attribute:: ik_weight
|
||||
|
||||
Weight of the IK constraint between 0 and 1.
|
||||
|
||||
Only defined for IK constraint.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_type
|
||||
|
||||
Type of IK constraint, (read-only).
|
||||
|
||||
Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
|
||||
|
||||
:type: integer.
|
||||
|
||||
.. attribute:: ik_flag
|
||||
|
||||
Combination of IK constraint option flags, read-only.
|
||||
|
||||
Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: ik_dist
|
||||
|
||||
Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: ik_mode
|
||||
|
||||
Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`.
|
||||
|
||||
Additional mode for IK constraint. Currently only used for Distance constraint:
|
||||
|
||||
:type: integer
|
31
doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst
Normal file
31
doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst
Normal file
@@ -0,0 +1,31 @@
|
||||
BL_ArmatureObject(KX_GameObject)
|
||||
================================
|
||||
|
||||
base class --- :class:`KX_GameObject`
|
||||
|
||||
.. class:: BL_ArmatureObject(KX_GameObject)
|
||||
|
||||
An armature object.
|
||||
|
||||
.. attribute:: constraints
|
||||
|
||||
The list of armature constraint defined on this armature.
|
||||
Elements of the list can be accessed by index or string.
|
||||
The key format for string access is '<bone_name>:<constraint_name>'.
|
||||
|
||||
:type: list of :class:`BL_ArmatureConstraint`
|
||||
|
||||
.. attribute:: channels
|
||||
|
||||
The list of armature channels.
|
||||
Elements of the list can be accessed by index or name the bone.
|
||||
|
||||
:type: list of :class:`BL_ArmatureChannel`
|
||||
|
||||
.. method:: update()
|
||||
|
||||
Ensures that the armature will be updated on next graphic frame.
|
||||
|
||||
This action is unecessary if a KX_ArmatureActuator with mode run is active
|
||||
or if an action is playing. Use this function in other cases. It must be called
|
||||
on each frame to ensure that the armature is updated continously.
|
227
doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
Normal file
227
doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
Normal file
@@ -0,0 +1,227 @@
|
||||
BL_Shader(PyObjectPlus)
|
||||
=======================
|
||||
|
||||
base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: BL_Shader(PyObjectPlus)
|
||||
|
||||
BL_Shader GLSL shaders.
|
||||
|
||||
TODO - Description
|
||||
|
||||
.. method:: setUniformfv(name, fList)
|
||||
|
||||
Set a uniform with a list of float values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg fList: a list (2, 3 or 4 elements) of float values
|
||||
:type fList: list[float]
|
||||
|
||||
.. method:: delSource()
|
||||
|
||||
Clear the shader. Use this method before the source is changed with :data:`setSource`.
|
||||
|
||||
.. method:: getFragmentProg()
|
||||
|
||||
Returns the fragment program.
|
||||
|
||||
:return: The fragment program.
|
||||
:rtype: string
|
||||
|
||||
.. method:: getVertexProg()
|
||||
|
||||
Get the vertex program.
|
||||
|
||||
:return: The vertex program.
|
||||
:rtype: string
|
||||
|
||||
.. method:: isValid()
|
||||
|
||||
Check if the shader is valid.
|
||||
|
||||
:return: True if the shader is valid
|
||||
:rtype: boolean
|
||||
|
||||
.. method:: setAttrib(enum)
|
||||
|
||||
Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
|
||||
|
||||
:arg enum: attribute location value
|
||||
:type enum: integer
|
||||
|
||||
.. method:: setNumberOfPasses( max_pass )
|
||||
|
||||
Set the maximum number of passes. Not used a.t.m.
|
||||
|
||||
:arg max_pass: the maximum number of passes
|
||||
:type max_pass: integer
|
||||
|
||||
.. method:: setSampler(name, index)
|
||||
|
||||
Set uniform texture sample index.
|
||||
|
||||
:arg name: Uniform name
|
||||
:type name: string
|
||||
:arg index: Texture sample index.
|
||||
:type index: integer
|
||||
|
||||
.. method:: setSource(vertexProgram, fragmentProgram)
|
||||
|
||||
Set the vertex and fragment programs
|
||||
|
||||
:arg vertexProgram: Vertex program
|
||||
:type vertexProgram: string
|
||||
:arg fragmentProgram: Fragment program
|
||||
:type fragmentProgram: string
|
||||
|
||||
.. method:: setUniform1f(name, fx)
|
||||
|
||||
Set a uniform with 1 float value.
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg fx: Uniform value
|
||||
:type fx: float
|
||||
|
||||
.. method:: setUniform1i(name, ix)
|
||||
|
||||
Set a uniform with an integer value.
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg ix: the uniform value
|
||||
:type ix: integer
|
||||
|
||||
.. method:: setUniform2f(name, fx, fy)
|
||||
|
||||
Set a uniform with 2 float values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg fx: first float value
|
||||
:type fx: float
|
||||
|
||||
:arg fy: second float value
|
||||
:type fy: float
|
||||
|
||||
.. method:: setUniform2i(name, ix, iy)
|
||||
|
||||
Set a uniform with 2 integer values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg ix: first integer value
|
||||
:type ix: integer
|
||||
:arg iy: second integer value
|
||||
:type iy: integer
|
||||
|
||||
.. method:: setUniform3f(name, fx, fy, fz)
|
||||
|
||||
Set a uniform with 3 float values.
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg fx: first float value
|
||||
:type fx: float
|
||||
:arg fy: second float value
|
||||
:type fy: float
|
||||
:arg fz: third float value
|
||||
:type fz: float
|
||||
|
||||
.. method:: setUniform3i(name, ix, iy, iz)
|
||||
|
||||
Set a uniform with 3 integer values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg ix: first integer value
|
||||
:type ix: integer
|
||||
:arg iy: second integer value
|
||||
:type iy: integer
|
||||
:arg iz: third integer value
|
||||
:type iz: integer
|
||||
|
||||
.. method:: setUniform4f(name, fx, fy, fz, fw)
|
||||
|
||||
Set a uniform with 4 float values.
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg fx: first float value
|
||||
:type fx: float
|
||||
:arg fy: second float value
|
||||
:type fy: float
|
||||
:arg fz: third float value
|
||||
:type fz: float
|
||||
:arg fw: fourth float value
|
||||
:type fw: float
|
||||
|
||||
.. method:: setUniform4i(name, ix, iy, iz, iw)
|
||||
|
||||
Set a uniform with 4 integer values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg ix: first integer value
|
||||
:type ix: integer
|
||||
:arg iy: second integer value
|
||||
:type iy: integer
|
||||
:arg iz: third integer value
|
||||
:type iz: integer
|
||||
:arg iw: fourth integer value
|
||||
:type iw: integer
|
||||
|
||||
.. method:: setUniformDef(name, type)
|
||||
|
||||
Define a new uniform
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg type: uniform type
|
||||
:type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
|
||||
|
||||
.. method:: setUniformMatrix3(name, mat, transpose)
|
||||
|
||||
Set a uniform with a 3x3 matrix value
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
|
||||
:type mat: 3x3 matrix
|
||||
:arg transpose: set to True to transpose the matrix
|
||||
:type transpose: boolean
|
||||
|
||||
.. method:: setUniformMatrix4(name, mat, transpose)
|
||||
|
||||
Set a uniform with a 4x4 matrix value
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
|
||||
:type mat: 4x4 matrix
|
||||
:arg transpose: set to True to transpose the matrix
|
||||
:type transpose: boolean
|
||||
|
||||
.. method:: setUniformiv(name, iList)
|
||||
|
||||
Set a uniform with a list of integer values
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
:arg iList: a list (2, 3 or 4 elements) of integer values
|
||||
:type iList: list[integer]
|
||||
|
||||
.. method:: setUniformEyef(name)
|
||||
|
||||
Set a uniform with a float value that reflects the eye being render in stereo mode:
|
||||
0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform
|
||||
is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures
|
||||
containing the left and right eye images in a top-bottom order.
|
||||
|
||||
:arg name: the uniform name
|
||||
:type name: string
|
||||
|
||||
.. method:: validate()
|
||||
|
||||
Validate the shader object.
|
@@ -0,0 +1,68 @@
|
||||
BL_ShapeActionActuator(SCA_IActuator)
|
||||
=====================================
|
||||
|
||||
base class --- :class:`SCA_IActuator`
|
||||
|
||||
.. class:: BL_ShapeActionActuator(SCA_IActuator)
|
||||
|
||||
ShapeAction Actuators apply an shape action to an mesh object.
|
||||
|
||||
.. attribute:: action
|
||||
|
||||
The name of the action to set as the current shape action.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: frameStart
|
||||
|
||||
Specifies the starting frame of the shape animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: frameEnd
|
||||
|
||||
Specifies the ending frame of the shape animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: blendIn
|
||||
|
||||
Specifies the number of frames of animation to generate when making transitions between actions.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: priority
|
||||
|
||||
Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: frame
|
||||
|
||||
Sets the current frame for the animation.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: propName
|
||||
|
||||
Sets the property to be used in FromProp playback mode.
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: blendTime
|
||||
|
||||
Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: mode
|
||||
|
||||
The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
|
||||
|
||||
:type: integer
|
||||
|
||||
.. attribute:: framePropName
|
||||
|
||||
The name of the property that is set to the current frame number.
|
||||
|
||||
:type: string
|
69
doc/python_api/rst/bge_types/bge.types.CListValue.rst
Normal file
69
doc/python_api/rst/bge_types/bge.types.CListValue.rst
Normal file
@@ -0,0 +1,69 @@
|
||||
CListValue(CPropValue)
|
||||
======================
|
||||
|
||||
base class --- :class:`CPropValue`
|
||||
|
||||
.. class:: CListValue(CPropValue)
|
||||
|
||||
This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
|
||||
|
||||
As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
|
||||
|
||||
Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
|
||||
|
||||
.. method:: append(val)
|
||||
|
||||
Add an item to the list (like pythons append)
|
||||
|
||||
.. warning::
|
||||
|
||||
Appending values to the list can cause crashes when the list is used internally by the game engine.
|
||||
|
||||
.. method:: count(val)
|
||||
|
||||
Count the number of instances of a value in the list.
|
||||
|
||||
:return: number of instances
|
||||
:rtype: integer
|
||||
|
||||
.. method:: index(val)
|
||||
|
||||
Return the index of a value in the list.
|
||||
|
||||
:return: The index of the value in the list.
|
||||
:rtype: integer
|
||||
|
||||
.. method:: reverse()
|
||||
|
||||
Reverse the order of the list.
|
||||
|
||||
.. method:: get(key, default=None)
|
||||
|
||||
Return the value matching key, or the default value if its not found.
|
||||
|
||||
:return: The key value or a default.
|
||||
|
||||
.. method:: from_id(id)
|
||||
|
||||
This is a funtion especially for the game engine to return a value with a spesific id.
|
||||
|
||||
Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
myObID=id(gameObject)
|
||||
ob= scene.objects.from_id(myObID)
|
||||
|
||||
Where ``myObID`` is an int or long from the id function.
|
||||
|
||||
This has the advantage that you can store the id in places you could not store a gameObject.
|
||||
|
||||
.. warning::
|
||||
|
||||
The id is derived from a memory location and will be different each time the game engine starts.
|
||||
|
||||
.. warning::
|
||||
|
||||
The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups.
|
8
doc/python_api/rst/bge_types/bge.types.CPropValue.rst
Normal file
8
doc/python_api/rst/bge_types/bge.types.CPropValue.rst
Normal file
@@ -0,0 +1,8 @@
|
||||
CPropValue(CValue)
|
||||
==================
|
||||
|
||||
base class --- :class:`CValue`
|
||||
|
||||
.. class:: CPropValue(CValue)
|
||||
|
||||
This class has no python functions
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user