Compare commits
222 Commits
GPencil_Ed
...
texture_no
Author | SHA1 | Date | |
---|---|---|---|
9282d305bd | |||
646a96bf8e | |||
f78490182e | |||
abf39fa31f | |||
cd4fedb285 | |||
![]() |
59a0c11ecc | ||
1fe7b84c73 | |||
![]() |
071ec918f4 | ||
c2e56a5267 | |||
296a92f5f3 | |||
93c4ba7b70 | |||
7a04c7f6d0 | |||
3b639b8b3d | |||
3e0ff35b4b | |||
ef5c036d1c | |||
76ccc1d26b | |||
5cc199e495 | |||
5e67779d80 | |||
27b58f0eb2 | |||
de0b9f34d7 | |||
85f6fc501c | |||
f0f1c7995b | |||
9f61350a05 | |||
d4aaa4f9b6 | |||
c1eec5582a | |||
8627d65951 | |||
20006e4a67 | |||
2bdd44c87a | |||
0c5eb88451 | |||
0ae4d7d405 | |||
3da1a75b74 | |||
b3b9e08423 | |||
3820d44979 | |||
cd4d5dcb46 | |||
a56e31c89c | |||
dc2617130b | |||
b04d2f99f2 | |||
15bde0dbea | |||
3e61478b1b | |||
1b2fc74792 | |||
72330b97a2 | |||
1549fea999 | |||
137f557246 | |||
72341537e8 | |||
76f50cd17a | |||
f51b583ea0 | |||
db0e2e7347 | |||
2329b58fd3 | |||
090ab750b3 | |||
c167ac1556 | |||
06ea819c0d | |||
ca25fe98fc | |||
![]() |
ae6f62c4e2 | ||
c1d3532d2c | |||
17253bec06 | |||
9c81833430 | |||
d6beaad01c | |||
28a0e1dae5 | |||
fbd25174d1 | |||
a6343696c1 | |||
cea086dd97 | |||
19eb700fef | |||
f1ddf99580 | |||
2309def874 | |||
754bdbe4b4 | |||
cb7cf523e5 | |||
1999b5a814 | |||
2617d37034 | |||
![]() |
c71c7f0e0b | ||
1e02a5ff43 | |||
d7e4944e5b | |||
aaa02bd490 | |||
bce0dc8cf7 | |||
d9ddc99a27 | |||
d68521df7b | |||
668ffcd6e9 | |||
01bda15832 | |||
7366283c01 | |||
602250d9fe | |||
47788b5e68 | |||
1807dcf619 | |||
8555595d17 | |||
9783d9297c | |||
117a7e3545 | |||
17f0a01a56 | |||
e77b25fabb | |||
6fb1e1680b | |||
2efc3211ab | |||
4d9f2f7e86 | |||
d5abe8419d | |||
233c650d55 | |||
491839b3c8 | |||
781db5f8a6 | |||
171a6bb5dc | |||
8fe336ce7e | |||
ebee593f26 | |||
59f1585d02 | |||
a5c3de2e49 | |||
6076bedec0 | |||
83cbcefac8 | |||
55812e3acd | |||
03760fed0d | |||
ab6417aa9f | |||
8545fb516e | |||
252bfc6f65 | |||
7b6c9d23cf | |||
c07f6c02b3 | |||
3e7e97f127 | |||
690345a826 | |||
7ba2b37a8a | |||
![]() |
b88e700df4 | ||
![]() |
983c71931b | ||
![]() |
12e5a32557 | ||
fe4d0c234e | |||
e67fd7a2cb | |||
![]() |
e81d077c85 | ||
06515475b9 | |||
81ae71fcd3 | |||
6e8a8a72a3 | |||
036f4e7a38 | |||
c077f5fa08 | |||
c8995ecc83 | |||
871cf70144 | |||
825d6adef5 | |||
0493879401 | |||
ecc03c8ed0 | |||
2b4eeb79cd | |||
bd0b9ed0c0 | |||
716890e864 | |||
0b67102bd6 | |||
e1e984e437 | |||
e54d571176 | |||
3673a03226 | |||
844909b294 | |||
e93990dfc5 | |||
abab4f19e6 | |||
030b694c7a | |||
d87ff752af | |||
cf7bdb42ac | |||
226eb53bc7 | |||
c57d9c05d6 | |||
8600dc6365 | |||
2f637004d5 | |||
4fe2b45d3d | |||
12e9ccb256 | |||
cf15147053 | |||
2420a3c189 | |||
3c1d286ca5 | |||
![]() |
409043c69d | ||
a6bb564c99 | |||
4afd5db47e | |||
87471874a9 | |||
0762451e86 | |||
9ae458362a | |||
627f27502f | |||
f96fd4430a | |||
76bfce231a | |||
58005e135b | |||
4cb0e25678 | |||
894dbda575 | |||
47ebf96de4 | |||
5996ad2fd4 | |||
af92f3d325 | |||
e1f5e19eee | |||
9345d2d723 | |||
e3a6f1c152 | |||
4649f17c38 | |||
b5399deac3 | |||
c751055513 | |||
18d08ede22 | |||
4e60462881 | |||
ed935ae5ad | |||
e177c51430 | |||
a42638d265 | |||
a5cd6a029f | |||
f86fd544c1 | |||
7de1efd274 | |||
367204a063 | |||
8b6759a4a9 | |||
0efa41e996 | |||
44df4242fa | |||
e35b4bac0a | |||
670f5deda6 | |||
ee010650f6 | |||
20a1778148 | |||
9c782c17ba | |||
f2c3b5a384 | |||
4ee53074aa | |||
72f75927f5 | |||
7d88f0ce4d | |||
3bd46904be | |||
22ecceec4a | |||
4ad0d33d69 | |||
e7de96f5eb | |||
dfc56f1776 | |||
965a49a3e6 | |||
11ad517536 | |||
8d42c2f3ea | |||
e240bd3932 | |||
2334e5ecd4 | |||
![]() |
dc199369d1 | ||
![]() |
29c2b70a2c | ||
b7d053beaa | |||
fd4cd626be | |||
503dbb65c0 | |||
b12dbdd93b | |||
f0278387e8 | |||
9ddc4b1fba | |||
5f4c99e66f | |||
75aaa476cb | |||
14b951747f | |||
de724a258e | |||
a4ba73311b | |||
b35aafab6a | |||
94dd73b995 | |||
e9e555fb85 | |||
5c50820e6a | |||
f5c526f29c | |||
4bd79aca12 | |||
b2d6cd2e33 | |||
98bd0b4027 | |||
c4235ce820 |
@@ -318,6 +318,9 @@ mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
|
||||
# Misc
|
||||
if(WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
||||
endif()
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
option(WITH_OPENNL "Enable use of Open Numerical Library" ON)
|
||||
@@ -351,7 +354,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build cycles with logging support" OFF)
|
||||
option(WITH_CYCLES_LOGGING "Build cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG "Build cycles with extra debug capabilities" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||
mark_as_advanced(WITH_CYCLES_DEBUG)
|
||||
@@ -1151,6 +1154,10 @@ elseif(WIN32)
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi)
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
list(APPEND PLATFORM_LINKLIBS imm32)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
@@ -1506,6 +1513,11 @@ elseif(WIN32)
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi)
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
list(APPEND PLATFORM_LINKLIBS -limm32)
|
||||
endif()
|
||||
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
||||
|
||||
if(WITH_MINGW64)
|
||||
|
74
GNUmakefile
74
GNUmakefile
@@ -113,7 +113,7 @@ endif
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build Blender
|
||||
all:
|
||||
all: FORCE
|
||||
@echo
|
||||
@echo Configuring Blender ...
|
||||
|
||||
@@ -142,13 +142,13 @@ bpy: all
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Configuration (save some cd'ing around)
|
||||
config:
|
||||
config: FORCE
|
||||
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Help for build targets
|
||||
help:
|
||||
help: FORCE
|
||||
@echo ""
|
||||
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
|
||||
@echo " * debug - build a debug binary"
|
||||
@@ -214,13 +214,13 @@ help:
|
||||
# -----------------------------------------------------------------------------
|
||||
# Packages
|
||||
#
|
||||
package_debian:
|
||||
package_debian: FORCE
|
||||
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
|
||||
|
||||
package_pacman:
|
||||
package_pacman: FORCE
|
||||
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
|
||||
|
||||
package_archive:
|
||||
package_archive: FORCE
|
||||
make -C "$(BUILD_DIR)" -s package_archive
|
||||
@echo archive in "$(BUILD_DIR)/release"
|
||||
|
||||
@@ -228,24 +228,24 @@ package_archive:
|
||||
# -----------------------------------------------------------------------------
|
||||
# Tests
|
||||
#
|
||||
test:
|
||||
test: FORCE
|
||||
cd $(BUILD_DIR) ; ctest . --output-on-failure
|
||||
|
||||
# run pep8 check check on scripts we distribute.
|
||||
test_pep8:
|
||||
test_pep8: FORCE
|
||||
python3 tests/python/pep8.py > test_pep8.log 2>&1
|
||||
@echo "written: test_pep8.log"
|
||||
|
||||
# run some checks on our cmakefiles.
|
||||
test_cmake:
|
||||
test_cmake: FORCE
|
||||
python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
|
||||
@echo "written: test_cmake_consistency.log"
|
||||
|
||||
# run deprecation tests, see if we have anything to remove.
|
||||
test_deprecated:
|
||||
test_deprecated: FORCE
|
||||
python3 tests/check_deprecated.py
|
||||
|
||||
test_style_c:
|
||||
test_style_c: FORCE
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
@@ -253,7 +253,7 @@ test_style_c:
|
||||
"$(BLENDER_DIR)/source/creator" \
|
||||
--no-length-check
|
||||
|
||||
test_style_c_qtc:
|
||||
test_style_c_qtc: FORCE
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
@@ -266,7 +266,7 @@ test_style_c_qtc:
|
||||
@echo "written: test_style.tasks"
|
||||
|
||||
|
||||
test_style_osl:
|
||||
test_style_osl: FORCE
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
@@ -274,7 +274,7 @@ test_style_osl:
|
||||
"$(BLENDER_DIR)/release/scripts/templates_osl"
|
||||
|
||||
|
||||
test_style_osl_qtc:
|
||||
test_style_osl_qtc: FORCE
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
@@ -289,13 +289,13 @@ test_style_osl_qtc:
|
||||
# Project Files
|
||||
#
|
||||
|
||||
project_qtcreator:
|
||||
project_qtcreator: FORCE
|
||||
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
|
||||
|
||||
project_netbeans:
|
||||
project_netbeans: FORCE
|
||||
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
|
||||
|
||||
project_eclipse:
|
||||
project_eclipse: FORCE
|
||||
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
|
||||
|
||||
|
||||
@@ -303,40 +303,40 @@ project_eclipse:
|
||||
# Static Checking
|
||||
#
|
||||
|
||||
check_cppcheck:
|
||||
check_cppcheck: FORCE
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
|
||||
"$(BLENDER_DIR)/check_cppcheck.txt"
|
||||
@echo "written: check_cppcheck.txt"
|
||||
|
||||
check_clang_array:
|
||||
check_clang_array: FORCE
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
|
||||
|
||||
check_splint:
|
||||
check_splint: FORCE
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
|
||||
|
||||
check_sparse:
|
||||
check_sparse: FORCE
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
|
||||
|
||||
check_smatch:
|
||||
check_smatch: FORCE
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
|
||||
|
||||
check_spelling_py:
|
||||
check_spelling_py: FORCE
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
"$(BLENDER_DIR)/release/scripts"
|
||||
|
||||
check_spelling_c:
|
||||
check_spelling_c: FORCE
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
@@ -345,7 +345,7 @@ check_spelling_c:
|
||||
"$(BLENDER_DIR)/intern/guardedalloc" \
|
||||
"$(BLENDER_DIR)/intern/ghost" \
|
||||
|
||||
check_spelling_c_qtc:
|
||||
check_spelling_c_qtc: FORCE
|
||||
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
@@ -356,13 +356,13 @@ check_spelling_c_qtc:
|
||||
> \
|
||||
"$(BLENDER_DIR)/check_spelling_c.tasks"
|
||||
|
||||
check_spelling_osl:
|
||||
check_spelling_osl: FORCE
|
||||
cd "$(BUILD_DIR)" ;\
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
|
||||
|
||||
check_descriptions:
|
||||
check_descriptions: FORCE
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
|
||||
|
||||
@@ -370,14 +370,14 @@ check_descriptions:
|
||||
# Utilities
|
||||
#
|
||||
|
||||
tgz:
|
||||
tgz: FORCE
|
||||
./build_files/utils/build_tgz.sh
|
||||
|
||||
icons:
|
||||
icons: FORCE
|
||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||
|
||||
update:
|
||||
update: FORCE
|
||||
if [ -d "../lib" ]; then \
|
||||
svn update ../lib/* ; \
|
||||
fi
|
||||
@@ -390,23 +390,23 @@ update:
|
||||
#
|
||||
|
||||
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
||||
doc_py:
|
||||
doc_py: FORCE
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
|
||||
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
|
||||
|
||||
doc_doxy:
|
||||
doc_doxy: FORCE
|
||||
cd doc/doxygen; doxygen Doxyfile
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
|
||||
|
||||
doc_dna:
|
||||
doc_dna: FORCE
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
|
||||
|
||||
doc_man:
|
||||
doc_man: FORCE
|
||||
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
|
||||
|
||||
help_features:
|
||||
help_features: FORCE
|
||||
@python3 -c \
|
||||
"import re; \
|
||||
print('\n'.join([ \
|
||||
@@ -417,7 +417,9 @@ help_features:
|
||||
if w.startswith('WITH_')]))" | uniq
|
||||
|
||||
|
||||
clean:
|
||||
clean: FORCE
|
||||
$(MAKE) -C "$(BUILD_DIR)" clean
|
||||
|
||||
.PHONY: all
|
||||
|
||||
FORCE:
|
||||
|
@@ -266,6 +266,7 @@ if 'blenderlite' in B.targets:
|
||||
target_env_defs['WITH_BF_BOOLEAN'] = False
|
||||
target_env_defs['WITH_BF_REMESH'] = False
|
||||
target_env_defs['WITH_BF_PYTHON'] = False
|
||||
target_env_defs['WITH_BF_IME'] = False
|
||||
target_env_defs['WITH_BF_3DMOUSE'] = False
|
||||
target_env_defs['WITH_BF_LIBMV'] = False
|
||||
target_env_defs['WITH_BF_FREESTYLE'] = False
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
@@ -83,6 +83,9 @@ ENDIF(OPENCOLORIO_FOUND)
|
||||
MARK_AS_ADVANCED(
|
||||
OPENCOLORIO_INCLUDE_DIR
|
||||
OPENCOLORIO_LIBRARY
|
||||
OPENCOLORIO_OPENCOLORIO_LIBRARY
|
||||
OPENCOLORIO_TINYXML_LIBRARY
|
||||
OPENCOLORIO_YAML-CPP_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(COMPONENT)
|
||||
|
@@ -205,7 +205,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
@@ -170,6 +170,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#CUDA
|
||||
@@ -198,6 +200,9 @@ CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
## DISABLED, causes linking errors!
|
||||
|
@@ -151,6 +151,8 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
@@ -197,7 +199,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
@@ -237,6 +239,9 @@ CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
# # Todo
|
||||
|
@@ -169,6 +169,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Freestyle
|
||||
@@ -192,6 +194,9 @@ CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
## DISABLED, causes linking errors!
|
||||
|
@@ -154,6 +154,8 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
@@ -200,7 +202,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
@@ -244,6 +246,9 @@ CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
|
||||
|
@@ -390,6 +390,10 @@ def creator(env):
|
||||
incs.append('#/extern/libmv')
|
||||
defs.append('WITH_LIBMV')
|
||||
|
||||
if env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']:
|
||||
incs.append('#/intern/cycles/blender')
|
||||
defs.append('WITH_CYCLES_LOGGING')
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
defs.append('WITH_FFMPEG')
|
||||
|
||||
@@ -650,7 +654,7 @@ def WinPyBundle(target=None, source=None, env=None):
|
||||
# Extract Numpy
|
||||
if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
|
||||
py_tar = env.subst(env['LCGDIR']).lstrip("#")
|
||||
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
|
||||
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.9.tar.gz'
|
||||
|
||||
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
|
||||
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
|
||||
|
@@ -174,6 +174,7 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_CXX_GUARDEDALLOC',
|
||||
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
|
||||
'BUILDBOT_BRANCH',
|
||||
'WITH_BF_IME',
|
||||
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
|
||||
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV',
|
||||
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
|
||||
@@ -197,7 +198,7 @@ def validate_arguments(args, bc):
|
||||
'C_WARN', 'CC_WARN', 'CXX_WARN',
|
||||
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
|
||||
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
|
||||
'WITH_BF_CYCLES_DEBUG'
|
||||
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING'
|
||||
]
|
||||
|
||||
|
||||
@@ -507,6 +508,8 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
|
||||
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_IME', 'Enable Input Method Editor (IME) for complex Asian character input', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
|
||||
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
|
||||
('BF_3DMOUSE', '3d mouse library base path', ''),
|
||||
@@ -605,6 +608,7 @@ def read_opts(env, cfg, args):
|
||||
('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''),
|
||||
('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []),
|
||||
(BoolVariable('WITH_BF_CYCLES_DEBUG', 'Build Cycles engine with extra debugging capabilities', False)),
|
||||
(BoolVariable('WITH_BF_CYCLES_LOGGING', 'Build Cycles engine with logging support', True)),
|
||||
|
||||
(BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
|
||||
(BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)),
|
||||
|
68
extern/libmv/CMakeLists.txt
vendored
68
extern/libmv/CMakeLists.txt
vendored
@@ -37,13 +37,42 @@ set(SRC
|
||||
libmv-capi.h
|
||||
)
|
||||
|
||||
if(WITH_LIBMV)
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND
|
||||
INC_SYS
|
||||
../Eigen3
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-DWITH_LIBMV_GUARDED_ALLOC
|
||||
-DGOOGLE_GLOG_DLL_DECL=
|
||||
-DLIBMV_NO_FAST_DETECTOR=
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
TEST_SHARED_PTR_SUPPORT()
|
||||
if(SHARED_PTR_FOUND)
|
||||
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||
@@ -56,20 +85,6 @@ if(WITH_LIBMV)
|
||||
message(FATAL_ERROR "Unable to find shared_ptr.")
|
||||
endif()
|
||||
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
../Eigen3
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
@@ -202,17 +217,6 @@ if(WITH_LIBMV)
|
||||
third_party/msinttypes/stdint.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GTESTS)
|
||||
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
|
||||
@@ -262,7 +266,7 @@ if(WITH_LIBMV)
|
||||
endif()
|
||||
|
||||
# make GLog a separate target, so it can be used for gtest as well.
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
# We compile GLog together with GFlag so we don't worry about
|
||||
# adding extra lib to linker.
|
||||
set(GLOG_SRC
|
||||
@@ -338,13 +342,5 @@ if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
)
|
||||
endif()
|
||||
|
||||
set(GLOG_INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
)
|
||||
|
||||
set(GLOG_INC_SYS
|
||||
)
|
||||
|
||||
blender_add_lib(extern_glog "${GLOG_SRC}" "${GLOG_INC}" "${GLOG_INC_SYS}")
|
||||
blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
|
||||
endif()
|
||||
|
47
extern/libmv/SConscript
vendored
47
extern/libmv/SConscript
vendored
@@ -12,6 +12,22 @@ Import('env')
|
||||
defs = []
|
||||
incs = '.'
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
if not env['WITH_SHARED_PTR_SUPPORT']:
|
||||
print("-- Unable to find shared_ptr which is required for compilation.")
|
||||
@@ -22,10 +38,6 @@ if env['WITH_BF_LIBMV']:
|
||||
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
|
||||
defs.append('CERES_TR1_SHARED_PTR')
|
||||
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
src = env.Glob('intern/*.cc')
|
||||
src.remove('intern' + os.sep + 'stub.cc')
|
||||
src += env.Glob('libmv/autotrack/*.cc')
|
||||
@@ -36,27 +48,22 @@ if env['WITH_BF_LIBMV']:
|
||||
src += env.Glob('libmv/simple_pipeline/*.cc')
|
||||
src += env.Glob('libmv/tracking/*.cc')
|
||||
src += env.Glob('third_party/gflags/*.cc')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
src = [src for src in src if src.find('_test.cc') == -1]
|
||||
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
124
extern/libmv/bundle.sh
vendored
124
extern/libmv/bundle.sh
vendored
@@ -130,25 +130,7 @@ set(SRC
|
||||
libmv-capi.h
|
||||
)
|
||||
|
||||
if(WITH_LIBMV)
|
||||
add_definitions(
|
||||
-DWITH_LIBMV_GUARDED_ALLOC
|
||||
-DGOOGLE_GLOG_DLL_DECL=
|
||||
-DLIBMV_NO_FAST_DETECTOR=
|
||||
)
|
||||
|
||||
TEST_SHARED_PTR_SUPPORT()
|
||||
if(SHARED_PTR_FOUND)
|
||||
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||
add_definitions(-DCERES_TR1_MEMORY_HEADER)
|
||||
endif()
|
||||
if(SHARED_PTR_TR1_NAMESPACE)
|
||||
add_definitions(-DCERES_TR1_SHARED_PTR)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to find shared_ptr.")
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
@@ -163,6 +145,38 @@ if(WITH_LIBMV)
|
||||
\${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-DWITH_LIBMV_GUARDED_ALLOC
|
||||
-DGOOGLE_GLOG_DLL_DECL=
|
||||
-DLIBMV_NO_FAST_DETECTOR=
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
TEST_SHARED_PTR_SUPPORT()
|
||||
if(SHARED_PTR_FOUND)
|
||||
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||
add_definitions(-DCERES_TR1_MEMORY_HEADER)
|
||||
endif()
|
||||
if(SHARED_PTR_TR1_NAMESPACE)
|
||||
add_definitions(-DCERES_TR1_SHARED_PTR)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to find shared_ptr.")
|
||||
endif()
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
@@ -194,17 +208,6 @@ ${headers}
|
||||
${third_headers}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GTESTS)
|
||||
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
|
||||
@@ -213,7 +216,7 @@ ${tests}
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SRC
|
||||
libmv-capi_stub.cc
|
||||
intern/stub.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -224,7 +227,7 @@ if(WITH_LIBMV)
|
||||
endif()
|
||||
|
||||
# make GLog a separate target, so it can be used for gtest as well.
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
# We compile GLog together with GFlag so we don't worry about
|
||||
# adding extra lib to linker.
|
||||
set(GLOG_SRC
|
||||
@@ -267,15 +270,7 @@ ${third_glog_headers}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(GLOG_INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
)
|
||||
|
||||
set(GLOG_INC_SYS
|
||||
)
|
||||
|
||||
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${GLOG_INC}" "\${GLOG_INC_SYS}")
|
||||
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${INC}" "\${INC_SYS}")
|
||||
endif()
|
||||
EOF
|
||||
|
||||
@@ -294,6 +289,22 @@ Import('env')
|
||||
defs = []
|
||||
incs = '.'
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
if not env['WITH_SHARED_PTR_SUPPORT']:
|
||||
print("-- Unable to find shared_ptr which is required for compilation.")
|
||||
@@ -304,34 +315,25 @@ if env['WITH_BF_LIBMV']:
|
||||
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
|
||||
defs.append('CERES_TR1_SHARED_PTR')
|
||||
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
src = env.Glob('intern/*.cc')
|
||||
src.remove('intern' + os.sep + 'stub.cc')
|
||||
$src
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
${win_src}
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
src = [src for src in src if src.find('_test.cc') == -1]
|
||||
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
13
extern/libmv/intern/reconstruction.cc
vendored
13
extern/libmv/intern/reconstruction.cc
vendored
@@ -61,6 +61,7 @@ struct libmv_Reconstruction {
|
||||
CameraIntrinsics *intrinsics;
|
||||
|
||||
double error;
|
||||
bool is_valid;
|
||||
};
|
||||
|
||||
namespace {
|
||||
@@ -289,6 +290,12 @@ libmv_Reconstruction *libmv_solveReconstruction(
|
||||
|
||||
LG << "number of markers for init: " << keyframe_markers.size();
|
||||
|
||||
if (keyframe_markers.size() < 8) {
|
||||
LG << "No enough markers to initialize from";
|
||||
libmv_reconstruction->is_valid = false;
|
||||
return libmv_reconstruction;
|
||||
}
|
||||
|
||||
update_callback.invoke(0, "Initial reconstruction");
|
||||
|
||||
EuclideanReconstructTwoFrames(keyframe_markers, &reconstruction);
|
||||
@@ -319,6 +326,7 @@ libmv_Reconstruction *libmv_solveReconstruction(
|
||||
progress_update_callback,
|
||||
callback_customdata);
|
||||
|
||||
libmv_reconstruction->is_valid = true;
|
||||
return (libmv_Reconstruction *) libmv_reconstruction;
|
||||
}
|
||||
|
||||
@@ -377,9 +385,14 @@ libmv_Reconstruction *libmv_solveModal(
|
||||
progress_update_callback,
|
||||
callback_customdata);
|
||||
|
||||
libmv_reconstruction->is_valid = true;
|
||||
return (libmv_Reconstruction *) libmv_reconstruction;
|
||||
}
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction *libmv_reconstruction) {
|
||||
return libmv_reconstruction->is_valid;
|
||||
}
|
||||
|
||||
void libmv_reconstructionDestroy(libmv_Reconstruction *libmv_reconstruction) {
|
||||
LIBMV_OBJECT_DELETE(libmv_reconstruction->intrinsics, CameraIntrinsics);
|
||||
LIBMV_OBJECT_DELETE(libmv_reconstruction, libmv_Reconstruction);
|
||||
|
2
extern/libmv/intern/reconstruction.h
vendored
2
extern/libmv/intern/reconstruction.h
vendored
@@ -68,6 +68,8 @@ libmv_Reconstruction* libmv_solveModal(
|
||||
reconstruct_progress_update_cb progress_update_callback,
|
||||
void* callback_customdata);
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction *libmv_reconstruction);
|
||||
|
||||
void libmv_reconstructionDestroy(libmv_Reconstruction* libmv_reconstruction);
|
||||
|
||||
int libmv_reprojectionPointForTrack(
|
||||
|
4
extern/libmv/intern/stub.cc
vendored
4
extern/libmv/intern/stub.cc
vendored
@@ -138,6 +138,10 @@ libmv_Reconstruction *libmv_solveModal(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction * /*libmv_reconstruction*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int libmv_reprojectionPointForTrack(
|
||||
const libmv_Reconstruction * /*libmv_reconstruction*/,
|
||||
int /*track*/,
|
||||
|
@@ -34,6 +34,11 @@
|
||||
#if defined (__APPLE__)
|
||||
# include <libkern/OSAtomic.h>
|
||||
#elif defined(_MSC_VER)
|
||||
# define NOGDI
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#elif defined(__arm__)
|
||||
/* Attempt to fix compilation error on Debian armel kernel.
|
||||
@@ -97,13 +102,13 @@ atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_add_uint64(uint64_t *p, uint64_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd64(p, x);
|
||||
return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x);
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_sub_uint64(uint64_t *p, uint64_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd64(p, -((int64_t)x));
|
||||
return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x));
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
|
@@ -163,6 +163,10 @@ include_directories(
|
||||
${OPENEXR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# TODO(sergey): Adjust so standalone repository is also happy.
|
||||
include_directories(
|
||||
../atomic
|
||||
)
|
||||
|
||||
# Warnings
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
@@ -62,12 +62,23 @@ if env['WITH_BF_CYCLES_OSL']:
|
||||
if env['WITH_BF_CYCLES_DEBUG']:
|
||||
defs.append('WITH_CYCLES_DEBUG')
|
||||
|
||||
if env['WITH_BF_CYCLES_LOGGING']:
|
||||
defs.append('WITH_CYCLES_LOGGING')
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs.append('#extern/libmv/third_party/glog/src/windows')
|
||||
incs.append('#extern/libmv/third_party/gflags')
|
||||
else:
|
||||
incs.append('#extern/libmv/third_party/glog/src')
|
||||
incs.append('#extern/libmv/third_party/gflags')
|
||||
|
||||
incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
|
||||
incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna #source/blender/blenlib'.split())
|
||||
incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
|
||||
|
||||
incs.append(env['BF_GLEW_INC'])
|
||||
incs.append('#/intern/glew-mx')
|
||||
incs.append('#/intern/atomic')
|
||||
incs.append('#intern/mikktspace')
|
||||
incs.extend('#extern/glew/include #extern/clew/include #extern/cuew/include #intern/mikktspace'.split())
|
||||
|
||||
|
@@ -825,6 +825,14 @@ static void xml_read_background(const XMLReadState& state, pugi::xml_node node)
|
||||
Shader *shader = state.scene->shaders[state.scene->default_background];
|
||||
|
||||
xml_read_bool(&shader->heterogeneous_volume, node, "heterogeneous_volume");
|
||||
xml_read_int(&shader->volume_interpolation_method, node, "volume_interpolation_method");
|
||||
|
||||
if(xml_equal_string(node, "volume_sampling_method", "distance"))
|
||||
shader->volume_sampling_method = VOLUME_SAMPLING_DISTANCE;
|
||||
else if(xml_equal_string(node, "volume_sampling_method", "equiangular"))
|
||||
shader->volume_sampling_method = VOLUME_SAMPLING_EQUIANGULAR;
|
||||
else if(xml_equal_string(node, "volume_sampling_method", "multiple_importance"))
|
||||
shader->volume_sampling_method = VOLUME_SAMPLING_MULTIPLE_IMPORTANCE;
|
||||
|
||||
xml_read_shader_graph(state, shader, node);
|
||||
}
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#include "blender_sync.h"
|
||||
#include "blender_util.h"
|
||||
|
||||
#include "util_logging.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Blender Camera Intermediate: we first convert both the offline and 3d view
|
||||
@@ -400,6 +402,7 @@ void BlenderSync::sync_camera_motion(BL::Object b_ob, float motion_time)
|
||||
tfm = blender_camera_matrix(tfm, cam->type);
|
||||
|
||||
if(tfm != cam->matrix) {
|
||||
VLOG(1) << "Camera " << b_ob.name() << " motion detected.";
|
||||
if(motion_time == -1.0f) {
|
||||
cam->motion.pre = tfm;
|
||||
cam->use_motion = true;
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "subd_split.h"
|
||||
|
||||
#include "util_foreach.h"
|
||||
#include "util_logging.h"
|
||||
|
||||
#include "mikktspace.h"
|
||||
|
||||
@@ -761,11 +762,13 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion
|
||||
if(new_attribute) {
|
||||
if(i != numverts || memcmp(mP, &mesh->verts[0], sizeof(float3)*numverts) == 0) {
|
||||
/* no motion, remove attributes again */
|
||||
VLOG(1) << "No actual motion for mesh " << b_mesh.name();
|
||||
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||
if(attr_mN)
|
||||
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_NORMAL);
|
||||
}
|
||||
else if(time_index > 0) {
|
||||
VLOG(1) << "Filling motion for mesh " << b_mesh.name();
|
||||
/* motion, fill up previous steps that we might have skipped because
|
||||
* they had no motion, but we need them anyway now */
|
||||
float3 *P = &mesh->verts[0];
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "util_foreach.h"
|
||||
#include "util_hash.h"
|
||||
#include "util_logging.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
@@ -251,6 +252,7 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
|
||||
if(object && (scene->need_motion() == Scene::MOTION_PASS || object_use_motion(b_ob))) {
|
||||
/* object transformation */
|
||||
if(tfm != object->tfm) {
|
||||
VLOG(1) << "Object " << b_ob.name() << " motion detected.";
|
||||
if(motion_time == -1.0f) {
|
||||
object->motion.pre = tfm;
|
||||
object->use_motion = true;
|
||||
|
@@ -105,7 +105,7 @@ static PyObject *create_func(PyObject *self, PyObject *args)
|
||||
BL::UserPreferences userpref(userprefptr);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
BL::BlendData data(dataptr);
|
||||
|
||||
PointerRNA sceneptr;
|
||||
@@ -113,15 +113,15 @@ static PyObject *create_func(PyObject *self, PyObject *args)
|
||||
BL::Scene scene(sceneptr);
|
||||
|
||||
PointerRNA regionptr;
|
||||
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyregion), ®ionptr);
|
||||
RNA_pointer_create(NULL, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), ®ionptr);
|
||||
BL::Region region(regionptr);
|
||||
|
||||
PointerRNA v3dptr;
|
||||
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
|
||||
RNA_pointer_create(NULL, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
|
||||
BL::SpaceView3D v3d(v3dptr);
|
||||
|
||||
PointerRNA rv3dptr;
|
||||
RNA_id_pointer_create((ID*)pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
|
||||
RNA_pointer_create(NULL, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
|
||||
BL::RegionView3D rv3d(rv3dptr);
|
||||
|
||||
/* create session */
|
||||
@@ -196,7 +196,7 @@ static PyObject *bake_func(PyObject *self, PyObject *args)
|
||||
void *b_result = PyLong_AsVoidPtr(pyresult);
|
||||
|
||||
PointerRNA bakepixelptr;
|
||||
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pypixel_array), &bakepixelptr);
|
||||
RNA_pointer_create(NULL, &RNA_BakePixel, PyLong_AsVoidPtr(pypixel_array), &bakepixelptr);
|
||||
BL::BakePixel b_bake_pixel(bakepixelptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
@@ -238,7 +238,7 @@ static PyObject *reset_func(PyObject *self, PyObject *args)
|
||||
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
BL::BlendData b_data(dataptr);
|
||||
|
||||
PointerRNA sceneptr;
|
||||
|
@@ -92,6 +92,7 @@ void BlenderSession::create_session()
|
||||
|
||||
/* reset status/progress */
|
||||
last_status = "";
|
||||
last_error = "";
|
||||
last_progress = -1.0f;
|
||||
start_resize_time = 0.0;
|
||||
|
||||
@@ -826,10 +827,8 @@ void BlenderSession::update_status_progress()
|
||||
get_status(status, substatus);
|
||||
get_progress(progress, total_time);
|
||||
|
||||
|
||||
|
||||
if(background) {
|
||||
if(progress>0)
|
||||
if(progress > 0)
|
||||
remaining_time = (1.0 - (double)progress) * (total_time / (double)progress);
|
||||
|
||||
scene += " | " + b_scene.name();
|
||||
@@ -843,12 +842,12 @@ void BlenderSession::update_status_progress()
|
||||
if(samples > 0 && total_samples != USHRT_MAX)
|
||||
remaining_time = (total_samples - samples) * (total_time / samples);
|
||||
}
|
||||
|
||||
if(remaining_time>0) {
|
||||
|
||||
if(remaining_time > 0) {
|
||||
BLI_timestr(remaining_time, time_str, sizeof(time_str));
|
||||
timestatus += "Remaining:" + string(time_str) + " | ";
|
||||
}
|
||||
|
||||
|
||||
timestatus += string_printf("Mem:%.2fM, Peak:%.2fM", (double)mem_used, (double)mem_peak);
|
||||
|
||||
if(status.size() > 0)
|
||||
@@ -865,6 +864,21 @@ void BlenderSession::update_status_progress()
|
||||
b_engine.update_progress(progress);
|
||||
last_progress = progress;
|
||||
}
|
||||
|
||||
if (session->progress.get_error()) {
|
||||
string error = session->progress.get_error_message();
|
||||
if(error != last_error) {
|
||||
/* TODO(sergey): Currently C++ RNA API doesn't let us to
|
||||
* use mnemonic name for the variable. Would be nice to
|
||||
* have this figured out.
|
||||
*
|
||||
* For until then, 1 << 5 means RPT_ERROR.
|
||||
*/
|
||||
b_engine.report(1 << 5, error.c_str());
|
||||
b_engine.error_set(error.c_str());
|
||||
last_error = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BlenderSession::tag_update()
|
||||
|
@@ -91,6 +91,7 @@ public:
|
||||
string b_rlay_name;
|
||||
|
||||
string last_status;
|
||||
string last_error;
|
||||
float last_progress;
|
||||
|
||||
int width, height;
|
||||
|
@@ -400,7 +400,7 @@ BVHNode* BVHBuild::build_node(const BVHRange& range, int level)
|
||||
progress_total += left.size() + right.size() - range.size();
|
||||
size_t total = progress_total;
|
||||
|
||||
/* leaft node */
|
||||
/* left node */
|
||||
BVHNode *leftnode = build_node(left, level + 1);
|
||||
|
||||
/* right node (modify start for splits) */
|
||||
|
@@ -76,7 +76,7 @@ public:
|
||||
{
|
||||
if(first_error) {
|
||||
fprintf(stderr, "\nRefer to the Cycles GPU rendering documentation for possible solutions:\n");
|
||||
fprintf(stderr, "http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/GPU_Rendering\n\n");
|
||||
fprintf(stderr, "http://www.blender.org/manual/render/cycles/gpu_rendering.html\n\n");
|
||||
first_error = false;
|
||||
}
|
||||
}
|
||||
@@ -202,24 +202,8 @@ public:
|
||||
/* compute cubin name */
|
||||
int major, minor;
|
||||
cuDeviceComputeCapability(&major, &minor, cuDevId);
|
||||
|
||||
string cubin;
|
||||
|
||||
/* ToDo: We don't bundle sm_52 kernel yet */
|
||||
if(major == 5 && minor == 2) {
|
||||
if(experimental)
|
||||
cubin = path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor));
|
||||
else
|
||||
cubin = path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor));
|
||||
|
||||
if(path_exists(cubin))
|
||||
/* self build sm_52 kernel? Use it. */
|
||||
return cubin;
|
||||
else
|
||||
/* use 5.0 kernel as workaround */
|
||||
minor = 0;
|
||||
}
|
||||
|
||||
/* attempt to use kernel provided with blender */
|
||||
if(experimental)
|
||||
cubin = path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor));
|
||||
|
@@ -681,7 +681,7 @@ ccl_device float3 shader_bsdf_subsurface(KernelGlobals *kg, ShaderData *sd)
|
||||
for(int i = 0; i< sd->num_closure; i++) {
|
||||
ShaderClosure *sc = &sd->closure[i];
|
||||
|
||||
if(CLOSURE_IS_BSSRDF(sc->type))
|
||||
if(CLOSURE_IS_BSSRDF(sc->type) || CLOSURE_IS_BSDF_BSSRDF(sc->type))
|
||||
eval += sc->weight;
|
||||
}
|
||||
|
||||
|
@@ -539,34 +539,25 @@ typedef enum AttributeStandard {
|
||||
#define MAX_CLOSURE 1
|
||||
#endif
|
||||
|
||||
/* TODO(sergey): This is rather nasty bug happening in here, which
|
||||
* could be simply a compilers bug for which we can't find a generic
|
||||
* platform independent workaround. Also even if it's a compiler
|
||||
* issue, it's not so simple to upgrade the compiler in the release
|
||||
* environment for Linux and doing it so closer to the release is
|
||||
* rather a risky business.
|
||||
*
|
||||
* For this release it's probably safer to stick with such a rather
|
||||
* dirty solution, and look for a cleaner fix during the next release
|
||||
* cycle.
|
||||
/* This struct is to be 16 bytes aligned, we also keep some extra precautions:
|
||||
* - All the float3 members are in the beginning of the struct, so compiler
|
||||
* does not put own padding trying to align this members.
|
||||
* - We make sure OSL pointer is also 16 bytes aligned.
|
||||
*/
|
||||
typedef struct ShaderClosure {
|
||||
ClosureType type;
|
||||
float3 weight;
|
||||
#ifndef __APPLE__
|
||||
float3 N;
|
||||
float3 T;
|
||||
|
||||
ClosureType type;
|
||||
float sample_weight;
|
||||
#endif
|
||||
float data0;
|
||||
float data1;
|
||||
float data2;
|
||||
int pad1, pad2, pad3;
|
||||
|
||||
float3 N;
|
||||
float3 T;
|
||||
#ifdef __APPLE__
|
||||
float sample_weight;
|
||||
#endif
|
||||
#ifdef __OSL__
|
||||
void *prim;
|
||||
void *prim, *pad4;
|
||||
#endif
|
||||
} ShaderClosure;
|
||||
|
||||
|
@@ -38,6 +38,7 @@ incs.append(env['BF_OIIO_INC'])
|
||||
incs.append(env['BF_BOOST_INC'])
|
||||
incs.append(env['BF_OSL_INC'])
|
||||
incs.append(env['BF_OPENEXR_INC'].split())
|
||||
incs.append('#/intern/atomic')
|
||||
|
||||
defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
|
||||
defs.append('CCL_NAMESPACE_END=}')
|
||||
@@ -46,6 +47,16 @@ defs.append('WITH_OSL')
|
||||
if env['WITH_BF_CYCLES_DEBUG']:
|
||||
defs.append('WITH_CYCLES_DEBUG')
|
||||
|
||||
if env['WITH_BF_CYCLES_LOGGING']:
|
||||
defs.append('WITH_CYCLES_LOGGING')
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs.append('#extern/libmv/third_party/glog/src/windows')
|
||||
incs.append('#extern/libmv/third_party/gflags')
|
||||
else:
|
||||
incs.append('#extern/libmv/third_party/glog/src')
|
||||
incs.append('#extern/libmv/third_party/gflags')
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
cxxflags.append('-DBOOST_NO_RTTI -DBOOST_NO_TYPEID /fp:fast'.split())
|
||||
incs.append(env['BF_PTHREADS_INC'])
|
||||
|
@@ -189,7 +189,7 @@ static void register_closure(OSL::ShadingSystem *ss, const char *name, int id, O
|
||||
/* optimization: it's possible to not use a prepare function at all and
|
||||
* only initialize the actual class when accessing the closure component
|
||||
* data, but then we need to map the id to the class somehow */
|
||||
ss->register_closure(name, id, params, prepare, NULL);
|
||||
ss->register_closure(name, id, params, prepare, NULL, 16);
|
||||
}
|
||||
|
||||
void OSLShader::register_closures(OSLShadingSystem *ss_)
|
||||
|
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "stdosl.h"
|
||||
#include "node_color.h"
|
||||
|
||||
shader node_combine_hsv(
|
||||
float H = 0.0,
|
||||
@@ -22,6 +23,6 @@ shader node_combine_hsv(
|
||||
float V = 0.0,
|
||||
output color Color = 0.8)
|
||||
{
|
||||
Color = color("hsv", H, S, V);
|
||||
Color = color_srgb_to_scene_linear(color("hsv", H, S, V));
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,6 @@ shader node_normal(
|
||||
output float Dot = 1.0)
|
||||
{
|
||||
NormalOut = normalize(Direction);
|
||||
Dot = dot(NormalOut, NormalIn);
|
||||
Dot = dot(NormalOut, normalize(NormalIn));
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ shader node_separate_hsv(
|
||||
output float S = 0.0,
|
||||
output float V = 0.0)
|
||||
{
|
||||
color col = rgb_to_hsv(Color);
|
||||
color col = rgb_to_hsv(color_scene_linear_to_srgb(Color));
|
||||
|
||||
H = col[0];
|
||||
S = col[1];
|
||||
|
@@ -26,7 +26,8 @@ ccl_device void svm_node_combine_hsv(KernelGlobals *kg, ShaderData *sd, float *s
|
||||
float value = stack_load_float(stack, value_in);
|
||||
|
||||
/* Combine, and convert back to RGB */
|
||||
float3 color = hsv_to_rgb(make_float3(hue, saturation, value));
|
||||
float3 color = color_srgb_to_scene_linear(
|
||||
hsv_to_rgb(make_float3(hue, saturation, value)));
|
||||
|
||||
if (stack_valid(color_out))
|
||||
stack_store_float3(stack, color_out, color);
|
||||
@@ -40,7 +41,7 @@ ccl_device void svm_node_separate_hsv(KernelGlobals *kg, ShaderData *sd, float *
|
||||
float3 color = stack_load_float3(stack, color_in);
|
||||
|
||||
/* Convert to HSV */
|
||||
color = rgb_to_hsv(color);
|
||||
color = rgb_to_hsv(color_scene_linear_to_srgb(color));
|
||||
|
||||
if (stack_valid(hue_out))
|
||||
stack_store_float(stack, hue_out, color.x);
|
||||
|
@@ -59,6 +59,10 @@ Integrator::Integrator()
|
||||
mesh_light_samples = 1;
|
||||
subsurface_samples = 1;
|
||||
volume_samples = 1;
|
||||
|
||||
sample_all_lights_direct = true;
|
||||
sample_all_lights_indirect = true;
|
||||
|
||||
method = PATH;
|
||||
|
||||
sampling_pattern = SAMPLING_PATTERN_SOBOL;
|
||||
|
@@ -153,81 +153,83 @@ void Scene::device_update(Device *device_, Progress& progress)
|
||||
progress.set_status("Updating Shaders");
|
||||
shader_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Images");
|
||||
image_manager->device_update(device, &dscene, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Background");
|
||||
background->device_update(device, &dscene, this);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Objects");
|
||||
object_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Meshes");
|
||||
mesh_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Objects Flags");
|
||||
object_manager->device_update_flags(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Hair Systems");
|
||||
curve_system_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Lookup Tables");
|
||||
lookup_tables->device_update(device, &dscene);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
/* TODO(sergey): Make sure camera is not needed above. */
|
||||
progress.set_status("Updating Camera");
|
||||
camera->device_update(device, &dscene, this);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Lights");
|
||||
light_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Particle Systems");
|
||||
particle_system_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Film");
|
||||
film->device_update(device, &dscene, this);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Integrator");
|
||||
integrator->device_update(device, &dscene, this);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Lookup Tables");
|
||||
lookup_tables->device_update(device, &dscene);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Baking");
|
||||
bake_manager->device_update(device, &dscene, this, progress);
|
||||
|
||||
if(progress.get_cancel()) return;
|
||||
if(progress.get_cancel() || device->have_error()) return;
|
||||
|
||||
progress.set_status("Updating Device", "Writing constant memory");
|
||||
device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
|
||||
if(device->have_error() == false) {
|
||||
progress.set_status("Updating Device", "Writing constant memory");
|
||||
device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
|
||||
}
|
||||
}
|
||||
|
||||
Scene::MotionType Scene::need_motion(bool advanced_shading)
|
||||
|
@@ -251,7 +251,7 @@ void Session::run_gpu()
|
||||
update_scene();
|
||||
|
||||
if(!device->error_message().empty())
|
||||
progress.set_cancel(device->error_message());
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
if(progress.get_cancel())
|
||||
break;
|
||||
@@ -292,7 +292,7 @@ void Session::run_gpu()
|
||||
}
|
||||
|
||||
if(!device->error_message().empty())
|
||||
progress.set_cancel(device->error_message());
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
tiles_written = update_progressive_refine(progress.get_cancel());
|
||||
|
||||
@@ -540,7 +540,7 @@ void Session::run_cpu()
|
||||
update_scene();
|
||||
|
||||
if(!device->error_message().empty())
|
||||
progress.set_cancel(device->error_message());
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
if(progress.get_cancel())
|
||||
break;
|
||||
@@ -558,7 +558,7 @@ void Session::run_cpu()
|
||||
need_tonemap = true;
|
||||
|
||||
if(!device->error_message().empty())
|
||||
progress.set_cancel(device->error_message());
|
||||
progress.set_error(device->error_message());
|
||||
}
|
||||
|
||||
device->task_wait();
|
||||
@@ -580,7 +580,7 @@ void Session::run_cpu()
|
||||
}
|
||||
|
||||
if(!device->error_message().empty())
|
||||
progress.set_cancel(device->error_message());
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
tiles_written = update_progressive_refine(progress.get_cancel());
|
||||
}
|
||||
@@ -604,7 +604,7 @@ void Session::load_kernels()
|
||||
if(message.empty())
|
||||
message = "Failed loading render kernel, see console for errors";
|
||||
|
||||
progress.set_cancel(message);
|
||||
progress.set_error(message);
|
||||
progress.set_status("Error", message);
|
||||
progress.set_update();
|
||||
return;
|
||||
|
@@ -18,6 +18,15 @@
|
||||
#define __SHADER_H__
|
||||
|
||||
#ifdef WITH_OSL
|
||||
# if defined(_MSC_VER)
|
||||
/* Prevent OSL from polluting the context with weird macros from windows.h.
|
||||
* TODO(sergey): Ideally it's only enough to have class/struct declarations in
|
||||
* the header and skip header include here.
|
||||
*/
|
||||
# define NOGDI
|
||||
# define NOMINMAX
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <OSL/oslexec.h>
|
||||
#endif
|
||||
|
||||
|
@@ -30,6 +30,7 @@ endif()
|
||||
set(SRC_HEADERS
|
||||
util_algorithm.h
|
||||
util_args.h
|
||||
util_atomic.h
|
||||
util_boundbox.h
|
||||
util_cache.h
|
||||
util_debug.h
|
||||
|
33
intern/cycles/util/util_atomic.h
Normal file
33
intern/cycles/util/util_atomic.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2014 Blender Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License
|
||||
*/
|
||||
|
||||
#ifndef __UTIL_ATOMIC_H__
|
||||
#define __UTIL_ATOMIC_H__
|
||||
|
||||
/* Using atomic ops header from Blender. */
|
||||
#include "atomic_ops.h"
|
||||
|
||||
ATOMIC_INLINE void atomic_update_max_z(size_t *maximum_value, size_t value)
|
||||
{
|
||||
size_t prev_value = *maximum_value;
|
||||
while (prev_value < value) {
|
||||
if (atomic_cas_z(maximum_value, prev_value, value) != prev_value) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __UTIL_ATOMIC_H__ */
|
@@ -130,6 +130,9 @@
|
||||
|
||||
/* MinGW64 has conflicting declarations for these SSE headers in <windows.h>.
|
||||
* Since we can't avoid including <windows.h>, better only include that */
|
||||
#define NOGDI
|
||||
#define NOMINMAX
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#endif
|
||||
|
@@ -46,6 +46,8 @@ public:
|
||||
update_cb = NULL;
|
||||
cancel = false;
|
||||
cancel_message = "";
|
||||
error = false;
|
||||
error_message = "";
|
||||
cancel_cb = NULL;
|
||||
}
|
||||
|
||||
@@ -79,6 +81,8 @@ public:
|
||||
sync_substatus = "";
|
||||
cancel = false;
|
||||
cancel_message = "";
|
||||
error = false;
|
||||
error_message = "";
|
||||
}
|
||||
|
||||
/* cancel */
|
||||
@@ -108,6 +112,28 @@ public:
|
||||
cancel_cb = function;
|
||||
}
|
||||
|
||||
/* error */
|
||||
void set_error(const string& error_message_)
|
||||
{
|
||||
thread_scoped_lock lock(progress_mutex);
|
||||
error_message = error_message_;
|
||||
error = true;
|
||||
/* If error happens we also stop rendering. */
|
||||
cancel_message = error_message_;
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
bool get_error()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
string get_error_message()
|
||||
{
|
||||
thread_scoped_lock lock(progress_mutex);
|
||||
return error_message;
|
||||
}
|
||||
|
||||
/* tile and timing information */
|
||||
|
||||
void set_start_time(double start_time_)
|
||||
@@ -259,6 +285,9 @@ protected:
|
||||
|
||||
volatile bool cancel;
|
||||
string cancel_message;
|
||||
|
||||
volatile bool error;
|
||||
string error_message;
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -17,6 +17,8 @@
|
||||
#ifndef __UTIL_STATS_H__
|
||||
#define __UTIL_STATS_H__
|
||||
|
||||
#include "util_atomic.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
class Stats {
|
||||
@@ -24,14 +26,13 @@ public:
|
||||
Stats() : mem_used(0), mem_peak(0) {}
|
||||
|
||||
void mem_alloc(size_t size) {
|
||||
mem_used += size;
|
||||
if(mem_used > mem_peak)
|
||||
mem_peak = mem_used;
|
||||
atomic_add_z(&mem_used, size);
|
||||
atomic_update_max_z(&mem_peak, mem_used);
|
||||
}
|
||||
|
||||
void mem_free(size_t size) {
|
||||
assert(mem_used >= size);
|
||||
mem_used -= size;
|
||||
atomic_sub_z(&mem_used, size);
|
||||
}
|
||||
|
||||
size_t mem_used;
|
||||
|
@@ -280,6 +280,16 @@ elseif(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
add_definitions(-DWITH_INPUT_IME)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ImeWin32.cpp
|
||||
|
||||
intern/GHOST_ImeWin32.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerWin32.cpp
|
||||
|
@@ -897,6 +897,30 @@ extern int GHOST_UseNativePixels(void);
|
||||
*/
|
||||
extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle);
|
||||
|
||||
/**
|
||||
* Enable IME attached to the given window, i.e. allows user-input
|
||||
* events to be dispatched to the IME.
|
||||
* \param windowhandle Window handle of the caller
|
||||
* \param x Requested x-coordinate of the rectangle
|
||||
* \param y Requested y-coordinate of the rectangle
|
||||
* \param w Requested width of the rectangle
|
||||
* \param h Requested height of the rectangle
|
||||
* \param complete Whether or not to complete the ongoing composition
|
||||
* true: Start a new composition
|
||||
* false: Move the IME windows to the given position without finishing it.
|
||||
*/
|
||||
extern void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
|
||||
GHOST_TInt32 x,
|
||||
GHOST_TInt32 y,
|
||||
GHOST_TInt32 w,
|
||||
GHOST_TInt32 h,
|
||||
int complete);
|
||||
/**
|
||||
* Disable the IME attached to the given window, i.e. prohibits any user-input
|
||||
* events from being dispatched to the IME.
|
||||
* \param windowhandle The window handle of the caller
|
||||
*/
|
||||
extern void GHOST_EndIME(GHOST_WindowHandle windowhandle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -331,6 +331,29 @@ public:
|
||||
|
||||
virtual float getNativePixelSize(void) = 0;
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
/**
|
||||
* Enable IME attached to the given window, i.e. allows user-input
|
||||
* events to be dispatched to the IME.
|
||||
* \param x Requested x-coordinate of the rectangle
|
||||
* \param y Requested y-coordinate of the rectangle
|
||||
* \param w Requested width of the rectangle
|
||||
* \param h Requested height of the rectangle
|
||||
* \param complete Whether or not to complete the ongoing composition
|
||||
* true: Start a new composition
|
||||
* false: Move the IME windows to the given position without finishing it.
|
||||
*/
|
||||
virtual void beginIME(
|
||||
GHOST_TInt32 x, GHOST_TInt32 y,
|
||||
GHOST_TInt32 w, GHOST_TInt32 h,
|
||||
int completed) = 0;
|
||||
|
||||
/**
|
||||
* Disable the IME attached to the given window, i.e. prohibits any user-input
|
||||
* events from being dispatched to the IME.
|
||||
*/
|
||||
virtual void endIME() = 0;
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IWindow")
|
||||
|
@@ -190,6 +190,10 @@ typedef enum {
|
||||
|
||||
GHOST_kEventTimer,
|
||||
|
||||
GHOST_kEventImeCompositionStart,
|
||||
GHOST_kEventImeComposition,
|
||||
GHOST_kEventImeCompositionEnd,
|
||||
|
||||
GHOST_kNumEventTypes
|
||||
} GHOST_TEventType;
|
||||
|
||||
@@ -436,6 +440,22 @@ typedef struct {
|
||||
GHOST_TEventDataPtr data;
|
||||
} GHOST_TEventDragnDropData;
|
||||
|
||||
/** similar to wmImeData */
|
||||
typedef struct {
|
||||
/** size_t */
|
||||
GHOST_TUserDataPtr result_len, composite_len;
|
||||
/** char * utf8 encoding */
|
||||
GHOST_TUserDataPtr result, composite;
|
||||
/** Cursor position in the IME composition. */
|
||||
int cursor_position;
|
||||
/** Represents the position of the beginning of the selection */
|
||||
int target_start;
|
||||
/** Represents the position of the end of the selection */
|
||||
int target_end;
|
||||
/** custom temporal data */
|
||||
GHOST_TUserDataPtr tmp;
|
||||
} GHOST_TEventImeData;
|
||||
|
||||
typedef struct {
|
||||
int count;
|
||||
GHOST_TUns8 **strings;
|
||||
|
@@ -154,6 +154,14 @@ if env['BF_GHOST_DEBUG']:
|
||||
else:
|
||||
sources.remove('intern' + os.sep + 'GHOST_EventPrinter.cpp')
|
||||
|
||||
if env['WITH_BF_IME'] and window_system in ('win32-vc', 'win32-mingw', 'win64-vc', 'win64-mingw'):
|
||||
defs.append('WITH_INPUT_IME')
|
||||
elif env['WITH_BF_IME']:
|
||||
print "IME input is only supported on Windows! Please disable WITH_BF_IME!"
|
||||
Exit()
|
||||
else:
|
||||
sources.remove('intern' + os.sep + 'GHOST_ImeWin32.cpp')
|
||||
|
||||
if env['WITH_BF_3DMOUSE']:
|
||||
defs.append('WITH_INPUT_NDOF')
|
||||
|
||||
|
@@ -915,3 +915,21 @@ float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
|
||||
void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
|
||||
GHOST_TInt32 x, GHOST_TInt32 y,
|
||||
GHOST_TInt32 w, GHOST_TInt32 h,
|
||||
int complete)
|
||||
{
|
||||
GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
|
||||
window->beginIME(x, y, w, h, complete);
|
||||
}
|
||||
|
||||
void GHOST_EndIME(GHOST_WindowHandle windowhandle)
|
||||
{
|
||||
GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
|
||||
window->endIME();
|
||||
}
|
||||
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
517
intern/ghost/intern/GHOST_ImeWin32.cpp
Normal file
517
intern/ghost/intern/GHOST_ImeWin32.cpp
Normal file
@@ -0,0 +1,517 @@
|
||||
/*
|
||||
* ***** 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) 2010 The Chromium Authors. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: some of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
||||
/** \file ghost/intern/GHOST_ImeWin32.cpp
|
||||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
|
||||
#include "GHOST_C-api.h"
|
||||
#include "GHOST_ImeWin32.h"
|
||||
#include "GHOST_WindowWin32.h"
|
||||
#include "utfconv.h"
|
||||
|
||||
|
||||
GHOST_ImeWin32::GHOST_ImeWin32()
|
||||
: ime_status_(false),
|
||||
input_language_id_(LANG_USER_DEFAULT),
|
||||
is_composing_(false),
|
||||
system_caret_(false),
|
||||
caret_rect_(-1, -1, 0, 0),
|
||||
is_first(true),
|
||||
is_enable(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
GHOST_ImeWin32::~GHOST_ImeWin32()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool GHOST_ImeWin32::SetInputLanguage()
|
||||
{
|
||||
/**
|
||||
* Retrieve the current keyboard layout from Windows and determine whether
|
||||
* or not the current input context has IMEs.
|
||||
* Also save its input language for language-specific operations required
|
||||
* while composing a text.
|
||||
*/
|
||||
HKL keyboard_layout = ::GetKeyboardLayout(0);
|
||||
input_language_id_ = reinterpret_cast<LANGID>(keyboard_layout);
|
||||
ime_status_ = ::ImmIsIME(keyboard_layout);
|
||||
return ime_status_;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::CreateImeWindow(HWND window_handle)
|
||||
{
|
||||
/**
|
||||
* When a user disables TSF (Text Service Framework) and CUAS (Cicero
|
||||
* Unaware Application Support), Chinese IMEs somehow ignore function calls
|
||||
* to ::ImmSetCandidateWindow(), i.e. they do not move their candidate
|
||||
* window to the position given as its parameters, and use the position
|
||||
* of the current system caret instead, i.e. it uses ::GetCaretPos() to
|
||||
* retrieve the position of their IME candidate window.
|
||||
* Therefore, we create a temporary system caret for Chinese IMEs and use
|
||||
* it during this input context.
|
||||
* Since some third-party Japanese IME also uses ::GetCaretPos() to determine
|
||||
* their window position, we also create a caret for Japanese IMEs.
|
||||
*/
|
||||
if (PRIMARYLANGID(input_language_id_) == LANG_CHINESE ||
|
||||
PRIMARYLANGID(input_language_id_) == LANG_JAPANESE) {
|
||||
if (!system_caret_) {
|
||||
if (::CreateCaret(window_handle, NULL, 1, 1)) {
|
||||
system_caret_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Restore the positions of the IME windows. */
|
||||
UpdateImeWindow(window_handle);
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::SetImeWindowStyle(HWND window_handle, UINT message, WPARAM wparam, LPARAM lparam, BOOL *handled)
|
||||
{
|
||||
/**
|
||||
* To prevent the IMM (Input Method Manager) from displaying the IME
|
||||
* composition window, Update the styles of the IME windows and EXPLICITLY
|
||||
* call ::DefWindowProc() here.
|
||||
* NOTE(hbono): We can NEVER let WTL call ::DefWindowProc() when we update
|
||||
* the styles of IME windows because the 'lparam' variable is a local one
|
||||
* and all its updates disappear in returning from this function, i.e. WTL
|
||||
* does not call ::DefWindowProc() with our updated 'lparam' value but call
|
||||
* the function with its original value and over-writes our window styles.
|
||||
*/
|
||||
*handled = TRUE;
|
||||
lparam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
|
||||
::DefWindowProc(window_handle, message, wparam, lparam);
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::DestroyImeWindow(HWND window_handle)
|
||||
{
|
||||
/* Destroy the system caret if we have created for this IME input context. */
|
||||
if (system_caret_) {
|
||||
::DestroyCaret();
|
||||
system_caret_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::MoveImeWindow(HWND window_handle, HIMC imm_context)
|
||||
{
|
||||
int x = caret_rect_.m_l;
|
||||
int y = caret_rect_.m_t;
|
||||
const int kCaretMargin = 1;
|
||||
/**
|
||||
* As written in a comment in GHOST_ImeWin32::CreateImeWindow(),
|
||||
* Chinese IMEs ignore function calls to ::ImmSetCandidateWindow()
|
||||
* when a user disables TSF (Text Service Framework) and CUAS (Cicero
|
||||
* Unaware Application Support).
|
||||
* On the other hand, when a user enables TSF and CUAS, Chinese IMEs
|
||||
* ignore the position of the current system caret and uses the
|
||||
* parameters given to ::ImmSetCandidateWindow() with its 'dwStyle'
|
||||
* parameter CFS_CANDIDATEPOS.
|
||||
* Therefore, we do not only call ::ImmSetCandidateWindow() but also
|
||||
* set the positions of the temporary system caret if it exists.
|
||||
*/
|
||||
CANDIDATEFORM candidate_position = { 0, CFS_CANDIDATEPOS, { x, y },
|
||||
{ 0, 0, 0, 0 } };
|
||||
::ImmSetCandidateWindow(imm_context, &candidate_position);
|
||||
if (system_caret_) {
|
||||
switch (PRIMARYLANGID(input_language_id_)) {
|
||||
case LANG_JAPANESE:
|
||||
::SetCaretPos(x, y + caret_rect_.getHeight());
|
||||
break;
|
||||
default:
|
||||
::SetCaretPos(x, y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (PRIMARYLANGID(input_language_id_) == LANG_KOREAN) {
|
||||
/**
|
||||
* Chinese IMEs and Japanese IMEs require the upper-left corner of
|
||||
* the caret to move the position of their candidate windows.
|
||||
* On the other hand, Korean IMEs require the lower-left corner of the
|
||||
* caret to move their candidate windows.
|
||||
*/
|
||||
y += kCaretMargin;
|
||||
}
|
||||
/**
|
||||
* Japanese IMEs and Korean IMEs also use the rectangle given to
|
||||
* ::ImmSetCandidateWindow() with its 'dwStyle' parameter CFS_EXCLUDE
|
||||
* to move their candidate windows when a user disables TSF and CUAS.
|
||||
* Therefore, we also set this parameter here.
|
||||
*/
|
||||
CANDIDATEFORM exclude_rectangle = { 0, CFS_EXCLUDE, { x, y },
|
||||
{ x, y, x + caret_rect_.getWidth(), y + caret_rect_.getHeight() } };
|
||||
::ImmSetCandidateWindow(imm_context, &exclude_rectangle);
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::UpdateImeWindow(HWND window_handle)
|
||||
{
|
||||
/* Just move the IME window attached to the given window. */
|
||||
if (caret_rect_.m_l >= 0 && caret_rect_.m_t >= 0) {
|
||||
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||
if (imm_context) {
|
||||
MoveImeWindow(window_handle, imm_context);
|
||||
::ImmReleaseContext(window_handle, imm_context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::CleanupComposition(HWND window_handle)
|
||||
{
|
||||
/**
|
||||
* Notify the IMM attached to the given window to complete the ongoing
|
||||
* composition, (this case happens when the given window is de-activated
|
||||
* while composing a text and re-activated), and reset the omposition status.
|
||||
*/
|
||||
if (is_composing_) {
|
||||
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||
if (imm_context) {
|
||||
::ImmNotifyIME(imm_context, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
|
||||
::ImmReleaseContext(window_handle, imm_context);
|
||||
}
|
||||
ResetComposition(window_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::CheckFirst(HWND window_handle)
|
||||
{
|
||||
if (is_first) {
|
||||
this->EndIME(window_handle);
|
||||
is_first = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::ResetComposition(HWND window_handle)
|
||||
{
|
||||
/* Currently, just reset the composition status. */
|
||||
is_composing_ = false;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::CompleteComposition(HWND window_handle, HIMC imm_context)
|
||||
{
|
||||
/**
|
||||
* We have to confirm there is an ongoing composition before completing it.
|
||||
* This is for preventing some IMEs from getting confused while completing an
|
||||
* ongoing composition even if they do not have any ongoing compositions.)
|
||||
*/
|
||||
if (is_composing_) {
|
||||
::ImmNotifyIME(imm_context, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
|
||||
ResetComposition(window_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::GetCaret(HIMC imm_context, LPARAM lparam, ImeComposition *composition)
|
||||
{
|
||||
/**
|
||||
* This operation is optional and language-dependent because the caret
|
||||
* style is depended on the language, e.g.:
|
||||
* * Korean IMEs: the caret is a blinking block,
|
||||
* (It contains only one hangul character);
|
||||
* * Chinese IMEs: the caret is a blinking line,
|
||||
* (i.e. they do not need to retrieve the target selection);
|
||||
* * Japanese IMEs: the caret is a selection (or underlined) block,
|
||||
* (which can contain one or more Japanese characters).
|
||||
*/
|
||||
int target_start = -1;
|
||||
int target_end = -1;
|
||||
switch (PRIMARYLANGID(input_language_id_)) {
|
||||
case LANG_KOREAN:
|
||||
if (lparam & CS_NOMOVECARET) {
|
||||
target_start = 0;
|
||||
target_end = 1;
|
||||
}
|
||||
break;
|
||||
case LANG_CHINESE:
|
||||
{
|
||||
int clause_size = ImmGetCompositionStringW(imm_context, GCS_COMPCLAUSE, NULL, 0);
|
||||
if (clause_size) {
|
||||
static std::vector<unsigned long> clauses;
|
||||
clause_size = clause_size / sizeof(clauses[0]);
|
||||
clauses.resize(clause_size);
|
||||
ImmGetCompositionStringW(imm_context, GCS_COMPCLAUSE, &clauses[0],
|
||||
sizeof(clauses[0]) *clause_size);
|
||||
if (composition->cursor_position == composition->ime_string.size()) {
|
||||
target_start = clauses[clause_size - 2];
|
||||
target_end = clauses[clause_size - 1];
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < clause_size - 1; i++) {
|
||||
if (clauses[i] == composition->cursor_position) {
|
||||
target_start = clauses[i];
|
||||
target_end = clauses[i + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (composition->cursor_position != -1) {
|
||||
target_start = composition->cursor_position;
|
||||
target_end = composition->ime_string.size();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LANG_JAPANESE:
|
||||
|
||||
/**
|
||||
* For Japanese IMEs, the robustest way to retrieve the caret
|
||||
* is scanning the attribute of the latest composition string and
|
||||
* retrieving the begining and the end of the target clause, i.e.
|
||||
* a clause being converted.
|
||||
*/
|
||||
if (lparam & GCS_COMPATTR) {
|
||||
int attribute_size = ::ImmGetCompositionStringW(imm_context,
|
||||
GCS_COMPATTR,
|
||||
NULL, 0);
|
||||
if (attribute_size > 0) {
|
||||
char *attribute_data = new char[attribute_size];
|
||||
if (attribute_data) {
|
||||
::ImmGetCompositionStringW(imm_context, GCS_COMPATTR,
|
||||
attribute_data, attribute_size);
|
||||
for (target_start = 0; target_start < attribute_size;
|
||||
++target_start) {
|
||||
if (IsTargetAttribute(attribute_data[target_start]))
|
||||
break;
|
||||
}
|
||||
for (target_end = target_start; target_end < attribute_size;
|
||||
++target_end) {
|
||||
if (!IsTargetAttribute(attribute_data[target_end]))
|
||||
break;
|
||||
}
|
||||
if (target_start == attribute_size) {
|
||||
/**
|
||||
* This composition clause does not contain any target clauses,
|
||||
* i.e. this clauses is an input clause.
|
||||
* We treat whole this clause as a target clause.
|
||||
*/
|
||||
target_end = target_start;
|
||||
target_start = 0;
|
||||
}
|
||||
if (target_start != -1 && target_start < attribute_size &&
|
||||
attribute_data[target_start] == ATTR_TARGET_NOTCONVERTED)
|
||||
{
|
||||
composition->cursor_position = target_start;
|
||||
}
|
||||
}
|
||||
delete[] attribute_data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
composition->target_start = target_start;
|
||||
composition->target_end = target_end;
|
||||
}
|
||||
|
||||
|
||||
bool GHOST_ImeWin32::GetString(HIMC imm_context, WPARAM lparam, int type, ImeComposition *composition)
|
||||
{
|
||||
bool result = false;
|
||||
if (lparam & type) {
|
||||
int string_size = ::ImmGetCompositionStringW(imm_context, type, NULL, 0);
|
||||
if (string_size > 0) {
|
||||
int string_length = string_size / sizeof(wchar_t);
|
||||
wchar_t *string_data = new wchar_t[string_length + 1];
|
||||
string_data[string_length] = '\0';
|
||||
if (string_data) {
|
||||
/* Fill the given ImeComposition object. */
|
||||
::ImmGetCompositionStringW(imm_context, type,
|
||||
string_data, string_size);
|
||||
composition->string_type = type;
|
||||
composition->ime_string = string_data;
|
||||
result = true;
|
||||
}
|
||||
delete[] string_data;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool GHOST_ImeWin32::GetResult(HWND window_handle, LPARAM lparam, ImeComposition *composition)
|
||||
{
|
||||
bool result = false;
|
||||
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||
if (imm_context) {
|
||||
/* Copy the result string to the ImeComposition object. */
|
||||
result = GetString(imm_context, lparam, GCS_RESULTSTR, composition);
|
||||
/**
|
||||
* Reset all the other parameters because a result string does not
|
||||
* have composition attributes.
|
||||
*/
|
||||
composition->cursor_position = -1;
|
||||
composition->target_start = -1;
|
||||
composition->target_end = -1;
|
||||
::ImmReleaseContext(window_handle, imm_context);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool GHOST_ImeWin32::GetComposition(HWND window_handle, LPARAM lparam, ImeComposition *composition)
|
||||
{
|
||||
bool result = false;
|
||||
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||
if (imm_context) {
|
||||
/* Copy the composition string to the ImeComposition object. */
|
||||
result = GetString(imm_context, lparam, GCS_COMPSTR, composition);
|
||||
|
||||
/* Retrieve the cursor position in the IME composition. */
|
||||
int cursor_position = ::ImmGetCompositionStringW(imm_context, GCS_CURSORPOS, NULL, 0);
|
||||
composition->cursor_position = cursor_position;
|
||||
composition->target_start = -1;
|
||||
composition->target_end = -1;
|
||||
|
||||
/* Retrieve the target selection and Update the ImeComposition object. */
|
||||
GetCaret(imm_context, lparam, composition);
|
||||
|
||||
/* Mark that there is an ongoing composition. */
|
||||
is_composing_ = true;
|
||||
|
||||
::ImmReleaseContext(window_handle, imm_context);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::EndIME(HWND window_handle)
|
||||
{
|
||||
/**
|
||||
* A renderer process have moved its input focus to a password input
|
||||
* when there is an ongoing composition, e.g. a user has clicked a
|
||||
* mouse button and selected a password input while composing a text.
|
||||
* For this case, we have to complete the ongoing composition and
|
||||
* clean up the resources attached to this object BEFORE DISABLING THE IME.
|
||||
*/
|
||||
if (!is_enable) return;
|
||||
is_enable = false;
|
||||
CleanupComposition(window_handle);
|
||||
::ImmAssociateContextEx(window_handle, NULL, 0);
|
||||
eventImeData.composite_len = 0;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::BeginIME(HWND window_handle, const GHOST_Rect &caret_rect, bool complete)
|
||||
{
|
||||
if (is_enable && complete) return;
|
||||
is_enable = true;
|
||||
/**
|
||||
* Load the default IME context.
|
||||
* NOTE(hbono)
|
||||
* IMM ignores this call if the IME context is loaded. Therefore, we do
|
||||
* not have to check whether or not the IME context is loaded.
|
||||
*/
|
||||
::ImmAssociateContextEx(window_handle, NULL, IACE_DEFAULT);
|
||||
/* Complete the ongoing composition and move the IME windows. */
|
||||
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||
if (imm_context) {
|
||||
if (complete) {
|
||||
/**
|
||||
* A renderer process have moved its input focus to another edit
|
||||
* control when there is an ongoing composition, e.g. a user has
|
||||
* clicked a mouse button and selected another edit control while
|
||||
* composing a text.
|
||||
* For this case, we have to complete the ongoing composition and
|
||||
* hide the IME windows BEFORE MOVING THEM.
|
||||
*/
|
||||
CompleteComposition(window_handle, imm_context);
|
||||
}
|
||||
/**
|
||||
* Save the caret position, and Update the position of the IME window.
|
||||
* This update is used for moving an IME window when a renderer process
|
||||
* resize/moves the input caret.
|
||||
*/
|
||||
if (caret_rect.m_l >= 0 && caret_rect.m_t >= 0) {
|
||||
caret_rect_ = caret_rect;
|
||||
MoveImeWindow(window_handle, imm_context);
|
||||
}
|
||||
::ImmReleaseContext(window_handle, imm_context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void convert_utf16_to_utf8_len(std::wstring s, int &len)
|
||||
{
|
||||
if (len >= 0 && len <= s.size())
|
||||
len = count_utf_8_from_16(s.substr(0, len).c_str()) - 1;
|
||||
else
|
||||
len = -1;
|
||||
}
|
||||
|
||||
|
||||
static size_t updateUtf8Buf(ImeComposition &info)
|
||||
{
|
||||
size_t len = count_utf_8_from_16(info.ime_string.c_str());
|
||||
info.utf8_buf.resize(len);
|
||||
conv_utf_16_to_8(info.ime_string.c_str(), &info.utf8_buf[0], len);
|
||||
convert_utf16_to_utf8_len(info.ime_string, info.cursor_position);
|
||||
convert_utf16_to_utf8_len(info.ime_string, info.target_start);
|
||||
convert_utf16_to_utf8_len(info.ime_string, info.target_end);
|
||||
return len - 1;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_ImeWin32::UpdateInfo(HWND window_handle)
|
||||
{
|
||||
int res = this->GetResult(window_handle, GCS_RESULTSTR, &resultInfo);
|
||||
int comp = this->GetComposition(window_handle, GCS_COMPSTR | GCS_COMPATTR, &compInfo);
|
||||
/* convert wchar to utf8 */
|
||||
if (res) {
|
||||
eventImeData.result_len = (GHOST_TUserDataPtr)updateUtf8Buf(resultInfo);
|
||||
eventImeData.result = &resultInfo.utf8_buf[0];
|
||||
}
|
||||
else {
|
||||
eventImeData.result = 0;
|
||||
eventImeData.result_len = 0;
|
||||
}
|
||||
if (comp) {
|
||||
eventImeData.composite_len = (GHOST_TUserDataPtr)updateUtf8Buf(compInfo);
|
||||
eventImeData.composite = &compInfo.utf8_buf[0];
|
||||
eventImeData.cursor_position = compInfo.cursor_position;
|
||||
eventImeData.target_start = compInfo.target_start;
|
||||
eventImeData.target_end = compInfo.target_end;
|
||||
}
|
||||
else {
|
||||
eventImeData.composite = 0;
|
||||
eventImeData.composite_len = 0;
|
||||
eventImeData.cursor_position = -1;
|
||||
eventImeData.target_start = -1;
|
||||
eventImeData.target_end = -1;
|
||||
}
|
||||
}
|
401
intern/ghost/intern/GHOST_ImeWin32.h
Normal file
401
intern/ghost/intern/GHOST_ImeWin32.h
Normal file
@@ -0,0 +1,401 @@
|
||||
/*
|
||||
* ***** 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) 2010 The Chromium Authors. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: some of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_ImeWin32.h
|
||||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#ifndef __GHOST_IME_H__
|
||||
#define __GHOST_IME_H__
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "GHOST_Event.h"
|
||||
#include "GHOST_Rect.h"
|
||||
#include <vector>
|
||||
|
||||
class GHOST_EventIME : public GHOST_Event
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* \param msec The time this event was generated.
|
||||
* \param type The type of key event.
|
||||
* \param key The key code of the key.
|
||||
*/
|
||||
GHOST_EventIME(GHOST_TUns64 msec,
|
||||
GHOST_TEventType type,
|
||||
GHOST_IWindow *window, void *customdata)
|
||||
: GHOST_Event(msec, type, window)
|
||||
{
|
||||
this->m_data = customdata;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This header file defines a struct and a class used for encapsulating IMM32
|
||||
* APIs, controls IMEs attached to a window, and enables the 'on-the-spot'
|
||||
* input without deep knowledge about the APIs, i.e. knowledge about the
|
||||
* language-specific and IME-specific behaviors.
|
||||
* The following items enumerates the simplest steps for an (window)
|
||||
* application to control its IMEs with the struct and the class defined
|
||||
* this file.
|
||||
* 1. Add an instance of the GHOST_ImeWin32 class to its window class.
|
||||
* (The GHOST_ImeWin32 class needs a window handle.)
|
||||
* 2. Add messages handlers listed in the following subsections, follow the
|
||||
* instructions written in each subsection, and use the GHOST_ImeWin32 class.
|
||||
* 2.1. WM_IME_SETCONTEXT (0x0281)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::CreateImeWindow();
|
||||
* - GHOST_ImeWin32::CleanupComposition(), and;
|
||||
* - GHOST_ImeWin32::SetImeWindowStyle().
|
||||
* An application MUST prevent from calling ::DefWindowProc().
|
||||
* 2.2. WM_IME_STARTCOMPOSITION (0x010D)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::CreateImeWindow(), and;
|
||||
* - GHOST_ImeWin32::ResetComposition().
|
||||
* An application MUST prevent from calling ::DefWindowProc().
|
||||
* 2.3. WM_IME_COMPOSITION (0x010F)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::UpdateImeWindow();
|
||||
* - GHOST_ImeWin32::GetResult();
|
||||
* - GHOST_ImeWin32::GetComposition(), and;
|
||||
* - GHOST_ImeWin32::ResetComposition() (optional).
|
||||
* An application MUST prevent from calling ::DefWindowProc().
|
||||
* 2.4. WM_IME_ENDCOMPOSITION (0x010E)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::ResetComposition(), and;
|
||||
* - GHOST_ImeWin32::DestroyImeWindow().
|
||||
* An application CAN call ::DefWindowProc().
|
||||
* 2.5. WM_INPUTLANGCHANGE (0x0051)
|
||||
* Call the functions listed below:
|
||||
* - GHOST_ImeWin32::SetInputLanguage().
|
||||
* An application CAN call ::DefWindowProc().
|
||||
*/
|
||||
|
||||
/* This struct represents the status of an ongoing composition. */
|
||||
struct ImeComposition {
|
||||
/* Represents the cursor position in the IME composition. */
|
||||
int cursor_position;
|
||||
|
||||
/* Represents the position of the beginning of the selection */
|
||||
int target_start;
|
||||
|
||||
/* Represents the position of the end of the selection */
|
||||
int target_end;
|
||||
|
||||
/**
|
||||
* Represents the type of the string in the 'ime_string' parameter.
|
||||
* Its possible values and description are listed below:
|
||||
* Value Description
|
||||
* 0 The parameter is not used.
|
||||
* GCS_RESULTSTR The parameter represents a result string.
|
||||
* GCS_COMPSTR The parameter represents a composition string.
|
||||
*/
|
||||
int string_type;
|
||||
|
||||
/* Represents the string retrieved from IME (Input Method Editor) */
|
||||
std::wstring ime_string;
|
||||
std::vector<char> utf8_buf;
|
||||
std::vector<unsigned char> format;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class controls the IMM (Input Method Manager) through IMM32 APIs and
|
||||
* enables it to retrieve the string being controled by the IMM. (I wrote
|
||||
* a note to describe the reason why I do not use 'IME' but 'IMM' below.)
|
||||
* NOTE(hbono):
|
||||
* Fortunately or unfortunately, TSF (Text Service Framework) and
|
||||
* CUAS (Cicero Unaware Application Support) allows IMM32 APIs for
|
||||
* retrieving not only the inputs from IMEs (Input Method Editors), used
|
||||
* only for inputting East-Asian language texts, but also the ones from
|
||||
* tablets (on Windows XP Tablet PC Edition and Windows Vista), voice
|
||||
* recognizers (e.g. ViaVoice and Microsoft Office), etc.
|
||||
* We can disable TSF and CUAS in Windows XP Tablet PC Edition. On the other
|
||||
* hand, we can NEVER disable either TSF or CUAS in Windows Vista, i.e.
|
||||
* THIS CLASS IS NOT ONLY USED ON THE INPUT CONTEXTS OF EAST-ASIAN
|
||||
* LANGUAGES BUT ALSO USED ON THE INPUT CONTEXTS OF ALL LANGUAGES.
|
||||
*/
|
||||
class GHOST_ImeWin32 {
|
||||
public:
|
||||
GHOST_ImeWin32();
|
||||
~GHOST_ImeWin32();
|
||||
|
||||
/* Retrieves whether or not there is an ongoing composition. */
|
||||
bool is_composing() const {return is_composing_;}
|
||||
|
||||
/**
|
||||
* Retrieves the input language from Windows and update it.
|
||||
* Return values
|
||||
* * true
|
||||
* The given input language has IMEs.
|
||||
* * false
|
||||
* The given input language does not have IMEs.
|
||||
*/
|
||||
bool SetInputLanguage();
|
||||
|
||||
/**
|
||||
* Create the IME windows, and allocate required resources for them.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void CreateImeWindow(HWND window_handle);
|
||||
|
||||
/**
|
||||
* Update the style of the IME windows.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
* * message [in] (UINT)
|
||||
* * wparam [in] (WPARAM)
|
||||
* * lparam [in] (LPARAM)
|
||||
* Represent the windows message of the caller.
|
||||
* These parameters are used for verifying if this function is called
|
||||
* in a handler function for WM_IME_SETCONTEXT messages because this
|
||||
* function uses ::DefWindowProc() to update the style.
|
||||
* A caller just has to pass the input parameters for the handler
|
||||
* function without modifications.
|
||||
* * handled [out] (BOOL*)
|
||||
* Returns ::DefWindowProc() is really called in this function.
|
||||
* PLEASE DO NOT CALL ::DefWindowProc() IF THIS VALUE IS TRUE!
|
||||
* All the window styles set in this function are over-written when
|
||||
* calling ::DefWindowProc() after returning this function.
|
||||
*/
|
||||
void SetImeWindowStyle(HWND window_handle, UINT message,
|
||||
WPARAM wparam, LPARAM lparam, BOOL* handled);
|
||||
|
||||
/**
|
||||
* Destroy the IME windows and all the resources attached to them.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void DestroyImeWindow(HWND window_handle);
|
||||
|
||||
/**
|
||||
* Update the position of the IME windows.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void UpdateImeWindow(HWND window_handle);
|
||||
|
||||
/**
|
||||
* Clean up the all resources attached to the given GHOST_ImeWin32 object, and
|
||||
* reset its composition status.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void CleanupComposition(HWND window_handle);
|
||||
|
||||
/**
|
||||
* Reset the composition status.
|
||||
* Cancel the ongoing composition if it exists.
|
||||
* NOTE(hbono): This method does not release the allocated resources.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void ResetComposition(HWND window_handle);
|
||||
|
||||
/**
|
||||
* Retrieve a composition result of the ongoing composition if it exists.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
* * lparam [in] (LPARAM)
|
||||
* Specifies the updated members of the ongoing composition, and must be
|
||||
* the same parameter of a WM_IME_COMPOSITION message handler.
|
||||
* This parameter is used for checking if the ongoing composition has
|
||||
* its result string,
|
||||
* * composition [out] (ImeComposition)
|
||||
* Represents the struct contains the composition result.
|
||||
* Return values
|
||||
* * true
|
||||
* The ongoing composition has a composition result.
|
||||
* * false
|
||||
* The ongoing composition does not have composition results.
|
||||
* Remarks
|
||||
* This function is designed for being called from WM_IME_COMPOSITION
|
||||
* message handlers.
|
||||
*/
|
||||
bool GetResult(HWND window_handle, LPARAM lparam,
|
||||
ImeComposition* composition);
|
||||
|
||||
/**
|
||||
* Retrieve the current composition status of the ongoing composition.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
* * lparam [in] (LPARAM)
|
||||
* Specifies the updated members of the ongoing composition, and must be
|
||||
* the same parameter of a WM_IME_COMPOSITION message handler.
|
||||
* This parameter is used for checking if the ongoing composition has
|
||||
* its result string,
|
||||
* * composition [out] (ImeComposition)
|
||||
* Represents the struct contains the composition status.
|
||||
* Return values
|
||||
* * true
|
||||
* The status of the ongoing composition is updated.
|
||||
* * false
|
||||
* The status of the ongoing composition is not updated.
|
||||
* Remarks
|
||||
* This function is designed for being called from WM_IME_COMPOSITION
|
||||
* message handlers.
|
||||
*/
|
||||
bool GetComposition(HWND window_handle, LPARAM lparam,
|
||||
ImeComposition* composition);
|
||||
|
||||
/**
|
||||
* Enable the IME attached to the given window, i.e. allows user-input
|
||||
* events to be dispatched to the IME.
|
||||
* In Chrome, this function is used when:
|
||||
* * a renderer process moves its input focus to another edit control, or;
|
||||
* * a renrerer process moves the position of the focused edit control.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
* * caret_rect [in] (const gfx::Rect&)
|
||||
* Represent the rectangle of the input caret.
|
||||
* This rectangle is used for controlling the positions of IME windows.
|
||||
* * complete [in] (bool)
|
||||
* Represents whether or not to complete the ongoing composition.
|
||||
* + true
|
||||
* After finishing the ongoing composition and close its IME windows,
|
||||
* start another composition and display its IME windows to the given
|
||||
* position.
|
||||
* + false
|
||||
* Just move the IME windows of the ongoing composition to the given
|
||||
* position without finishing it.
|
||||
*/
|
||||
void BeginIME(HWND window_handle,
|
||||
const GHOST_Rect& caret_rect,
|
||||
bool complete);
|
||||
|
||||
/**
|
||||
* Disable the IME attached to the given window, i.e. prohibits any user-input
|
||||
* events from being dispatched to the IME.
|
||||
* In Chrome, this function is used when:
|
||||
* * a renreder process sets its input focus to a password input.
|
||||
* Parameters
|
||||
* * window_handle [in] (HWND)
|
||||
* Represents the window handle of the caller.
|
||||
*/
|
||||
void EndIME(HWND window_handle);
|
||||
|
||||
/* Updatg resultInfo and compInfo */
|
||||
void UpdateInfo(HWND window_handle);
|
||||
|
||||
/* disable ime when start up */
|
||||
void CheckFirst(HWND window_handle);
|
||||
|
||||
ImeComposition resultInfo, compInfo;
|
||||
GHOST_TEventImeData eventImeData;
|
||||
|
||||
protected:
|
||||
/* Determines whether or not the given attribute represents a target (a.k.a. a selection). */
|
||||
bool IsTargetAttribute(char attribute) const {
|
||||
return (attribute == ATTR_TARGET_CONVERTED ||
|
||||
attribute == ATTR_TARGET_NOTCONVERTED);
|
||||
}
|
||||
|
||||
/* Retrieve the target area. */
|
||||
void GetCaret(HIMC imm_context, LPARAM lparam,
|
||||
ImeComposition* composition);
|
||||
|
||||
/* Update the position of the IME windows. */
|
||||
void MoveImeWindow(HWND window_handle, HIMC imm_context);
|
||||
|
||||
/* Complete the ongoing composition if it exists. */
|
||||
void CompleteComposition(HWND window_handle, HIMC imm_context);
|
||||
|
||||
/* Retrieve a string from the IMM. */
|
||||
bool GetString(HIMC imm_context, WPARAM lparam, int type,
|
||||
ImeComposition* composition);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Represents whether or not there is an ongoing composition in a browser
|
||||
* process, i.e. whether or not a browser process is composing a text.
|
||||
*/
|
||||
bool is_composing_;
|
||||
|
||||
/**
|
||||
* This value represents whether or not the current input context has IMEs.
|
||||
* The following table shows the list of IME status:
|
||||
* Value Description
|
||||
* false The current input language does not have IMEs.
|
||||
* true The current input language has IMEs.
|
||||
*/
|
||||
bool ime_status_;
|
||||
|
||||
/**
|
||||
* The current input Language ID retrieved from Windows, which consists of:
|
||||
* * Primary Language ID (bit 0 to bit 9), which shows a natunal language
|
||||
* (English, Korean, Chinese, Japanese, etc.) and;
|
||||
* * Sub-Language ID (bit 10 to bit 15), which shows a geometrical region
|
||||
* the language is spoken (For English, United States, United Kingdom,
|
||||
* Australia, Canada, etc.)
|
||||
* The following list enumerates some examples for the Language ID:
|
||||
* * "en-US" (0x0409)
|
||||
* MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
|
||||
* * "ko-KR" (0x0412)
|
||||
* MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN);
|
||||
* * "zh-TW" (0x0404)
|
||||
* MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL);
|
||||
* * "zh-CN" (0x0804)
|
||||
* MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED);
|
||||
* * "ja-JP" (0x0411)
|
||||
* MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), etc.
|
||||
* (See <winnt.h> for other available values.)
|
||||
* This Language ID is used for processing language-specific operations in
|
||||
* IME functions.
|
||||
*/
|
||||
LANGID input_language_id_;
|
||||
|
||||
/**
|
||||
* Represents whether or not the current input context has created a system
|
||||
* caret to set the position of its IME candidate window.
|
||||
* * true: it creates a system caret.
|
||||
* * false: it does not create a system caret.
|
||||
*/
|
||||
bool system_caret_;
|
||||
|
||||
/* The rectangle of the input caret retrieved from a renderer process. */
|
||||
GHOST_Rect caret_rect_;
|
||||
|
||||
/* used for disable ime when start up */
|
||||
bool is_first, is_enable;
|
||||
};
|
||||
|
||||
#endif * __GHOST_IME_H__
|
@@ -146,8 +146,8 @@ static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
|
||||
NDOF_BUTTON_ROTATE
|
||||
};
|
||||
|
||||
/* this is the older SpacePilot (sans Pro)
|
||||
* thanks to polosson for info about this device */
|
||||
// this is the older SpacePilot (sans Pro)
|
||||
// thanks to polosson for info about this device
|
||||
static const NDOF_ButtonT SpacePilot_HID_map[] = {
|
||||
NDOF_BUTTON_1,
|
||||
NDOF_BUTTON_2,
|
||||
@@ -190,17 +190,17 @@ static const NDOF_ButtonT Generic_HID_map[] = {
|
||||
static const int genericButtonCount = sizeof(Generic_HID_map) / sizeof(NDOF_ButtonT);
|
||||
|
||||
GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System &sys)
|
||||
: m_system(sys),
|
||||
m_deviceType(NDOF_UnknownDevice), /* each platform has its own device detection code */
|
||||
m_buttonCount(genericButtonCount),
|
||||
m_buttonMask(0),
|
||||
m_hidMap(Generic_HID_map),
|
||||
m_buttons(0),
|
||||
m_motionTime(0),
|
||||
m_prevMotionTime(0),
|
||||
m_motionState(GHOST_kNotStarted),
|
||||
m_motionEventPending(false),
|
||||
m_deadZone(0.0f)
|
||||
: m_system(sys),
|
||||
m_deviceType(NDOF_UnknownDevice), // each platform has its own device detection code
|
||||
m_buttonCount(genericButtonCount),
|
||||
m_buttonMask(0),
|
||||
m_hidMap(Generic_HID_map),
|
||||
m_buttons(0),
|
||||
m_motionTime(0),
|
||||
m_prevMotionTime(0),
|
||||
m_motionState(GHOST_kNotStarted),
|
||||
m_motionEventPending(false),
|
||||
m_deadZone(0.0f)
|
||||
{
|
||||
// to avoid the rare situation where one triple is updated and
|
||||
// the other is not, initialize them both here:
|
||||
@@ -228,7 +228,7 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
|
||||
// that I don't have access to. Thanks!
|
||||
|
||||
switch (vendor_id) {
|
||||
case 0x046D: // Logitech (3Dconnexion)
|
||||
case 0x046D: // Logitech (3Dconnexion was a subsidiary)
|
||||
switch (product_id) {
|
||||
// -- current devices --
|
||||
case 0xC626: // full-size SpaceNavigator
|
||||
@@ -281,6 +281,29 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
|
||||
printf("ndof: unknown Logitech product %04hx\n", product_id);
|
||||
}
|
||||
break;
|
||||
case 0x256F: // 3Dconnexion
|
||||
switch (product_id) {
|
||||
case 0xC62E: // plugged in
|
||||
case 0xC62F: // wireless
|
||||
puts("ndof: using SpaceMouse Wireless");
|
||||
m_deviceType = NDOF_SpaceMouseWireless;
|
||||
m_buttonCount = 2;
|
||||
m_hidMap = Modern3Dx_HID_map;
|
||||
break;
|
||||
case 0xC631: // plugged in
|
||||
case 0xC632: // wireless
|
||||
puts("ndof: using SpaceMouse Pro Wireless");
|
||||
m_deviceType = NDOF_SpaceMouseProWireless;
|
||||
m_buttonCount = 27;
|
||||
// ^^ actually has 15 buttons, but their HID codes range from 0 to 26
|
||||
m_buttonMask = 0x07C0F137;
|
||||
m_hidMap = Modern3Dx_HID_map;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("ndof: unknown 3Dconnexion product %04hx\n", product_id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
|
||||
}
|
||||
@@ -390,9 +413,9 @@ void GHOST_NDOFManager::updateButtons(int button_bits, GHOST_TUns64 time)
|
||||
|
||||
void GHOST_NDOFManager::setDeadZone(float dz)
|
||||
{
|
||||
if (dz < 0.f) {
|
||||
if (dz < 0.0f) {
|
||||
// negative values don't make sense, so clamp at zero
|
||||
dz = 0.f;
|
||||
dz = 0.0f;
|
||||
}
|
||||
else if (dz > 0.5f) {
|
||||
// warn the rogue user/developer, but allow it
|
||||
@@ -405,14 +428,14 @@ void GHOST_NDOFManager::setDeadZone(float dz)
|
||||
|
||||
static bool atHomePosition(GHOST_TEventNDOFMotionData *ndof)
|
||||
{
|
||||
#define HOME(foo) (ndof->foo == 0.f)
|
||||
#define HOME(foo) (ndof->foo == 0.0f)
|
||||
return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
|
||||
#undef HOME
|
||||
}
|
||||
|
||||
static bool nearHomePosition(GHOST_TEventNDOFMotionData *ndof, float threshold)
|
||||
{
|
||||
if (threshold == 0.f) {
|
||||
if (threshold == 0.0f) {
|
||||
return atHomePosition(ndof);
|
||||
}
|
||||
else {
|
||||
@@ -442,7 +465,7 @@ bool GHOST_NDOFManager::sendMotionEvent()
|
||||
// scale axis values here to normalize them to around +/- 1
|
||||
// they are scaled again for overall sensitivity in the WM based on user prefs
|
||||
|
||||
const float scale = 1.f / 350.f; // 3Dconnexion devices send +/- 350 usually
|
||||
const float scale = 1.0f / 350.0f; // 3Dconnexion devices send +/- 350 usually
|
||||
|
||||
data->tx = scale * m_translation[0];
|
||||
data->ty = scale * m_translation[1];
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GHOST_NDOFMANAGER_H__
|
||||
#define __GHOST_NDOFMANAGER_H__
|
||||
|
||||
@@ -38,6 +38,8 @@ typedef enum {
|
||||
NDOF_SpaceExplorer,
|
||||
NDOF_SpacePilotPro,
|
||||
NDOF_SpaceMousePro,
|
||||
NDOF_SpaceMouseWireless,
|
||||
NDOF_SpaceMouseProWireless,
|
||||
|
||||
// older devices
|
||||
NDOF_SpacePilot,
|
||||
|
@@ -508,6 +508,7 @@ GHOST_TKey GHOST_SystemWin32::hardKey(GHOST_IWindow *window, RAWINPUT const &raw
|
||||
|
||||
//! note: this function can be extended to include other exotic cases as they arise.
|
||||
// This function was added in response to bug [#25715]
|
||||
// This is going to be a long list [T42426]
|
||||
GHOST_TKey GHOST_SystemWin32::processSpecialKey(GHOST_IWindow *window, short vKey, short scanCode) const
|
||||
{
|
||||
GHOST_TKey key = GHOST_kKeyUnknown;
|
||||
@@ -515,6 +516,10 @@ GHOST_TKey GHOST_SystemWin32::processSpecialKey(GHOST_IWindow *window, short vKe
|
||||
case LANG_FRENCH:
|
||||
if (vKey == VK_OEM_8) key = GHOST_kKeyF13; // oem key; used purely for shortcuts .
|
||||
break;
|
||||
case LANG_ENGLISH:
|
||||
if (SUBLANGID(m_langId) == SUBLANG_ENGLISH_UK && vKey == VK_OEM_8) // "`¬"
|
||||
key = GHOST_kKeyAccentGrave;
|
||||
break;
|
||||
}
|
||||
|
||||
return key;
|
||||
@@ -787,6 +792,15 @@ GHOST_Event *GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, GHOST_
|
||||
return new GHOST_Event(system->getMilliSeconds(), type, window);
|
||||
}
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
GHOST_Event *GHOST_SystemWin32::processImeEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TEventImeData *data)
|
||||
{
|
||||
GHOST_System *system = (GHOST_System *)getSystem();
|
||||
return new GHOST_EventIME(system->getMilliSeconds(), type, window, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWin32::pushDragDropEvent(
|
||||
GHOST_TEventType eventType,
|
||||
GHOST_TDragnDropTypes draggedObjectType,
|
||||
@@ -899,6 +913,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
|
||||
LRESULT lResult = 0;
|
||||
GHOST_SystemWin32 *system = ((GHOST_SystemWin32 *)getSystem());
|
||||
GHOST_EventManager *eventManager = system->getEventManager();
|
||||
GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized");
|
||||
|
||||
if (hwnd) {
|
||||
@@ -907,8 +922,13 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
switch (msg) {
|
||||
// we need to check if new key layout has AltGr
|
||||
case WM_INPUTLANGCHANGE:
|
||||
{
|
||||
system->handleKeyboardChange();
|
||||
#ifdef WITH_INPUT_IME
|
||||
window->getImeInput()->SetInputLanguage();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Keyboard events, processed
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -944,6 +964,56 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef WITH_INPUT_IME
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// IME events, processed, read more in GHOST_IME.h
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
case WM_IME_SETCONTEXT:
|
||||
{
|
||||
window->getImeInput()->SetInputLanguage();
|
||||
window->getImeInput()->CreateImeWindow(window->getHWND());
|
||||
window->getImeInput()->CleanupComposition(window->getHWND());
|
||||
window->getImeInput()->CheckFirst(window->getHWND());
|
||||
break;
|
||||
}
|
||||
case WM_IME_STARTCOMPOSITION:
|
||||
{
|
||||
eventHandled = true;
|
||||
/* remove input event before start comp event, avoid redundant input */
|
||||
eventManager->removeTypeEvents(GHOST_kEventKeyDown, window);
|
||||
window->getImeInput()->CreateImeWindow(window->getHWND());
|
||||
window->getImeInput()->ResetComposition(window->getHWND());
|
||||
event = processImeEvent(
|
||||
GHOST_kEventImeCompositionStart,
|
||||
window,
|
||||
&window->getImeInput()->eventImeData);
|
||||
break;
|
||||
}
|
||||
case WM_IME_COMPOSITION:
|
||||
{
|
||||
eventHandled = true;
|
||||
window->getImeInput()->UpdateImeWindow(window->getHWND());
|
||||
window->getImeInput()->UpdateInfo(window->getHWND());
|
||||
event = processImeEvent(
|
||||
GHOST_kEventImeComposition,
|
||||
window,
|
||||
&window->getImeInput()->eventImeData);
|
||||
break;
|
||||
}
|
||||
case WM_IME_ENDCOMPOSITION:
|
||||
{
|
||||
eventHandled = true;
|
||||
/* remove input event after end comp event, avoid redundant input */
|
||||
eventManager->removeTypeEvents(GHOST_kEventKeyDown, window);
|
||||
window->getImeInput()->ResetComposition(window->getHWND());
|
||||
window->getImeInput()->DestroyImeWindow(window->getHWND());
|
||||
event = processImeEvent(
|
||||
GHOST_kEventImeCompositionEnd,
|
||||
window,
|
||||
&window->getImeInput()->eventImeData);
|
||||
break;
|
||||
}
|
||||
#endif /* WITH_INPUT_IME */
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Keyboard events, ignored
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -306,6 +306,15 @@ protected:
|
||||
*/
|
||||
static GHOST_Event *processWindowEvent(GHOST_TEventType type, GHOST_IWindow *window);
|
||||
|
||||
/**
|
||||
* Creates a IME event.
|
||||
* \param type The type of event to create.
|
||||
* \param window The window receiving the event (the active window).
|
||||
* \param data IME data.
|
||||
* \return The event created.
|
||||
*/
|
||||
static GHOST_Event *processImeEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TEventImeData *data);
|
||||
|
||||
/**
|
||||
* Handles minimum window size.
|
||||
* \param minmax The MINMAXINFO structure.
|
||||
|
@@ -295,6 +295,22 @@ public:
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
virtual void beginIME(GHOST_TInt32 x,
|
||||
GHOST_TInt32 y,
|
||||
GHOST_TInt32 w,
|
||||
GHOST_TInt32 h,
|
||||
int completed)
|
||||
{
|
||||
/* do nothing temporarily if not in windows */
|
||||
}
|
||||
|
||||
virtual void endIME()
|
||||
{
|
||||
/* do nothing temporarily if not in windows */
|
||||
}
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Tries to install a rendering context in this window.
|
||||
|
@@ -645,6 +645,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||
m_lionStyleFullScreen = true;
|
||||
}
|
||||
|
||||
[NSApp activateIgnoringOtherApps:YES]; // raise application to front, important for new blender instance animation play case
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
|
@@ -1050,3 +1050,16 @@ GHOST_TSuccess GHOST_WindowWin32::endProgressBar()
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
void GHOST_WindowWin32::beginIME(GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int completed)
|
||||
{
|
||||
this->getImeInput()->BeginIME(this->getHWND(), GHOST_Rect(x, y - h , x, y), (bool)completed);
|
||||
}
|
||||
|
||||
|
||||
void GHOST_WindowWin32::endIME()
|
||||
{
|
||||
this->getImeInput()->EndIME(this->getHWND());
|
||||
}
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
@@ -39,6 +39,9 @@
|
||||
|
||||
#include "GHOST_Window.h"
|
||||
#include "GHOST_TaskbarWin32.h"
|
||||
#ifdef WITH_INPUT_IME
|
||||
# include "GHOST_ImeWin32.h"
|
||||
#endif
|
||||
|
||||
#include <wintab.h>
|
||||
#define PACKETDATA (PK_BUTTONS | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR)
|
||||
@@ -253,6 +256,17 @@ public:
|
||||
/** if the window currently resizing */
|
||||
bool m_inLiveResize;
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
GHOST_ImeWin32 *getImeInput() {return &m_imeImput;}
|
||||
|
||||
virtual void beginIME(
|
||||
GHOST_TInt32 x, GHOST_TInt32 y,
|
||||
GHOST_TInt32 w, GHOST_TInt32 h,
|
||||
int completed);
|
||||
|
||||
virtual void endIME();
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -339,6 +353,11 @@ private:
|
||||
|
||||
/** Hwnd to parent window */
|
||||
GHOST_TEmbedderWindowID m_parentWindowHwnd;
|
||||
|
||||
#ifdef WITH_INPUT_IME
|
||||
/** Handle input method editors event */
|
||||
GHOST_ImeWin32 m_imeImput;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // __GHOST_WINDOWWIN32_H__
|
||||
|
@@ -483,7 +483,7 @@ void
|
||||
else lword = sizeof(double);
|
||||
|
||||
if ( Glu->MemModel == SYSTEM ) {
|
||||
new_mem = (void *) SUPERLU_MALLOC(new_len * lword);
|
||||
new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * (size_t)lword);
|
||||
/* new_mem = (void *) calloc(new_len, lword); */
|
||||
if ( no_expand != 0 ) {
|
||||
tries = 0;
|
||||
@@ -494,7 +494,7 @@ void
|
||||
if ( ++tries > 10 ) return (NULL);
|
||||
alpha = Reduce(alpha);
|
||||
new_len = alpha * *prev_len;
|
||||
new_mem = (void *) SUPERLU_MALLOC(new_len * lword);
|
||||
new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * (size_t)lword);
|
||||
/* new_mem = (void *) calloc(new_len, lword); */
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ void
|
||||
|
||||
} else { /* MemModel == USER */
|
||||
if ( no_expand == 0 ) {
|
||||
new_mem = suser_malloc(new_len * lword, HEAD);
|
||||
new_mem = suser_malloc((size_t)new_len * (size_t)lword, HEAD);
|
||||
if ( NotDoubleAlign(new_mem) &&
|
||||
(type == LUSUP || type == UCOL) ) {
|
||||
old_mem = new_mem;
|
||||
|
Binary file not shown.
@@ -916,10 +916,7 @@ def process(layer_name, lineset_name):
|
||||
|
||||
# execute line set pre-processing callback functions
|
||||
for fn in callbacks_lineset_pre:
|
||||
try:
|
||||
fn(scene, layer, lineset)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
fn(scene, layer, lineset)
|
||||
|
||||
selection_criteria = []
|
||||
# prepare selection criteria by visibility
|
||||
|
@@ -38,10 +38,10 @@ __all__ = (
|
||||
from _bpy import types, props, app, data, context
|
||||
|
||||
# python modules
|
||||
from . import utils, path, ops
|
||||
from . import utils, path
|
||||
|
||||
# fake operator module
|
||||
ops = ops.ops_fake_module
|
||||
from .ops import ops_fake_module as ops
|
||||
|
||||
|
||||
def main():
|
||||
|
@@ -36,6 +36,7 @@ class BPyOps:
|
||||
|
||||
bpy.ops
|
||||
"""
|
||||
__slots__ = ()
|
||||
|
||||
def __getattr__(self, module):
|
||||
"""
|
||||
|
@@ -32,7 +32,10 @@ KM_HIERARCHY = [
|
||||
('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
|
||||
('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
|
||||
('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region)
|
||||
('Grease Pencil', 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region)
|
||||
|
||||
('Grease Pencil', 'EMPTY', 'WINDOW', [ # grease pencil stuff (per region)
|
||||
('Grease Pencil Stroke Edit Mode', 'EMPTY', 'WINDOW', []),
|
||||
]),
|
||||
|
||||
('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
|
||||
('Object Mode', 'EMPTY', 'WINDOW', []),
|
||||
|
@@ -99,7 +99,7 @@ def add_object_align_init(context, operator):
|
||||
return location * rotation
|
||||
|
||||
|
||||
def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
def object_data_add(context, obdata, operator=None, use_active_layer=True, name=None):
|
||||
"""
|
||||
Add an object using the view context and preference to to initialize the
|
||||
location, rotation and layer.
|
||||
@@ -110,6 +110,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
:type obdata: valid object data type or None.
|
||||
:arg operator: The operator, checked for location and rotation properties.
|
||||
:type operator: :class:`bpy.types.Operator`
|
||||
:arg name: Optional name
|
||||
:type name: string
|
||||
:return: the newly created object in the scene.
|
||||
:rtype: :class:`bpy.types.ObjectBase`
|
||||
"""
|
||||
@@ -119,7 +121,10 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
for ob in scene.objects:
|
||||
ob.select = False
|
||||
|
||||
obj_new = bpy.data.objects.new(obdata.name, obdata)
|
||||
if name is None:
|
||||
name = "Object" if obdata is None else obdata.name
|
||||
|
||||
obj_new = bpy.data.objects.new(name, obdata)
|
||||
|
||||
base = scene.objects.link(obj_new)
|
||||
base.select = True
|
||||
@@ -150,7 +155,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
obj_act.mode == 'EDIT' and
|
||||
obj_act.type == obj_new.type):
|
||||
|
||||
_obdata = bpy.data.meshes.new(obdata.name)
|
||||
_obdata = bpy.data.meshes.new(name)
|
||||
obj_act = bpy.data.objects.new(_obdata.name, _obdata)
|
||||
obj_act.matrix_world = obj_new.matrix_world
|
||||
scene.objects.link(obj_act)
|
||||
@@ -169,7 +174,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
|
||||
#scene.objects.active = obj_new
|
||||
|
||||
bpy.ops.object.join() # join into the active.
|
||||
bpy.data.meshes.remove(obdata)
|
||||
if obdata:
|
||||
bpy.data.meshes.remove(obdata)
|
||||
# base is freed, set to active object
|
||||
base = scene.object_bases.active
|
||||
|
||||
|
@@ -487,6 +487,12 @@ def GetInfoOperatorRNA(bl_rna):
|
||||
|
||||
|
||||
def BuildRNAInfo():
|
||||
|
||||
# needed on successive calls to prevent stale data access
|
||||
for cls in (InfoStructRNA, InfoFunctionRNA, InfoOperatorRNA, InfoPropertyRNA):
|
||||
cls.global_lookup.clear()
|
||||
del cls
|
||||
|
||||
# Use for faster lookups
|
||||
# use rna_struct.identifier as the key for each dict
|
||||
rna_struct_dict = {} # store identifier:rna lookups
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc4800"
|
||||
axis_y="#73dc00"
|
||||
axis_z="#00c2ff">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#ff5a5a"
|
||||
axis_y="#58ff58"
|
||||
axis_z="#6262ff">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
menu_shadow_width="12"
|
||||
icon_file=""
|
||||
icon_alpha="1"
|
||||
emboss="#ffffff05"
|
||||
widget_emboss="#ffffff05"
|
||||
axis_x="#dc0000"
|
||||
axis_y="#00dc00"
|
||||
axis_z="#0000dc">
|
||||
|
@@ -708,6 +708,7 @@ def main(context,
|
||||
island_margin,
|
||||
projection_limit,
|
||||
user_area_weight,
|
||||
use_aspect
|
||||
):
|
||||
global USER_FILL_HOLES
|
||||
global USER_FILL_HOLES_QUALITY
|
||||
@@ -720,7 +721,6 @@ def main(context,
|
||||
global dict_matrix
|
||||
dict_matrix = {}
|
||||
|
||||
|
||||
# Constants:
|
||||
# Takes a list of faces that make up a UV island and rotate
|
||||
# until they optimally fit inside a square.
|
||||
@@ -992,9 +992,31 @@ def main(context,
|
||||
print("Smart Projection time: %.2f" % (time.time() - time1))
|
||||
# Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec" % (time.time() - time1))
|
||||
|
||||
# aspect correction is only done in edit mode - and only smart unwrap supports currently
|
||||
if is_editmode:
|
||||
bpy.ops.object.mode_set(mode='EDIT')
|
||||
|
||||
if use_aspect:
|
||||
import bmesh
|
||||
aspect = context.scene.uvedit_aspect(context.active_object)
|
||||
if aspect[0] > aspect[1]:
|
||||
aspect[0] = aspect[1]/aspect[0];
|
||||
aspect[1] = 1.0
|
||||
else:
|
||||
aspect[1] = aspect[0]/aspect[1];
|
||||
aspect[0] = 1.0
|
||||
|
||||
bm = bmesh.from_edit_mesh(me)
|
||||
|
||||
uv_act = bm.loops.layers.uv.active
|
||||
|
||||
faces = [f for f in bm.faces if f.select]
|
||||
|
||||
for f in faces:
|
||||
for l in f.loops:
|
||||
l[uv_act].uv[0] *= aspect[0]
|
||||
l[uv_act].uv[1] *= aspect[1]
|
||||
|
||||
dict_matrix.clear()
|
||||
|
||||
#XXX Window.DrawProgressBar(1.0, "")
|
||||
@@ -1017,7 +1039,7 @@ def main(context,
|
||||
]
|
||||
"""
|
||||
|
||||
from bpy.props import FloatProperty
|
||||
from bpy.props import FloatProperty, BoolProperty
|
||||
|
||||
|
||||
class SmartProject(Operator):
|
||||
@@ -1046,6 +1068,11 @@ class SmartProject(Operator):
|
||||
min=0.0, max=1.0,
|
||||
default=0.0,
|
||||
)
|
||||
use_aspect = BoolProperty(
|
||||
name="Correct Aspect",
|
||||
description="Map UVs taking image aspect ratio into account",
|
||||
default=True
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -1056,6 +1083,7 @@ class SmartProject(Operator):
|
||||
self.island_margin,
|
||||
self.angle_limit,
|
||||
self.user_area_weight,
|
||||
self.use_aspect
|
||||
)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@@ -19,11 +19,34 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
|
||||
class GreasePencilPanel():
|
||||
from bpy.types import Menu, UIList
|
||||
|
||||
|
||||
def gpencil_stroke_placement_settings(context, layout, gpd):
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.label(text="Stroke Placement:")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_enum(gpd, "draw_mode", 'VIEW')
|
||||
row.prop_enum(gpd, "draw_mode", 'CURSOR')
|
||||
|
||||
if context.space_data.type == 'VIEW_3D':
|
||||
row = col.row(align=True)
|
||||
row.prop_enum(gpd, "draw_mode", 'SURFACE')
|
||||
row.prop_enum(gpd, "draw_mode", 'STROKE')
|
||||
|
||||
row = col.row(align=False)
|
||||
row.active = gpd.draw_mode in {'SURFACE', 'STROKE'}
|
||||
row.prop(gpd, "use_stroke_endpoints")
|
||||
|
||||
|
||||
class GreasePencilDrawingToolsPanel():
|
||||
# subclass must set
|
||||
# bl_space_type = 'IMAGE_EDITOR'
|
||||
# bl_region_type = 'TOOLS'
|
||||
bl_label = "Grease Pencil"
|
||||
bl_category = "Grease Pencil"
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
@staticmethod
|
||||
def draw(self, context):
|
||||
@@ -31,19 +54,421 @@ class GreasePencilPanel():
|
||||
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.label(text="Draw:")
|
||||
row = col.row(align=True)
|
||||
row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
|
||||
row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
|
||||
|
||||
row = col.row(align=True)
|
||||
row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
|
||||
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(context.tool_settings, "use_grease_pencil_sessions")
|
||||
row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
|
||||
row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(context.tool_settings, "use_grease_pencil_sessions", text="Continuous Drawing")
|
||||
|
||||
if context.space_data.type in {'VIEW_3D', 'CLIP_EDITOR'}:
|
||||
col.separator()
|
||||
col.label("Data Source:")
|
||||
row = col.row(align=True)
|
||||
if context.space_data.type == 'VIEW_3D':
|
||||
row.prop(context.tool_settings, "grease_pencil_source", expand=True)
|
||||
elif context.space_data.type == 'CLIP_EDITOR':
|
||||
row.prop(context.space_data, "grease_pencil_source", expand=True)
|
||||
|
||||
gpd = context.gpencil_data
|
||||
if gpd:
|
||||
col.separator()
|
||||
gpencil_stroke_placement_settings(context, col, gpd)
|
||||
|
||||
if context.space_data.type == 'VIEW_3D':
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
col.label(text="Measure:")
|
||||
col.label(text="Tools:")
|
||||
col.operator("gpencil.convert", text="Convert...")
|
||||
col.operator("view3d.ruler")
|
||||
|
||||
|
||||
class GreasePencilStrokeEditPanel():
|
||||
# subclass must set
|
||||
# bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_label = "Edit Strokes"
|
||||
bl_category = "Grease Pencil"
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.gpencil_data is not None)
|
||||
|
||||
@staticmethod
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gpd = context.gpencil_data
|
||||
edit_ok = bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label(text="Select:")
|
||||
subcol = col.column(align=True)
|
||||
subcol.active = edit_ok
|
||||
subcol.operator("gpencil.select_all", text="Select All")
|
||||
subcol.operator("gpencil.select_border")
|
||||
subcol.operator("gpencil.select_circle")
|
||||
|
||||
col.separator()
|
||||
|
||||
subcol = col.column(align=True)
|
||||
subcol.active = edit_ok
|
||||
subcol.operator("gpencil.select_linked")
|
||||
subcol.operator("gpencil.select_more")
|
||||
subcol.operator("gpencil.select_less")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label(text="Edit:")
|
||||
subcol = col.column(align=True)
|
||||
subcol.active = edit_ok
|
||||
subcol.operator("gpencil.delete", text="Delete")
|
||||
subcol.operator("gpencil.duplicate_move", text="Duplicate")
|
||||
subcol.operator("transform.mirror", text="Mirror").gpencil_strokes = True
|
||||
|
||||
col.separator()
|
||||
|
||||
subcol = col.column(align=True)
|
||||
subcol.active = edit_ok
|
||||
subcol.operator("transform.translate").gpencil_strokes = True # icon='MAN_TRANS'
|
||||
subcol.operator("transform.rotate").gpencil_strokes = True # icon='MAN_ROT'
|
||||
subcol.operator("transform.resize", text="Scale").gpencil_strokes = True # icon='MAN_SCALE'
|
||||
|
||||
col.separator()
|
||||
|
||||
subcol = col.column(align=True)
|
||||
subcol.active = edit_ok
|
||||
subcol.operator("transform.bend", text="Bend").gpencil_strokes = True
|
||||
subcol.operator("transform.shear", text="Shear").gpencil_strokes = True
|
||||
subcol.operator("transform.tosphere", text="To Sphere").gpencil_strokes = True
|
||||
|
||||
|
||||
###############################
|
||||
|
||||
class GPENCIL_PIE_tool_palette(Menu):
|
||||
"""A pie menu for quick access to Grease Pencil tools"""
|
||||
bl_label = "Grease Pencil Tools"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
gpd = context.gpencil_data
|
||||
|
||||
# W - Drawing Types
|
||||
col = pie.column()
|
||||
col.operator("gpencil.draw", text="Draw", icon='GREASEPENCIL').mode = 'DRAW'
|
||||
col.operator("gpencil.draw", text="Straight Lines", icon='LINE_DATA').mode = 'DRAW_STRAIGHT'
|
||||
col.operator("gpencil.draw", text="Poly", icon='MESH_DATA').mode = 'DRAW_POLY'
|
||||
|
||||
# E - Eraser
|
||||
# XXX: needs a dedicated icon...
|
||||
col = pie.column()
|
||||
col.operator("gpencil.draw", text="Eraser", icon='FORCE_CURVE').mode = 'ERASER'
|
||||
|
||||
# E - "Settings" Palette is included here too, since it needs to be in a stable position...
|
||||
if gpd and gpd.layers.active:
|
||||
col.separator()
|
||||
col.operator("wm.call_menu_pie", text="Settings...", icon='SCRIPTWIN').name = "GPENCIL_PIE_settings_palette"
|
||||
|
||||
# Editing tools
|
||||
if gpd:
|
||||
if gpd.use_stroke_edit_mode and context.editable_gpencil_strokes:
|
||||
# S - Exit Edit Mode
|
||||
pie.prop(gpd, "use_stroke_edit_mode", text="Exit Edit Mode", icon='EDIT')
|
||||
|
||||
# N - Transforms
|
||||
col = pie.column()
|
||||
row = col.row(align=True)
|
||||
row.operator("transform.translate", icon='MAN_TRANS').gpencil_strokes = True
|
||||
row.operator("transform.rotate", icon='MAN_ROT').gpencil_strokes = True
|
||||
row.operator("transform.resize", text="Scale", icon='MAN_SCALE').gpencil_strokes = True
|
||||
row = col.row(align=True)
|
||||
row.label("Proportional Edit:")
|
||||
row.prop(context.tool_settings, "proportional_edit", text="", icon_only=True)
|
||||
row.prop(context.tool_settings, "proportional_edit_falloff", text="", icon_only=True)
|
||||
|
||||
# NW - Select (Non-Modal)
|
||||
col = pie.column()
|
||||
col.operator("gpencil.select_all", text="Select All", icon='PARTICLE_POINT')
|
||||
col.operator("gpencil.select_all", text="Select Inverse", icon='BLANK1')
|
||||
col.operator("gpencil.select_linked", text="Select Linked", icon='LINKED')
|
||||
|
||||
# NE - Select (Modal)
|
||||
col = pie.column()
|
||||
col.operator("gpencil.select_border", text="Border Select", icon='BORDER_RECT')
|
||||
col.operator("gpencil.select_circle", text="Circle Select", icon='META_EMPTY')
|
||||
col.operator("gpencil.select_lasso", text="Lasso Select", icon='BORDER_LASSO')
|
||||
|
||||
# SW - Edit Tools
|
||||
col = pie.column()
|
||||
col.operator("gpencil.duplicate_move", icon='PARTICLE_PATH', text="Duplicate")
|
||||
col.operator("gpencil.delete", icon='X', text="Delete...")
|
||||
|
||||
# SE - More Tools
|
||||
pie.operator("wm.call_menu_pie", text="More...").name = "GPENCIL_PIE_tools_more"
|
||||
else:
|
||||
# Toggle Edit Mode
|
||||
pie.prop(gpd, "use_stroke_edit_mode", text="Enable Stroke Editing", icon='EDIT')
|
||||
|
||||
|
||||
class GPENCIL_PIE_settings_palette(Menu):
|
||||
"""A pie menu for quick access to Grease Pencil settings"""
|
||||
bl_label = "Grease Pencil Settings"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return bool(context.gpencil_data and context.active_gpencil_layer)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
# gpd = context.gpencil_data
|
||||
gpl = context.active_gpencil_layer
|
||||
|
||||
# W - Stroke draw settings
|
||||
col = pie.column(align=True)
|
||||
col.label(text="Stroke")
|
||||
col.prop(gpl, "color", text="")
|
||||
col.prop(gpl, "alpha", text="", slider=True)
|
||||
|
||||
# E - Fill draw settings
|
||||
col = pie.column(align=True)
|
||||
col.label(text="Fill")
|
||||
col.prop(gpl, "fill_color", text="")
|
||||
col.prop(gpl, "fill_alpha", text="", slider=True)
|
||||
|
||||
# S - Layer settings
|
||||
col = pie.column()
|
||||
col.prop(gpl, "line_width", slider=True)
|
||||
# col.prop(gpl, "use_volumetric_strokes")
|
||||
col.prop(gpl, "use_onion_skinning")
|
||||
|
||||
# N - Active Layer
|
||||
# XXX: this should show an operator to change the active layer instead
|
||||
col = pie.column()
|
||||
col.label("Active Layer: ")
|
||||
col.prop(gpl, "info", text="")
|
||||
# col.prop(gpd, "layers")
|
||||
row = col.row()
|
||||
row.prop(gpl, "lock")
|
||||
row.prop(gpl, "hide")
|
||||
|
||||
|
||||
class GPENCIL_PIE_tools_more(Menu):
|
||||
"""A pie menu for accessing more Grease Pencil tools"""
|
||||
bl_label = "More Grease Pencil Tools"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
gpd = context.gpencil_data
|
||||
return bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
# gpd = context.gpencil_data
|
||||
|
||||
pie.operator("gpencil.select_more", icon='ZOOMIN')
|
||||
pie.operator("gpencil.select_less", icon='ZOOMOUT')
|
||||
|
||||
pie.operator("transform.mirror", icon='MOD_MIRROR').gpencil_strokes = True
|
||||
pie.operator("transform.bend", icon='MOD_SIMPLEDEFORM').gpencil_strokes = True
|
||||
pie.operator("transform.shear", icon='MOD_TRIANGULATE').gpencil_strokes = True
|
||||
pie.operator("transform.tosphere", icon='MOD_MULTIRES').gpencil_strokes = True
|
||||
|
||||
pie.operator("gpencil.convert", icon='OUTLINER_OB_CURVE')
|
||||
pie.operator("wm.call_menu_pie", text="Back to Main Palette...").name = "GPENCIL_PIE_tool_palette"
|
||||
|
||||
|
||||
class GPENCIL_UL_layer(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||
# assert(isinstance(item, bpy.types.GPencilLayer)
|
||||
gpl = item
|
||||
|
||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||
if gpl.lock:
|
||||
layout.active = False
|
||||
|
||||
split = layout.split(percentage=0.2)
|
||||
split.prop(gpl, "color", text="")
|
||||
split.prop(gpl, "info", text="", emboss=False)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(gpl, "lock", text="", emboss=False)
|
||||
row.prop(gpl, "hide", text="", emboss=False)
|
||||
elif self.layout_type in {'GRID'}:
|
||||
layout.alignment = 'CENTER'
|
||||
layout.label(text="", icon_value=icon)
|
||||
|
||||
|
||||
class GreasePencilDataPanel():
|
||||
# subclass must set
|
||||
# bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_label = "Grease Pencil"
|
||||
bl_region_type = 'UI'
|
||||
|
||||
@staticmethod
|
||||
def draw_header(self, context):
|
||||
self.layout.prop(context.space_data, "show_grease_pencil", text="")
|
||||
|
||||
@staticmethod
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
# owner of Grease Pencil data
|
||||
gpd_owner = context.gpencil_data_owner
|
||||
gpd = context.gpencil_data
|
||||
|
||||
# Owner Selector
|
||||
if context.space_data.type == 'VIEW_3D':
|
||||
layout.prop(context.tool_settings, "grease_pencil_source", expand=True)
|
||||
elif context.space_data.type == 'CLIP_EDITOR':
|
||||
layout.prop(context.space_data, "grease_pencil_source", expand=True)
|
||||
|
||||
# Grease Pencil data selector
|
||||
layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
|
||||
|
||||
# Grease Pencil data...
|
||||
if gpd:
|
||||
self.draw_layers(context, layout, gpd)
|
||||
|
||||
def draw_layers(self, context, layout, gpd):
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", rows=5)
|
||||
|
||||
col = row.column()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.operator("gpencil.layer_add", icon='ZOOMIN', text="")
|
||||
sub.operator("gpencil.layer_remove", icon='ZOOMOUT', text="")
|
||||
|
||||
gpl = context.active_gpencil_layer
|
||||
if gpl:
|
||||
col.separator()
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
|
||||
sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
|
||||
|
||||
if gpl:
|
||||
self.draw_layer(layout, gpl)
|
||||
|
||||
def draw_layer(self, layout, gpl):
|
||||
# layer settings
|
||||
split = layout.split(percentage=0.5)
|
||||
split.active = not gpl.lock
|
||||
|
||||
# Column 1 - Stroke
|
||||
col = split.column(align=True)
|
||||
col.label(text="Stroke:")
|
||||
col.prop(gpl, "color", text="")
|
||||
col.prop(gpl, "alpha", slider=True)
|
||||
|
||||
# Column 2 - Fill
|
||||
col = split.column(align=True)
|
||||
col.label(text="Fill:")
|
||||
col.prop(gpl, "fill_color", text="")
|
||||
col.prop(gpl, "fill_alpha", text="Opacity", slider=True)
|
||||
|
||||
# Options
|
||||
split = layout.split(percentage=0.5)
|
||||
split.active = not gpl.lock
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(gpl, "line_width", slider=True)
|
||||
col.prop(gpl, "use_volumetric_strokes")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(gpl, "show_x_ray")
|
||||
|
||||
# if debug:
|
||||
# layout.prop(gpl, "show_points")
|
||||
|
||||
layout.separator()
|
||||
|
||||
# Full-Row - Frame Locking (and Delete Frame)
|
||||
row = layout.row(align=True)
|
||||
row.active = not gpl.lock
|
||||
|
||||
if gpl.active_frame:
|
||||
lock_status = "Locked" if gpl.lock_frame else "Unlocked"
|
||||
lock_label = "Frame: %d (%s)" % (gpl.active_frame.frame_number, lock_status)
|
||||
else:
|
||||
lock_label = "Lock Frame"
|
||||
row.prop(gpl, "lock_frame", text=lock_label, icon='UNLOCKED')
|
||||
row.operator("gpencil.active_frame_delete", text="", icon='X')
|
||||
|
||||
layout.separator()
|
||||
|
||||
# Onion skinning
|
||||
col = layout.column(align=True)
|
||||
col.active = not gpl.lock
|
||||
|
||||
row = col.row()
|
||||
row.prop(gpl, "use_onion_skinning")
|
||||
row.prop(gpl, "use_ghost_custom_colors", text="", icon='COLOR')
|
||||
|
||||
split = col.split(percentage=0.5)
|
||||
split.active = gpl.use_onion_skinning
|
||||
|
||||
# - Before Frames
|
||||
sub = split.column(align=True)
|
||||
row = sub.row(align=True)
|
||||
row.active = gpl.use_ghost_custom_colors
|
||||
row.prop(gpl, "before_color", text="")
|
||||
sub.prop(gpl, "ghost_before_range", text="Before")
|
||||
|
||||
# - After Frames
|
||||
sub = split.column(align=True)
|
||||
row = sub.row(align=True)
|
||||
row.active = gpl.use_ghost_custom_colors
|
||||
row.prop(gpl, "after_color", text="")
|
||||
sub.prop(gpl, "ghost_after_range", text="After")
|
||||
|
||||
|
||||
class GreasePencilToolsPanel():
|
||||
# subclass must set
|
||||
# bl_space_type = 'IMAGE_EDITOR'
|
||||
# bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_label = "Grease Pencil Settings"
|
||||
bl_region_type = 'UI'
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.gpencil_data is not None)
|
||||
|
||||
@staticmethod
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
# gpd_owner = context.gpencil_data_owner
|
||||
gpd = context.gpencil_data
|
||||
|
||||
layout.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.label("Proportional Edit:")
|
||||
row = layout.row()
|
||||
row.prop(context.tool_settings, "proportional_edit", text="")
|
||||
row.prop(context.tool_settings, "proportional_edit_falloff", text="")
|
||||
|
||||
layout.separator()
|
||||
layout.separator()
|
||||
|
||||
gpencil_stroke_placement_settings(context, layout, gpd)
|
||||
|
@@ -21,7 +21,11 @@
|
||||
import bpy
|
||||
from bpy.types import Panel, Header, Menu, UIList
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilPanel
|
||||
from bl_ui.properties_grease_pencil_common import (
|
||||
GreasePencilDrawingToolsPanel,
|
||||
GreasePencilStrokeEditPanel,
|
||||
GreasePencilDataPanel
|
||||
)
|
||||
|
||||
|
||||
class CLIP_UL_tracking_objects(UIList):
|
||||
@@ -422,7 +426,9 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
|
||||
col = layout.column()
|
||||
row = col.row()
|
||||
row.prop(settings, "use_tripod_solver", text="Tripod")
|
||||
row.prop(settings, "use_keyframe_selection", text="Keyframe")
|
||||
sub = row.row()
|
||||
sub.active = not settings.use_tripod_solver
|
||||
sub.prop(settings, "use_keyframe_selection", text="Keyframe")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.active = (not settings.use_tripod_solver and
|
||||
@@ -1050,12 +1056,6 @@ class CLIP_PT_tools_mask(MASK_PT_tools, Panel):
|
||||
# --- end mask ---
|
||||
|
||||
|
||||
class CLIP_PT_tools_grease_pencil(GreasePencilPanel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_category = "Grease Pencil"
|
||||
|
||||
|
||||
class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
@@ -1110,6 +1110,26 @@ class CLIP_PT_tools_scenesetup(Panel):
|
||||
layout.operator("clip.setup_tracking_scene")
|
||||
|
||||
|
||||
# Grease Pencil properties
|
||||
class CLIP_PT_grease_pencil(GreasePencilDataPanel, CLIP_PT_clip_view_panel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP Panel
|
||||
# But, this should only be visible in "clip" view
|
||||
|
||||
|
||||
# Grease Pencil drawing tools
|
||||
class CLIP_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
|
||||
|
||||
# Grease Pencil stroke editing tools
|
||||
class CLIP_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
|
||||
|
||||
class CLIP_MT_view(Menu):
|
||||
bl_label = "View"
|
||||
|
||||
|
@@ -91,6 +91,8 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
|
||||
row.prop(dopesheet, "show_speakers", text="")
|
||||
if bpy.data.linestyles:
|
||||
row.prop(dopesheet, "show_linestyles", text="")
|
||||
if bpy.data.grease_pencil:
|
||||
row.prop(dopesheet, "show_gpencil", text="")
|
||||
|
||||
|
||||
#######################################
|
||||
@@ -365,14 +367,16 @@ class DOPESHEET_MT_gpencil_frame(Menu):
|
||||
layout = self.layout
|
||||
|
||||
layout.menu("DOPESHEET_MT_key_transform", text="Transform")
|
||||
|
||||
#layout.operator_menu_enum("action.snap", "type", text="Snap")
|
||||
#layout.operator_menu_enum("action.mirror", "type", text="Mirror")
|
||||
layout.operator_menu_enum("action.snap", "type", text="Snap")
|
||||
layout.operator_menu_enum("action.mirror", "type", text="Mirror")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("action.duplicate")
|
||||
layout.operator("action.delete")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("action.keyframe_type")
|
||||
|
||||
#layout.separator()
|
||||
#layout.operator("action.copy")
|
||||
#layout.operator("action.paste")
|
||||
|
@@ -25,7 +25,11 @@ from bl_ui.properties_paint_common import (
|
||||
brush_texpaint_common,
|
||||
brush_mask_texture_settings,
|
||||
)
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilPanel
|
||||
from bl_ui.properties_grease_pencil_common import (
|
||||
GreasePencilDrawingToolsPanel,
|
||||
GreasePencilStrokeEditPanel,
|
||||
GreasePencilDataPanel
|
||||
)
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
|
||||
@@ -1149,10 +1153,21 @@ class IMAGE_PT_scope_sample(Panel):
|
||||
sub.prop(sima.scopes, "accuracy")
|
||||
|
||||
|
||||
class IMAGE_PT_tools_grease_pencil(GreasePencilPanel, Panel):
|
||||
# Grease Pencil properties
|
||||
class IMAGE_PT_grease_pencil(GreasePencilDataPanel, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP Panel
|
||||
|
||||
# Grease Pencil drawing tools
|
||||
class IMAGE_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
|
||||
|
||||
# Grease Pencil stroke editing tools
|
||||
class IMAGE_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_category = "Grease Pencil"
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
|
@@ -57,12 +57,15 @@ class INFO_HT_header(Header):
|
||||
row = layout.row(align=True)
|
||||
|
||||
if bpy.app.autoexec_fail is True and bpy.app.autoexec_fail_quiet is False:
|
||||
row.label("Auto-run disabled: %s" % bpy.app.autoexec_fail_message, icon='ERROR')
|
||||
row.label("Auto-run disabled", icon='ERROR')
|
||||
if bpy.data.is_saved:
|
||||
props = row.operator("wm.revert_mainfile", icon='SCREEN_BACK', text="Reload Trusted")
|
||||
props.use_scripts = True
|
||||
|
||||
row.operator("script.autoexec_warn_clear", text="Ignore")
|
||||
|
||||
# include last so text doesn't push buttons out of the header
|
||||
row.label(bpy.app.autoexec_fail_message)
|
||||
return
|
||||
|
||||
row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
|
||||
@@ -276,7 +279,7 @@ class INFO_MT_help(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
|
||||
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://www.blender.org/manual"
|
||||
layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/%d.%d" % bpy.app.version[:2]
|
||||
layout.separator()
|
||||
|
||||
|
@@ -19,6 +19,12 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
from bl_ui.properties_grease_pencil_common import (
|
||||
GreasePencilDrawingToolsPanel,
|
||||
GreasePencilStrokeEditPanel,
|
||||
GreasePencilDataPanel,
|
||||
GreasePencilToolsPanel,
|
||||
)
|
||||
|
||||
|
||||
class NODE_HT_header(Header):
|
||||
@@ -439,6 +445,45 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
|
||||
layout.template_node_socket(color)
|
||||
|
||||
|
||||
# Grease Pencil properties
|
||||
class NODE_PT_grease_pencil(GreasePencilDataPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP Panel
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
snode = context.space_data
|
||||
return snode is not None and snode.node_tree is not None
|
||||
|
||||
|
||||
class NODE_PT_grease_pencil_tools(GreasePencilToolsPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP tools panel
|
||||
# It contains access to some essential tools usually found only in
|
||||
# toolbar, but which may not necessarily be open
|
||||
|
||||
|
||||
# Tool Shelf ------------------
|
||||
|
||||
|
||||
# Grease Pencil drawing tools
|
||||
class NODE_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
|
||||
# Grease Pencil stroke editing tools
|
||||
class NODE_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
# -----------------------------
|
||||
|
||||
def node_draw_tree_view(layout, context):
|
||||
pass
|
||||
|
||||
|
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilDataPanel, GreasePencilToolsPanel
|
||||
from bpy.app.translations import pgettext_iface as iface_
|
||||
|
||||
|
||||
@@ -71,7 +72,6 @@ class SEQUENCER_HT_header(Header):
|
||||
row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
|
||||
|
||||
layout.prop(st, "view_type", expand=True, text="")
|
||||
layout.prop(st, "waveform_draw_type", text="")
|
||||
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.prop(st, "display_mode", expand=True, text="")
|
||||
@@ -103,6 +103,17 @@ class SEQUENCER_HT_header(Header):
|
||||
row = layout.row()
|
||||
row.prop(st, "overlay_type", text="")
|
||||
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
gpd = context.gpencil_data
|
||||
toolsettings = context.tool_settings
|
||||
|
||||
# Proportional editing
|
||||
if gpd and gpd.use_stroke_edit_mode:
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "proportional_edit", icon_only=True)
|
||||
if toolsettings.proportional_edit != 'DISABLED':
|
||||
row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True
|
||||
props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
|
||||
@@ -151,8 +162,10 @@ class SEQUENCER_MT_view(Menu):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
|
||||
is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
|
||||
|
||||
if st.view_type in {'PREVIEW'}:
|
||||
if st.view_type == 'PREVIEW':
|
||||
# Specifying the REGION_PREVIEW context is needed in preview-only
|
||||
# mode, else the lookup for the shortcut will fail in
|
||||
# wm_keymap_item_find_props() (see #32595).
|
||||
@@ -162,10 +175,10 @@ class SEQUENCER_MT_view(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.operator("sequencer.view_all", text="View all Sequences")
|
||||
layout.operator("sequencer.view_selected")
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
if is_preview:
|
||||
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
||||
layout.operator("sequencer.view_all_preview", text="Fit preview in window")
|
||||
|
||||
@@ -183,11 +196,14 @@ class SEQUENCER_MT_view(Menu):
|
||||
# # XXX, invokes in the header view
|
||||
# layout.operator("sequencer.view_ghost_border", text="Overlay Border")
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.prop(st, "show_seconds")
|
||||
layout.prop(st, "show_frame_indicator")
|
||||
layout.prop(st, "show_strip_offset")
|
||||
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.prop_menu_enum(st, "waveform_draw_type")
|
||||
|
||||
if is_preview:
|
||||
if st.display_mode == 'IMAGE':
|
||||
layout.prop(st, "show_safe_margin")
|
||||
elif st.display_mode == 'WAVEFORM':
|
||||
@@ -195,7 +211,7 @@ class SEQUENCER_MT_view(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.prop(st, "use_marker_sync")
|
||||
layout.separator()
|
||||
|
||||
@@ -781,6 +797,8 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
|
||||
layout.label(text="Camera Override")
|
||||
layout.template_ID(strip, "scene_camera")
|
||||
|
||||
layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
|
||||
|
||||
if scene:
|
||||
layout.prop(scene, "audio_volume", text="Audio Volume")
|
||||
|
||||
@@ -1017,5 +1035,22 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
|
||||
col.prop(mod, "contrast")
|
||||
|
||||
|
||||
class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
|
||||
bl_space_type = 'SEQUENCE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP Panel
|
||||
# But, it should only show up when there are images in the preview region
|
||||
|
||||
|
||||
class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsPanel_Output, Panel):
|
||||
bl_space_type = 'SEQUENCE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP tools panel
|
||||
# It contains access to some essential tools usually found only in
|
||||
# toolbar, which doesn't exist here...
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
bpy.utils.register_module(__name__)
|
||||
|
@@ -776,7 +776,7 @@ class USERPREF_PT_theme(Panel):
|
||||
padding = subsplit.split(percentage=0.15)
|
||||
colsub = padding.column()
|
||||
colsub = padding.column()
|
||||
colsub.row().prop(ui, "emboss")
|
||||
colsub.row().prop(ui, "widget_emboss")
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilDataPanel
|
||||
from bl_ui.properties_paint_common import UnifiedPaintPanel
|
||||
from bpy.app.translations import contexts as i18n_contexts
|
||||
|
||||
@@ -56,7 +57,12 @@ class VIEW3D_HT_header(Header):
|
||||
row.prop(view, "use_occlude_geometry", text="")
|
||||
|
||||
# Proportional editing
|
||||
if mode in {'EDIT', 'PARTICLE_EDIT'}:
|
||||
if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "proportional_edit", icon_only=True)
|
||||
if toolsettings.proportional_edit != 'DISABLED':
|
||||
row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
|
||||
elif mode in {'EDIT', 'PARTICLE_EDIT'}:
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "proportional_edit", icon_only=True)
|
||||
if toolsettings.proportional_edit != 'DISABLED':
|
||||
@@ -66,6 +72,13 @@ class VIEW3D_HT_header(Header):
|
||||
row.prop(toolsettings, "use_proportional_edit_objects", icon_only=True)
|
||||
if toolsettings.use_proportional_edit_objects:
|
||||
row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
|
||||
else:
|
||||
# Proportional editing
|
||||
if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "proportional_edit", icon_only=True)
|
||||
if toolsettings.proportional_edit != 'DISABLED':
|
||||
row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
|
||||
|
||||
# Snap
|
||||
if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
|
||||
@@ -2703,6 +2716,12 @@ class VIEW3D_MT_edit_armature_roll(Menu):
|
||||
|
||||
# ********** Panel **********
|
||||
|
||||
class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
# NOTE: this is just a wrapper around the generic GP Panel
|
||||
|
||||
|
||||
class VIEW3D_PT_view3d_properties(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
|
@@ -19,7 +19,10 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import Menu, Panel, UIList
|
||||
from bl_ui.properties_grease_pencil_common import GreasePencilPanel
|
||||
from bl_ui.properties_grease_pencil_common import (
|
||||
GreasePencilDrawingToolsPanel,
|
||||
GreasePencilStrokeEditPanel
|
||||
)
|
||||
from bl_ui.properties_paint_common import (
|
||||
UnifiedPaintPanel,
|
||||
brush_texture_settings,
|
||||
@@ -1805,11 +1808,14 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
||||
sub.prop(pe, "fade_frames", slider=True)
|
||||
|
||||
|
||||
# Grease Pencil tools
|
||||
class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel):
|
||||
# Grease Pencil drawing tools
|
||||
class VIEW3D_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
|
||||
|
||||
# Grease Pencil stroke editing tools
|
||||
class VIEW3D_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_category = "Grease Pencil"
|
||||
|
||||
|
||||
# Note: moved here so that it's always in last position in 'Tools' panels!
|
||||
|
@@ -57,7 +57,7 @@
|
||||
<p class="p5"><span class="s3">General information <a href="http://www.blender.org/"><span class="s4">www.blender.org</span></a> <br>
|
||||
Full release log <a href="http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.73"><span class="s4">wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.73</span></a><br>
|
||||
Tutorials <a href="http://www.blender.org/support/tutorials/"><span class="s4">www.blender.org/support/tutorials/</span></a> <br>
|
||||
Manual <a href="http://wiki.blender.org/index.php/Doc:2.6/Manual"><span class="s4">wiki.blender.org/index.php/Doc:2.6/Manual</span></a><br>
|
||||
Manual <a href="http://www.blender.org/manual"><span class="s4">www.blender.org/manual</span></a><br>
|
||||
User Forum <a href="http://www.blenderartists.org/"><span class="s4">www.blenderartists.org</span></a><br>
|
||||
IRC <a href="irc://irc.freenode.net/#blenderchat"><span class="s4">#blenderchat</span></a> or <a href="irc://irc.freenode.net/#blender"><span class="s4">#blender</span></a> on irc.freenode.net</span></p>
|
||||
<p class="p4">Developers:</p>
|
||||
|
@@ -163,6 +163,8 @@ const char *BLF_translate_do_new_dataname(const char *msgctxt, const char *msgid
|
||||
#define BLF_I18NCONTEXT_ID_MESH "Mesh"
|
||||
#define BLF_I18NCONTEXT_ID_NODETREE "NodeTree"
|
||||
#define BLF_I18NCONTEXT_ID_OBJECT "Object"
|
||||
#define BLF_I18NCONTEXT_ID_PAINTCURVE "PaintCurve"
|
||||
#define BLF_I18NCONTEXT_ID_PALETTE "Palette"
|
||||
#define BLF_I18NCONTEXT_ID_PARTICLESETTINGS "ParticleSettings"
|
||||
#define BLF_I18NCONTEXT_ID_SCENE "Scene"
|
||||
#define BLF_I18NCONTEXT_ID_SCREEN "Screen"
|
||||
@@ -207,11 +209,15 @@ typedef struct
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LAMP, "id_lamp"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LIBRARY, "id_library"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_LATTICE, "id_lattice"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MASK, "id_mask"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MATERIAL, "id_material"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_METABALL, "id_metaball"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MESH, "id_mesh"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MOVIECLIP, "id_movieclip"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_NODETREE, "id_nodetree"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_OBJECT, "id_object"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PAINTCURVE, "id_paintcurve"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PALETTE, "id_palette"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_PARTICLESETTINGS, "id_particlesettings"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCENE, "id_scene"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_SCREEN, "id_screen"), \
|
||||
@@ -223,8 +229,6 @@ typedef struct
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_VFONT, "id_vfont"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WORLD, "id_world"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MOVIECLIP, "id_movieclip"), \
|
||||
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_MASK, "id_mask"), \
|
||||
{NULL, NULL, NULL} \
|
||||
}
|
||||
|
||||
|
@@ -262,8 +262,8 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
|
||||
g->xoff = -1;
|
||||
g->yoff = -1;
|
||||
bitmap = slot->bitmap;
|
||||
g->width = bitmap.width;
|
||||
g->height = bitmap.rows;
|
||||
g->width = (int)bitmap.width;
|
||||
g->height = (int)bitmap.rows;
|
||||
|
||||
if (g->width && g->height) {
|
||||
if (sharp) {
|
||||
|
@@ -42,7 +42,7 @@ extern "C" {
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 272
|
||||
#define BLENDER_SUBVERSION 2
|
||||
#define BLENDER_SUBVERSION 3
|
||||
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
|
||||
#define BLENDER_MINVERSION 270
|
||||
#define BLENDER_MINSUBVERSION 5
|
||||
|
@@ -56,6 +56,9 @@ struct Text;
|
||||
struct ImBuf;
|
||||
struct EditBone;
|
||||
struct bPoseChannel;
|
||||
struct bGPdata;
|
||||
struct bGPDlayer;
|
||||
struct bGPDframe;
|
||||
struct wmWindow;
|
||||
struct wmWindowManager;
|
||||
struct SpaceText;
|
||||
@@ -275,6 +278,14 @@ struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C);
|
||||
int CTX_data_selected_pose_bones(const bContext *C, ListBase *list);
|
||||
int CTX_data_visible_pose_bones(const bContext *C, ListBase *list);
|
||||
|
||||
struct bGPdata *CTX_data_gpencil_data(const bContext *C);
|
||||
struct bGPDlayer *CTX_data_active_gpencil_layer(const bContext *C);
|
||||
struct bGPDframe *CTX_data_active_gpencil_frame(const bContext *C);
|
||||
int CTX_data_visible_gpencil_layers(const bContext *C, ListBase *list);
|
||||
int CTX_data_editable_gpencil_layers(const bContext *C, ListBase *list);
|
||||
int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -35,6 +35,7 @@ struct ListBase;
|
||||
struct bGPdata;
|
||||
struct bGPDlayer;
|
||||
struct bGPDframe;
|
||||
struct bGPDstroke;
|
||||
|
||||
/* ------------ Grease-Pencil API ------------------ */
|
||||
|
||||
@@ -43,6 +44,8 @@ void free_gpencil_frames(struct bGPDlayer *gpl);
|
||||
void free_gpencil_layers(struct ListBase *list);
|
||||
void BKE_gpencil_free(struct bGPdata *gpd);
|
||||
|
||||
void gpencil_stroke_sync_selection(struct bGPDstroke *gps);
|
||||
|
||||
struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe);
|
||||
struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd, const char *name, int setactive);
|
||||
struct bGPdata *gpencil_data_addnew(const char name[]);
|
||||
|
@@ -41,13 +41,13 @@ typedef union IDPropertyTemplate {
|
||||
double d;
|
||||
struct {
|
||||
char *str;
|
||||
short len;
|
||||
int len;
|
||||
char subtype;
|
||||
} string;
|
||||
struct ID *id;
|
||||
struct {
|
||||
short type;
|
||||
short len;
|
||||
int len;
|
||||
char type;
|
||||
} array;
|
||||
struct {
|
||||
int matvec_size;
|
||||
@@ -110,7 +110,7 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
|
||||
|
||||
bool IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
struct IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
struct IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||
|
||||
void IDP_FreeProperty(struct IDProperty *prop);
|
||||
|
||||
|
@@ -36,6 +36,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct bNodeTreeExecPool;
|
||||
struct Main;
|
||||
struct Material;
|
||||
struct ID;
|
||||
@@ -96,10 +97,16 @@ struct Material *BKE_material_pop_id(struct ID *id, int index, bool update_data)
|
||||
void BKE_material_clear_id(struct ID *id, bool update_data);
|
||||
/* rendering */
|
||||
|
||||
void init_render_material(struct Material *, int, float *);
|
||||
void init_render_materials(struct Main *, int, float *);
|
||||
void end_render_material(struct Material *);
|
||||
void end_render_materials(struct Main *);
|
||||
void init_render_material(struct Material *mat,
|
||||
struct bNodeTreeExecPool *exec_tree_pool,
|
||||
int render_mode, float *amb);
|
||||
void init_render_materials(struct Main *bmain,
|
||||
struct bNodeTreeExecPool *exec_tree_pool,
|
||||
int render_mode, float *amb);
|
||||
void end_render_material(struct bNodeTreeExecPool *exec_tree_pool,
|
||||
struct Material *mat);
|
||||
void end_render_materials(struct Main *bmain,
|
||||
struct bNodeTreeExecPool *exec_tree_pool);
|
||||
|
||||
bool material_in_material(struct Material *parmat, struct Material *mat);
|
||||
|
||||
|
@@ -46,6 +46,7 @@ void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip);
|
||||
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
|
||||
void BKE_movieclip_reload(struct MovieClip *clip);
|
||||
void BKE_movieclip_clear_cache(struct MovieClip *clip);
|
||||
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);
|
||||
|
||||
struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
|
||||
struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user