Compare commits
555 Commits
temp-keyma
...
ui_layout_
Author | SHA1 | Date | |
---|---|---|---|
8ae25e307e | |||
ec8a20fec0 | |||
5159ce640f | |||
4319e9499e | |||
5979ea96a5 | |||
2b83d81f68 | |||
70f8eaf1b7 | |||
638de72277 | |||
2ca8230f67 | |||
fb565ddb68 | |||
56a47e58f4 | |||
09ce794dc8 | |||
8f40af6dcd | |||
964c5421df | |||
9bcced83ee | |||
3bbef95747 | |||
337aab59e9 | |||
a1b42b79b3 | |||
7ce81484f8 | |||
6f4c7f1f01 | |||
b492a0e767 | |||
f3427cbc98 | |||
03f0ecca93 | |||
86660aa294 | |||
dd2e187344 | |||
528dc6440b | |||
5165d62931 | |||
d1ab958fd4 | |||
4f2eac3b39 | |||
bf77efb684 | |||
1857823839 | |||
2dc7555522 | |||
![]() |
f8d7df6f16 | ||
f2fd5987d0 | |||
3e86bb2d0b | |||
1ce55693f5 | |||
![]() |
9d59d20957 | ||
0417f205f5 | |||
![]() |
f638ad61b8 | ||
![]() |
856a79e1fb | ||
cbbf8bbbb4 | |||
![]() |
fc85096dc8 | ||
4df45e18dc | |||
249a41bc7c | |||
ba31c4d684 | |||
2a771cbc58 | |||
335e030753 | |||
934b9e80d0 | |||
06357b23a2 | |||
9f2447cbd8 | |||
70b3fb3781 | |||
6739bb195e | |||
540e85d567 | |||
0dd9a9e66a | |||
f504306671 | |||
97e7d9f90b | |||
d97df0d0e6 | |||
4127aeb7a5 | |||
e36ecb8a66 | |||
94aa4d1657 | |||
ae3e59fb61 | |||
aff6cc9cf1 | |||
fb1915d870 | |||
33437719c1 | |||
0c7fc3a961 | |||
7b6af843c2 | |||
c5904574cb | |||
3926ec6aa1 | |||
1f1e26f1ab | |||
d38c7db5e1 | |||
4017b48331 | |||
378e42e119 | |||
9600c7cb05 | |||
691282e571 | |||
55606dbdbc | |||
346a1d445e | |||
0297274720 | |||
dff8a7db73 | |||
b3c8ffcb3e | |||
4d16d00154 | |||
3d681108bf | |||
20367898fe | |||
e3fe8ce00b | |||
908b6960c0 | |||
a25c11fd8d | |||
d352a0adc5 | |||
009c38df53 | |||
8b5ce6e843 | |||
30cd35a37b | |||
cfc4805455 | |||
8f49299134 | |||
cfc1ddeff7 | |||
![]() |
18e316bcb9 | ||
![]() |
57da454872 | ||
![]() |
1962ae69b1 | ||
![]() |
56f2293a51 | ||
![]() |
e5bc37eb5e | ||
![]() |
d17094b256 | ||
![]() |
85e2871382 | ||
d32b59fc18 | |||
630019d5f8 | |||
28817c82f1 | |||
9a873d0ab2 | |||
5852c66125 | |||
20d3ce57d0 | |||
ef7b7efd11 | |||
3b556a477d | |||
5593baea1b | |||
0859492c75 | |||
a3773dcc4f | |||
80dcb2ced8 | |||
00233f5f78 | |||
f9ca750bdf | |||
3823287179 | |||
d274c64d22 | |||
8dc33a81b0 | |||
df4525d1d9 | |||
f0815b1322 | |||
863e395ad8 | |||
fcc5d7c29e | |||
64e0ab6a00 | |||
86aaa3efba | |||
e19686a35a | |||
819ad49d29 | |||
1e4722eeab | |||
8a2db3ed21 | |||
d9d3e7778c | |||
a3f520170c | |||
6242940639 | |||
a16d835f7b | |||
8366c3ecd8 | |||
30ec94561c | |||
da8d33e2e3 | |||
5330f1c5d1 | |||
c63f804222 | |||
508e34d0bf | |||
4e014727f6 | |||
![]() |
3126f85d26 | ||
b3a7a75a26 | |||
d1474371fa | |||
a867e63dd6 | |||
cdbda1c3d8 | |||
366ac88d68 | |||
16017178b2 | |||
a54235e0c6 | |||
613faa0987 | |||
72cfd5134b | |||
1aa89d9a1c | |||
df0253be33 | |||
54f9cd5283 | |||
e27759152a | |||
e43065596b | |||
d88314ee5b | |||
5b0f96f97c | |||
f447411a82 | |||
7fb216d800 | |||
2d2f23de10 | |||
a60d4f33c6 | |||
409cfba1a3 | |||
ba80d8440f | |||
1c4b04f1fd | |||
0e68751b8a | |||
70b705b5fe | |||
4165a57a66 | |||
![]() |
f818ff411a | ||
![]() |
04dfca5b9d | ||
![]() |
4e213d4216 | ||
![]() |
9a0506ea18 | ||
36000e6da3 | |||
c44acc7fb8 | |||
0ee4785675 | |||
bb7202495a | |||
19d651ca9a | |||
d706101559 | |||
bb09556be5 | |||
f55f418867 | |||
f884ba02a2 | |||
de702a4803 | |||
48e871ab1d | |||
fcf720a135 | |||
89042f576e | |||
7fee5f5643 | |||
f1fd5ed74f | |||
4a52531a11 | |||
4c4fa3d49b | |||
3b8ae85e3d | |||
a8ae68aa5c | |||
2088bb0d49 | |||
b58e5d4f2c | |||
1295e85de0 | |||
528cdf9b50 | |||
e3324c3a8e | |||
22370929fe | |||
7810c60fe3 | |||
695747aad1 | |||
5a14af62d0 | |||
82ec06cbfa | |||
ca7de1ff22 | |||
1a0cb28ae2 | |||
180e8f8bfb | |||
9f255db4fe | |||
7a76223f1f | |||
8a0e6a3143 | |||
5e180ebffc | |||
c4ce4034e6 | |||
3e87c039ba | |||
1d86bdf16b | |||
03b8e4f608 | |||
23db3a5ade | |||
783d31c3a3 | |||
abccde4d68 | |||
5f543915e8 | |||
274453ef73 | |||
a9f9236670 | |||
bfbd85e9d6 | |||
ab375079df | |||
6ff89166a8 | |||
52502ad0a4 | |||
14251d4615 | |||
1889eec918 | |||
c1a880bc5e | |||
3c9e2e82fa | |||
851829c1fb | |||
e394a78b4c | |||
d5ce40a5ed | |||
713027b832 | |||
983811607d | |||
cd58ce85c2 | |||
5e44324b79 | |||
7ff07ddd01 | |||
1628a6858e | |||
f0d9dbae0d | |||
ce6db959c7 | |||
a9ed50514c | |||
7436fb2ef1 | |||
481cdb08ed | |||
1d97e948d2 | |||
c68429bc03 | |||
d94df18550 | |||
7a612c3799 | |||
60aee3943f | |||
d860d23e1a | |||
2cc6e06bdb | |||
b6d920bbd5 | |||
2891fb645b | |||
24bd483ee1 | |||
09f780c1b0 | |||
6d7327f607 | |||
0d47a4d2fe | |||
df1d319a79 | |||
856d36e4b8 | |||
cb42ad8c75 | |||
cd8613c6e7 | |||
342dd5a771 | |||
a3815f8777 | |||
ade710500d | |||
f1a3b68e76 | |||
b9db470636 | |||
0be9d8db65 | |||
99dd3b0156 | |||
5d628c519b | |||
0941b8b672 | |||
83db7a0070 | |||
1df228a416 | |||
80d86f303a | |||
88b46a6ce9 | |||
![]() |
17e9870221 | ||
6fee105943 | |||
da53c3f020 | |||
58e8c71cbd | |||
f6740993f7 | |||
c8af234f85 | |||
84becb870f | |||
747534af00 | |||
![]() |
2b4d2de253 | ||
ce5e9b599c | |||
784a3ccf79 | |||
101c277e3d | |||
349d416949 | |||
18e8350cd1 | |||
bda0175984 | |||
570804882d | |||
4b5670ac11 | |||
3b4c7a8c9b | |||
0e8edbbc01 | |||
2b22a61152 | |||
52f9023fbf | |||
07f0046203 | |||
1dc31f5b98 | |||
e47e60a9b9 | |||
736a84ec66 | |||
![]() |
acb5bbf9b2 | ||
a46ced5076 | |||
f430f14df4 | |||
7277f8973b | |||
c2ff37455e | |||
95011f6d48 | |||
44505b38df | |||
0911acb5cf | |||
6654e109df | |||
5b64301834 | |||
2d3d76693a | |||
7719c11006 | |||
854db8951b | |||
ba65f7093b | |||
f6743fcaa4 | |||
d7c2b78822 | |||
9b01e7bc27 | |||
d3fe033875 | |||
81dbf08eb4 | |||
38eb91c848 | |||
25ff7a4f2a | |||
06dd89b0ca | |||
beca377c27 | |||
e657a4af13 | |||
4c4eb1ce20 | |||
d0f7ab27a8 | |||
335b193336 | |||
778a19a13a | |||
32c5972653 | |||
38bf3b8d23 | |||
6221180963 | |||
18a4553838 | |||
815b1f24fa | |||
04d9316cf3 | |||
c55e90da4c | |||
2ef695fabf | |||
6c6c4da718 | |||
bc6358a580 | |||
f25e459f8f | |||
98e4d548a1 | |||
119423b252 | |||
8ace49dedc | |||
1de73fc6c3 | |||
08a2c5f224 | |||
4430bd3644 | |||
![]() |
0736460dfb | ||
![]() |
fec317de8d | ||
53c9fbef60 | |||
6de656b4f2 | |||
58efa7d686 | |||
0de0cee9a2 | |||
9cd2e4fa3f | |||
b608133075 | |||
a08a8aa928 | |||
c140f11946 | |||
![]() |
bb8770b976 | ||
8433ed76b2 | |||
d18cd768bb | |||
bfe1d0e0dc | |||
75fc1c3507 | |||
297bf7235b | |||
c0dd355926 | |||
4fccb8a023 | |||
e44743736f | |||
e4a727626e | |||
56dc2bf0c5 | |||
9e09900a30 | |||
![]() |
15e5dbc2c3 | ||
0706b410bd | |||
eef18d39cb | |||
051e186d5c | |||
b3be71e07a | |||
72a360827b | |||
44a8070db3 | |||
06c4106d03 | |||
75b2729488 | |||
50afc430fd | |||
![]() |
27881e9948 | ||
13ca63d2ad | |||
3b05034935 | |||
ddf2a58282 | |||
82b8fd8eaf | |||
32c12d057f | |||
be8016908d | |||
4faf9bfbe9 | |||
b85d5b6d52 | |||
83a41ccd0a | |||
cfdadc7d61 | |||
4eb47c303d | |||
0c18024a8d | |||
c771bbc27e | |||
01c75c3765 | |||
719e782f2c | |||
bcbee4b9a3 | |||
1bc801e020 | |||
14c55a5828 | |||
![]() |
e35dab0fec | ||
0bddf5315f | |||
8f24d404fe | |||
e614a8290c | |||
e8142ad7dc | |||
4683091369 | |||
d5a359b1d4 | |||
c450966e95 | |||
3b2d3a3cd1 | |||
7bdc67f5f3 | |||
fe09aa602a | |||
c338ac9454 | |||
3cefb27830 | |||
266fc1c1ff | |||
5736157b5e | |||
a6395cebb7 | |||
c87cfcc8de | |||
63785a889c | |||
35efa1d3d3 | |||
![]() |
a63b55f642 | ||
![]() |
a4bb1a5881 | ||
995fa1f4c0 | |||
14dee6d7a5 | |||
7c75c2db4f | |||
![]() |
e51cbce646 | ||
bf4ce5755f | |||
712885c30e | |||
f43e3d0b6b | |||
494470ba23 | |||
8789490f96 | |||
71c904433c | |||
2feed9bdef | |||
f71efafe8f | |||
cfea9c261c | |||
df22cd9ce1 | |||
3352dd3a3f | |||
126e6c8e1d | |||
59a516913e | |||
b5b1f9d11c | |||
7a4b0ff358 | |||
d4daf9c00d | |||
cd702db338 | |||
48ea2131aa | |||
cb614107d3 | |||
5a82aee9e6 | |||
8d53e8cd02 | |||
da11e33b26 | |||
361b3eb88e | |||
eb1feb9f4a | |||
0b396bc15b | |||
16100f8261 | |||
b809340960 | |||
b53d358261 | |||
3248ac5e83 | |||
![]() |
25e5ec245c | ||
![]() |
d0af8edcd1 | ||
![]() |
eaad4caa56 | ||
54e92bbd29 | |||
4e96bff938 | |||
f56a9fbad5 | |||
9b4e56c091 | |||
d41bf6b8e8 | |||
46508430f8 | |||
28369f725c | |||
23e375a281 | |||
24b03729ae | |||
9948e26e14 | |||
1e6108e972 | |||
46cfa605c3 | |||
17f458ff32 | |||
24d1829243 | |||
fcfe1963a6 | |||
5cbad89637 | |||
12ab59a2d6 | |||
84a9647f22 | |||
d9324b61d5 | |||
e4afccf388 | |||
e910765ad0 | |||
81bf9a41e1 | |||
![]() |
6c0705009e | ||
fbd614f1fa | |||
16d3f4db4c | |||
264a4a8f97 | |||
84e5c981dc | |||
f5f25b843e | |||
eb0fcd4574 | |||
1f693aefca | |||
61fc9fcffa | |||
0b6603d9b6 | |||
c0f42a7526 | |||
c86437cc83 | |||
cce16df10f | |||
17ce968c59 | |||
08862b8246 | |||
85ce4d957c | |||
9fabe3ef53 | |||
efd0333a9c | |||
1272936773 | |||
7661f8a65b | |||
41fac4fa76 | |||
25d4d43491 | |||
cdfa517760 | |||
23b455a891 | |||
92e3b3839b | |||
10a2562bc5 | |||
f1f1c32849 | |||
![]() |
5b8fe8324b | ||
38957c1838 | |||
5954a5c465 | |||
375c1eab65 | |||
d0d2fc9819 | |||
30fb455977 | |||
35a6d9ec55 | |||
acaf46db0e | |||
29f9a19708 | |||
da16cb1511 | |||
f03953ae06 | |||
ccb7f1d4f1 | |||
26f42a1928 | |||
5c17dbd991 | |||
8ed723745e | |||
292125bfd3 | |||
9c2db1455f | |||
eb24c9a1e1 | |||
03ec3a6141 | |||
48ceeead10 | |||
10c0bba28e | |||
7e8fd563c6 | |||
93de6ca2db | |||
0488b728eb | |||
10f6450ef2 | |||
501c0b1df8 | |||
328f8dc21c | |||
2faef3473c | |||
e0e3038b1e | |||
ec6da3d72e | |||
201952aed2 | |||
3bc0cb08b8 | |||
7b9a0ed8c4 | |||
08d325805f | |||
72f4ac99c7 | |||
e55c1a9b5a | |||
edc1e65809 | |||
6afa0a7a50 | |||
9abbf73d3f | |||
a01244cade | |||
47a8d3b880 | |||
e054b7f251 | |||
01f9e13c30 | |||
d709705203 | |||
301a27187c | |||
b54cc68365 | |||
0ed2e254bb | |||
cb22caa8c7 | |||
18c12803bd | |||
0e0502cbdf | |||
2c03d6a12b | |||
9992079d59 | |||
36e6d44c90 | |||
00dc1c08aa | |||
f8908f0d43 | |||
e9cd2fb23b | |||
341dbce1b7 | |||
c1db8d6983 | |||
ffb515410c | |||
658a7cb46f | |||
51be9ff07a | |||
2de27897f3 |
@@ -523,9 +523,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fsanitize=enum \
|
||||
-fsanitize=float-cast-overflow \
|
||||
-fsanitize=float-divide-by-zero \
|
||||
-fsanitize=leak \
|
||||
-fsanitize=nonnull-attribute \
|
||||
-fsanitize=object-size \
|
||||
-fsanitize=returns-nonnull-attribute \
|
||||
-fsanitize=signed-integer-overflow \
|
||||
-fsanitize=undefined \
|
||||
@@ -533,6 +531,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-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")
|
||||
@@ -540,9 +541,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
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()
|
||||
|
||||
@@ -810,14 +817,20 @@ set(PLATFORM_LINKLIBS "")
|
||||
set(PLATFORM_LINKFLAGS "")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||
|
||||
if(WITH_COMPILER_ASAN)
|
||||
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}")
|
||||
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}")
|
||||
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()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@@ -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)
|
||||
|
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,8 +10,8 @@ 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} )
|
||||
--- a/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
|
||||
+++ b/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
|
||||
--- 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 --
|
||||
|
@@ -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
|
||||
)
|
||||
)
|
||||
|
@@ -32,6 +32,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||
${EXTRA_LIBS}
|
||||
${PLATFORM_LINKLIBS}
|
||||
bf_testing_main
|
||||
bf_intern_eigen
|
||||
bf_intern_guardedalloc
|
||||
extern_gtest
|
||||
extern_gmock
|
||||
|
@@ -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
|
||||
)
|
||||
|
@@ -31,7 +31,8 @@ endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(MSVC_CLANG On)
|
||||
set(MSVC_REDIST_DIR $ENV{VCToolsRedistDir})
|
||||
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()
|
||||
@@ -149,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.
|
||||
@@ -162,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)
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS%
|
||||
|
||||
if "%BUILD_ARCH%"=="x64" (
|
||||
set MSBUILD_PLATFORM=x64
|
||||
) else if "%BUILD_ARCH%"=="x86" (
|
||||
@@ -11,8 +9,17 @@ if "%BUILD_ARCH%"=="x64" (
|
||||
)
|
||||
|
||||
if "%WITH_CLANG%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
|
||||
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%
|
||||
|
@@ -1,3 +1,9 @@
|
||||
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" (
|
||||
@@ -27,6 +33,16 @@ set LLVM_DIR=
|
||||
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%" == "" (
|
||||
|
@@ -12,6 +12,11 @@ if not exist "%vs_where%" (
|
||||
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
|
||||
)
|
||||
|
@@ -42,6 +42,8 @@ if NOT "%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" (
|
||||
@@ -51,6 +53,10 @@ if NOT "%1" == "" (
|
||||
) else if "%1" == "2017pre" (
|
||||
set BUILD_VS_YEAR=2017
|
||||
set VSWHERE_ARGS=-prerelease
|
||||
set BUILD_VS_YEAR=2017
|
||||
) else if "%1" == "2017b" (
|
||||
set BUILD_VS_YEAR=2017
|
||||
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
||||
) else if "%1" == "2015" (
|
||||
set BUILD_VS_YEAR=2015
|
||||
) else if "%1" == "2013" (
|
||||
|
@@ -22,3 +22,6 @@ 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=
|
||||
|
@@ -23,7 +23,13 @@ echo - buildir [newdir] ^(override default build folder^)
|
||||
echo - x86 ^(override host auto-detect and build 32 bit code^)
|
||||
echo - x64 ^(override host auto-detect and build 64 bit code^)
|
||||
echo - 2013 ^(build with visual studio 2013^)
|
||||
echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL]
|
||||
echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL]
|
||||
echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL]
|
||||
echo.
|
||||
echo Experimental options
|
||||
echo - 2015 ^(build with visual studio 2015^)
|
||||
echo - 2017 ^(build with visual studio 2017^)
|
||||
echo - 2017pre ^(build with visual studio 2017 pre-release^)
|
||||
echo - 2017b ^(build with visual studio 2017 Build Tools^)
|
||||
echo - clang ^(enable building with clang^)
|
||||
echo - asan ^(enable asan when building with clang^)
|
||||
echo - ninja ^(enable building with ninja instead of msbuild^)
|
||||
echo.
|
||||
|
2
extern/audaspace/plugins/ffmpeg/FFMPEG.cpp
vendored
@@ -23,7 +23,9 @@ AUD_NAMESPACE_BEGIN
|
||||
|
||||
FFMPEG::FFMPEG()
|
||||
{
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
||||
av_register_all();
|
||||
#endif
|
||||
}
|
||||
|
||||
void FFMPEG::registerPlugin()
|
||||
|
124
extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
vendored
@@ -22,37 +22,37 @@
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avio.h>
|
||||
#include <libavutil/avutil.h>
|
||||
}
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
||||
#define FFMPEG_OLD_CODE
|
||||
#endif
|
||||
|
||||
int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
||||
{
|
||||
AVFrame* frame = nullptr;
|
||||
int buf_size = buffer.getSize();
|
||||
int buf_pos = 0;
|
||||
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
int got_frame;
|
||||
int read_length;
|
||||
uint8_t* orig_data = packet.data;
|
||||
int orig_size = packet.size;
|
||||
|
||||
int buf_size = buffer.getSize();
|
||||
int buf_pos = 0;
|
||||
|
||||
while(packet.size > 0)
|
||||
{
|
||||
got_frame = 0;
|
||||
|
||||
if(!frame)
|
||||
frame = av_frame_alloc();
|
||||
else
|
||||
av_frame_unref(frame);
|
||||
|
||||
read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
|
||||
read_length = avcodec_decode_audio4(m_codecCtx, m_frame, &got_frame, &packet);
|
||||
if(read_length < 0)
|
||||
break;
|
||||
|
||||
if(got_frame)
|
||||
{
|
||||
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
||||
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
||||
|
||||
if(buf_size - buf_pos < data_size)
|
||||
{
|
||||
@@ -62,18 +62,18 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
||||
|
||||
if(m_tointerleave)
|
||||
{
|
||||
int single_size = data_size / m_codecCtx->channels / frame->nb_samples;
|
||||
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
|
||||
for(int channel = 0; channel < m_codecCtx->channels; channel++)
|
||||
{
|
||||
for(int i = 0; i < frame->nb_samples; i++)
|
||||
for(int i = 0; i < m_frame->nb_samples; i++)
|
||||
{
|
||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
|
||||
frame->data[channel] + i * single_size, single_size);
|
||||
m_frame->data[channel] + i * single_size, single_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, frame->data[0], data_size);
|
||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
|
||||
|
||||
buf_pos += data_size;
|
||||
}
|
||||
@@ -83,7 +83,42 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
|
||||
|
||||
packet.data = orig_data;
|
||||
packet.size = orig_size;
|
||||
av_free(frame);
|
||||
#else
|
||||
avcodec_send_packet(m_codecCtx, &packet);
|
||||
|
||||
while(true)
|
||||
{
|
||||
auto ret = avcodec_receive_frame(m_codecCtx, m_frame);
|
||||
|
||||
if(ret != 0)
|
||||
break;
|
||||
|
||||
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
|
||||
|
||||
if(buf_size - buf_pos < data_size)
|
||||
{
|
||||
buffer.resize(buf_size + data_size, true);
|
||||
buf_size += data_size;
|
||||
}
|
||||
|
||||
if(m_tointerleave)
|
||||
{
|
||||
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
|
||||
for(int channel = 0; channel < m_codecCtx->channels; channel++)
|
||||
{
|
||||
for(int i = 0; i < m_frame->nb_samples; i++)
|
||||
{
|
||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
|
||||
m_frame->data[channel] + i * single_size, single_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
|
||||
|
||||
buf_pos += data_size;
|
||||
}
|
||||
#endif
|
||||
|
||||
return buf_pos;
|
||||
}
|
||||
@@ -101,7 +136,11 @@ void FFMPEGReader::init()
|
||||
|
||||
for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
|
||||
{
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
#else
|
||||
if((m_formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
#endif
|
||||
&& (m_stream < 0))
|
||||
{
|
||||
m_stream=i;
|
||||
@@ -112,12 +151,34 @@ void FFMPEGReader::init()
|
||||
if(m_stream == -1)
|
||||
AUD_THROW(FileException, "File couldn't be read, no audio stream found by ffmpeg.");
|
||||
|
||||
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
|
||||
|
||||
// get a decoder and open it
|
||||
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
|
||||
#ifndef FFMPEG_OLD_CODE
|
||||
AVCodec* aCodec = avcodec_find_decoder(m_formatCtx->streams[m_stream]->codecpar->codec_id);
|
||||
|
||||
if(!aCodec)
|
||||
AUD_THROW(FileException, "File couldn't be read, no decoder found with ffmpeg.");
|
||||
#endif
|
||||
|
||||
m_frame = av_frame_alloc();
|
||||
|
||||
if(!m_frame)
|
||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg frame couldn't be allocated.");
|
||||
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
|
||||
|
||||
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
|
||||
#else
|
||||
m_codecCtx = avcodec_alloc_context3(aCodec);
|
||||
#endif
|
||||
|
||||
if(!m_codecCtx)
|
||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg context couldn't be allocated.");
|
||||
|
||||
#ifndef FFMPEG_OLD_CODE
|
||||
if(avcodec_parameters_to_context(m_codecCtx, m_formatCtx->streams[m_stream]->codecpar) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg decoder parameters couldn't be copied to decoder context.");
|
||||
#endif
|
||||
|
||||
if(avcodec_open2(m_codecCtx, aCodec, nullptr) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be read, ffmpeg codec couldn't be opened.");
|
||||
@@ -157,6 +218,8 @@ void FFMPEGReader::init()
|
||||
FFMPEGReader::FFMPEGReader(std::string filename) :
|
||||
m_pkgbuf(),
|
||||
m_formatCtx(nullptr),
|
||||
m_codecCtx(nullptr),
|
||||
m_frame(nullptr),
|
||||
m_aviocontext(nullptr),
|
||||
m_membuf(nullptr)
|
||||
{
|
||||
@@ -177,12 +240,14 @@ FFMPEGReader::FFMPEGReader(std::string filename) :
|
||||
|
||||
FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
|
||||
m_pkgbuf(),
|
||||
m_codecCtx(nullptr),
|
||||
m_frame(nullptr),
|
||||
m_membuffer(buffer),
|
||||
m_membufferpos(0)
|
||||
{
|
||||
m_membuf = reinterpret_cast<data_t*>(av_malloc(FF_MIN_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE));
|
||||
m_membuf = reinterpret_cast<data_t*>(av_malloc(AV_INPUT_BUFFER_MIN_SIZE + AV_INPUT_BUFFER_PADDING_SIZE));
|
||||
|
||||
m_aviocontext = avio_alloc_context(m_membuf, FF_MIN_BUFFER_SIZE, 0, this, read_packet, nullptr, seek_packet);
|
||||
m_aviocontext = avio_alloc_context(m_membuf, AV_INPUT_BUFFER_MIN_SIZE, 0, this, read_packet, nullptr, seek_packet);
|
||||
|
||||
if(!m_aviocontext)
|
||||
{
|
||||
@@ -212,7 +277,14 @@ FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
|
||||
|
||||
FFMPEGReader::~FFMPEGReader()
|
||||
{
|
||||
if(m_frame)
|
||||
av_frame_free(&m_frame);
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
avcodec_close(m_codecCtx);
|
||||
#else
|
||||
if(m_codecCtx)
|
||||
avcodec_free_context(&m_codecCtx);
|
||||
#endif
|
||||
avformat_close_input(&m_formatCtx);
|
||||
}
|
||||
|
||||
@@ -312,7 +384,7 @@ void FFMPEGReader::seek(int position)
|
||||
}
|
||||
}
|
||||
}
|
||||
av_free_packet(&packet);
|
||||
av_packet_unref(&packet);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -343,7 +415,7 @@ Specs FFMPEGReader::getSpecs() const
|
||||
void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
{
|
||||
// read packages and decode them
|
||||
AVPacket packet;
|
||||
AVPacket packet = {};
|
||||
int data_size = 0;
|
||||
int pkgbuf_pos;
|
||||
int left = length;
|
||||
@@ -359,7 +431,7 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
data_size = std::min(pkgbuf_pos, left * sample_size);
|
||||
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
||||
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
||||
left -= data_size/sample_size;
|
||||
left -= data_size / sample_size;
|
||||
}
|
||||
|
||||
// for each frame read as long as there isn't enough data already
|
||||
@@ -375,9 +447,9 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
data_size = std::min(pkgbuf_pos, left * sample_size);
|
||||
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
|
||||
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
|
||||
left -= data_size/sample_size;
|
||||
left -= data_size / sample_size;
|
||||
}
|
||||
av_free_packet(&packet);
|
||||
av_packet_unref(&packet);
|
||||
}
|
||||
// read more data than necessary?
|
||||
if(pkgbuf_pos > data_size)
|
||||
|
@@ -79,6 +79,11 @@ private:
|
||||
*/
|
||||
AVCodecContext* m_codecCtx;
|
||||
|
||||
/**
|
||||
* The AVFrame structure for using ffmpeg.
|
||||
*/
|
||||
AVFrame* m_frame;
|
||||
|
||||
/**
|
||||
* The AVIOContext to read the data from.
|
||||
*/
|
||||
|
218
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
vendored
@@ -27,6 +27,10 @@ extern "C" {
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 58
|
||||
#define FFMPEG_OLD_CODE
|
||||
#endif
|
||||
|
||||
void FFMPEGWriter::encode()
|
||||
{
|
||||
sample_t* data = m_input_buffer.getBuffer();
|
||||
@@ -58,82 +62,106 @@ void FFMPEGWriter::encode()
|
||||
if(m_input_size)
|
||||
m_convert(reinterpret_cast<data_t*>(data), reinterpret_cast<data_t*>(data), m_input_samples * m_specs.channels);
|
||||
|
||||
AVPacket packet;
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
m_packet->data = nullptr;
|
||||
m_packet->size = 0;
|
||||
|
||||
packet.data = nullptr;
|
||||
packet.size = 0;
|
||||
av_init_packet(m_packet);
|
||||
|
||||
av_init_packet(&packet);
|
||||
|
||||
AVFrame* frame = av_frame_alloc();
|
||||
av_frame_unref(frame);
|
||||
av_frame_unref(m_frame);
|
||||
int got_packet;
|
||||
#endif
|
||||
|
||||
frame->nb_samples = m_input_samples;
|
||||
frame->format = m_codecCtx->sample_fmt;
|
||||
frame->channel_layout = m_codecCtx->channel_layout;
|
||||
m_frame->nb_samples = m_input_samples;
|
||||
m_frame->format = m_codecCtx->sample_fmt;
|
||||
m_frame->channel_layout = m_codecCtx->channel_layout;
|
||||
|
||||
if(avcodec_fill_audio_frame(frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
|
||||
if(avcodec_fill_audio_frame(m_frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg.");
|
||||
|
||||
AVRational sample_time = { 1, static_cast<int>(m_specs.rate) };
|
||||
frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
|
||||
m_frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
|
||||
|
||||
if(avcodec_encode_audio2(m_codecCtx, &packet, frame, &got_packet))
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
if(avcodec_encode_audio2(m_codecCtx, m_packet, m_frame, &got_packet))
|
||||
{
|
||||
av_frame_free(&frame);
|
||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
||||
}
|
||||
|
||||
if(got_packet)
|
||||
{
|
||||
packet.flags |= AV_PKT_FLAG_KEY;
|
||||
packet.stream_index = m_stream->index;
|
||||
if(av_write_frame(m_formatCtx, &packet) < 0)
|
||||
m_packet->flags |= AV_PKT_FLAG_KEY;
|
||||
m_packet->stream_index = m_stream->index;
|
||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
||||
{
|
||||
av_free_packet(&packet);
|
||||
av_frame_free(&frame);
|
||||
av_free_packet(m_packet);
|
||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
||||
}
|
||||
av_free_packet(&packet);
|
||||
av_free_packet(m_packet);
|
||||
}
|
||||
#else
|
||||
if(avcodec_send_frame(m_codecCtx, m_frame) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
||||
|
||||
av_frame_free(&frame);
|
||||
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
|
||||
{
|
||||
m_packet->stream_index = m_stream->index;
|
||||
|
||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void FFMPEGWriter::close()
|
||||
{
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
int got_packet = true;
|
||||
|
||||
while(got_packet)
|
||||
{
|
||||
AVPacket packet;
|
||||
m_packet->data = nullptr;
|
||||
m_packet->size = 0;
|
||||
|
||||
packet.data = nullptr;
|
||||
packet.size = 0;
|
||||
av_init_packet(m_packet);
|
||||
|
||||
av_init_packet(&packet);
|
||||
|
||||
if(avcodec_encode_audio2(m_codecCtx, &packet, nullptr, &got_packet))
|
||||
if(avcodec_encode_audio2(m_codecCtx, m_packet, nullptr, &got_packet))
|
||||
AUD_THROW(FileException, "File end couldn't be written, audio encoding failed with ffmpeg.");
|
||||
|
||||
if(got_packet)
|
||||
{
|
||||
packet.flags |= AV_PKT_FLAG_KEY;
|
||||
packet.stream_index = m_stream->index;
|
||||
if(av_write_frame(m_formatCtx, &packet))
|
||||
m_packet->flags |= AV_PKT_FLAG_KEY;
|
||||
m_packet->stream_index = m_stream->index;
|
||||
if(av_write_frame(m_formatCtx, m_packet))
|
||||
{
|
||||
av_free_packet(&packet);
|
||||
av_free_packet(m_packet);
|
||||
AUD_THROW(FileException, "Final frames couldn't be writen to the file with ffmpeg.");
|
||||
}
|
||||
av_free_packet(&packet);
|
||||
av_free_packet(m_packet);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(avcodec_send_frame(m_codecCtx, nullptr) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
|
||||
|
||||
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
|
||||
{
|
||||
m_packet->stream_index = m_stream->index;
|
||||
|
||||
if(av_write_frame(m_formatCtx, m_packet) < 0)
|
||||
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate) :
|
||||
m_position(0),
|
||||
m_specs(specs),
|
||||
m_formatCtx(nullptr),
|
||||
m_codecCtx(nullptr),
|
||||
m_stream(nullptr),
|
||||
m_packet(nullptr),
|
||||
m_frame(nullptr),
|
||||
m_input_samples(0),
|
||||
m_deinterleave(false)
|
||||
{
|
||||
@@ -142,75 +170,105 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
if(avformat_alloc_output_context2(&m_formatCtx, nullptr, formats[format], filename.c_str()) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, format couldn't be found with ffmpeg.");
|
||||
|
||||
m_outputFmt = m_formatCtx->oformat;
|
||||
AVOutputFormat* outputFmt = m_formatCtx->oformat;
|
||||
|
||||
if(!m_outputFmt) {
|
||||
if(!outputFmt) {
|
||||
avformat_free_context(m_formatCtx);
|
||||
AUD_THROW(FileException, "File couldn't be written, output format couldn't be found with ffmpeg.");
|
||||
}
|
||||
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
|
||||
switch(codec)
|
||||
{
|
||||
case CODEC_AAC:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_AAC;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_AAC;
|
||||
break;
|
||||
case CODEC_AC3:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_AC3;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_AC3;
|
||||
break;
|
||||
case CODEC_FLAC:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_FLAC;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_FLAC;
|
||||
break;
|
||||
case CODEC_MP2:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_MP2;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_MP2;
|
||||
break;
|
||||
case CODEC_MP3:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_MP3;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_MP3;
|
||||
break;
|
||||
case CODEC_OPUS:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_OPUS;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_OPUS;
|
||||
break;
|
||||
case CODEC_PCM:
|
||||
switch(specs.format)
|
||||
{
|
||||
case FORMAT_U8:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
|
||||
break;
|
||||
case FORMAT_S16:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
|
||||
break;
|
||||
case FORMAT_S24:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
|
||||
break;
|
||||
case FORMAT_S32:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
|
||||
break;
|
||||
case FORMAT_FLOAT32:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
|
||||
break;
|
||||
case FORMAT_FLOAT64:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
|
||||
break;
|
||||
default:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CODEC_VORBIS:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
|
||||
break;
|
||||
default:
|
||||
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
outputFmt->audio_codec = AV_CODEC_ID_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
uint64_t channel_layout = 0;
|
||||
|
||||
switch(m_specs.channels)
|
||||
{
|
||||
case CHANNELS_MONO:
|
||||
channel_layout = AV_CH_LAYOUT_MONO;
|
||||
break;
|
||||
case CHANNELS_STEREO:
|
||||
channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
break;
|
||||
case CHANNELS_STEREO_LFE:
|
||||
channel_layout = AV_CH_LAYOUT_2POINT1;
|
||||
break;
|
||||
case CHANNELS_SURROUND4:
|
||||
channel_layout = AV_CH_LAYOUT_QUAD;
|
||||
break;
|
||||
case CHANNELS_SURROUND5:
|
||||
channel_layout = AV_CH_LAYOUT_5POINT0_BACK;
|
||||
break;
|
||||
case CHANNELS_SURROUND51:
|
||||
channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
|
||||
break;
|
||||
case CHANNELS_SURROUND61:
|
||||
channel_layout = AV_CH_LAYOUT_6POINT1_BACK;
|
||||
break;
|
||||
case CHANNELS_SURROUND71:
|
||||
channel_layout = AV_CH_LAYOUT_7POINT1;
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(m_outputFmt->audio_codec == AV_CODEC_ID_NONE)
|
||||
if(outputFmt->audio_codec == AV_CODEC_ID_NONE)
|
||||
AUD_THROW(FileException, "File couldn't be written, audio codec not found with ffmpeg.");
|
||||
|
||||
AVCodec* codec = avcodec_find_encoder(m_outputFmt->audio_codec);
|
||||
AVCodec* codec = avcodec_find_encoder(outputFmt->audio_codec);
|
||||
if(!codec)
|
||||
AUD_THROW(FileException, "File couldn't be written, audio encoder couldn't be found with ffmpeg.");
|
||||
|
||||
@@ -220,7 +278,14 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
|
||||
m_stream->id = m_formatCtx->nb_streams - 1;
|
||||
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
m_codecCtx = m_stream->codec;
|
||||
#else
|
||||
m_codecCtx = avcodec_alloc_context3(codec);
|
||||
#endif
|
||||
|
||||
if(!m_codecCtx)
|
||||
AUD_THROW(FileException, "File couldn't be written, context creation failed with ffmpeg.");
|
||||
|
||||
switch(m_specs.format)
|
||||
{
|
||||
@@ -247,7 +312,7 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
}
|
||||
|
||||
if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
m_codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
bool format_supported = false;
|
||||
|
||||
@@ -328,9 +393,13 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
|
||||
m_specs.rate = m_codecCtx->sample_rate;
|
||||
|
||||
m_codecCtx->codec_id = m_outputFmt->audio_codec;
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
m_codecCtx->codec_id = outputFmt->audio_codec;
|
||||
#endif
|
||||
|
||||
m_codecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
m_codecCtx->bit_rate = bitrate;
|
||||
m_codecCtx->channel_layout = channel_layout;
|
||||
m_codecCtx->channels = m_specs.channels;
|
||||
m_stream->time_base.num = m_codecCtx->time_base.num = 1;
|
||||
m_stream->time_base.den = m_codecCtx->time_base.den = m_codecCtx->sample_rate;
|
||||
@@ -338,6 +407,11 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
if(avcodec_open2(m_codecCtx, codec, nullptr) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, encoder couldn't be opened with ffmpeg.");
|
||||
|
||||
#ifndef FFMPEG_OLD_CODE
|
||||
if(avcodec_parameters_from_context(m_stream->codecpar, m_codecCtx) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, codec parameters couldn't be copied to the context.");
|
||||
#endif
|
||||
|
||||
int samplesize = std::max(int(AUD_SAMPLE_SIZE(m_specs)), AUD_DEVICE_SAMPLE_SIZE(m_specs));
|
||||
|
||||
if((m_input_size = m_codecCtx->frame_size))
|
||||
@@ -346,13 +420,26 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
|
||||
if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
|
||||
AUD_THROW(FileException, "File couldn't be written, file opening failed with ffmpeg.");
|
||||
|
||||
avformat_write_header(m_formatCtx, nullptr);
|
||||
if(avformat_write_header(m_formatCtx, nullptr) < 0)
|
||||
AUD_THROW(FileException, "File couldn't be written, writing the header failed.");
|
||||
}
|
||||
catch(Exception&)
|
||||
{
|
||||
#ifndef FFMPEG_OLD_CODE
|
||||
if(m_codecCtx)
|
||||
avcodec_free_context(&m_codecCtx);
|
||||
#endif
|
||||
avformat_free_context(m_formatCtx);
|
||||
throw;
|
||||
}
|
||||
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
m_packet = new AVPacket({});
|
||||
#else
|
||||
m_packet = av_packet_alloc();
|
||||
#endif
|
||||
|
||||
m_frame = av_frame_alloc();
|
||||
}
|
||||
|
||||
FFMPEGWriter::~FFMPEGWriter()
|
||||
@@ -365,9 +452,26 @@ FFMPEGWriter::~FFMPEGWriter()
|
||||
|
||||
av_write_trailer(m_formatCtx);
|
||||
|
||||
avcodec_close(m_codecCtx);
|
||||
if(m_frame)
|
||||
av_frame_free(&m_frame);
|
||||
|
||||
avio_close(m_formatCtx->pb);
|
||||
if(m_packet)
|
||||
{
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
delete m_packet;
|
||||
#else
|
||||
av_packet_free(&m_packet);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FFMPEG_OLD_CODE
|
||||
avcodec_close(m_codecCtx);
|
||||
#else
|
||||
if(m_codecCtx)
|
||||
avcodec_free_context(&m_codecCtx);
|
||||
#endif
|
||||
|
||||
avio_closep(&m_formatCtx->pb);
|
||||
avformat_free_context(m_formatCtx);
|
||||
}
|
||||
|
||||
|
15
extern/audaspace/plugins/ffmpeg/FFMPEGWriter.h
vendored
@@ -65,16 +65,21 @@ private:
|
||||
*/
|
||||
AVCodecContext* m_codecCtx;
|
||||
|
||||
/**
|
||||
* The AVOutputFormat structure for using ffmpeg.
|
||||
*/
|
||||
AVOutputFormat* m_outputFmt;
|
||||
|
||||
/**
|
||||
* The AVStream structure for using ffmpeg.
|
||||
*/
|
||||
AVStream* m_stream;
|
||||
|
||||
/**
|
||||
* The AVPacket structure for using ffmpeg.
|
||||
*/
|
||||
AVPacket* m_packet;
|
||||
|
||||
/**
|
||||
* The AVFrame structure for using ffmpeg.
|
||||
*/
|
||||
AVFrame* m_frame;
|
||||
|
||||
/**
|
||||
* The input buffer for the format converted data before encoding.
|
||||
*/
|
||||
|
@@ -78,7 +78,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
|
||||
engine.reset(self, data, depsgraph)
|
||||
|
||||
def render_to_image(self, depsgraph):
|
||||
def render(self, depsgraph):
|
||||
engine.render(self, depsgraph)
|
||||
|
||||
def bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
|
||||
@@ -93,7 +93,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
engine.reset(self, context.blend_data, context.depsgraph)
|
||||
engine.sync(self, context.depsgraph, context.blend_data)
|
||||
|
||||
def render_to_view(self, context):
|
||||
def view_draw(self, context):
|
||||
engine.draw(self, context.depsgraph, context.region, context.space_data, context.region_data)
|
||||
|
||||
def update_script_node(self, node):
|
||||
|
@@ -1154,7 +1154,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
default='THICK',
|
||||
)
|
||||
cls.cull_backfacing = BoolProperty(
|
||||
name="Cull back-faces",
|
||||
name="Cull Back-faces",
|
||||
description="Do not test the back-face of each strand",
|
||||
default=True,
|
||||
)
|
||||
@@ -1330,49 +1330,6 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
del bpy.types.ViewLayer.cycles
|
||||
|
||||
|
||||
class CyclesCurveSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
bpy.types.ParticleSettings.cycles = PointerProperty(
|
||||
name="Cycles Hair Settings",
|
||||
description="Cycles hair settings",
|
||||
type=cls,
|
||||
)
|
||||
cls.radius_scale = FloatProperty(
|
||||
name="Radius Scaling",
|
||||
description="Multiplier of width properties",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.01,
|
||||
)
|
||||
cls.root_width = FloatProperty(
|
||||
name="Root Size",
|
||||
description="Strand's width at root",
|
||||
min=0.0, max=1000.0,
|
||||
default=1.0,
|
||||
)
|
||||
cls.tip_width = FloatProperty(
|
||||
name="Tip Multiplier",
|
||||
description="Strand's width at tip",
|
||||
min=0.0, max=1000.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.shape = FloatProperty(
|
||||
name="Strand Shape",
|
||||
description="Strand shape parameter",
|
||||
min=-1.0, max=1.0,
|
||||
default=0.0,
|
||||
)
|
||||
cls.use_closetip = BoolProperty(
|
||||
name="Close tip",
|
||||
description="Set tip radius to zero",
|
||||
default=True,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def unregister(cls):
|
||||
del bpy.types.ParticleSettings.cycles
|
||||
|
||||
|
||||
class CyclesDeviceSettings(bpy.types.PropertyGroup):
|
||||
@classmethod
|
||||
def register(cls):
|
||||
@@ -1503,7 +1460,6 @@ def register():
|
||||
bpy.utils.register_class(CyclesMeshSettings)
|
||||
bpy.utils.register_class(CyclesObjectSettings)
|
||||
bpy.utils.register_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.register_class(CyclesCurveSettings)
|
||||
bpy.utils.register_class(CyclesDeviceSettings)
|
||||
bpy.utils.register_class(CyclesPreferences)
|
||||
bpy.utils.register_class(CyclesRenderLayerSettings)
|
||||
@@ -1519,7 +1475,6 @@ def unregister():
|
||||
bpy.utils.unregister_class(CyclesObjectSettings)
|
||||
bpy.utils.unregister_class(CyclesVisibilitySettings)
|
||||
bpy.utils.unregister_class(CyclesCurveRenderSettings)
|
||||
bpy.utils.unregister_class(CyclesCurveSettings)
|
||||
bpy.utils.unregister_class(CyclesDeviceSettings)
|
||||
bpy.utils.unregister_class(CyclesPreferences)
|
||||
bpy.utils.unregister_class(CyclesRenderLayerSettings)
|
||||
|
@@ -433,3 +433,14 @@ def do_versions(self):
|
||||
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
|
||||
# Switch to squared roughness convention
|
||||
square_roughness_nodes_insert()
|
||||
|
||||
if bpy.data.version <= (2, 80, 15):
|
||||
# Copy cycles hair settings to internal settings
|
||||
for part in bpy.data.particles:
|
||||
cpart = part.get("cycles", None)
|
||||
if cpart:
|
||||
part.shape = cpart.get("shape", 0.0)
|
||||
part.root_radius = cpart.get("root_width", 1.0)
|
||||
part.tip_radius = cpart.get("tip_width", 0.0)
|
||||
part.radius_scale = cpart.get("radius_scale", 0.01)
|
||||
part.use_close_tip = cpart.get("use_closetip", True)
|
||||
|
@@ -149,18 +149,16 @@ static bool ObtainCacheParticleData(Mesh *mesh,
|
||||
if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
|
||||
ren_step += b_part.kink_extra_steps();
|
||||
|
||||
PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
|
||||
|
||||
CData->psys_firstcurve.push_back_slow(curvenum);
|
||||
CData->psys_curvenum.push_back_slow(totcurves);
|
||||
CData->psys_shader.push_back_slow(shader);
|
||||
|
||||
float radius = get_float(cpsys, "radius_scale") * 0.5f;
|
||||
float radius = b_part.radius_scale() * 0.5f;
|
||||
|
||||
CData->psys_rootradius.push_back_slow(radius * get_float(cpsys, "root_width"));
|
||||
CData->psys_tipradius.push_back_slow(radius * get_float(cpsys, "tip_width"));
|
||||
CData->psys_shape.push_back_slow(get_float(cpsys, "shape"));
|
||||
CData->psys_closetip.push_back_slow(get_boolean(cpsys, "use_closetip"));
|
||||
CData->psys_rootradius.push_back_slow(radius * b_part.root_radius());
|
||||
CData->psys_tipradius.push_back_slow(radius * b_part.tip_radius());
|
||||
CData->psys_shape.push_back_slow(b_part.shape());
|
||||
CData->psys_closetip.push_back_slow(b_part.use_close_tip());
|
||||
|
||||
int pa_no = 0;
|
||||
if(!(b_part.child_type() == 0) && totchild != 0)
|
||||
|
@@ -1173,7 +1173,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
|
||||
* freed data from the blender side.
|
||||
*/
|
||||
if(preview && b_ob.type() != BL::Object::type_MESH)
|
||||
b_ob.update_from_editmode();
|
||||
b_ob.update_from_editmode(b_data);
|
||||
|
||||
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
|
||||
|
||||
|
@@ -278,25 +278,25 @@ void BlenderSync::sync_background_light(bool use_portal)
|
||||
/* Object */
|
||||
|
||||
Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
BlenderObjectCulling& culling,
|
||||
bool *use_portal)
|
||||
{
|
||||
const bool is_instance = b_dupli_iter->is_instance();
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
BL::Object b_parent = is_instance ? b_dupli_iter->parent()
|
||||
: b_dupli_iter->object();
|
||||
BL::Object b_ob_instance = is_instance ? b_dupli_iter->instance_object()
|
||||
const bool is_instance = b_instance.is_instance();
|
||||
BL::Object b_ob = b_instance.object();
|
||||
BL::Object b_parent = is_instance ? b_instance.parent()
|
||||
: b_instance.object();
|
||||
BL::Object b_ob_instance = is_instance ? b_instance.instance_object()
|
||||
: b_ob;
|
||||
const bool motion = motion_time != 0.0f;
|
||||
/*const*/ Transform tfm = get_transform(b_ob.matrix_world());
|
||||
int *persistent_id = NULL;
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
|
||||
if(is_instance) {
|
||||
persistent_id_array = b_dupli_iter->persistent_id();
|
||||
persistent_id_array = b_instance.persistent_id();
|
||||
persistent_id = persistent_id_array.data;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
persistent_id,
|
||||
b_ob,
|
||||
b_ob_instance,
|
||||
is_instance ? b_dupli_iter->random_id() : 0,
|
||||
is_instance ? b_instance.random_id() : 0,
|
||||
tfm,
|
||||
use_portal);
|
||||
}
|
||||
@@ -448,12 +448,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
|
||||
|
||||
/* dupli texture coordinates and random_id */
|
||||
if(is_instance) {
|
||||
object->dupli_generated = 0.5f*get_float3(b_dupli_iter->orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_dupli_iter->uv());
|
||||
object->random_id = b_dupli_iter->random_id();
|
||||
object->dupli_generated = 0.5f*get_float3(b_instance.orco()) - make_float3(0.5f, 0.5f, 0.5f);
|
||||
object->dupli_uv = get_float2(b_instance.uv());
|
||||
object->random_id = b_instance.random_id();
|
||||
|
||||
/* Sync possible particle data. */
|
||||
sync_dupli_particle(b_ob, *b_dupli_iter, object);
|
||||
sync_dupli_particle(b_ob, b_instance, object);
|
||||
}
|
||||
else {
|
||||
object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
|
||||
@@ -482,7 +482,8 @@ static bool object_render_hide_original(BL::Object::type_enum ob_type,
|
||||
static bool object_render_hide(BL::Object& b_ob,
|
||||
bool top_level,
|
||||
bool parent_hide,
|
||||
bool& hide_triangles)
|
||||
bool& hide_triangles,
|
||||
BL::Depsgraph::mode_enum depsgraph_mode)
|
||||
{
|
||||
/* check if we should render or hide particle emitter */
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
@@ -501,11 +502,16 @@ static bool object_render_hide(BL::Object& b_ob,
|
||||
has_particles = true;
|
||||
}
|
||||
|
||||
/* Both mode_PREVIEW and mode_VIEWPORT are treated the same here.*/
|
||||
const bool show_duplicator = depsgraph_mode == BL::Depsgraph::mode_RENDER
|
||||
? b_ob.show_duplicator_for_render()
|
||||
: b_ob.show_duplicator_for_viewport();
|
||||
|
||||
if(has_particles) {
|
||||
show_emitter = b_ob.show_duplicator_for_render();
|
||||
show_emitter = show_duplicator;
|
||||
hide_emitter = !show_emitter;
|
||||
} else if(b_ob.is_duplicator()) {
|
||||
if(top_level || b_ob.show_duplicator_for_render()) {
|
||||
if(top_level || show_duplicator) {
|
||||
hide_as_dupli_parent = true;
|
||||
}
|
||||
}
|
||||
@@ -563,12 +569,15 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
bool cancel = false;
|
||||
bool use_portal = false;
|
||||
|
||||
BL::Depsgraph::duplis_iterator b_dupli_iter;
|
||||
for(b_depsgraph.duplis.begin(b_dupli_iter);
|
||||
b_dupli_iter != b_depsgraph.duplis.end() && !cancel;
|
||||
++b_dupli_iter)
|
||||
BL::Depsgraph::mode_enum depsgraph_mode = b_depsgraph.mode();
|
||||
|
||||
BL::Depsgraph::object_instances_iterator b_instance_iter;
|
||||
for(b_depsgraph.object_instances.begin(b_instance_iter);
|
||||
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
|
||||
++b_instance_iter)
|
||||
{
|
||||
BL::Object b_ob = b_dupli_iter->object();
|
||||
BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
|
||||
BL::Object b_ob = b_instance.object();
|
||||
if(!b_ob.is_visible()) {
|
||||
continue;
|
||||
}
|
||||
@@ -581,10 +590,10 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
|
||||
/* test if object needs to be hidden */
|
||||
bool hide_tris;
|
||||
|
||||
if(!object_render_hide(b_ob, true, true, hide_tris)) {
|
||||
if(!object_render_hide(b_ob, true, true, hide_tris, depsgraph_mode)) {
|
||||
/* object itself */
|
||||
sync_object(b_depsgraph,
|
||||
b_dupli_iter,
|
||||
b_instance,
|
||||
~(0), /* until we get rid of layers */
|
||||
motion_time,
|
||||
hide_tris,
|
||||
|
@@ -28,11 +28,11 @@ CCL_NAMESPACE_BEGIN
|
||||
/* Utilities */
|
||||
|
||||
bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
Object *object)
|
||||
{
|
||||
/* test if this dupli was generated from a particle sytem */
|
||||
BL::ParticleSystem b_psys = b_dup.particle_system();
|
||||
BL::ParticleSystem b_psys = b_instance.particle_system();
|
||||
if(!b_psys)
|
||||
return false;
|
||||
|
||||
@@ -43,7 +43,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
return false;
|
||||
|
||||
/* don't handle child particles yet */
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup.persistent_id();
|
||||
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id();
|
||||
|
||||
if(persistent_id[0] >= b_psys.particles.length())
|
||||
return false;
|
||||
@@ -53,7 +53,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
|
||||
ParticleSystem *psys;
|
||||
|
||||
bool first_use = !particle_system_map.is_used(key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_dup.object(), key);
|
||||
bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key);
|
||||
|
||||
/* no update needed? */
|
||||
if(!need_update && !object->mesh->need_update && !scene->object_manager->need_update)
|
||||
|
@@ -773,7 +773,7 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
|
||||
|
||||
/* copy recalc flags, outside of mutex so we can decide to do the real
|
||||
* synchronization at a later time to not block on running updates */
|
||||
sync->sync_recalc();
|
||||
sync->sync_recalc(b_depsgraph_);
|
||||
|
||||
/* don't do synchronization if on pause */
|
||||
if(session_pause) {
|
||||
|
@@ -659,7 +659,9 @@ static ShaderNode *add_node(Scene *scene,
|
||||
image->animated = b_image_node.image_user().use_auto_refresh();
|
||||
image->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
image->filename.string(),
|
||||
@@ -668,6 +670,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
get_image_extension(b_image_node),
|
||||
image->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
image->color_space = (NodeImageColorSpace)b_image_node.color_space();
|
||||
image->projection = (NodeImageProjection)b_image_node.projection();
|
||||
@@ -707,7 +710,9 @@ static ShaderNode *add_node(Scene *scene,
|
||||
env->animated = b_env_node.image_user().use_auto_refresh();
|
||||
env->use_alpha = b_image.use_alpha();
|
||||
|
||||
/* TODO: restore */
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
#if 0
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
env->filename.string(),
|
||||
@@ -716,6 +721,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
EXTENSION_REPEAT,
|
||||
env->use_alpha);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
env->color_space = (NodeImageColorSpace)b_env_node.color_space();
|
||||
env->interpolation = get_image_interpolation(b_env_node);
|
||||
@@ -1238,33 +1244,32 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
TaskPool pool;
|
||||
set<Shader*> updated_shaders;
|
||||
|
||||
/* material loop */
|
||||
BL::BlendData::materials_iterator b_mat_orig;
|
||||
for(b_data.materials.begin(b_mat_orig);
|
||||
b_mat_orig != b_data.materials.end();
|
||||
++b_mat_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Material b_mat_(b_depsgraph.id_eval_get(*b_mat_orig));
|
||||
BL::Material *b_mat = &b_mat_;
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Material)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Material b_mat(*b_id);
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, *b_mat) || update_all) {
|
||||
if(shader_map.sync(&shader, b_mat) || shader->need_sync_object || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
shader->name = b_mat->name().c_str();
|
||||
shader->pass_id = b_mat->pass_index();
|
||||
shader->name = b_mat.name().c_str();
|
||||
shader->pass_id = b_mat.pass_index();
|
||||
shader->need_sync_object = false;
|
||||
|
||||
/* create nodes */
|
||||
if(b_mat->use_nodes() && b_mat->node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat->node_tree());
|
||||
if(b_mat.use_nodes() && b_mat.node_tree()) {
|
||||
BL::ShaderNodeTree b_ntree(b_mat.node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
diffuse->color = get_float3(b_mat->diffuse_color());
|
||||
diffuse->color = get_float3(b_mat.diffuse_color());
|
||||
graph->add(diffuse);
|
||||
|
||||
ShaderNode *out = graph->output();
|
||||
@@ -1272,7 +1277,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
}
|
||||
|
||||
/* settings */
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat->ptr, "cycles");
|
||||
PointerRNA cmat = RNA_pointer_get(&b_mat.ptr, "cycles");
|
||||
shader->use_mis = get_boolean(cmat, "sample_as_light");
|
||||
shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow");
|
||||
shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume");
|
||||
@@ -1412,41 +1417,39 @@ void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all)
|
||||
{
|
||||
shader_map.set_default(scene->default_light);
|
||||
|
||||
/* lamp loop */
|
||||
BL::BlendData::lamps_iterator b_lamp_orig;
|
||||
for(b_data.lamps.begin(b_lamp_orig);
|
||||
b_lamp_orig != b_data.lamps.end();
|
||||
++b_lamp_orig)
|
||||
{
|
||||
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
|
||||
BL::Lamp b_lamp_(b_depsgraph.id_eval_get(*b_lamp_orig));
|
||||
BL::Lamp *b_lamp = &b_lamp_;
|
||||
BL::Depsgraph::ids_iterator b_id;
|
||||
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
|
||||
if (!b_id->is_a(&RNA_Lamp)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
BL::Lamp b_lamp(*b_id);
|
||||
Shader *shader;
|
||||
|
||||
/* test if we need to sync */
|
||||
if(shader_map.sync(&shader, *b_lamp) || update_all) {
|
||||
if(shader_map.sync(&shader, b_lamp) || update_all) {
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
/* create nodes */
|
||||
if(b_lamp->use_nodes() && b_lamp->node_tree()) {
|
||||
shader->name = b_lamp->name().c_str();
|
||||
if(b_lamp.use_nodes() && b_lamp.node_tree()) {
|
||||
shader->name = b_lamp.name().c_str();
|
||||
|
||||
BL::ShaderNodeTree b_ntree(b_lamp->node_tree());
|
||||
BL::ShaderNodeTree b_ntree(b_lamp.node_tree());
|
||||
|
||||
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
float strength = 1.0f;
|
||||
|
||||
if(b_lamp->type() == BL::Lamp::type_POINT ||
|
||||
b_lamp->type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp->type() == BL::Lamp::type_AREA)
|
||||
if(b_lamp.type() == BL::Lamp::type_POINT ||
|
||||
b_lamp.type() == BL::Lamp::type_SPOT ||
|
||||
b_lamp.type() == BL::Lamp::type_AREA)
|
||||
{
|
||||
strength = 100.0f;
|
||||
}
|
||||
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
emission->color = get_float3(b_lamp->color());
|
||||
emission->color = get_float3(b_lamp.color());
|
||||
emission->strength = strength;
|
||||
graph->add(emission);
|
||||
|
||||
|
@@ -76,31 +76,12 @@ BlenderSync::~BlenderSync()
|
||||
|
||||
/* Sync */
|
||||
|
||||
bool BlenderSync::sync_recalc()
|
||||
void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
|
||||
{
|
||||
/* sync recalc flags from blender to cycles. actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable */
|
||||
|
||||
BL::BlendData::materials_iterator b_mat;
|
||||
bool has_updated_objects = b_data.objects.is_updated();
|
||||
for(b_data.materials.begin(b_mat); b_mat != b_data.materials.end(); ++b_mat) {
|
||||
if(b_mat->is_updated() || (b_mat->node_tree() && b_mat->node_tree().is_updated())) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
else {
|
||||
Shader *shader = shader_map.find(*b_mat);
|
||||
if(has_updated_objects && shader != NULL && shader->has_object_dependency) {
|
||||
shader_map.set_recalc(*b_mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::lamps_iterator b_lamp;
|
||||
|
||||
for(b_data.lamps.begin(b_lamp); b_lamp != b_data.lamps.end(); ++b_lamp)
|
||||
if(b_lamp->is_updated() || (b_lamp->node_tree() && b_lamp->node_tree().is_updated()))
|
||||
shader_map.set_recalc(*b_lamp);
|
||||
/* Sync recalc flags from blender to cycles. Actual update is done separate,
|
||||
* so we can do it later on if doing it immediate is not suitable. */
|
||||
|
||||
bool has_updated_objects = b_depsgraph.id_type_updated(BL::DriverTarget::id_type_OBJECT);
|
||||
bool dicing_prop_changed = false;
|
||||
|
||||
if(experimental) {
|
||||
@@ -122,70 +103,77 @@ bool BlenderSync::sync_recalc()
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::objects_iterator b_ob;
|
||||
/* Iterate over all IDs in this depsgraph. */
|
||||
BL::Depsgraph::updates_iterator b_update;
|
||||
for(b_depsgraph.updates.begin(b_update); b_update != b_depsgraph.updates.end(); ++b_update) {
|
||||
BL::ID b_id(b_update->id());
|
||||
|
||||
for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
|
||||
if(b_ob->is_updated()) {
|
||||
object_map.set_recalc(*b_ob);
|
||||
light_map.set_recalc(*b_ob);
|
||||
/* Material */
|
||||
if (b_id.is_a(&RNA_Material)) {
|
||||
BL::Material b_mat(b_id);
|
||||
shader_map.set_recalc(b_mat);
|
||||
}
|
||||
/* Lamp */
|
||||
else if (b_id.is_a(&RNA_Lamp)) {
|
||||
BL::Lamp b_lamp(b_id);
|
||||
shader_map.set_recalc(b_lamp);
|
||||
}
|
||||
/* Object */
|
||||
else if (b_id.is_a(&RNA_Object)) {
|
||||
BL::Object b_ob(b_id);
|
||||
const bool updated_geometry = b_update->updated_geometry();
|
||||
|
||||
if (b_update->updated_transform()) {
|
||||
object_map.set_recalc(b_ob);
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
|
||||
if(object_is_mesh(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated() ||
|
||||
(dicing_prop_changed && object_subdivision_type(*b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
if(object_is_mesh(b_ob)) {
|
||||
if(updated_geometry ||
|
||||
(dicing_prop_changed && object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
|
||||
{
|
||||
BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
|
||||
BL::ID key = BKE_object_is_modified(b_ob)? b_ob: b_ob.data();
|
||||
mesh_map.set_recalc(key);
|
||||
}
|
||||
}
|
||||
else if(object_is_light(*b_ob)) {
|
||||
if(b_ob->is_updated_data() || b_ob->data().is_updated())
|
||||
light_map.set_recalc(*b_ob);
|
||||
else if(object_is_light(b_ob)) {
|
||||
if(updated_geometry) {
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
}
|
||||
|
||||
if(b_ob->is_updated_data()) {
|
||||
if(updated_geometry) {
|
||||
BL::Object::particle_systems_iterator b_psys;
|
||||
for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(*b_ob);
|
||||
for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys)
|
||||
particle_system_map.set_recalc(b_ob);
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::meshes_iterator b_mesh;
|
||||
|
||||
for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh) {
|
||||
if(b_mesh->is_updated()) {
|
||||
mesh_map.set_recalc(*b_mesh);
|
||||
/* Mesh */
|
||||
else if (b_id.is_a(&RNA_Mesh)) {
|
||||
BL::Mesh b_mesh(b_id);
|
||||
mesh_map.set_recalc(b_mesh);
|
||||
}
|
||||
}
|
||||
|
||||
BL::BlendData::worlds_iterator b_world;
|
||||
|
||||
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world) {
|
||||
if(world_map == b_world->ptr.data) {
|
||||
if(b_world->is_updated() ||
|
||||
(b_world->node_tree() && b_world->node_tree().is_updated()))
|
||||
{
|
||||
world_recalc = true;
|
||||
}
|
||||
else if(b_world->node_tree() && b_world->use_nodes()) {
|
||||
Shader *shader = scene->default_background;
|
||||
if(has_updated_objects && shader->has_object_dependency) {
|
||||
/* World */
|
||||
else if (b_id.is_a(&RNA_World)) {
|
||||
BL::World b_world(b_id);
|
||||
if(world_map == b_world.ptr.data) {
|
||||
world_recalc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Updates shader with object dependency if objects changed. */
|
||||
if (has_updated_objects) {
|
||||
if(scene->default_background->has_object_dependency) {
|
||||
world_recalc = true;
|
||||
}
|
||||
|
||||
bool recalc =
|
||||
shader_map.has_recalc() ||
|
||||
object_map.has_recalc() ||
|
||||
light_map.has_recalc() ||
|
||||
mesh_map.has_recalc() ||
|
||||
particle_system_map.has_recalc() ||
|
||||
BlendDataObjects_is_updated_get(&b_data.ptr) ||
|
||||
world_recalc;
|
||||
|
||||
return recalc;
|
||||
foreach(Shader *shader, scene->shaders) {
|
||||
if (shader->has_object_dependency) {
|
||||
shader->need_sync_object = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BlenderSync::sync_data(BL::RenderSettings& b_render,
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
~BlenderSync();
|
||||
|
||||
/* sync */
|
||||
bool sync_recalc();
|
||||
void sync_recalc(BL::Depsgraph& b_depsgraph);
|
||||
void sync_data(BL::RenderSettings& b_render,
|
||||
BL::Depsgraph& b_depsgraph,
|
||||
BL::SpaceView3D& b_v3d,
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
bool motion,
|
||||
int motion_step = 0);
|
||||
Object *sync_object(BL::Depsgraph& b_depsgraph,
|
||||
BL::Depsgraph::duplis_iterator& b_dupli_iter,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
uint layer_flag,
|
||||
float motion_time,
|
||||
bool hide_tris,
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
|
||||
/* particles */
|
||||
bool sync_dupli_particle(BL::Object& b_ob,
|
||||
BL::DepsgraphIter& b_dup,
|
||||
BL::DepsgraphObjectInstance& b_instance,
|
||||
Object *object);
|
||||
|
||||
/* Images. */
|
||||
|
@@ -59,12 +59,15 @@ ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index)
|
||||
ccl_global char *ray_state = kernel_split_state.ray_state;
|
||||
|
||||
#ifdef __BRANCHED_PATH__
|
||||
# ifdef __SUBSURFACE__
|
||||
ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index];
|
||||
|
||||
if(ss_indirect->num_rays) {
|
||||
ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER);
|
||||
}
|
||||
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
else
|
||||
# endif /* __SUBSURFACE__ */
|
||||
if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
|
||||
int orig_ray = kernel_split_state.branched_state[ray_index].original_ray;
|
||||
|
||||
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
||||
|
@@ -202,6 +202,7 @@ Shader::Shader()
|
||||
|
||||
need_update = true;
|
||||
need_update_mesh = true;
|
||||
need_sync_object = false;
|
||||
}
|
||||
|
||||
Shader::~Shader()
|
||||
|
@@ -99,6 +99,7 @@ public:
|
||||
/* synchronization */
|
||||
bool need_update;
|
||||
bool need_update_mesh;
|
||||
bool need_sync_object;
|
||||
|
||||
/* If the shader has only volume components, the surface is assumed to
|
||||
* be transparent.
|
||||
|
@@ -36,10 +36,12 @@ set(SRC
|
||||
|
||||
intern/eigenvalues.cc
|
||||
intern/linear_solver.cc
|
||||
intern/matrix.cc
|
||||
intern/svd.cc
|
||||
|
||||
intern/eigenvalues.h
|
||||
intern/linear_solver.h
|
||||
intern/matrix.h
|
||||
intern/svd.h
|
||||
)
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "intern/eigenvalues.h"
|
||||
#include "intern/linear_solver.h"
|
||||
#include "intern/matrix.h"
|
||||
#include "intern/svd.h"
|
||||
|
||||
#endif /* __EIGEN_C_API_H__ */
|
||||
|
55
intern/eigen/intern/matrix.cc
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2018 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_CC__
|
||||
#define __EIGEN3_MATRIX_C_API_CC__
|
||||
|
||||
/* Eigen gives annoying huge amount of warnings here, silence them! */
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
#ifdef __EIGEN3_MATRIX_C_API_CC__ /* quiet warning */
|
||||
#endif
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "matrix.h"
|
||||
|
||||
using Eigen::Map;
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
|
||||
{
|
||||
Map<Matrix4f> M = Map<Matrix4f>((float*)matrix);
|
||||
Matrix4f R;
|
||||
bool invertible = true;
|
||||
M.computeInverseWithCheck(R, invertible, 0.0f);
|
||||
memcpy(inverse, R.data(), sizeof(float)*4*4);
|
||||
return invertible;
|
||||
}
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_CC__ */
|
40
intern/eigen/intern/matrix.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_MATRIX_C_API_H__
|
||||
#define __EIGEN3_MATRIX_C_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EIGEN3_MATRIX_C_API_H__ */
|
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/SVD>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#include "svd.h"
|
||||
|
||||
@@ -51,6 +52,8 @@ using Eigen::MatrixXf;
|
||||
using Eigen::VectorXf;
|
||||
using Eigen::Map;
|
||||
|
||||
using Eigen::Matrix4f;
|
||||
|
||||
void EIG_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V)
|
||||
{
|
||||
/* Since our matrix is squared, we can use thinU/V. */
|
||||
|
@@ -101,7 +101,12 @@
|
||||
* See T47228 and D1746 */
|
||||
#define USE_NON_LATIN_KB_WORKAROUND
|
||||
|
||||
static GHOST_TKey convertXKey(KeySym key);
|
||||
static GHOST_TKey ghost_key_from_keysym(
|
||||
const KeySym key);
|
||||
static GHOST_TKey ghost_key_from_keycode(
|
||||
const XkbDescPtr xkb_descr, const KeyCode keycode);
|
||||
static GHOST_TKey ghost_key_from_keysym_or_keycode(
|
||||
const KeySym key, const XkbDescPtr xkb_descr, const KeyCode keycode);
|
||||
|
||||
/* these are for copy and select copy */
|
||||
static char *txt_cut_buffer = NULL;
|
||||
@@ -117,6 +122,7 @@ GHOST_SystemX11::
|
||||
GHOST_SystemX11(
|
||||
)
|
||||
: GHOST_System(),
|
||||
m_xkb_descr(NULL),
|
||||
m_start_time(0)
|
||||
{
|
||||
XInitThreads();
|
||||
@@ -192,6 +198,11 @@ GHOST_SystemX11(
|
||||
use_xkb = XkbQueryExtension(m_display, &xkb_opcode, &xkb_event, &xkb_error, &xkb_major, &xkb_minor);
|
||||
if (use_xkb) {
|
||||
XkbSetDetectableAutoRepeat(m_display, true, NULL);
|
||||
|
||||
m_xkb_descr = XkbGetMap(m_display, 0, XkbUseCoreKbd);
|
||||
if (m_xkb_descr) {
|
||||
XkbGetNames(m_display, XkbKeyNamesMask, m_xkb_descr);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_XWAYLAND_HACK
|
||||
@@ -249,6 +260,10 @@ GHOST_SystemX11::
|
||||
XCloseDevice(m_display, m_xtablet.EraserDevice);
|
||||
#endif /* WITH_X11_XINPUT */
|
||||
|
||||
if (m_xkb_descr) {
|
||||
XkbFreeNames(m_xkb_descr, XkbKeyNamesMask, false);
|
||||
}
|
||||
|
||||
XCloseDisplay(m_display);
|
||||
}
|
||||
|
||||
@@ -669,10 +684,8 @@ processEvents(
|
||||
}
|
||||
|
||||
/* dispatch event to XIM server */
|
||||
if ((XFilterEvent(&xevent, (Window)NULL) == True) && (xevent.type != KeyRelease)) {
|
||||
/* do nothing now, the event is consumed by XIM.
|
||||
* however, KeyRelease event should be processed
|
||||
* here, otherwise modifiers remain activated. */
|
||||
if ((XFilterEvent(&xevent, (Window)NULL) == True)) {
|
||||
/* do nothing now, the event is consumed by XIM. */
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -726,7 +739,7 @@ processEvents(
|
||||
getMilliSeconds(),
|
||||
GHOST_kEventKeyDown,
|
||||
window,
|
||||
convertXKey(modifiers[i]),
|
||||
ghost_key_from_keysym(modifiers[i]),
|
||||
'\0',
|
||||
NULL));
|
||||
}
|
||||
@@ -956,7 +969,6 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
{
|
||||
XKeyEvent *xke = &(xe->xkey);
|
||||
KeySym key_sym;
|
||||
KeySym key_sym_str;
|
||||
char ascii;
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
/* utf8_array[] is initial buffer used for Xutf8LookupString().
|
||||
@@ -983,7 +995,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
* is unmodified (or anyone swapping the keys with xmodmap).
|
||||
*
|
||||
* - XLookupKeysym seems to always use first defined keymap (see T47228), which generates
|
||||
* keycodes unusable by convertXKey for non-latin-compatible keymaps.
|
||||
* keycodes unusable by ghost_key_from_keysym for non-latin-compatible keymaps.
|
||||
*
|
||||
* To address this, we:
|
||||
*
|
||||
@@ -1001,6 +1013,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
*
|
||||
* [1] http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/KeyBind.c
|
||||
*/
|
||||
KeySym key_sym_str;
|
||||
/* Mode_switch 'modifier' is AltGr - when this one or Shift are enabled, we do not want to apply
|
||||
* that 'forced number' hack. */
|
||||
const unsigned int mode_switch_mask = XkbKeysymToModifiers(xke->display, XK_Mode_switch);
|
||||
@@ -1021,7 +1034,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
|
||||
/* Only allow a limited set of keys from XLookupKeysym, all others we take from XLookupString,
|
||||
* unless it gives unknown key... */
|
||||
gkey = convertXKey(key_sym);
|
||||
gkey = ghost_key_from_keysym_or_keycode(key_sym, m_xkb_descr, xke->keycode);
|
||||
switch (gkey) {
|
||||
case GHOST_kKeyRightAlt:
|
||||
case GHOST_kKeyLeftAlt:
|
||||
@@ -1058,11 +1071,13 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
case GHOST_kKeyNumpadSlash:
|
||||
break;
|
||||
default:
|
||||
GHOST_TKey gkey_str = convertXKey(key_sym_str);
|
||||
{
|
||||
GHOST_TKey gkey_str = ghost_key_from_keysym(key_sym_str);
|
||||
if (gkey_str != GHOST_kKeyUnknown) {
|
||||
gkey = gkey_str;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* In keyboards like latin ones,
|
||||
* numbers needs a 'Shift' to be accessed but key_sym
|
||||
@@ -1083,7 +1098,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
key_sym = XLookupKeysym(xke, 0);
|
||||
}
|
||||
|
||||
gkey = convertXKey(key_sym);
|
||||
gkey = ghost_key_from_keysym_or_keycode(key_sym, m_xkb_descr, xke->keycode);
|
||||
|
||||
if (!XLookupString(xke, &ascii, 1, NULL, NULL)) {
|
||||
ascii = '\0';
|
||||
@@ -1732,10 +1747,22 @@ generateWindowExposeEvents()
|
||||
return anyProcessed;
|
||||
}
|
||||
|
||||
static GHOST_TKey
|
||||
ghost_key_from_keysym_or_keycode(const KeySym keysym, XkbDescPtr xkb_descr, const KeyCode keycode)
|
||||
{
|
||||
GHOST_TKey type = ghost_key_from_keysym(keysym);
|
||||
if (type == GHOST_kKeyUnknown) {
|
||||
if (xkb_descr) {
|
||||
type = ghost_key_from_keycode(xkb_descr, keycode);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
#define GXMAP(k, x, y) case x: k = y; break
|
||||
|
||||
static GHOST_TKey
|
||||
convertXKey(KeySym key)
|
||||
ghost_key_from_keysym(const KeySym key)
|
||||
{
|
||||
GHOST_TKey type;
|
||||
|
||||
@@ -1844,6 +1871,9 @@ convertXKey(KeySym key)
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
#ifdef GHOST_DEBUG
|
||||
printf("%s: unknown key: %lu / 0x%lx\n", __func__, key, key);
|
||||
#endif
|
||||
type = GHOST_kKeyUnknown;
|
||||
break;
|
||||
}
|
||||
@@ -1854,6 +1884,33 @@ convertXKey(KeySym key)
|
||||
|
||||
#undef GXMAP
|
||||
|
||||
#define MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
|
||||
|
||||
static GHOST_TKey
|
||||
ghost_key_from_keycode(const XkbDescPtr xkb_descr, const KeyCode keycode)
|
||||
{
|
||||
GHOST_ASSERT(XkbKeyNameLength == 4, "Name length is invalid!");
|
||||
if (keycode >= xkb_descr->min_key_code && keycode <= xkb_descr->max_key_code) {
|
||||
const char *id_str = xkb_descr->names->keys[keycode].name;
|
||||
const uint32_t id = MAKE_ID(id_str[0], id_str[1], id_str[2], id_str[3]);
|
||||
switch (id) {
|
||||
case MAKE_ID('T', 'L', 'D', 'E'):
|
||||
return GHOST_kKeyAccentGrave;
|
||||
#ifdef GHOST_DEBUG
|
||||
default:
|
||||
printf("%s unhandled keycode: %.*s\n", __func__, XkbKeyNameLength, id_str);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
GHOST_ASSERT(false, "KeyCode out of range!");
|
||||
}
|
||||
return GHOST_kKeyUnknown;
|
||||
}
|
||||
|
||||
#undef MAKE_ID
|
||||
|
||||
/* from xclip.c xcout() v0.11 */
|
||||
|
||||
#define XCLIB_XCOUT_NONE 0 /* no context */
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#define __GHOST_SYSTEMX11_H__
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/XKBlib.h> /* allow detectable autorepeate */
|
||||
|
||||
#include "GHOST_System.h"
|
||||
#include "../GHOST_Types.h"
|
||||
@@ -373,6 +374,10 @@ public:
|
||||
private:
|
||||
|
||||
Display *m_display;
|
||||
|
||||
/* Use for scancode lookups. */
|
||||
XkbDescRec *m_xkb_descr;
|
||||
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
XIM m_xim;
|
||||
#endif
|
||||
|
@@ -59,13 +59,19 @@ using namespace OCIO_NAMESPACE;
|
||||
#include "ocio_impl.h"
|
||||
|
||||
static const int LUT3D_EDGE_SIZE = 64;
|
||||
static const int SHADER_CACHE_SIZE = 4;
|
||||
|
||||
extern "C" char datatoc_gpu_shader_display_transform_glsl[];
|
||||
extern "C" char datatoc_gpu_shader_display_transform_vertex_glsl[];
|
||||
|
||||
/* **** OpenGL drawing routines using GLSL for color space transform ***** */
|
||||
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
typedef struct OCIO_GLSLShader {
|
||||
/* Cache ID */
|
||||
std::string lut3dCacheID;
|
||||
std::string shaderCacheID;
|
||||
|
||||
/* LUT */
|
||||
bool lut3d_texture_allocated; /* boolean flag indicating whether
|
||||
* lut texture is allocated
|
||||
*/
|
||||
@@ -75,25 +81,29 @@ typedef struct OCIO_GLSLDrawState {
|
||||
|
||||
float *lut3d; /* 3D LUT table */
|
||||
|
||||
bool dither_used;
|
||||
/* Dither */
|
||||
bool use_dither;
|
||||
|
||||
bool curve_mapping_used;
|
||||
/* Curve Mapping */
|
||||
bool use_curve_mapping;
|
||||
bool curve_mapping_texture_allocated;
|
||||
bool curve_mapping_texture_valid;
|
||||
GLuint curve_mapping_texture;
|
||||
size_t curve_mapping_cache_id;
|
||||
|
||||
bool predivide_used;
|
||||
|
||||
/* Cache */
|
||||
std::string lut3dcacheid;
|
||||
std::string shadercacheid;
|
||||
/* Alpha Predivide */
|
||||
bool use_predivide;
|
||||
|
||||
/* GLSL stuff */
|
||||
GLuint ocio_shader;
|
||||
GLuint vert_shader;
|
||||
GLuint program;
|
||||
Gwn_ShaderInterface *shader_interface;
|
||||
} GLSLDrawState;
|
||||
|
||||
typedef struct OCIO_GLSLDrawState {
|
||||
/* Shader Cache */
|
||||
OCIO_GLSLShader *shader_cache[SHADER_CACHE_SIZE];
|
||||
|
||||
/* Previous OpenGL state. */
|
||||
GLint last_texture, last_texture_unit;
|
||||
@@ -150,33 +160,24 @@ static GLuint linkShaders(GLuint ocio_shader, GLuint vert_shader)
|
||||
|
||||
static OCIO_GLSLDrawState *allocateOpenGLState(void)
|
||||
{
|
||||
OCIO_GLSLDrawState *state;
|
||||
|
||||
/* Allocate memory for state. */
|
||||
state = (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
return (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
|
||||
"OCIO OpenGL State struct");
|
||||
|
||||
/* Call constructors on new memory. */
|
||||
new (&state->lut3dcacheid) std::string("");
|
||||
new (&state->shadercacheid) std::string("");
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Ensure LUT texture and array are allocated */
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
|
||||
static bool ensureLUT3DAllocated(OCIO_GLSLShader *shader)
|
||||
{
|
||||
int num_3d_entries = 3 * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE;
|
||||
|
||||
if (state->lut3d_texture_allocated)
|
||||
return state->lut3d_texture_valid;
|
||||
if (shader->lut3d_texture_allocated)
|
||||
return shader->lut3d_texture_valid;
|
||||
|
||||
glGenTextures(1, &state->lut3d_texture);
|
||||
glGenTextures(1, &shader->lut3d_texture);
|
||||
|
||||
state->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
shader->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -188,27 +189,27 @@ static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
|
||||
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F_ARB,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
0, GL_RGB, GL_FLOAT, state->lut3d);
|
||||
0, GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
|
||||
state->lut3d_texture_allocated = true;
|
||||
shader->lut3d_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
state->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
shader->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return state->lut3d_texture_valid;
|
||||
return shader->lut3d_texture_valid;
|
||||
}
|
||||
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
static bool ensureCurveMappingAllocated(OCIO_GLSLShader *shader, OCIO_CurveMappingSettings *curve_mapping_settings)
|
||||
{
|
||||
if (state->curve_mapping_texture_allocated)
|
||||
return state->curve_mapping_texture_valid;
|
||||
if (shader->curve_mapping_texture_allocated)
|
||||
return shader->curve_mapping_texture_valid;
|
||||
|
||||
glGenTextures(1, &state->curve_mapping_texture);
|
||||
glGenTextures(1, &shader->curve_mapping_texture);
|
||||
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -221,16 +222,51 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMap
|
||||
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F, curve_mapping_settings->lut_size,
|
||||
0, GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
|
||||
state->curve_mapping_texture_allocated = true;
|
||||
shader->curve_mapping_texture_allocated = true;
|
||||
|
||||
/* GL_RGB16F_ARB could be not supported at some drivers
|
||||
* in this case we could not use GLSL display
|
||||
*/
|
||||
state->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
shader->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
|
||||
|
||||
return state->curve_mapping_texture_valid;
|
||||
return shader->curve_mapping_texture_valid;
|
||||
}
|
||||
|
||||
static void freeGLSLShader(OCIO_GLSLShader *shader)
|
||||
{
|
||||
if (shader->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->curve_mapping_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d_texture_allocated) {
|
||||
glDeleteTextures(1, &shader->lut3d_texture);
|
||||
}
|
||||
|
||||
if (shader->lut3d) {
|
||||
MEM_freeN(shader->lut3d);
|
||||
}
|
||||
|
||||
if (shader->program) {
|
||||
glDeleteProgram(shader->program);
|
||||
}
|
||||
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
|
||||
if (shader->ocio_shader) {
|
||||
glDeleteShader(shader->ocio_shader);
|
||||
}
|
||||
|
||||
using std::string;
|
||||
shader->lut3dCacheID.~string();
|
||||
shader->shaderCacheID.~string();
|
||||
|
||||
MEM_freeN(shader);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Detect if we can support GLSL drawing */
|
||||
bool OCIOImpl::supportGLSLDraw()
|
||||
{
|
||||
@@ -265,85 +301,95 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &state->last_texture);
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &state->last_texture_unit);
|
||||
|
||||
if (!ensureLUT3DAllocated(state)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(state, curve_mapping_settings)) {
|
||||
glActiveTexture(state->last_texture_unit);
|
||||
glBindTexture(GL_TEXTURE_2D, state->last_texture);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (state->curve_mapping_texture_allocated) {
|
||||
glDeleteTextures(1, &state->curve_mapping_texture);
|
||||
state->curve_mapping_texture_allocated = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 1: Create a GPU Shader Description */
|
||||
/* Compute cache IDs. */
|
||||
GpuShaderDesc shaderDesc;
|
||||
shaderDesc.setLanguage(GPU_LANGUAGE_GLSL_1_3);
|
||||
shaderDesc.setFunctionName("OCIODisplay");
|
||||
shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
if (state->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
|
||||
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
|
||||
/* Find matching cached shader. */
|
||||
OCIO_GLSLShader *shader = NULL;
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
OCIO_GLSLShader *cached_shader = state->shader_cache[i];
|
||||
if (cached_shader == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cached_shader->lut3dCacheID == lut3dCacheID &&
|
||||
cached_shader->shaderCacheID == shaderCacheID &&
|
||||
cached_shader->use_predivide == use_predivide &&
|
||||
cached_shader->use_curve_mapping == use_curve_mapping &&
|
||||
cached_shader->use_dither == use_dither)
|
||||
{
|
||||
/* LRU cache, so move to front. */
|
||||
for (int j = i; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
state->shader_cache[0] = cached_shader;
|
||||
|
||||
shader = cached_shader;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 2: Compute the 3D LUT */
|
||||
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
|
||||
if (lut3dCacheID != state->lut3dcacheid) {
|
||||
state->lut3dcacheid = lut3dCacheID;
|
||||
ocio_processor->getGpuLut3D(state->lut3d, shaderDesc);
|
||||
if (shader == NULL) {
|
||||
/* LRU cache, shift other items back so we can insert at the front. */
|
||||
OCIO_GLSLShader *last_shader = state->shader_cache[SHADER_CACHE_SIZE - 1];
|
||||
if (last_shader) {
|
||||
freeGLSLShader(last_shader);
|
||||
}
|
||||
for (int j = SHADER_CACHE_SIZE - 1; j > 0; j--) {
|
||||
state->shader_cache[j] = state->shader_cache[j - 1];
|
||||
}
|
||||
|
||||
/* Allocate memory for shader. */
|
||||
shader = (OCIO_GLSLShader *) MEM_callocN(sizeof(OCIO_GLSLShader),
|
||||
"OCIO GLSL Shader");
|
||||
state->shader_cache[0] = shader;
|
||||
|
||||
new (&shader->lut3dCacheID) std::string();
|
||||
new (&shader->shaderCacheID) std::string();
|
||||
|
||||
shader->lut3dCacheID = lut3dCacheID;
|
||||
shader->shaderCacheID = shaderCacheID;
|
||||
shader->use_curve_mapping = use_curve_mapping;
|
||||
shader->use_dither = use_dither;
|
||||
shader->use_predivide = use_predivide;
|
||||
|
||||
bool valid = true;
|
||||
|
||||
/* Compute 3D LUT. */
|
||||
if (valid && ensureLUT3DAllocated(shader)) {
|
||||
ocio_processor->getGpuLut3D(shader->lut3d, shaderDesc);
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0,
|
||||
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
|
||||
GL_RGB, GL_FLOAT, state->lut3d);
|
||||
GL_RGB, GL_FLOAT, shader->lut3d);
|
||||
}
|
||||
else {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
/* Step 3: Compute the Shader */
|
||||
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
|
||||
if (state->program == 0 ||
|
||||
shaderCacheID != state->shadercacheid ||
|
||||
use_predivide != state->predivide_used ||
|
||||
use_curve_mapping != state->curve_mapping_used ||
|
||||
use_dither != state->dither_used)
|
||||
{
|
||||
state->shadercacheid = shaderCacheID;
|
||||
|
||||
if (state->program) {
|
||||
glDeleteProgram(state->program);
|
||||
}
|
||||
|
||||
if (state->ocio_shader) {
|
||||
glDeleteShader(state->ocio_shader);
|
||||
}
|
||||
|
||||
if (state->vert_shader) {
|
||||
glDeleteShader(state->vert_shader);
|
||||
/* Allocate curve mapping texture. */
|
||||
if (valid && use_curve_mapping) {
|
||||
if (!ensureCurveMappingAllocated(shader, curve_mapping_settings)) {
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
/* Vertex shader */
|
||||
std::ostringstream osv;
|
||||
|
||||
osv << "#version 330\n";
|
||||
osv << datatoc_gpu_shader_display_transform_vertex_glsl;
|
||||
|
||||
state->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
shader->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
|
||||
|
||||
/* Fragment shader */
|
||||
std::ostringstream os;
|
||||
@@ -369,31 +415,40 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
os << ocio_processor->getGpuShaderText(shaderDesc) << "\n";
|
||||
os << datatoc_gpu_shader_display_transform_glsl;
|
||||
|
||||
state->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
shader->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
|
||||
|
||||
if (state->ocio_shader && state->vert_shader) {
|
||||
state->program = linkShaders(state->ocio_shader, state->vert_shader);
|
||||
/* Program */
|
||||
if (shader->ocio_shader && shader->vert_shader) {
|
||||
shader->program = linkShaders(shader->ocio_shader, shader->vert_shader);
|
||||
}
|
||||
|
||||
if (state->program) {
|
||||
if (state->shader_interface) {
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
if (shader->program) {
|
||||
if (shader->shader_interface) {
|
||||
GWN_shaderinterface_discard(shader->shader_interface);
|
||||
}
|
||||
shader->shader_interface = GWN_shaderinterface_create(shader->program);
|
||||
}
|
||||
}
|
||||
state->shader_interface = GWN_shaderinterface_create(state->program);
|
||||
}
|
||||
|
||||
state->curve_mapping_used = use_curve_mapping;
|
||||
state->dither_used = use_dither;
|
||||
state->predivide_used = use_predivide;
|
||||
/* Update curve mapping texture. */
|
||||
if (use_curve_mapping && shader->curve_mapping_texture_allocated) {
|
||||
if (shader->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
|
||||
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
|
||||
}
|
||||
}
|
||||
|
||||
if (state->program) {
|
||||
/* Bind Shader. */
|
||||
if (shader->program) {
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
|
||||
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
|
||||
|
||||
if (use_curve_mapping) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
|
||||
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@@ -409,7 +464,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
|
||||
Gwn_VertFormat *format = immVertexFormat();
|
||||
GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||
immBindProgram(state->program, state->shader_interface);
|
||||
immBindProgram(shader->program, shader->shader_interface);
|
||||
|
||||
immUniform1i("image_texture", 0);
|
||||
immUniform1i("lut3d_texture", 1);
|
||||
@@ -453,27 +508,13 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)
|
||||
void OCIOImpl::freeGLState(OCIO_GLSLDrawState *state)
|
||||
{
|
||||
using std::string;
|
||||
|
||||
if (state->lut3d_texture_allocated)
|
||||
glDeleteTextures(1, &state->lut3d_texture);
|
||||
|
||||
if (state->lut3d)
|
||||
MEM_freeN(state->lut3d);
|
||||
|
||||
if (state->program)
|
||||
glDeleteProgram(state->program);
|
||||
|
||||
if (state->shader_interface)
|
||||
GWN_shaderinterface_discard(state->shader_interface);
|
||||
|
||||
if (state->ocio_shader)
|
||||
glDeleteShader(state->ocio_shader);
|
||||
|
||||
state->lut3dcacheid.~string();
|
||||
state->shadercacheid.~string();
|
||||
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
|
||||
if (state->shader_cache[i]) {
|
||||
freeGLSLShader(state->shader_cache[i]);
|
||||
}
|
||||
}
|
||||
|
||||
MEM_freeN(state);
|
||||
}
|
||||
|
3
release/datafiles/studiolights/matcap/license.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
|
||||
|
||||
Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.
|
BIN
release/datafiles/studiolights/matcap/mc01.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
release/datafiles/studiolights/matcap/mc02.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
release/datafiles/studiolights/matcap/mc03.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
release/datafiles/studiolights/matcap/mc04.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
release/datafiles/studiolights/matcap/mc05.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
release/datafiles/studiolights/matcap/mc06.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
release/datafiles/studiolights/matcap/mc07.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
release/datafiles/studiolights/matcap/mc08.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
release/datafiles/studiolights/matcap/mc09.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
release/datafiles/studiolights/matcap/mc10.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
release/datafiles/studiolights/matcap/mc11.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
release/datafiles/studiolights/matcap/mc12.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
release/datafiles/studiolights/matcap/mc13.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
release/datafiles/studiolights/matcap/mc14.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
release/datafiles/studiolights/matcap/mc15.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
release/datafiles/studiolights/matcap/mc16.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
release/datafiles/studiolights/matcap/mc17.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
release/datafiles/studiolights/matcap/mc18.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
release/datafiles/studiolights/matcap/mc19.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
release/datafiles/studiolights/matcap/mc20.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
release/datafiles/studiolights/matcap/mc21.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
release/datafiles/studiolights/matcap/mc22.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
release/datafiles/studiolights/matcap/mc23.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
release/datafiles/studiolights/matcap/mc24.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
@@ -153,8 +153,10 @@ def get_transform_generators_base_info(data):
|
||||
# no path in this case
|
||||
path = ""
|
||||
|
||||
# data on ID-blocks directly should get grouped by the KeyingSet
|
||||
grouping = None
|
||||
# transform data on ID-blocks directly should get grouped under a
|
||||
# hardcoded label ("Object Transforms") so that they get grouped
|
||||
# consistently when keyframed directly
|
||||
grouping = "Object Transforms"
|
||||
else:
|
||||
# get the path to the ID-block
|
||||
path = data.path_from_id()
|
||||
|
@@ -160,8 +160,8 @@
|
||||
</ThemeWidgetColors>
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#29282eff"
|
||||
<ThemeWidgetColors outline="#29282e"
|
||||
inner="#29282e99"
|
||||
inner_sel="#505158ff"
|
||||
item="#ffffffff"
|
||||
text="#eeeeee"
|
||||
@@ -936,18 +936,18 @@
|
||||
</ThemeUserPreferences>
|
||||
</user_preferences>
|
||||
<console>
|
||||
<ThemeConsole line_output="#6080ff"
|
||||
<ThemeConsole line_output="#b3c2ff"
|
||||
line_input="#ffffff"
|
||||
line_info="#00aa00"
|
||||
line_error="#dc6060"
|
||||
cursor="#dc6060"
|
||||
line_info="#47b347"
|
||||
line_error="#de6f6f"
|
||||
cursor="#de5959"
|
||||
select="#ffffff30">
|
||||
<space>
|
||||
<ThemeSpaceGeneric back="#2f3035"
|
||||
title="#ffffff"
|
||||
text="#ffffff"
|
||||
text_hi="#ffffff"
|
||||
header="#29282eff"
|
||||
header="#2f3035ff"
|
||||
header_text="#eeeeee"
|
||||
header_text_hi="#ffffff"
|
||||
button="#2f303599"
|
||||
|
@@ -161,7 +161,7 @@
|
||||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors outline="#000000"
|
||||
inner="#3f3f3fff"
|
||||
inner="#e6e6e699"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#ffffffff"
|
||||
text="#000000"
|
||||
@@ -169,7 +169,7 @@
|
||||
show_shaded="FALSE"
|
||||
shadetop="25"
|
||||
shadedown="-20"
|
||||
roundness="0.4">
|
||||
roundness="0.3">
|
||||
</ThemeWidgetColors>
|
||||
</wcol_pulldown>
|
||||
<wcol_menu_back>
|
||||
|
@@ -865,7 +865,7 @@ class TransformsToDeltasAnim(Operator):
|
||||
|
||||
|
||||
class DupliOffsetFromCursor(Operator):
|
||||
"""Set offset used for DupliGroup based on cursor position"""
|
||||
"""Set offset used for collection instances based on cursor position"""
|
||||
bl_idname = "object.dupli_offset_from_cursor"
|
||||
bl_label = "Set Offset From Cursor"
|
||||
bl_options = {'INTERNAL', 'UNDO'}
|
||||
@@ -876,9 +876,9 @@ class DupliOffsetFromCursor(Operator):
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
group = context.group
|
||||
collection = context.collection
|
||||
|
||||
group.dupli_offset = scene.cursor_location
|
||||
collection.dupli_offset = scene.cursor_location
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@@ -19,13 +19,17 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
from bpy.types import (
|
||||
Operator,
|
||||
OperatorFileListElement
|
||||
)
|
||||
from bpy.props import (
|
||||
BoolProperty,
|
||||
EnumProperty,
|
||||
FloatProperty,
|
||||
IntProperty,
|
||||
StringProperty,
|
||||
CollectionProperty,
|
||||
)
|
||||
|
||||
from bpy.app.translations import pgettext_tip as tip_
|
||||
@@ -55,6 +59,15 @@ rna_relative_prop = BoolProperty(
|
||||
default=False,
|
||||
)
|
||||
|
||||
rna_space_type_prop = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
)
|
||||
|
||||
|
||||
def context_path_validate(context, data_path):
|
||||
try:
|
||||
@@ -2335,21 +2348,29 @@ class WM_OT_tool_set_by_name(Operator):
|
||||
name="Text",
|
||||
description="Display name of the tool",
|
||||
)
|
||||
space_type = EnumProperty(
|
||||
name="Type",
|
||||
items=tuple(
|
||||
(e.identifier, e.name, "", e. value)
|
||||
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
|
||||
),
|
||||
default='EMPTY',
|
||||
|
||||
cycle = BoolProperty(
|
||||
name="Cycle",
|
||||
description="Cycle through tools in this group",
|
||||
default=False,
|
||||
options={'SKIP_SAVE'},
|
||||
)
|
||||
|
||||
space_type = rna_space_type_prop
|
||||
|
||||
def execute(self, context):
|
||||
from bl_ui.space_toolsystem_common import activate_by_name
|
||||
from bl_ui.space_toolsystem_common import (
|
||||
activate_by_name,
|
||||
activate_by_name_or_cycle,
|
||||
)
|
||||
|
||||
if self.properties.is_property_set("space_type"):
|
||||
space_type = self.space_type
|
||||
if space_type == 'EMPTY':
|
||||
else:
|
||||
space_type = context.space_data.type
|
||||
if activate_by_name(context, space_type, self.name):
|
||||
|
||||
fn = activate_by_name_or_cycle if self.cycle else activate_by_name
|
||||
if fn(context, space_type, self.name):
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
self.report({'WARNING'}, f"Tool {self.name!r} not found.")
|
||||
@@ -2369,9 +2390,7 @@ class WM_OT_toolbar(Operator):
|
||||
|
||||
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
||||
if cls is None:
|
||||
# self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
|
||||
# Passthrough to running search directly.
|
||||
bpy.ops.wm.search_menu('INVOKE_DEFAULT')
|
||||
self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
|
||||
return {'CANCELLED'}
|
||||
|
||||
wm = context.window_manager
|
||||
@@ -2379,15 +2398,126 @@ class WM_OT_toolbar(Operator):
|
||||
|
||||
def draw_menu(popover, context):
|
||||
layout = popover.layout
|
||||
cls.draw_cls(layout, context, detect_layout=False)
|
||||
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.operator("wm.search_menu")
|
||||
cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
|
||||
|
||||
wm.popover(draw_menu, keymap=keymap)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
# Studio Light operations
|
||||
class WM_OT_studiolight_install(Operator):
|
||||
"""Install a user defined studio light"""
|
||||
bl_idname = "wm.studiolight_install"
|
||||
bl_label = "Install Custom Studio Light"
|
||||
|
||||
files = CollectionProperty(
|
||||
name="File Path",
|
||||
type=OperatorFileListElement,
|
||||
)
|
||||
directory = StringProperty(
|
||||
subtype='DIR_PATH',
|
||||
)
|
||||
filter_folder = BoolProperty(
|
||||
name="Filter folders",
|
||||
default=True,
|
||||
options={'HIDDEN'},
|
||||
)
|
||||
filter_glob = StringProperty(
|
||||
default="*.png;*.jpg;*.hdr;*.exr",
|
||||
options={'HIDDEN'},
|
||||
)
|
||||
orientation = EnumProperty(
|
||||
items=(
|
||||
("MATCAP", "MatCap", ""),
|
||||
("WORLD", "World", ""),
|
||||
("CAMERA", "Camera", ""),
|
||||
)
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
import traceback
|
||||
import shutil
|
||||
import pathlib
|
||||
userpref = context.user_preferences
|
||||
|
||||
filepaths = [pathlib.Path(self.directory, e.name) for e in self.files]
|
||||
path_studiolights = bpy.utils.user_resource('DATAFILES')
|
||||
|
||||
if not path_studiolights:
|
||||
self.report({'ERROR'}, "Failed to get Studio Light path")
|
||||
return {'CANCELLED'}
|
||||
|
||||
path_studiolights = pathlib.Path(path_studiolights, "studiolights", self.orientation.lower())
|
||||
if not path_studiolights.exists():
|
||||
try:
|
||||
path_studiolights.mkdir(parents=True, exist_ok=True)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
for filepath in filepaths:
|
||||
shutil.copy(str(filepath), str(path_studiolights))
|
||||
userpref.studio_lights_refresh()
|
||||
|
||||
# print message
|
||||
msg = (
|
||||
tip_("StudioLight Installed %r into %r") %
|
||||
(", ".join(str(x.name) for x in self.files), str(path_studiolights))
|
||||
)
|
||||
print(msg)
|
||||
self.report({'INFO'}, msg)
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
class WM_OT_studiolight_uninstall(Operator):
|
||||
bl_idname = 'wm.studiolight_uninstall'
|
||||
bl_label = "Uninstall Studio Light"
|
||||
index = bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
import pathlib
|
||||
userpref = context.user_preferences
|
||||
for studio_light in userpref.studio_lights:
|
||||
if studio_light.index == self.index:
|
||||
path = pathlib.Path(studio_light.path)
|
||||
if path.exists():
|
||||
path.unlink()
|
||||
userpref.studio_lights_refresh()
|
||||
return {'FINISHED'}
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
class WM_OT_studiolight_expand(Operator):
|
||||
bl_idname = "wm.studiolight_expand"
|
||||
bl_label = "Expand Studio Light"
|
||||
index = bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
userpref = context.user_preferences
|
||||
for studio_light in userpref.studio_lights:
|
||||
if studio_light.index == self.index:
|
||||
studio_light.show_expanded = not studio_light.show_expanded
|
||||
break
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class WM_OT_studiolight_userpref_show(Operator):
|
||||
"""Show light user preferences"""
|
||||
bl_idname = "wm.studiolight_userpref_show"
|
||||
bl_label = ""
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
def execute(self, context):
|
||||
context.user_preferences.active_section = 'LIGHTS'
|
||||
bpy.ops.screen.userpref_show('INVOKE_DEFAULT')
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
classes = (
|
||||
BRUSH_OT_active_index_set,
|
||||
WM_OT_addon_disable,
|
||||
@@ -2442,6 +2572,10 @@ classes = (
|
||||
WM_OT_owner_disable,
|
||||
WM_OT_owner_enable,
|
||||
WM_OT_url_open,
|
||||
WM_OT_studiolight_expand,
|
||||
WM_OT_studiolight_install,
|
||||
WM_OT_studiolight_uninstall,
|
||||
WM_OT_studiolight_userpref_show,
|
||||
WM_OT_tool_set_by_name,
|
||||
WM_OT_toolbar,
|
||||
)
|
||||
|
@@ -88,7 +88,7 @@ _modules = [
|
||||
"space_userpref",
|
||||
"space_view3d",
|
||||
"space_view3d_toolbar",
|
||||
]
|
||||
]
|
||||
|
||||
import bpy
|
||||
|
||||
@@ -167,6 +167,8 @@ def unregister():
|
||||
|
||||
# Define a default UIList, when a list does not need any custom drawing...
|
||||
# Keep in sync with its #defined name in UI_interface.h
|
||||
|
||||
|
||||
class UI_UL_list(bpy.types.UIList):
|
||||
# These are common filtering or ordering operations (same as the default C ones!).
|
||||
@staticmethod
|
||||
|
@@ -37,27 +37,26 @@ class MotionPathButtonsPanel:
|
||||
mps = avs.motion_path
|
||||
|
||||
# Display Range
|
||||
layout.row().prop(mps, "type", expand=True)
|
||||
layout.use_property_split = True
|
||||
layout.row().prop(mps, "type")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Display Range:")
|
||||
sub = col.column(align=True)
|
||||
if mps.type == 'CURRENT_FRAME':
|
||||
sub.prop(mps, "frame_before", text="Before")
|
||||
sub.prop(mps, "frame_before", text="Frame Range Before")
|
||||
sub.prop(mps, "frame_after", text="After")
|
||||
elif mps.type == 'RANGE':
|
||||
sub.prop(mps, "frame_start", text="Start")
|
||||
sub.prop(mps, "frame_start", text="Frame Range Start")
|
||||
sub.prop(mps, "frame_end", text="End")
|
||||
|
||||
sub.prop(mps, "frame_step", text="Step")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
if bones:
|
||||
col.label(text="Cache for Bone:")
|
||||
else:
|
||||
col.label(text="Cache:")
|
||||
col.label(text="Cache")
|
||||
|
||||
if mpath:
|
||||
sub = col.column(align=True)
|
||||
@@ -81,17 +80,15 @@ class MotionPathButtonsPanel:
|
||||
sub.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
|
||||
|
||||
# Display Settings
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Show:")
|
||||
layout.label(text="Display")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
|
||||
if mpath is not None:
|
||||
col.prop(mpath, "lines", text="Lines")
|
||||
col.prop(mpath, "line_thickness", text="Thickness")
|
||||
|
||||
col = split.column()
|
||||
col.label("")
|
||||
col.prop(mps, "show_keyframe_highlight", text="Keyframes")
|
||||
sub = col.column()
|
||||
sub.enabled = mps.show_keyframe_highlight
|
||||
@@ -101,11 +98,11 @@ class MotionPathButtonsPanel:
|
||||
|
||||
# Customize path
|
||||
if mpath is not None:
|
||||
row = layout.row(align=True)
|
||||
row.prop(mpath, "use_custom_color", text="", toggle=True, icon='COLOR')
|
||||
sub = row.row(align=True)
|
||||
|
||||
col.prop(mpath, "use_custom_color", text="Custom Color")
|
||||
sub = col.column()
|
||||
sub.enabled = mpath.use_custom_color
|
||||
sub.prop(mpath, "color", text="")
|
||||
sub.prop(mpath, "color")
|
||||
|
||||
|
||||
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
|
||||
|
@@ -941,6 +941,7 @@ class BONE_PT_constraints(ConstraintButtonsPanel, Panel):
|
||||
for con in context.pose_bone.constraints:
|
||||
self.draw_constraint(context, con)
|
||||
|
||||
|
||||
classes = (
|
||||
OBJECT_PT_constraints,
|
||||
BONE_PT_constraints,
|
||||
|
@@ -77,15 +77,13 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "draw_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(arm, "show_names", text="Names")
|
||||
col.prop(arm, "show_axes", text="Axes")
|
||||
col.prop(arm, "show_bone_custom_shapes", text="Shapes")
|
||||
|
||||
col = split.column()
|
||||
col.prop(arm, "show_group_colors", text="Colors")
|
||||
col.prop(arm, "show_group_colors", text="Group Colors")
|
||||
if ob:
|
||||
col.prop(ob, "show_x_ray", text="X-Ray")
|
||||
col.prop(arm, "use_deform_delay", text="Delay Refresh")
|
||||
@@ -149,7 +147,8 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_assign", text="Assign")
|
||||
sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
# row.operator("pose.bone_group_remove_from", text="Remove")
|
||||
sub.operator("pose.group_unassign", text="Remove")
|
||||
|
||||
sub = row.row(align=True)
|
||||
sub.operator("pose.group_select", text="Select")
|
||||
@@ -196,7 +195,11 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
|
||||
if pose_marker_active is not None:
|
||||
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
|
||||
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
|
||||
col.operator(
|
||||
"poselib.apply_pose",
|
||||
icon='ZOOM_SELECTED',
|
||||
text="",
|
||||
).pose_index = poselib.pose_markers.active_index
|
||||
|
||||
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
|
||||
|
||||
@@ -216,21 +219,19 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(arm, "ghost_type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
col = layout.column(align=True)
|
||||
|
||||
if arm.ghost_type == 'RANGE':
|
||||
col.prop(arm, "ghost_frame_start", text="Start")
|
||||
col.prop(arm, "ghost_frame_start", text="Frame Start")
|
||||
col.prop(arm, "ghost_frame_end", text="End")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
elif arm.ghost_type == 'CURRENT_FRAME':
|
||||
col.prop(arm, "ghost_step", text="Range")
|
||||
col.prop(arm, "ghost_step", text="Frame Range")
|
||||
col.prop(arm, "ghost_size", text="Step")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
|
||||
col.prop(arm, "show_only_ghost_selected", text="Display Selected Only")
|
||||
|
||||
|
||||
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
@@ -244,6 +245,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
itasc = ob.pose.ik_param
|
||||
@@ -251,34 +253,37 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
layout.prop(ob.pose, "ik_solver")
|
||||
|
||||
if itasc:
|
||||
layout.use_property_split = False
|
||||
layout.row().prop(itasc, "mode", expand=True)
|
||||
layout.use_property_split = True
|
||||
simulation = (itasc.mode == 'SIMULATION')
|
||||
if simulation:
|
||||
layout.label(text="Reiteration:")
|
||||
layout.row().prop(itasc, "reiteration_method", expand=True)
|
||||
layout.prop(itasc, "reiteration_method", expand=False)
|
||||
|
||||
row = layout.row()
|
||||
row.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
row.prop(itasc, "precision")
|
||||
row.prop(itasc, "iterations")
|
||||
col = layout.column()
|
||||
col.active = not simulation or itasc.reiteration_method != 'NEVER'
|
||||
col.prop(itasc, "precision")
|
||||
col.prop(itasc, "iterations")
|
||||
|
||||
if simulation:
|
||||
layout.prop(itasc, "use_auto_step")
|
||||
row = layout.row()
|
||||
col = layout.column(align=True)
|
||||
if itasc.use_auto_step:
|
||||
row.prop(itasc, "step_min", text="Min")
|
||||
row.prop(itasc, "step_max", text="Max")
|
||||
col.prop(itasc, "step_min", text="Steps Min")
|
||||
col.prop(itasc, "step_max", text="Max")
|
||||
else:
|
||||
row.prop(itasc, "step_count")
|
||||
col.prop(itasc, "step_count", text="Steps")
|
||||
|
||||
layout.prop(itasc, "solver")
|
||||
if simulation:
|
||||
layout.prop(itasc, "feedback")
|
||||
layout.prop(itasc, "velocity_max")
|
||||
if itasc.solver == 'DLS':
|
||||
row = layout.row()
|
||||
row.prop(itasc, "damping_max", text="Damp", slider=True)
|
||||
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
col.prop(itasc, "damping_max", text="Damping Max", slider=True)
|
||||
col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True)
|
||||
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
|
@@ -62,88 +62,63 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
|
||||
col = layout.column()
|
||||
|
||||
if bone and ob:
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.prop(pchan, "location")
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
|
||||
col = row.column()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "location")
|
||||
sub.prop(pchan, "lock_location", text="")
|
||||
|
||||
col = layout.column()
|
||||
if pchan.rotation_mode == 'QUATERNION':
|
||||
col.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
elif pchan.rotation_mode == 'AXIS_ANGLE':
|
||||
#col.label(text="Rotation")
|
||||
# col.label(text="Rotation")
|
||||
#col.prop(pchan, "rotation_angle", text="Angle")
|
||||
#col.prop(pchan, "rotation_axis", text="Axis")
|
||||
col.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(pchan, "lock_rotation_w", text="")
|
||||
subsub.prop(pchan, "lock_rotation", text="")
|
||||
else:
|
||||
col.prop(pchan, "rotation_euler", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "rotation_euler", text="Rotation")
|
||||
sub.prop(pchan, "lock_rotation", text="")
|
||||
|
||||
row.column().prop(pchan, "scale")
|
||||
col = layout.column()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(pchan, "scale")
|
||||
sub.prop(pchan, "lock_scale", text="")
|
||||
|
||||
layout.prop(pchan, "rotation_mode")
|
||||
col = layout.column()
|
||||
col.prop(pchan, "rotation_mode")
|
||||
|
||||
elif context.edit_bone:
|
||||
bone = context.edit_bone
|
||||
row = layout.row()
|
||||
row.column().prop(bone, "head")
|
||||
row.column().prop(bone, "tail")
|
||||
col = layout.column()
|
||||
col.prop(bone, "head")
|
||||
col.prop(bone, "tail")
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Roll:")
|
||||
sub.prop(bone, "roll", text="")
|
||||
sub.label()
|
||||
sub.prop(bone, "lock")
|
||||
col = layout.column()
|
||||
col.prop(bone, "roll")
|
||||
col.prop(bone, "lock")
|
||||
|
||||
|
||||
class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
return ob and ob.mode == 'POSE' and context.bone
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
col = split.column()
|
||||
col.active = not (bone.parent and bone.use_connect)
|
||||
col.prop(pchan, "lock_location", text="Location")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_rotation", text="Rotation")
|
||||
|
||||
col = split.column()
|
||||
col.prop(pchan, "lock_scale", text="Scale")
|
||||
|
||||
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = pchan.lock_rotations_4d
|
||||
sub.prop(pchan, "lock_rotation_w", text="W")
|
||||
col = layout.column()
|
||||
col.prop(bone, "tail_radius")
|
||||
col.prop(bone, "envelope_distance")
|
||||
|
||||
|
||||
class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
@@ -166,54 +141,52 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
|
||||
bbone = bone
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
layout.prop(bone, "bbone_segments", text="Segments")
|
||||
|
||||
col = layout.column()
|
||||
col.active = bone.bbone_segments > 1
|
||||
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Curve XY Offsets:")
|
||||
sub.prop(bbone, "bbone_curveinx", text="In X")
|
||||
sub.prop(bbone, "bbone_curveoutx", text="Out X")
|
||||
sub.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
sub.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveinx", text="Curve In X")
|
||||
col.prop(bbone, "bbone_curveiny", text="In Y")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label("Roll:")
|
||||
sub.prop(bbone, "bbone_rollin", text="In")
|
||||
sub.prop(bbone, "bbone_rollout", text="Out")
|
||||
sub.prop(bone, "use_endroll_as_inroll")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_curveoutx", text="Curve Out X")
|
||||
col.prop(bbone, "bbone_curveouty", text="Out Y")
|
||||
|
||||
row = col.row()
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Scale:")
|
||||
sub.prop(bbone, "bbone_scalein", text="In")
|
||||
sub.prop(bbone, "bbone_scaleout", text="Out")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_rollin", text="Roll In")
|
||||
col.prop(bbone, "bbone_rollout", text="Out")
|
||||
col.prop(bone, "use_endroll_as_inroll")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label("Easing:")
|
||||
sub.prop(bbone, "bbone_easein", text="In")
|
||||
sub.prop(bbone, "bbone_easeout", text="Out")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_scalein", text="Scale In")
|
||||
col.prop(bbone, "bbone_scaleout", text="Out")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(bbone, "bbone_easein", text="Ease In")
|
||||
col.prop(bbone, "bbone_easeout", text="Out")
|
||||
|
||||
if pchan:
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
col.prop(pchan, "use_bbone_custom_handles")
|
||||
|
||||
row = col.row()
|
||||
row.active = pchan.use_bbone_custom_handles
|
||||
col = layout.column(align=True)
|
||||
col.active = pchan.use_bbone_custom_handles
|
||||
col.use_property_split = True
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="In:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative")
|
||||
sub = col.column()
|
||||
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="Custom Handle Start")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="End")
|
||||
|
||||
sub = row.column(align=True)
|
||||
sub.label(text="Out:")
|
||||
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="Relative")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative Handle Start")
|
||||
sub.prop(pchan, "use_bbone_relative_end_handle", text="End")
|
||||
|
||||
|
||||
class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
@@ -221,6 +194,7 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -232,26 +206,22 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
|
||||
elif bone is None:
|
||||
bone = context.edit_bone
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Layers:")
|
||||
col = layout.column()
|
||||
col.use_property_split = False
|
||||
col.prop(bone, "layers", text="")
|
||||
col.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
|
||||
if ob and pchan:
|
||||
col.label(text="Bone Group:")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
|
||||
col.label(text="Object Children:")
|
||||
col.prop(bone, "use_relative_parent")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
if context.bone:
|
||||
col.prop(bone, "parent", text="")
|
||||
col.prop(bone, "parent")
|
||||
else:
|
||||
col.prop_search(bone, "parent", arm, "edit_bones", text="")
|
||||
col.prop_search(bone, "parent", arm, "edit_bones")
|
||||
|
||||
if ob and pchan:
|
||||
col.prop(bone, "use_relative_parent")
|
||||
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="Bone Group")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (bone.parent is not None)
|
||||
@@ -274,6 +244,7 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
# note. this works ok in edit-mode but isn't
|
||||
# all that useful so disabling for now.
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
@@ -285,23 +256,20 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
|
||||
bone = context.edit_bone
|
||||
|
||||
if bone:
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(bone, "hide", text="Hide")
|
||||
sub = col.column()
|
||||
sub.active = bool(pchan and pchan.custom_shape)
|
||||
sub.prop(bone, "show_wire", text="Wireframe")
|
||||
|
||||
if pchan:
|
||||
col = split.column()
|
||||
|
||||
col.label(text="Custom Shape:")
|
||||
col.prop(pchan, "custom_shape", text="")
|
||||
col = layout.column()
|
||||
col.prop(pchan, "custom_shape")
|
||||
if pchan.custom_shape:
|
||||
col.prop(pchan, "use_custom_shape_bone_size", text="Bone Size")
|
||||
col.prop(pchan, "custom_shape_scale", text="Scale")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
|
||||
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones")
|
||||
|
||||
|
||||
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
@@ -315,80 +283,82 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
bone = context.bone
|
||||
pchan = ob.pose.bones[bone.name]
|
||||
|
||||
row = layout.row()
|
||||
|
||||
active = pchan.is_in_ik_chain
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_x", text="X")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_x is False and active
|
||||
col = layout.column()
|
||||
col.prop(pchan, "ik_stretch", slider=True)
|
||||
col.active = active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
layout.separator()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit")
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.prop(pchan, "lock_ik_x", text="Lock IK X")
|
||||
col.prop(pchan, "lock_ik_y", text="Y")
|
||||
col.prop(pchan, "lock_ik_z", text="Z")
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_x", text="")
|
||||
sub.prop(pchan, "ik_max_x", text="")
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_y", text="Y")
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
|
||||
row.active = pchan.lock_ik_y is False and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit")
|
||||
sub.prop(pchan, "ik_stiffness_x", text="Stiffness X", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "ik_stiffness_y", text="Y", slider=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Z", slider=True)
|
||||
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_y", text="")
|
||||
sub.prop(pchan, "ik_max_y", text="")
|
||||
col = layout.column(align=True)
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_x is False and active
|
||||
sub.prop(pchan, "use_ik_limit_x", text="Limit X")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
sub.prop(pchan, "ik_min_x", text="Min")
|
||||
sub.prop(pchan, "ik_max_x", text="Max")
|
||||
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_y is False and active
|
||||
sub.prop(pchan, "use_ik_limit_y", text="Limit Y")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
|
||||
sub.prop(pchan, "ik_min_y", text="Min")
|
||||
sub.prop(pchan, "ik_max_y", text="Max")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_z", text="Z")
|
||||
split.active = active
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit Z")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
sub = split.row()
|
||||
|
||||
sub.prop(pchan, "use_ik_limit_z", text="Limit")
|
||||
sub.active = pchan.lock_ik_z is False and active
|
||||
sub = split.row(align=True)
|
||||
sub.prop(pchan, "ik_min_z", text="")
|
||||
sub.prop(pchan, "ik_max_z", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
|
||||
sub.prop(pchan, "ik_min_z", text="Min")
|
||||
sub.prop(pchan, "ik_max_z", text="Max")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.label(text="Stretch:")
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stretch", text="", slider=True)
|
||||
sub.active = active
|
||||
col.separator()
|
||||
|
||||
if ob.pose.ik_solver == 'ITASC':
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
|
||||
col = layout.column()
|
||||
col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
|
||||
col.active = active
|
||||
col = split.column()
|
||||
col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(pchan, "ik_rotation_weight", text="IK Rotation Weight", slider=True)
|
||||
col.active = active
|
||||
# not supported yet
|
||||
#row = layout.row()
|
||||
@@ -410,6 +380,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
bone = context.bone
|
||||
|
||||
@@ -418,17 +389,15 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
|
||||
layout.active = bone.use_deform
|
||||
|
||||
row = layout.row()
|
||||
col = layout.column()
|
||||
col.prop(bone, "envelope_distance", text="Envelope Distance")
|
||||
col.prop(bone, "envelope_weight", text="Envelope Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Envelope Multiply")
|
||||
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope:")
|
||||
col.prop(bone, "envelope_distance", text="Distance")
|
||||
col.prop(bone, "envelope_weight", text="Weight")
|
||||
col.prop(bone, "use_envelope_multiply", text="Multiply")
|
||||
col.separator()
|
||||
|
||||
col = row.column(align=True)
|
||||
col.label(text="Envelope Radius:")
|
||||
col.prop(bone, "head_radius", text="Head")
|
||||
col = layout.column(align=True)
|
||||
col.prop(bone, "head_radius", text="Radius Head")
|
||||
col.prop(bone, "tail_radius", text="Tail")
|
||||
|
||||
|
||||
@@ -448,7 +417,6 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
|
||||
classes = (
|
||||
BONE_PT_context_bone,
|
||||
BONE_PT_transform,
|
||||
BONE_PT_transform_locks,
|
||||
BONE_PT_curved,
|
||||
BONE_PT_relations,
|
||||
BONE_PT_display,
|
||||
|
@@ -76,21 +76,22 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.row().prop(cam, "type", expand=True)
|
||||
layout.prop(cam, "type")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
if cam.type == 'PERSP':
|
||||
row = col.row()
|
||||
col = layout.column()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
row.prop(cam, "lens")
|
||||
col.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
col.prop(cam, "lens_unit")
|
||||
|
||||
elif cam.type == 'ORTHO':
|
||||
col.prop(cam, "ortho_scale")
|
||||
@@ -99,40 +100,37 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
engine = context.engine
|
||||
if engine == 'CYCLES':
|
||||
ccam = cam.cycles
|
||||
col.prop(ccam, "panorama_type", text="Type")
|
||||
col.prop(ccam, "panorama_type")
|
||||
if ccam.panorama_type == 'FISHEYE_EQUIDISTANT':
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'FISHEYE_EQUISOLID':
|
||||
row = layout.row()
|
||||
row.prop(ccam, "fisheye_lens", text="Lens")
|
||||
row.prop(ccam, "fisheye_fov")
|
||||
col.prop(ccam, "fisheye_lens", text="Lens")
|
||||
col.prop(ccam, "fisheye_fov")
|
||||
elif ccam.panorama_type == 'EQUIRECTANGULAR':
|
||||
row = layout.row()
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "latitude_min")
|
||||
sub.prop(ccam, "latitude_max")
|
||||
sub = row.column(align=True)
|
||||
sub.prop(ccam, "longitude_min")
|
||||
sub.prop(ccam, "longitude_max")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "latitude_min", text="Latitute Min")
|
||||
sub.prop(ccam, "latitude_max", text="Max")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(ccam, "longitude_min", text="Longiture Min")
|
||||
sub.prop(ccam, "longitude_max", text="Max")
|
||||
elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}:
|
||||
row = col.row()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
row.prop(cam, "lens")
|
||||
col.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'FOV':
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
col.prop(cam, "angle")
|
||||
col.prop(cam, "lens_unit")
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Shift:")
|
||||
col.prop(cam, "shift_x", text="X")
|
||||
col.prop(cam, "shift_y", text="Y")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "shift_x", text="Shift X")
|
||||
sub.prop(cam, "shift_y", text="Y")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Clipping:")
|
||||
col.prop(cam, "clip_start", text="Start")
|
||||
col.prop(cam, "clip_end", text="End")
|
||||
col.separator()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(cam, "clip_start", text="Clip Start")
|
||||
sub.prop(cam, "clip_end", text="End")
|
||||
|
||||
|
||||
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
@@ -147,6 +145,8 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
render = context.scene.render
|
||||
st = context.camera.stereo
|
||||
cam = context.camera
|
||||
@@ -154,9 +154,9 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
|
||||
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
|
||||
|
||||
col = layout.column()
|
||||
col.row().prop(st, "convergence_mode", expand=True)
|
||||
layout.prop(st, "convergence_mode")
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = st.convergence_mode != 'PARALLEL'
|
||||
sub.prop(st, "convergence_distance")
|
||||
@@ -165,20 +165,20 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
if is_spherical_stereo:
|
||||
col.separator()
|
||||
row = col.row()
|
||||
row.prop(st, "use_spherical_stereo")
|
||||
sub = row.row()
|
||||
col.prop(st, "use_spherical_stereo")
|
||||
sub = col.column()
|
||||
sub.active = st.use_spherical_stereo
|
||||
sub.prop(st, "use_pole_merge")
|
||||
row = col.row(align=True)
|
||||
row.active = st.use_pole_merge
|
||||
row.prop(st, "pole_merge_angle_from")
|
||||
row.prop(st, "pole_merge_angle_to")
|
||||
|
||||
col.label(text="Pivot:")
|
||||
row = col.row()
|
||||
row.active = not use_spherical_stereo
|
||||
row.prop(st, "pivot", expand=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = st.use_pole_merge
|
||||
sub.prop(st, "pole_merge_angle_from", text="Pole Merge Angle Start")
|
||||
sub.prop(st, "pole_merge_angle_to", text="End")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not use_spherical_stereo
|
||||
col.separator()
|
||||
col.prop(st, "pivot")
|
||||
|
||||
|
||||
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
@@ -196,57 +196,55 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
layout.label(text="Sensor:")
|
||||
layout.use_property_split = True
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.prop(cam, "sensor_fit")
|
||||
|
||||
col = split.column(align=True)
|
||||
if cam.sensor_fit == 'AUTO':
|
||||
col.prop(cam, "sensor_width", text="Size")
|
||||
col.prop(cam, "sensor_width")
|
||||
else:
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'HORIZONTAL'
|
||||
sub.prop(cam, "sensor_width", text="Width")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.active = cam.sensor_fit == 'VERTICAL'
|
||||
sub.prop(cam, "sensor_height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(cam, "sensor_fit", text="")
|
||||
|
||||
|
||||
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
|
||||
bl_label = "Depth of Field"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
dof_options = cam.gpu_dof
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Focus:")
|
||||
col.prop(cam, "dof_object", text="")
|
||||
col = layout.column()
|
||||
col.prop(cam, "dof_object", text="Focus on Object")
|
||||
sub = col.column()
|
||||
sub.active = (cam.dof_object is None)
|
||||
sub.prop(cam, "dof_distance", text="Distance")
|
||||
sub.prop(cam, "dof_distance", text="Focus Distance")
|
||||
|
||||
col.separator()
|
||||
|
||||
if context.engine == 'BLENDER_EEVEE':
|
||||
col = split.column(align=True)
|
||||
col.label("Aperture:")
|
||||
col = layout.column()
|
||||
col.label("Aperture")
|
||||
engine = context.engine
|
||||
sub = col.column(align=True)
|
||||
sub.prop(dof_options, "fstop")
|
||||
sub.prop(dof_options, "blades")
|
||||
sub.prop(dof_options, "rotation")
|
||||
sub.prop(dof_options, "ratio")
|
||||
col.prop(dof_options, "fstop")
|
||||
col.prop(dof_options, "blades")
|
||||
col.prop(dof_options, "rotation")
|
||||
col.prop(dof_options, "ratio")
|
||||
else:
|
||||
hq_support = dof_options.is_hq_supported
|
||||
col = split.column(align=True)
|
||||
col.label("Viewport:")
|
||||
col = layout.column()
|
||||
col.label("Viewport")
|
||||
sub = col.column()
|
||||
sub.active = hq_support
|
||||
sub.prop(dof_options, "use_high_quality")
|
||||
@@ -358,24 +356,21 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
|
||||
|
||||
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
split = layout.split()
|
||||
split.label()
|
||||
split.prop_menu_enum(cam, "show_guide")
|
||||
|
||||
col = split.column()
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
col = split.column()
|
||||
col.prop_menu_enum(cam, "show_guide")
|
||||
col.separator()
|
||||
col.prop(cam, "draw_size", text="Size")
|
||||
col.separator()
|
||||
@@ -384,6 +379,13 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
sub.active = cam.show_passepartout
|
||||
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
bl_label = "Safe Areas"
|
||||
@@ -413,27 +415,30 @@ def draw_display_safe_settings(layout, safe_data, settings):
|
||||
show_safe_areas = settings.show_safe_areas
|
||||
show_safe_center = settings.show_safe_center
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
row = col.row(align=True)
|
||||
row = layout.row(align=True)
|
||||
row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label)
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
col = split.column()
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = show_safe_areas
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(safe_data, "title", slider=True)
|
||||
sub.prop(safe_data, "action", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(settings, "show_safe_center", text="Center-Cut Safe Areas")
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.active = show_safe_areas
|
||||
col.prop(safe_data, "title", slider=True)
|
||||
col.prop(safe_data, "action", slider=True)
|
||||
|
||||
col = split.column()
|
||||
col.active = show_safe_areas and show_safe_center
|
||||
col.prop(safe_data, "title_center", slider=True)
|
||||
col.prop(safe_data, "action_center", slider=True)
|
||||
sub = col.column()
|
||||
sub.active = show_safe_areas and show_safe_center
|
||||
sub.prop(safe_data, "title_center", slider=True)
|
||||
sub.prop(safe_data, "action_center", slider=True)
|
||||
|
||||
|
||||
classes = (
|
||||
@@ -445,8 +450,8 @@ classes = (
|
||||
DATA_PT_camera_stereoscopy,
|
||||
DATA_PT_camera_dof,
|
||||
DATA_PT_camera_display,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_camera_safe_areas,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_custom_props_camera,
|
||||
)
|
||||
|
||||
|
@@ -93,43 +93,42 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
|
||||
row = layout.row()
|
||||
row.prop(curve, "dimensions", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Resolution Preview U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "resolution_v", text="V")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_u", text="Preview U")
|
||||
sub.prop(curve, "render_resolution_u", text="Render U")
|
||||
if is_surf:
|
||||
sub.prop(curve, "render_resolution_v", text="V")
|
||||
col.separator()
|
||||
|
||||
if is_curve:
|
||||
col.label(text="Twisting:")
|
||||
col.prop(curve, "twist_mode", text="")
|
||||
col.prop(curve, "twist_mode")
|
||||
col.prop(curve, "twist_smooth", text="Smooth")
|
||||
elif is_text:
|
||||
col.label(text="Display:")
|
||||
col.prop(curve, "use_fast_edit", text="Fast Editing")
|
||||
|
||||
col = split.column()
|
||||
|
||||
if is_surf:
|
||||
sub = col.column()
|
||||
sub.label(text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "resolution_v", text="Preview V")
|
||||
sub.prop(curve, "render_resolution_v", text="Render V")
|
||||
|
||||
if is_curve or is_text:
|
||||
col.label(text="Fill:")
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
|
||||
sub.prop(curve, "fill_mode", text="")
|
||||
sub.prop(curve, "fill_mode")
|
||||
col.prop(curve, "use_fill_deform")
|
||||
|
||||
if is_curve:
|
||||
col.label(text="Path/Curve-Deform:")
|
||||
col = layout.column()
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
subsub = sub.row()
|
||||
subsub.prop(curve, "use_radius")
|
||||
subsub.prop(curve, "use_stretch")
|
||||
sub.prop(curve, "use_radius")
|
||||
sub.prop(curve, "use_stretch")
|
||||
sub.prop(curve, "use_deform_bounds")
|
||||
|
||||
|
||||
@@ -140,16 +139,17 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_auto_texspace")
|
||||
row.prop(curve, "use_uv_as_generated")
|
||||
col = layout.column()
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location", text="Location")
|
||||
row.column().prop(curve, "texspace_size", text="Size")
|
||||
col = layout.column()
|
||||
col.prop(curve, "texspace_location")
|
||||
col.prop(curve, "texspace_size")
|
||||
|
||||
layout.operator("curve.match_texture_space")
|
||||
|
||||
@@ -163,49 +163,65 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Modification:")
|
||||
col = layout.column()
|
||||
col.prop(curve, "offset")
|
||||
col.prop(curve, "extrude")
|
||||
col.label(text="Taper Object:")
|
||||
col.prop(curve, "taper_object", text="")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Bevel:")
|
||||
col.prop(curve, "bevel_depth", text="Depth")
|
||||
col.prop(curve, "bevel_resolution", text="Resolution")
|
||||
col.label(text="Bevel Object:")
|
||||
col.prop(curve, "bevel_object", text="")
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "extrude")
|
||||
|
||||
col.prop(curve, "taper_object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel):
|
||||
bl_label = "Bevel"
|
||||
bl_parent_id = "DATA_PT_geometry_curve"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (type(context.curve) in {Curve, TextCurve})
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = (curve.bevel_object is None)
|
||||
sub.prop(curve, "bevel_depth", text="Depth")
|
||||
sub.prop(curve, "bevel_resolution", text="Resolution")
|
||||
|
||||
col.prop(curve, "bevel_object", text="Object")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
|
||||
if type(curve) is not TextCurve:
|
||||
col = layout.column(align=True)
|
||||
row = col.row()
|
||||
row.label(text="Bevel Factor:")
|
||||
|
||||
col = layout.column()
|
||||
col.active = (
|
||||
(curve.bevel_depth > 0.0) or
|
||||
(curve.extrude > 0.0) or
|
||||
(curve.bevel_object is not None))
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_start", text="")
|
||||
row.prop(curve, "bevel_factor_start", text="Start")
|
||||
row = col.row(align=True)
|
||||
row.prop(curve, "bevel_factor_mapping_end", text="")
|
||||
row.prop(curve, "bevel_factor_end", text="End")
|
||||
(curve.bevel_object is not None)
|
||||
)
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_start", text="Bevel Start")
|
||||
sub.prop(curve, "bevel_factor_end", text="End")
|
||||
|
||||
row = layout.row()
|
||||
sub = row.row()
|
||||
sub.active = curve.taper_object is not None
|
||||
sub.prop(curve, "use_map_taper")
|
||||
sub = row.row()
|
||||
sub.active = curve.bevel_object is not None
|
||||
sub.prop(curve, "use_fill_caps")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(curve, "bevel_factor_mapping_start", text="Bevel Mapping Start")
|
||||
sub.prop(curve, "bevel_factor_mapping_end", text="End")
|
||||
|
||||
|
||||
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
@@ -218,6 +234,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
|
||||
@@ -228,8 +245,9 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
|
||||
col.prop(curve, "eval_time")
|
||||
|
||||
# these are for paths only
|
||||
row = layout.row()
|
||||
row.prop(curve, "use_path_follow")
|
||||
col.separator()
|
||||
|
||||
col.prop(curve, "use_path_follow")
|
||||
|
||||
|
||||
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
@@ -237,65 +255,64 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
curve = context.curve
|
||||
act_spline = curve.splines.active
|
||||
is_surf = type(curve) is SurfaceCurve
|
||||
is_poly = (act_spline.type == 'POLY')
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
if is_poly:
|
||||
# These settings are below but its easier to have
|
||||
# polys set aside since they use so few settings
|
||||
row = layout.row()
|
||||
row.label(text="Cyclic:")
|
||||
row.prop(act_spline, "use_cyclic_u", text="U")
|
||||
|
||||
layout.prop(act_spline, "use_smooth")
|
||||
col.prop(act_spline, "use_cyclic_u")
|
||||
col.prop(act_spline, "use_smooth")
|
||||
else:
|
||||
col = split.column()
|
||||
col.label(text="Cyclic:")
|
||||
if act_spline.type == 'NURBS':
|
||||
col.label(text="Bezier:")
|
||||
col.label(text="Endpoint:")
|
||||
col.label(text="Order:")
|
||||
|
||||
col.label(text="Resolution:")
|
||||
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_u", text="U")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_cyclic_u")
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "use_cyclic_v", text="V")
|
||||
|
||||
if act_spline.type == 'NURBS':
|
||||
sub = col.column()
|
||||
sub = col.column(align=True)
|
||||
# sub.active = (not act_spline.use_cyclic_u)
|
||||
sub.prop(act_spline, "use_bezier_u", text="U")
|
||||
sub.prop(act_spline, "use_endpoint_u", text="U")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(act_spline, "order_u", text="U")
|
||||
col.prop(act_spline, "resolution_u", text="U")
|
||||
sub.prop(act_spline, "use_bezier_u", text="Bezier U")
|
||||
|
||||
if is_surf:
|
||||
col = split.column()
|
||||
col.prop(act_spline, "use_cyclic_v", text="V")
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_bezier_v", text="V")
|
||||
|
||||
# its a surface, assume its a nurbs
|
||||
sub = col.column()
|
||||
sub.active = (not act_spline.use_cyclic_v)
|
||||
sub.prop(act_spline, "use_bezier_v", text="V")
|
||||
sub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
sub = col.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "use_endpoint_u", text="Endpoint U")
|
||||
|
||||
if is_surf:
|
||||
subsub = sub.column()
|
||||
subsub.active = (not act_spline.use_cyclic_v)
|
||||
subsub.prop(act_spline, "use_endpoint_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "order_u", text="Order U")
|
||||
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "order_v", text="V")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(act_spline, "resolution_u", text="Resolution U")
|
||||
if is_surf:
|
||||
sub.prop(act_spline, "resolution_v", text="V")
|
||||
|
||||
if act_spline.type == 'BEZIER':
|
||||
col = layout.column()
|
||||
col.label(text="Interpolation:")
|
||||
|
||||
col.separator()
|
||||
|
||||
sub = col.column()
|
||||
sub.active = (curve.dimensions == '3D')
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Tilt")
|
||||
sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt")
|
||||
|
||||
col.prop(act_spline, "radius_interpolation", text="Radius")
|
||||
|
||||
@@ -324,42 +341,46 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
|
||||
row.label(text="Bold & Italic")
|
||||
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
||||
|
||||
# layout.prop(text, "font")
|
||||
layout.separator()
|
||||
|
||||
split = layout.split()
|
||||
row = layout.row(align=True)
|
||||
row.prop(char, "use_bold", toggle=True)
|
||||
row.prop(char, "use_italic", toggle=True)
|
||||
row.prop(char, "use_underline", toggle=True)
|
||||
row.prop(char, "use_small_caps", toggle=True)
|
||||
|
||||
|
||||
class DATA_PT_font_transform(CurveButtonsPanelText, Panel):
|
||||
bl_label = "Transform"
|
||||
bl_parent_id = "DATA_PT_font"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
text = context.curve
|
||||
char = context.curve.edit_format
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.prop(text, "size", text="Size")
|
||||
col = split.column()
|
||||
col.prop(text, "shear")
|
||||
|
||||
split = layout.split()
|
||||
col.separator()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Object Font:")
|
||||
col.prop(text, "family", text="")
|
||||
col.prop(text, "family")
|
||||
col.prop(text, "follow_curve")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Text on Curve:")
|
||||
col.prop(text, "follow_curve", text="")
|
||||
col.separator()
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Underline:")
|
||||
sub.prop(text, "underline_position", text="Position")
|
||||
sub.prop(text, "underline_height", text="Thickness")
|
||||
sub.prop(text, "underline_position", text="Underline Position")
|
||||
sub.prop(text, "underline_height", text="Underline Thickness")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Character:")
|
||||
col.prop(char, "use_bold")
|
||||
col.prop(char, "use_italic")
|
||||
col.prop(char, "use_underline")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(text, "small_caps_scale", text="Small Caps")
|
||||
row.prop(char, "use_small_caps")
|
||||
col.prop(text, "small_caps_scale", text="Small Caps Scale")
|
||||
|
||||
|
||||
class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
@@ -370,23 +391,40 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.label(text="Horizontal Alignment:")
|
||||
layout.row().prop(text, "align_x", expand=True)
|
||||
|
||||
layout.label(text="Vertical Alignment:")
|
||||
class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel):
|
||||
bl_parent_id = "DATA_PT_paragraph"
|
||||
bl_label = "Alignment"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
text = context.curve
|
||||
|
||||
layout.row().prop(text, "align_x", expand=True)
|
||||
layout.row().prop(text, "align_y", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Spacing:")
|
||||
col.prop(text, "space_character", text="Letter")
|
||||
col.prop(text, "space_word", text="Word")
|
||||
col.prop(text, "space_line", text="Line")
|
||||
class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel):
|
||||
bl_parent_id = "DATA_PT_paragraph"
|
||||
bl_label = "Spacing"
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Offset:")
|
||||
col.prop(text, "offset_x", text="X")
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
text = context.curve
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "space_character", text="Character Spacing")
|
||||
col.prop(text, "space_word", text="Word Spacing")
|
||||
col.prop(text, "space_line", text="Line Spacing")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(text, "offset_x", text="Offset X")
|
||||
col.prop(text, "offset_y", text="Y")
|
||||
|
||||
|
||||
@@ -398,10 +436,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
text = context.curve
|
||||
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.operator("font.textbox_add", icon='ZOOMIN')
|
||||
col = split.column()
|
||||
layout.operator("font.textbox_add", icon='ZOOMIN')
|
||||
|
||||
for i, box in enumerate(text.text_boxes):
|
||||
|
||||
@@ -409,19 +444,16 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
|
||||
|
||||
row = boxy.row()
|
||||
|
||||
split = row.split()
|
||||
col = row.column()
|
||||
col.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "width", text="Size X")
|
||||
sub.prop(box, "height", text="Y")
|
||||
|
||||
col.label(text="Dimensions:")
|
||||
col.prop(box, "width", text="Width")
|
||||
col.prop(box, "height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label(text="Offset:")
|
||||
col.prop(box, "x", text="X")
|
||||
col.prop(box, "y", text="Y")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(box, "x", text="Offset X")
|
||||
sub.prop(box, "y", text="Y")
|
||||
|
||||
row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i
|
||||
|
||||
@@ -437,10 +469,14 @@ classes = (
|
||||
DATA_PT_shape_curve,
|
||||
DATA_PT_curve_texture_space,
|
||||
DATA_PT_geometry_curve,
|
||||
DATA_PT_geometry_curve_bevel,
|
||||
DATA_PT_pathanim,
|
||||
DATA_PT_active_spline,
|
||||
DATA_PT_font,
|
||||
DATA_PT_font_transform,
|
||||
DATA_PT_paragraph,
|
||||
DATA_PT_paragraph_alignment,
|
||||
DATA_PT_paragraph_spacing,
|
||||
DATA_PT_text_boxes,
|
||||
DATA_PT_custom_props_curve,
|
||||
)
|
||||
|
@@ -36,10 +36,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
layout.prop(ob, "empty_draw_type", text="Display")
|
||||
layout.prop(ob, "empty_draw_type", text="Display As")
|
||||
|
||||
if ob.empty_draw_type == 'IMAGE':
|
||||
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
|
||||
@@ -49,9 +50,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
|
||||
row = layout.row(align=True)
|
||||
|
||||
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
|
||||
row = layout.row(align=True)
|
||||
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
|
||||
col = layout.col(align=True)
|
||||
col.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
col.prop(ob, "empty_image_offset", text="Y", index=1)
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(ob, "empty_draw_size", text="Size")
|
||||
|
||||
|
@@ -80,27 +80,27 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
col = col.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT'}:
|
||||
sub.label(text="Falloff:")
|
||||
sub.prop(lamp, "falloff_type", text="")
|
||||
sub.prop(lamp, "distance")
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
|
||||
col = col.column()
|
||||
col.label(text="Falloff")
|
||||
col.prop(lamp, "falloff_type")
|
||||
col.prop(lamp, "distance")
|
||||
col.prop(lamp, "shadow_soft_size")
|
||||
|
||||
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
|
||||
col.label(text="Attenuation Factors:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
|
||||
sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
|
||||
|
||||
elif lamp.falloff_type == 'INVERSE_COEFFICIENTS':
|
||||
col.label(text="Inverse Coefficients:")
|
||||
col.label(text="Inverse Coefficients")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "constant_coefficient", text="Constant")
|
||||
sub.prop(lamp, "linear_coefficient", text="Linear")
|
||||
@@ -119,31 +119,31 @@ class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
layout.row().prop(lamp, "type", expand=True)
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "color", text="")
|
||||
sub.prop(lamp, "energy")
|
||||
col = layout.column()
|
||||
col.prop(lamp, "color")
|
||||
col.prop(lamp, "energy")
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
|
||||
col.separator()
|
||||
|
||||
if lamp.type in {'POINT', 'SPOT', 'SUN'}:
|
||||
sub.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
col.prop(lamp, "shadow_soft_size", text="Radius")
|
||||
elif lamp.type == 'AREA':
|
||||
sub = sub.column(align=True)
|
||||
sub.prop(lamp, "shape", text="")
|
||||
col.prop(lamp, "shape")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
||||
if lamp.shape in {'SQUARE', 'DISK'}:
|
||||
sub.prop(lamp, "size")
|
||||
elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
|
||||
sub.prop(lamp, "size", text="Size X")
|
||||
sub.prop(lamp, "size_y", text="Size Y")
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "specular_factor", text="Specular")
|
||||
sub.prop(lamp, "size_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
@@ -162,49 +162,81 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
split = layout.split()
|
||||
split.active = lamp.use_shadow
|
||||
layout.active = lamp.use_shadow
|
||||
|
||||
sub = split.column()
|
||||
col = sub.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
col.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
|
||||
col = sub.column()
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Soft")
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
|
||||
sub.prop(lamp, "shadow_buffer_clip_end", text="End")
|
||||
|
||||
col.prop(lamp, "shadow_buffer_soft", text="Softness")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(lamp, "shadow_buffer_bias", text="Bias")
|
||||
col.prop(lamp, "shadow_buffer_exp", text="Exponent")
|
||||
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
|
||||
|
||||
if lamp.type == 'SUN':
|
||||
|
||||
class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel):
|
||||
bl_label = "Cascaded Shadow Map"
|
||||
bl_parent_id = "DATA_PT_EEVEE_shadow"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
lamp = context.lamp
|
||||
engine = context.engine
|
||||
|
||||
return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
lamp = context.lamp
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow
|
||||
col.label("Cascaded Shadow Map:")
|
||||
|
||||
split = col.split()
|
||||
col.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
col.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_count", text="Count")
|
||||
sub.prop(lamp, "shadow_cascade_fade", text="Fade")
|
||||
col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
|
||||
sub.prop(lamp, "shadow_cascade_exponent", text="Distribution")
|
||||
|
||||
layout.separator()
|
||||
class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
|
||||
bl_label = "Contact Shadows"
|
||||
bl_parent_id = "DATA_PT_EEVEE_shadow"
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
lamp = context.lamp
|
||||
engine = context.engine
|
||||
return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
lamp = context.lamp
|
||||
|
||||
layout = self.layout
|
||||
layout.active = lamp.use_shadow
|
||||
layout.prop(lamp, "use_contact_shadow", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
lamp = context.lamp
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.active = lamp.use_shadow and lamp.use_contact_shadow
|
||||
|
||||
layout.prop(lamp, "use_contact_shadow")
|
||||
split = layout.split()
|
||||
split.active = lamp.use_contact_shadow
|
||||
col = split.column()
|
||||
col.prop(lamp, "contact_shadow_distance", text="Distance")
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Soft")
|
||||
|
||||
col = split.column()
|
||||
col.prop(lamp, "contact_shadow_soft_size", text="Softness")
|
||||
col.prop(lamp, "contact_shadow_bias", text="Bias")
|
||||
col.prop(lamp, "contact_shadow_thickness", text="Thickness")
|
||||
|
||||
@@ -272,6 +304,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
|
||||
class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
bl_label = "Spot Shape"
|
||||
bl_parent_id = "DATA_PT_EEVEE_lamp"
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
@@ -282,16 +315,15 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lamp = context.lamp
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col.prop(lamp, "spot_size", text="Size")
|
||||
col.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
|
||||
col = split.column()
|
||||
sub = col.column()
|
||||
sub.prop(lamp, "spot_size", text="Size")
|
||||
sub.prop(lamp, "spot_blend", text="Blend", slider=True)
|
||||
col = split.column()
|
||||
col.prop(lamp, "show_cone")
|
||||
|
||||
|
||||
@@ -326,6 +358,8 @@ classes = (
|
||||
DATA_PT_lamp,
|
||||
DATA_PT_EEVEE_lamp,
|
||||
DATA_PT_EEVEE_shadow,
|
||||
DATA_PT_EEVEE_shadow_contact,
|
||||
DATA_PT_EEVEE_shadow_cascaded_shadow_map,
|
||||
DATA_PT_area,
|
||||
DATA_PT_spot,
|
||||
DATA_PT_falloff_curve,
|
||||
|
@@ -57,24 +57,31 @@ class DATA_PT_lattice(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
lat = context.lattice
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_u")
|
||||
row.prop(lat, "interpolation_type_u", text="")
|
||||
col = layout.column()
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_v")
|
||||
row.prop(lat, "interpolation_type_v", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "points_u", text="Resolution U")
|
||||
sub.prop(lat, "points_v", text="V")
|
||||
sub.prop(lat, "points_w", text="W")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "points_w")
|
||||
row.prop(lat, "interpolation_type_w", text="")
|
||||
col.separator()
|
||||
|
||||
row = layout.row()
|
||||
row.prop(lat, "use_outside")
|
||||
row.prop_search(lat, "vertex_group", context.object, "vertex_groups", text="")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(lat, "interpolation_type_u", text="Interpolation U")
|
||||
sub.prop(lat, "interpolation_type_v", text="V")
|
||||
sub.prop(lat, "interpolation_type_w", text="W")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(lat, "use_outside")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop_search(lat, "vertex_group", context.object, "vertex_groups")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -56,34 +56,32 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
split = layout.split()
|
||||
# layout.prop(probe, "type")
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label("Resolution:")
|
||||
col.prop(probe, "grid_resolution_x", text="X")
|
||||
col.prop(probe, "grid_resolution_x", text="Resolution X")
|
||||
col.prop(probe, "grid_resolution_y", text="Y")
|
||||
col.prop(probe, "grid_resolution_z", text="Z")
|
||||
|
||||
elif probe.type == 'PLANAR':
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_distance", "Distance")
|
||||
col.prop(probe, "falloff")
|
||||
else:
|
||||
col = split.column(align=True)
|
||||
col.label("Influence:")
|
||||
col.prop(probe, "influence_type", text="")
|
||||
col = layout.column()
|
||||
col.prop(probe, "influence_type")
|
||||
|
||||
if probe.influence_type == 'ELIPSOID':
|
||||
col.prop(probe, "influence_distance", "Radius")
|
||||
@@ -93,27 +91,24 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
||||
col.prop(probe, "falloff")
|
||||
col.prop(probe, "intensity")
|
||||
|
||||
col = split.column(align=True)
|
||||
|
||||
col.label("Clipping:")
|
||||
col.prop(probe, "clip_start", text="Start")
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.prop(probe, "clip_start", text="Clipping Start")
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
col.prop(probe, "clip_end", text="End")
|
||||
sub.prop(probe, "clip_end", text="End")
|
||||
|
||||
if probe.type == 'GRID':
|
||||
col.separator()
|
||||
|
||||
col.label("Visibility:")
|
||||
col.label("Visibility")
|
||||
col.prop(probe, "visibility_buffer_bias", "Bias")
|
||||
col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
|
||||
col.prop(probe, "visibility_blur", "Blur")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label("Visibility Collection:")
|
||||
row = col.row(align=True)
|
||||
row.prop(probe, "visibility_collection", text="")
|
||||
row.prop(probe, "visibility_collection")
|
||||
row.prop(probe, "invert_visibility_collection", text="", icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
@@ -132,14 +127,14 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
probe = context.lightprobe
|
||||
|
||||
col = layout.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
|
||||
row = col.row()
|
||||
row.prop(probe, "parallax_type", expand=True)
|
||||
col.prop(probe, "parallax_type")
|
||||
|
||||
if probe.parallax_type == 'ELIPSOID':
|
||||
col.prop(probe, "parallax_distance", "Radius")
|
||||
@@ -153,31 +148,28 @@ class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
probe = context.lightprobe
|
||||
|
||||
row = layout.row()
|
||||
row.prop(probe, "show_data")
|
||||
col = layout.column()
|
||||
|
||||
if probe.type != "PLANAR":
|
||||
row.prop(probe, "data_draw_size", text="Size")
|
||||
col.prop(probe, "data_draw_size", text="Size")
|
||||
else:
|
||||
row.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
col.prop(ob, "empty_draw_size", text="Arrow Size")
|
||||
|
||||
split = layout.split()
|
||||
col.prop(probe, "show_data")
|
||||
|
||||
if probe.type in {'GRID', 'CUBEMAP'}:
|
||||
col = split.column()
|
||||
col.prop(probe, "show_influence")
|
||||
|
||||
col = split.column()
|
||||
col.prop(probe, "show_clip")
|
||||
|
||||
if probe.type == 'CUBEMAP':
|
||||
col = split.column()
|
||||
col.active = probe.use_custom_parallax
|
||||
col.prop(probe, "show_parallax")
|
||||
sub = col.column()
|
||||
sub.active = probe.use_custom_parallax
|
||||
sub.prop(probe, "show_parallax")
|
||||
|
||||
|
||||
classes = (
|
||||
|
@@ -158,19 +158,18 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
col.prop(mesh, "show_double_sided")
|
||||
|
||||
col = split.column()
|
||||
col.prop(mesh, "use_auto_smooth")
|
||||
sub = col.column()
|
||||
sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
|
||||
sub.prop(mesh, "auto_smooth_angle", text="Angle")
|
||||
|
||||
split.prop(mesh, "show_double_sided")
|
||||
|
||||
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
bl_label = "Texture Space"
|
||||
@@ -179,6 +178,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
@@ -187,9 +187,9 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
row = layout.row()
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
layout.prop(mesh, "texspace_location", text="Location")
|
||||
layout.prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
|
||||
@@ -225,6 +225,34 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
|
||||
col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP'
|
||||
col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
|
||||
|
||||
box = layout.box()
|
||||
box.label(text="Row, auto, col_tweak 2")
|
||||
gflow = box.grid_flow(row_major=True, num_columns=0, even_columns=False, even_rows=False, align=False)
|
||||
for vg in ob.vertex_groups:
|
||||
gflow.prop(vg, "name", text="")
|
||||
gflow.prop(vg, "lock_weight")
|
||||
|
||||
box = layout.box()
|
||||
box.label(text="Col, auto, col_tweak 2")
|
||||
gflow = box.grid_flow(row_major=False, num_columns=0, even_columns=False, even_rows=False, align=False)
|
||||
for vg in ob.vertex_groups:
|
||||
gflow.prop(vg, "name", text="")
|
||||
gflow.prop(vg, "lock_weight")
|
||||
|
||||
box = layout.box()
|
||||
box.label(text="Row, auto % 2, col_tweak 2")
|
||||
gflow = box.grid_flow(row_major=True, num_columns=-2, even_columns=False, even_rows=False, align=False)
|
||||
for vg in ob.vertex_groups:
|
||||
gflow.prop(vg, "name", text="")
|
||||
gflow.prop(vg, "lock_weight")
|
||||
|
||||
box = layout.box()
|
||||
box.label(text="Col, auto % 2, col_tweak 2")
|
||||
gflow = box.grid_flow(row_major=False, num_columns=-2, even_columns=False, even_rows=False, align=False)
|
||||
for vg in ob.vertex_groups:
|
||||
gflow.prop(vg, "name", text="")
|
||||
gflow.prop(vg, "lock_weight")
|
||||
|
||||
if ob.vertex_groups and (ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex)):
|
||||
row = layout.row()
|
||||
|
||||
@@ -280,6 +308,7 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel):
|
||||
sub.operator("object.face_map_select", text="Select")
|
||||
sub.operator("object.face_map_deselect", text="Deselect")
|
||||
|
||||
|
||||
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
||||
bl_label = "Shape Keys"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
@@ -54,23 +54,18 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.label(text="Resolution:")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(mball, "resolution", text="View")
|
||||
sub.prop(mball, "resolution", text="Resolution View")
|
||||
sub.prop(mball, "render_resolution", text="Render")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Settings:")
|
||||
col.prop(mball, "threshold", text="Threshold")
|
||||
|
||||
layout.label(text="Update:")
|
||||
layout.row().prop(mball, "update_method", expand=True)
|
||||
col.prop(mball, "update_method")
|
||||
|
||||
|
||||
class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
@@ -80,14 +75,15 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
layout.prop(mball, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location", text="Location")
|
||||
row.column().prop(mball, "texspace_size", text="Size")
|
||||
col = layout.column()
|
||||
col.prop(mball, "texspace_location")
|
||||
col.prop(mball, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
@@ -99,35 +95,33 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
metaelem = context.meta_ball.elements.active
|
||||
|
||||
layout.prop(metaelem, "type")
|
||||
col = layout.column()
|
||||
|
||||
split = layout.split()
|
||||
col.prop(metaelem, "type")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="Settings:")
|
||||
col.prop(metaelem, "stiffness", text="Stiffness")
|
||||
col.prop(metaelem, "use_negative", text="Negative")
|
||||
col.prop(metaelem, "hide", text="Hide")
|
||||
|
||||
col = split.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
|
||||
if metaelem.type in {'CUBE', 'ELLIPSOID'}:
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
col.prop(metaelem, "size_z", text="Z")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
sub.prop(metaelem, "size_z", text="Z")
|
||||
|
||||
elif metaelem.type == 'TUBE':
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
|
||||
elif metaelem.type == 'PLANE':
|
||||
col.label(text="Size:")
|
||||
col.prop(metaelem, "size_x", text="X")
|
||||
col.prop(metaelem, "size_y", text="Y")
|
||||
sub.prop(metaelem, "size_x", text="Size X")
|
||||
sub.prop(metaelem, "size_y", text="Y")
|
||||
|
||||
|
||||
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -168,7 +168,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
if bpy.app.debug:
|
||||
layout.prop(md, "debug_options")
|
||||
|
||||
|
||||
def BUILD(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
||||
@@ -328,8 +327,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
row.prop(md, "delimit")
|
||||
layout_info = layout
|
||||
|
||||
layout_info.label(text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False)
|
||||
layout_info.label(
|
||||
text=iface_("Face Count: {:,}".format(md.face_count)),
|
||||
translate=False,
|
||||
)
|
||||
|
||||
def DISPLACE(self, layout, ob, md):
|
||||
has_texture = (md.texture is not None)
|
||||
|
@@ -62,14 +62,16 @@ class DATA_PT_speaker(DataButtonsPanel, Panel):
|
||||
|
||||
speaker = context.speaker
|
||||
|
||||
split = layout.split(percentage=0.75)
|
||||
layout.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
|
||||
split.template_ID(speaker, "sound", open="sound.open_mono")
|
||||
split.prop(speaker, "muted")
|
||||
layout.use_property_split = True
|
||||
|
||||
row = layout.row()
|
||||
row.prop(speaker, "volume")
|
||||
row.prop(speaker, "pitch")
|
||||
layout.prop(speaker, "muted")
|
||||
|
||||
col = layout.column()
|
||||
col.active = not speaker.muted
|
||||
col.prop(speaker, "volume", slider=True)
|
||||
col.prop(speaker, "pitch")
|
||||
|
||||
|
||||
class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
@@ -79,20 +81,20 @@ class DATA_PT_distance(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "volume_min", text="Minimum")
|
||||
col.prop(speaker, "volume_max", text="Maximum")
|
||||
col = layout.column()
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "volume_min", slider=True, text="Volume Min")
|
||||
sub.prop(speaker, "volume_max", slider=True, text="Max")
|
||||
col.prop(speaker, "attenuation")
|
||||
|
||||
col = split.column()
|
||||
col.label("Distance:")
|
||||
col.prop(speaker, "distance_max", text="Maximum")
|
||||
col.prop(speaker, "distance_reference", text="Reference")
|
||||
col.separator()
|
||||
col.prop(speaker, "distance_max", text="Max Distance")
|
||||
col.prop(speaker, "distance_reference", text="Distance Reference")
|
||||
|
||||
|
||||
class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
@@ -102,18 +104,20 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
speaker = context.speaker
|
||||
layout.active = not speaker.muted
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label("Angle:")
|
||||
col.prop(speaker, "cone_angle_outer", text="Outer")
|
||||
col.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(speaker, "cone_angle_outer", text="Angle Outer")
|
||||
sub.prop(speaker, "cone_angle_inner", text="Inner")
|
||||
|
||||
col = split.column()
|
||||
col.label("Volume:")
|
||||
col.prop(speaker, "cone_volume_outer", text="Outer")
|
||||
col.separator()
|
||||
|
||||
col.prop(speaker, "cone_volume_outer", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):
|
||||
|
@@ -20,7 +20,7 @@
|
||||
import bpy
|
||||
from bpy.types import (
|
||||
Panel,
|
||||
)
|
||||
)
|
||||
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
@@ -85,7 +85,6 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
|
||||
row.label(module_name)
|
||||
|
||||
|
||||
|
||||
class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
|
||||
_context_path = "workspace"
|
||||
_property_type = bpy.types.WorkSpace
|
||||
@@ -100,4 +99,3 @@ if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
register_class(cls)
|
||||
|
||||
|
@@ -629,7 +629,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
row = layout.row(align=True)
|
||||
row.prop(linestyle, "panel", expand=True)
|
||||
if linestyle.panel == 'STROKES':
|
||||
## Chaining
|
||||
# Chaining
|
||||
layout.prop(linestyle, "use_chaining", text="Chaining:")
|
||||
split = layout.split(align=True)
|
||||
split.active = linestyle.use_chaining
|
||||
@@ -643,7 +643,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
col = split.column()
|
||||
col.prop(linestyle, "use_same_object")
|
||||
|
||||
## Splitting
|
||||
# Splitting
|
||||
layout.label(text="Splitting:")
|
||||
split = layout.split(align=True)
|
||||
# First column
|
||||
@@ -679,7 +679,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
sub.prop(linestyle, "split_dash3", text="D3")
|
||||
sub.prop(linestyle, "split_gap3", text="G3")
|
||||
|
||||
## Sorting
|
||||
# Sorting
|
||||
layout.prop(linestyle, "use_sorting", text="Sorting:")
|
||||
col = layout.column()
|
||||
col.active = linestyle.use_sorting
|
||||
@@ -693,7 +693,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
row = col.row(align=True)
|
||||
row.prop(linestyle, "sort_order", expand=True)
|
||||
|
||||
## Selection
|
||||
# Selection
|
||||
layout.label(text="Selection:")
|
||||
split = layout.split(align=True)
|
||||
# First column
|
||||
@@ -716,12 +716,12 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
sub.active = linestyle.use_chain_count
|
||||
sub.prop(linestyle, "chain_count")
|
||||
|
||||
## Caps
|
||||
# Caps
|
||||
layout.label(text="Caps:")
|
||||
row = layout.row(align=True)
|
||||
row.prop(linestyle, "caps", expand=True)
|
||||
|
||||
## Dashed lines
|
||||
# Dashed lines
|
||||
layout.prop(linestyle, "use_dashed_line", text="Dashed Line:")
|
||||
row = layout.row(align=True)
|
||||
row.active = linestyle.use_dashed_line
|
||||
@@ -788,7 +788,8 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
props = row.operator(
|
||||
"wm.properties_context_change",
|
||||
text="Go to Linestyle Textures Properties",
|
||||
icon='TEXTURE')
|
||||
icon='TEXTURE',
|
||||
)
|
||||
props.context = 'TEXTURE'
|
||||
|
||||
elif linestyle.panel == 'MISC':
|
||||
|
@@ -242,7 +242,6 @@ class GreasePencilStrokeEditPanel:
|
||||
if is_3d_view:
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.separator()
|
||||
col = layout.column(align=True)
|
||||
col.operator("gpencil.stroke_subdivide", text="Subdivide")
|
||||
|
@@ -43,8 +43,8 @@ class MASK_UL_layers(UIList):
|
||||
|
||||
class MASK_PT_mask:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Settings"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@@ -66,8 +66,8 @@ class MASK_PT_mask:
|
||||
|
||||
class MASK_PT_layers:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Layers"
|
||||
|
||||
@classmethod
|
||||
@@ -114,8 +114,8 @@ class MASK_PT_layers:
|
||||
|
||||
class MASK_PT_spline:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
bl_label = "Active Spline"
|
||||
|
||||
@classmethod
|
||||
@@ -148,8 +148,8 @@ class MASK_PT_spline:
|
||||
|
||||
class MASK_PT_point:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
bl_label = "Active Point"
|
||||
|
||||
@classmethod
|
||||
@@ -203,8 +203,8 @@ class MASK_PT_point:
|
||||
|
||||
class MASK_PT_display:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'UI'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'UI'
|
||||
bl_label = "Mask Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@@ -229,8 +229,8 @@ class MASK_PT_display:
|
||||
|
||||
class MASK_PT_transforms:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Transforms"
|
||||
bl_category = "Mask"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -253,8 +253,8 @@ class MASK_PT_transforms:
|
||||
|
||||
class MASK_PT_tools:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Mask Tools"
|
||||
bl_category = "Mask"
|
||||
|
||||
@@ -291,8 +291,8 @@ class MASK_PT_tools:
|
||||
|
||||
class MASK_PT_add:
|
||||
# subclasses must define...
|
||||
#~ bl_space_type = 'CLIP_EDITOR'
|
||||
#~ bl_region_type = 'TOOLS'
|
||||
# ~ bl_space_type = 'CLIP_EDITOR'
|
||||
# ~ bl_region_type = 'TOOLS'
|
||||
bl_label = "Add"
|
||||
bl_category = "Mask"
|
||||
|
||||
|
@@ -23,6 +23,7 @@ from rna_prop_ui import PropertyPanel
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
from bpy_extras.node_utils import find_node_input, find_output_node
|
||||
|
||||
|
||||
class MATERIAL_MT_specials(Menu):
|
||||
bl_label = "Material Specials"
|
||||
|
||||
@@ -172,11 +173,11 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
|
||||
if mat.use_nodes:
|
||||
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
|
||||
else:
|
||||
raym = mat.raytrace_mirror
|
||||
layout.use_property_split = True
|
||||
layout.prop(mat, "diffuse_color", text="Base Color")
|
||||
layout.prop(raym, "reflect_factor", text="Metallic")
|
||||
layout.prop(mat, "metallic")
|
||||
layout.prop(mat, "specular_intensity", text="Specular")
|
||||
layout.prop(raym, "gloss_factor", text="Roughness")
|
||||
layout.prop(mat, "roughness")
|
||||
|
||||
|
||||
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
@@ -191,6 +192,7 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
|
||||
@@ -215,6 +217,27 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
|
||||
row.prop(mat, "use_sss_translucency")
|
||||
|
||||
|
||||
class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
|
||||
bl_label = "Viewport Display"
|
||||
bl_context = "material"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.material
|
||||
|
||||
def draw(self, context):
|
||||
mat = context.material
|
||||
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.prop(mat, "diffuse_color")
|
||||
col.prop(mat, "specular_color")
|
||||
col.prop(mat, "roughness")
|
||||
|
||||
|
||||
classes = (
|
||||
MATERIAL_MT_specials,
|
||||
MATERIAL_UL_matslots,
|
||||
@@ -223,8 +246,10 @@ classes = (
|
||||
EEVEE_MATERIAL_PT_context_material,
|
||||
EEVEE_MATERIAL_PT_surface,
|
||||
EEVEE_MATERIAL_PT_options,
|
||||
MATERIAL_PT_viewport,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
|
@@ -48,129 +48,108 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
col = layout.column()
|
||||
|
||||
ob = context.object
|
||||
|
||||
row = layout.row()
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "location")
|
||||
sub.prop(ob, "lock_location", text="")
|
||||
|
||||
row.column().prop(ob, "location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
row.column().prop(ob, "rotation_quaternion", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_quaternion", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
# row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "rotation_axis", text="Axis")
|
||||
row.column().prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_axis_angle", text="Rotation")
|
||||
subsub = sub.column(align=True)
|
||||
subsub.prop(ob, "lock_rotation_w", text="")
|
||||
subsub.prop(ob, "lock_rotation", text="")
|
||||
else:
|
||||
row.column().prop(ob, "rotation_euler", text="Rotation")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "rotation_euler", text="Rotation")
|
||||
sub.prop(ob, "lock_rotation", text="")
|
||||
|
||||
row.column().prop(ob, "scale")
|
||||
sub = col.row(align=True)
|
||||
sub.prop(ob, "scale")
|
||||
sub.prop(ob, "lock_scale", text="")
|
||||
|
||||
layout.prop(ob, "rotation_mode")
|
||||
col.prop(ob, "rotation_mode")
|
||||
|
||||
|
||||
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Delta Transform"
|
||||
bl_parent_id = "OBJECT_PT_transform"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
row = layout.row()
|
||||
col = layout.column()
|
||||
|
||||
row.column().prop(ob, "delta_location")
|
||||
col.column().prop(ob, "delta_location")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
col.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
#row.column().label(text="Rotation")
|
||||
# row.column().label(text="Rotation")
|
||||
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
|
||||
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
|
||||
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
|
||||
row.column().label(text="Not for Axis-Angle")
|
||||
col.column().label(text="Not for Axis-Angle")
|
||||
else:
|
||||
row.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
col.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
||||
|
||||
row.column().prop(ob, "delta_scale")
|
||||
|
||||
|
||||
class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Transform Locks"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split(percentage=0.1)
|
||||
|
||||
col = split.column(align=True)
|
||||
col.label(text="")
|
||||
col.label(text="X:")
|
||||
col.label(text="Y:")
|
||||
col.label(text="Z:")
|
||||
|
||||
split.column().prop(ob, "lock_location", text="Location")
|
||||
split.column().prop(ob, "lock_rotation", text="Rotation")
|
||||
split.column().prop(ob, "lock_scale", text="Scale")
|
||||
|
||||
if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
|
||||
row = layout.row()
|
||||
row.prop(ob, "lock_rotations_4d", text="Lock Rotation")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = ob.lock_rotations_4d
|
||||
sub.prop(ob, "lock_rotation_w", text="W")
|
||||
col.column().prop(ob, "delta_scale")
|
||||
|
||||
|
||||
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(ob, "pass_index")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Parent:")
|
||||
col.prop(ob, "parent", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ob, "parent_type", text="")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
|
||||
sub.active = (parent is not None)
|
||||
|
||||
|
||||
class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Relations Extras"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
ob = context.object
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column()
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Tracking Axes:")
|
||||
col.prop(ob, "track_axis", text="Axis")
|
||||
col.prop(ob, "parent")
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ob, "parent_type")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.prop_search(ob, "parent_bone", parent.data, "bones")
|
||||
sub.active = (parent is not None)
|
||||
|
||||
col = col.column()
|
||||
col.active = (ob.parent is not None)
|
||||
col.prop(ob, "use_slow_parent")
|
||||
sub = col.column()
|
||||
sub.active = (ob.use_slow_parent)
|
||||
sub.prop(ob, "slow_parent_offset", text="Offset")
|
||||
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.prop(ob, "track_axis", text="Tracking Axis")
|
||||
col.prop(ob, "up_axis", text="Up Axis")
|
||||
|
||||
col = split.column()
|
||||
col.prop(ob, "use_slow_parent")
|
||||
row = col.row()
|
||||
row.active = ((ob.parent is not None) and (ob.use_slow_parent))
|
||||
row.prop(ob, "slow_parent_offset", text="Offset")
|
||||
col.separator()
|
||||
|
||||
col.prop(ob, "pass_index")
|
||||
|
||||
|
||||
class COLLECTION_MT_specials(Menu):
|
||||
@@ -221,10 +200,12 @@ class OBJECT_PT_collections(ObjectButtonsPanel, Panel):
|
||||
|
||||
|
||||
class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
bl_label = "Viewport Display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
obj = context.object
|
||||
obj_type = obj.type
|
||||
@@ -233,9 +214,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
|
||||
is_dupli = (obj.dupli_type != 'NONE')
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(obj, "show_name", text="Name")
|
||||
col.prop(obj, "show_axis", text="Axis")
|
||||
# Makes no sense for cameras, armatures, etc.!
|
||||
@@ -245,48 +224,39 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
if obj_type == 'MESH' or is_dupli:
|
||||
col.prop(obj, "show_all_edges")
|
||||
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.prop(obj, "show_bounds", text="Bounds")
|
||||
sub = row.row()
|
||||
sub.active = obj.show_bounds
|
||||
sub.prop(obj, "draw_bounds_type", text="")
|
||||
col = layout.column()
|
||||
col.prop(obj, "show_bounds", text="Bounds")
|
||||
col = layout.column()
|
||||
col.active = obj.show_bounds
|
||||
col.prop(obj, "draw_bounds_type")
|
||||
|
||||
col = layout.column()
|
||||
if is_geometry:
|
||||
col.prop(obj, "show_texture_space", text="Texture Space")
|
||||
col.prop(obj.display, "show_shadows")
|
||||
col.prop(obj.display, "show_shadows", text="Shadow")
|
||||
|
||||
col.prop(obj, "show_x_ray", text="X-Ray")
|
||||
if obj_type == 'MESH' or is_empty_image:
|
||||
col.prop(obj, "show_transparent", text="Transparency")
|
||||
# if obj_type == 'MESH' or is_empty_image:
|
||||
# col.prop(obj, "show_transparent", text="Transparency")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
if is_wire:
|
||||
# wire objects only use the max. draw type for duplis
|
||||
col.active = is_dupli
|
||||
col.label(text="Maximum Dupli Draw Type:")
|
||||
else:
|
||||
col.label(text="Maximum Draw Type:")
|
||||
col.prop(obj, "draw_type", text="")
|
||||
|
||||
col = split.column()
|
||||
if is_geometry or is_empty_image:
|
||||
# Only useful with object having faces/materials...
|
||||
col.label(text="Object Color:")
|
||||
col.prop(obj, "color", text="")
|
||||
col.prop(
|
||||
obj, "draw_type",
|
||||
text="Maximum Dupli Draw Type" if is_wire else "Maximum Dupli Draw Type",
|
||||
)
|
||||
|
||||
col = layout.column()
|
||||
col.active = bool(is_dupli or obj.particle_systems)
|
||||
col.label(text="Duplicator Visibility:")
|
||||
row = col.row(align=True)
|
||||
row.prop(obj, "show_duplicator_for_viewport", text="Viewport")
|
||||
row.prop(obj, "show_duplicator_for_render", text="Render")
|
||||
if is_geometry or is_empty_image:
|
||||
# Only useful with object having faces/materials...
|
||||
col.prop(obj, "color")
|
||||
|
||||
|
||||
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
bl_label = "Duplication"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -295,14 +265,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
|
||||
layout.row().prop(ob, "dupli_type", expand=True)
|
||||
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column(align=True)
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "dupli_frames_start", text="Start")
|
||||
col.prop(ob, "dupli_frames_end", text="End")
|
||||
|
||||
col = split.column(align=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "dupli_frames_on", text="On")
|
||||
col.prop(ob, "dupli_frames_off", text="Off")
|
||||
|
||||
@@ -312,15 +283,22 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
||||
layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
row = layout.row()
|
||||
row.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = row.row()
|
||||
col = layout.column()
|
||||
col.prop(ob, "use_dupli_faces_scale", text="Scale")
|
||||
sub = col.column()
|
||||
sub.active = ob.use_dupli_faces_scale
|
||||
sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
|
||||
|
||||
elif ob.dupli_type == 'COLLECTION':
|
||||
layout.prop(ob, "dupli_group", text="Collection")
|
||||
|
||||
if ob.dupli_type != 'NONE' or len(ob.particle_systems):
|
||||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(ob, "show_duplicator_for_viewport")
|
||||
col.prop(ob, "show_duplicator_for_render")
|
||||
|
||||
|
||||
from .properties_animviz import (
|
||||
MotionPathButtonsPanel,
|
||||
@@ -370,9 +348,7 @@ classes = (
|
||||
OBJECT_PT_context_object,
|
||||
OBJECT_PT_transform,
|
||||
OBJECT_PT_delta_transform,
|
||||
OBJECT_PT_transform_locks,
|
||||
OBJECT_PT_relations,
|
||||
OBJECT_PT_relations_extras,
|
||||
COLLECTION_MT_specials,
|
||||
OBJECT_PT_collections,
|
||||
OBJECT_PT_display,
|
||||
|
@@ -257,6 +257,7 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
|
||||
cloth = context.cloth.settings
|
||||
effector_weights_ui(self, context, cloth.effector_weights, 'CLOTH')
|
||||
|
||||
|
||||
classes = (
|
||||
CLOTH_MT_presets,
|
||||
PHYSICS_PT_cloth,
|
||||
|
@@ -117,7 +117,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
|
||||
rbo = ob.rigid_body
|
||||
|
||||
#col = layout.column(align=1)
|
||||
#col.label(text="Activation:")
|
||||
# col.label(text="Activation:")
|
||||
# XXX: settings such as activate on collison/etc.
|
||||
|
||||
split = layout.split()
|
||||
|
@@ -67,12 +67,13 @@ class RENDER_PT_context(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
if rd.has_multiple_engines:
|
||||
layout.prop(rd, "engine", text="")
|
||||
layout.prop(rd, "engine", text="Render Engine")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
@@ -125,6 +126,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
@@ -134,41 +136,47 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
row.operator("render.preset_add", text="", icon='ZOOMIN')
|
||||
row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "resolution_x", text="Resolution X")
|
||||
col.prop(rd, "resolution_y", text="Y")
|
||||
col.prop(rd, "resolution_percentage", text="%")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "pixel_aspect_x", text="Aspect X")
|
||||
col.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_border", text="Border")
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start")
|
||||
sub.prop(scene, "frame_end")
|
||||
sub.prop(scene, "frame_step")
|
||||
col = layout.column(align=True)
|
||||
col.prop(scene, "frame_start", text="Frame Start")
|
||||
col.prop(scene, "frame_end", text="End")
|
||||
col.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
col = layout.split(percentage=0.5)
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Frame Rate")
|
||||
self.draw_framerate(col, rd)
|
||||
|
||||
self.draw_framerate(sub, rd)
|
||||
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
class RENDER_PT_frame_remapping(RenderButtonsPanel, Panel):
|
||||
bl_label = "Time Remapping"
|
||||
bl_parent_id = "RENDER_PT_dimensions"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "frame_map_old", text="Old")
|
||||
col.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
@@ -178,16 +186,15 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
@@ -197,24 +204,13 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.prop(rd, "use_stamp")
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
row = col.row()
|
||||
row.prop(rd, "stamp_font_size", text="Font Size")
|
||||
row.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
|
||||
row = col.row()
|
||||
row.column().prop(rd, "stamp_foreground", slider=True)
|
||||
row.column().prop(rd, "stamp_background", slider=True)
|
||||
|
||||
layout.label("Enabled Metadata")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = split.column(align=True)
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
@@ -222,7 +218,7 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_memory", text="Memory")
|
||||
|
||||
col = split.column()
|
||||
col = split.column(align=True)
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
@@ -230,14 +226,40 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
if rd.use_sequencer:
|
||||
col.prop(rd, "use_stamp_strip_meta", text="Sequence Strip")
|
||||
|
||||
row = layout.split(percentage=0.3)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
if rd.use_sequencer:
|
||||
layout.label("Sequencer:")
|
||||
layout.prop(rd, "use_stamp_strip_meta")
|
||||
|
||||
|
||||
class RENDER_PT_stamp_burn(RenderButtonsPanel, Panel):
|
||||
bl_label = "Burn Into Image"
|
||||
bl_parent_id = "RENDER_PT_stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
col = layout.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
col.prop(rd, "use_stamp_labels", text="Draw Labels")
|
||||
col.column().prop(rd, "stamp_foreground", slider=True)
|
||||
col.column().prop(rd, "stamp_background", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
@@ -246,6 +268,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = False
|
||||
|
||||
rd = context.scene.render
|
||||
image_settings = rd.image_settings
|
||||
@@ -253,17 +276,17 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
layout.prop(rd, "filepath", text="")
|
||||
|
||||
split = layout.split()
|
||||
layout.use_property_split = True
|
||||
|
||||
col = split.column()
|
||||
col.active = not rd.is_movie_format
|
||||
col.prop(rd, "use_overwrite")
|
||||
col.prop(rd, "use_placeholder")
|
||||
|
||||
col = split.column()
|
||||
col = layout.column(align=True)
|
||||
sub = col.column(align=True)
|
||||
sub.active = not rd.is_movie_format
|
||||
sub.prop(rd, "use_overwrite")
|
||||
sub.prop(rd, "use_placeholder")
|
||||
col.prop(rd, "use_file_extension")
|
||||
col.prop(rd, "use_render_cache")
|
||||
|
||||
layout.use_property_split = False
|
||||
layout.template_image_settings(image_settings, color_management=False)
|
||||
if rd.use_multiview:
|
||||
layout.template_image_views(image_settings)
|
||||
@@ -447,6 +470,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -475,6 +499,7 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -500,6 +525,7 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -525,6 +551,8 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -554,20 +582,32 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_volumetric
|
||||
col = layout.column()
|
||||
col.prop(props, "volumetric_start")
|
||||
col.prop(props, "volumetric_end")
|
||||
sub = col.column(align=True)
|
||||
sub.prop(props, "volumetric_start")
|
||||
sub.prop(props, "volumetric_end")
|
||||
col.prop(props, "volumetric_tile_size")
|
||||
col.separator()
|
||||
col.prop(props, "volumetric_samples")
|
||||
col.prop(props, "volumetric_sample_distribution")
|
||||
sub.prop(props, "volumetric_sample_distribution")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_lights")
|
||||
col.prop(props, "volumetric_light_clamp")
|
||||
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_lights
|
||||
sub.prop(props, "volumetric_light_clamp", text="Light Clamping")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_shadows")
|
||||
col.prop(props, "volumetric_shadow_samples")
|
||||
sub = col.column()
|
||||
sub.active = props.use_volumetric_shadows
|
||||
sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
|
||||
col.separator()
|
||||
col.prop(props, "use_volumetric_colored_transmittance")
|
||||
|
||||
|
||||
@@ -587,9 +627,13 @@ class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
layout.active = props.use_sss
|
||||
|
||||
col = layout.column()
|
||||
col.prop(props, "sss_samples")
|
||||
col.prop(props, "sss_jitter_threshold")
|
||||
@@ -612,12 +656,14 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
col = layout.column()
|
||||
col.active = props.use_ssr
|
||||
col.prop(props, "use_ssr_refraction")
|
||||
col.prop(props, "use_ssr_refraction", text="Refraction")
|
||||
col.prop(props, "use_ssr_halfres")
|
||||
col.prop(props, "ssr_quality")
|
||||
col.prop(props, "ssr_max_roughness")
|
||||
@@ -637,6 +683,8 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -658,6 +706,8 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -678,6 +728,8 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
props = scene.eevee
|
||||
|
||||
@@ -698,30 +750,52 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col = layout.column()
|
||||
col.prop(rd, "filter_size")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "alpha_mode", text="Alpha")
|
||||
|
||||
|
||||
class RENDER_PT_hair(RenderButtonsPanel, Panel):
|
||||
bl_label = "Hair"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "hair_type", expand=True)
|
||||
|
||||
layout.use_property_split = True
|
||||
layout.prop(rd, "hair_subdiv")
|
||||
|
||||
|
||||
classes = (
|
||||
RENDER_MT_presets,
|
||||
RENDER_MT_ffmpeg_presets,
|
||||
RENDER_MT_framerate_presets,
|
||||
RENDER_PT_context,
|
||||
RENDER_PT_dimensions,
|
||||
RENDER_PT_frame_remapping,
|
||||
RENDER_PT_post_processing,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_output,
|
||||
RENDER_PT_encoding,
|
||||
RENDER_PT_stamp,
|
||||
RENDER_PT_stamp_burn,
|
||||
RENDER_UL_renderviews,
|
||||
RENDER_PT_stereoscopy,
|
||||
RENDER_PT_hair,
|
||||
RENDER_PT_clay_settings,
|
||||
RENDER_PT_eevee_sampling,
|
||||
RENDER_PT_eevee_film,
|
||||
|