Compare commits
150 Commits
input_meth
...
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 | |||
de724a258e | |||
a4ba73311b | |||
b35aafab6a | |||
94dd73b995 | |||
e9e555fb85 | |||
5c50820e6a | |||
f5c526f29c | |||
4bd79aca12 | |||
b2d6cd2e33 | |||
98bd0b4027 | |||
c4235ce820 |
@@ -318,8 +318,8 @@ 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)" ON)
|
||||
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)
|
||||
@@ -1152,7 +1152,11 @@ elseif(WIN32)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi imm32)
|
||||
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
|
||||
@@ -1508,7 +1512,12 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -limm32)
|
||||
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
|
||||
|
@@ -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
|
||||
@@ -196,7 +198,10 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-limm32']
|
||||
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']
|
||||
|
||||
|
@@ -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
|
||||
@@ -235,7 +237,10 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
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']
|
||||
|
||||
|
@@ -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
|
||||
@@ -190,7 +192,10 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-limm32']
|
||||
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']
|
||||
|
||||
|
@@ -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
|
||||
@@ -242,7 +244,10 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
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']
|
||||
|
||||
|
@@ -654,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',
|
||||
@@ -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', ''),
|
||||
|
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()
|
||||
|
32
extern/libmv/SConscript
vendored
32
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,18 +48,6 @@ 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'
|
||||
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
|
107
extern/libmv/bundle.sh
vendored
107
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}")
|
||||
@@ -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,25 +315,9 @@ 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}
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -541,7 +541,7 @@ typedef enum AttributeStandard {
|
||||
|
||||
/* 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 pddings trying to align this members.
|
||||
* does not put own padding trying to align this members.
|
||||
* - We make sure OSL pointer is also 16 bytes aligned.
|
||||
*/
|
||||
typedef struct ShaderClosure {
|
||||
|
@@ -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;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#ifdef WITH_OSL
|
||||
# if defined(_MSC_VER)
|
||||
/* Prevent OSL from pollyting the context with weird macroses from windows.h.
|
||||
/* 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.
|
||||
*/
|
||||
|
@@ -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
|
||||
|
@@ -285,11 +285,11 @@ elseif(WIN32)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_ImeWin32.cpp
|
||||
|
||||
|
||||
intern/GHOST_ImeWin32.h
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManagerWin32.cpp
|
||||
|
@@ -906,8 +906,8 @@ extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle);
|
||||
* \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.
|
||||
* 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,
|
||||
|
@@ -340,14 +340,13 @@ public:
|
||||
* \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.
|
||||
* 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;
|
||||
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
|
||||
|
@@ -1,401 +0,0 @@
|
||||
/*
|
||||
* ***** 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 bwlow:
|
||||
* 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 EnableIME(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 DisableIME(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__
|
@@ -443,7 +443,7 @@ typedef struct {
|
||||
/** similar to wmImeData */
|
||||
typedef struct {
|
||||
/** size_t */
|
||||
GHOST_TUserDataPtr result_len, composite_len;
|
||||
GHOST_TUserDataPtr result_len, composite_len;
|
||||
/** char * utf8 encoding */
|
||||
GHOST_TUserDataPtr result, composite;
|
||||
/** Cursor position in the IME composition. */
|
||||
|
@@ -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')
|
||||
|
||||
|
@@ -918,11 +918,9 @@ float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
|
||||
#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_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);
|
||||
@@ -934,4 +932,4 @@ void GHOST_EndIME(GHOST_WindowHandle windowhandle)
|
||||
window->endIME();
|
||||
}
|
||||
|
||||
#endif /* WITH_INPUT_IME */
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
@@ -114,7 +114,7 @@ struct ImeComposition {
|
||||
|
||||
/**
|
||||
* Represents the type of the string in the 'ime_string' parameter.
|
||||
* Its possible values and description are listed bwlow:
|
||||
* Its possible values and description are listed below:
|
||||
* Value Description
|
||||
* 0 The parameter is not used.
|
||||
* GCS_RESULTSTR The parameter represents a result string.
|
||||
|
@@ -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,
|
||||
|
@@ -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];
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#include "GHOST_Window.h"
|
||||
#include "GHOST_TaskbarWin32.h"
|
||||
#ifdef WITH_INPUT_IME
|
||||
#include "GHOST_ImeWin32.h"
|
||||
# include "GHOST_ImeWin32.h"
|
||||
#endif
|
||||
|
||||
#include <wintab.h>
|
||||
@@ -259,11 +259,10 @@ public:
|
||||
#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 beginIME(
|
||||
GHOST_TInt32 x, GHOST_TInt32 y,
|
||||
GHOST_TInt32 w, GHOST_TInt32 h,
|
||||
int completed);
|
||||
|
||||
virtual void endIME();
|
||||
#endif /* WITH_INPUT_IME */
|
||||
|
@@ -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.
@@ -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):
|
||||
"""
|
||||
|
@@ -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,7 +19,6 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
|
||||
import bpy
|
||||
from bpy.types import Menu, UIList
|
||||
|
||||
|
||||
@@ -38,7 +37,7 @@ def gpencil_stroke_placement_settings(context, layout, gpd):
|
||||
row.prop_enum(gpd, "draw_mode", 'STROKE')
|
||||
|
||||
row = col.row(align=False)
|
||||
row.active = gpd.draw_mode in ('SURFACE', 'STROKE')
|
||||
row.active = gpd.draw_mode in {'SURFACE', 'STROKE'}
|
||||
row.prop(gpd, "use_stroke_endpoints")
|
||||
|
||||
|
||||
@@ -64,16 +63,23 @@ class GreasePencilDrawingToolsPanel():
|
||||
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()
|
||||
@@ -228,7 +234,7 @@ class GPENCIL_PIE_settings_palette(Menu):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
gpd = context.gpencil_data
|
||||
# gpd = context.gpencil_data
|
||||
gpl = context.active_gpencil_layer
|
||||
|
||||
# W - Stroke draw settings
|
||||
@@ -246,7 +252,7 @@ class GPENCIL_PIE_settings_palette(Menu):
|
||||
# S - Layer settings
|
||||
col = pie.column()
|
||||
col.prop(gpl, "line_width", slider=True)
|
||||
#col.prop(gpl, "use_volumetric_strokes")
|
||||
# col.prop(gpl, "use_volumetric_strokes")
|
||||
col.prop(gpl, "use_onion_skinning")
|
||||
|
||||
# N - Active Layer
|
||||
@@ -254,12 +260,12 @@ class GPENCIL_PIE_settings_palette(Menu):
|
||||
col = pie.column()
|
||||
col.label("Active Layer: ")
|
||||
col.prop(gpl, "info", text="")
|
||||
#col.prop(gpd, "layers")
|
||||
# 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"
|
||||
@@ -273,20 +279,19 @@ class GPENCIL_PIE_tools_more(Menu):
|
||||
layout = self.layout
|
||||
|
||||
pie = layout.menu_pie()
|
||||
gpd = context.gpencil_data
|
||||
|
||||
# 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):
|
||||
@@ -328,8 +333,9 @@ class GreasePencilDataPanel():
|
||||
gpd = context.gpencil_data
|
||||
|
||||
# Owner Selector
|
||||
# XXX: add this for 3D view too
|
||||
if context.space_data.type == 'CLIP_EDITOR':
|
||||
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
|
||||
@@ -390,8 +396,8 @@ class GreasePencilDataPanel():
|
||||
col = split.column(align=True)
|
||||
col.prop(gpl, "show_x_ray")
|
||||
|
||||
#if debug:
|
||||
# layout.prop(gpl, "show_points")
|
||||
# if debug:
|
||||
# layout.prop(gpl, "show_points")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -417,7 +423,7 @@ class GreasePencilDataPanel():
|
||||
row.prop(gpl, "use_onion_skinning")
|
||||
row.prop(gpl, "use_ghost_custom_colors", text="", icon='COLOR')
|
||||
|
||||
split = col.split(percentage = 0.5)
|
||||
split = col.split(percentage=0.5)
|
||||
split.active = gpl.use_onion_skinning
|
||||
|
||||
# - Before Frames
|
||||
@@ -427,7 +433,6 @@ class GreasePencilDataPanel():
|
||||
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)
|
||||
@@ -451,7 +456,7 @@ class GreasePencilToolsPanel():
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
gpd_owner = context.gpencil_data_owner
|
||||
# gpd_owner = context.gpencil_data_owner
|
||||
gpd = context.gpencil_data
|
||||
|
||||
layout.prop(gpd, "use_stroke_edit_mode", text="Enable Editing", icon='EDIT', toggle=True)
|
||||
|
@@ -279,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()
|
||||
|
||||
|
@@ -72,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="")
|
||||
@@ -163,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).
|
||||
@@ -174,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")
|
||||
|
||||
@@ -195,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':
|
||||
@@ -207,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()
|
||||
|
||||
@@ -793,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")
|
||||
|
||||
|
@@ -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()
|
||||
|
@@ -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} \
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -84,6 +84,7 @@ struct ColorManagedViewSettings;
|
||||
struct ColorManagedDisplaySettings;
|
||||
struct bNodeInstanceHash;
|
||||
|
||||
typedef struct bNodeTreeExecPool bNodeTreeExecPool;
|
||||
|
||||
/* ************** NODE TYPE DEFINITIONS ***** */
|
||||
|
||||
@@ -773,7 +774,7 @@ struct ShadeResult;
|
||||
|
||||
struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree);
|
||||
void ntreeShaderEndExecTree(struct bNodeTreeExec *exec);
|
||||
bool ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
|
||||
bool ntreeShaderExecTree(bNodeTreeExecPool *exec_tree_pool, struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
|
||||
void ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
|
||||
|
||||
/* switch material render loop */
|
||||
@@ -999,13 +1000,24 @@ struct TexResult;
|
||||
int ntreeTexTagAnimated(struct bNodeTree *ntree);
|
||||
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
|
||||
|
||||
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree);
|
||||
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree) ATTR_WARN_UNUSED_RESULT;
|
||||
void ntreeTexEndExecTree(struct bNodeTreeExec *exec);
|
||||
int ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target,
|
||||
int ntreeTexExecTree(bNodeTreeExecPool *pool,
|
||||
struct bNodeTree *ntree, struct TexResult *target,
|
||||
float coord[3], float dxt[3], float dyt[3], int osatex, const short thread,
|
||||
struct Tex *tex, short which_output, int cfra, int preview, struct ShadeInput *shi, struct MTex *mtex);
|
||||
|
||||
|
||||
bNodeTreeExecPool *BKE_node_tree_exec_pool_new(void);
|
||||
void BKE_node_tree_exec_pool_free(bNodeTreeExecPool *pool);
|
||||
void BKE_node_tree_exec_pool_put(bNodeTreeExecPool *pool,
|
||||
struct ID *id,
|
||||
void *data);
|
||||
void *BKE_node_tree_exec_pool_get(bNodeTreeExecPool *pool,
|
||||
struct ID *id);
|
||||
void *BKE_node_tree_exec_pool_pop(bNodeTreeExecPool *pool,
|
||||
struct ID *id);
|
||||
|
||||
/*************************************************/
|
||||
|
||||
void init_nodesystem(void);
|
||||
|
@@ -393,7 +393,7 @@ struct Sequence *BKE_sequencer_add_sound_strip(struct bContext *C, ListBase *seq
|
||||
struct Sequence *BKE_sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
|
||||
|
||||
/* view3d draw callback, run when not in background view */
|
||||
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, int, char[256]);
|
||||
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, bool, int, char[256]);
|
||||
extern SequencerDrawView sequencer_view3d_cb;
|
||||
|
||||
/* copy/paste */
|
||||
|
@@ -277,6 +277,13 @@ set(SRC
|
||||
intern/pbvh_intern.h
|
||||
)
|
||||
|
||||
if(WITH_BINRELOC)
|
||||
list(APPEND INC_SYS
|
||||
${BINRELOC_INCLUDE_DIRS}
|
||||
)
|
||||
add_definitions(-DWITH_BINRELOC)
|
||||
endif()
|
||||
|
||||
add_definitions(${GL_DEFINITIONS})
|
||||
|
||||
if(WIN32)
|
||||
|
@@ -170,6 +170,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', '
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
incs += ' ../../../intern/utfconv'
|
||||
|
||||
if env['WITH_BF_BINRELOC']:
|
||||
incs += ' #extern/binreloc/include'
|
||||
defs.append('WITH_BINRELOC')
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [166,25]) #, cc_compileflags = env['CCFLAGS'].append('/WX') )
|
||||
|
@@ -172,29 +172,19 @@ static void *_ehash_lookup(EHash *eh, void *key)
|
||||
|
||||
/**/
|
||||
|
||||
typedef struct _EHashIterator {
|
||||
EHash *eh;
|
||||
int curBucket;
|
||||
EHEntry *curEntry;
|
||||
} EHashIterator;
|
||||
|
||||
static EHashIterator *_ehashIterator_new(EHash *eh)
|
||||
static void _ehashIterator_init(EHash *eh, EHashIterator *ehi)
|
||||
{
|
||||
EHashIterator *ehi = EHASH_alloc(eh, sizeof(*ehi));
|
||||
/* fill all members */
|
||||
ehi->eh = eh;
|
||||
ehi->curEntry = NULL;
|
||||
ehi->curBucket = -1;
|
||||
ehi->curEntry = NULL;
|
||||
|
||||
while (!ehi->curEntry) {
|
||||
ehi->curBucket++;
|
||||
if (ehi->curBucket == ehi->eh->curSize)
|
||||
break;
|
||||
ehi->curEntry = ehi->eh->buckets[ehi->curBucket];
|
||||
}
|
||||
return ehi;
|
||||
}
|
||||
static void _ehashIterator_free(EHashIterator *ehi)
|
||||
{
|
||||
EHASH_free(ehi->eh, ehi);
|
||||
}
|
||||
|
||||
static void *_ehashIterator_getCurrent(EHashIterator *ehi)
|
||||
@@ -3051,17 +3041,17 @@ void *ccgSubSurf_getFaceGridData(CCGSubSurf *ss, CCGFace *f, int gridIndex, int
|
||||
|
||||
/*** External API iterator functions ***/
|
||||
|
||||
CCGVertIterator *ccgSubSurf_getVertIterator(CCGSubSurf *ss)
|
||||
void ccgSubSurf_initVertIterator(CCGSubSurf *ss, CCGVertIterator *viter)
|
||||
{
|
||||
return (CCGVertIterator *) _ehashIterator_new(ss->vMap);
|
||||
_ehashIterator_init(ss->vMap, viter);
|
||||
}
|
||||
CCGEdgeIterator *ccgSubSurf_getEdgeIterator(CCGSubSurf *ss)
|
||||
void ccgSubSurf_initEdgeIterator(CCGSubSurf *ss, CCGEdgeIterator *eiter)
|
||||
{
|
||||
return (CCGEdgeIterator *) _ehashIterator_new(ss->eMap);
|
||||
_ehashIterator_init(ss->eMap, eiter);
|
||||
}
|
||||
CCGFaceIterator *ccgSubSurf_getFaceIterator(CCGSubSurf *ss)
|
||||
void ccgSubSurf_initFaceIterator(CCGSubSurf *ss, CCGFaceIterator *fiter)
|
||||
{
|
||||
return (CCGFaceIterator *) _ehashIterator_new(ss->fMap);
|
||||
_ehashIterator_init(ss->fMap, fiter);
|
||||
}
|
||||
|
||||
CCGVert *ccgVertIterator_getCurrent(CCGVertIterator *vi)
|
||||
@@ -3076,10 +3066,6 @@ void ccgVertIterator_next(CCGVertIterator *vi)
|
||||
{
|
||||
_ehashIterator_next((EHashIterator *) vi);
|
||||
}
|
||||
void ccgVertIterator_free(CCGVertIterator *vi)
|
||||
{
|
||||
_ehashIterator_free((EHashIterator *) vi);
|
||||
}
|
||||
|
||||
CCGEdge *ccgEdgeIterator_getCurrent(CCGEdgeIterator *vi)
|
||||
{
|
||||
@@ -3093,10 +3079,6 @@ void ccgEdgeIterator_next(CCGEdgeIterator *vi)
|
||||
{
|
||||
_ehashIterator_next((EHashIterator *) vi);
|
||||
}
|
||||
void ccgEdgeIterator_free(CCGEdgeIterator *vi)
|
||||
{
|
||||
_ehashIterator_free((EHashIterator *) vi);
|
||||
}
|
||||
|
||||
CCGFace *ccgFaceIterator_getCurrent(CCGFaceIterator *vi)
|
||||
{
|
||||
@@ -3110,10 +3092,6 @@ void ccgFaceIterator_next(CCGFaceIterator *vi)
|
||||
{
|
||||
_ehashIterator_next((EHashIterator *) vi);
|
||||
}
|
||||
void ccgFaceIterator_free(CCGFaceIterator *vi)
|
||||
{
|
||||
_ehashIterator_free((EHashIterator *) vi);
|
||||
}
|
||||
|
||||
/*** Extern API final vert/edge/face interface ***/
|
||||
|
||||
|
@@ -53,6 +53,13 @@ typedef struct CCGAllocatorIFC {
|
||||
void (*release) (CCGAllocatorHDL a);
|
||||
} CCGAllocatorIFC;
|
||||
|
||||
/* private, so we can allocate on the stack */
|
||||
typedef struct _EHashIterator {
|
||||
struct _EHash *eh;
|
||||
int curBucket;
|
||||
struct _EHEntry *curEntry;
|
||||
} EHashIterator;
|
||||
|
||||
/***/
|
||||
|
||||
typedef enum {
|
||||
@@ -163,27 +170,24 @@ int ccgSubSurf_getNumFinalFaces (const CCGSubSurf *ss);
|
||||
|
||||
/***/
|
||||
|
||||
typedef struct CCGVertIterator CCGVertIterator;
|
||||
typedef struct CCGEdgeIterator CCGEdgeIterator;
|
||||
typedef struct CCGFaceIterator CCGFaceIterator;
|
||||
typedef struct _EHashIterator CCGVertIterator;
|
||||
typedef struct _EHashIterator CCGEdgeIterator;
|
||||
typedef struct _EHashIterator CCGFaceIterator;
|
||||
|
||||
CCGVertIterator* ccgSubSurf_getVertIterator (CCGSubSurf *ss);
|
||||
CCGEdgeIterator* ccgSubSurf_getEdgeIterator (CCGSubSurf *ss);
|
||||
CCGFaceIterator* ccgSubSurf_getFaceIterator (CCGSubSurf *ss);
|
||||
void ccgSubSurf_initVertIterator(CCGSubSurf *ss, CCGVertIterator *viter);
|
||||
void ccgSubSurf_initEdgeIterator(CCGSubSurf *ss, CCGEdgeIterator *eiter);
|
||||
void ccgSubSurf_initFaceIterator(CCGSubSurf *ss, CCGFaceIterator *fiter);
|
||||
|
||||
CCGVert* ccgVertIterator_getCurrent (CCGVertIterator *vi);
|
||||
int ccgVertIterator_isStopped (CCGVertIterator *vi);
|
||||
void ccgVertIterator_next (CCGVertIterator *vi);
|
||||
void ccgVertIterator_free (CCGVertIterator *vi);
|
||||
|
||||
CCGEdge* ccgEdgeIterator_getCurrent (CCGEdgeIterator *ei);
|
||||
int ccgEdgeIterator_isStopped (CCGEdgeIterator *ei);
|
||||
void ccgEdgeIterator_next (CCGEdgeIterator *ei);
|
||||
void ccgEdgeIterator_free (CCGEdgeIterator *ei);
|
||||
|
||||
CCGFace* ccgFaceIterator_getCurrent (CCGFaceIterator *fi);
|
||||
int ccgFaceIterator_isStopped (CCGFaceIterator *fi);
|
||||
void ccgFaceIterator_next (CCGFaceIterator *fi);
|
||||
void ccgFaceIterator_free (CCGFaceIterator *fi);
|
||||
|
||||
#endif /* __CCGSUBSURF_H__ */
|
||||
|
@@ -1484,8 +1484,8 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
|
||||
MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0);
|
||||
const bool has_multires = (mmd && mmd->sculptlvl != 0);
|
||||
bool multires_applied = false;
|
||||
const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt;
|
||||
const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm);
|
||||
const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt && !useRenderParams;
|
||||
const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm) && !useRenderParams;
|
||||
const int draw_flag = dm_drawflag_calc(scene->toolsettings);
|
||||
|
||||
/* Generic preview only in object mode! */
|
||||
|
@@ -1654,6 +1654,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
|
||||
pchanw.next = pchan->next;
|
||||
pchanw.parent = pchan->parent;
|
||||
pchanw.child = pchan->child;
|
||||
pchanw.custom_tx = pchan->custom_tx;
|
||||
|
||||
pchanw.mpath = pchan->mpath;
|
||||
pchan->mpath = NULL;
|
||||
|
@@ -454,7 +454,7 @@ void BKE_camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
|
||||
float dummy_drawsize;
|
||||
const float dummy_scale[3] = {1.0f, 1.0f, 1.0f};
|
||||
|
||||
BKE_camera_view_frame_ex(scene, camera, false, 1.0, dummy_scale,
|
||||
BKE_camera_view_frame_ex(scene, camera, 0.0, true, dummy_scale,
|
||||
dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
|
||||
}
|
||||
|
||||
|
@@ -2357,6 +2357,15 @@ void DAG_on_visible_update(Main *bmain, const bool do_time)
|
||||
ob->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_tag(bmain, &ob->id);
|
||||
}
|
||||
/* This should not be needed here, but in some cases, like after a redo, we can end up with
|
||||
* a wrong final matrix (see T42472).
|
||||
* Quoting Sergey, this comes from BKE_object_handle_update_ex, which is calling
|
||||
* BKE_object_where_is_calc_ex when it shouldn't, but that issue is not easily fixable.
|
||||
*/
|
||||
else {
|
||||
ob->recalc |= OB_RECALC_OB;
|
||||
lib_id_recalc_tag(bmain, &ob->id);
|
||||
}
|
||||
if (ob->proxy && (ob->proxy_group == NULL)) {
|
||||
ob->proxy->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_tag(bmain, &ob->id);
|
||||
|
@@ -42,10 +42,18 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_strict_flags.h"
|
||||
|
||||
/* IDPropertyTemplate is a union in DNA_ID.h */
|
||||
|
||||
/**
|
||||
* if the new is 'IDP_ARRAY_REALLOC_LIMIT' items less,
|
||||
* than #IDProperty.totallen, reallocate anyway.
|
||||
*/
|
||||
#define IDP_ARRAY_REALLOC_LIMIT 200
|
||||
|
||||
/*local size table.*/
|
||||
static char idp_size_table[] = {
|
||||
static size_t idp_size_table[] = {
|
||||
1, /*strings*/
|
||||
sizeof(int),
|
||||
sizeof(float),
|
||||
@@ -158,9 +166,8 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
|
||||
BLI_assert(prop->type == IDP_IDPARRAY);
|
||||
|
||||
/* first check if the array buffer size has room */
|
||||
/* if newlen is 200 items less than totallen, reallocate anyway */
|
||||
if (newlen <= prop->totallen) {
|
||||
if (newlen < prop->len && prop->totallen - newlen < 200) {
|
||||
if (newlen < prop->len && prop->totallen - newlen < IDP_ARRAY_REALLOC_LIMIT) {
|
||||
int i;
|
||||
|
||||
for (i = newlen; i < prop->len; i++)
|
||||
@@ -194,7 +201,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
|
||||
*/
|
||||
newsize = newlen;
|
||||
newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
|
||||
prop->data.pointer = MEM_recallocN(prop->data.pointer, sizeof(IDProperty) * newsize);
|
||||
prop->data.pointer = MEM_recallocN(prop->data.pointer, sizeof(IDProperty) * (size_t)newsize);
|
||||
prop->len = newlen;
|
||||
prop->totallen = newsize;
|
||||
}
|
||||
@@ -235,8 +242,7 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
|
||||
const bool is_grow = newlen >= prop->len;
|
||||
|
||||
/* first check if the array buffer size has room */
|
||||
/* if newlen is 200 chars less than totallen, reallocate anyway */
|
||||
if (newlen <= prop->totallen && prop->totallen - newlen < 200) {
|
||||
if (newlen <= prop->totallen && prop->totallen - newlen < IDP_ARRAY_REALLOC_LIMIT) {
|
||||
idp_resize_group_array(prop, newlen, prop->data.pointer);
|
||||
prop->len = newlen;
|
||||
return;
|
||||
@@ -256,7 +262,8 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
|
||||
if (is_grow == false)
|
||||
idp_resize_group_array(prop, newlen, prop->data.pointer);
|
||||
|
||||
prop->data.pointer = MEM_recallocN(prop->data.pointer, idp_size_table[(int)prop->subtype] * newsize);
|
||||
prop->data.pointer = MEM_recallocN(
|
||||
prop->data.pointer, idp_size_table[(int)prop->subtype] * (size_t)newsize);
|
||||
|
||||
if (is_grow == true)
|
||||
idp_resize_group_array(prop, newlen, prop->data.pointer);
|
||||
@@ -336,14 +343,14 @@ IDProperty *IDP_NewString(const char *st, const char *name, int maxlen)
|
||||
}
|
||||
else {
|
||||
/* include null terminator '\0' */
|
||||
int stlen = strlen(st) + 1;
|
||||
int stlen = (int)strlen(st) + 1;
|
||||
|
||||
if (maxlen > 0 && maxlen < stlen)
|
||||
stlen = maxlen;
|
||||
|
||||
prop->data.pointer = MEM_mallocN(stlen, "id property string 2");
|
||||
prop->data.pointer = MEM_mallocN((size_t)stlen, "id property string 2");
|
||||
prop->len = prop->totallen = stlen;
|
||||
BLI_strncpy(prop->data.pointer, st, stlen);
|
||||
BLI_strncpy(prop->data.pointer, st, (size_t)stlen);
|
||||
}
|
||||
|
||||
prop->type = IDP_STRING;
|
||||
@@ -374,18 +381,18 @@ void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
|
||||
int stlen;
|
||||
|
||||
BLI_assert(prop->type == IDP_STRING);
|
||||
stlen = strlen(st);
|
||||
stlen = (int)strlen(st);
|
||||
if (maxlen > 0 && maxlen < stlen)
|
||||
stlen = maxlen;
|
||||
|
||||
if (prop->subtype == IDP_STRING_SUB_BYTE) {
|
||||
IDP_ResizeArray(prop, stlen);
|
||||
memcpy(prop->data.pointer, st, stlen);
|
||||
memcpy(prop->data.pointer, st, (size_t)stlen);
|
||||
}
|
||||
else {
|
||||
stlen++;
|
||||
IDP_ResizeArray(prop, stlen);
|
||||
BLI_strncpy(prop->data.pointer, st, stlen);
|
||||
BLI_strncpy(prop->data.pointer, st, (size_t)stlen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +402,7 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st)
|
||||
|
||||
BLI_assert(prop->type == IDP_STRING);
|
||||
|
||||
newlen = prop->len + strlen(st);
|
||||
newlen = prop->len + (int)strlen(st);
|
||||
/* we have to remember that prop->len includes the null byte for strings.
|
||||
* so there's no need to add +1 to the resize function.*/
|
||||
IDP_ResizeArray(prop, newlen);
|
||||
@@ -795,10 +802,15 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
|
||||
case IDP_DOUBLE:
|
||||
return (IDP_Double(prop1) == IDP_Double(prop2));
|
||||
case IDP_STRING:
|
||||
return ((prop1->len == prop2->len) && strncmp(IDP_String(prop1), IDP_String(prop2), prop1->len) == 0);
|
||||
{
|
||||
return (((prop1->len == prop2->len) &&
|
||||
strncmp(IDP_String(prop1), IDP_String(prop2), (size_t)prop1->len) == 0));
|
||||
}
|
||||
case IDP_ARRAY:
|
||||
if (prop1->len == prop2->len && prop1->subtype == prop2->subtype) {
|
||||
return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype] * prop1->len);
|
||||
return (memcmp(IDP_Array(prop1),
|
||||
IDP_Array(prop2),
|
||||
idp_size_table[(int)prop1->subtype] * (size_t)prop1->len) == 0);
|
||||
}
|
||||
return false;
|
||||
case IDP_GROUP:
|
||||
@@ -870,7 +882,7 @@ bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
|
||||
* IDP_AddToGroup or MEM_freeN the property, doing anything else might result in
|
||||
* a memory leak.
|
||||
*/
|
||||
IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *name)
|
||||
IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *name)
|
||||
{
|
||||
IDProperty *prop = NULL;
|
||||
|
||||
@@ -897,8 +909,10 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
|
||||
{
|
||||
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
|
||||
prop->subtype = val->array.type;
|
||||
if (val->array.len)
|
||||
prop->data.pointer = MEM_callocN(idp_size_table[val->array.type] * val->array.len, "id property array");
|
||||
if (val->array.len) {
|
||||
prop->data.pointer = MEM_callocN(
|
||||
idp_size_table[val->array.type] * (size_t)val->array.len, "id property array");
|
||||
}
|
||||
prop->len = prop->totallen = val->array.len;
|
||||
break;
|
||||
}
|
||||
@@ -918,9 +932,9 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
|
||||
prop->len = 0;
|
||||
}
|
||||
else {
|
||||
prop->data.pointer = MEM_mallocN(val->string.len, "id property string 2");
|
||||
prop->data.pointer = MEM_mallocN((size_t)val->string.len, "id property string 2");
|
||||
prop->len = prop->totallen = val->string.len;
|
||||
memcpy(prop->data.pointer, st, val->string.len);
|
||||
memcpy(prop->data.pointer, st, (size_t)val->string.len);
|
||||
}
|
||||
prop->subtype = IDP_STRING_SUB_BYTE;
|
||||
}
|
||||
@@ -932,10 +946,10 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
|
||||
prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
|
||||
}
|
||||
else {
|
||||
int stlen = strlen(st) + 1;
|
||||
prop->data.pointer = MEM_mallocN(stlen, "id property string 3");
|
||||
int stlen = (int)strlen(st) + 1;
|
||||
prop->data.pointer = MEM_mallocN((size_t)stlen, "id property string 3");
|
||||
prop->len = prop->totallen = stlen;
|
||||
memcpy(prop->data.pointer, st, stlen);
|
||||
memcpy(prop->data.pointer, st, (size_t)stlen);
|
||||
}
|
||||
prop->subtype = IDP_STRING_SUB_UTF8;
|
||||
}
|
||||
|
@@ -1058,12 +1058,15 @@ static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode
|
||||
}
|
||||
}
|
||||
|
||||
void init_render_material(Material *mat, int r_mode, float *amb)
|
||||
void init_render_material(Material *mat,
|
||||
bNodeTreeExecPool *exec_tree_pool,
|
||||
int r_mode, float *amb)
|
||||
{
|
||||
|
||||
do_init_render_material(mat, r_mode, amb);
|
||||
|
||||
|
||||
if (mat->nodetree && mat->use_nodes) {
|
||||
struct bNodeTreeExec *exec_data;
|
||||
/* mode_l will take the pipeline options from the main material, and the or-ed
|
||||
* result of non-pipeline options from the nodes. shadeless is an exception,
|
||||
* mode_l will have it set when all node materials are shadeless. */
|
||||
@@ -1074,9 +1077,15 @@ void init_render_material(Material *mat, int r_mode, float *amb)
|
||||
ntreeShaderGetTexcoMode(mat->nodetree, r_mode, &mat->texco, &mat->mode_l);
|
||||
|
||||
init_render_nodetree(mat->nodetree, mat, r_mode, amb);
|
||||
|
||||
if (!mat->nodetree->execdata)
|
||||
mat->nodetree->execdata = ntreeShaderBeginExecTree(mat->nodetree);
|
||||
|
||||
exec_data = BKE_node_tree_exec_pool_get(exec_tree_pool,
|
||||
&mat->nodetree->id);
|
||||
if (exec_data == NULL) {
|
||||
exec_data = ntreeShaderBeginExecTree(mat->nodetree);
|
||||
BKE_node_tree_exec_pool_put(exec_tree_pool,
|
||||
&mat->nodetree->id,
|
||||
exec_data);
|
||||
}
|
||||
}
|
||||
else {
|
||||
mat->mode_l = mat->mode;
|
||||
@@ -1087,7 +1096,9 @@ void init_render_material(Material *mat, int r_mode, float *amb)
|
||||
}
|
||||
}
|
||||
|
||||
void init_render_materials(Main *bmain, int r_mode, float *amb)
|
||||
void init_render_materials(Main *bmain,
|
||||
bNodeTreeExecPool *exec_tree_pool,
|
||||
int r_mode, float *amb)
|
||||
{
|
||||
Material *ma;
|
||||
|
||||
@@ -1106,27 +1117,32 @@ void init_render_materials(Main *bmain, int r_mode, float *amb)
|
||||
/* is_used flag comes back in convertblender.c */
|
||||
ma->flag &= ~MA_IS_USED;
|
||||
if (ma->id.us)
|
||||
init_render_material(ma, r_mode, amb);
|
||||
init_render_material(ma, exec_tree_pool, r_mode, amb);
|
||||
}
|
||||
|
||||
init_render_material(&defmaterial, r_mode, amb);
|
||||
init_render_material(&defmaterial, exec_tree_pool, r_mode, amb);
|
||||
}
|
||||
|
||||
/* only needed for nodes now */
|
||||
void end_render_material(Material *mat)
|
||||
void end_render_material(bNodeTreeExecPool *exec_tree_pool,
|
||||
Material *mat)
|
||||
{
|
||||
if (mat && mat->nodetree && mat->use_nodes) {
|
||||
if (mat->nodetree->execdata)
|
||||
ntreeShaderEndExecTree(mat->nodetree->execdata);
|
||||
struct bNodeTreeExec *exec_data;
|
||||
exec_data = BKE_node_tree_exec_pool_pop(exec_tree_pool,
|
||||
&mat->nodetree->id);
|
||||
if (exec_data != NULL) {
|
||||
ntreeShaderEndExecTree(exec_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void end_render_materials(Main *bmain)
|
||||
void end_render_materials(Main *bmain, bNodeTreeExecPool *exec_tree_pool)
|
||||
{
|
||||
Material *ma;
|
||||
for (ma = bmain->mat.first; ma; ma = ma->id.next)
|
||||
if (ma->id.us)
|
||||
end_render_material(ma);
|
||||
end_render_material(exec_tree_pool, ma);
|
||||
}
|
||||
|
||||
static bool material_in_nodetree(bNodeTree *ntree, Material *mat)
|
||||
|
@@ -525,6 +525,15 @@ static bool put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, i
|
||||
}
|
||||
}
|
||||
|
||||
static bool moviecache_check_free_proxy(ImBuf *UNUSED(ibuf),
|
||||
void *userkey,
|
||||
void *UNUSED(userdata))
|
||||
{
|
||||
MovieClipImBufCacheKey *key = (MovieClipImBufCacheKey *)userkey;
|
||||
|
||||
return !(key->proxy == IMB_PROXY_NONE && key->render_flag == 0);
|
||||
}
|
||||
|
||||
/*********************** common functions *************************/
|
||||
|
||||
/* only image block itself */
|
||||
@@ -1167,6 +1176,15 @@ void BKE_movieclip_clear_cache(MovieClip *clip)
|
||||
free_buffers(clip);
|
||||
}
|
||||
|
||||
void BKE_movieclip_clear_proxy_cache(MovieClip *clip)
|
||||
{
|
||||
if (clip->cache && clip->cache->moviecache) {
|
||||
IMB_moviecache_cleanup(clip->cache->moviecache,
|
||||
moviecache_check_free_proxy,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_movieclip_reload(MovieClip *clip)
|
||||
{
|
||||
/* clear cache */
|
||||
|
@@ -46,11 +46,12 @@
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_linestyle_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_ghash.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLF_translation.h"
|
||||
|
||||
@@ -1129,9 +1130,6 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
|
||||
|
||||
id_us_plus((ID *)newtree->gpd);
|
||||
|
||||
/* in case a running nodetree is copied */
|
||||
newtree->execdata = NULL;
|
||||
|
||||
BLI_listbase_clear(&newtree->nodes);
|
||||
BLI_listbase_clear(&newtree->links);
|
||||
|
||||
@@ -1625,13 +1623,7 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat
|
||||
|
||||
if (ntree->typeinfo->free_node_cache)
|
||||
ntree->typeinfo->free_node_cache(ntree, node);
|
||||
|
||||
/* texture node has bad habit of keeping exec data around */
|
||||
if (ntree->type == NTREE_TEXTURE && ntree->execdata) {
|
||||
ntreeTexEndExecTree(ntree->execdata);
|
||||
ntree->execdata = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (node->typeinfo->freefunc)
|
||||
node->typeinfo->freefunc(node);
|
||||
}
|
||||
@@ -1705,24 +1697,7 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const bool do_id_user)
|
||||
bNodeSocket *sock, *nextsock;
|
||||
|
||||
if (ntree == NULL) return;
|
||||
|
||||
/* XXX hack! node trees should not store execution graphs at all.
|
||||
* This should be removed when old tree types no longer require it.
|
||||
* Currently the execution data for texture nodes remains in the tree
|
||||
* after execution, until the node tree is updated or freed.
|
||||
*/
|
||||
if (ntree->execdata) {
|
||||
switch (ntree->type) {
|
||||
case NTREE_SHADER:
|
||||
ntreeShaderEndExecTree(ntree->execdata);
|
||||
break;
|
||||
case NTREE_TEXTURE:
|
||||
ntreeTexEndExecTree(ntree->execdata);
|
||||
ntree->execdata = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* XXX not nice, but needed to free localized node groups properly */
|
||||
free_localized_node_groups(ntree);
|
||||
|
||||
@@ -3716,3 +3691,47 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Node execution. */
|
||||
|
||||
typedef struct bNodeTreeExecPool {
|
||||
GHash *hash;
|
||||
} bNodeTreeExecPool;
|
||||
|
||||
struct bNodeTreeExecPool *BKE_node_tree_exec_pool_new(void)
|
||||
{
|
||||
bNodeTreeExecPool *pool;
|
||||
pool = MEM_callocN(sizeof(bNodeTreeExecPool), __func__);
|
||||
pool->hash = BLI_ghash_ptr_new(__func__);
|
||||
return pool;
|
||||
}
|
||||
|
||||
void BKE_node_tree_exec_pool_free(bNodeTreeExecPool *pool)
|
||||
{
|
||||
/* Only destroys pool, all exec data is expected to be freed already. */
|
||||
BLI_assert(pool != NULL);
|
||||
BLI_ghash_free(pool->hash, NULL, NULL);
|
||||
MEM_freeN(pool);
|
||||
}
|
||||
|
||||
void BKE_node_tree_exec_pool_put(bNodeTreeExecPool *pool,
|
||||
struct ID *id,
|
||||
void *data)
|
||||
{
|
||||
BLI_assert(pool != NULL);
|
||||
BLI_ghash_insert(pool->hash, id, data);
|
||||
}
|
||||
|
||||
void *BKE_node_tree_exec_pool_get(bNodeTreeExecPool *pool,
|
||||
struct ID *id)
|
||||
{
|
||||
BLI_assert(pool != NULL);
|
||||
return BLI_ghash_lookup(pool->hash, id);
|
||||
}
|
||||
|
||||
void *BKE_node_tree_exec_pool_pop(bNodeTreeExecPool *pool,
|
||||
struct ID *id)
|
||||
{
|
||||
BLI_assert(pool != NULL);
|
||||
return BLI_ghash_popkey(pool->hash, id, NULL);
|
||||
}
|
||||
|
@@ -2571,12 +2571,19 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
|
||||
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
|
||||
ptcache_path(pid, path);
|
||||
|
||||
len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
|
||||
|
||||
dir = opendir(path);
|
||||
if (dir==NULL)
|
||||
return;
|
||||
|
||||
|
||||
len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
|
||||
/* append underscore terminator to ensure we don't match similar names
|
||||
* from objects whose names start with the same prefix
|
||||
*/
|
||||
if (len < sizeof(filename) - 2) {
|
||||
BLI_strncpy(filename + len, "_", sizeof(filename) - 2 - len);
|
||||
len += 1;
|
||||
}
|
||||
|
||||
BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
|
||||
|
||||
while ((de = readdir(dir)) != NULL) {
|
||||
|
@@ -2529,6 +2529,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
|
||||
int do_seq;
|
||||
// bool have_seq = false; /* UNUSED */
|
||||
bool have_comp = false;
|
||||
bool use_gpencil = true;
|
||||
Scene *scene;
|
||||
int is_thread_main = BLI_thread_is_main();
|
||||
|
||||
@@ -2553,6 +2554,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
|
||||
BKE_scene_camera_switch_update(scene);
|
||||
camera = scene->camera;
|
||||
}
|
||||
|
||||
if (seq->flag & SEQ_SCENE_NO_GPENCIL) {
|
||||
use_gpencil = false;
|
||||
}
|
||||
|
||||
if (have_comp == false && camera == NULL) {
|
||||
scene->r.cfra = oldcfra;
|
||||
@@ -2586,7 +2591,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
|
||||
ibuf = sequencer_view3d_cb(scene, camera, width, height, IB_rect,
|
||||
context->scene->r.seq_prev_type,
|
||||
(context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0,
|
||||
true, scene->r.alphamode, err_out);
|
||||
use_gpencil, true, scene->r.alphamode, err_out);
|
||||
if (ibuf == NULL) {
|
||||
fprintf(stderr, "seq_render_scene_strip failed to get opengl buffer: %s\n", err_out);
|
||||
}
|
||||
|
@@ -407,7 +407,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
|
||||
CCGFace **faceMap;
|
||||
MTFace *tf;
|
||||
MLoopUV *mluv;
|
||||
CCGFaceIterator *fi;
|
||||
CCGFaceIterator fi;
|
||||
int index, gridSize, gridFaces, /*edgeSize,*/ totface, x, y, S;
|
||||
MLoopUV *dmloopuv = CustomData_get_layer_n(&dm->loopData, CD_MLOOPUV, n);
|
||||
/* need to update both CD_MTFACE & CD_MLOOPUV, hrmf, we could get away with
|
||||
@@ -434,11 +434,10 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
|
||||
|
||||
/* make a map from original faces to CCGFaces */
|
||||
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
|
||||
for (fi = ccgSubSurf_getFaceIterator(uvss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(uvss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
|
||||
}
|
||||
ccgFaceIterator_free(fi);
|
||||
|
||||
/* load coordinates from uvss into tface */
|
||||
tf = tface;
|
||||
@@ -695,9 +694,9 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
|
||||
{
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
CCGVertIterator *vi;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGFaceIterator *fi;
|
||||
CCGVertIterator vi;
|
||||
CCGEdgeIterator ei;
|
||||
CCGFaceIterator fi;
|
||||
CCGKey key;
|
||||
int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
int gridSize = ccgSubSurf_getGridSize(ss);
|
||||
@@ -707,25 +706,23 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
|
||||
if (!ccgSubSurf_getNumVerts(ss))
|
||||
r_min[0] = r_min[1] = r_min[2] = r_max[0] = r_max[1] = r_max[2] = 0.0;
|
||||
|
||||
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
float *co = ccgSubSurf_getVertData(ss, v);
|
||||
|
||||
minmax_v3_v3v3(co, r_min, r_max);
|
||||
}
|
||||
ccgVertIterator_free(vi);
|
||||
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
|
||||
|
||||
for (i = 0; i < edgeSize; i++)
|
||||
minmax_v3_v3v3(CCG_elem_offset_co(&key, edgeData, i), r_min, r_max);
|
||||
}
|
||||
ccgEdgeIterator_free(ei);
|
||||
|
||||
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
|
||||
|
||||
for (S = 0; S < numVerts; S++) {
|
||||
@@ -736,7 +733,6 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float r_min[3], float r_max[3])
|
||||
minmax_v3_v3v3(CCG_grid_elem_co(&key, faceGridData, x, y), r_min, r_max);
|
||||
}
|
||||
}
|
||||
ccgFaceIterator_free(fi);
|
||||
}
|
||||
|
||||
static int ccgDM_getNumVerts(DerivedMesh *dm)
|
||||
@@ -1429,9 +1425,9 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
|
||||
int edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
int gridSize = ccgSubSurf_getGridSize(ss);
|
||||
int i;
|
||||
CCGVertIterator *vi;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGFaceIterator *fi;
|
||||
CCGVertIterator vi;
|
||||
CCGEdgeIterator ei;
|
||||
CCGFaceIterator fi;
|
||||
CCGFace **faceMap2;
|
||||
CCGEdge **edgeMap2;
|
||||
CCGVert **vertMap2;
|
||||
@@ -1439,30 +1435,27 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
|
||||
|
||||
totvert = ccgSubSurf_getNumVerts(ss);
|
||||
vertMap2 = MEM_mallocN(totvert * sizeof(*vertMap2), "vertmap");
|
||||
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
|
||||
vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v;
|
||||
}
|
||||
ccgVertIterator_free(vi);
|
||||
|
||||
totedge = ccgSubSurf_getNumEdges(ss);
|
||||
edgeMap2 = MEM_mallocN(totedge * sizeof(*edgeMap2), "edgemap");
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss), i = 0; !ccgEdgeIterator_isStopped(ei); i++, ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei), i = 0; !ccgEdgeIterator_isStopped(&ei); i++, ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
|
||||
edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
|
||||
}
|
||||
ccgEdgeIterator_free(ei);
|
||||
|
||||
totface = ccgSubSurf_getNumFaces(ss);
|
||||
faceMap2 = MEM_mallocN(totface * sizeof(*faceMap2), "facemap");
|
||||
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
|
||||
faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
|
||||
}
|
||||
ccgFaceIterator_free(fi);
|
||||
|
||||
i = 0;
|
||||
for (index = 0; index < totface; index++) {
|
||||
@@ -1512,12 +1505,12 @@ static void ccgDM_foreachMappedVert(
|
||||
DMForeachFlag flag)
|
||||
{
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGVertIterator *vi;
|
||||
CCGVertIterator vi;
|
||||
CCGKey key;
|
||||
CCG_key_top_level(&key, ccgdm->ss);
|
||||
|
||||
for (vi = ccgSubSurf_getVertIterator(ccgdm->ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ccgdm->ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
const int index = ccgDM_getVertMapIndex(ccgdm->ss, v);
|
||||
|
||||
if (index != -1) {
|
||||
@@ -1526,8 +1519,6 @@ static void ccgDM_foreachMappedVert(
|
||||
func(userData, index, CCG_elem_co(&key, vd), no, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
ccgVertIterator_free(vi);
|
||||
}
|
||||
|
||||
static void ccgDM_foreachMappedEdge(
|
||||
@@ -1537,14 +1528,14 @@ static void ccgDM_foreachMappedEdge(
|
||||
{
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGEdgeIterator ei;
|
||||
CCGKey key;
|
||||
int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
|
||||
CCG_key_top_level(&key, ss);
|
||||
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
const int index = ccgDM_getEdgeMapIndex(ss, e);
|
||||
|
||||
if (index != -1) {
|
||||
@@ -1554,8 +1545,6 @@ static void ccgDM_foreachMappedEdge(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ccgEdgeIterator_free(ei);
|
||||
}
|
||||
|
||||
static void ccgDM_foreachMappedLoop(
|
||||
@@ -1593,28 +1582,26 @@ static void ccgDM_drawVerts(DerivedMesh *dm)
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
int edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
int gridSize = ccgSubSurf_getGridSize(ss);
|
||||
CCGVertIterator *vi;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGFaceIterator *fi;
|
||||
CCGVertIterator vi;
|
||||
CCGEdgeIterator ei;
|
||||
CCGFaceIterator fi;
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
glVertex3fv(ccgSubSurf_getVertData(ss, v));
|
||||
}
|
||||
ccgVertIterator_free(vi);
|
||||
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
int x;
|
||||
|
||||
for (x = 1; x < edgeSize - 1; x++)
|
||||
glVertex3fv(ccgSubSurf_getEdgeData(ss, e, x));
|
||||
}
|
||||
ccgEdgeIterator_free(ei);
|
||||
|
||||
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
|
||||
|
||||
glVertex3fv(ccgSubSurf_getFaceCenterData(f));
|
||||
@@ -1626,7 +1613,6 @@ static void ccgDM_drawVerts(DerivedMesh *dm)
|
||||
for (x = 1; x < gridSize - 1; x++)
|
||||
glVertex3fv(ccgSubSurf_getFaceGridData(ss, f, S, x, y));
|
||||
}
|
||||
ccgFaceIterator_free(fi);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
@@ -2749,15 +2735,15 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm,
|
||||
{
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGEdgeIterator ei;
|
||||
CCGKey key;
|
||||
int i, useAging, edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
|
||||
CCG_key_top_level(&key, ss);
|
||||
ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
|
||||
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
|
||||
int index = ccgDM_getEdgeMapIndex(ss, e);
|
||||
|
||||
@@ -2775,8 +2761,6 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm,
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
ccgEdgeIterator_free(ei);
|
||||
}
|
||||
|
||||
static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
|
||||
@@ -2787,14 +2771,14 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
CCGKey key;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGEdgeIterator ei;
|
||||
int i, useAging, edgeSize = ccgSubSurf_getEdgeSize(ss);
|
||||
|
||||
CCG_key_top_level(&key, ss);
|
||||
ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
|
||||
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
CCGElem *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
|
||||
int index = ccgDM_getEdgeMapIndex(ss, e);
|
||||
|
||||
@@ -2813,8 +2797,6 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm,
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
ccgEdgeIterator_free(ei);
|
||||
}
|
||||
|
||||
static void ccgDM_foreachMappedFaceCenter(
|
||||
@@ -2826,12 +2808,12 @@ static void ccgDM_foreachMappedFaceCenter(
|
||||
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
|
||||
CCGSubSurf *ss = ccgdm->ss;
|
||||
CCGKey key;
|
||||
CCGFaceIterator *fi;
|
||||
CCGFaceIterator fi;
|
||||
|
||||
CCG_key_top_level(&key, ss);
|
||||
|
||||
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
const int index = ccgDM_getFaceMapIndex(ss, f);
|
||||
|
||||
if (index != -1) {
|
||||
@@ -2841,8 +2823,6 @@ static void ccgDM_foreachMappedFaceCenter(
|
||||
func(userData, index, CCG_elem_co(&key, vd), no);
|
||||
}
|
||||
}
|
||||
|
||||
ccgFaceIterator_free(fi);
|
||||
}
|
||||
|
||||
static void ccgDM_release(DerivedMesh *dm)
|
||||
@@ -3438,9 +3418,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
DerivedMesh *dm)
|
||||
{
|
||||
CCGDerivedMesh *ccgdm = MEM_callocN(sizeof(*ccgdm), "ccgdm");
|
||||
CCGVertIterator *vi;
|
||||
CCGEdgeIterator *ei;
|
||||
CCGFaceIterator *fi;
|
||||
CCGVertIterator vi;
|
||||
CCGEdgeIterator ei;
|
||||
CCGFaceIterator fi;
|
||||
int index, totvert, totedge, totface;
|
||||
int i;
|
||||
int vertNum, edgeNum, faceNum;
|
||||
@@ -3573,30 +3553,27 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
|
||||
totvert = ccgSubSurf_getNumVerts(ss);
|
||||
ccgdm->vertMap = MEM_mallocN(totvert * sizeof(*ccgdm->vertMap), "vertMap");
|
||||
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
|
||||
ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v;
|
||||
}
|
||||
ccgVertIterator_free(vi);
|
||||
|
||||
totedge = ccgSubSurf_getNumEdges(ss);
|
||||
ccgdm->edgeMap = MEM_mallocN(totedge * sizeof(*ccgdm->edgeMap), "edgeMap");
|
||||
for (ei = ccgSubSurf_getEdgeIterator(ss); !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
|
||||
for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); ccgEdgeIterator_next(&ei)) {
|
||||
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
|
||||
|
||||
ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
|
||||
}
|
||||
ccgEdgeIterator_free(ei);
|
||||
|
||||
totface = ccgSubSurf_getNumFaces(ss);
|
||||
ccgdm->faceMap = MEM_mallocN(totface * sizeof(*ccgdm->faceMap), "faceMap");
|
||||
for (fi = ccgSubSurf_getFaceIterator(ss); !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(fi);
|
||||
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
|
||||
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
|
||||
|
||||
ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))].face = f;
|
||||
}
|
||||
ccgFaceIterator_free(fi);
|
||||
|
||||
ccgdm->reverseFaceMap = MEM_callocN(sizeof(int) * ccgSubSurf_getNumFinalFaces(ss), "reverseFaceMap");
|
||||
|
||||
@@ -4001,13 +3978,13 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
|
||||
*/
|
||||
CCGSubSurf *ss = _getSubSurf(NULL, 1, 3, CCG_USE_ARENA);
|
||||
float edge_sum[3], face_sum[3];
|
||||
CCGVertIterator *vi;
|
||||
CCGVertIterator vi;
|
||||
DerivedMesh *dm = CDDM_from_mesh(me);
|
||||
|
||||
ss_sync_from_derivedmesh(ss, dm, NULL, 0);
|
||||
|
||||
for (vi = ccgSubSurf_getVertIterator(ss); !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(vi);
|
||||
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
|
||||
CCGVert *v = ccgVertIterator_getCurrent(&vi);
|
||||
int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
|
||||
int N = ccgSubSurf_getVertNumEdges(v);
|
||||
int numFaces = ccgSubSurf_getVertNumFaces(v);
|
||||
@@ -4036,7 +4013,6 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
|
||||
r_positions[idx][1] = (co[1] * N * N + edge_sum[1] * 4 + face_sum[1]) / (N * (N + 5));
|
||||
r_positions[idx][2] = (co[2] * N * N + edge_sum[2] * 4 + face_sum[2]) / (N * (N + 5));
|
||||
}
|
||||
ccgVertIterator_free(vi);
|
||||
|
||||
ccgSubSurf_free(ss);
|
||||
|
||||
|
@@ -835,10 +835,7 @@ Tex *BKE_texture_copy(Tex *tex)
|
||||
if (texn->ot) texn->ot = BKE_copy_oceantex(texn->ot);
|
||||
if (tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
|
||||
|
||||
if (tex->nodetree) {
|
||||
if (tex->nodetree->execdata) {
|
||||
ntreeTexEndExecTree(tex->nodetree->execdata);
|
||||
}
|
||||
if (tex->nodetree != NULL) {
|
||||
texn->nodetree = ntreeCopyTree(tex->nodetree);
|
||||
}
|
||||
|
||||
|
@@ -383,13 +383,17 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
|
||||
int frame = BKE_movieclip_remap_scene_to_clip_frame(
|
||||
context->clips[options->clip_index],
|
||||
context->user.framenr);
|
||||
bool has_marker;
|
||||
|
||||
if (libmv_autoTrackGetMarker(context->autotrack,
|
||||
options->clip_index,
|
||||
frame,
|
||||
options->track_index,
|
||||
&libmv_current_marker))
|
||||
{
|
||||
BLI_spin_lock(&context->spin_lock);
|
||||
has_marker = libmv_autoTrackGetMarker(context->autotrack,
|
||||
options->clip_index,
|
||||
frame,
|
||||
options->track_index,
|
||||
&libmv_current_marker);
|
||||
BLI_spin_unlock(&context->spin_lock);
|
||||
|
||||
if (has_marker) {
|
||||
if (!tracking_check_marker_margin(&libmv_current_marker,
|
||||
options->track->margin,
|
||||
context->frame_width,
|
||||
@@ -427,7 +431,7 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
|
||||
}
|
||||
else {
|
||||
options->is_failed = true;
|
||||
options->failed_frame = frame;
|
||||
options->failed_frame = frame + frame_delta;
|
||||
}
|
||||
ok = true;
|
||||
}
|
||||
@@ -442,11 +446,11 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
|
||||
|
||||
void BKE_autotrack_context_sync(AutoTrackContext *context)
|
||||
{
|
||||
int newframe = context->user.framenr,
|
||||
frame_delta = context->backwards ? -1 : 1;
|
||||
int newframe, frame_delta = context->backwards ? -1 : 1;
|
||||
int clip, frame;
|
||||
|
||||
BLI_spin_lock(&context->spin_lock);
|
||||
newframe = context->user.framenr;
|
||||
for (frame = context->sync_frame;
|
||||
frame != (context->backwards ? newframe - 1 : newframe + 1);
|
||||
frame += frame_delta)
|
||||
@@ -459,22 +463,18 @@ void BKE_autotrack_context_sync(AutoTrackContext *context)
|
||||
AutoTrackOptions *options = &context->options[track];
|
||||
int track_frame = BKE_movieclip_remap_scene_to_clip_frame(
|
||||
context->clips[options->clip_index], frame);
|
||||
if (options->is_failed) {
|
||||
if (options->failed_frame == track_frame) {
|
||||
MovieTrackingMarker *prev_marker =
|
||||
BKE_tracking_marker_get_exact(
|
||||
options->track,
|
||||
frame);
|
||||
if (prev_marker) {
|
||||
marker = *prev_marker;
|
||||
marker.framenr = context->backwards ?
|
||||
track_frame - 1 :
|
||||
track_frame + 1;
|
||||
marker.flag |= MARKER_DISABLED;
|
||||
BKE_tracking_marker_insert(options->track, &marker);
|
||||
}
|
||||
if (options->is_failed && options->failed_frame == track_frame) {
|
||||
MovieTrackingMarker *prev_marker =
|
||||
BKE_tracking_marker_get_exact(options->track, frame);
|
||||
if (prev_marker) {
|
||||
marker = *prev_marker;
|
||||
marker.framenr = context->backwards ?
|
||||
track_frame - 1 :
|
||||
track_frame + 1;
|
||||
marker.flag |= MARKER_DISABLED;
|
||||
BKE_tracking_marker_insert(options->track, &marker);
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (libmv_autoTrackGetMarker(context->autotrack,
|
||||
clip,
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "DNA_texture_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_listbase.h"
|
||||
|
||||
#include "BKE_animsys.h"
|
||||
#include "BKE_global.h"
|
||||
@@ -138,6 +139,8 @@ World *BKE_world_copy(World *wrld)
|
||||
if (wrld->preview)
|
||||
wrldn->preview = BKE_previewimg_copy(wrld->preview);
|
||||
|
||||
BLI_listbase_clear(&wrldn->gpumaterial);
|
||||
|
||||
return wrldn;
|
||||
}
|
||||
|
||||
@@ -162,6 +165,8 @@ World *localize_world(World *wrld)
|
||||
|
||||
wrldn->preview = NULL;
|
||||
|
||||
BLI_listbase_clear(&wrldn->gpumaterial);
|
||||
|
||||
return wrldn;
|
||||
}
|
||||
|
||||
|
@@ -51,9 +51,9 @@
|
||||
}))
|
||||
|
||||
#else
|
||||
# define CHECK_TYPE(var, type)
|
||||
# define CHECK_TYPE_PAIR(var_a, var_b)
|
||||
# define CHECK_TYPE_PAIR_INLINE(var_a, var_b) (void)0
|
||||
# define CHECK_TYPE(var, type) { EXPR_NOP(var); }(void)0
|
||||
# define CHECK_TYPE_PAIR(var_a, var_b) { (EXPR_NOP(var_a), EXPR_NOP(var_b)); }(void)0
|
||||
# define CHECK_TYPE_PAIR_INLINE(var_a, var_b) (EXPR_NOP(var_a), EXPR_NOP(var_b))
|
||||
#endif
|
||||
|
||||
/* can be used in simple macros */
|
||||
@@ -66,10 +66,15 @@
|
||||
((void)(((type)0) != (0 ? (val) : ((type)0))))
|
||||
#endif
|
||||
|
||||
#define CHECK_TYPE_NONCONST(var) { \
|
||||
void *non_const = 0 ? (var) : NULL; \
|
||||
(void)non_const; \
|
||||
} (void)0
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define CHECK_TYPE_NONCONST(var) __extension__ ({ \
|
||||
void *non_const = 0 ? (var) : NULL; \
|
||||
(void)non_const; \
|
||||
})
|
||||
#else
|
||||
# define CHECK_TYPE_NONCONST(var) EXPR_NOP(var)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* CHECK_TYPE_ANY: handy macro, eg:
|
||||
|
@@ -26,7 +26,6 @@
|
||||
/** \file BLI_edgehash.h
|
||||
* \ingroup bli
|
||||
* \author Daniel Dunbar
|
||||
* \brief A general unordered 2-int pair hash table ADT.
|
||||
*/
|
||||
|
||||
#include "BLI_compiler_attrs.h"
|
||||
@@ -55,6 +54,9 @@ bool BLI_edgehash_reinsert(EdgeHash *eh, unsigned int v0, unsigned in
|
||||
void *BLI_edgehash_lookup(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_edgehash_lookup_default(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val_default) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_edgehash_lookup_p(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgehash_remove(EdgeHash *eh, unsigned int v0, unsigned int v1, EdgeHashFreeFP valfreefp);
|
||||
|
||||
void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
|
||||
int BLI_edgehash_size(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP valfreefp,
|
||||
|
@@ -30,7 +30,6 @@
|
||||
|
||||
/** \file BLI_ghash.h
|
||||
* \ingroup bli
|
||||
* \brief A general (pointer -> pointer) hash table ADT
|
||||
*/
|
||||
|
||||
#include "BLI_sys_types.h" /* for bool */
|
||||
@@ -41,6 +40,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned int (*GHashHashFP) (const void *key);
|
||||
/** returns false when equal */
|
||||
typedef bool (*GHashCmpFP) (const void *a, const void *b);
|
||||
typedef void (*GHashKeyFreeFP) (void *key);
|
||||
typedef void (*GHashValFreeFP) (void *val);
|
||||
|
@@ -37,6 +37,7 @@ typedef void (*HeapFreeFP)(void *ptr);
|
||||
* are recycled, so memory usage will not shrink. */
|
||||
Heap *BLI_heap_new_ex(unsigned int tot_reserve) ATTR_WARN_UNUSED_RESULT;
|
||||
Heap *BLI_heap_new(void) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_heap_clear(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
|
||||
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
|
||||
|
||||
/* Insert heap node with a value (often a 'cost') and pointer into the heap,
|
||||
|
@@ -77,6 +77,7 @@ float volume_tetrahedron_signed_v3(const float v1[3], const float v2[3], const f
|
||||
bool is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
|
||||
bool is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
|
||||
bool is_poly_convex_v2(const float verts[][2], unsigned int nr);
|
||||
int is_quad_flip_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
|
||||
|
||||
/********************************* Distance **********************************/
|
||||
|
||||
|
@@ -37,4 +37,7 @@ void BLI_polyfill_calc(
|
||||
const int coords_sign,
|
||||
unsigned int (*r_tris)[3]);
|
||||
|
||||
/* default size of polyfill arena */
|
||||
#define BLI_POLYFILL_ARENA_SIZE MEM_SIZE_OPTIMAL(1 << 14)
|
||||
|
||||
#endif /* __BLI_POLYFILL2D_H__ */
|
||||
|
39
source/blender/blenlib/BLI_polyfill2d_beautify.h
Normal file
39
source/blender/blenlib/BLI_polyfill2d_beautify.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* ***** 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.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __BLI_POLYFILL2D_BEAUTIFY_H__
|
||||
#define __BLI_POLYFILL2D_BEAUTIFY_H__
|
||||
|
||||
struct EdgeHash;
|
||||
struct Heap;
|
||||
struct MemArena;
|
||||
|
||||
void BLI_polyfill_beautify(
|
||||
const float (*coords)[2],
|
||||
const unsigned int coords_tot,
|
||||
unsigned int (*tris)[3],
|
||||
|
||||
/* structs for reuse */
|
||||
struct MemArena *arena, struct Heap *eheap, struct EdgeHash *eh);
|
||||
|
||||
/* avoid realloc's when creating new structures for polyfill ngons */
|
||||
#define BLI_POLYFILL_ALLOC_NGON_RESERVE 64
|
||||
|
||||
#endif /* __BLI_POLYFILL2D_BEAUTIFY_H__ */
|
@@ -52,7 +52,7 @@ typedef struct SmallHash {
|
||||
} SmallHash;
|
||||
|
||||
typedef struct {
|
||||
SmallHash *sh;
|
||||
const SmallHash *sh;
|
||||
unsigned int i;
|
||||
} SmallHashIter;
|
||||
|
||||
@@ -61,13 +61,16 @@ void BLI_smallhash_init_ex(SmallHash *sh,
|
||||
void BLI_smallhash_init(SmallHash *sh) ATTR_NONNULL(1);
|
||||
void BLI_smallhash_release(SmallHash *sh) ATTR_NONNULL(1);
|
||||
void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1);
|
||||
bool BLI_smallhash_reinsert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1);
|
||||
bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
|
||||
void *BLI_smallhash_lookup(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_smallhash_lookup_p(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_smallhash_haskey(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
|
||||
int BLI_smallhash_count(SmallHash *sh) ATTR_NONNULL(1);
|
||||
void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1);
|
||||
int BLI_smallhash_count(const SmallHash *sh) ATTR_NONNULL(1);
|
||||
void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_smallhash_iternew(SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_smallhash_iternew_p(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
|
||||
/* void BLI_smallhash_print(SmallHash *sh); */ /* UNUSED */
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@@ -219,6 +219,8 @@ extern "C" {
|
||||
/* reusable ELEM macro */
|
||||
#define ELEM(...) VA_NARGS_CALL_OVERLOAD(_VA_ELEM, __VA_ARGS__)
|
||||
|
||||
/* no-op for expressions we don't want to instansiate, but must remian valid */
|
||||
#define EXPR_NOP(expr) (void)(0 ? ((void)(expr), 1) : 0)
|
||||
|
||||
/* shift around elements */
|
||||
#define SHIFT3(type, a, b, c) { \
|
||||
|
@@ -85,6 +85,7 @@ set(SRC
|
||||
intern/noise.c
|
||||
intern/path_util.c
|
||||
intern/polyfill2d.c
|
||||
intern/polyfill2d_beautify.c
|
||||
intern/quadric.c
|
||||
intern/rand.c
|
||||
intern/rct.c
|
||||
@@ -161,6 +162,7 @@ set(SRC
|
||||
BLI_noise.h
|
||||
BLI_path_util.h
|
||||
BLI_polyfill2d.h
|
||||
BLI_polyfill2d_beautify.h
|
||||
BLI_quadric.h
|
||||
BLI_rand.h
|
||||
BLI_rect.h
|
||||
@@ -189,13 +191,6 @@ set(SRC
|
||||
PIL_time_utildefines.h
|
||||
)
|
||||
|
||||
if(WITH_BINRELOC)
|
||||
list(APPEND INC_SYS
|
||||
${BINRELOC_INCLUDE_DIRS}
|
||||
)
|
||||
add_definitions(-DWITH_BINRELOC)
|
||||
endif()
|
||||
|
||||
if(WITH_MEM_VALGRIND)
|
||||
add_definitions(-DWITH_MEM_VALGRIND)
|
||||
endif()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user