diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-12-05 06:12:49 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-12-05 06:12:49 +0400 |
commit | 3197796cf7aa4f1c34f2e68a2eca9d6a412a51d0 (patch) | |
tree | 5a0a119149b1079f888178bc2df3d15950c2f9b9 | |
parent | 43c5e1b58030322096770b1aa4d91077793cd2c4 (diff) | |
parent | eb233d933223a3795f3ff5204c4412f7a0fd6782 (diff) |
Merged changes in the trunk up to revision 42425.
Conflicts resolved:
doc/python_api/sphinx_doc_gen.py
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/space_view3d/drawobject.c
343 files changed, 8803 insertions, 6315 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f8e72f7494..eaa75ddb1f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -857,14 +857,23 @@ elseif(WIN32) if(WITH_BOOST) set(BOOST ${LIBDIR}/boost) set(BOOST_INCLUDE_DIR ${BOOST}/include) - set(BOOST_POSTFIX "vc90-mt-s-1_47.lib") - set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_47.lib") + if(MSVC10) + set(BOOST_POSTFIX "vc100-mt-s-1_47.lib") + set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_47.lib") + else() + set(BOOST_POSTFIX "vc90-mt-s-1_47.lib") + set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_47.lib") + endif() set(BOOST_LIBRARIES - optimized libboost_date_time-${BOOST_POSTFIX} libboost_filesystem-${BOOST_POSTFIX} - libboost_regex-${BOOST_POSTFIX} libboost_system-${BOOST_POSTFIX} libboost_thread-${BOOST_POSTFIX} - debug libboost_date_time-${BOOST_DEBUG_POSTFIX} libboost_filesystem-${BOOST_DEBUG_POSTFIX} - libboost_regex-${BOOST_DEBUG_POSTFIX} libboost_system-${BOOST_DEBUG_POSTFIX} libboost_thread-${BOOST_DEBUG_POSTFIX}) - set(BOOST_LIBPATH ${BOOST}/lib) + optimized libboost_date_time-${BOOST_POSTFIX} optimized libboost_filesystem-${BOOST_POSTFIX} + optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX} + debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX} + debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX}) + if(MSVC10) + set(BOOST_LIBPATH ${BOOST}/lib/vc_10) + else() + set(BOOST_LIBPATH ${BOOST}/lib) + endif() set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") endif() diff --git a/SConstruct b/SConstruct index cd4e31efeff..fd99933e976 100644 --- a/SConstruct +++ b/SConstruct @@ -581,6 +581,14 @@ if env['OURPLATFORM']!='darwin': source.remove('CMakeLists.txt') source=['intern/cycles/doc/license/'+s for s in source] scriptinstall.append(env.Install(dir=dir,source=source)) + + # cuda binaries + if env['WITH_BF_CYCLES_CUDA_BINARIES']: + dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib') + for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']: + kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel') + cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch) + scriptinstall.append(env.Install(dir=dir,source=cubin_file)) if env['WITH_BF_INTERNATIONAL']: internationalpaths=['release' + os.sep + 'datafiles'] diff --git a/build_files/buildbot/config/user-config-i686.py b/build_files/buildbot/config/user-config-i686.py index 99af7f3fa04..34817ed0ae9 100644 --- a/build_files/buildbot/config/user-config-i686.py +++ b/build_files/buildbot/config/user-config-i686.py @@ -58,6 +58,8 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32' +WITH_BF_STATICLIBSAMPLERATE = True + WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' @@ -114,5 +116,5 @@ WITH_BF_OCEANSIM = True # Compilation and optimization BF_DEBUG = False -REL_CCFLAGS = ['-O2', '-msse', '-msse2'] # C & C++ +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32'] diff --git a/build_files/buildbot/config/user-config-player-i686.py b/build_files/buildbot/config/user-config-player-i686.py index 3445ae59bda..6c5c5f89ad4 100644 --- a/build_files/buildbot/config/user-config-player-i686.py +++ b/build_files/buildbot/config/user-config-player-i686.py @@ -52,6 +52,8 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32' +WITH_BF_STATICLIBSAMPLERATE = True + WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' @@ -93,5 +95,5 @@ WITH_BF_OCEANSIM = True # Compilation and optimization BF_DEBUG = False -REL_CCFLAGS = ['-O2', '-msse', '-msse2'] # C & C++ +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32'] diff --git a/build_files/buildbot/config/user-config-player-x86_64.py b/build_files/buildbot/config/user-config-player-x86_64.py index 6ec56865c26..ad3839a2434 100644 --- a/build_files/buildbot/config/user-config-player-x86_64.py +++ b/build_files/buildbot/config/user-config-player-x86_64.py @@ -48,6 +48,8 @@ WITH_BF_JPEG = True BF_JPEG_LIB = 'libjpeg' BF_JPEG_LIBPATH = '/home/sources/staticlibs/lib64' +WITH_BF_STATICLIBSAMPLERATE = True + WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64' @@ -93,5 +95,5 @@ WITH_BF_OCEANSIM = True # Compilation and optimization BF_DEBUG = False -REL_CCFLAGS = ['-O2', '-msse', '-msse2'] # C & C++ +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64'] diff --git a/build_files/buildbot/config/user-config-x86_64.py b/build_files/buildbot/config/user-config-x86_64.py index a607be286f9..e090ddfbfd6 100644 --- a/build_files/buildbot/config/user-config-x86_64.py +++ b/build_files/buildbot/config/user-config-x86_64.py @@ -58,6 +58,8 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64' +WITH_BF_STATICLIBSAMPLERATE = True + WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' @@ -114,5 +116,5 @@ WITH_BF_OCEANSIM = True # Compilation and optimization BF_DEBUG = False -REL_CCFLAGS = ['-O2', '-msse', '-msse2'] # C & C++ +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64'] diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 028b1bd0289..e0b8822ce36 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -283,7 +283,7 @@ BF_PCRE_LIBPATH = '${BF_PCRE}/lib' #BF_EXPAT_LIB = 'expat' #BF_EXPAT_LIBPATH = '/usr/lib' -#Cycles +# Cycles WITH_BF_CYCLES = True WITH_BF_OIIO = True @@ -298,6 +298,10 @@ BF_BOOST_INC = BF_BOOST + '/include' BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt' BF_BOOST_LIBPATH = BF_BOOST + '/lib' +WITH_BF_CYCLES_CUDA_BINARIES = False +BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21'] + #Ray trace optimization if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386': WITH_BF_RAYOPTIMIZATION = True diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index b25bf98c9e6..6964ff993b6 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -219,6 +219,10 @@ BF_BOOST_LIBPATH = BF_BOOST + '/lib' WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST +WITH_BF_CYCLES_CUDA_BINARIES = False +BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21'] + WITH_BF_OPENMP = True #Ray trace optimization diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 7295a16c4bc..a2e3d11c244 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -165,6 +165,11 @@ BF_BOOST_INC = '${BF_BOOST}/include' BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-1_47 libboost_regex-vc90-mt-s-1_47 libboost_system-vc90-mt-s-1_47 libboost_thread-vc90-mt-s-1_47' BF_BOOST_LIBPATH = '${BF_BOOST}/lib' +#CUDA +WITH_BF_CYCLES_CUDA_BINARIES = False +#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21'] + #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE'] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index eb04d9f6403..74a526a59f7 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -154,6 +154,7 @@ WITH_BF_3DMOUSE = True WITH_BF_OPENMP = True +#Cycles WITH_BF_CYCLES = True WITH_BF_OIIO = True @@ -169,6 +170,11 @@ BF_BOOST_INC = '${BF_BOOST}/include' BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_47 libboost_filesystem-vc90-mt-s-1_47 libboost_regex-vc90-mt-s-1_47 libboost_system-vc90-mt-s-1_47 libboost_thread-vc90-mt-s-1_47' BF_BOOST_LIBPATH = '${BF_BOOST}/lib' +#CUDA +WITH_BF_CYCLES_CUDA_BINARIES = False +#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21'] + #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2'] diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index a63dfaa3fc9..1e55e09987d 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -291,7 +291,7 @@ def setup_syslibs(lenv): syslibs += Split(lenv['BF_JPEG_LIB']) syslibs += Split(lenv['BF_PNG_LIB']) - + syslibs += lenv['LLIBS'] return syslibs @@ -588,6 +588,8 @@ def AppIt(target=None, source=None, env=None): commands.getoutput(cmd) cmd = 'mkdir %s/kernel' % (cinstalldir) commands.getoutput(cmd) + cmd = 'mkdir %s/lib' % (cinstalldir) + commands.getoutput(cmd) cmd = 'cp -R %s/blender/addon/*.py %s/' % (croot, cinstalldir) commands.getoutput(cmd) cmd = 'cp -R %s/doc/license %s/license' % (croot, cinstalldir) @@ -596,6 +598,8 @@ def AppIt(target=None, source=None, env=None): commands.getoutput(cmd) cmd = 'cp -R %s/kernel/svm %s/util/util_color.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, cinstalldir) commands.getoutput(cmd) + cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir) + commands.getoutput(cmd) if env['WITH_OSX_STATICPYTHON']: cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index 1ddbfcb9608..98c1b74d5cc 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -157,7 +157,7 @@ def validate_arguments(args, bc): '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_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_BINARIES' 'BF_CYCLES_BINARIES_ARCH', + 'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES' 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH', 'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH' ] @@ -544,7 +544,9 @@ def read_opts(env, cfg, args): localopts.AddVariables( (BoolVariable('WITH_BF_CYCLES', 'Build with the Cycles engine', True)), - (BoolVariable('WITH_BF_CYCLES_BINARIES', 'Build with precompiled CUDA binaries', False)), + (BoolVariable('WITH_BF_CYCLES_CUDA_BINARIES', 'Build with precompiled CUDA binaries', False)), + ('BF_CYCLES_CUDA_NVCC', 'CUDA nvcc compiler path', ''), + ('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []), (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)), (BoolVariable('WITH_BF_STATICOIIO', 'Staticly link to OpenImageIO', False)), diff --git a/doc/python_api/rst/info_best_practice.rst b/doc/python_api/rst/info_best_practice.rst index 180a9fd1aa3..f4daed9ad9f 100644 --- a/doc/python_api/rst/info_best_practice.rst +++ b/doc/python_api/rst/info_best_practice.rst @@ -39,7 +39,7 @@ As well as pep8 we have other conventions used for blender python scripts. .. code-block:: python - bpy.context.scene.render.file_format = 'PNG' + bpy.context.scene.render.image_settings.file_format = 'PNG' bpy.context.scene.render.filepath = "//render_out" * pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script. @@ -181,7 +181,7 @@ When removing many items in a large list this can provide a good speedup. Avoid Copying Lists ^^^^^^^^^^^^^^^^^^^ -When passing a list/dictionary to a function, it is faster to have the function modify the list rather then returning a new list so python dosn't have tp duplicate the list in memory. +When passing a list/dictionary to a function, it is faster to have the function modify the list rather then returning a new list so python doesn't have to duplicate the list in memory. Functions that modify a list in-place are more efficient then functions that create new lists. diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 0a07e03b9ae..064067867ae 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -87,6 +87,7 @@ else: "gpu", "mathutils", "mathutils.geometry", + "mathutils.noise", "Freestyle", ) @@ -1198,6 +1199,8 @@ def rna2sphinx(BASEPATH): fw(" mathutils.rst\n\n") if "mathutils.geometry" not in EXCLUDE_MODULES: fw(" mathutils.geometry.rst\n\n") + if "mathutils.noise" not in EXCLUDE_MODULES: + fw(" mathutils.noise.rst\n\n") if "Freestyle" not in EXCLUDE_MODULES: fw(" Freestyle.rst\n\n") if "bgl" not in EXCLUDE_MODULES: @@ -1339,6 +1342,10 @@ def rna2sphinx(BASEPATH): import mathutils.geometry as module pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities") + if "mathutils.noise" not in EXCLUDE_MODULES: + import mathutils.noise as module + pymodule2sphinx(BASEPATH, "mathutils.noise", module, "Noise Utilities") + if "Freestyle" not in EXCLUDE_MODULES: import Freestyle as module pymodule2sphinx(BASEPATH, "Freestyle", module, "Freestyle Data Types & Operators") diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt index cd1f572197c..0e74c41195b 100644 --- a/extern/libmv/CMakeLists.txt +++ b/extern/libmv/CMakeLists.txt @@ -39,6 +39,7 @@ set(SRC libmv-capi.cpp libmv/numeric/numeric.cc libmv/numeric/poly.cc + libmv/simple_pipeline/callbacks.cc libmv/simple_pipeline/reconstruction.cc libmv/simple_pipeline/resect.cc libmv/simple_pipeline/intersect.cc @@ -52,6 +53,8 @@ set(SRC libmv/image/array_nd.cc libmv/tracking/pyramid_region_tracker.cc libmv/tracking/sad.cc + libmv/tracking/brute_region_tracker.cc + libmv/tracking/hybrid_region_tracker.cc libmv/tracking/esm_region_tracker.cc libmv/tracking/trklt_region_tracker.cc libmv/tracking/klt_region_tracker.cc @@ -83,6 +86,7 @@ set(SRC libmv/numeric/poly.h libmv/numeric/function_derivative.h libmv/numeric/numeric.h + libmv/simple_pipeline/callbacks.h libmv/simple_pipeline/resect.h libmv/simple_pipeline/reconstruction.h libmv/simple_pipeline/camera_intrinsics.h @@ -98,6 +102,8 @@ set(SRC libmv/image/sample.h libmv/image/image.h libmv/tracking/region_tracker.h + libmv/tracking/brute_region_tracker.h + libmv/tracking/hybrid_region_tracker.h libmv/tracking/retrack_region_tracker.h libmv/tracking/sad.h libmv/tracking/pyramid_region_tracker.h @@ -173,9 +179,9 @@ if(WIN32) if(MSVC) set(MSVC_OFLAGS O1 O2 Ox) - foreach(FLAG ) - string(REPLACE "" "Od" CMAKE_CXX_FLAGS_RELEASE "") - string(REPLACE "" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "") + foreach(FLAG ${MSVC_OFLAGS}) + string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endforeach() endif() else(WIN32) diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh index 690f78df387..fb336c66d61 100755 --- a/extern/libmv/bundle.sh +++ b/extern/libmv/bundle.sh @@ -183,9 +183,9 @@ IF(WIN32) IF(MSVC) set(MSVC_OFLAGS O1 O2 Ox) - foreach(FLAG ${MSVC_OFLAGS}) - string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + foreach(FLAG \${MSVC_OFLAGS}) + string(REPLACE "\${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "\${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "\${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "\${CMAKE_C_FLAGS_RELWITHDEBINFO}") endforeach() ENDIF(MSVC) ELSE(WIN32) diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp index 8c453944e9d..ed89f8cbfb3 100644 --- a/extern/libmv/libmv-capi.cpp +++ b/extern/libmv/libmv-capi.cpp @@ -31,9 +31,13 @@ #include "libmv-capi.h" #include "glog/logging.h" +#include "libmv/logging/logging.h" + #include "Math/v3d_optimization.h" #include "libmv/tracking/esm_region_tracker.h" +#include "libmv/tracking/brute_region_tracker.h" +#include "libmv/tracking/hybrid_region_tracker.h" #include "libmv/tracking/klt_region_tracker.h" #include "libmv/tracking/trklt_region_tracker.h" #include "libmv/tracking/lmicklt_region_tracker.h" @@ -41,6 +45,7 @@ #include "libmv/tracking/sad.h" +#include "libmv/simple_pipeline/callbacks.h" #include "libmv/simple_pipeline/tracks.h" #include "libmv/simple_pipeline/initialize_reconstruction.h" #include "libmv/simple_pipeline/bundle.h" @@ -106,18 +111,33 @@ void libmv_setLoggingVerbosity(int verbosity) /* ************ RegionTracker ************ */ -libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level, int half_window_size) +libmv_RegionTracker *libmv_pyramidRegionTrackerNew(int max_iterations, int pyramid_level, int half_window_size) { - libmv::EsmRegionTracker *klt_region_tracker = new libmv::EsmRegionTracker; + libmv::EsmRegionTracker *esm_region_tracker = new libmv::EsmRegionTracker; + esm_region_tracker->half_window_size = half_window_size; + esm_region_tracker->max_iterations = max_iterations; + esm_region_tracker->min_determinant = 1e-4; + + libmv::PyramidRegionTracker *pyramid_region_tracker = + new libmv::PyramidRegionTracker(esm_region_tracker, pyramid_level); - klt_region_tracker->half_window_size = half_window_size; - klt_region_tracker->max_iterations = max_iterations; - klt_region_tracker->min_determinant = 1e-4; + return (libmv_RegionTracker *)pyramid_region_tracker; +} + +libmv_RegionTracker *libmv_hybridRegionTrackerNew(int max_iterations, int half_window_size) +{ + libmv::EsmRegionTracker *esm_region_tracker = new libmv::EsmRegionTracker; + esm_region_tracker->half_window_size = half_window_size; + esm_region_tracker->max_iterations = max_iterations; + esm_region_tracker->min_determinant = 1e-4; - libmv::PyramidRegionTracker *region_tracker = - new libmv::PyramidRegionTracker(klt_region_tracker, pyramid_level); + libmv::BruteRegionTracker *brute_region_tracker = new libmv::BruteRegionTracker; + brute_region_tracker->half_window_size = half_window_size; - return (libmv_RegionTracker *)region_tracker; + libmv::HybridRegionTracker *hybrid_region_tracker = + new libmv::HybridRegionTracker(brute_region_tracker, esm_region_tracker); + + return (libmv_RegionTracker *)hybrid_region_tracker; } static void floatBufToImage(const float *buf, int width, int height, libmv::FloatImage *image) @@ -294,16 +314,16 @@ void libmv_regionTrackerDestroy(libmv_RegionTracker *libmv_tracker) /* ************ Tracks ************ */ void libmv_SADSamplePattern(unsigned char *image, int stride, - float warp[3][2], unsigned char *pattern) + float warp[3][2], unsigned char *pattern, int pattern_size) { libmv::mat32 mat32; memcpy(mat32.data, warp, sizeof(float)*3*2); - libmv::SamplePattern(image, stride, mat32, pattern, 16); + libmv::SamplePattern(image, stride, mat32, pattern, pattern_size); } -float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, int stride, +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, int pattern_size, unsigned char *image, int stride, int width, int height, float warp[3][2]) { float result; @@ -311,7 +331,7 @@ float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsig memcpy(mat32.data, warp, sizeof(float)*3*2); - result = libmv::Track(pattern, warped, 16, image, stride, width, height, &mat32, 16, 16); + result = libmv::Track(pattern, warped, pattern_size, image, stride, width, height, &mat32, 16, 16); memcpy(warp, mat32.data, sizeof(float)*3*2); @@ -339,6 +359,26 @@ void libmv_tracksDestroy(libmv_Tracks *libmv_tracks) /* ************ Reconstruction solver ************ */ +class ReconstructUpdateCallback : public libmv::ProgressUpdateCallback { +public: + ReconstructUpdateCallback(reconstruct_progress_update_cb progress_update_callback, + void *callback_customdata) + { + progress_update_callback_ = progress_update_callback; + callback_customdata_ = callback_customdata; + } + + void invoke(double progress, const char *message) + { + if(progress_update_callback_) { + progress_update_callback_(callback_customdata_, progress, message); + } + } +protected: + reconstruct_progress_update_cb progress_update_callback_; + void *callback_customdata_; +}; + int libmv_refineParametersAreValid(int parameters) { return (parameters == (LIBMV_REFINE_FOCAL_LENGTH)) || (parameters == (LIBMV_REFINE_FOCAL_LENGTH | @@ -356,7 +396,8 @@ int libmv_refineParametersAreValid(int parameters) { libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyframe1, int keyframe2, - int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3) + int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + reconstruct_progress_update_cb progress_update_callback, void *callback_customdata) { /* Invert the camera intrinsics. */ libmv::vector<libmv::Marker> markers = ((libmv::Tracks*)tracks)->AllMarkers(); @@ -364,6 +405,9 @@ libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyfra libmv::EuclideanReconstruction *reconstruction = &libmv_reconstruction->reconstruction; libmv::CameraIntrinsics *intrinsics = &libmv_reconstruction->intrinsics; + ReconstructUpdateCallback update_callback = + ReconstructUpdateCallback(progress_update_callback, callback_customdata); + intrinsics->SetFocalLength(focal_length, focal_length); intrinsics->SetPrincipalPoint(principal_x, principal_y); intrinsics->SetRadialDistortion(k1, k2, k3); @@ -377,15 +421,16 @@ libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyfra libmv::Tracks normalized_tracks(markers); - // printf("frames to init from: %d, %d\n", keyframe1, keyframe2); + LG << "frames to init from: " << keyframe1 << " " << keyframe2; libmv::vector<libmv::Marker> keyframe_markers = normalized_tracks.MarkersForTracksInBothImages(keyframe1, keyframe2); - // printf("number of markers for init: %d\n", keyframe_markers.size()); + LG << "number of markers for init: " << keyframe_markers.size(); + + update_callback.invoke(0, "Initial reconstruction"); libmv::EuclideanReconstructTwoFrames(keyframe_markers, reconstruction); libmv::EuclideanBundle(normalized_tracks, reconstruction); - - libmv::EuclideanCompleteReconstruction(normalized_tracks, reconstruction); + libmv::EuclideanCompleteReconstruction(normalized_tracks, reconstruction, &update_callback); if (refine_intrinsics) { /* only a few combinations are supported but trust the caller */ @@ -402,9 +447,13 @@ libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyfra if (refine_intrinsics & LIBMV_REFINE_RADIAL_DISTORTION_K2) { libmv_refine_flags |= libmv::BUNDLE_RADIAL_K2; } - libmv::EuclideanBundleCommonIntrinsics(*(libmv::Tracks *)tracks, libmv_refine_flags, reconstruction, intrinsics); + + progress_update_callback(callback_customdata, 1.0, "Refining solution"); + libmv::EuclideanBundleCommonIntrinsics(*(libmv::Tracks *)tracks, libmv_refine_flags, + reconstruction, intrinsics); } + progress_update_callback(callback_customdata, 1.0, "Finishing solution"); libmv_reconstruction->tracks = *(libmv::Tracks *)tracks; libmv_reconstruction->error = libmv::EuclideanReprojectionError(*(libmv::Tracks *)tracks, *reconstruction, *intrinsics); diff --git a/extern/libmv/libmv-capi.h b/extern/libmv/libmv-capi.h index 8252a11739b..c5e61d69c56 100644 --- a/extern/libmv/libmv-capi.h +++ b/extern/libmv/libmv-capi.h @@ -43,15 +43,16 @@ void libmv_startDebugLogging(void); void libmv_setLoggingVerbosity(int verbosity); /* RegionTracker */ -struct libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level, int half_window_size); +struct libmv_RegionTracker *libmv_pyramidRegionTrackerNew(int max_iterations, int pyramid_level, int half_window_size); +struct libmv_RegionTracker *libmv_hybridRegionTrackerNew(int max_iterations, int half_window_size); int libmv_regionTrackerTrack(struct libmv_RegionTracker *libmv_tracker, const float *ima1, const float *ima2, int width, int height, double x1, double y1, double *x2, double *y2); void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker); /* SAD Tracker */ void libmv_SADSamplePattern(unsigned char *image, int stride, - float warp[3][2], unsigned char *pattern); -float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, + float warp[3][2], unsigned char *pattern, int pattern_size); +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, int pattern_size, unsigned char *image, int stride, int width, int height, float warp[3][2]); /* Tracks */ @@ -64,10 +65,14 @@ void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks); #define LIBMV_REFINE_PRINCIPAL_POINT (1<<1) #define LIBMV_REFINE_RADIAL_DISTORTION_K1 (1<<2) #define LIBMV_REFINE_RADIAL_DISTORTION_K2 (1<<4) + +typedef void (*reconstruct_progress_update_cb) (void *customdata, double progress, const char *message); + int libmv_refineParametersAreValid(int parameters); struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2, - int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3); + int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3, + reconstruct_progress_update_cb progress_update_callback, void *callback_customdata); int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]); double libmv_reporojectionErrorForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track); double libmv_reporojectionErrorForImage(struct libmv_Reconstruction *libmv_reconstruction, int image); diff --git a/extern/libmv/libmv/simple_pipeline/callbacks.cc b/extern/libmv/libmv/simple_pipeline/callbacks.cc new file mode 100644 index 00000000000..7e4bca6efc7 --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/callbacks.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#include "libmv/simple_pipeline/callbacks.h" + +namespace libmv { + +void ProgressUpdateCallback::invoke(double progress, const char* message) +{ +} + +} // namespace libmv diff --git a/extern/libmv/libmv/simple_pipeline/callbacks.h b/extern/libmv/libmv/simple_pipeline/callbacks.h new file mode 100644 index 00000000000..675f73c1cab --- /dev/null +++ b/extern/libmv/libmv/simple_pipeline/callbacks.h @@ -0,0 +1,33 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#ifndef LIBMV_SIMPLE_PIPELINE_CALLBACKS_H_ +#define LIBMV_SIMPLE_PIPELINE_CALLBACKS_H_ + +namespace libmv { + +class ProgressUpdateCallback { + public: + virtual void invoke(double progress, const char *message); +}; + +} // namespace libmv + +#endif // LIBMV_SIMPLE_PIPELINE_MARKERS_H_ diff --git a/extern/libmv/libmv/simple_pipeline/pipeline.cc b/extern/libmv/libmv/simple_pipeline/pipeline.cc index 9512a41c00f..382365e579f 100644 --- a/extern/libmv/libmv/simple_pipeline/pipeline.cc +++ b/extern/libmv/libmv/simple_pipeline/pipeline.cc @@ -21,6 +21,7 @@ #include <cstdio> #include "libmv/logging/logging.h" +#include "libmv/simple_pipeline/pipeline.h" #include "libmv/simple_pipeline/bundle.h" #include "libmv/simple_pipeline/intersect.h" #include "libmv/simple_pipeline/resect.h" @@ -117,14 +118,32 @@ struct ProjectivePipelineRoutines { } // namespace +static void CompleteReconstructionLogProress(ProgressUpdateCallback *update_callback, + double progress, + const char *step = NULL) +{ + if(update_callback) { + char message[256]; + + if(step) + snprintf(message, sizeof(message), "Completing solution %d%% | %s", (int)(progress*100), step); + else + snprintf(message, sizeof(message), "Completing solution %d%%", (int)(progress*100)); + + update_callback->invoke(progress, message); + } +} + template<typename PipelineRoutines> void InternalCompleteReconstruction( const Tracks &tracks, - typename PipelineRoutines::Reconstruction *reconstruction) { + typename PipelineRoutines::Reconstruction *reconstruction, + ProgressUpdateCallback *update_callback = NULL) { int max_track = tracks.MaxTrack(); int max_image = tracks.MaxImage(); int num_resects = -1; int num_intersects = -1; + int tot_resects = 0; LG << "Max track: " << max_track; LG << "Max image: " << max_image; LG << "Number of markers: " << tracks.NumMarkers(); @@ -148,12 +167,17 @@ void InternalCompleteReconstruction( LG << "Got " << reconstructed_markers.size() << " reconstructed markers for track " << track; if (reconstructed_markers.size() >= 2) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image)); PipelineRoutines::Intersect(reconstructed_markers, reconstruction); num_intersects++; LG << "Ran Intersect() for track " << track; } } if (num_intersects) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image), + "Bundling..."); PipelineRoutines::Bundle(tracks, reconstruction); LG << "Ran Bundle() after intersections."; } @@ -178,8 +202,11 @@ void InternalCompleteReconstruction( LG << "Got " << reconstructed_markers.size() << " reconstructed markers for image " << image; if (reconstructed_markers.size() >= 5) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image)); if (PipelineRoutines::Resect(reconstructed_markers, reconstruction, false)) { num_resects++; + tot_resects++; LG << "Ran Resect() for image " << image; } else { LG << "Failed Resect() for image " << image; @@ -187,6 +214,9 @@ void InternalCompleteReconstruction( } } if (num_resects) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image), + "Bundling..."); PipelineRoutines::Bundle(tracks, reconstruction); } LG << "Did " << num_resects << " resects."; @@ -208,6 +238,8 @@ void InternalCompleteReconstruction( } } if (reconstructed_markers.size() >= 5) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image)); if (PipelineRoutines::Resect(reconstructed_markers, reconstruction, true)) { num_resects++; LG << "Ran Resect() for image " << image; @@ -217,6 +249,9 @@ void InternalCompleteReconstruction( } } if (num_resects) { + CompleteReconstructionLogProress(update_callback, + (double)tot_resects/(max_image), + "Bundling..."); PipelineRoutines::Bundle(tracks, reconstruction); } } @@ -244,7 +279,7 @@ double InternalReprojectionError(const Tracks &image_tracks, PipelineRoutines::ProjectMarker(*point, *camera, intrinsics); double ex = reprojected_marker.x - markers[i].x; double ey = reprojected_marker.y - markers[i].y; - +#if 0 const int N = 100; char line[N]; snprintf(line, N, @@ -262,6 +297,7 @@ double InternalReprojectionError(const Tracks &image_tracks, ex, ey, sqrt(ex*ex + ey*ey)); +#endif total_error += sqrt(ex*ex + ey*ey); } LG << "Skipped " << num_skipped << " markers."; @@ -289,9 +325,11 @@ double ProjectiveReprojectionError( } void EuclideanCompleteReconstruction(const Tracks &tracks, - EuclideanReconstruction *reconstruction) { + EuclideanReconstruction *reconstruction, + ProgressUpdateCallback *update_callback) { InternalCompleteReconstruction<EuclideanPipelineRoutines>(tracks, - reconstruction); + reconstruction, + update_callback); } void ProjectiveCompleteReconstruction(const Tracks &tracks, diff --git a/extern/libmv/libmv/simple_pipeline/pipeline.h b/extern/libmv/libmv/simple_pipeline/pipeline.h index b7dfcb7993a..e940b57bc0d 100644 --- a/extern/libmv/libmv/simple_pipeline/pipeline.h +++ b/extern/libmv/libmv/simple_pipeline/pipeline.h @@ -21,6 +21,7 @@ #ifndef LIBMV_SIMPLE_PIPELINE_PIPELINE_H_ #define LIBMV_SIMPLE_PIPELINE_PIPELINE_H_ +#include "libmv/simple_pipeline/callbacks.h" #include "libmv/simple_pipeline/tracks.h" #include "libmv/simple_pipeline/reconstruction.h" @@ -46,7 +47,8 @@ namespace libmv { \sa EuclideanResect, EuclideanIntersect, EuclideanBundle */ void EuclideanCompleteReconstruction(const Tracks &tracks, - EuclideanReconstruction *reconstruction); + EuclideanReconstruction *reconstruction, + ProgressUpdateCallback *update_callback = NULL); /*! Estimate camera matrices and homogeneous 3D coordinates for all frames and diff --git a/extern/libmv/libmv/tracking/brute_region_tracker.cc b/extern/libmv/libmv/tracking/brute_region_tracker.cc new file mode 100644 index 00000000000..c33432b7fd7 --- /dev/null +++ b/extern/libmv/libmv/tracking/brute_region_tracker.cc @@ -0,0 +1,331 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#include "libmv/tracking/brute_region_tracker.h" + +#ifdef __SSE2__ +#include <emmintrin.h> +#endif + +#ifndef __APPLE__ +// Needed for memalign on Linux and _aligned_alloc on Windows. +#ifdef FREE_WINDOWS +/* make sure _aligned_malloc is included */ +#ifdef __MSVCRT_VERSION__ +#undef __MSVCRT_VERSION__ +#endif + +#define __MSVCRT_VERSION__ 0x0700 +#endif + +#include <malloc.h> +#else +// Apple's malloc is 16-byte aligned, and does not have malloc.h, so include +// stdilb instead. +#include <cstdlib> +#endif + +#include "libmv/image/image.h" +#include "libmv/image/convolve.h" +#include "libmv/image/sample.h" +#include "libmv/logging/logging.h" + +namespace libmv { +namespace { + +// TODO(keir): It's stupid that this is needed here. Push this somewhere else. +void *aligned_malloc(int size, int alignment) { +#ifdef _WIN32 + return _aligned_malloc(size, alignment); +#elif __APPLE__ + // On Mac OS X, both the heap and the stack are guaranteed 16-byte aligned so + // they work natively with SSE types with no further work. + CHECK_EQ(alignment, 16); + return malloc(size); +#else // This is for Linux. + return memalign(alignment, size); +#endif +} + +void aligned_free(void *ptr) { +#ifdef _WIN32 + _aligned_free(ptr); +#else + free(ptr); +#endif +} + +bool RegionIsInBounds(const FloatImage &image1, + double x, double y, + int half_window_size) { + // Check the minimum coordinates. + int min_x = floor(x) - half_window_size - 1; + int min_y = floor(y) - half_window_size - 1; + if (min_x < 0.0 || + min_y < 0.0) { + return false; + } + + // Check the maximum coordinates. + int max_x = ceil(x) + half_window_size + 1; + int max_y = ceil(y) + half_window_size + 1; + if (max_x > image1.cols() || + max_y > image1.rows()) { + return false; + } + + // Ok, we're good. + return true; +} + +#ifdef __SSE2__ + +// Compute the sub of absolute differences between the arrays "a" and "b". +// The array "a" is assumed to be 16-byte aligned, while "b" is not. The +// result is returned as the first and third elements of __m128i if +// interpreted as a 4-element 32-bit integer array. The SAD is the sum of the +// elements. +// +// The function requires size % 16 valid extra elements at the end of both "a" +// and "b", since the SSE load instructionst will pull in memory past the end +// of the arrays if their size is not a multiple of 16. +inline static __m128i SumOfAbsoluteDifferencesContiguousSSE( + const unsigned char *a, // aligned + const unsigned char *b, // not aligned + unsigned int size, + __m128i sad) { + // Do the bulk of the work as 16-way integer operations. + for(unsigned int j = 0; j < size / 16; j++) { + sad = _mm_add_epi32(sad, _mm_sad_epu8( _mm_load_si128 ((__m128i*)(a + 16 * j)), + _mm_loadu_si128((__m128i*)(b + 16 * j)))); + } + // Handle the trailing end. + // TODO(keir): Benchmark to verify that the below SSE is a win compared to a + // hand-rolled loop. It's not clear that the hand rolled loop would be slower + // than the potential cache miss when loading the immediate table below. + // + // An alternative to this version is to take a packet of all 1's then do a + // 128-bit shift. The issue is that the shift instruction needs an immediate + // amount rather than a variable amount, so the branch instruction here must + // remain. See _mm_srli_si128 and _mm_slli_si128. + unsigned int remainder = size % 16u; + if (remainder) { + unsigned int j = size / 16; + __m128i a_trail = _mm_load_si128 ((__m128i*)(a + 16 * j)); + __m128i b_trail = _mm_loadu_si128((__m128i*)(b + 16 * j)); + __m128i mask; + switch (remainder) { +#define X 0xff + case 1: mask = _mm_setr_epi8(X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 2: mask = _mm_setr_epi8(X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 3: mask = _mm_setr_epi8(X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 4: mask = _mm_setr_epi8(X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 5: mask = _mm_setr_epi8(X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 6: mask = _mm_setr_epi8(X, X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 7: mask = _mm_setr_epi8(X, X, X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 8: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0); break; + case 9: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0); break; + case 10: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, 0, 0, 0, 0, 0, 0); break; + case 11: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, X, 0, 0, 0, 0, 0); break; + case 12: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, X, X, 0, 0, 0, 0); break; + case 13: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, X, X, X, 0, 0, 0); break; + case 14: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, X, X, X, X, 0, 0); break; + case 15: mask = _mm_setr_epi8(X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, 0); break; +#undef X + } + sad = _mm_add_epi32(sad, _mm_sad_epu8(_mm_and_si128(mask, a_trail), + _mm_and_si128(mask, b_trail))); + } + return sad; +} +#endif + +// Computes the sum of absolute differences between pattern and image. Pattern +// must be 16-byte aligned, and the stride must be a multiple of 16. The image +// does pointer does not have to be aligned. +int SumOfAbsoluteDifferencesContiguousImage( + const unsigned char *pattern, + unsigned int pattern_width, + unsigned int pattern_height, + unsigned int pattern_stride, + const unsigned char *image, + unsigned int image_stride) { +#ifdef __SSE2__ + // TODO(keir): Add interleaved accumulation, where accumulation is done into + // two or more SSE registers that then get combined at the end. This reduces + // instruction dependency; in Eigen's squared norm code, splitting the + // accumulation produces a ~2x speedup. It's not clear it will help here, + // where the number of SSE instructions in the inner loop is smaller. + __m128i sad = _mm_setzero_si128(); + for (int r = 0; r < pattern_height; ++r) { + sad = SumOfAbsoluteDifferencesContiguousSSE(&pattern[pattern_stride * r], + &image[image_stride * r], + pattern_width, + sad); + } + return _mm_cvtsi128_si32( + _mm_add_epi32(sad, + _mm_shuffle_epi32(sad, _MM_SHUFFLE(3, 0, 1, 2)))); +#else + int sad = 0; + for (int r = 0; r < pattern_height; ++r) { + for (int c = 0; c < pattern_width; ++c) { + sad += abs(pattern[pattern_stride * r + c] - image[image_stride * r + c]); + } + } + return sad; +#endif +} + +// Sample a region of size width, height centered at x,y in image, converting +// from float to byte in the process. Samples from the first channel. Puts +// result into *pattern. +void SampleRectangularPattern(const FloatImage &image, + double x, double y, + int width, + int height, + int pattern_stride, + unsigned char *pattern) { + // There are two cases for width and height: even or odd. If it's odd, then + // the bounds [-width / 2, width / 2] works as expected. However, for even, + // this results in one extra access past the end. So use < instead of <= in + // the loops below, but increase the end limit by one in the odd case. + int end_width = (width / 2) + (width % 2); + int end_height = (height / 2) + (height % 2); + for (int r = -height / 2; r < end_height; ++r) { + for (int c = -width / 2; c < end_width; ++c) { + pattern[pattern_stride * (r + height / 2) + c + width / 2] = + SampleLinear(image, y + r, x + c, 0) * 255.0; + } + } +} + +// Returns x rounded up to the nearest multiple of alignment. +inline int PadToAlignment(int x, int alignment) { + if (x % alignment != 0) { + x += alignment - (x % alignment); + } + return x; +} + +// Sample a region centered at x,y in image with size extending by half_width +// from x. Samples from the first channel. The resulting array is placed in +// *pattern, and the stride, which will be a multiple of 16 if SSE is enabled, +// is returned in *pattern_stride. +// +// NOTE: Caller must free *pattern with aligned_malloc() from above. +void SampleSquarePattern(const FloatImage &image, + double x, double y, + int half_width, + unsigned char **pattern, + int *pattern_stride) { + int width = 2 * half_width + 1; + // Allocate an aligned block with padding on the end so each row of the + // pattern starts on a 16-byte boundary. + *pattern_stride = PadToAlignment(width, 16); + int pattern_size_bytes = *pattern_stride * width; + *pattern = static_cast<unsigned char *>( + aligned_malloc(pattern_size_bytes, 16)); + SampleRectangularPattern(image, x, y, width, width, + *pattern_stride, + *pattern); +} + +// NOTE: Caller must free *image with aligned_malloc() from above. +void FloatArrayToByteArrayWithPadding(const FloatImage &float_image, + unsigned char **image, + int *image_stride) { + // Allocate enough so that accessing 16 elements past the end is fine. + *image_stride = float_image.Width() + 16; + *image = static_cast<unsigned char *>( + aligned_malloc(*image_stride * float_image.Height(), 16)); + for (int i = 0; i < float_image.Height(); ++i) { + for (int j = 0; j < float_image.Width(); ++j) { + (*image)[*image_stride * i + j] = + static_cast<unsigned char>(255.0 * float_image(i, j, 0)); + } + } +} + +} // namespace + +// TODO(keir): Compare the "sharpness" of the peak around the best pixel. It's +// probably worth plotting a few examples to see what the histogram of SAD +// values for every hypothesis looks like. +// +// TODO(keir): Priority queue for multiple hypothesis. +bool BruteRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + if (!RegionIsInBounds(image1, x1, y1, half_window_size)) { + LG << "Fell out of image1's window with x1=" << x1 << ", y1=" << y1 + << ", hw=" << half_window_size << "."; + return false; + } + int pattern_width = 2 * half_window_size + 1; + + Array3Df image_and_gradient1; + Array3Df image_and_gradient2; + BlurredImageAndDerivativesChannels(image1, 0.9, &image_and_gradient1); + BlurredImageAndDerivativesChannels(image2, 0.9, &image_and_gradient2); + + // Sample the pattern to get it aligned to an image grid. + unsigned char *pattern; + int pattern_stride; + SampleSquarePattern(image_and_gradient1, x1, y1, half_window_size, + &pattern, + &pattern_stride); + + // Convert the search area directly to bytes without sampling. + unsigned char *search_area; + int search_area_stride; + FloatArrayToByteArrayWithPadding(image_and_gradient2, &search_area, &search_area_stride); + + // Try all possible locations inside the search area. Yes, everywhere. + int best_i, best_j, best_sad = INT_MAX; + for (int i = 0; i < image2.Height() - pattern_width; ++i) { + for (int j = 0; j < image2.Width() - pattern_width; ++j) { + int sad = SumOfAbsoluteDifferencesContiguousImage(pattern, + pattern_width, + pattern_width, + pattern_stride, + search_area + search_area_stride * i + j, + search_area_stride); + if (sad < best_sad) { + best_i = i; + best_j = j; + best_sad = sad; + } + } + } + + aligned_free(pattern); + aligned_free(search_area); + + if (best_sad != INT_MAX) { + *x2 = best_j + half_window_size; + *y2 = best_i + half_window_size; + return true; + } + return false; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/brute_region_tracker.h b/extern/libmv/libmv/tracking/brute_region_tracker.h new file mode 100644 index 00000000000..7a9b06d8a31 --- /dev/null +++ b/extern/libmv/libmv/tracking/brute_region_tracker.h @@ -0,0 +1,46 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#ifndef LIBMV_REGION_TRACKING_BRUTE_REGION_TRACKER_H_ +#define LIBMV_REGION_TRACKING_BRUTE_REGION_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +struct BruteRegionTracker : public RegionTracker { + BruteRegionTracker() : half_window_size(4) {} + + virtual ~BruteRegionTracker() {} + + // Tracker interface. + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + + // No point in creating getters or setters. + int half_window_size; +}; + +} // namespace libmv + +#endif // LIBMV_REGION_TRACKING_BRUTE_REGION_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/esm_region_tracker.cc b/extern/libmv/libmv/tracking/esm_region_tracker.cc index 01edee3bbb5..844b5ff3cb9 100644 --- a/extern/libmv/libmv/tracking/esm_region_tracker.cc +++ b/extern/libmv/libmv/tracking/esm_region_tracker.cc @@ -31,7 +31,7 @@ namespace libmv { // TODO(keir): Reduce duplication between here and the other region trackers. -bool RegionIsInBounds(const FloatImage &image1, +static bool RegionIsInBounds(const FloatImage &image1, double x, double y, int half_window_size) { // Check the minimum coordinates. @@ -56,7 +56,7 @@ bool RegionIsInBounds(const FloatImage &image1, // Sample a region centered at x,y in image with size extending by half_width // from x,y. Channels specifies the number of channels to sample from. -void SamplePattern(const FloatImage &image, +static void SamplePattern(const FloatImage &image, double x, double y, int half_width, int channels, @@ -74,7 +74,7 @@ void SamplePattern(const FloatImage &image, // Estimate "reasonable" error by computing autocorrelation for a small shift. // TODO(keir): Add a facility for -double EstimateReasonableError(const FloatImage &image, +static double EstimateReasonableError(const FloatImage &image, double x, double y, int half_width) { double error = 0.0; diff --git a/extern/libmv/libmv/tracking/hybrid_region_tracker.cc b/extern/libmv/libmv/tracking/hybrid_region_tracker.cc new file mode 100644 index 00000000000..ea3b0f5bfc0 --- /dev/null +++ b/extern/libmv/libmv/tracking/hybrid_region_tracker.cc @@ -0,0 +1,67 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#include "libmv/tracking/hybrid_region_tracker.h" + +#include "libmv/image/image.h" +#include "libmv/image/convolve.h" +#include "libmv/image/sample.h" +#include "libmv/logging/logging.h" + +namespace libmv { + +bool HybridRegionTracker::Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const { + double x2_coarse = *x2; + double y2_coarse = *y2; + if (!coarse_tracker_->Track(image1, image2, x1, y1, &x2_coarse, &y2_coarse)) { + LG << "Coarse tracker failed."; + return false; + } + + double x2_fine = x2_coarse; + double y2_fine = y2_coarse; + if (!fine_tracker_->Track(image1, image2, x1, y1, &x2_fine, &y2_fine)) { + LG << "Fine tracker failed."; + return false; + } + + // Calculate the shift done by the fine tracker. + double dx2 = x2_coarse - x2_fine; + double dy2 = y2_coarse - y2_fine; + double fine_shift = sqrt(dx2 * dx2 + dy2 * dy2); + + LG << "Refinement: dx=" << dx2 << " dy=" << dy2 << ", d=" << fine_shift; + + // If the fine tracker shifted the window by more than a pixel, then + // something bad probably happened and we should give up tracking. + if (fine_shift < 2.0) { + LG << "Refinement small enough; success."; + *x2 = x2_fine; + *y2 = y2_fine; + return true; + } + LG << "Refinement was too big; failing."; + return false; +} + +} // namespace libmv diff --git a/extern/libmv/libmv/tracking/hybrid_region_tracker.h b/extern/libmv/libmv/tracking/hybrid_region_tracker.h new file mode 100644 index 00000000000..a18341f0ce4 --- /dev/null +++ b/extern/libmv/libmv/tracking/hybrid_region_tracker.h @@ -0,0 +1,52 @@ +// Copyright (c) 2011 libmv authors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. + +#ifndef LIBMV_REGION_TRACKING_HYBRID_REGION_TRACKER_H_ +#define LIBMV_REGION_TRACKING_HYBRID_REGION_TRACKER_H_ + +#include "libmv/image/image.h" +#include "libmv/base/scoped_ptr.h" +#include "libmv/tracking/region_tracker.h" + +namespace libmv { + +// TODO(keir): Documentation! +class HybridRegionTracker : public RegionTracker { + public: + HybridRegionTracker(RegionTracker *coarse_tracker, + RegionTracker *fine_tracker) + : coarse_tracker_(coarse_tracker), + fine_tracker_(fine_tracker) {} + + virtual ~HybridRegionTracker() {} + + // Tracker interface. + virtual bool Track(const FloatImage &image1, + const FloatImage &image2, + double x1, double y1, + double *x2, double *y2) const; + + scoped_ptr<RegionTracker> coarse_tracker_; + scoped_ptr<RegionTracker> fine_tracker_; +}; + +} // namespace libmv + +#endif // LIBMV_REGION_TRACKING_HYBRID_REGION_TRACKER_H_ diff --git a/extern/libmv/libmv/tracking/klt_region_tracker.cc b/extern/libmv/libmv/tracking/klt_region_tracker.cc index 78ce0be603c..c8e605de572 100644 --- a/extern/libmv/libmv/tracking/klt_region_tracker.cc +++ b/extern/libmv/libmv/tracking/klt_region_tracker.cc @@ -63,7 +63,7 @@ static void ComputeTrackingEquation(const Array3Df &image_and_gradient1, } } -bool RegionIsInBounds(const FloatImage &image1, +static bool RegionIsInBounds(const FloatImage &image1, double x, double y, int half_window_size) { // Check the minimum coordinates. diff --git a/extern/libmv/libmv/tracking/lmicklt_region_tracker.cc b/extern/libmv/libmv/tracking/lmicklt_region_tracker.cc index 5ac96e66175..c06a1d3302c 100644 --- a/extern/libmv/libmv/tracking/lmicklt_region_tracker.cc +++ b/extern/libmv/libmv/tracking/lmicklt_region_tracker.cc @@ -29,7 +29,7 @@ namespace libmv { // TODO(keir): Reduce duplication between here and the other region trackers. -bool RegionIsInBounds(const FloatImage &image1, +static bool RegionIsInBounds(const FloatImage &image1, double x, double y, int half_window_size) { // Check the minimum coordinates. @@ -54,7 +54,7 @@ bool RegionIsInBounds(const FloatImage &image1, // Sample a region centered at x,y in image with size extending by half_width // from x,y. Channels specifies the number of channels to sample from. -void SamplePattern(const FloatImage &image, +static void SamplePattern(const FloatImage &image, double x, double y, int half_width, int channels, @@ -71,7 +71,7 @@ void SamplePattern(const FloatImage &image, } // Estimate "reasonable" error by computing autocorrelation for a small shift. -double EstimateReasonableError(const FloatImage &image, +static double EstimateReasonableError(const FloatImage &image, double x, double y, int half_width) { double error = 0.0; diff --git a/extern/libmv/libmv/tracking/sad.cc b/extern/libmv/libmv/tracking/sad.cc index 9b446bb4c35..0876ef2fe73 100644 --- a/extern/libmv/libmv/tracking/sad.cc +++ b/extern/libmv/libmv/tracking/sad.cc @@ -25,6 +25,7 @@ #include "libmv/tracking/sad.h" #include <stdlib.h> #include <math.h> +#include <stdio.h> namespace libmv { @@ -78,15 +79,31 @@ void SamplePattern(ubyte* image, int stride, mat32 warp, ubyte* pattern, int siz #ifdef __SSE2__ #include <emmintrin.h> -static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { + static uint SAD(/*const*/ ubyte* pattern, /*const*/ ubyte* image, int stride, int size) { + uint sad = 0; __m128i a = _mm_setzero_si128(); + for(int i = 0; i < size; i++) { - for(int j = 0; j < size/16; j++) { + int j = 0; + + for(j = 0; j < size/16; j++) { + if((i*size/16+j) % 32 == 0) { + sad += _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + a = _mm_setzero_si128(); + } + a = _mm_adds_epu16(a, _mm_sad_epu8( _mm_loadu_si128((__m128i*)(pattern+i*size+j*16)), _mm_loadu_si128((__m128i*)(image+i*stride+j*16)))); } + + for(j = j*16; j < size; j++) { + sad += abs((int)pattern[i*size+j] - image[i*stride+j]); + } } - return _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + + sad += _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + + return sad; } #else static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { diff --git a/extern/libmv/libmv/tracking/trklt_region_tracker.cc b/extern/libmv/libmv/tracking/trklt_region_tracker.cc index 7e51787ebac..f19315b6b11 100644 --- a/extern/libmv/libmv/tracking/trklt_region_tracker.cc +++ b/extern/libmv/libmv/tracking/trklt_region_tracker.cc @@ -81,7 +81,7 @@ static void ComputeTrackingEquation(const Array3Df &image_and_gradient1, *e = (A + lambda*Mat2f::Identity())*Di*(V - W) + 0.5*(S - R); } -bool RegionIsInBounds(const FloatImage &image1, +static bool RegionIsInBounds(const FloatImage &image1, double x, double y, int half_window_size) { // Check the minimum coordinates. diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index c5c4f6b22a6..3dc9ca5d284 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -10,12 +10,14 @@ include(cmake/external_libs.cmake) if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD) set(WITH_CYCLES_OPTIMIZED_KERNEL ON) +endif() - if(WIN32 AND MSVC) - set(CYCLES_OPTIMIZED_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast") - elseif(CMAKE_COMPILER_IS_GNUCC) - set(CYCLES_OPTIMIZED_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3") - endif() +if(WIN32 AND MSVC) + set(CYCLES_OPTIMIZED_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /EHsc") +elseif(CMAKE_COMPILER_IS_GNUCC) + set(CYCLES_OPTIMIZED_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mfpmath=sse") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math") endif() # for OSL, not needed yet diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript index ecd22f654e8..bc9eb563e50 100644 --- a/intern/cycles/SConscript +++ b/intern/cycles/SConscript @@ -14,6 +14,7 @@ sources.remove(path.join('kernel', 'kernel_optimized.cpp')) incs = [] defs = [] +cxxflags = [] defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {') defs.append('CCL_NAMESPACE_END=}') @@ -22,7 +23,7 @@ defs.append('WITH_OPENCL') defs.append('WITH_MULTI') defs.append('WITH_CUDA') -if env['WITH_BF_CYCLES_BINARIES']: +if env['WITH_BF_CYCLES_CUDA_BINARIES']: defs.append('WITH_CUDA_BINARIES') incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split()) @@ -33,20 +34,31 @@ incs.append(cycles['BF_OIIO_INC']) incs.append(cycles['BF_BOOST_INC']) incs.append(cycles['BF_PYTHON_INC']) +if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): + cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split()) +else: + cxxflags.append('-ffast-math'.split()) + # optimized kernel if env['WITH_BF_RAYOPTIMIZATION']: optim_cxxflags = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - optim_cxxflags.append('/Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast'.split()) + optim_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split()) else: - optim_cxxflags.append('-ffast-math -msse -msse2 -msse3'.split()) + optim_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split()) - optim_defs = defs + ['WITH_OPTIMIZED_KERNEL'] + defs.append('WITH_OPTIMIZED_KERNEL') + optim_defs = defs[:] optim_sources = [path.join('kernel', 'kernel_optimized.cpp')] cycles_optim = cycles.Clone() - cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[0], compileflags=[None], cxx_compileflags=optim_cxxflags) + cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[10], compileflags=[None], cxx_compileflags=optim_cxxflags) + +cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None], cxx_compileflags=cxxflags) -cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None]) +# cuda kernel binaries +if env['WITH_BF_CYCLES_CUDA_BINARIES']: + kernel_binaries = SConscript(['kernel/SConscript']) + cycles.Depends("device/device_cuda.o", kernel_binaries) diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index 5f9e1d7a5ff..530a4ad14d8 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -339,64 +339,33 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug else if(string_iequals(node.name(), "noise_texture")) { snode = new NoiseTextureNode(); } - else if(string_iequals(node.name(), "blend_texture")) { - BlendTextureNode *blend = new BlendTextureNode(); - xml_read_enum(&blend->progression, BlendTextureNode::progression_enum, node, "progression"); - xml_read_enum(&blend->axis, BlendTextureNode::axis_enum, node, "axis"); + else if(string_iequals(node.name(), "gradient_texture")) { + GradientTextureNode *blend = new GradientTextureNode(); + xml_read_enum(&blend->type, GradientTextureNode::type_enum, node, "type"); snode = blend; } - else if(string_iequals(node.name(), "clouds_texture")) { - CloudsTextureNode *clouds = new CloudsTextureNode(); - xml_read_bool(&clouds->hard, node, "hard"); - xml_read_int(&clouds->depth, node, "depth"); - xml_read_enum(&clouds->basis, CloudsTextureNode::basis_enum, node, "basis"); - snode = clouds; - } else if(string_iequals(node.name(), "voronoi_texture")) { VoronoiTextureNode *voronoi = new VoronoiTextureNode(); - xml_read_enum(&voronoi->distance_metric, VoronoiTextureNode::distance_metric_enum, node, "distance_metric"); xml_read_enum(&voronoi->coloring, VoronoiTextureNode::coloring_enum, node, "coloring"); snode = voronoi; } else if(string_iequals(node.name(), "musgrave_texture")) { MusgraveTextureNode *musgrave = new MusgraveTextureNode(); xml_read_enum(&musgrave->type, MusgraveTextureNode::type_enum, node, "type"); - xml_read_enum(&musgrave->basis, MusgraveTextureNode::basis_enum, node, "basis"); snode = musgrave; } - else if(string_iequals(node.name(), "marble_texture")) { - MarbleTextureNode *marble = new MarbleTextureNode(); - xml_read_enum(&marble->type, MarbleTextureNode::type_enum, node, "type"); - xml_read_enum(&marble->wave, MarbleTextureNode::wave_enum, node, "wave"); - xml_read_enum(&marble->basis, MarbleTextureNode::basis_enum, node, "basis"); - xml_read_bool(&marble->hard, node, "hard"); - xml_read_int(&marble->depth, node, "depth"); - snode = marble; - } else if(string_iequals(node.name(), "magic_texture")) { MagicTextureNode *magic = new MagicTextureNode(); xml_read_int(&magic->depth, node, "depth"); snode = magic; } - else if(string_iequals(node.name(), "stucci_texture")) { - StucciTextureNode *stucci = new StucciTextureNode(); - xml_read_enum(&stucci->type, StucciTextureNode::type_enum, node, "type"); - xml_read_enum(&stucci->basis, StucciTextureNode::basis_enum, node, "basis"); - xml_read_bool(&stucci->hard, node, "hard"); - snode = stucci; - } - else if(string_iequals(node.name(), "distorted_noise_texture")) { - DistortedNoiseTextureNode *dist = new DistortedNoiseTextureNode(); - xml_read_enum(&dist->basis, DistortedNoiseTextureNode::basis_enum, node, "basis"); - xml_read_enum(&dist->distortion_basis, DistortedNoiseTextureNode::basis_enum, node, "distortion_basis"); + else if(string_iequals(node.name(), "noise_texture")) { + NoiseTextureNode *dist = new NoiseTextureNode(); snode = dist; } - else if(string_iequals(node.name(), "wood_texture")) { - WoodTextureNode *wood = new WoodTextureNode(); - xml_read_enum(&wood->type, WoodTextureNode::type_enum, node, "type"); - xml_read_enum(&wood->wave, WoodTextureNode::wave_enum, node, "wave"); - xml_read_enum(&wood->basis, WoodTextureNode::basis_enum, node, "basis"); - xml_read_bool(&wood->hard, node, "hard"); + else if(string_iequals(node.name(), "wave_texture")) { + WaveTextureNode *wood = new WaveTextureNode(); + xml_read_enum(&wood->type, WaveTextureNode::type_enum, node, "type"); snode = wood; } else if(string_iequals(node.name(), "mapping")) { @@ -466,16 +435,31 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug else if(string_iequals(node.name(), "add_closure")) { snode = new AddClosureNode(); } + else if(string_iequals(node.name(), "invert")) { + snode = new InvertNode(); + } else if(string_iequals(node.name(), "mix")) { MixNode *mix = new MixNode(); xml_read_enum(&mix->type, MixNode::type_enum, node, "type"); snode = mix; } + else if(string_iequals(node.name(), "combine_rgb")) { + snode = new CombineRGBNode(); + } + else if(string_iequals(node.name(), "separate_rgb")) { + snode = new SeparateRGBNode(); + } + else if(string_iequals(node.name(), "hsv")) { + snode = new HSVNode(); + } else if(string_iequals(node.name(), "attribute")) { AttributeNode *attr = new AttributeNode(); xml_read_ustring(&attr->attribute, node, "attribute"); snode = attr; } + else if(string_iequals(node.name(), "camera")) { + snode = new CameraNode(); + } else if(string_iequals(node.name(), "fresnel")) { snode = new FresnelNode(); } diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index b96048acf05..3b685346791 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -39,7 +39,6 @@ set(ADDON_FILES addon/presets.py addon/properties.py addon/ui.py - addon/xml.py ) blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}") diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index a7a8a74bf38..a82d69903a8 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -33,12 +33,7 @@ bl_info = { "category": "Render"} import bpy - -from cycles import ui -from cycles import properties -from cycles import xml -from cycles import engine -from cycles import presets +from . import ui, properties, engine, presets class CyclesRender(bpy.types.RenderEngine): @@ -82,13 +77,11 @@ class CyclesRender(bpy.types.RenderEngine): def register(): properties.register() ui.register() - xml.register() presets.register() bpy.utils.register_module(__name__) def unregister(): - xml.unregister() ui.unregister() properties.unregister() presets.unregister() diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index a32a9e91499..2fedd2c0afa 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -56,7 +56,7 @@ def free(engine): def render(engine): import bcycles - if "session" in dir(engine): + if hasattr(engine, "session"): bcycles.render(engine.session) diff --git a/intern/cycles/blender/addon/enums.py b/intern/cycles/blender/addon/enums.py index 463fdc19534..a11f5ca0f87 100644 --- a/intern/cycles/blender/addon/enums.py +++ b/intern/cycles/blender/addon/enums.py @@ -18,7 +18,7 @@ # <pep8 compliant> -from cycles import engine +from . import engine def get_gpu_device(): @@ -41,7 +41,12 @@ devices = ( gpu_type = ( ("CUDA", "CUDA", "NVidia only"), - ("OPENCL", "OpenCL (incomplete)", ""), + ("OPENCL", "OpenCL", ""), + ) + +feature_set = ( + ("SUPPORTED", "Supported", "Only use finished and supported features"), + ("EXPERIMENTAL", "Experimental", "Use experimental and incomplete features that might be broken or change in the future"), ) shading_systems = ( diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 95f898f3ca5..0ea7396f9c2 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -27,7 +27,7 @@ from bpy.props import (BoolProperty, import math -from cycles import enums +from . import enums class CyclesRenderSettings(bpy.types.PropertyGroup): @@ -41,6 +41,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): cls.gpu_type = EnumProperty(name="GPU Type", description="Processing system to use on the GPU", items=enums.gpu_type, default="CUDA") + cls.feature_set = EnumProperty(name="Feature Set", description="Feature set to use for rendering", + items=enums.feature_set, default="SUPPORTED") + cls.shading_system = EnumProperty(name="Shading System", description="Shading system to use for rendering", items=enums.shading_systems, default="GPU_COMPATIBLE") diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 224e44c287a..d23347b937d 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -22,8 +22,7 @@ import bpy from bpy.types import Panel, Menu -from cycles import enums -from cycles import engine +from . import enums, engine class CYCLES_MT_integrator_presets(Menu): @@ -295,7 +294,12 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and (context.mesh or context.curve or context.meta_ball) + if CyclesButtonsPanel.poll(context): + if context.mesh or context.curve or context.meta_ball: + if context.scene.cycles.feature_set == 'EXPERIMENTAL': + return True + + return False def draw(self, context): layout = self.layout @@ -324,7 +328,7 @@ class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.object - return CyclesButtonsPanel.poll(context) and ob and ob.type in ('MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META') # todo: 'LAMP' + return CyclesButtonsPanel.poll(context) and ob and ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META'} # todo: 'LAMP' def draw(self, context): layout = self.layout @@ -399,7 +403,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): split = layout.split() col = split.column(align=True) - if lamp.type in ('POINT', 'SUN', 'SPOT'): + if lamp.type in {'POINT', 'SUN', 'SPOT'}: col.prop(lamp, "shadow_soft_size", text="Size") elif lamp.type == 'AREA': col.prop(lamp, "shape", text="") @@ -460,7 +464,8 @@ class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): # world = context.world - return False # world and world.node_tree and CyclesButtonsPanel.poll(context) + # world and world.node_tree and CyclesButtonsPanel.poll(context) + return False def draw(self, context): layout = self.layout @@ -494,7 +499,8 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): # mat = context.material - return False # mat and mat.node_tree and CyclesButtonsPanel.poll(context) + # mat and mat.node_tree and CyclesButtonsPanel.poll(context) + return False def draw(self, context): layout = self.layout @@ -705,18 +711,20 @@ def draw_device(self, context): if scene.render.engine == "CYCLES": cscene = scene.cycles + layout.prop(cscene, "feature_set") + experimental = cscene.feature_set == 'EXPERIMENTAL' + available_devices = engine.available_devices() available_cuda = 'cuda' in available_devices - available_opencl = 'opencl' in available_devices + available_opencl = experimental and 'opencl' in available_devices if available_cuda or available_opencl: layout.prop(cscene, "device") if cscene.device == 'GPU' and available_cuda and available_opencl: layout.prop(cscene, "gpu_type") - if cscene.device == 'CPU' and engine.with_osl(): + if experimental and cscene.device == 'CPU' and engine.with_osl(): layout.prop(cscene, "shading_system") - def draw_pause(self, context): layout = self.layout scene = context.scene @@ -730,7 +738,7 @@ def draw_pause(self, context): def get_panels(): - return [ + return ( bpy.types.RENDER_PT_render, bpy.types.RENDER_PT_output, bpy.types.RENDER_PT_encoding, @@ -782,7 +790,8 @@ def get_panels(): bpy.types.PARTICLE_PT_field_weights, bpy.types.PARTICLE_PT_force_fields, bpy.types.PARTICLE_PT_vertexgroups, - bpy.types.PARTICLE_PT_custom_props] + bpy.types.PARTICLE_PT_custom_props, + ) def register(): diff --git a/intern/cycles/blender/addon/xml.py b/intern/cycles/blender/addon/xml.py deleted file mode 100644 index f17051d92dc..00000000000 --- a/intern/cycles/blender/addon/xml.py +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright 2011, Blender Foundation. -# -# 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. -# - -# <pep8 compliant> - -# XML exporter for generating test files, not intended for end users - -import os -import bpy -from bpy_extras.io_utils import ExportHelper -import xml.etree.ElementTree as etree -import xml.dom.minidom as dom - - -def strip(root): - root.text = None - root.tail = None - - for elem in root: - strip(elem) - - -def write(node, fname): - strip(node) - - s = etree.tostring(node) - s = dom.parseString(s).toprettyxml() - - f = open(fname, "w") - f.write(s) - - -class ExportCyclesXML(bpy.types.Operator, ExportHelper): - '''''' - bl_idname = "export_mesh.cycles_xml" - bl_label = "Export Cycles XML" - - filename_ext = ".xml" - - @classmethod - def poll(cls, context): - return context.active_object != None - - def execute(self, context): - filepath = bpy.path.ensure_ext(self.filepath, ".xml") - - # get mesh - scene = context.scene - obj = context.object - - if not obj: - raise Exception("No active object") - - mesh = obj.to_mesh(scene, True, 'PREVIEW') - - if not mesh: - raise Exception("No mesh data in active object") - - # generate mesh node - nverts = "" - verts = "" - P = "" - - for v in mesh.vertices: - P += "%f %f %f " % (v.co[0], v.co[1], v.co[2]) - - for i, f in enumerate(mesh.faces): - nverts += str(len(f.vertices)) + " " - - for v in f.vertices: - verts += str(v) + " " - verts += " " - - node = etree.Element('mesh', attrib={'nverts': nverts, 'verts': verts, 'P': P}) - - # write to file - write(node, filepath) - - return {'FINISHED'} - - -def register(): - pass - - -def unregister(): - pass - -if __name__ == "__main__": - register() diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 2bc79224e08..e247b3744fa 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -281,7 +281,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) mesh->name = ustring(b_ob_data.name().c_str()); if(b_mesh) { - if(cmesh.data && RNA_boolean_get(&cmesh, "use_subdivision")) + if(cmesh.data && experimental && RNA_boolean_get(&cmesh, "use_subdivision")) create_subd_mesh(mesh, b_mesh, &cmesh, used_shaders); else create_mesh(scene, mesh, b_mesh, used_shaders); @@ -294,7 +294,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) if(cmesh.data) { int method = RNA_enum_get(&cmesh, "displacement_method"); - if(method == 0) + if(method == 0 || !experimental) mesh->displacement_method = Mesh::DISPLACE_BUMP; else if(method == 1) mesh->displacement_method = Mesh::DISPLACE_TRUE; diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index cf8527b9760..930ac1d495a 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -127,19 +127,14 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Node * switch(b_node.type()) { /* not supported */ - case BL::ShaderNode::type_CAMERA: break; - case BL::ShaderNode::type_COMBRGB: break; case BL::ShaderNode::type_CURVE_RGB: break; case BL::ShaderNode::type_CURVE_VEC: break; case BL::ShaderNode::type_GEOMETRY: break; - case BL::ShaderNode::type_HUE_SAT: break; - case BL::ShaderNode::type_INVERT: break; case BL::ShaderNode::type_MATERIAL: break; case BL::ShaderNode::type_MATERIAL_EXT: break; case BL::ShaderNode::type_NORMAL: break; case BL::ShaderNode::type_OUTPUT: break; case BL::ShaderNode::type_SCRIPT: break; - case BL::ShaderNode::type_SEPRGB: break; case BL::ShaderNode::type_SQUEEZE: break; case BL::ShaderNode::type_TEXTURE: break; case BL::ShaderNode::type_VALTORGB: break; @@ -158,6 +153,14 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Node * node = value; break; } + case BL::ShaderNode::type_CAMERA: { + node = new CameraNode(); + break; + } + case BL::ShaderNode::type_INVERT: { + node = new InvertNode(); + break; + } case BL::ShaderNode::type_MIX_RGB: { BL::ShaderNodeMixRGB b_mix_node(b_node); MixNode *mix = new MixNode(); @@ -165,6 +168,18 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Node * node = mix; break; } + case BL::ShaderNode::type_SEPRGB: { + node = new SeparateRGBNode(); + break; + } + case BL::ShaderNode::type_COMBRGB: { + node = new CombineRGBNode(); + break; + } + case BL::ShaderNode::type_HUE_SAT: { + node = new HSVNode(); + break; + } case BL::ShaderNode::type_RGBTOBW: { node = new ConvertNode(SHADER_SOCKET_COLOR, SHADER_SOCKET_FLOAT); break; diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 36cf29de128..f7b1ca53fd3 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -47,7 +47,8 @@ BlenderSync::BlenderSync(BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene mesh_map(&scene_->meshes), light_map(&scene_->lights), world_map(NULL), - world_recalc(false) + world_recalc(false), + experimental(false) { scene = scene_; preview = preview_; @@ -134,6 +135,8 @@ void BlenderSync::sync_integrator() { PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); + experimental = (RNA_enum_get(&cscene, "feature_set") != 0); + Integrator *integrator = scene->integrator; Integrator previntegrator = *integrator; @@ -253,6 +256,9 @@ SessionParams BlenderSync::get_session_params(BL::Scene b_scene, bool background SessionParams params; PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); + /* feature set */ + bool experimental = (RNA_enum_get(&cscene, "feature_set") != 0); + /* device type */ params.device_type = DEVICE_CPU; @@ -262,7 +268,7 @@ SessionParams BlenderSync::get_session_params(BL::Scene b_scene, bool background if(device_type_available(types, dtype)) params.device_type = dtype; - else if(device_type_available(types, DEVICE_OPENCL)) + else if(experimental && device_type_available(types, DEVICE_OPENCL)) params.device_type = DEVICE_OPENCL; else if(device_type_available(types, DEVICE_CUDA)) params.device_type = DEVICE_CUDA; diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 2e7b8ed253d..bde3207e1be 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -100,6 +100,7 @@ private: Scene *scene; bool preview; + bool experimental; struct RenderLayerInfo { RenderLayerInfo() diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 67cff3f5873..38674c2c561 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -59,16 +59,18 @@ void BVHBuild::add_reference_mesh(NodeSpec& root, Mesh *mesh, int i) Mesh::Triangle t = mesh->triangles[j]; Reference ref; - ref.prim_index = j; - ref.prim_object = i; - for(int k = 0; k < 3; k++) { float3 pt = mesh->verts[t.v[k]]; ref.bounds.grow(pt); } - references.push_back(ref); - root.bounds.grow(ref.bounds); + if(ref.bounds.valid()) { + ref.prim_index = j; + ref.prim_object = i; + + references.push_back(ref); + root.bounds.grow(ref.bounds); + } } } diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index e32cbfcc8a7..83d3f79d96f 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -237,7 +237,10 @@ public: return cubin; #ifdef WITH_CUDA_BINARIES - cuda_error("CUDA binary kernel for this graphics card not found."); + if(major <= 1 && minor <= 2) + cuda_error(string_printf("CUDA device supported only with shader model 1.3 or up, found %d.%d.", major, minor)); + else + cuda_error("CUDA binary kernel for this graphics card not found."); return ""; #else /* if not, find CUDA compiler */ diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 73425486be1..601b95d262a 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -54,13 +54,16 @@ set(SRC_SVM_HEADERS svm/svm.h svm/svm_attribute.h svm/svm_bsdf.h + svm/svm_camera.h svm/svm_closure.h svm/svm_convert.h svm/svm_displace.h svm/svm_fresnel.h svm/svm_geometry.h svm/svm_gradient.h + svm/svm_hsv.h svm/svm_image.h + svm/svm_invert.h svm/svm_light_path.h svm/svm_magic.h svm/svm_mapping.h @@ -69,6 +72,7 @@ set(SRC_SVM_HEADERS svm/svm_musgrave.h svm/svm_noise.h svm/svm_noisetex.h + svm/svm_sepcomb_rgb.h svm/svm_sky.h svm/svm_tex_coord.h svm/svm_texture.h diff --git a/intern/cycles/kernel/SConscript b/intern/cycles/kernel/SConscript new file mode 100644 index 00000000000..c9beb3ad0ae --- /dev/null +++ b/intern/cycles/kernel/SConscript @@ -0,0 +1,50 @@ +#!/usr/bin/python +import sys +import os + +def normpath(path): + return os.path.abspath(os.path.normpath(path)) + +Import ('env') + +kernel_binaries = [] + +if env['WITH_BF_CYCLES_CUDA_BINARIES']: + kernel = env.Clone() + + # cuda info + nvcc = env['BF_CYCLES_CUDA_NVCC'] + cuda_archs = env['BF_CYCLES_CUDA_BINARIES_ARCH'] + + # build directory + root_build_dir = normpath(env['BF_BUILDDIR']) + build_dir = os.path.join(root_build_dir, 'intern/cycles/kernel') + + # source directories and files + source_dir = Dir('.').srcnode().path + kernel_file = os.path.join(source_dir, "kernel.cu") + util_dir = os.path.join(source_dir, "../util") + svm_dir = os.path.join(source_dir, "../svm") + + # nvcc flags + nvcc_flags = "--cubin -use_fast_math --ptxas-options=\"-v\" --maxrregcount=24" + nvcc_flags += " --opencc-options -OPT:Olimit=0" + nvcc_flags += " -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC" + nvcc_flags += " -I \"%s\" -I \"%s\"" % (util_dir, svm_dir) + + # dependencies + dependencies = ['kernel.cu'] + kernel.Glob('*.h') + kernel.Glob('../util/*.h') + kernel.Glob('svm/*.h') + + # add command for each cuda architecture + for arch in cuda_archs: + cubin_file = os.path.join(build_dir, "kernel_%s.cubin" % arch) + + command = "\"%s\" -arch=%s %s \"%s\" -o \"%s\"" % (nvcc, arch, nvcc_flags, kernel_file, cubin_file) + + kernel.Command(cubin_file, 'kernel.cu', command) + kernel.Depends(cubin_file, dependencies) + + kernel_binaries.append(cubin_file) + +Return('kernel_binaries') + diff --git a/intern/cycles/kernel/kernel_bvh.h b/intern/cycles/kernel/kernel_bvh.h index e98bb158f6e..35215fd0f9f 100644 --- a/intern/cycles/kernel/kernel_bvh.h +++ b/intern/cycles/kernel/kernel_bvh.h @@ -33,6 +33,15 @@ CCL_NAMESPACE_BEGIN #define BVH_NODE_SIZE 4 #define TRI_NODE_SIZE 3 +/* silly workaround for float extended precision that happens when compiling + without sse support on x86, it results in different results for float ops + that you would otherwise expect to compare correctly */ +#if !defined(__i386__) || defined(__SSE__) +#define NO_EXTENDED_PRECISION +#else +#define NO_EXTENDED_PRECISION volatile +#endif + __device_inline float3 bvh_inverse_direction(float3 dir) { /* avoid divide by zero (ooeps = exp2f(-80.0f)) */ @@ -94,17 +103,17 @@ __device_inline void bvh_node_intersect(KernelGlobals *kg, float c0hiy = n0xy.w * idir.y - ood.y; float c0loz = nz.x * idir.z - ood.z; float c0hiz = nz.y * idir.z - ood.z; + NO_EXTENDED_PRECISION float c0min = max4(min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz), 0.0f); + NO_EXTENDED_PRECISION float c0max = min4(max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz), t); + float c1loz = nz.z * idir.z - ood.z; float c1hiz = nz.w * idir.z - ood.z; - - float c0min = max4(min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz), 0.0f); - float c0max = min4(max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz), t); float c1lox = n1xy.x * idir.x - ood.x; float c1hix = n1xy.y * idir.x - ood.x; float c1loy = n1xy.z * idir.y - ood.y; float c1hiy = n1xy.w * idir.y - ood.y; - float c1min = max4(min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz), 0.0f); - float c1max = min4(max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz), t); + NO_EXTENDED_PRECISION float c1min = max4(min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz), 0.0f); + NO_EXTENDED_PRECISION float c1max = min4(max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz), t); /* decide which nodes to traverse next */ #ifdef __VISIBILITY_FLAG__ diff --git a/intern/cycles/kernel/osl/nodes/CMakeLists.txt b/intern/cycles/kernel/osl/nodes/CMakeLists.txt index 1b8b81eb6f6..433fc2155fe 100644 --- a/intern/cycles/kernel/osl/nodes/CMakeLists.txt +++ b/intern/cycles/kernel/osl/nodes/CMakeLists.txt @@ -7,6 +7,7 @@ set(SRC_OSL node_background.osl node_blend_texture.osl node_bump.osl + node_camera.osl node_clouds_texture.osl node_convert_from_color.osl node_convert_from_float.osl @@ -21,7 +22,9 @@ set(SRC_OSL node_geometry.osl node_glass_bsdf.osl node_glossy_bsdf.osl + node_hsv.osl node_image_texture.osl + node_invert.osl node_light_path.osl node_magic_texture.osl node_mapping.osl @@ -35,6 +38,7 @@ set(SRC_OSL node_output_displacement.osl node_output_surface.osl node_output_volume.osl + node_sepcomb_rgb.osl node_sky_texture.osl node_stucci_texture.osl node_texture_coordinate.osl diff --git a/intern/cycles/kernel/osl/nodes/node_camera.osl b/intern/cycles/kernel/osl/nodes/node_camera.osl new file mode 100644 index 00000000000..0b50084db0f --- /dev/null +++ b/intern/cycles/kernel/osl/nodes/node_camera.osl @@ -0,0 +1,33 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +#include "stdosl.h" + +shader node_camera( + output vector ViewVector = vector(0.0, 0.0, 0.0), + output float ViewZDepth = 0.0, + output float ViewDistance = 0.0) +{ + ViewVector = (vector)transform("world", "camera", P); + + ViewZDepth = fabs(ViewVector[2]); + ViewDistance = lenght(ViewVector); + + ViewVector = normalize(ViewVector); +} + diff --git a/intern/cycles/kernel/osl/nodes/node_color.h b/intern/cycles/kernel/osl/nodes/node_color.h index b92973d1dfe..37d092eae78 100644 --- a/intern/cycles/kernel/osl/nodes/node_color.h +++ b/intern/cycles/kernel/osl/nodes/node_color.h @@ -48,3 +48,78 @@ color color_scene_linear_to_srgb(color c) color_scene_linear_to_srgb(c[2])); } +/* Color Operations */ + +color rgb_to_hsv(color rgb) +{ + float cmax, cmin, h, s, v, cdelta; + color c; + + cmax = max(rgb[0], max(rgb[1], rgb[2])); + cmin = min(rgb[0], min(rgb[1], rgb[2])); + cdelta = cmax - cmin; + + v = cmax; + + if(cmax != 0.0) { + s = cdelta/cmax; + } + else { + s = 0.0; + h = 0.0; + } + + if(s == 0.0) { + h = 0.0; + } + else { + c = (color(cmax, cmax, cmax) - rgb)/cdelta; + + if(rgb[0] == cmax) h = c[2] - c[1]; + else if(rgb[1] == cmax) h = 2.0 + c[0] - c[2]; + else h = 4.0 + c[1] - c[0]; + + h /= 6.0; + + if(h < 0.0) + h += 1.0; + } + + return color(h, s, v); +} + +color hsv_to_rgb(color hsv) +{ + float i, f, p, q, t, h, s, v; + color rgb; + + h = hsv[0]; + s = hsv[1]; + v = hsv[2]; + + if(s==0.0) { + rgb = color(v, v, v); + } + else { + if(h==1.0) + h = 0.0; + + h *= 6.0; + i = floor(h); + f = h - i; + rgb = color(f, f, f); + p = v*(1.0-s); + q = v*(1.0-(s*f)); + t = v*(1.0-(s*(1.0-f))); + + if(i == 0.0) rgb = color(v, t, p); + else if(i == 1.0) rgb = color(q, v, p); + else if(i == 2.0) rgb = color(p, v, t); + else if(i == 3.0) rgb = color(p, q, v); + else if(i == 4.0) rgb = color(t, p, v); + else rgb = color(v, p, q); + } + + return rgb; +} + diff --git a/intern/cycles/kernel/osl/nodes/node_hsv.osl b/intern/cycles/kernel/osl/nodes/node_hsv.osl new file mode 100644 index 00000000000..da776c8909e --- /dev/null +++ b/intern/cycles/kernel/osl/nodes/node_hsv.osl @@ -0,0 +1,42 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +#include "stdosl.h" +#include "node_color.h" + +shader node_hsv( + float Hue = 0.5, + float Saturation = 1.0, + float Value = 1.0, + float Fac = 0.5, + color ColorIn = color(0.0, 0.0, 0.0), + output color ColorOut = color(0.0, 0.0, 0.0)) +{ + float t = clamp(Fac, 0.0, 1.0); + color Color = rgb_to_hsv(ColorIn); + + Color[0] += Hue - 0.5; + Color[0] = fmod(Color[0], 1.0); + Color[1] *= Saturation; + Color[2] *= Value; + + Color = hsv_to_rgb(Color); + + ColorOut = mix(Color, ColorIn, t); +} + diff --git a/intern/cycles/kernel/osl/nodes/node_invert.osl b/intern/cycles/kernel/osl/nodes/node_invert.osl new file mode 100644 index 00000000000..817198c4561 --- /dev/null +++ b/intern/cycles/kernel/osl/nodes/node_invert.osl @@ -0,0 +1,29 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +#include "stdosl.h" + +shader node_invert( + float Fac = 1.0, + color ColorIn = color(0.8, 0.8, 0.8), + output ColorOut = color(0.8, 0.8, 0.8) +{ + color ColorInv = color(1.0) - ColorIn; + ColorOut = mix(ColorIn, ColorInv, Fac); +} + diff --git a/intern/cycles/kernel/osl/nodes/node_mix.osl b/intern/cycles/kernel/osl/nodes/node_mix.osl index 582aa7b3c60..8a462c995d3 100644 --- a/intern/cycles/kernel/osl/nodes/node_mix.osl +++ b/intern/cycles/kernel/osl/nodes/node_mix.osl @@ -17,79 +17,7 @@ */ #include "stdosl.h" - -color rgb_to_hsv(color rgb) -{ - float cmax, cmin, h, s, v, cdelta; - color c; - - cmax = max(rgb[0], max(rgb[1], rgb[2])); - cmin = min(rgb[0], min(rgb[1], rgb[2])); - cdelta = cmax - cmin; - - v = cmax; - - if(cmax != 0.0) { - s = cdelta/cmax; - } - else { - s = 0.0; - h = 0.0; - } - - if(s == 0.0) { - h = 0.0; - } - else { - c = (color(cmax, cmax, cmax) - rgb)/cdelta; - - if(rgb[0] == cmax) h = c[2] - c[1]; - else if(rgb[1] == cmax) h = 2.0 + c[0] - c[2]; - else h = 4.0 + c[1] - c[0]; - - h /= 6.0; - - if(h < 0.0) - h += 1.0; - } - - return color(h, s, v); -} - -color hsv_to_rgb(color hsv) -{ - float i, f, p, q, t, h, s, v; - color rgb; - - h = hsv[0]; - s = hsv[1]; - v = hsv[2]; - - if(s==0.0) { - rgb = color(v, v, v); - } - else { - if(h==1.0) - h = 0.0; - - h *= 6.0; - i = floor(h); - f = h - i; - rgb = color(f, f, f); - p = v*(1.0-s); - q = v*(1.0-(s*f)); - t = v*(1.0-(s*(1.0-f))); - - if(i == 0.0) rgb = color(v, t, p); - else if(i == 1.0) rgb = color(q, v, p); - else if(i == 2.0) rgb = color(p, v, t); - else if(i == 3.0) rgb = color(p, q, v); - else if(i == 4.0) rgb = color(t, p, v); - else rgb = color(v, p, q); - } - - return rgb; -} +#include "node_color.h" color node_mix_blend(float t, color col1, color col2) { diff --git a/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl b/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl new file mode 100644 index 00000000000..a02f31f4b07 --- /dev/null +++ b/intern/cycles/kernel/osl/nodes/node_sepcomb_rgb.osl @@ -0,0 +1,40 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +#include "stdosl.h" + +shader node_separate_rgb( + color Image = color(0.8, 0.8, 0.8), + output float R = 0.0, + output float G = 0.0, + output float B = 0.0) +{ + R = Image[0]; + G = Image[1]; + B = Image[2]; +} + +shader node_combine_rgb( + float R = 0.0, + float G = 0.0, + float B = 0.0, + output color Image = color(0.8, 0.8, 0.8) +{ + Image = color(R, G, B) +} + diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h index 2615272691c..5fde44e2769 100644 --- a/intern/cycles/kernel/svm/svm.h +++ b/intern/cycles/kernel/svm/svm.h @@ -126,14 +126,18 @@ CCL_NAMESPACE_END #include "svm_convert.h" #include "svm_displace.h" #include "svm_fresnel.h" +#include "svm_camera.h" #include "svm_geometry.h" +#include "svm_hsv.h" #include "svm_image.h" +#include "svm_invert.h" #include "svm_light_path.h" #include "svm_magic.h" #include "svm_mapping.h" #include "svm_wave.h" #include "svm_math.h" #include "svm_mix.h" +#include "svm_sepcomb_rgb.h" #include "svm_musgrave.h" #include "svm_sky.h" #include "svm_tex_coord.h" @@ -230,6 +234,9 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT svm_node_tex_magic(kg, sd, stack, node, &offset); break; #endif + case NODE_CAMERA: + svm_node_camera(kg, sd, stack, node.y, node.z, node.w); + break; case NODE_GEOMETRY: svm_node_geometry(sd, stack, node.y, node.z); break; @@ -251,9 +258,21 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT case NODE_VALUE_V: svm_node_value_v(kg, sd, stack, node.y, &offset); break; + case NODE_INVERT: + svm_node_invert(sd, stack, node.y, node.z, node.w); + break; case NODE_MIX: svm_node_mix(kg, sd, stack, node.y, node.z, node.w, &offset); break; + case NODE_SEPARATE_RGB: + svm_node_separate_rgb(sd, stack, node.y, node.z, node.w); + break; + case NODE_COMBINE_RGB: + svm_node_combine_rgb(sd, stack, node.y, node.z, node.w); + break; + case NODE_HSV: + svm_node_hsv(kg, sd, stack, node.y, node.z, node.w, &offset); + break; case NODE_ATTR: svm_node_attr(kg, sd, stack, node); break; diff --git a/intern/cycles/kernel/svm/svm_camera.h b/intern/cycles/kernel/svm/svm_camera.h new file mode 100644 index 00000000000..cf161ddcd8c --- /dev/null +++ b/intern/cycles/kernel/svm/svm_camera.h @@ -0,0 +1,43 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +CCL_NAMESPACE_BEGIN + +__device void svm_node_camera(KernelGlobals *kg, ShaderData *sd, float *stack, uint out_vector, uint out_zdepth, uint out_distance) +{ + float distance; + float zdepth; + float3 vector; + + Transform tfm = kernel_data.cam.worldtocamera; + vector = transform(&tfm, sd->P); + zdepth = vector.z; + distance = len(vector); + + if (stack_valid(out_vector)) + stack_store_float3(stack, out_vector, normalize(vector)); + + if (stack_valid(out_zdepth)) + stack_store_float(stack, out_zdepth, zdepth); + + if (stack_valid(out_distance)) + stack_store_float(stack, out_distance, distance); +} + +CCL_NAMESPACE_END + diff --git a/intern/cycles/kernel/svm/svm_hsv.h b/intern/cycles/kernel/svm/svm_hsv.h new file mode 100644 index 00000000000..fc927f297f5 --- /dev/null +++ b/intern/cycles/kernel/svm/svm_hsv.h @@ -0,0 +1,131 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +#ifndef __SVM_HSV_H__ +#define __SVM_HSV_H__ + +CCL_NAMESPACE_BEGIN + +__device float3 rgb_to_hsv(float3 rgb) +{ + float cmax, cmin, h, s, v, cdelta; + float3 c; + + cmax = fmaxf(rgb.x, fmaxf(rgb.y, rgb.z)); + cmin = min(rgb.x, min(rgb.y, rgb.z)); + cdelta = cmax - cmin; + + v = cmax; + + if(cmax != 0.0f) { + s = cdelta/cmax; + } + else { + s = 0.0f; + h = 0.0f; + } + + if(s == 0.0f) { + h = 0.0f; + } + else { + float3 cmax3 = make_float3(cmax, cmax, cmax); + c = (cmax3 - rgb)/cdelta; + + if(rgb.x == cmax) h = c.z - c.y; + else if(rgb.y == cmax) h = 2.0f + c.x - c.z; + else h = 4.0f + c.y - c.x; + + h /= 6.0f; + + if(h < 0.0f) + h += 1.0f; + } + + return make_float3(h, s, v); +} + +__device float3 hsv_to_rgb(float3 hsv) +{ + float i, f, p, q, t, h, s, v; + float3 rgb; + + h = hsv.x; + s = hsv.y; + v = hsv.z; + + if(s==0.0f) { + rgb = make_float3(v, v, v); + } + else { + if(h==1.0f) + h = 0.0f; + + h *= 6.0f; + i = floor(h); + f = h - i; + rgb = make_float3(f, f, f); + p = v*(1.0f-s); + q = v*(1.0f-(s*f)); + t = v*(1.0f-(s*(1.0f-f))); + + if(i == 0.0f) rgb = make_float3(v, t, p); + else if(i == 1.0f) rgb = make_float3(q, v, p); + else if(i == 2.0f) rgb = make_float3(p, v, t); + else if(i == 3.0f) rgb = make_float3(p, q, v); + else if(i == 4.0f) rgb = make_float3(t, p, v); + else rgb = make_float3(v, p, q); + } + + return rgb; +} + +__device void svm_node_hsv(KernelGlobals *kg, ShaderData *sd, float *stack, uint in_color_offset, uint fac_offset, uint out_color_offset, int *offset) +{ + /* read extra data */ + uint4 node1 = read_node(kg, offset); + + float fac = stack_load_float(stack, fac_offset); + float3 in_color = stack_load_float3(stack, in_color_offset); + float3 color = in_color; + + float hue = stack_load_float(stack, node1.y); + float sat = stack_load_float(stack, node1.z); + float val = stack_load_float(stack, node1.w); + + color = rgb_to_hsv(color); + + color.x += hue - 0.5f; + color.x = fmod(color.x, 1.0f); + color.y *= sat; + color.z *= val; + + color = hsv_to_rgb(color); + + color.x = fac*color.x + (1.0f - fac)*in_color.x; + color.y = fac*color.y + (1.0f - fac)*in_color.y; + color.z = fac*color.z + (1.0f - fac)*in_color.z; + + if (stack_valid(out_color_offset)) + stack_store_float3(stack, out_color_offset, color); +} + +CCL_NAMESPACE_END + +#endif /* __SVM_HSV_H__ */ + diff --git a/intern/cycles/kernel/svm/svm_invert.h b/intern/cycles/kernel/svm/svm_invert.h new file mode 100644 index 00000000000..a14d8ec82fa --- /dev/null +++ b/intern/cycles/kernel/svm/svm_invert.h @@ -0,0 +1,40 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +CCL_NAMESPACE_BEGIN + +__device float invert(float color, float factor) +{ + return factor*(1.0f - color) + (1.0f - factor) * color; +} + +__device void svm_node_invert(ShaderData *sd, float *stack, uint in_fac, uint in_color, uint out_color) +{ + float factor = stack_load_float(stack, in_fac); + float3 color = stack_load_float3(stack, in_color); + + color.x = invert(color.x, factor); + color.y = invert(color.y, factor); + color.z = invert(color.z, factor); + + if (stack_valid(out_color)) + stack_store_float3(stack, out_color, color); +} + +CCL_NAMESPACE_END + diff --git a/intern/cycles/kernel/svm/svm_mix.h b/intern/cycles/kernel/svm/svm_mix.h index c9e6cdf43b9..e2274a2e691 100644 --- a/intern/cycles/kernel/svm/svm_mix.h +++ b/intern/cycles/kernel/svm/svm_mix.h @@ -16,81 +16,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -CCL_NAMESPACE_BEGIN - -__device float3 rgb_to_hsv(float3 rgb) -{ - float cmax, cmin, h, s, v, cdelta; - float3 c; - - cmax = fmaxf(rgb.x, fmaxf(rgb.y, rgb.z)); - cmin = min(rgb.x, min(rgb.y, rgb.z)); - cdelta = cmax - cmin; - - v = cmax; - - if(cmax != 0.0f) { - s = cdelta/cmax; - } - else { - s = 0.0f; - h = 0.0f; - } - - if(s == 0.0f) { - h = 0.0f; - } - else { - float3 cmax3 = make_float3(cmax, cmax, cmax); - c = (cmax3 - rgb)/cdelta; - - if(rgb.x == cmax) h = c.z - c.y; - else if(rgb.y == cmax) h = 2.0f + c.x - c.z; - else h = 4.0f + c.y - c.x; - - h /= 6.0f; +#include "svm_hsv.h" - if(h < 0.0f) - h += 1.0f; - } - - return make_float3(h, s, v); -} - -__device float3 hsv_to_rgb(float3 hsv) -{ - float i, f, p, q, t, h, s, v; - float3 rgb; - - h = hsv.x; - s = hsv.y; - v = hsv.z; - - if(s==0.0f) { - rgb = make_float3(v, v, v); - } - else { - if(h==1.0f) - h = 0.0f; - - h *= 6.0f; - i = floor(h); - f = h - i; - rgb = make_float3(f, f, f); - p = v*(1.0f-s); - q = v*(1.0f-(s*f)); - t = v*(1.0f-(s*(1.0f-f))); - - if(i == 0.0f) rgb = make_float3(v, t, p); - else if(i == 1.0f) rgb = make_float3(q, v, p); - else if(i == 2.0f) rgb = make_float3(p, v, t); - else if(i == 3.0f) rgb = make_float3(p, q, v); - else if(i == 4.0f) rgb = make_float3(t, p, v); - else rgb = make_float3(v, p, q); - } - - return rgb; -} +CCL_NAMESPACE_BEGIN __device float3 svm_lerp(const float3 a, const float3 b, float t) { diff --git a/intern/cycles/kernel/svm/svm_sepcomb_rgb.h b/intern/cycles/kernel/svm/svm_sepcomb_rgb.h new file mode 100644 index 00000000000..4e23221e3cd --- /dev/null +++ b/intern/cycles/kernel/svm/svm_sepcomb_rgb.h @@ -0,0 +1,44 @@ +/* + * Copyright 2011, Blender Foundation. + * + * 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. + */ + +CCL_NAMESPACE_BEGIN + +__device void svm_node_combine_rgb(ShaderData *sd, float *stack, uint in_offset, uint color_index, uint out_offset) +{ + float color = stack_load_float(stack, in_offset); + + if (stack_valid(out_offset)) + stack_store_float(stack, out_offset+color_index, color); +} + +__device void svm_node_separate_rgb(ShaderData *sd, float *stack, uint icolor_offset, uint color_index, uint out_offset) +{ + float3 color = stack_load_float3(stack, icolor_offset); + + if (stack_valid(out_offset)) { + if (color_index == 0) + stack_store_float(stack, out_offset, color.x); + else if (color_index == 1) + stack_store_float(stack, out_offset, color.y); + else + stack_store_float(stack, out_offset, color.z); + } +} + +CCL_NAMESPACE_END + diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h index 071477a83c7..efec5c7650d 100644 --- a/intern/cycles/kernel/svm/svm_types.h +++ b/intern/cycles/kernel/svm/svm_types.h @@ -79,7 +79,12 @@ typedef enum NodeType { NODE_TEX_ENVIRONMENT = 4600, NODE_CLOSURE_HOLDOUT = 4700, NODE_LAYER_WEIGHT = 4800, - NODE_CLOSURE_VOLUME = 4900 + NODE_CLOSURE_VOLUME = 4900, + NODE_SEPARATE_RGB = 5000, + NODE_COMBINE_RGB = 5100, + NODE_HSV = 5200, + NODE_CAMERA = 5300, + NODE_INVERT = 5400 } NodeType; typedef enum NodeAttributeType { diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 19992771c1d..fc2dd49205a 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -685,9 +685,9 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen if(!mesh->transform_applied) { string msg = "Updating Mesh BVH "; if(mesh->name == "") - msg += string_printf("%ld/%ld", i+1, num_instance_bvh); + msg += string_printf("%lu/%lu", (unsigned long)(i+1), (unsigned long)num_instance_bvh); else - msg += string_printf("%s %ld/%ld", mesh->name.c_str(), i+1, num_instance_bvh); + msg += string_printf("%s %lu/%lu", mesh->name.c_str(), (unsigned long)(i+1), (unsigned long)num_instance_bvh); progress.set_status(msg, "Building BVH"); mesh->compute_bvh(&scene->params, progress); diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index d7bd74c9ec7..45f0ab41775 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -1566,6 +1566,34 @@ void MixClosureNode::compile(OSLCompiler& compiler) compiler.add(this, "node_mix_closure"); } +/* Invert */ + +InvertNode::InvertNode() +: ShaderNode("invert") +{ + add_input("Fac", SHADER_SOCKET_FLOAT, 1.0f); + add_input("Color", SHADER_SOCKET_COLOR); + add_output("Color", SHADER_SOCKET_COLOR); +} + +void InvertNode::compile(SVMCompiler& compiler) +{ + ShaderInput *fac_in = input("Fac"); + ShaderInput *color_in = input("Color"); + ShaderOutput *color_out = output("Color"); + + compiler.stack_assign(fac_in); + compiler.stack_assign(color_in); + compiler.stack_assign(color_out); + + compiler.add_node(NODE_INVERT, fac_in->stack_offset, color_in->stack_offset, color_out->stack_offset); +} + +void InvertNode::compile(OSLCompiler& compiler) +{ + compiler.add(this, "node_invert"); +} + /* Mix */ MixNode::MixNode() @@ -1629,6 +1657,111 @@ void MixNode::compile(OSLCompiler& compiler) compiler.add(this, "node_mix"); } +/* Combine RGB */ +CombineRGBNode::CombineRGBNode() +: ShaderNode("combine_rgb") +{ + add_input("R", SHADER_SOCKET_FLOAT); + add_input("G", SHADER_SOCKET_FLOAT); + add_input("B", SHADER_SOCKET_FLOAT); + add_output("Image", SHADER_SOCKET_COLOR); +} + +void CombineRGBNode::compile(SVMCompiler& compiler) +{ + ShaderInput *red_in = input("R"); + ShaderInput *green_in = input("G"); + ShaderInput *blue_in = input("B"); + ShaderOutput *color_out = output("Image"); + + compiler.stack_assign(color_out); + + compiler.stack_assign(red_in); + compiler.add_node(NODE_COMBINE_RGB, red_in->stack_offset, 0, color_out->stack_offset); + + compiler.stack_assign(green_in); + compiler.add_node(NODE_COMBINE_RGB, green_in->stack_offset, 1, color_out->stack_offset); + + compiler.stack_assign(blue_in); + compiler.add_node(NODE_COMBINE_RGB, blue_in->stack_offset, 2, color_out->stack_offset); +} + +void CombineRGBNode::compile(OSLCompiler& compiler) +{ + compiler.add(this, "node_combine_rgb"); +} + +/* Separate RGB */ +SeparateRGBNode::SeparateRGBNode() +: ShaderNode("separate_rgb") +{ + add_input("Image", SHADER_SOCKET_COLOR); + add_output("R", SHADER_SOCKET_FLOAT); + add_output("G", SHADER_SOCKET_FLOAT); + add_output("B", SHADER_SOCKET_FLOAT); +} + +void SeparateRGBNode::compile(SVMCompiler& compiler) +{ + ShaderInput *color_in = input("Image"); + ShaderOutput *red_out = output("R"); + ShaderOutput *green_out = output("G"); + ShaderOutput *blue_out = output("B"); + + compiler.stack_assign(color_in); + + compiler.stack_assign(red_out); + compiler.add_node(NODE_SEPARATE_RGB, color_in->stack_offset, 0, red_out->stack_offset); + + compiler.stack_assign(green_out); + compiler.add_node(NODE_SEPARATE_RGB, color_in->stack_offset, 1, green_out->stack_offset); + + compiler.stack_assign(blue_out); + compiler.add_node(NODE_SEPARATE_RGB, color_in->stack_offset, 2, blue_out->stack_offset); +} + +void SeparateRGBNode::compile(OSLCompiler& compiler) +{ + compiler.add(this, "node_separate_rgb"); +} + +/* Separate RGB */ +HSVNode::HSVNode() +: ShaderNode("hsv") +{ + add_input("Hue", SHADER_SOCKET_FLOAT); + add_input("Saturation", SHADER_SOCKET_FLOAT); + add_input("Value", SHADER_SOCKET_FLOAT); + add_input("Fac", SHADER_SOCKET_FLOAT); + add_input("Color", SHADER_SOCKET_COLOR); + add_output("Color", SHADER_SOCKET_COLOR); +} + +void HSVNode::compile(SVMCompiler& compiler) +{ + ShaderInput *hue_in = input("Hue"); + ShaderInput *saturation_in = input("Saturation"); + ShaderInput *value_in = input("Value"); + ShaderInput *fac_in = input("Fac"); + ShaderInput *color_in = input("Color"); + ShaderOutput *color_out = output("Color"); + + compiler.stack_assign(hue_in); + compiler.stack_assign(saturation_in); + compiler.stack_assign(value_in); + compiler.stack_assign(fac_in); + compiler.stack_assign(color_in); + compiler.stack_assign(color_out); + + compiler.add_node(NODE_HSV, color_in->stack_offset, fac_in->stack_offset, color_out->stack_offset); + compiler.add_node(NODE_HSV, hue_in->stack_offset, saturation_in->stack_offset, value_in->stack_offset); +} + +void HSVNode::compile(OSLCompiler& compiler) +{ + compiler.add(this, "node_hsv"); +} + /* Attribute */ AttributeNode::AttributeNode() @@ -1699,6 +1832,33 @@ void AttributeNode::compile(OSLCompiler& compiler) compiler.add(this, "node_attribute"); } +/* Camera */ + +CameraNode::CameraNode() +: ShaderNode("camera") +{ + add_output("View Vector", SHADER_SOCKET_VECTOR); + add_output("View Z Depth", SHADER_SOCKET_FLOAT); + add_output("View Distance", SHADER_SOCKET_FLOAT); +} + +void CameraNode::compile(SVMCompiler& compiler) +{ + ShaderOutput *vector_out = output("View Vector"); + ShaderOutput *z_depth_out = output("View Z Depth"); + ShaderOutput *distance_out = output("View Distance"); + + compiler.stack_assign(vector_out); + compiler.stack_assign(z_depth_out); + compiler.stack_assign(distance_out); + compiler.add_node(NODE_CAMERA, vector_out->stack_offset, z_depth_out->stack_offset, distance_out->stack_offset); +} + +void CameraNode::compile(OSLCompiler& compiler) +{ + compiler.add(this, "node_camera"); +} + /* Fresnel */ FresnelNode::FresnelNode() diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index d9cbd7ff589..e08651cf1eb 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -284,6 +284,11 @@ public: SHADER_NODE_CLASS(MixClosureNode) }; +class InvertNode : public ShaderNode { +public: + SHADER_NODE_CLASS(InvertNode) +}; + class MixNode : public ShaderNode { public: SHADER_NODE_CLASS(MixNode) @@ -292,6 +297,21 @@ public: static ShaderEnum type_enum; }; +class CombineRGBNode : public ShaderNode { +public: + SHADER_NODE_CLASS(CombineRGBNode) +}; + +class SeparateRGBNode : public ShaderNode { +public: + SHADER_NODE_CLASS(SeparateRGBNode) +}; + +class HSVNode : public ShaderNode { +public: + SHADER_NODE_CLASS(HSVNode) +}; + class AttributeNode : public ShaderNode { public: SHADER_NODE_CLASS(AttributeNode) @@ -300,6 +320,11 @@ public: ustring attribute; }; +class CameraNode : public ShaderNode { +public: + SHADER_NODE_CLASS(CameraNode) +}; + class FresnelNode : public ShaderNode { public: SHADER_NODE_CLASS(FresnelNode) diff --git a/intern/cycles/subd/subd_mesh.cpp b/intern/cycles/subd/subd_mesh.cpp index 8ed4854b786..3e6e0de48ea 100644 --- a/intern/cycles/subd/subd_mesh.cpp +++ b/intern/cycles/subd/subd_mesh.cpp @@ -88,7 +88,7 @@ SubdFace *SubdMesh::add_face(int *index, int num) /* test non-manifold cases */ if(!can_add_face(index, num)) { /* we could try to add face in opposite winding instead .. */ - fprintf(stderr, "Warning: non manifold mesh, invalid face '%lu'.\n", faces.size()); + fprintf(stderr, "Warning: non manifold mesh, invalid face '%lu'.\n", (unsigned long)faces.size()); return NULL; } diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h index 34cc1d6e11c..0114a9a26a5 100644 --- a/intern/cycles/util/util_boundbox.h +++ b/intern/cycles/util/util_boundbox.h @@ -19,11 +19,15 @@ #ifndef __UTIL_BOUNDBOX_H__ #define __UTIL_BOUNDBOX_H__ +#include <math.h> #include <float.h> +#include "util_math.h" #include "util_transform.h" #include "util_types.h" +using namespace std; + CCL_NAMESPACE_BEGIN class BoundBox @@ -71,7 +75,9 @@ public: bool valid(void) const { - return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z); + return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z) && + !(isnan(min.x) || isnan(min.y) || isnan(min.z)) && + !(isnan(max.x) || isnan(max.y) || isnan(max.z)); } BoundBox transformed(const Transform *tfm) diff --git a/intern/cycles/util/util_cache.h b/intern/cycles/util/util_cache.h index 91e8a94a584..6e3c7c47e39 100644 --- a/intern/cycles/util/util_cache.h +++ b/intern/cycles/util/util_cache.h @@ -106,7 +106,7 @@ public: data.resize(size/sizeof(T)); if(!fread(&data[0], size, 1, f)) { - fprintf(stderr, "Failed to read vector data from cache (%ld).\n", size); + fprintf(stderr, "Failed to read vector data from cache (%lu).\n", (unsigned long)size); return; } } diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 2f9e00dbfcb..7c56f0fbb12 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -63,6 +63,7 @@ CCL_NAMESPACE_BEGIN #if(!defined(FREE_WINDOWS)) #define copysignf(x, y) ((float)_copysign(x, y)) #define hypotf(x, y) _hypotf(x, y) +#define isnan(x) _isnan(x) #endif #endif diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index abf5e08de97..e8c81e57654 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -142,15 +142,15 @@ bool system_cpu_support_optimized() static bool caps_init = false; if(!caps_init) { - int result[4], num, num_ex; + int result[4], num; //, num_ex; memset(&caps, 0, sizeof(caps)); __cpuid(result, 0); num = result[0]; - __cpuid(result, 0x80000000); - num_ex = result[0]; + /*__cpuid(result, 0x80000000); + num_ex = result[0];*/ if(num >= 1){ __cpuid(result, 0x00000001); diff --git a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp index cc8d2497f37..4fdbbf8f9d4 100644 --- a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp +++ b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp @@ -1,14 +1,10 @@ -/** \file memutil/intern/MEM_CacheLimiterC-Api.cpp - * \ingroup memutil - */ -/** +/* + * ***** 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 @@ -21,6 +17,11 @@ * * Contributor(s): Peter Schlaile <peter@schlaile.de> 2005 * + * ***** BEGIN GPL LICENSE BLOCK ***** + */ + +/** \file memutil/intern/MEM_CacheLimiterC-Api.cpp + * \ingroup memutil */ #include <cstddef> diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index de662b47c4d..21f856a1396 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -235,7 +235,8 @@ def enable(module_name, default_set=True): # reload if the mtime changes mod = sys.modules.get(module_name) - if mod: + # chances of the file _not_ existing are low, but it could be removed + if mod and os.path.exists(mod.__file__): mod.__addon_enabled__ = False mtime_orig = getattr(mod, "__time__", 0) mtime_new = os.path.getmtime(mod.__file__) @@ -252,6 +253,7 @@ def enable(module_name, default_set=True): # Split registering up into 3 steps so we can undo # if it fails par way through. + # 1) try import try: mod = __import__(module_name) diff --git a/release/scripts/presets/tracking_settings/blurry_movie.py b/release/scripts/presets/tracking_settings/blurry_movie.py new file mode 100644 index 00000000000..8a503bec9bd --- /dev/null +++ b/release/scripts/presets/tracking_settings/blurry_movie.py @@ -0,0 +1,11 @@ +import bpy +settings = bpy.context.edit_movieclip.tracking.settings + +settings.default_tracker = 'KLT' +settings.default_pyramid_levels = 4 +settings.default_correlation_min = 0.75 +settings.default_pattern_size = 11 +settings.default_search_size = 202 +settings.default_frames_limit = 25 +settings.default_pattern_match = 'KEYFRAME' +settings.default_margin = 0 diff --git a/release/scripts/presets/tracking_settings/default.py b/release/scripts/presets/tracking_settings/default.py new file mode 100644 index 00000000000..4b2d41bf292 --- /dev/null +++ b/release/scripts/presets/tracking_settings/default.py @@ -0,0 +1,11 @@ +import bpy +settings = bpy.context.edit_movieclip.tracking.settings + +settings.default_tracker = 'KLT' +settings.default_pyramid_levels = 2 +settings.default_correlation_min = 0.75 +settings.default_pattern_size = 11 +settings.default_search_size = 51 +settings.default_frames_limit = 0 +settings.default_pattern_match = 'KEYFRAME' +settings.default_margin = 0 diff --git a/release/scripts/presets/tracking_settings/fast_motion.py b/release/scripts/presets/tracking_settings/fast_motion.py new file mode 100644 index 00000000000..a3d382e6700 --- /dev/null +++ b/release/scripts/presets/tracking_settings/fast_motion.py @@ -0,0 +1,11 @@ +import bpy +settings = bpy.context.edit_movieclip.tracking.settings + +settings.default_tracker = 'KLT' +settings.default_pyramid_levels = 2 +settings.default_correlation_min = 0.75 +settings.default_pattern_size = 11 +settings.default_search_size = 121 +settings.default_frames_limit = 0 +settings.default_pattern_match = 'KEYFRAME' +settings.default_margin = 0 diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 269871b7230..11d545849ef 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -40,14 +40,14 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user): bgpic = None for x in space_v3d.background_images: - if x.source == 'MOVIE': + if x.source == 'MOVIE_CLIP': bgpic = x break if not bgpic: bgpic = space_v3d.background_images.new() - bgpic.source = 'MOVIE' + bgpic.source = 'MOVIE_CLIP' bgpic.clip = clip bgpic.clip_user.proxy_render_size = user.proxy_render_size bgpic.clip_user.use_render_undistorted = True diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index 7aea18487f3..965231218a4 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -22,7 +22,7 @@ import bpy from bpy.types import Operator -def randomize_selected(seed, delta, loc, rot, scale, scale_even): +def randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min): import random from random import uniform @@ -62,20 +62,16 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even): else: org_sca_x, org_sca_y, org_sca_z = obj.scale - if scale_even: - sca_x = sca_y = sca_z = uniform(scale[0], - scale[0]) - uniform(0.0, 0.0), uniform(0.0, 0.0) - else: - sca_x, sca_y, sca_z = rand_vec(scale) + sca_x, sca_y, sca_z = uniform(-scale[0]+2, scale[0]), uniform(-scale[1]+2, scale[1]), uniform(-scale[2]+2, scale[2]) if scale_even: - aX = -(sca_x * org_sca_x) + org_sca_x - aY = -(sca_x * org_sca_y) + org_sca_y - aZ = -(sca_x * org_sca_z) + org_sca_z + aX = sca_x * org_sca_x + aY = sca_x * org_sca_y + aZ = sca_x * org_sca_z else: - aX = sca_x + org_sca_x - aY = sca_y + org_sca_y - aZ = sca_z + org_sca_z + aX = sca_x * org_sca_x + aY = sca_y * org_sca_y + aZ = sca_z * org_sca_z if delta: obj.delta_scale = aX, aY, aZ @@ -85,7 +81,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even): uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) -from bpy.props import IntProperty, BoolProperty, FloatVectorProperty +from bpy.props import IntProperty, BoolProperty, FloatProperty, FloatVectorProperty class RandomizeLocRotSize(Operator): @@ -98,7 +94,7 @@ class RandomizeLocRotSize(Operator): name="Random Seed", description="Seed value for the random generator", min=0, - max=1000, + max=10000, default=0, ) use_delta = BoolProperty( @@ -157,7 +153,7 @@ class RandomizeLocRotSize(Operator): description="Maximum scale randomization over each axis", min=-100.0, max=100.0, - default=(0.0, 0.0, 0.0), + default=(1.0, 1.0, 1.0), subtype='TRANSLATION', ) @@ -174,7 +170,8 @@ class RandomizeLocRotSize(Operator): scale_even = self.scale_even #scale_min = self.scale_min + scale_min = 0 - randomize_selected(seed, delta, loc, rot, scale, scale_even) + randomize_selected(seed, delta, loc, rot, scale, scale_even, scale_min) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 100b21fc303..a5c8c280616 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -360,6 +360,30 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator): preset_subdir = "tracking_track_color" +class AddPresetTrackingSettings(AddPresetBase, Operator): + '''Add a motion tracking settings preset''' + bl_idname = "clip.tracking_settings_preset_add" + bl_label = "Add Tracking Settings Preset" + preset_menu = "CLIP_MT_tracking_settings_presets" + + preset_defines = [ + "settings = bpy.context.edit_movieclip.tracking.settings" + ] + + preset_values = [ + "settings.default_tracker", + "settings.default_pyramid_levels", + "settings.default_correlation_min", + "settings.default_pattern_size", + "settings.default_search_size", + "settings.default_frames_limit", + "settings.default_pattern_match", + "settings.default_margin" + ] + + preset_subdir = "tracking_settings" + + class AddPresetKeyconfig(AddPresetBase, Operator): '''Add a Keyconfig Preset''' bl_idname = "wm.keyconfig_preset_add" diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 9f67edd7653..d16b2f15f52 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -166,6 +166,10 @@ class TEXTURE_PT_preview(TextureButtonsPanel, Panel): layout.template_preview(tex, parent=idblock, slot=slot) else: layout.template_preview(tex, slot=slot) + + #Show Alpha Button for Brush Textures, see #29502 + if context.space_data.texture_context == 'BRUSH': + layout.prop(tex, "use_preview_alpha") class TEXTURE_PT_colors(TextureButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index b04d81b6b2a..5cdd1de547f 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -92,6 +92,9 @@ class CLIP_PT_tools_marker(Panel): return clip and sc.mode == 'TRACKING' def draw(self, context): + sc = context.space_data + clip = sc.clip + settings = clip.tracking.settings layout = self.layout col = layout.column(align=True) @@ -99,6 +102,45 @@ class CLIP_PT_tools_marker(Panel): col.operator("clip.detect_features") col.operator("clip.delete_track") + box = layout.box() + row = box.row(align=True) + row.prop(settings, "show_default_expanded", text="", emboss=False) + row.label(text="Tracking Settings") + + if settings.show_default_expanded: + col = box.column() + row = col.row(align=True) + label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label + row.menu('CLIP_MT_tracking_settings_presets', text=label) + row.operator("clip.tracking_settings_preset_add", + text="", icon='ZOOMIN') + props = row.operator("clip.track_color_preset_add", + text="", icon='ZOOMOUT') + props.remove_active = True + + col.separator() + + sub = col.column(align=True) + sub.prop(settings, "default_pattern_size") + sub.prop(settings, "default_search_size") + + col.label(text="Tracker:") + col.prop(settings, "default_tracker", text="") + + if settings.default_tracker == 'KLT': + col.prop(settings, "default_pyramid_levels") + elif settings.default_tracker == 'SAD': + col.prop(settings, "default_correlation_min") + + col.separator() + + sub = col.column(align=True) + sub.prop(settings, "default_frames_limit") + sub.prop(settings, "default_margin") + + col.label(text="Match:") + col.prop(settings, "default_pattern_match", text="") + class CLIP_PT_tools_tracking(Panel): bl_space_type = 'CLIP_EDITOR' @@ -447,18 +489,23 @@ class CLIP_PT_track_settings(Panel): clip = context.space_data.clip settings = clip.tracking.settings + col = layout.column() + active = clip.tracking.tracks.active if active: - layout.prop(active, "tracker") + col.prop(active, "tracker") + if active.tracker == 'KLT': - layout.prop(active, "pyramid_levels") + col.prop(active, "pyramid_levels") elif active.tracker == 'SAD': - layout.prop(active, "correlation_min") + col.prop(active, "correlation_min") + + col.separator() + col.prop(active, "frames_limit") + col.prop(active, "margin") + col.prop(active, "pattern_match", text="Match") - layout.prop(settings, "frames_adjust") - layout.prop(settings, "speed") - layout.prop(settings, "frames_limit") - layout.prop(settings, "margin") + col.prop(settings, "speed") class CLIP_PT_stabilization(Panel): @@ -767,7 +814,7 @@ class CLIP_MT_reconstruction(Menu): layout.separator() layout.operator("clip.track_to_empty") - layout.operator("clip.tracks_to_mesh") + layout.operator("clip.bundles_to_mesh") class CLIP_MT_track_visibility(Menu): @@ -866,6 +913,14 @@ class CLIP_MT_track_color_presets(Menu): draw = bpy.types.Menu.draw_preset +class CLIP_MT_tracking_settings_presets(Menu): + """Predefined tracking settings""" + bl_label = "Tracking Presets" + preset_subdir = "tracking_settings" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + + class CLIP_MT_track_color_specials(Menu): bl_label = "Track Color Specials" diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 2d22a398624..56a48ad77b9 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -359,8 +359,8 @@ class INFO_MT_help(Menu): layout = self.layout - layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual' - layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-260/' + 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="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-261/' layout.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 67a8c28ddb8..ac8c8e0dbb8 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2308,10 +2308,16 @@ class VIEW3D_PT_background_image(Panel): row.prop(bg, "show_expanded", text="", emboss=False) if bg.source == 'IMAGE' and bg.image: row.prop(bg.image, "name", text="", emboss=False) - elif bg.source == 'MOVIE' and bg.clip: + elif bg.source == 'MOVIE_CLIP' and bg.clip: row.prop(bg.clip, "name", text="", emboss=False) else: row.label(text="Not Set") + + if bg.show_background_image: + row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF') + else: + row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON') + row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i box.prop(bg, "view_axis", text="Axis") @@ -2328,7 +2334,7 @@ class VIEW3D_PT_background_image(Panel): box.template_image(bg, "image", bg.image_user, compact=True) has_bg = True - elif bg.source == 'MOVIE': + elif bg.source == 'MOVIE_CLIP': box.prop(bg, 'use_camera_clip') column = box.column() diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index c7922a0dfa1..bc0252aa616 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -354,7 +354,7 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # custom properties def doCustomProps(ksi, ks, bone): - prop_type_compat = {bpy.types.BooleanProperty, + prop_type_compat = {bpy.types.BoolProperty, bpy.types.IntProperty, bpy.types.FloatProperty} diff --git a/release/text/readme.html b/release/text/readme.html index 8c5ead49036..0627624d2e7 100644 --- a/release/text/readme.html +++ b/release/text/readme.html @@ -12,18 +12,18 @@ </style> </head> <body> -<p class="title"><b>Blender 2.60</b></p> +<p class="title"><b>Blender 2.61</b></p> <p><br></p> <p class="header"><b>About</b></p> <p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.</p> <p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p> <p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p> <p><br></p> -<p class="header"><b>2.60</b></p> -<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.60. This release is the first official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-260/">More information about this release</a>.</p> +<p class="header"><b>2.61</b></p> +<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.61. This release is the second official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-261/">More information about this release</a>.</p> <p><br></p> <p class="header"><b>Bugs</b></p> -<p class="body">Although Blender 2.60 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p> +<p class="body">Although Blender 2.61 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p> <p><br></p> <p class="header"><b>Package Contents</b></p> <p class="body">The downloaded Blender package includes:</p> @@ -47,7 +47,7 @@ <p class="header"><b>Links</b></p> <p class="body">Users:</p> <p class="body"> General information <a href="http://www.blender.org">www.blender.org</a> <br> - Full release log <a href="http://www.blender.org/development/release-logs/blender-260/">www.blender.org/development/release-logs/blender-260/</a><br> + Full release log <a href="http://www.blender.org/development/release-logs/blender-261/">www.blender.org/development/release-logs/blender-261/</a><br> Tutorials <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a> <br> Manual <a href="http://wiki.blender.org/index.php/Doc:Manual">wiki.blender.org/index.php/Doc:Manual</a><br> User Forum <a href="http://www.blenderartists.org">www.blenderartists.org</a><br> diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 6a6e71eac22..08ed019e26e 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -38,6 +38,7 @@ set(SRC_DNA_INC ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_controller_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_curve_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_customdata_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_defs.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_documentation.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_dynamicpaint_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_effect_types.h diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 84f1bf75a3f..429d5e84785 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -255,7 +255,11 @@ struct DerivedMesh { */ void (*drawFacesTex)(DerivedMesh *dm, int (*setDrawOptions)(struct MTFace *tface, - int has_mcol, int matnr)); + int has_mcol, int matnr), + int (*compareDrawOptions)(void *userData, + int cur_index, + int next_index), + void *userData); /* Draw all faces with GLSL materials * o setMaterial is called for every different material nr @@ -280,9 +284,11 @@ struct DerivedMesh { void (*drawMappedFaces)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), - void *userData, int useColors, int (*setMaterial)(int, void *attribs), - int (*compareDrawOptions)(void *userData, int cur_index, int next_index)); + int (*compareDrawOptions)(void *userData, + int cur_index, + int next_index), + void *userData, int useColors); /* Draw mapped faces using MTFace * o Drawing options too complicated to enumerate, look at code. @@ -290,6 +296,9 @@ struct DerivedMesh { void (*drawMappedFacesTex)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), + int (*compareDrawOptions)(void *userData, + int cur_index, + int next_index), void *userData); /* Draw mapped faces with GLSL materials @@ -299,7 +308,8 @@ struct DerivedMesh { */ void (*drawMappedFacesGLSL)(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), - int (*setDrawOptions)(void *userData, int index), void *userData); + int (*setDrawOptions)(void *userData, int index), + void *userData); /* Draw mapped edges as lines * o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge) @@ -554,6 +564,16 @@ typedef struct DMVertexAttribs { int tottface, totmcol, tottang, totorco; } DMVertexAttribs; +/* should be local, bmesh replaces this */ +typedef struct { + DerivedMesh dm; + + struct EditMesh *em; + float (*vertexCos)[3]; + float (*vertexNos)[3]; + float (*faceNos)[3]; +} EditMeshDerivedMesh; + void DM_vertex_attributes_from_gpu(DerivedMesh *dm, struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs); diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index fdd876ff29b..8738dc0830a 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 260 -#define BLENDER_SUBVERSION 5 +#define BLENDER_SUBVERSION 6 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h index 9739a5eacf2..c8df6c4f455 100644 --- a/source/blender/blenkernel/BKE_bmesh.h +++ b/source/blender/blenkernel/BKE_bmesh.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/BKE_bmeshCustomData.h b/source/blender/blenkernel/BKE_bmeshCustomData.h index 2c6449eb290..793410371df 100644 --- a/source/blender/blenkernel/BKE_bmeshCustomData.h +++ b/source/blender/blenkernel/BKE_bmeshCustomData.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 5497866b9df..f6b4240a026 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -285,7 +285,8 @@ void CustomData_validate_layer_name(const struct CustomData *data, int type, cha int CustomData_verify_versions(struct CustomData *data, int index); /*BMesh specific customdata stuff*/ -void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata); +void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, + struct CustomData *ldata); void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *pdata, struct CustomData *ldata, int total); void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize); diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index 3e643fe961c..ed8ea691134 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -52,13 +52,16 @@ void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob); struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int defgroup); struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup); +void defvert_remove_index(struct MDeformVert *dvert, int defgroup, struct MDeformWeight *dw); -float defvert_find_weight(const struct MDeformVert *dvert, const int group_num); -float defvert_array_find_weight_safe(const struct MDeformVert *dvert, int index, int group_num); +float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup); +float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup); -void defvert_copy(struct MDeformVert *dvert_r, const struct MDeformVert *dvert); -void defvert_sync(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, int use_verify); -void defvert_sync_mapped(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, const int *flip_map, const int flip_map_len, const int use_verify); +void defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src); +void defvert_copy_index(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const int defgroup); +void defvert_sync(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, int use_verify); +void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, + const int *flip_map, const int flip_map_len, const int use_verify); void defvert_remap (struct MDeformVert *dvert, int *map); void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len); void defvert_normalize(struct MDeformVert *dvert); diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index e0b8e40d731..5d475903feb 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -121,7 +121,7 @@ void DAG_id_tag_update(struct ID *id, short flag); /* flush all tagged updates */ void DAG_ids_flush_tagged(struct Main *bmain); /* check and clear ID recalc flags */ -void DAG_ids_check_recalc(struct Main *bmain); +void DAG_ids_check_recalc(struct Main *bmain, struct Scene *scene, int time); void DAG_ids_clear_recalc(struct Main *bmain); /* test if any of this id type is tagged for update */ void DAG_id_type_tag(struct Main *bmain, short idtype); @@ -131,7 +131,8 @@ int DAG_id_type_tagged(struct Main *bmain, short idtype); void DAG_pose_sort(struct Object *ob); /* callback for editors module to do updates */ -void DAG_editors_update_cb(void (*func)(struct Main *bmain, struct ID *id)); +void DAG_editors_update_cb(void (*id_func)(struct Main *bmain, struct ID *id), + void (*scene_func)(struct Main *bmain, struct Scene *scene, int updated)); /* debugging */ void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index 7f4e809718c..3ebd57dde39 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -109,15 +109,10 @@ typedef struct EffectorCache { int flag; } EffectorCache; -void free_effect(struct Effect *eff); -void free_effects(struct ListBase *lb); struct Effect *copy_effect(struct Effect *eff); void copy_effects(struct ListBase *lbn, struct ListBase *lb); void deselectall_eff(struct Object *ob); -struct PartEff *give_parteff(struct Object *ob); - - void free_partdeflect(struct PartDeflect *pd); struct ListBase *pdInitEffectors(struct Scene *scene, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights); void pdEndEffectors(struct ListBase **effectors); diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index 554314c419a..044a40658c3 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -52,8 +52,10 @@ int group_is_animated(struct Object *parent, struct Group *group); void group_tag_recalc(struct Group *group); void group_handle_recalc_and_update(struct Scene *scene, struct Object *parent, struct Group *group); +#if 0 /* UNUSED */ struct Object *group_get_member_with_action(struct Group *group, struct bAction *act); void group_relink_nla_objects(struct Object *ob); +#endif #endif diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index ade055ac457..e8d6c85664b 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -49,7 +49,7 @@ void *alloc_libblock(struct ListBase *lb, short type, const char *name); void *copy_libblock(struct ID *id); void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action); -void BKE_id_lib_local_paths(struct Main *bmain, struct ID *id); +void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id); void id_lib_extern(struct ID *id); void BKE_library_filepath_set(struct Library *lib, const char *filepath); void id_us_plus(struct ID *id); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 900835940c7..232aa46575e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -132,12 +132,6 @@ void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *m void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge, const int totvert, const int totedge); -/* Partial Mesh Visibility */ -struct PartialVisibility *mesh_pmv_copy(struct PartialVisibility *); -void mesh_pmv_free(struct PartialVisibility *); -void mesh_pmv_revert(struct Mesh *me); -void mesh_pmv_off(struct Mesh *me); - /* functions for making menu's from customdata layers */ int mesh_layers_menu_charlen(struct CustomData *data, int type); /* use this to work out how many chars to allocate */ void mesh_layers_menu_concat(struct CustomData *data, int type, char *str); diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 82e42ae27e2..5dbf22b54bf 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 5eb9529b2fc..b5a5090a5eb 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -128,7 +128,7 @@ void object_tfm_restore(struct Object *ob, void *obtfm_pt); typedef struct ObjectTfmProtectedChannels { float loc[3], dloc[3]; - float size[3], dsize[3]; + float size[3], dscale[3]; float rot[3], drot[3]; float quat[4], dquat[4]; float rotAxis[3], drotAxis[3]; diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 7cb31505430..2df5e7ac2c6 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -90,7 +90,6 @@ float BKE_curframe(struct Scene *scene); float BKE_frame_to_ctime(struct Scene *scene, const float frame); void scene_update_tagged(struct Main *bmain, struct Scene *sce); -void scene_clear_tagged(struct Main *bmain, struct Scene *sce); void scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 715febf2fd1..3a4ac279852 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index af852d49d82..e55d40ebfe5 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -34,6 +34,7 @@ struct bGPDlayer; struct ImBuf; +struct MovieReconstructContext; struct MovieTrackingTrack; struct MovieTrackingMarker; struct MovieTracking; @@ -44,6 +45,7 @@ struct Camera; struct Object; struct Scene; +void BKE_tracking_init_settings(struct MovieTracking *tracking); void BKE_tracking_clamp_track(struct MovieTrackingTrack *track, int event); void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int flag, int clear); @@ -58,7 +60,6 @@ struct MovieTrackingMarker *BKE_tracking_exact_marker(struct MovieTrackingTrack int BKE_tracking_has_marker(struct MovieTrackingTrack *track, int framenr); void BKE_tracking_free_track(struct MovieTrackingTrack *track); -struct MovieTrackingTrack *BKE_tracking_copy_track(struct MovieTrackingTrack *track); void BKE_tracking_clear_path(struct MovieTrackingTrack *track, int ref_frame, int action); @@ -91,9 +92,14 @@ void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingCont int BKE_tracking_next(struct MovieTrackingContext *context); /* Camera solving */ -int BKE_tracking_can_solve(struct MovieTracking *tracking, char *error_msg, int error_size); - -float BKE_tracking_solve_reconstruction(struct MovieTracking *tracking, int width, int height); +int BKE_tracking_can_reconstruct(struct MovieTracking *tracking, char *error_msg, int error_size); + +struct MovieReconstructContext* BKE_tracking_reconstruction_context_new(struct MovieTracking *tracking, + int keyframe1, int keyframe2, int width, int height); +void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *context); +void BKE_tracking_solve_reconstruction(struct MovieReconstructContext *context, + short *stop, short *do_update, float *progress, char *stats_message, int message_size); +int BKE_tracking_finish_reconstruction(struct MovieReconstructContext *context, struct MovieTracking *tracking); struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking, int framenr); void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, int framenr, float mat[4][4]); diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 3222167c56e..b5b3c7e67eb 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -36,6 +36,10 @@ #ifndef BKE_UTILDEFINES_H #define BKE_UTILDEFINES_H +#ifdef __cplusplus +extern "C" { +#endif + /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in DNA_space_types.h */ #ifndef FILE_MAXDIR @@ -81,6 +85,8 @@ /* bit-row */ #define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) ) -#define BMEMSET(mem, val, size) {unsigned int _i; char *_c = (char*) mem; for (_i=0; _i<size; _i++) *_c++ = val;} +#ifdef __cplusplus +} +#endif #endif // BKE_UTILDEFINES_H diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 353b73a271c..86530d18c9b 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -92,6 +92,7 @@ set(SRC intern/displist.c intern/dynamicpaint.c intern/effect.c + intern/editderivedmesh.c intern/fcurve.c intern/fluidsim.c intern/fmodifier.c diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c index 67215b5e40f..bb909dcbbdd 100644 --- a/source/blender/blenkernel/intern/BME_Customdata.c +++ b/source/blender/blenkernel/intern/BME_Customdata.c @@ -9,10 +9,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index d1c258cbc93..44258f92024 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -68,9 +68,11 @@ void BME_free_transdata(BME_TransData_Head *td) { MEM_freeN(td); } -BME_TransData *BME_assign_transdata(BME_TransData_Head *td, BME_Mesh *bm, BME_Vert *v, - float *co, float *org, float *vec, float *loc, - float factor, float weight, float maxfactor, float *max) { +BME_TransData *BME_assign_transdata( + BME_TransData_Head *td, BME_Mesh *bm, BME_Vert *v, + float *co, float *org, float *vec, float *loc, + float factor, float weight, float maxfactor, float *max) +{ BME_TransData *vtd; int is_new = 0; @@ -85,13 +87,23 @@ BME_TransData *BME_assign_transdata(BME_TransData_Head *td, BME_Mesh *bm, BME_Ve vtd->bm = bm; vtd->v = v; - if (co != NULL) VECCOPY(vtd->co,co); - if (org == NULL && is_new) { VECCOPY(vtd->org,v->co); } /* default */ - else if (org != NULL) VECCOPY(vtd->org,org); + + if (co != NULL) { + copy_v3_v3(vtd->co, co); + } + + if (org == NULL && is_new) { + copy_v3_v3(vtd->org, v->co); /* default */ + } + else if (org != NULL) { + copy_v3_v3(vtd->org,org); + } + if (vec != NULL) { - VECCOPY(vtd->vec,vec); + copy_v3_v3(vtd->vec,vec); normalize_v3(vtd->vec); } + vtd->loc = loc; vtd->factor = factor; @@ -324,7 +336,8 @@ static int BME_bevel_is_split_vert(BME_Loop *l) { * the bevel operation as a whole based on the relationship between v1 and v2 * (won't necessarily be a vec from v1->co to v2->co, though it probably will be); * the return value is -1 for failure, 0 if we used vert co's, and 1 if we used transform origins */ -static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransData_Head *td) { +static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransData_Head *td) +{ BME_TransData *vtd1, *vtd2; vtd1 = BME_get_transdata(td,v1); @@ -338,16 +351,16 @@ static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransDa * if they belong to different origins, then we will use the origins to determine * the vector */ if (compare_v3v3(vtd1->org,vtd2->org,0.000001f)) { - VECSUB(vec,v2->co,v1->co); + sub_v3_v3v3(vec, v2->co, v1->co); if (len_v3(vec) < 0.000001f) { - mul_v3_fl(vec,0); + zero_v3(vec); } return 0; } else { - VECSUB(vec,vtd2->org,vtd1->org); + sub_v3_v3v3(vec,vtd2->org,vtd1->org); if (len_v3(vec) < 0.000001f) { - mul_v3_fl(vec,0); + zero_v3(vec); } return 1; } @@ -362,7 +375,8 @@ static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransDa * vec2 is the direction of projection (pointing away from vec1) * up_vec is used for orientation (expected to be normalized) * returns the length of the projected vector that lies along vec1 */ -static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int is_forward, BME_TransData_Head *UNUSED(td)) { +static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int is_forward, BME_TransData_Head *UNUSED(td)) +{ float factor, vec3[3], tmp[3],c1,c2; cross_v3_v3v3(tmp,vec1,vec2); @@ -377,7 +391,7 @@ static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int normalize_v3(vec3); c1 = dot_v3v3(vec3,vec1); c2 = dot_v3v3(vec1,vec1); - if (fabs(c1) < 0.000001f || fabs(c2) < 0.000001f) { + if (fabsf(c1) < 0.000001f || fabsf(c2) < 0.000001f) { factor = 0.0f; } else { @@ -525,8 +539,8 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B if (is_edge || dis > maxfactor*value) { dis = maxfactor*value; } - VECADDFAC(sv->co,v->co,vec1,dis); - VECSUB(vec1,sv->co,vtd1->org); + madd_v3_v3v3fl(sv->co, v->co, vec1, dis); + sub_v3_v3v3(vec1, sv->co, vtd1->org); dis = len_v3(vec1); normalize_v3(vec1); BME_assign_transdata(td, bm, sv, vtd1->org, vtd1->org, vec1, sv->co, dis, scale, maxfactor, vtd->max); @@ -546,11 +560,11 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran fac1 = 0; } else { - VECCOPY(vec2,vtd1->vec); - mul_v3_fl(vec2,vtd1->factor); + copy_v3_v3(vec2, vtd1->vec); + mul_v3_fl(vec2, vtd1->factor); if (dot_v3v3(vec1, vec1)) { - project_v3_v3v3(vec2,vec2,vec1); - fac1 = len_v3(vec2)/value; + project_v3_v3v3(vec2, vec2,vec1); + fac1 = len_v3(vec2) / value; } else { fac1 = 0; @@ -561,11 +575,11 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran fac2 = 0; } else { - VECCOPY(vec3,vtd2->vec); - mul_v3_fl(vec3,vtd2->factor); + copy_v3_v3(vec3, vtd2->vec); + mul_v3_fl(vec3, vtd2->factor); if (dot_v3v3(vec1, vec1)) { - project_v3_v3v3(vec2,vec3,vec1); - fac2 = len_v3(vec2)/value; + project_v3_v3v3(vec2, vec3, vec1); + fac2 = len_v3(vec2) / value; } else { fac2 = 0; @@ -573,7 +587,7 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran } if (fac1 || fac2) { - max = len_v3(vec1)/(fac1 + fac2); + max = len_v3(vec1) / (fac1 + fac2); if (vtd1->max && (*vtd1->max < 0 || max < *vtd1->max)) { *vtd1->max = max; } @@ -762,8 +776,8 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti for (i=0,ol=f->loopbase,l=ol->next; l->next!=ol; l=l->next) { BME_bevel_get_vec(vec1,l->next->v,ol->v,td); BME_bevel_get_vec(vec2,l->v,ol->v,td); - cross_v3_v3v3(vec3,vec2,vec1); - VECADD(up_vec,up_vec,vec3); + cross_v3_v3v3(vec3, vec2, vec1); + add_v3_v3(up_vec, vec3); i++; } mul_v3_fl(up_vec,1.0f/i); @@ -792,7 +806,7 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti fac1 = 0; } else { - VECCOPY(vec2,vtd1->vec); + copy_v3_v3(vec2,vtd1->vec); mul_v3_fl(vec2,vtd1->factor); if (dot_v3v3(vec1, vec1)) { project_v3_v3v3(vec2,vec2,vec1); @@ -806,7 +820,7 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti fac2 = 0; } else { - VECCOPY(vec3,vtd2->vec); + copy_v3_v3(vec3,vtd2->vec); mul_v3_fl(vec3,vtd2->factor); if (dot_v3v3(vec1, vec1)) { project_v3_v3v3(vec2,vec3,vec1); @@ -832,7 +846,8 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti return l->f; } -static void BME_bevel_add_vweight(BME_TransData_Head *td, BME_Mesh *bm, BME_Vert *v, float weight, float factor, int options) { +static void BME_bevel_add_vweight(BME_TransData_Head *td, BME_Mesh *bm, BME_Vert *v, float weight, float factor, int options) +{ BME_TransData *vtd; if (v->tflag1 & BME_BEVEL_NONMAN) return; @@ -1104,6 +1119,7 @@ static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int UNUSED(defg } return bm; + } /* tags all elements as originals */ @@ -1123,8 +1139,8 @@ static BME_Mesh *BME_bevel_reinitialize(BME_Mesh *bm) { for (f=bm->polys.first; f; f=f->next) { f->tflag1 |= BME_BEVEL_ORIG; } - return bm; + } /** @@ -1317,7 +1333,7 @@ BME_Mesh *BME_bevel(BME_Mesh *bm, float value, int res, int options, int defgrp_ else { d = value; } - VECADDFAC(v->co,vtd->org,vtd->vec,vtd->factor*d); + madd_v3_v3v3fl(v->co,vtd->org,vtd->vec,vtd->factor*d); } v->tflag1 = 0; } diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 216dbf8b2c2..795b36813e1 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -456,1182 +456,6 @@ DerivedMesh *mesh_create_derived(Mesh *me, Object *ob, float (*vertCos)[3]) return dm; } -/// - -typedef struct { - DerivedMesh dm; - - EditMesh *em; - float (*vertexCos)[3]; - float (*vertexNos)[3]; - float (*faceNos)[3]; -} EditMeshDerivedMesh; - -static void emDM_foreachMappedVert(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no_f, short *no_s), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditVert *eve; - int i; - - for (i=0,eve= emdm->em->verts.first; eve; i++,eve=eve->next) { - if (emdm->vertexCos) { - func(userData, i, emdm->vertexCos[i], emdm->vertexNos[i], NULL); - } else { - func(userData, i, eve->co, eve->no, NULL); - } - } -} -static void emDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData, int index, float *v0co, float *v1co), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditEdge *eed; - int i; - - if (emdm->vertexCos) { - EditVert *eve; - - for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) - func(userData, i, emdm->vertexCos[(int) eed->v1->tmp.l], emdm->vertexCos[(int) eed->v2->tmp.l]); - } else { - for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) - func(userData, i, eed->v1->co, eed->v2->co); - } -} -static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditEdge *eed; - int i; - - if (emdm->vertexCos) { - EditVert *eve; - - for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - - glBegin(GL_LINES); - for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { - if(!setDrawOptions || setDrawOptions(userData, i)) { - glVertex3fv(emdm->vertexCos[(int) eed->v1->tmp.l]); - glVertex3fv(emdm->vertexCos[(int) eed->v2->tmp.l]); - } - } - glEnd(); - } else { - glBegin(GL_LINES); - for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { - if(!setDrawOptions || setDrawOptions(userData, i)) { - glVertex3fv(eed->v1->co); - glVertex3fv(eed->v2->co); - } - } - glEnd(); - } -} -static void emDM_drawEdges(DerivedMesh *dm, int UNUSED(drawLooseEdges), int UNUSED(drawAllEdges)) -{ - emDM_drawMappedEdges(dm, NULL, NULL); -} -static void emDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void (*setDrawInterpOptions)(void *userData, int index, float t), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditEdge *eed; - int i; - - if (emdm->vertexCos) { - EditVert *eve; - - for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - - glBegin(GL_LINES); - for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { - if(!setDrawOptions || setDrawOptions(userData, i)) { - setDrawInterpOptions(userData, i, 0.0); - glVertex3fv(emdm->vertexCos[(int) eed->v1->tmp.l]); - setDrawInterpOptions(userData, i, 1.0); - glVertex3fv(emdm->vertexCos[(int) eed->v2->tmp.l]); - } - } - glEnd(); - } else { - glBegin(GL_LINES); - for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { - if(!setDrawOptions || setDrawOptions(userData, i)) { - setDrawInterpOptions(userData, i, 0.0); - glVertex3fv(eed->v1->co); - setDrawInterpOptions(userData, i, 1.0); - glVertex3fv(eed->v2->co); - } - } - glEnd(); - } -} - -static void emDM_drawUVEdges(DerivedMesh *dm) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditFace *efa; - MTFace *tf; - - glBegin(GL_LINES); - for(efa= emdm->em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&emdm->em->fdata, efa->data, CD_MTFACE); - - if(tf && !(efa->h)) { - glVertex2fv(tf->uv[0]); - glVertex2fv(tf->uv[1]); - - glVertex2fv(tf->uv[1]); - glVertex2fv(tf->uv[2]); - - if (!efa->v4) { - glVertex2fv(tf->uv[2]); - glVertex2fv(tf->uv[0]); - } else { - glVertex2fv(tf->uv[2]); - glVertex2fv(tf->uv[3]); - glVertex2fv(tf->uv[3]); - glVertex2fv(tf->uv[0]); - } - } - } - glEnd(); -} - -static void emDM__calcFaceCent(EditFace *efa, float cent[3], float (*vertexCos)[3]) -{ - if (vertexCos) { - copy_v3_v3(cent, vertexCos[(int) efa->v1->tmp.l]); - add_v3_v3(cent, vertexCos[(int) efa->v2->tmp.l]); - add_v3_v3(cent, vertexCos[(int) efa->v3->tmp.l]); - if (efa->v4) add_v3_v3(cent, vertexCos[(int) efa->v4->tmp.l]); - } else { - copy_v3_v3(cent, efa->v1->co); - add_v3_v3(cent, efa->v2->co); - add_v3_v3(cent, efa->v3->co); - if (efa->v4) add_v3_v3(cent, efa->v4->co); - } - - if (efa->v4) { - mul_v3_fl(cent, 0.25f); - } else { - mul_v3_fl(cent, 0.33333333333f); - } -} -static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditVert *eve; - EditFace *efa; - float cent[3]; - int i; - - if (emdm->vertexCos) { - for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - } - - for(i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { - emDM__calcFaceCent(efa, cent, emdm->vertexCos); - func(userData, i, cent, emdm->vertexCos?emdm->faceNos[i]:efa->n); - } -} - -/* note, material function is ignored for now. */ -static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int UNUSED(useColors), int (*setMaterial)(int, void *attribs), - int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditFace *efa; - int i, draw; - const int skip_normals= !glIsEnabled(GL_LIGHTING); /* could be passed as an arg */ - - /* GL_ZERO is used to detect if drawing has started or not */ - GLenum poly_prev= GL_ZERO; - GLenum shade_prev= GL_ZERO; - - (void)setMaterial; /* unused */ - - /* currently unused -- each original face is handled separately */ - (void)compareDrawOptions; - - if (emdm->vertexCos) { - /* add direct access */ - float (*vertexCos)[3]= emdm->vertexCos; - float (*vertexNos)[3]= emdm->vertexNos; - float (*faceNos)[3]= emdm->faceNos; - EditVert *eve; - - for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - - for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { - int drawSmooth = (efa->flag & ME_SMOOTH); - draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth); - if(draw) { - const GLenum poly_type= efa->v4 ? GL_QUADS:GL_TRIANGLES; - if (draw==2) { /* enabled with stipple */ - - if(poly_prev != GL_ZERO) glEnd(); - poly_prev= GL_ZERO; /* force glBegin */ - - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); - } - - if(skip_normals) { - if(poly_type != poly_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glBegin((poly_prev= poly_type)); - } - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - if(poly_type == GL_QUADS) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - else { - const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; - if (shade_type != shade_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ - glBegin((poly_prev= poly_type)); - } - else if(poly_type != poly_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glBegin((poly_prev= poly_type)); - } - - if (!drawSmooth) { - glNormal3fv(faceNos[i]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - if(poly_type == GL_QUADS) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } else { - glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - if(poly_type == GL_QUADS) { - glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - } - } - - - if (draw==2) { - glEnd(); - poly_prev= GL_ZERO; /* force glBegin */ - - glDisable(GL_POLYGON_STIPPLE); - } - } - } - } - else { - for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { - int drawSmooth = (efa->flag & ME_SMOOTH); - draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth); - if(draw) { - const GLenum poly_type= efa->v4 ? GL_QUADS:GL_TRIANGLES; - if (draw==2) { /* enabled with stipple */ - - if(poly_prev != GL_ZERO) glEnd(); - poly_prev= GL_ZERO; /* force glBegin */ - - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_quarttone); - } - - if(skip_normals) { - if(poly_type != poly_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glBegin((poly_prev= poly_type)); - } - glVertex3fv(efa->v1->co); - glVertex3fv(efa->v2->co); - glVertex3fv(efa->v3->co); - if(poly_type == GL_QUADS) glVertex3fv(efa->v4->co); - } - else { - const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; - if (shade_type != shade_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ - glBegin((poly_prev= poly_type)); - } - else if(poly_type != poly_prev) { - if(poly_prev != GL_ZERO) glEnd(); - glBegin((poly_prev= poly_type)); - } - - if (!drawSmooth) { - glNormal3fv(efa->n); - glVertex3fv(efa->v1->co); - glVertex3fv(efa->v2->co); - glVertex3fv(efa->v3->co); - if(poly_type == GL_QUADS) glVertex3fv(efa->v4->co); - } else { - glNormal3fv(efa->v1->no); - glVertex3fv(efa->v1->co); - glNormal3fv(efa->v2->no); - glVertex3fv(efa->v2->co); - glNormal3fv(efa->v3->no); - glVertex3fv(efa->v3->co); - if(poly_type == GL_QUADS) { - glNormal3fv(efa->v4->no); - glVertex3fv(efa->v4->co); - } - } - } - - - if (draw==2) { - glEnd(); - poly_prev= GL_ZERO; - - glDisable(GL_POLYGON_STIPPLE); - } - } - } - } - - /* if non zero we know a face was rendered */ - if(poly_prev != GL_ZERO) glEnd(); -} - -static void emDM_drawFacesTex_common(DerivedMesh *dm, - int (*drawParams)(MTFace *tface, int has_mcol, int matnr), - int (*drawParamsMapped)(void *userData, int index), - void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditMesh *em= emdm->em; - float (*vertexCos)[3]= emdm->vertexCos; - float (*vertexNos)[3]= emdm->vertexNos; - EditFace *efa; - int i; - - /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ - glShadeModel(GL_SMOOTH); - - if (vertexCos) { - EditVert *eve; - - for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - - for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { - MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - MCol *mcol= CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - unsigned char *cp= NULL; - int drawSmooth= (efa->flag & ME_SMOOTH); - int flag; - - if(drawParams) - flag= drawParams(tf, (mcol != NULL), efa->mat_nr); - else if(drawParamsMapped) - flag= drawParamsMapped(userData, i); - else - flag= 1; - - if(flag != 0) { /* flag 0 == the face is hidden or invisible */ - - /* we always want smooth here since otherwise vertex colors dont interpolate */ - if (mcol) { - if (flag==1) { - cp= (unsigned char*)mcol; - } - } else { - glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); - } - - glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); - if (!drawSmooth) { - glNormal3fv(emdm->faceNos[i]); - - if(tf) glTexCoord2fv(tf->uv[0]); - if(cp) glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - - if(tf) glTexCoord2fv(tf->uv[1]); - if(cp) glColor3ub(cp[7], cp[6], cp[5]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - - if(tf) glTexCoord2fv(tf->uv[2]); - if(cp) glColor3ub(cp[11], cp[10], cp[9]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - - if(efa->v4) { - if(tf) glTexCoord2fv(tf->uv[3]); - if(cp) glColor3ub(cp[15], cp[14], cp[13]); - glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - } else { - if(tf) glTexCoord2fv(tf->uv[0]); - if(cp) glColor3ub(cp[3], cp[2], cp[1]); - glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - - if(tf) glTexCoord2fv(tf->uv[1]); - if(cp) glColor3ub(cp[7], cp[6], cp[5]); - glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - - if(tf) glTexCoord2fv(tf->uv[2]); - if(cp) glColor3ub(cp[11], cp[10], cp[9]); - glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - - if(efa->v4) { - if(tf) glTexCoord2fv(tf->uv[3]); - if(cp) glColor3ub(cp[15], cp[14], cp[13]); - glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - } - glEnd(); - } - } - } else { - for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { - MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - MCol *mcol= CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - unsigned char *cp= NULL; - int drawSmooth= (efa->flag & ME_SMOOTH); - int flag; - - if(drawParams) - flag= drawParams(tf, (mcol != NULL), efa->mat_nr); - else if(drawParamsMapped) - flag= drawParamsMapped(userData, i); - else - flag= 1; - - if(flag != 0) { /* flag 0 == the face is hidden or invisible */ - /* we always want smooth here since otherwise vertex colors dont interpolate */ - if (mcol) { - if (flag==1) { - cp= (unsigned char*)mcol; - } - } else { - glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); - } - - glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); - if (!drawSmooth) { - glNormal3fv(efa->n); - - if(tf) glTexCoord2fv(tf->uv[0]); - if(cp) glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(efa->v1->co); - - if(tf) glTexCoord2fv(tf->uv[1]); - if(cp) glColor3ub(cp[7], cp[6], cp[5]); - glVertex3fv(efa->v2->co); - - if(tf) glTexCoord2fv(tf->uv[2]); - if(cp) glColor3ub(cp[11], cp[10], cp[9]); - glVertex3fv(efa->v3->co); - - if(efa->v4) { - if(tf) glTexCoord2fv(tf->uv[3]); - if(cp) glColor3ub(cp[15], cp[14], cp[13]); - glVertex3fv(efa->v4->co); - } - } else { - if(tf) glTexCoord2fv(tf->uv[0]); - if(cp) glColor3ub(cp[3], cp[2], cp[1]); - glNormal3fv(efa->v1->no); - glVertex3fv(efa->v1->co); - - if(tf) glTexCoord2fv(tf->uv[1]); - if(cp) glColor3ub(cp[7], cp[6], cp[5]); - glNormal3fv(efa->v2->no); - glVertex3fv(efa->v2->co); - - if(tf) glTexCoord2fv(tf->uv[2]); - if(cp) glColor3ub(cp[11], cp[10], cp[9]); - glNormal3fv(efa->v3->no); - glVertex3fv(efa->v3->co); - - if(efa->v4) { - if(tf) glTexCoord2fv(tf->uv[3]); - if(cp) glColor3ub(cp[15], cp[14], cp[13]); - glNormal3fv(efa->v4->no); - glVertex3fv(efa->v4->co); - } - } - glEnd(); - } - } - } -} - -static void emDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr)) -{ - emDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL); -} - -static void emDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData) -{ - emDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData); -} - -static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, - int (*setMaterial)(int, void *attribs), - int (*setDrawOptions)(void *userData, int index), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditMesh *em= emdm->em; - float (*vertexCos)[3]= emdm->vertexCos; - float (*vertexNos)[3]= emdm->vertexNos; - EditVert *eve; - EditFace *efa; - DMVertexAttribs attribs= {{{0}}}; - GPUVertexAttribs gattribs; - /* int tfoffset; */ /* UNUSED */ - int i, b, matnr, new_matnr, dodraw /* , layer */ /* UNUSED */; - - dodraw = 0; - matnr = -1; - - /* layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE); */ /* UNUSED */ - /* tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset; */ /* UNUSED */ - - /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ - glShadeModel(GL_SMOOTH); - - for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - -#define PASSATTRIB(efa, eve, vert) { \ - if(attribs.totorco) { \ - float *orco = attribs.orco.array[eve->tmp.l]; \ - glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \ - } \ - for(b = 0; b < attribs.tottface; b++) { \ - MTFace *_tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ - glVertexAttrib2fvARB(attribs.tface[b].glIndex, _tf->uv[vert]); \ - } \ - for(b = 0; b < attribs.totmcol; b++) { \ - MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \ - GLubyte col[4]; \ - col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \ - glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \ - } \ - if(attribs.tottang) { \ - float *tang = attribs.tang.array[i*4 + vert]; \ - glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \ - } \ -} - - for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { - int drawSmooth= (efa->flag & ME_SMOOTH); - - if(setDrawOptions && !setDrawOptions(userData, i)) - continue; - - new_matnr = efa->mat_nr + 1; - if(new_matnr != matnr) { - dodraw = setMaterial(matnr = new_matnr, &gattribs); - if(dodraw) - DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); - } - - if(dodraw) { - glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); - if (!drawSmooth) { - if(vertexCos) glNormal3fv(emdm->faceNos[i]); - else glNormal3fv(efa->n); - - PASSATTRIB(efa, efa->v1, 0); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - else glVertex3fv(efa->v1->co); - - PASSATTRIB(efa, efa->v2, 1); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - else glVertex3fv(efa->v2->co); - - PASSATTRIB(efa, efa->v3, 2); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - else glVertex3fv(efa->v3->co); - - if(efa->v4) { - PASSATTRIB(efa, efa->v4, 3); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - else glVertex3fv(efa->v4->co); - } - } else { - PASSATTRIB(efa, efa->v1, 0); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - } - else { - glNormal3fv(efa->v1->no); - glVertex3fv(efa->v1->co); - } - - PASSATTRIB(efa, efa->v2, 1); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - } - else { - glNormal3fv(efa->v2->no); - glVertex3fv(efa->v2->co); - } - - PASSATTRIB(efa, efa->v3, 2); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - } - else { - glNormal3fv(efa->v3->no); - glVertex3fv(efa->v3->co); - } - - if(efa->v4) { - PASSATTRIB(efa, efa->v4, 3); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - else { - glNormal3fv(efa->v4->no); - glVertex3fv(efa->v4->co); - } - } - } - glEnd(); - } - } -#undef PASSATTRIB -} - -static void emDM_drawFacesGLSL(DerivedMesh *dm, - int (*setMaterial)(int, void *attribs)) -{ - dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL); -} - -static void emDM_drawMappedFacesMat(DerivedMesh *dm, - void (*setMaterial)(void *userData, int, void *attribs), - int (*setFace)(void *userData, int index), void *userData) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditMesh *em= emdm->em; - float (*vertexCos)[3]= emdm->vertexCos; - float (*vertexNos)[3]= emdm->vertexNos; - EditVert *eve; - EditFace *efa; - DMVertexAttribs attribs= {{{0}}}; - GPUVertexAttribs gattribs; - int i, b, matnr, new_matnr; - - matnr = -1; - - /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ - glShadeModel(GL_SMOOTH); - - for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - -#define PASSATTRIB(efa, eve, vert) { \ - if(attribs.totorco) { \ - float *orco = attribs.orco.array[eve->tmp.l]; \ - if(attribs.orco.glTexco) \ - glTexCoord3fv(orco); \ - else \ - glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \ - } \ - for(b = 0; b < attribs.tottface; b++) { \ - MTFace *_tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ - if(attribs.tface[b].glTexco) \ - glTexCoord2fv(_tf->uv[vert]); \ - else \ - glVertexAttrib2fvARB(attribs.tface[b].glIndex, _tf->uv[vert]); \ - } \ - for(b = 0; b < attribs.totmcol; b++) { \ - MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \ - GLubyte col[4]; \ - col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \ - glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \ - } \ - if(attribs.tottang) { \ - float *tang = attribs.tang.array[i*4 + vert]; \ - glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \ - } \ -} - - for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { - int drawSmooth= (efa->flag & ME_SMOOTH); - - /* face hiding */ - if(setFace && !setFace(userData, i)) - continue; - - /* material */ - new_matnr = efa->mat_nr + 1; - if(new_matnr != matnr) { - setMaterial(userData, matnr = new_matnr, &gattribs); - DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); - } - - /* face */ - glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); - if (!drawSmooth) { - if(vertexCos) glNormal3fv(emdm->faceNos[i]); - else glNormal3fv(efa->n); - - PASSATTRIB(efa, efa->v1, 0); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - else glVertex3fv(efa->v1->co); - - PASSATTRIB(efa, efa->v2, 1); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - else glVertex3fv(efa->v2->co); - - PASSATTRIB(efa, efa->v3, 2); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - else glVertex3fv(efa->v3->co); - - if(efa->v4) { - PASSATTRIB(efa, efa->v4, 3); - if(vertexCos) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - else glVertex3fv(efa->v4->co); - } - } else { - PASSATTRIB(efa, efa->v1, 0); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); - } - else { - glNormal3fv(efa->v1->no); - glVertex3fv(efa->v1->co); - } - - PASSATTRIB(efa, efa->v2, 1); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); - } - else { - glNormal3fv(efa->v2->no); - glVertex3fv(efa->v2->co); - } - - PASSATTRIB(efa, efa->v3, 2); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); - } - else { - glNormal3fv(efa->v3->no); - glVertex3fv(efa->v3->co); - } - - if(efa->v4) { - PASSATTRIB(efa, efa->v4, 3); - if(vertexCos) { - glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); - glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); - } - else { - glNormal3fv(efa->v4->no); - glVertex3fv(efa->v4->co); - } - } - } - glEnd(); - } -#undef PASSATTRIB -} - -static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditVert *eve; - int i; - - if (emdm->em->verts.first) { - for (i=0,eve= emdm->em->verts.first; eve; i++,eve= eve->next) { - if (emdm->vertexCos) { - DO_MINMAX(emdm->vertexCos[i], min_r, max_r); - } else { - DO_MINMAX(eve->co, min_r, max_r); - } - } - } else { - min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0; - } -} -static int emDM_getNumVerts(DerivedMesh *dm) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - - return BLI_countlist(&emdm->em->verts); -} - -static int emDM_getNumEdges(DerivedMesh *dm) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - - return BLI_countlist(&emdm->em->edges); -} - -static int emDM_getNumFaces(DerivedMesh *dm) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - - return BLI_countlist(&emdm->em->faces); -} - -static void emDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3]) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditVert *eve; - int i; - - for (i=0,eve= emdm->em->verts.first; eve; i++,eve=eve->next) { - if (emdm->vertexCos) { - copy_v3_v3(cos_r[i], emdm->vertexCos[i]); - } else { - copy_v3_v3(cos_r[i], eve->co); - } - } -} - -static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) -{ - EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first; - int i; - - for(i = 0; i < index; ++i) ev = ev->next; - - copy_v3_v3(vert_r->co, ev->co); - - normal_float_to_short_v3(vert_r->no, ev->no); - - /* TODO what to do with vert_r->flag? */ - vert_r->bweight = (unsigned char) (ev->bweight*255.0f); -} - -static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) -{ - EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; - EditEdge *ee = em->edges.first; - EditVert *ev, *v1, *v2; - int i; - - for(i = 0; i < index; ++i) ee = ee->next; - - edge_r->crease = (unsigned char) (ee->crease*255.0f); - edge_r->bweight = (unsigned char) (ee->bweight*255.0f); - /* TODO what to do with edge_r->flag? */ - edge_r->flag = ME_EDGEDRAW|ME_EDGERENDER; - if (ee->seam) edge_r->flag |= ME_SEAM; - if (ee->sharp) edge_r->flag |= ME_SHARP; - if (ee->freestyle) edge_r->flag |= ME_FREESTYLE_EDGE; -#if 0 - /* this needs setup of f2 field */ - if (!ee->f2) edge_r->flag |= ME_LOOSEEDGE; -#endif - - /* goddamn, we have to search all verts to find indices */ - v1 = ee->v1; - v2 = ee->v2; - for(i = 0, ev = em->verts.first; v1 || v2; i++, ev = ev->next) { - if(ev == v1) { - edge_r->v1 = i; - v1 = NULL; - } - if(ev == v2) { - edge_r->v2 = i; - v2 = NULL; - } - } -} - -static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) -{ - EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; - EditFace *ef = em->faces.first; - EditVert *ev, *v1, *v2, *v3, *v4; - int i; - - for(i = 0; i < index; ++i) ef = ef->next; - - face_r->mat_nr = ef->mat_nr; - face_r->flag = ef->flag; - - /* goddamn, we have to search all verts to find indices */ - v1 = ef->v1; - v2 = ef->v2; - v3 = ef->v3; - v4 = ef->v4; - if(!v4) face_r->v4 = 0; - - for(i = 0, ev = em->verts.first; v1 || v2 || v3 || v4; - i++, ev = ev->next) { - if(ev == v1) { - face_r->v1 = i; - v1 = NULL; - } - if(ev == v2) { - face_r->v2 = i; - v2 = NULL; - } - if(ev == v3) { - face_r->v3 = i; - v3 = NULL; - } - if(ev == v4) { - face_r->v4 = i; - v4 = NULL; - } - } - - test_index_face(face_r, NULL, 0, ef->v4?4:3); -} - -static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditVert *ev = emdm->em->verts.first; - int i; - - for(i=0; ev; ev = ev->next, ++vert_r, ++i) { - if(emdm->vertexCos) - copy_v3_v3(vert_r->co, emdm->vertexCos[i]); - else - copy_v3_v3(vert_r->co, ev->co); - - normal_float_to_short_v3(vert_r->no, ev->no); - - /* TODO what to do with vert_r->flag? */ - vert_r->flag = 0; - vert_r->bweight = (unsigned char) (ev->bweight*255.0f); - } -} - -static void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) -{ - EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; - EditEdge *ee = em->edges.first; - EditVert *ev; - int i; - - /* store vertex indices in tmp union */ - for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) - ev->tmp.l = (intptr_t) i; - - for( ; ee; ee = ee->next, ++edge_r) { - edge_r->crease = (unsigned char) (ee->crease*255.0f); - edge_r->bweight = (unsigned char) (ee->bweight*255.0f); - /* TODO what to do with edge_r->flag? */ - edge_r->flag = ME_EDGEDRAW|ME_EDGERENDER; - if (ee->seam) edge_r->flag |= ME_SEAM; - if (ee->sharp) edge_r->flag |= ME_SHARP; - if (ee->freestyle) edge_r->flag |= ME_FREESTYLE_EDGE; -#if 0 - /* this needs setup of f2 field */ - if (!ee->f2) edge_r->flag |= ME_LOOSEEDGE; -#endif - - edge_r->v1 = (int)ee->v1->tmp.l; - edge_r->v2 = (int)ee->v2->tmp.l; - } -} - -static void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) -{ - EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; - EditFace *ef = em->faces.first; - EditVert *ev; - int i; - - /* store vertexes indices in tmp union */ - for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) - ev->tmp.l = (intptr_t) i; - - for( ; ef; ef = ef->next, ++face_r) { - face_r->mat_nr = ef->mat_nr; - face_r->flag = ef->flag; - - face_r->v1 = (int)ef->v1->tmp.l; - face_r->v2 = (int)ef->v2->tmp.l; - face_r->v3 = (int)ef->v3->tmp.l; - if(ef->v4) face_r->v4 = (int)ef->v4->tmp.l; - else face_r->v4 = 0; - - test_index_face(face_r, NULL, 0, ef->v4?4:3); - } -} - -static void *emDM_getFaceDataArray(DerivedMesh *dm, int type) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - EditMesh *em= emdm->em; - EditFace *efa; - char *data, *emdata; - void *datalayer; - int index, size; - - datalayer = DM_get_face_data_layer(dm, type); - if(datalayer) - return datalayer; - - /* layers are store per face for editmesh, we convert to a temporary - * data layer array in the derivedmesh when these are requested */ - if(type == CD_MTFACE || type == CD_MCOL) { - index = CustomData_get_layer_index(&em->fdata, type); - - if(index != -1) { - /* int offset = em->fdata.layers[index].offset; */ /* UNUSED */ - size = CustomData_sizeof(type); - - DM_add_face_layer(dm, type, CD_CALLOC, NULL); - index = CustomData_get_layer_index(&dm->faceData, type); - dm->faceData.layers[index].flag |= CD_FLAG_TEMPORARY; - - data = datalayer = DM_get_face_data_layer(dm, type); - for(efa=em->faces.first; efa; efa=efa->next, data+=size) { - emdata = CustomData_em_get(&em->fdata, efa->data, type); - memcpy(data, emdata, size); - } - } - } - - return datalayer; -} - -static void emDM_release(DerivedMesh *dm) -{ - EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; - - if (DM_release(dm)) { - if (emdm->vertexCos) { - MEM_freeN(emdm->vertexCos); - MEM_freeN(emdm->vertexNos); - MEM_freeN(emdm->faceNos); - } - - MEM_freeN(emdm); - } -} - -DerivedMesh *editmesh_get_derived(EditMesh *em, float (*vertexCos)[3]) -{ - EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm"); - - DM_init(&emdm->dm, DM_TYPE_EDITMESH, BLI_countlist(&em->verts), - BLI_countlist(&em->edges), BLI_countlist(&em->faces)); - - emdm->dm.getMinMax = emDM_getMinMax; - - emdm->dm.getNumVerts = emDM_getNumVerts; - emdm->dm.getNumEdges = emDM_getNumEdges; - emdm->dm.getNumFaces = emDM_getNumFaces; - - emdm->dm.getVertCos = emDM_getVertCos; - - emdm->dm.getVert = emDM_getVert; - emdm->dm.getEdge = emDM_getEdge; - emdm->dm.getFace = emDM_getFace; - emdm->dm.copyVertArray = emDM_copyVertArray; - emdm->dm.copyEdgeArray = emDM_copyEdgeArray; - emdm->dm.copyFaceArray = emDM_copyFaceArray; - emdm->dm.getFaceDataArray = emDM_getFaceDataArray; - - emdm->dm.foreachMappedVert = emDM_foreachMappedVert; - emdm->dm.foreachMappedEdge = emDM_foreachMappedEdge; - emdm->dm.foreachMappedFaceCenter = emDM_foreachMappedFaceCenter; - - emdm->dm.drawEdges = emDM_drawEdges; - emdm->dm.drawMappedEdges = emDM_drawMappedEdges; - emdm->dm.drawMappedEdgesInterp = emDM_drawMappedEdgesInterp; - emdm->dm.drawMappedFaces = emDM_drawMappedFaces; - emdm->dm.drawMappedFacesTex = emDM_drawMappedFacesTex; - emdm->dm.drawMappedFacesGLSL = emDM_drawMappedFacesGLSL; - emdm->dm.drawFacesTex = emDM_drawFacesTex; - emdm->dm.drawFacesGLSL = emDM_drawFacesGLSL; - emdm->dm.drawMappedFacesMat = emDM_drawMappedFacesMat; - emdm->dm.drawUVEdges = emDM_drawUVEdges; - - emdm->dm.release = emDM_release; - - emdm->em = em; - emdm->vertexCos = vertexCos; - - if(CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) { - EditVert *eve; - int i; - - DM_add_vert_layer(&emdm->dm, CD_MDEFORMVERT, CD_CALLOC, NULL); - - for(eve = em->verts.first, i = 0; eve; eve = eve->next, ++i) - DM_set_vert_data(&emdm->dm, i, CD_MDEFORMVERT, - CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT)); - } - - if(vertexCos) { - EditVert *eve; - EditFace *efa; - int totface = BLI_countlist(&em->faces); - int i; - - for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (intptr_t) i++; - - emdm->vertexNos = MEM_callocN(sizeof(*emdm->vertexNos)*i, "emdm_vno"); - emdm->faceNos = MEM_mallocN(sizeof(*emdm->faceNos)*totface, "emdm_vno"); - - for(i=0, efa= em->faces.first; efa; i++, efa=efa->next) { - float *v1 = vertexCos[(int) efa->v1->tmp.l]; - float *v2 = vertexCos[(int) efa->v2->tmp.l]; - float *v3 = vertexCos[(int) efa->v3->tmp.l]; - float *no = emdm->faceNos[i]; - - if(efa->v4) { - float *v4 = vertexCos[(int) efa->v4->tmp.l]; - - normal_quad_v3( no,v1, v2, v3, v4); - add_v3_v3(emdm->vertexNos[(int) efa->v4->tmp.l], no); - } - else { - normal_tri_v3( no,v1, v2, v3); - } - - add_v3_v3(emdm->vertexNos[(int) efa->v1->tmp.l], no); - add_v3_v3(emdm->vertexNos[(int) efa->v2->tmp.l], no); - add_v3_v3(emdm->vertexNos[(int) efa->v3->tmp.l], no); - } - - for(i=0, eve= em->verts.first; eve; i++, eve=eve->next) { - float *no = emdm->vertexNos[i]; - /* following Mesh convention; we use vertex coordinate itself - * for normal in this case */ - if (normalize_v3(no) == 0.0f) { - normalize_v3_v3(no, vertexCos[i]); - } - } - } - - return (DerivedMesh*) emdm; -} - -/***/ - DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, ModifierData *md) { Mesh *me = ob->data; @@ -3013,7 +1837,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, /* ugly hack, editmesh derivedmesh doesn't copy face data, this way we * can use offsets instead */ - if(dm->release == emDM_release) + if(dm->type == DM_TYPE_EDITMESH) tfdata = &((EditMeshDerivedMesh*)dm)->em->fdata; else tfdata = fdata; @@ -3170,9 +1994,14 @@ static void navmesh_drawColored(DerivedMesh *dm) glEnable(GL_LIGHTING); } -static void navmesh_DM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr)) +static void navmesh_DM_drawFacesTex(DerivedMesh *dm, + int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) { (void) setDrawOptions; + (void) compareDrawOptions; + (void) userData; navmesh_drawColored(dm); } diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 5fb03b7bbd0..767401a55ef 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -92,8 +92,8 @@ bAction *add_empty_action(const char name[]) /* temp data for make_local_action */ typedef struct tMakeLocalActionContext { - bAction *act; /* original action */ - bAction *actn; /* new action */ + bAction *act; /* original action */ + bAction *act_new; /* new action */ int is_lib; /* some action users were libraries */ int is_local; /* some action users were not libraries */ @@ -117,9 +117,9 @@ static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr) if (adt->action == mlac->act) { if (id->lib == NULL) { - adt->action = mlac->actn; + adt->action = mlac->act_new; - id_us_plus(&mlac->actn->id); + id_us_plus(&mlac->act_new->id); id_us_min(&mlac->act->id); } } @@ -146,10 +146,10 @@ void make_local_action(bAction *act) id_clear_lib_data(bmain, &act->id); } else if (mlac.is_local && mlac.is_lib) { - mlac.actn= copy_action(act); - mlac.actn->id.us= 0; + mlac.act_new= copy_action(act); + mlac.act_new->id.us= 0; - BKE_id_lib_local_paths(bmain, &mlac.actn->id); + BKE_id_lib_local_paths(bmain, act->id.lib, &mlac.act_new->id); BKE_animdata_main_cb(bmain, make_localact_apply_cb, &mlac); } diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 36df1101a24..0cd8845c53b 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -757,7 +757,7 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, i static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, int animated) { extern int enable_cu_speed; /* object.c */ - Object copyob = {{NULL}}; + Object copyob; int cfrao = scene->r.cfra; int dupend = ob->dupend; @@ -1030,27 +1030,17 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa em = BKE_mesh_get_editmesh(me); if(em) { - int totvert; - dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= MEM_mallocN(sizeof(MFace)*totface, "mface temp"); - dm->copyFaceArray(dm, mface); - totvert= dm->getNumVerts(dm); - mvert= MEM_mallocN(sizeof(MVert)*totvert, "mvert temp"); - dm->copyVertArray(dm, mvert); - BKE_mesh_end_editmesh(me, em); } else { dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= dm->getFaceArray(dm); - mvert= dm->getVertArray(dm); } + totface= dm->getNumFaces(dm); + mface= dm->getFaceArray(dm); + mvert= dm->getVertArray(dm); + if(G.rendering) { orco= (float(*)[3])get_mesh_orco_verts(par); @@ -1189,11 +1179,6 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa if (sce) base= base->next; /* scene loop */ else go= go->next; /* group loop */ } - - if(em) { - MEM_freeN(mface); - MEM_freeN(mvert); - } if(orco) MEM_freeN(orco); diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index a9c29728650..68d2cf940af 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -158,17 +158,17 @@ void make_local_armature(bArmature *arm) id_clear_lib_data(bmain, &arm->id); } else if(is_local && is_lib) { - bArmature *armn= copy_armature(arm); - armn->id.us= 0; + bArmature *arm_new= copy_armature(arm); + arm_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &armn->id); + BKE_id_lib_local_paths(bmain, arm->id.lib, &arm_new->id); for(ob= bmain->object.first; ob; ob= ob->id.next) { if(ob->data == arm) { if(ob->id.lib==NULL) { - ob->data= armn; - armn->id.us++; + ob->data= arm_new; + arm_new->id.us++; arm->id.us--; } } @@ -2120,6 +2120,8 @@ void pchan_calc_mat(bPoseChannel *pchan) pchan_to_mat4(pchan, pchan->chan_mat); } +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ + /* NLA strip modifiers */ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseChannel *pchan) { @@ -2242,6 +2244,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha } } +#endif + /* calculate tail of posechannel */ void where_is_pose_bone_tail(bPoseChannel *pchan) { @@ -2351,9 +2355,12 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti } if(do_extra) { + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ /* do NLA strip modifiers - i.e. curve follow */ do_strip_modifiers(scene, ob, bone, pchan); - +#endif + /* Do constraints */ if (pchan->constraints.first) { bConstraintOb *cob; diff --git a/source/blender/blenkernel/intern/bmesh_private.h b/source/blender/blenkernel/intern/bmesh_private.h index b114f38cdd5..d0b03883e6e 100644 --- a/source/blender/blenkernel/intern/bmesh_private.h +++ b/source/blender/blenkernel/intern/bmesh_private.h @@ -9,10 +9,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 5303baddbca..7fac273ef77 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -224,17 +224,17 @@ void make_local_brush(Brush *brush) } } else if(is_local && is_lib) { - Brush *brushn= copy_brush(brush); - brushn->id.us= 1; /* only keep fake user */ - brushn->id.flag |= LIB_FAKEUSER; + Brush *brush_new= copy_brush(brush); + brush_new->id.us= 1; /* only keep fake user */ + brush_new->id.flag |= LIB_FAKEUSER; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &brush->id); + BKE_id_lib_local_paths(bmain, brush->id.lib, &brush_new->id); for(scene= bmain->scene.first; scene; scene=scene->id.next) { if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) { if(scene->id.lib==NULL) { - paint_brush_set(&scene->toolsettings->imapaint.paint, brushn); + paint_brush_set(&scene->toolsettings->imapaint.paint, brush_new); } } } diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 08e8a80750e..2bd973d7799 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -108,18 +108,18 @@ void make_local_camera(Camera *cam) id_clear_lib_data(bmain, &cam->id); } else if(is_local && is_lib) { - Camera *camn= copy_camera(cam); + Camera *cam_new= copy_camera(cam); - camn->id.us= 0; + cam_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &camn->id); + BKE_id_lib_local_paths(bmain, cam->id.lib, &cam_new->id); for(ob= bmain->object.first; ob; ob= ob->id.next) { if(ob->data == cam) { if(ob->id.lib==NULL) { - ob->data= camn; - camn->id.us++; + ob->data= cam_new; + cam_new->id.us++; cam->id.us--; } } diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index de0bf90e79b..af452e47591 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -647,6 +647,7 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha static void cdDM_drawFacesTex_common(DerivedMesh *dm, int (*drawParams)(MTFace *tface, int has_mcol, int matnr), int (*drawParamsMapped)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; @@ -771,24 +772,18 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, } if( !GPU_buffer_legacy(dm) ) { - /* warning!, this logic is incorrect, see bug [#27175] - * firstly, there are no checks for changes in context, such as texface image. - * secondly, drawParams() sets the GL context, so checking if there is a change - * from lastFlag is too late once glDrawArrays() runs, since drawing the arrays - * will use the modified, OpenGL settings. - * - * However its tricky to fix this without duplicating the internal logic - * of drawParams(), perhaps we need an argument like... - * drawParams(..., keep_gl_state_but_return_when_changed) ?. - * - * We could also just disable VBO's here, since texface may be deprecated - campbell. - */ - + int tottri = dm->drawObject->tot_triangle_point/3; + int next_actualFace= dm->drawObject->triangle_to_mface[0]; + glShadeModel( GL_SMOOTH ); lastFlag = 0; - for(i = 0; i < dm->drawObject->tot_triangle_point/3; i++) { - int actualFace = dm->drawObject->triangle_to_mface[i]; + for(i = 0; i < tottri; i++) { + int actualFace = next_actualFace; int flag = 1; + int flush = 0; + + if(i != tottri-1) + next_actualFace= dm->drawObject->triangle_to_mface[i+1]; if(drawParams) { flag = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr); @@ -804,27 +799,30 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, if(drawParamsMapped) flag = drawParamsMapped(userData, actualFace); } - if( flag != lastFlag ) { - if( startFace < i ) { - if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */ - if (lastFlag==1 && col) - GPU_color_switch(1); - else - GPU_color_switch(0); - glDrawArrays(GL_TRIANGLES,startFace*3,(i-startFace)*3); - } - } - lastFlag = flag; - startFace = i; + + /* flush buffer if current triangle isn't drawable or it's last triangle */ + flush= !flag || i == tottri - 1; + + if(!flush && compareDrawOptions) { + /* also compare draw options and flush buffer if they're different + need for face selection highlight in edit mode */ + flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0; } - } - if( startFace < dm->drawObject->tot_triangle_point/3 ) { - if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */ - if (lastFlag==1 && col) - GPU_color_switch(1); - else - GPU_color_switch(0); - glDrawArrays(GL_TRIANGLES, startFace*3, dm->drawObject->tot_triangle_point - startFace*3); + + if(flush) { + int first= startFace*3; + int count= (i-startFace+(flag ? 1 : 0))*3; /* Add one to the length if we're drawing at the end of the array */ + + if(count) { + if (col) + GPU_color_switch(1); + else + GPU_color_switch(0); + + glDrawArrays(GL_TRIANGLES, first, count); + } + + startFace = i + 1; } } } @@ -834,13 +832,19 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, } } -static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr)) +static void cdDM_drawFacesTex(DerivedMesh *dm, + int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) { - cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL); + cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData); } -static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs), - int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) +static void cdDM_drawMappedFaces(DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), + int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData, int useColors) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mv = cddm->mvert; @@ -980,15 +984,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us flush|= mf[actualFace].mat_nr != mf[next_actualFace].mat_nr; if(!flush && compareDrawOptions) { - int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace]; - - if(orig==ORIGINDEX_NONE || next_orig==ORIGINDEX_NONE) { - flush= 1; - } else { - /* also compare draw options and flush buffer if they're different - need for face selection highlight in edit mode */ - flush|= compareDrawOptions(userData, orig, next_orig) == 0; - } + flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0; } if(flush) { @@ -1009,9 +1005,12 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us } } -static void cdDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData) +static void cdDM_drawMappedFacesTex(DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) { - cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData); + cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData); } static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int a, int index, int vert, int smoothnormal) @@ -1058,7 +1057,10 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int glVertex3fv(mvert[index].co); } -static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) +static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, + int (*setMaterial)(int, void *attribs), + int (*setDrawOptions)(void *userData, int index), + void *userData) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; GPUVertexAttribs gattribs; @@ -1348,7 +1350,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo glShadeModel(GL_FLAT); } -static void cdDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs)) +static void cdDM_drawFacesGLSL(DerivedMesh *dm,int (*setMaterial)(int, void *attribs)) { dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL); } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 358c63b4f9f..0f1c73c59c1 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -274,16 +274,16 @@ void make_local_curve(Curve *cu) extern_local_curve(cu); } else if(is_local && is_lib) { - Curve *cun= copy_curve(cu); - cun->id.us= 0; + Curve *cu_new= copy_curve(cu); + cu_new->id.us= 0; - BKE_id_lib_local_paths(bmain, &cun->id); + BKE_id_lib_local_paths(bmain, cu->id.lib, &cu_new->id); for(ob= bmain->object.first; ob; ob= ob->id.next) { if(ob->data==cu) { if(ob->id.lib==NULL) { - ob->data= cun; - cun->id.us++; + ob->data= cu_new; + cu_new->id.us++; cu->id.us--; } } diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 0c3c78f6eef..1f09d98d697 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -45,7 +45,7 @@ #include "BLI_utildefines.h" -void defgroup_copy_list (ListBase *outbase, ListBase *inbase) +void defgroup_copy_list(ListBase *outbase, ListBase *inbase) { bDeformGroup *defgroup, *defgroupn; @@ -57,7 +57,7 @@ void defgroup_copy_list (ListBase *outbase, ListBase *inbase) } } -bDeformGroup *defgroup_duplicate (bDeformGroup *ingroup) +bDeformGroup *defgroup_duplicate(bDeformGroup *ingroup) { bDeformGroup *outgroup; @@ -65,7 +65,7 @@ bDeformGroup *defgroup_duplicate (bDeformGroup *ingroup) return NULL; outgroup=MEM_callocN(sizeof(bDeformGroup), "copy deformGroup"); - + /* For now, just copy everything over. */ memcpy (outgroup, ingroup, sizeof(bDeformGroup)); @@ -75,59 +75,85 @@ bDeformGroup *defgroup_duplicate (bDeformGroup *ingroup) } /* copy & overwrite weights */ -void defvert_copy (MDeformVert *dvert_r, const MDeformVert *dvert) +void defvert_copy(MDeformVert *dvert_dst, const MDeformVert *dvert_src) { - if(dvert_r->totweight == dvert->totweight) { - if(dvert->totweight) - memcpy(dvert_r->dw, dvert->dw, dvert->totweight * sizeof(MDeformWeight)); + if (dvert_dst->totweight == dvert_src->totweight) { + if (dvert_src->totweight) + memcpy(dvert_dst->dw, dvert_src->dw, dvert_src->totweight * sizeof(MDeformWeight)); } else { - if(dvert_r->dw) - MEM_freeN(dvert_r->dw); + if (dvert_dst->dw) + MEM_freeN(dvert_dst->dw); - if(dvert->totweight) - dvert_r->dw= MEM_dupallocN(dvert->dw); + if (dvert_src->totweight) + dvert_dst->dw= MEM_dupallocN(dvert_src->dw); else - dvert_r->dw= NULL; + dvert_dst->dw= NULL; + + dvert_dst->totweight = dvert_src->totweight; + } +} + +/* copy an index from one dvert to another + * - do nothing if neither are set. + * - add destination weight if needed. + */ +void defvert_copy_index(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const int defgroup) +{ + MDeformWeight *dw_src, *dw_dst; + + dw_src= defvert_find_index(dvert_src, defgroup); + + if (dw_src) { + /* source is valid, verify destination */ + dw_dst= defvert_verify_index(dvert_dst, defgroup); + dw_dst->weight= dw_src->weight; + } + else { + /* source was NULL, assign zero, could also remove */ + dw_dst= defvert_find_index(dvert_dst, defgroup); - dvert_r->totweight = dvert->totweight; + if (dw_dst) { + dw_dst->weight= 0.0f; + } } } /* only sync over matching weights, don't add or remove groups * warning, loop within loop. */ -void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verify) +void defvert_sync(MDeformVert *dvert_dst, const MDeformVert *dvert_src, int use_verify) { - if(dvert->totweight && dvert_r->totweight) { + if (dvert_src->totweight && dvert_dst->totweight) { int i; - MDeformWeight *dw; - for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) { - MDeformWeight *dw_r; - if(use_verify) dw_r= defvert_verify_index(dvert_r, dw->def_nr); - else dw_r= defvert_find_index(dvert_r, dw->def_nr); - - if(dw_r) { - dw_r->weight= dw->weight; + MDeformWeight *dw_src; + for (i=0, dw_src=dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) { + MDeformWeight *dw_dst; + if (use_verify) dw_dst= defvert_verify_index(dvert_dst, dw_src->def_nr); + else dw_dst= defvert_find_index(dvert_dst, dw_src->def_nr); + + if (dw_dst) { + dw_dst->weight= dw_src->weight; } } } } /* be sure all flip_map values are valid */ -void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const int *flip_map, const int flip_map_len, const int use_verify) +void defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src, + const int *flip_map, const int flip_map_len, const int use_verify) { - if (dvert->totweight && dvert_r->totweight) { + if (dvert_src->totweight && dvert_dst->totweight) { int i; - MDeformWeight *dw; - for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) { - if (dw->def_nr < flip_map_len) { - MDeformWeight *dw_r; - if(use_verify) dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]); - else dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]); - - if(dw_r) { - dw_r->weight= dw->weight; + MDeformWeight *dw_src; + for (i=0, dw_src=dvert_src->dw; i < dvert_src->totweight; i++, dw_src++) { + if (dw_src->def_nr < flip_map_len) { + MDeformWeight *dw_dst; + if (use_verify) dw_dst= defvert_verify_index(dvert_dst, flip_map[dw_src->def_nr]); + else dw_dst= defvert_find_index(dvert_dst, flip_map[dw_src->def_nr]); + + if (dw_dst) { + dw_dst->weight= dw_src->weight; } } } @@ -135,18 +161,18 @@ void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const } /* be sure all flip_map values are valid */ -void defvert_remap (MDeformVert *dvert, int *map) +void defvert_remap(MDeformVert *dvert, int *map) { MDeformWeight *dw; int i; - for(i=0, dw=dvert->dw; i<dvert->totweight; i++, dw++) { + for (i=0, dw=dvert->dw; i<dvert->totweight; i++, dw++) { dw->def_nr= map[dw->def_nr]; } } -void defvert_normalize (MDeformVert *dvert) +void defvert_normalize(MDeformVert *dvert) { - if(dvert->totweight<=0) { + if (dvert->totweight<=0) { /* nothing */ } else if (dvert->totweight==1) { @@ -156,30 +182,30 @@ void defvert_normalize (MDeformVert *dvert) int i; float tot= 0.0f; MDeformWeight *dw; - for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) + for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) tot += dw->weight; - if(tot > 0.0f) { - for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) + if (tot > 0.0f) { + for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) dw->weight /= tot; } } } -void defvert_flip (MDeformVert *dvert, const int *flip_map, const int flip_map_len) +void defvert_flip(MDeformVert *dvert, const int *flip_map, const int flip_map_len) { MDeformWeight *dw; int i; - for(dw= dvert->dw, i=0; i<dvert->totweight; dw++, i++) { - if((dw->def_nr < flip_map_len) && (flip_map[dw->def_nr] >= 0)) { + for (dw= dvert->dw, i=0; i<dvert->totweight; dw++, i++) { + if ((dw->def_nr < flip_map_len) && (flip_map[dw->def_nr] >= 0)) { dw->def_nr= flip_map[dw->def_nr]; } } } -bDeformGroup *defgroup_find_name (Object *ob, const char *name) +bDeformGroup *defgroup_find_name(Object *ob, const char *name) { /* return a pointer to the deform group with this name * or return NULL otherwise. @@ -194,7 +220,7 @@ bDeformGroup *defgroup_find_name (Object *ob, const char *name) return NULL; } -int defgroup_name_index (Object *ob, const char *name) +int defgroup_name_index(Object *ob, const char *name) { /* Return the location of the named deform group within the list of * deform groups. This function is a combination of defgroup_find_index and @@ -203,8 +229,8 @@ int defgroup_name_index (Object *ob, const char *name) */ bDeformGroup *curdef; int def_nr; - - if(name && name[0] != '\0') { + + if (name && name[0] != '\0') { for (curdef=ob->defbase.first, def_nr=0; curdef; curdef=curdef->next, def_nr++) { if (!strcmp(curdef->name, name)) return def_nr; @@ -214,7 +240,7 @@ int defgroup_name_index (Object *ob, const char *name) return -1; } -int defgroup_find_index (Object *ob, bDeformGroup *dg) +int defgroup_find_index(Object *ob, bDeformGroup *dg) { /* Fetch the location of this deform group * within the linked list of deform groups. @@ -250,7 +276,7 @@ int defgroup_find_index (Object *ob, bDeformGroup *dg) * constant for this) */ if (eg == NULL) return -1; - + return def_nr; } @@ -259,7 +285,7 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default) { int totdg= *flip_map_len= BLI_countlist(&ob->defbase); - if(totdg==0) { + if (totdg==0) { return NULL; } else { @@ -272,16 +298,16 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default) } for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) { - if(map[i] == -1) { /* may be calculated previously */ + if (map[i] == -1) { /* may be calculated previously */ /* incase no valid value is found, use this */ - if(use_default) + if (use_default) map[i]= i; flip_side_name(name, dg->name, FALSE); - if(strcmp(name, dg->name)) { + if (strcmp(name, dg->name)) { flip_num= defgroup_name_index(ob, name); - if(flip_num >= 0) { + if (flip_num >= 0) { map[i]= flip_num; map[flip_num]= i; /* save an extra lookup */ } @@ -297,7 +323,7 @@ int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, in { int totdg= *flip_map_len= BLI_countlist(&ob->defbase); - if(totdg==0) { + if (totdg==0) { return NULL; } else { @@ -313,10 +339,10 @@ int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, in dg= BLI_findlink(&ob->defbase, defgroup); flip_side_name(name, dg->name, FALSE); - if(strcmp(name, dg->name)) { + if (strcmp(name, dg->name)) { flip_num= defgroup_name_index(ob, name); - if(flip_num >= 0) { + if (flip_num >= 0) { map[defgroup]= flip_num; map[flip_num]= defgroup; } @@ -331,11 +357,11 @@ int defgroup_flip_index(Object *ob, int index, int use_default) bDeformGroup *dg= BLI_findlink(&ob->defbase, index); int flip_index = -1; - if(dg) { + if (dg) { char name[sizeof(dg->name)]; flip_side_name(name, dg->name, 0); - if(strcmp(name, dg->name)) + if (strcmp(name, dg->name)) flip_index= defgroup_name_index(ob, name); } @@ -345,7 +371,7 @@ int defgroup_flip_index(Object *ob, int index, int use_default) static int defgroup_find_name_dupe(const char *name, bDeformGroup *dg, Object *ob) { bDeformGroup *curdef; - + for (curdef = ob->defbase.first; curdef; curdef=curdef->next) { if (dg!=curdef) { if (!strcmp(curdef->name, name)) { @@ -363,7 +389,7 @@ static int defgroup_unique_check(void *arg, const char *name) return defgroup_find_name_dupe(name, data->dg, data->ob); } -void defgroup_unique_name (bDeformGroup *dg, Object *ob) +void defgroup_unique_name(bDeformGroup *dg, Object *ob) { struct {Object *ob; void *dg;} data; data.ob= ob; @@ -375,7 +401,7 @@ void defgroup_unique_name (bDeformGroup *dg, Object *ob) /* finds the best possible flipped name. For renaming; check for unique names afterwards */ /* if strip_number: removes number extensions * note: dont use sizeof() for 'name' or 'from_name' */ -void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_NAME], int strip_number) +void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_NAME], int strip_number) { int len; char prefix[MAX_VGROUP_NAME]= ""; /* The part before the facing */ @@ -385,15 +411,15 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP char *index=NULL; len= BLI_strnlen(from_name, MAX_VGROUP_NAME); - if(len<3) return; // we don't do names like .R or .L + if (len < 3) return; // we don't do names like .R or .L BLI_strncpy(name, from_name, MAX_VGROUP_NAME); /* We first check the case with a .### extension, let's find the last period */ - if(isdigit(name[len-1])) { + if (isdigit(name[len-1])) { index= strrchr(name, '.'); // last occurrence if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever! - if(strip_number==0) + if (strip_number==0) BLI_strncpy(number, index, sizeof(number)); *index= 0; len= BLI_strnlen(name, MAX_VGROUP_NAME); @@ -405,7 +431,7 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP #define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') /* first case; separator . - _ with extensions r R l L */ - if( IS_SEPARATOR(name[len-2]) ) { + if (IS_SEPARATOR(name[len-2]) ) { switch(name[len-1]) { case 'l': prefix[len-1]= 0; @@ -426,7 +452,7 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP } } /* case; beginning with r R l L , with separator after it */ - else if( IS_SEPARATOR(name[1]) ) { + else if (IS_SEPARATOR(name[1]) ) { switch(name[0]) { case 'l': strcpy(replace, "r"); @@ -450,14 +476,14 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP break; } } - else if(len > 5) { + else if (len > 5) { /* hrms, why test for a separator? lets do the rule 'ultimate left or right' */ index = BLI_strcasestr(prefix, "right"); if (index==prefix || index==prefix+len-5) { - if(index[0]=='r') + if (index[0]=='r') strcpy (replace, "left"); else { - if(index[1]=='I') + if (index[1]=='I') strcpy (replace, "LEFT"); else strcpy (replace, "Left"); @@ -468,10 +494,10 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP else { index = BLI_strcasestr(prefix, "left"); if (index==prefix || index==prefix+len-4) { - if(index[0]=='l') + if (index[0]=='l') strcpy (replace, "right"); else { - if(index[1]=='E') + if (index[1]=='E') strcpy (replace, "RIGHT"); else strcpy (replace, "Right"); @@ -487,30 +513,32 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP BLI_snprintf (name, MAX_VGROUP_NAME, "%s%s%s%s", prefix, replace, suffix, number); } -float defvert_find_weight(const struct MDeformVert *dvert, const int group_num) +float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup) { - MDeformWeight *dw= defvert_find_index(dvert, group_num); + MDeformWeight *dw= defvert_find_index(dvert, defgroup); return dw ? dw->weight : 0.0f; } -float defvert_array_find_weight_safe(const struct MDeformVert *dvert, int index, int group_num) +float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup) { - if(group_num == -1 || dvert == NULL) + if (defgroup == -1 || dvert == NULL) return 1.0f; - return defvert_find_weight(dvert+index, group_num); + return defvert_find_weight(dvert+index, defgroup); } MDeformWeight *defvert_find_index(const MDeformVert *dvert, const int defgroup) { - if(dvert && defgroup >= 0) { + if (dvert && defgroup >= 0) { MDeformWeight *dw = dvert->dw; int i; - for(i=dvert->totweight; i>0; i--, dw++) - if(dw->def_nr == defgroup) + for (i=dvert->totweight; i>0; i--, dw++) { + if (dw->def_nr == defgroup) { return dw; + } + } } return NULL; @@ -518,30 +546,74 @@ MDeformWeight *defvert_find_index(const MDeformVert *dvert, const int defgroup) /* Ensures that mv has a deform weight entry for the specified defweight group */ /* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ -MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup) +MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup) { - MDeformWeight *newdw; + MDeformWeight *dw_new; /* do this check always, this function is used to check for it */ - if(!dv || defgroup < 0) + if (!dvert || defgroup < 0) return NULL; - newdw= defvert_find_index(dv, defgroup); - if(newdw) - return newdw; + dw_new= defvert_find_index(dvert, defgroup); + if (dw_new) + return dw_new; - newdw= MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); - if (dv->dw) { - memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN(dv->dw); + dw_new= MEM_callocN(sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); + if (dvert->dw) { + memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); + MEM_freeN(dvert->dw); } - dv->dw= newdw; - newdw += dv->totweight; - newdw->weight= 0.0f; - newdw->def_nr= defgroup; + dvert->dw= dw_new; + dw_new += dvert->totweight; + dw_new->weight= 0.0f; + dw_new->def_nr= defgroup; /* Group index */ - dv->totweight++; + dvert->totweight++; + + return dw_new; +} + +/* Removes the given vertex from the vertex group, specified either by its defgrp_idx, + * or directly by its MDeformWeight pointer, if dw is not NULL. + * WARNING: This function frees the given MDeformWeight, do not use it afterward! */ +void defvert_remove_index(MDeformVert *dvert, int defgroup, MDeformWeight *dw) +{ + MDeformWeight *dw_new; + int i; + + /* Get index of removed MDeformWeight. */ + if (dw == NULL) { + dw = dvert->dw; + for (i = dvert->totweight; i > 0; i--, dw++) { + if (dw->def_nr == defgroup) + break; + } + i--; + } + else { + i = dw - dvert->dw; + /* Security check! */ + if(i < 0 || i >= dvert->totweight) + return; + } - return newdw; + dvert->totweight--; + /* If there are still other deform weights attached to this vert then remove + * this deform weight, and reshuffle the others. + */ + if (dvert->totweight) { + dw_new = MEM_mallocN(sizeof(MDeformWeight)*(dvert->totweight), __func__); + if (dvert->dw){ + memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*i); + memcpy(dw_new+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); + MEM_freeN(dvert->dw); + } + dvert->dw = dw_new; + } + else { + /* If there are no other deform weights left then just remove this one. */ + MEM_freeN(dvert->dw); + dvert->dw = NULL; + } } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index b1e39b1d768..4eaf49dc679 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1636,17 +1636,25 @@ void graph_print_adj_list(void) /* mechanism to allow editors to be informed of depsgraph updates, to do their own updates based on changes... */ -static void (*EditorsUpdateCb)(Main *bmain, ID *id)= NULL; +static void (*EditorsUpdateIDCb)(Main *bmain, ID *id)= NULL; +static void (*EditorsUpdateSceneCb)(Main *bmain, Scene *scene, int updated)= NULL; -void DAG_editors_update_cb(void (*func)(Main *bmain, ID *id)) +void DAG_editors_update_cb(void (*id_func)(Main *bmain, ID *id), void (*scene_func)(Main *bmain, Scene *scene, int updated)) { - EditorsUpdateCb= func; + EditorsUpdateIDCb= id_func; + EditorsUpdateSceneCb= scene_func; } -static void dag_editors_update(Main *bmain, ID *id) +static void dag_editors_id_update(Main *bmain, ID *id) { - if(EditorsUpdateCb) - EditorsUpdateCb(bmain, id); + if(EditorsUpdateIDCb) + EditorsUpdateIDCb(bmain, id); +} + +static void dag_editors_scene_update(Main *bmain, Scene *scene, int updated) +{ + if(EditorsUpdateSceneCb) + EditorsUpdateSceneCb(bmain, scene, updated); } /* groups with objects in this scene need to be put in the right order as well */ @@ -2460,7 +2468,7 @@ static void dag_id_flush_update(Scene *sce, ID *id) /* no point in trying in this cases */ if(id && id->us <= 1) { - dag_editors_update(bmain, id); + dag_editors_id_update(bmain, id); id= NULL; } } @@ -2572,7 +2580,7 @@ static void dag_id_flush_update(Scene *sce, ID *id) } /* update editors */ - dag_editors_update(bmain, id); + dag_editors_id_update(bmain, id); } } @@ -2612,10 +2620,10 @@ void DAG_ids_flush_tagged(Main *bmain) DAG_scene_flush_update(bmain, sce, lay, 0); } -void DAG_ids_check_recalc(Main *bmain) +void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time) { ListBase *lbarray[MAX_LIBARRAY]; - int a; + int a, updated = 0; /* loop over all ID types */ a = set_listbasepointers(bmain, lbarray); @@ -2627,13 +2635,13 @@ void DAG_ids_check_recalc(Main *bmain) /* we tag based on first ID type character to avoid looping over all ID's in case there are no tags */ if(id && bmain->id_tag_update[id->name[0]]) { - /* do editors update */ - dag_editors_update(bmain, NULL); - return; + updated= 1; + break; } } -} + dag_editors_scene_update(bmain, scene, (updated || time)); +} void DAG_ids_clear_recalc(Main *bmain) { diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 519ac1cf534..59139886fe6 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -1693,7 +1693,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData } /* apply weights into a vertex group, if doesnt exists add a new layer */ - if (defgrp_index >= 0 && !dvert && strlen(surface->output_name)>0) + if (defgrp_index >= 0 && !dvert && (surface->output_name[0] != '\0')) dvert = CustomData_add_layer_named(&result->vertData, CD_MDEFORMVERT, CD_CALLOC, NULL, sData->total_points, surface->output_name); if (defgrp_index >= 0 && dvert) { @@ -1703,25 +1703,16 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData MDeformWeight *def_weight = defvert_find_index(dv, defgrp_index); /* skip if weight value is 0 and no existing weight is found */ - if (!def_weight && !weight[i]) - continue; - - /* if not found, add a weight for it */ - if (!def_weight) { - MDeformWeight *newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), - "deformWeight"); - if(dv->dw){ - memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN(dv->dw); + if ((def_weight != NULL) || (weight[i] != 0.0f)) { + + /* if not found, add a weight for it */ + if (def_weight == NULL) { + def_weight= defvert_verify_index(dv, defgrp_index); } - dv->dw=newdw; - dv->dw[dv->totweight].def_nr=defgrp_index; - def_weight = &dv->dw[dv->totweight]; - dv->totweight++; - } - /* set weight value */ - def_weight->weight = weight[i]; + /* set weight value */ + def_weight->weight = weight[i]; + } } } } @@ -1735,11 +1726,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData for (i=0; i<sData->total_points; i++) { float normal[3]; normal_short_to_float_v3(normal, mvert[i].no); - normalize_v3(normal); - - mvert[i].co[0] += normal[0]*wPoint[i].height; - mvert[i].co[1] += normal[1]*wPoint[i].height; - mvert[i].co[2] += normal[2]*wPoint[i].height; + madd_v3_v3fl(mvert[i].co, normal, wPoint[i].height); } CDDM_calc_normals(result); } @@ -2282,10 +2269,10 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) tPoint->quad = (isInside == 2) ? 1 : 0; /* quad or tri part*/ /* save vertex indexes */ - tPoint->v1 = (isInside == 2) ? mface[i].v1 : mface[i].v1; + tPoint->v1 = mface[i].v1; /* (isInside == 2) ? mface[i].v1 : mface[i].v1; */ /* same! */ tPoint->v2 = (isInside == 2) ? mface[i].v3 : mface[i].v2; tPoint->v3 = (isInside == 2) ? mface[i].v4 : mface[i].v3; - + sample = 5; /* make sure we exit sample loop as well */ break; } @@ -3585,7 +3572,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, float radius = 0.0f; float strength = 0.0f; float velocity_val = 0.0f; - int part_index; + int part_index= -1; /* * With predefined radius, there is no variation between particles. @@ -3657,10 +3644,12 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, part_index = nearest[n].index; /* If inside solid range and no disp depth required, no need to seek further */ - if (s_range < 0.0f) - if (surface->type != MOD_DPAINT_SURFACE_T_DISPLACE && - surface->type != MOD_DPAINT_SURFACE_T_WAVE) + if ( (s_range < 0.0f) && + (surface->type != MOD_DPAINT_SURFACE_T_DISPLACE) && + (surface->type != MOD_DPAINT_SURFACE_T_WAVE)) + { break; + } } if (nearest) MEM_freeN(nearest); @@ -3688,7 +3677,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, float depth = 0.0f; /* apply velocity */ - if (brush->flags & MOD_DPAINT_USES_VELOCITY) { + if ((brush->flags & MOD_DPAINT_USES_VELOCITY) && (part_index != -1)) { float velocity[3]; ParticleData *pa = psys->particles + part_index; mul_v3_v3fl(velocity, pa->state.vel, particle_timestep); @@ -3700,8 +3689,9 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, velocity_val = len_v3(velocity); /* store brush velocity for smudge */ - if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && - brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) { + if ( (surface->type == MOD_DPAINT_SURFACE_T_PAINT) && + (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity)) + { copy_v3_v3(&bData->brush_velocity[index*4], velocity); mul_v3_fl(&bData->brush_velocity[index*4], 1.0f/velocity_val); bData->brush_velocity[index*4+3] = velocity_val; @@ -3709,12 +3699,11 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, } if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) { - paintColor[0] = brush->r; - paintColor[1] = brush->g; - paintColor[2] = brush->b; + copy_v3_v3(paintColor, &brush->r); } - else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE || - surface->type == MOD_DPAINT_SURFACE_T_WAVE) { + else if ( (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) || + (surface->type == MOD_DPAINT_SURFACE_T_WAVE)) + { /* get displace depth */ disp_intersect = (1.0f - sqrtf(disp_intersect / radius)) * radius; depth = (radius - disp_intersect) / bData->bNormal[index].normal_scale; diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c new file mode 100644 index 00000000000..541ccf9ac37 --- /dev/null +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -0,0 +1,1289 @@ +/* + * ***** 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) 2005 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/editderivedmesh.c + * \ingroup bke + */ + +#include "GL/glew.h" + +#include "BLI_utildefines.h" +#include "BLI_blenlib.h" +#include "BLI_edgehash.h" +#include "BLI_editVert.h" +#include "BLI_math.h" +#include "BLI_pbvh.h" + +#include "BKE_cdderivedmesh.h" +#include "BKE_global.h" +#include "BKE_mesh.h" +#include "BKE_paint.h" + + +#include "DNA_meshdata_types.h" +#include "DNA_object_types.h" +#include "DNA_curve_types.h" /* for Curve */ + +#include "MEM_guardedalloc.h" + +#include "GPU_buffers.h" +#include "GPU_draw.h" +#include "GPU_extensions.h" +#include "GPU_material.h" + +#include <string.h> +#include <limits.h> +#include <math.h> + +extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */ + +static void emDM_foreachMappedVert( + DerivedMesh *dm, + void (*func)(void *userData, int index, float *co, float *no_f, short *no_s), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *eve; + int i; + + for (i=0,eve= emdm->em->verts.first; eve; i++,eve=eve->next) { + if (emdm->vertexCos) { + func(userData, i, emdm->vertexCos[i], emdm->vertexNos[i], NULL); + } + else { + func(userData, i, eve->co, eve->no, NULL); + } + } +} +static void emDM_foreachMappedEdge( + DerivedMesh *dm, + void (*func)(void *userData, int index, float *v0co, float *v1co), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditEdge *eed; + int i; + + if (emdm->vertexCos) { + EditVert *eve; + + for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) + func(userData, i, emdm->vertexCos[(int) eed->v1->tmp.l], emdm->vertexCos[(int) eed->v2->tmp.l]); + } + else { + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) + func(userData, i, eed->v1->co, eed->v2->co); + } +} + +static void emDM_drawMappedEdges( + DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditEdge *eed; + int i; + + if (emdm->vertexCos) { + EditVert *eve; + + for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + + glBegin(GL_LINES); + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { + if (!setDrawOptions || setDrawOptions(userData, i)) { + glVertex3fv(emdm->vertexCos[(int) eed->v1->tmp.l]); + glVertex3fv(emdm->vertexCos[(int) eed->v2->tmp.l]); + } + } + glEnd(); + } + else { + glBegin(GL_LINES); + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { + if (!setDrawOptions || setDrawOptions(userData, i)) { + glVertex3fv(eed->v1->co); + glVertex3fv(eed->v2->co); + } + } + glEnd(); + } +} +static void emDM_drawEdges( + DerivedMesh *dm, + int UNUSED(drawLooseEdges), + int UNUSED(drawAllEdges)) +{ + emDM_drawMappedEdges(dm, NULL, NULL); +} + +static void emDM_drawMappedEdgesInterp( + DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index), + void (*setDrawInterpOptions)(void *userData, int index, float t), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditEdge *eed; + int i; + + if (emdm->vertexCos) { + EditVert *eve; + + for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + + glBegin(GL_LINES); + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { + if (!setDrawOptions || setDrawOptions(userData, i)) { + setDrawInterpOptions(userData, i, 0.0); + glVertex3fv(emdm->vertexCos[(int) eed->v1->tmp.l]); + setDrawInterpOptions(userData, i, 1.0); + glVertex3fv(emdm->vertexCos[(int) eed->v2->tmp.l]); + } + } + glEnd(); + } + else { + glBegin(GL_LINES); + for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) { + if (!setDrawOptions || setDrawOptions(userData, i)) { + setDrawInterpOptions(userData, i, 0.0); + glVertex3fv(eed->v1->co); + setDrawInterpOptions(userData, i, 1.0); + glVertex3fv(eed->v2->co); + } + } + glEnd(); + } +} + +static void emDM_drawUVEdges(DerivedMesh *dm) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditFace *efa; + MTFace *tf; + + glBegin(GL_LINES); + for (efa= emdm->em->faces.first; efa; efa= efa->next) { + tf = CustomData_em_get(&emdm->em->fdata, efa->data, CD_MTFACE); + + if (tf && !(efa->h)) { + glVertex2fv(tf->uv[0]); + glVertex2fv(tf->uv[1]); + + glVertex2fv(tf->uv[1]); + glVertex2fv(tf->uv[2]); + + if (!efa->v4) { + glVertex2fv(tf->uv[2]); + glVertex2fv(tf->uv[0]); + } + else { + glVertex2fv(tf->uv[2]); + glVertex2fv(tf->uv[3]); + glVertex2fv(tf->uv[3]); + glVertex2fv(tf->uv[0]); + } + } + } + glEnd(); +} + +static void emDM__calcFaceCent(EditFace *efa, float cent[3], float (*vertexCos)[3]) +{ + if (vertexCos) { + copy_v3_v3(cent, vertexCos[(int) efa->v1->tmp.l]); + add_v3_v3(cent, vertexCos[(int) efa->v2->tmp.l]); + add_v3_v3(cent, vertexCos[(int) efa->v3->tmp.l]); + if (efa->v4) add_v3_v3(cent, vertexCos[(int) efa->v4->tmp.l]); + } + else { + copy_v3_v3(cent, efa->v1->co); + add_v3_v3(cent, efa->v2->co); + add_v3_v3(cent, efa->v3->co); + if (efa->v4) add_v3_v3(cent, efa->v4->co); + } + + if (efa->v4) { + mul_v3_fl(cent, 0.25f); + } + else { + mul_v3_fl(cent, 0.33333333333f); + } +} + +static void emDM_foreachMappedFaceCenter( + DerivedMesh *dm, + void (*func)(void *userData, int index, float *co, float *no), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *eve; + EditFace *efa; + float cent[3]; + int i; + + if (emdm->vertexCos) { + for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + } + + for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { + emDM__calcFaceCent(efa, cent, emdm->vertexCos); + func(userData, i, cent, emdm->vertexCos?emdm->faceNos[i]:efa->n); + } +} + +/* note, material function is ignored for now. */ +static void emDM_drawMappedFaces( + DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), + int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData, int UNUSED(useColors)) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditFace *efa; + int i, draw; + const int skip_normals= !glIsEnabled(GL_LIGHTING); /* could be passed as an arg */ + + /* GL_ZERO is used to detect if drawing has started or not */ + GLenum poly_prev= GL_ZERO; + GLenum shade_prev= GL_ZERO; + + (void)setMaterial; /* UNUSED */ + + /* currently unused -- each original face is handled separately */ + (void)compareDrawOptions; + + if (emdm->vertexCos) { + /* add direct access */ + float (*vertexCos)[3]= emdm->vertexCos; + float (*vertexNos)[3]= emdm->vertexNos; + float (*faceNos)[3]= emdm->faceNos; + EditVert *eve; + + for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + + for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { + int drawSmooth = (efa->flag & ME_SMOOTH); + draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth); + if (draw) { + const GLenum poly_type= efa->v4 ? GL_QUADS:GL_TRIANGLES; + if (draw==2) { /* enabled with stipple */ + + if (poly_prev != GL_ZERO) glEnd(); + poly_prev= GL_ZERO; /* force glBegin */ + + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_quarttone); + } + + if (skip_normals) { + if (poly_type != poly_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glBegin((poly_prev= poly_type)); + } + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + if (poly_type == GL_QUADS) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + else { + const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; + if (shade_type != shade_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ + glBegin((poly_prev= poly_type)); + } + else if (poly_type != poly_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glBegin((poly_prev= poly_type)); + } + + if (!drawSmooth) { + glNormal3fv(faceNos[i]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + if (poly_type == GL_QUADS) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + else { + glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + if (poly_type == GL_QUADS) { + glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + } + } + + if (draw==2) { + glEnd(); + poly_prev= GL_ZERO; /* force glBegin */ + + glDisable(GL_POLYGON_STIPPLE); + } + } + } + } + else { + for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) { + int drawSmooth = (efa->flag & ME_SMOOTH); + draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth); + if (draw) { + const GLenum poly_type= efa->v4 ? GL_QUADS:GL_TRIANGLES; + if (draw==2) { /* enabled with stipple */ + + if (poly_prev != GL_ZERO) glEnd(); + poly_prev= GL_ZERO; /* force glBegin */ + + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_quarttone); + } + + if (skip_normals) { + if (poly_type != poly_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glBegin((poly_prev= poly_type)); + } + glVertex3fv(efa->v1->co); + glVertex3fv(efa->v2->co); + glVertex3fv(efa->v3->co); + if (poly_type == GL_QUADS) glVertex3fv(efa->v4->co); + } + else { + const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT; + if (shade_type != shade_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */ + glBegin((poly_prev= poly_type)); + } + else if (poly_type != poly_prev) { + if (poly_prev != GL_ZERO) glEnd(); + glBegin((poly_prev= poly_type)); + } + + if (!drawSmooth) { + glNormal3fv(efa->n); + glVertex3fv(efa->v1->co); + glVertex3fv(efa->v2->co); + glVertex3fv(efa->v3->co); + if (poly_type == GL_QUADS) glVertex3fv(efa->v4->co); + } + else { + glNormal3fv(efa->v1->no); + glVertex3fv(efa->v1->co); + glNormal3fv(efa->v2->no); + glVertex3fv(efa->v2->co); + glNormal3fv(efa->v3->no); + glVertex3fv(efa->v3->co); + if (poly_type == GL_QUADS) { + glNormal3fv(efa->v4->no); + glVertex3fv(efa->v4->co); + } + } + } + + + if (draw==2) { + glEnd(); + poly_prev= GL_ZERO; /* force glBegin */ + + glDisable(GL_POLYGON_STIPPLE); + } + } + } + } + + /* if non zero we know a face was rendered */ + if (poly_prev != GL_ZERO) glEnd(); +} + +static void emDM_drawFacesTex_common( + DerivedMesh *dm, + int (*drawParams)(MTFace *tface, int has_mcol, int matnr), + int (*drawParamsMapped)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditMesh *em= emdm->em; + float (*vertexCos)[3]= emdm->vertexCos; + float (*vertexNos)[3]= emdm->vertexNos; + EditFace *efa; + int i; + + (void) compareDrawOptions; + + /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ + glShadeModel(GL_SMOOTH); + + if (vertexCos) { + EditVert *eve; + + for (i=0,eve=em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + + for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { + MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + MCol *mcol= CustomData_em_get(&em->fdata, efa->data, CD_MCOL); + unsigned char *cp= NULL; + int drawSmooth= (efa->flag & ME_SMOOTH); + int flag; + + if (drawParams) + flag= drawParams(tf, (mcol != NULL), efa->mat_nr); + else if (drawParamsMapped) + flag= drawParamsMapped(userData, i); + else + flag= 1; + + if (flag != 0) { /* flag 0 == the face is hidden or invisible */ + + /* we always want smooth here since otherwise vertex colors dont interpolate */ + if (mcol) { + if (flag==1) { + cp= (unsigned char*)mcol; + } + } + else { + glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); + } + + glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); + if (!drawSmooth) { + glNormal3fv(emdm->faceNos[i]); + + if (tf) glTexCoord2fv(tf->uv[0]); + if (cp) glColor3ub(cp[3], cp[2], cp[1]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + + if (tf) glTexCoord2fv(tf->uv[1]); + if (cp) glColor3ub(cp[7], cp[6], cp[5]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + + if (tf) glTexCoord2fv(tf->uv[2]); + if (cp) glColor3ub(cp[11], cp[10], cp[9]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + + if (efa->v4) { + if (tf) glTexCoord2fv(tf->uv[3]); + if (cp) glColor3ub(cp[15], cp[14], cp[13]); + glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + } + else { + if (tf) glTexCoord2fv(tf->uv[0]); + if (cp) glColor3ub(cp[3], cp[2], cp[1]); + glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + + if (tf) glTexCoord2fv(tf->uv[1]); + if (cp) glColor3ub(cp[7], cp[6], cp[5]); + glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + + if (tf) glTexCoord2fv(tf->uv[2]); + if (cp) glColor3ub(cp[11], cp[10], cp[9]); + glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + + if (efa->v4) { + if (tf) glTexCoord2fv(tf->uv[3]); + if (cp) glColor3ub(cp[15], cp[14], cp[13]); + glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + } + glEnd(); + } + } + } + else { + for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { + MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); + MCol *mcol= CustomData_em_get(&em->fdata, efa->data, CD_MCOL); + unsigned char *cp= NULL; + int drawSmooth= (efa->flag & ME_SMOOTH); + int flag; + + if (drawParams) + flag= drawParams(tf, (mcol != NULL), efa->mat_nr); + else if (drawParamsMapped) + flag= drawParamsMapped(userData, i); + else + flag= 1; + + if (flag != 0) { /* flag 0 == the face is hidden or invisible */ + + /* we always want smooth here since otherwise vertex colors dont interpolate */ + if (mcol) { + if (flag==1) { + cp= (unsigned char*)mcol; + } + } + else { + glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); + } + + glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); + if (!drawSmooth) { + glNormal3fv(efa->n); + + if (tf) glTexCoord2fv(tf->uv[0]); + if (cp) glColor3ub(cp[3], cp[2], cp[1]); + glVertex3fv(efa->v1->co); + + if (tf) glTexCoord2fv(tf->uv[1]); + if (cp) glColor3ub(cp[7], cp[6], cp[5]); + glVertex3fv(efa->v2->co); + + if (tf) glTexCoord2fv(tf->uv[2]); + if (cp) glColor3ub(cp[11], cp[10], cp[9]); + glVertex3fv(efa->v3->co); + + if (efa->v4) { + if (tf) glTexCoord2fv(tf->uv[3]); + if (cp) glColor3ub(cp[15], cp[14], cp[13]); + glVertex3fv(efa->v4->co); + } + } + else { + if (tf) glTexCoord2fv(tf->uv[0]); + if (cp) glColor3ub(cp[3], cp[2], cp[1]); + glNormal3fv(efa->v1->no); + glVertex3fv(efa->v1->co); + + if (tf) glTexCoord2fv(tf->uv[1]); + if (cp) glColor3ub(cp[7], cp[6], cp[5]); + glNormal3fv(efa->v2->no); + glVertex3fv(efa->v2->co); + + if (tf) glTexCoord2fv(tf->uv[2]); + if (cp) glColor3ub(cp[11], cp[10], cp[9]); + glNormal3fv(efa->v3->no); + glVertex3fv(efa->v3->co); + + if (efa->v4) { + if (tf) glTexCoord2fv(tf->uv[3]); + if (cp) glColor3ub(cp[15], cp[14], cp[13]); + glNormal3fv(efa->v4->no); + glVertex3fv(efa->v4->co); + } + } + glEnd(); + } + } + } +} + +static void emDM_drawFacesTex( + DerivedMesh *dm, + int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) +{ + emDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData); +} + +static void emDM_drawMappedFacesTex( + DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) +{ + emDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData); +} + +static void emDM_drawMappedFacesGLSL( + DerivedMesh *dm, + int (*setMaterial)(int, void *attribs), + int (*setDrawOptions)(void *userData, int index), + void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditMesh *em= emdm->em; + float (*vertexCos)[3]= emdm->vertexCos; + float (*vertexNos)[3]= emdm->vertexNos; + EditVert *eve; + EditFace *efa; + DMVertexAttribs attribs= {{{0}}}; + GPUVertexAttribs gattribs; + /* int tfoffset; */ /* UNUSED */ + int i, b, matnr, new_matnr, dodraw /* , layer */ /* UNUSED */; + + dodraw = 0; + matnr = -1; + + /* layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE); */ /* UNUSED */ + /* tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset; */ /* UNUSED */ + + /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ + glShadeModel(GL_SMOOTH); + + for (i=0,eve=em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + +#define PASSATTRIB(efa, eve, vert) { \ + if (attribs.totorco) { \ + float *orco = attribs.orco.array[eve->tmp.l]; \ + glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \ + } \ + for (b = 0; b < attribs.tottface; b++) { \ + MTFace *_tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ + glVertexAttrib2fvARB(attribs.tface[b].glIndex, _tf->uv[vert]); \ + } \ + for (b = 0; b < attribs.totmcol; b++) { \ + MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \ + GLubyte col[4]; \ + col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \ + glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \ + } \ + if (attribs.tottang) { \ + float *tang = attribs.tang.array[i*4 + vert]; \ + glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \ + } \ +} + + for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { + int drawSmooth= (efa->flag & ME_SMOOTH); + + if (setDrawOptions && !setDrawOptions(userData, i)) + continue; + + new_matnr = efa->mat_nr + 1; + if (new_matnr != matnr) { + dodraw = setMaterial(matnr = new_matnr, &gattribs); + if (dodraw) + DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); + } + + if (dodraw) { + glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); + if (!drawSmooth) { + if (vertexCos) glNormal3fv(emdm->faceNos[i]); + else glNormal3fv(efa->n); + + PASSATTRIB(efa, efa->v1, 0); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + else glVertex3fv(efa->v1->co); + + PASSATTRIB(efa, efa->v2, 1); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + else glVertex3fv(efa->v2->co); + + PASSATTRIB(efa, efa->v3, 2); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + else glVertex3fv(efa->v3->co); + + if (efa->v4) { + PASSATTRIB(efa, efa->v4, 3); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + else glVertex3fv(efa->v4->co); + } + } + else { + PASSATTRIB(efa, efa->v1, 0); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + } + else { + glNormal3fv(efa->v1->no); + glVertex3fv(efa->v1->co); + } + + PASSATTRIB(efa, efa->v2, 1); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + } + else { + glNormal3fv(efa->v2->no); + glVertex3fv(efa->v2->co); + } + + PASSATTRIB(efa, efa->v3, 2); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + } + else { + glNormal3fv(efa->v3->no); + glVertex3fv(efa->v3->co); + } + + if (efa->v4) { + PASSATTRIB(efa, efa->v4, 3); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + else { + glNormal3fv(efa->v4->no); + glVertex3fv(efa->v4->co); + } + } + } + glEnd(); + } + } +#undef PASSATTRIB +} + +static void emDM_drawFacesGLSL( + DerivedMesh *dm, + int (*setMaterial)(int, void *attribs)) +{ + dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL); +} + +static void emDM_drawMappedFacesMat( + DerivedMesh *dm, + void (*setMaterial)(void *userData, int, void *attribs), + int (*setFace)(void *userData, int index), void *userData) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditMesh *em= emdm->em; + float (*vertexCos)[3]= emdm->vertexCos; + float (*vertexNos)[3]= emdm->vertexNos; + EditVert *eve; + EditFace *efa; + DMVertexAttribs attribs= {{{0}}}; + GPUVertexAttribs gattribs; + int i, b, matnr, new_matnr; + + matnr = -1; + + /* always use smooth shading even for flat faces, else vertex colors wont interpolate */ + glShadeModel(GL_SMOOTH); + + for (i=0,eve=em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + +#define PASSATTRIB(efa, eve, vert) { \ + if (attribs.totorco) { \ + float *orco = attribs.orco.array[eve->tmp.l]; \ + if (attribs.orco.glTexco) \ + glTexCoord3fv(orco); \ + else \ + glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \ + } \ + for (b = 0; b < attribs.tottface; b++) { \ + MTFace *_tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ + if (attribs.tface[b].glTexco) \ + glTexCoord2fv(_tf->uv[vert]); \ + else \ + glVertexAttrib2fvARB(attribs.tface[b].glIndex, _tf->uv[vert]); \ + } \ + for (b = 0; b < attribs.totmcol; b++) { \ + MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \ + GLubyte col[4]; \ + col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \ + glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \ + } \ + if (attribs.tottang) { \ + float *tang = attribs.tang.array[i*4 + vert]; \ + glVertexAttrib4fvARB(attribs.tang.glIndex, tang); \ + } \ +} + + for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) { + int drawSmooth= (efa->flag & ME_SMOOTH); + + /* face hiding */ + if (setFace && !setFace(userData, i)) + continue; + + /* material */ + new_matnr = efa->mat_nr + 1; + if (new_matnr != matnr) { + setMaterial(userData, matnr = new_matnr, &gattribs); + DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); + } + + /* face */ + glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); + if (!drawSmooth) { + if (vertexCos) glNormal3fv(emdm->faceNos[i]); + else glNormal3fv(efa->n); + + PASSATTRIB(efa, efa->v1, 0); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + else glVertex3fv(efa->v1->co); + + PASSATTRIB(efa, efa->v2, 1); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + else glVertex3fv(efa->v2->co); + + PASSATTRIB(efa, efa->v3, 2); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + else glVertex3fv(efa->v3->co); + + if (efa->v4) { + PASSATTRIB(efa, efa->v4, 3); + if (vertexCos) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + else glVertex3fv(efa->v4->co); + } + } + else { + PASSATTRIB(efa, efa->v1, 0); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v1->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v1->tmp.l]); + } + else { + glNormal3fv(efa->v1->no); + glVertex3fv(efa->v1->co); + } + + PASSATTRIB(efa, efa->v2, 1); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v2->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v2->tmp.l]); + } + else { + glNormal3fv(efa->v2->no); + glVertex3fv(efa->v2->co); + } + + PASSATTRIB(efa, efa->v3, 2); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v3->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v3->tmp.l]); + } + else { + glNormal3fv(efa->v3->no); + glVertex3fv(efa->v3->co); + } + + if (efa->v4) { + PASSATTRIB(efa, efa->v4, 3); + if (vertexCos) { + glNormal3fv(vertexNos[(int) efa->v4->tmp.l]); + glVertex3fv(vertexCos[(int) efa->v4->tmp.l]); + } + else { + glNormal3fv(efa->v4->no); + glVertex3fv(efa->v4->co); + } + } + } + glEnd(); + } +#undef PASSATTRIB +} + +static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *eve; + int i; + + if (emdm->em->verts.first) { + for (i=0,eve= emdm->em->verts.first; eve; i++,eve= eve->next) { + if (emdm->vertexCos) { + DO_MINMAX(emdm->vertexCos[i], min_r, max_r); + } + else { + DO_MINMAX(eve->co, min_r, max_r); + } + } + } + else { + min_r[0] = min_r[1] = min_r[2] = max_r[0] = max_r[1] = max_r[2] = 0.0; + } +} +static int emDM_getNumVerts(DerivedMesh *dm) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + + return BLI_countlist(&emdm->em->verts); +} + +static int emDM_getNumEdges(DerivedMesh *dm) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + + return BLI_countlist(&emdm->em->edges); +} + +static int emDM_getNumFaces(DerivedMesh *dm) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + + return BLI_countlist(&emdm->em->faces); +} + +static void emDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3]) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *eve; + int i; + + for (i=0,eve= emdm->em->verts.first; eve; i++,eve=eve->next) { + if (emdm->vertexCos) { + copy_v3_v3(cos_r[i], emdm->vertexCos[i]); + } + else { + copy_v3_v3(cos_r[i], eve->co); + } + } +} + +static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) +{ + EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first; + int i; + + for (i = 0; i < index; ++i) ev = ev->next; + + copy_v3_v3(vert_r->co, ev->co); + + normal_float_to_short_v3(vert_r->no, ev->no); + + /* TODO what to do with vert_r->flag? */ + vert_r->bweight = (unsigned char) (ev->bweight*255.0f); +} + +static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) +{ + EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; + EditEdge *ee = em->edges.first; + EditVert *ev, *v1, *v2; + int i; + + for (i = 0; i < index; ++i) ee = ee->next; + + edge_r->crease = (unsigned char) (ee->crease*255.0f); + edge_r->bweight = (unsigned char) (ee->bweight*255.0f); + /* TODO what to do with edge_r->flag? */ + edge_r->flag = ME_EDGEDRAW|ME_EDGERENDER; + if (ee->seam) edge_r->flag |= ME_SEAM; + if (ee->sharp) edge_r->flag |= ME_SHARP; + if (ee->freestyle) edge_r->flag |= ME_FREESTYLE_EDGE; +#if 0 + /* this needs setup of f2 field */ + if (!ee->f2) edge_r->flag |= ME_LOOSEEDGE; +#endif + + /* goddamn, we have to search all verts to find indices */ + v1 = ee->v1; + v2 = ee->v2; + for (i = 0, ev = em->verts.first; v1 || v2; i++, ev = ev->next) { + if (ev == v1) { + edge_r->v1 = i; + v1 = NULL; + } + if (ev == v2) { + edge_r->v2 = i; + v2 = NULL; + } + } +} + +static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) +{ + EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; + EditFace *ef = em->faces.first; + EditVert *ev, *v1, *v2, *v3, *v4; + int i; + + for (i = 0; i < index; ++i) ef = ef->next; + + face_r->mat_nr = ef->mat_nr; + face_r->flag = ef->flag; + + /* goddamn, we have to search all verts to find indices */ + v1 = ef->v1; + v2 = ef->v2; + v3 = ef->v3; + v4 = ef->v4; + if (!v4) face_r->v4 = 0; + + for (i = 0, ev = em->verts.first; v1 || v2 || v3 || v4; + i++, ev = ev->next) { + if (ev == v1) { + face_r->v1 = i; + v1 = NULL; + } + if (ev == v2) { + face_r->v2 = i; + v2 = NULL; + } + if (ev == v3) { + face_r->v3 = i; + v3 = NULL; + } + if (ev == v4) { + face_r->v4 = i; + v4 = NULL; + } + } + + test_index_face(face_r, NULL, 0, ef->v4?4:3); +} + +static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditVert *ev = emdm->em->verts.first; + int i; + + for (i=0; ev; ev = ev->next, ++vert_r, ++i) { + if (emdm->vertexCos) + copy_v3_v3(vert_r->co, emdm->vertexCos[i]); + else + copy_v3_v3(vert_r->co, ev->co); + + normal_float_to_short_v3(vert_r->no, ev->no); + + /* TODO what to do with vert_r->flag? */ + vert_r->flag = 0; + vert_r->bweight = (unsigned char) (ev->bweight*255.0f); + } +} + +static void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) +{ + EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; + EditEdge *ee = em->edges.first; + EditVert *ev; + int i; + + /* store vertex indices in tmp union */ + for (ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) + ev->tmp.l = (intptr_t) i; + + for ( ; ee; ee = ee->next, ++edge_r) { + edge_r->crease = (unsigned char) (ee->crease*255.0f); + edge_r->bweight = (unsigned char) (ee->bweight*255.0f); + /* TODO what to do with edge_r->flag? */ + edge_r->flag = ME_EDGEDRAW|ME_EDGERENDER; + if (ee->seam) edge_r->flag |= ME_SEAM; + if (ee->sharp) edge_r->flag |= ME_SHARP; + if (ee->freestyle) edge_r->flag |= ME_FREESTYLE_EDGE; +#if 0 + /* this needs setup of f2 field */ + if (!ee->f2) edge_r->flag |= ME_LOOSEEDGE; +#endif + + edge_r->v1 = (int)ee->v1->tmp.l; + edge_r->v2 = (int)ee->v2->tmp.l; + } +} + +static void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) +{ + EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; + EditFace *ef = em->faces.first; + EditVert *ev; + int i; + + /* store vertexes indices in tmp union */ + for (ev = em->verts.first, i = 0; ev; ev = ev->next, ++i) + ev->tmp.l = (intptr_t) i; + + for ( ; ef; ef = ef->next, ++face_r) { + face_r->mat_nr = ef->mat_nr; + face_r->flag = ef->flag; + + face_r->v1 = (int)ef->v1->tmp.l; + face_r->v2 = (int)ef->v2->tmp.l; + face_r->v3 = (int)ef->v3->tmp.l; + if (ef->v4) face_r->v4 = (int)ef->v4->tmp.l; + else face_r->v4 = 0; + + test_index_face(face_r, NULL, 0, ef->v4?4:3); + } +} + +static void *emDM_getFaceDataArray(DerivedMesh *dm, int type) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + EditMesh *em= emdm->em; + EditFace *efa; + char *data, *emdata; + void *datalayer; + int index, size; + + datalayer = DM_get_face_data_layer(dm, type); + if (datalayer) + return datalayer; + + /* layers are store per face for editmesh, we convert to a temporary + * data layer array in the derivedmesh when these are requested */ + if (type == CD_MTFACE || type == CD_MCOL) { + index = CustomData_get_layer_index(&em->fdata, type); + + if (index != -1) { + /* int offset = em->fdata.layers[index].offset; */ /* UNUSED */ + size = CustomData_sizeof(type); + + DM_add_face_layer(dm, type, CD_CALLOC, NULL); + index = CustomData_get_layer_index(&dm->faceData, type); + dm->faceData.layers[index].flag |= CD_FLAG_TEMPORARY; + + data = datalayer = DM_get_face_data_layer(dm, type); + for (efa=em->faces.first; efa; efa=efa->next, data+=size) { + emdata = CustomData_em_get(&em->fdata, efa->data, type); + memcpy(data, emdata, size); + } + } + } + + return datalayer; +} + +static void emDM_release(DerivedMesh *dm) +{ + EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; + + if (DM_release(dm)) { + if (emdm->vertexCos) { + MEM_freeN(emdm->vertexCos); + MEM_freeN(emdm->vertexNos); + MEM_freeN(emdm->faceNos); + } + + MEM_freeN(emdm); + } +} + +DerivedMesh *editmesh_get_derived( + EditMesh *em, + float (*vertexCos)[3]) +{ + EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm"); + + DM_init(&emdm->dm, DM_TYPE_EDITMESH, BLI_countlist(&em->verts), + BLI_countlist(&em->edges), BLI_countlist(&em->faces)); + + emdm->dm.getMinMax = emDM_getMinMax; + + emdm->dm.getNumVerts = emDM_getNumVerts; + emdm->dm.getNumEdges = emDM_getNumEdges; + emdm->dm.getNumFaces = emDM_getNumFaces; + + emdm->dm.getVertCos = emDM_getVertCos; + + emdm->dm.getVert = emDM_getVert; + emdm->dm.getEdge = emDM_getEdge; + emdm->dm.getFace = emDM_getFace; + emdm->dm.copyVertArray = emDM_copyVertArray; + emdm->dm.copyEdgeArray = emDM_copyEdgeArray; + emdm->dm.copyFaceArray = emDM_copyFaceArray; + emdm->dm.getFaceDataArray = emDM_getFaceDataArray; + + emdm->dm.foreachMappedVert = emDM_foreachMappedVert; + emdm->dm.foreachMappedEdge = emDM_foreachMappedEdge; + emdm->dm.foreachMappedFaceCenter = emDM_foreachMappedFaceCenter; + + emdm->dm.drawEdges = emDM_drawEdges; + emdm->dm.drawMappedEdges = emDM_drawMappedEdges; + emdm->dm.drawMappedEdgesInterp = emDM_drawMappedEdgesInterp; + emdm->dm.drawMappedFaces = emDM_drawMappedFaces; + emdm->dm.drawMappedFacesTex = emDM_drawMappedFacesTex; + emdm->dm.drawMappedFacesGLSL = emDM_drawMappedFacesGLSL; + emdm->dm.drawFacesTex = emDM_drawFacesTex; + emdm->dm.drawFacesGLSL = emDM_drawFacesGLSL; + emdm->dm.drawMappedFacesMat = emDM_drawMappedFacesMat; + emdm->dm.drawUVEdges = emDM_drawUVEdges; + + emdm->dm.release = emDM_release; + + emdm->em = em; + emdm->vertexCos = vertexCos; + + if (CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) { + EditVert *eve; + int i; + + DM_add_vert_layer(&emdm->dm, CD_MDEFORMVERT, CD_CALLOC, NULL); + + for (eve = em->verts.first, i = 0; eve; eve = eve->next, ++i) + DM_set_vert_data(&emdm->dm, i, CD_MDEFORMVERT, + CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT)); + } + + if (vertexCos) { + EditVert *eve; + EditFace *efa; + int totface = BLI_countlist(&em->faces); + int i; + + for (i=0,eve=em->verts.first; eve; eve= eve->next) + eve->tmp.l = (intptr_t) i++; + + emdm->vertexNos = MEM_callocN(sizeof(*emdm->vertexNos)*i, "emdm_vno"); + emdm->faceNos = MEM_mallocN(sizeof(*emdm->faceNos)*totface, "emdm_vno"); + + for (i=0, efa= em->faces.first; efa; i++, efa=efa->next) { + float *v1 = vertexCos[(int) efa->v1->tmp.l]; + float *v2 = vertexCos[(int) efa->v2->tmp.l]; + float *v3 = vertexCos[(int) efa->v3->tmp.l]; + float *no = emdm->faceNos[i]; + + if (efa->v4) { + float *v4 = vertexCos[(int) efa->v4->tmp.l]; + + normal_quad_v3( no,v1, v2, v3, v4); + add_v3_v3(emdm->vertexNos[(int) efa->v4->tmp.l], no); + } + else { + normal_tri_v3( no,v1, v2, v3); + } + + add_v3_v3(emdm->vertexNos[(int) efa->v1->tmp.l], no); + add_v3_v3(emdm->vertexNos[(int) efa->v2->tmp.l], no); + add_v3_v3(emdm->vertexNos[(int) efa->v3->tmp.l], no); + } + + for (i=0, eve= em->verts.first; eve; i++, eve=eve->next) { + float *no = emdm->vertexNos[i]; + /* following Mesh convention; we use vertex coordinate itself + * for normal in this case */ + if (normalize_v3(no) == 0.0f) { + normalize_v3_v3(no, vertexCos[i]); + } + } + } + + return (DerivedMesh*) emdm; +} + diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7b58c0bc00b..dcb8533d7a1 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -154,43 +154,6 @@ typedef struct VeNoCo { /* ***************** PARTICLES ***************** */ -/* deprecated, only keep this for readfile.c */ -PartEff *give_parteff(Object *ob) -{ - PartEff *paf; - - paf= ob->effect.first; - while(paf) { - if(paf->type==EFF_PARTICLE) return paf; - paf= paf->next; - } - return NULL; -} - -void free_effect(Effect *eff) -{ - PartEff *paf; - - if(eff->type==EFF_PARTICLE) { - paf= (PartEff *)eff; - if(paf->keys) MEM_freeN(paf->keys); - } - MEM_freeN(eff); -} - - -void free_effects(ListBase *lb) -{ - Effect *eff; - - eff= lb->first; - while(eff) { - BLI_remlink(lb, eff); - free_effect(eff); - eff= lb->first; - } -} - /* -------------------------- Effectors ------------------ */ void free_partdeflect(PartDeflect *pd) { diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index c5709ad3d9c..8ebac31ad95 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -114,23 +114,28 @@ void unlink_group(Group *group) } for(ob= bmain->object.first; ob; ob= ob->id.next) { - bActionStrip *strip; if(ob->dup_group==group) { ob->dup_group= NULL; - - /* duplicator strips use a group object, we remove it */ - for(strip= ob->nlastrips.first; strip; strip= strip->next) { - if(strip->object) - strip->object= NULL; +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ + { + bActionStrip *strip; + /* duplicator strips use a group object, we remove it */ + for(strip= ob->nlastrips.first; strip; strip= strip->next) { + if(strip->object) + strip->object= NULL; + } } +#endif } for(psys=ob->particlesystem.first; psys; psys=psys->next){ if(psys->part->dup_group==group) psys->part->dup_group= NULL; +#if 0 /* not used anymore, only keps for readfile.c, no need to account for this */ if(psys->part->eff_group==group) psys->part->eff_group= NULL; +#endif } } @@ -279,13 +284,14 @@ void group_tag_recalc(Group *group) } } -int group_is_animated(Object *parent, Group *group) +int group_is_animated(Object *UNUSED(parent), Group *group) { GroupObject *go; - - // XXX: old animsys depreceated... + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ if(parent->nlastrips.first) return 1; +#endif for(go= group->gobject.first; go; go= go->next) if(go->ob && go->ob->proxy) @@ -387,6 +393,7 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group } } +#if 0 Object *group_get_member_with_action(Group *group, bAction *act) { GroupObject *go; @@ -438,3 +445,4 @@ void group_relink_nla_objects(Object *ob) } } +#endif diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c7f74f37a2d..fb734ea4f3d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -385,19 +385,19 @@ void make_local_image(struct Image *ima) extern_local_image(ima); } else if(is_local && is_lib) { - Image *iman= copy_image(ima); + Image *ima_new= copy_image(ima); - iman->id.us= 0; + ima_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &iman->id); + BKE_id_lib_local_paths(bmain, ima->id.lib, &ima_new->id); tex= bmain->tex.first; while(tex) { if(tex->id.lib==NULL) { if(tex->ima==ima) { - tex->ima = iman; - iman->id.us++; + tex->ima = ima_new; + ima_new->id.us++; ima->id.us--; } } @@ -407,8 +407,8 @@ void make_local_image(struct Image *ima) while(brush) { if(brush->id.lib==NULL) { if(brush->clone.image==ima) { - brush->clone.image = iman; - iman->id.us++; + brush->clone.image = ima_new; + ima_new->id.us++; ima->id.us--; } } @@ -429,11 +429,11 @@ void make_local_image(struct Image *ima) for(a=0; a<me->totface; a++, tface++) { if(tface->tpage == ima) { - tface->tpage = iman; - if(iman->id.us == 0) { + tface->tpage = ima_new; + if(ima_new->id.us == 0) { tface->tpage->id.us= 1; } - id_lib_extern((ID*)iman); + id_lib_extern((ID*)ima_new); } } } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 034f4a96879..622ec093a3f 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -43,7 +43,8 @@ #include <string.h> #include <stddef.h> -#include "MEM_guardedalloc.h" +/* since we have versioning code here */ +#define DNA_DEPRECATED_ALLOW #include "DNA_anim_types.h" #include "DNA_constraint_types.h" @@ -73,6 +74,7 @@ #include "BKE_nla.h" #include "BKE_sequencer.h" +#include "MEM_guardedalloc.h" /* *************************************************** */ /* Old-Data Freeing Tools */ diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 4edd032dc04..6b4cdc70aea 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -184,19 +184,19 @@ void make_local_lamp(Lamp *la) id_clear_lib_data(bmain, &la->id); } else if(is_local && is_lib) { - Lamp *lan= copy_lamp(la); - lan->id.us= 0; + Lamp *la_new= copy_lamp(la); + la_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &lan->id); + BKE_id_lib_local_paths(bmain, la->id.lib, &la_new->id); ob= bmain->object.first; while(ob) { if(ob->data==la) { if(ob->id.lib==NULL) { - ob->data= lan; - lan->id.us++; + ob->data= la_new; + la_new->id.us++; la->id.us--; } } diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 7c9e2be4493..fe07662795e 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -271,17 +271,17 @@ void make_local_lattice(Lattice *lt) id_clear_lib_data(bmain, <->id); } else if(is_local && is_lib) { - Lattice *ltn= copy_lattice(lt); - ltn->id.us= 0; + Lattice *lt_new= copy_lattice(lt); + lt_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, <n->id); + BKE_id_lib_local_paths(bmain, lt->id.lib, <_new->id); for(ob= bmain->object.first; ob; ob= ob->id.next) { if(ob->data==lt) { if(ob->id.lib==NULL) { - ob->data= ltn; - ltn->id.us++; + ob->data= lt_new; + lt_new->id.us++; lt->id.us--; } } @@ -462,7 +462,7 @@ void end_latt_deform(Object *ob) so we store in latmat transform from path coord inside object */ typedef struct { - float dmin[3], dmax[3], dsize, dloc[3]; + float dmin[3], dmax[3], dscale, dloc[3]; float curvespace[4][4], objectspace[4][4], objectspace3[3][3]; int no_rot_axis; } CurveDeform; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index ba97e48c8bd..a79f4a2628b 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -137,9 +137,9 @@ * from id_make_local() but then the make local functions would not be self * contained. * also note that the id _must_ have a library - campbell */ -void BKE_id_lib_local_paths(Main *bmain, ID *id) +void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id) { - char *bpath_user_data[2]= {bmain->name, (id)->lib->filepath}; + char *bpath_user_data[2]= {bmain->name, lib->filepath}; bpath_traverse_id(bmain, id, bpath_relocate_visitor, @@ -1293,7 +1293,7 @@ int new_id(ListBase *lb, ID *id, const char *tname) don't have other library users. */ void id_clear_lib_data(Main *bmain, ID *id) { - BKE_id_lib_local_paths(bmain, id); + BKE_id_lib_local_paths(bmain, id->lib, id); id->lib= NULL; id->flag= LIB_LOCAL; @@ -1334,19 +1334,23 @@ static void lib_indirect_test_id(ID *id, Library *lib) if(GS(id->name)==ID_OB) { Object *ob= (Object *)id; - bActionStrip *strip; Mesh *me; int a; - + +#if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */ // XXX old animation system! -------------------------------------- - for (strip=ob->nlastrips.first; strip; strip=strip->next){ - LIBTAG(strip->object); - LIBTAG(strip->act); - LIBTAG(strip->ipo); + { + bActionStrip *strip; + for (strip=ob->nlastrips.first; strip; strip=strip->next){ + LIBTAG(strip->object); + LIBTAG(strip->act); + LIBTAG(strip->ipo); + } } // XXX: new animation system needs something like this? - +#endif + for(a=0; a<ob->totcol; a++) { LIBTAG(ob->mat[a]); } diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 9d196a1104b..6a99adfedf0 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -365,12 +365,12 @@ void make_local_material(Material *ma) } /* Both user and local, so copy. */ else if(is_local && is_lib) { - Material *man= copy_material(ma); + Material *ma_new= copy_material(ma); - man->id.us= 0; + ma_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &man->id); + BKE_id_lib_local_paths(bmain, ma->id.lib, &ma_new->id); /* do objects */ ob= bmain->object.first; @@ -379,8 +379,8 @@ void make_local_material(Material *ma) for(a=0; a<ob->totcol; a++) { if(ob->mat[a]==ma) { if(ob->id.lib==NULL) { - ob->mat[a]= man; - man->id.us++; + ob->mat[a]= ma_new; + ma_new->id.us++; ma->id.us--; } } @@ -395,8 +395,8 @@ void make_local_material(Material *ma) for(a=0; a<me->totcol; a++) { if(me->mat[a]==ma) { if(me->id.lib==NULL) { - me->mat[a]= man; - man->id.us++; + me->mat[a]= ma_new; + ma_new->id.us++; ma->id.us--; } } @@ -411,8 +411,8 @@ void make_local_material(Material *ma) for(a=0; a<cu->totcol; a++) { if(cu->mat[a]==ma) { if(cu->id.lib==NULL) { - cu->mat[a]= man; - man->id.us++; + cu->mat[a]= ma_new; + ma_new->id.us++; ma->id.us--; } } @@ -427,8 +427,8 @@ void make_local_material(Material *ma) for(a=0; a<mb->totcol; a++) { if(mb->mat[a]==ma) { if(mb->id.lib==NULL) { - mb->mat[a]= man; - man->id.us++; + mb->mat[a]= ma_new; + ma_new->id.us++; ma->id.us--; } } @@ -1179,8 +1179,7 @@ int object_remove_material_slot(Object *ob) } -/* r g b = current value, col = new value, fac==0 is no change */ -/* if g==NULL, it only does r channel */ +/* r_col = current value, col = new value, fac==0 is no change */ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) { float tmp, facm= 1.0f-fac; @@ -1188,165 +1187,137 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) switch (type) { case MA_RAMP_BLEND: r_col[0] = facm*(r_col[0]) + fac*col[0]; - if(r_col[1]) { - r_col[1] = facm*(r_col[1]) + fac*col[1]; - r_col[2] = facm*(r_col[2]) + fac*col[2]; - } - break; + r_col[1] = facm*(r_col[1]) + fac*col[1]; + r_col[2] = facm*(r_col[2]) + fac*col[2]; + break; case MA_RAMP_ADD: r_col[0] += fac*col[0]; - if(r_col[1]) { - r_col[1] += fac*col[1]; - r_col[2] += fac*col[2]; - } - break; + r_col[1] += fac*col[1]; + r_col[2] += fac*col[2]; + break; case MA_RAMP_MULT: r_col[0] *= (facm + fac*col[0]); - if(r_col[1]) { - r_col[1] *= (facm + fac*col[1]); - r_col[2] *= (facm + fac*col[2]); - } - break; + r_col[1] *= (facm + fac*col[1]); + r_col[2] *= (facm + fac*col[2]); + break; case MA_RAMP_SCREEN: r_col[0] = 1.0f - (facm + fac*(1.0f - col[0])) * (1.0f - r_col[0]); - if(r_col[1]) { - r_col[1] = 1.0f - (facm + fac*(1.0f - col[1])) * (1.0f - r_col[1]); - r_col[2] = 1.0f - (facm + fac*(1.0f - col[2])) * (1.0f - r_col[2]); - } - break; + r_col[1] = 1.0f - (facm + fac*(1.0f - col[1])) * (1.0f - r_col[1]); + r_col[2] = 1.0f - (facm + fac*(1.0f - col[2])) * (1.0f - r_col[2]); + break; case MA_RAMP_OVERLAY: if(r_col[0] < 0.5f) r_col[0] *= (facm + 2.0f*fac*col[0]); else r_col[0] = 1.0f - (facm + 2.0f*fac*(1.0f - col[0])) * (1.0f - r_col[0]); - if(r_col[1]) { - if(r_col[1] < 0.5f) - r_col[1] *= (facm + 2.0f*fac*col[1]); - else - r_col[1] = 1.0f - (facm + 2.0f*fac*(1.0f - col[1])) * (1.0f - r_col[1]); - if(r_col[2] < 0.5f) - r_col[2] *= (facm + 2.0f*fac*col[2]); - else - r_col[2] = 1.0f - (facm + 2.0f*fac*(1.0f - col[2])) * (1.0f - r_col[2]); - } - break; + if(r_col[1] < 0.5f) + r_col[1] *= (facm + 2.0f*fac*col[1]); + else + r_col[1] = 1.0f - (facm + 2.0f*fac*(1.0f - col[1])) * (1.0f - r_col[1]); + if(r_col[2] < 0.5f) + r_col[2] *= (facm + 2.0f*fac*col[2]); + else + r_col[2] = 1.0f - (facm + 2.0f*fac*(1.0f - col[2])) * (1.0f - r_col[2]); + break; case MA_RAMP_SUB: r_col[0] -= fac*col[0]; - if(r_col[1]) { - r_col[1] -= fac*col[1]; - r_col[2] -= fac*col[2]; - } - break; + r_col[1] -= fac*col[1]; + r_col[2] -= fac*col[2]; + break; case MA_RAMP_DIV: if(col[0]!=0.0f) r_col[0] = facm*(r_col[0]) + fac*(r_col[0])/col[0]; - if(r_col[1]) { - if(col[1]!=0.0f) - r_col[1] = facm*(r_col[1]) + fac*(r_col[1])/col[1]; - if(col[2]!=0.0f) - r_col[2] = facm*(r_col[2]) + fac*(r_col[2])/col[2]; - } - break; + if(col[1]!=0.0f) + r_col[1] = facm*(r_col[1]) + fac*(r_col[1])/col[1]; + if(col[2]!=0.0f) + r_col[2] = facm*(r_col[2]) + fac*(r_col[2])/col[2]; + break; case MA_RAMP_DIFF: r_col[0] = facm*(r_col[0]) + fac*fabsf(r_col[0]-col[0]); - if(r_col[1]) { - r_col[1] = facm*(r_col[1]) + fac*fabsf(r_col[1]-col[1]); - r_col[2] = facm*(r_col[2]) + fac*fabsf(r_col[2]-col[2]); - } - break; + r_col[1] = facm*(r_col[1]) + fac*fabsf(r_col[1]-col[1]); + r_col[2] = facm*(r_col[2]) + fac*fabsf(r_col[2]-col[2]); + break; case MA_RAMP_DARK: - tmp=col[0]+((1-col[0])*facm); + tmp=col[0]+((1-col[0])*facm); if(tmp < r_col[0]) r_col[0]= tmp; - if(r_col[1]) { - tmp=col[1]+((1-col[1])*facm); - if(tmp < r_col[1]) r_col[1]= tmp; - tmp=col[2]+((1-col[2])*facm); - if(tmp < r_col[2]) r_col[2]= tmp; - } - break; + tmp=col[1]+((1-col[1])*facm); + if(tmp < r_col[1]) r_col[1]= tmp; + tmp=col[2]+((1-col[2])*facm); + if(tmp < r_col[2]) r_col[2]= tmp; + break; case MA_RAMP_LIGHT: tmp= fac*col[0]; if(tmp > r_col[0]) r_col[0]= tmp; - if(r_col[1]) { - tmp= fac*col[1]; - if(tmp > r_col[1]) r_col[1]= tmp; - tmp= fac*col[2]; - if(tmp > r_col[2]) r_col[2]= tmp; - } - break; - case MA_RAMP_DODGE: - - + tmp= fac*col[1]; + if(tmp > r_col[1]) r_col[1]= tmp; + tmp= fac*col[2]; + if(tmp > r_col[2]) r_col[2]= tmp; + break; + case MA_RAMP_DODGE: if(r_col[0] !=0.0f){ tmp = 1.0f - fac*col[0]; if(tmp <= 0.0f) r_col[0] = 1.0f; else if ((tmp = (r_col[0]) / tmp)> 1.0f) r_col[0] = 1.0f; - else + else r_col[0] = tmp; } - if(r_col[1]) { - if(r_col[1] !=0.0f){ - tmp = 1.0f - fac*col[1]; - if(tmp <= 0.0f ) - r_col[1] = 1.0f; - else if ((tmp = (r_col[1]) / tmp) > 1.0f ) - r_col[1] = 1.0f; - else - r_col[1] = tmp; - } - if(r_col[2] !=0.0f){ - tmp = 1.0f - fac*col[2]; - if(tmp <= 0.0f) - r_col[2] = 1.0f; - else if ((tmp = (r_col[2]) / tmp) > 1.0f ) - r_col[2] = 1.0f; - else - r_col[2] = tmp; - } - + if(r_col[1] !=0.0f){ + tmp = 1.0f - fac*col[1]; + if(tmp <= 0.0f ) + r_col[1] = 1.0f; + else if ((tmp = (r_col[1]) / tmp) > 1.0f ) + r_col[1] = 1.0f; + else + r_col[1] = tmp; } - break; + if(r_col[2] !=0.0f){ + tmp = 1.0f - fac*col[2]; + if(tmp <= 0.0f) + r_col[2] = 1.0f; + else if ((tmp = (r_col[2]) / tmp) > 1.0f ) + r_col[2] = 1.0f; + else + r_col[2] = tmp; + } + break; case MA_RAMP_BURN: - tmp = facm + fac*col[0]; - + if(tmp <= 0.0f) r_col[0] = 0.0f; else if (( tmp = (1.0f - (1.0f - (r_col[0])) / tmp )) < 0.0f) r_col[0] = 0.0f; else if (tmp > 1.0f) r_col[0]=1.0f; - else + else r_col[0] = tmp; - if(r_col[1]) { - tmp = facm + fac*col[1]; - if(tmp <= 0.0f) + tmp = facm + fac*col[1]; + if(tmp <= 0.0f) + r_col[1] = 0.0f; + else if (( tmp = (1.0f - (1.0f - (r_col[1])) / tmp )) < 0.0f ) r_col[1] = 0.0f; - else if (( tmp = (1.0f - (1.0f - (r_col[1])) / tmp )) < 0.0f ) - r_col[1] = 0.0f; - else if(tmp >1.0f) - r_col[1]=1.0f; - else - r_col[1] = tmp; + else if(tmp >1.0f) + r_col[1]=1.0f; + else + r_col[1] = tmp; - tmp = facm + fac*col[2]; - if(tmp <= 0.0f) + tmp = facm + fac*col[2]; + if(tmp <= 0.0f) + r_col[2] = 0.0f; + else if (( tmp = (1.0f - (1.0f - (r_col[2])) / tmp )) < 0.0f ) r_col[2] = 0.0f; - else if (( tmp = (1.0f - (1.0f - (r_col[2])) / tmp )) < 0.0f ) - r_col[2] = 0.0f; - else if(tmp >1.0f) - r_col[2]= 1.0f; - else - r_col[2] = tmp; - } - break; - case MA_RAMP_HUE: - if(r_col[1]){ + else if(tmp >1.0f) + r_col[2]= 1.0f; + else + r_col[2] = tmp; + break; + case MA_RAMP_HUE: + { float rH,rS,rV; - float colH,colS,colV; + float colH,colS,colV; float tmpr,tmpg,tmpb; rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); if(colS!=0 ){ @@ -1357,9 +1328,9 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) r_col[2] = facm*(r_col[2]) + fac*tmpb; } } - break; - case MA_RAMP_SAT: - if(r_col[1]){ + break; + case MA_RAMP_SAT: + { float rH,rS,rV; float colH,colS,colV; rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); @@ -1368,18 +1339,18 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) hsv_to_rgb( rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2); } } - break; - case MA_RAMP_VAL: - if(r_col[1]){ + break; + case MA_RAMP_VAL: + { float rH,rS,rV; float colH,colS,colV; rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV); rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV); hsv_to_rgb( rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2); } - break; - case MA_RAMP_COLOR: - if(r_col[1]){ + break; + case MA_RAMP_COLOR: + { float rH,rS,rV; float colH,colS,colV; float tmpr,tmpg,tmpb; @@ -1392,12 +1363,12 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) r_col[2] = facm*(r_col[2]) + fac*tmpb; } } - break; - case MA_RAMP_SOFT: - if (r_col[1]){ - float scr, scg, scb; + break; + case MA_RAMP_SOFT: + { + float scr, scg, scb; - /* first calculate non-fac based Screen mix */ + /* first calculate non-fac based Screen mix */ scr = 1.0f - (1.0f - col[0]) * (1.0f - r_col[0]); scg = 1.0f - (1.0f - col[1]) * (1.0f - r_col[1]); scb = 1.0f - (1.0f - col[2]) * (1.0f - r_col[2]); @@ -1405,25 +1376,23 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) r_col[0] = facm*(r_col[0]) + fac*(((1.0f - r_col[0]) * col[0] * (r_col[0])) + (r_col[0] * scr)); r_col[1] = facm*(r_col[1]) + fac*(((1.0f - r_col[1]) * col[1] * (r_col[1])) + (r_col[1] * scg)); r_col[2] = facm*(r_col[2]) + fac*(((1.0f - r_col[2]) * col[2] * (r_col[2])) + (r_col[2] * scb)); - } - break; - case MA_RAMP_LINEAR: - if (col[0] > 0.5f) + } + break; + case MA_RAMP_LINEAR: + if (col[0] > 0.5f) r_col[0] = r_col[0] + fac*(2.0f*(col[0]-0.5f)); - else + else r_col[0] = r_col[0] + fac*(2.0f*(col[0]) - 1.0f); - if (r_col[1]){ - if (col[1] > 0.5f) - r_col[1] = r_col[1] + fac*(2.0f*(col[1]-0.5f)); - else - r_col[1] = r_col[1] + fac*(2.0f*(col[1]) -1.0f); - if (col[2] > 0.5f) - r_col[2] = r_col[2] + fac*(2.0f*(col[2]-0.5f)); - else - r_col[2] = r_col[2] + fac*(2.0f*(col[2]) - 1.0f); - } - break; - } + if (col[1] > 0.5f) + r_col[1] = r_col[1] + fac*(2.0f*(col[1]-0.5f)); + else + r_col[1] = r_col[1] + fac*(2.0f*(col[1]) -1.0f); + if (col[2] > 0.5f) + r_col[2] = r_col[2] + fac*(2.0f*(col[2]-0.5f)); + else + r_col[2] = r_col[2] + fac*(2.0f*(col[2]) - 1.0f); + break; + } } /* copy/paste buffer, if we had a propper py api that would be better */ diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 3e3f16dcfa3..0883ec121d6 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -174,17 +174,17 @@ void make_local_mball(MetaBall *mb) extern_local_mball(mb); } else if(is_local && is_lib) { - MetaBall *mbn= copy_mball(mb); - mbn->id.us= 0; + MetaBall *mb_new= copy_mball(mb); + mb_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &mbn->id); + BKE_id_lib_local_paths(bmain, mb->id.lib, &mb_new->id); for(ob= G.main->object.first; ob; ob= ob->id.next) { if(ob->data == mb) { if(ob->id.lib==NULL) { - ob->data= mbn; - mbn->id.us++; + ob->data= mb_new; + mb_new->id.us++; mb->id.us--; } } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index ec9d4873057..43958457edb 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -106,32 +106,18 @@ void unlink_mesh(Mesh *me) } if(me->key) { - me->key->id.us--; - if (me->key->id.us == 0 && me->key->ipo ) - me->key->ipo->id.us--; + me->key->id.us--; } me->key= NULL; if(me->texcomesh) me->texcomesh= NULL; } - /* do not free mesh itself */ void free_mesh(Mesh *me) { unlink_mesh(me); - if(me->pv) { - if(me->pv->vert_map) MEM_freeN(me->pv->vert_map); - if(me->pv->edge_map) MEM_freeN(me->pv->edge_map); - if(me->pv->old_faces) MEM_freeN(me->pv->old_faces); - if(me->pv->old_edges) MEM_freeN(me->pv->old_edges); - me->totvert= me->pv->totvert; - me->totedge= me->pv->totedge; - me->totface= me->pv->totface; - MEM_freeN(me->pv); - } - CustomData_free(&me->vdata, me->totvert); CustomData_free(&me->edata, me->totedge); CustomData_free(&me->fdata, me->totface); @@ -232,7 +218,6 @@ Mesh *copy_mesh(Mesh *me) men->mselect= NULL; men->edit_mesh= NULL; - men->pv= NULL; /* looks like this is no-longer supported but NULL just incase */ men->bb= MEM_dupallocN(men->bb); @@ -298,17 +283,17 @@ void make_local_mesh(Mesh *me) expand_local_mesh(me); } else if(is_local && is_lib) { - Mesh *men= copy_mesh(me); - men->id.us= 0; + Mesh *me_new= copy_mesh(me); + me_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &men->id); + BKE_id_lib_local_paths(bmain, me->id.lib, &me_new->id); for(ob= bmain->object.first; ob; ob= ob->id.next) { if(me == ob->data) { if(ob->id.lib==NULL) { - set_mesh(ob, men); + set_mesh(ob, me_new); } } } @@ -1458,72 +1443,6 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, c } } -/* Partial Mesh Visibility */ -PartialVisibility *mesh_pmv_copy(PartialVisibility *pmv) -{ - PartialVisibility *n= MEM_dupallocN(pmv); - n->vert_map= MEM_dupallocN(pmv->vert_map); - n->edge_map= MEM_dupallocN(pmv->edge_map); - n->old_edges= MEM_dupallocN(pmv->old_edges); - n->old_faces= MEM_dupallocN(pmv->old_faces); - return n; -} - -void mesh_pmv_free(PartialVisibility *pv) -{ - MEM_freeN(pv->vert_map); - MEM_freeN(pv->edge_map); - MEM_freeN(pv->old_faces); - MEM_freeN(pv->old_edges); - MEM_freeN(pv); -} - -void mesh_pmv_revert(Mesh *me) -{ - if(me->pv) { - unsigned i; - MVert *nve, *old_verts; - - /* Reorder vertices */ - nve= me->mvert; - old_verts = MEM_mallocN(sizeof(MVert)*me->pv->totvert,"PMV revert verts"); - for(i=0; i<me->pv->totvert; ++i) - old_verts[i]= nve[me->pv->vert_map[i]]; - - /* Restore verts, edges and faces */ - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->totvert); - CustomData_free_layer_active(&me->edata, CD_MEDGE, me->totedge); - CustomData_free_layer_active(&me->fdata, CD_MFACE, me->totface); - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, old_verts, me->pv->totvert); - CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, me->pv->old_edges, me->pv->totedge); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, me->pv->old_faces, me->pv->totface); - mesh_update_customdata_pointers(me); - - me->totvert= me->pv->totvert; - me->totedge= me->pv->totedge; - me->totface= me->pv->totface; - - me->pv->old_edges= NULL; - me->pv->old_faces= NULL; - - /* Free maps */ - MEM_freeN(me->pv->edge_map); - me->pv->edge_map= NULL; - MEM_freeN(me->pv->vert_map); - me->pv->vert_map= NULL; - } -} - -void mesh_pmv_off(Mesh *me) -{ - if(me->pv) { - mesh_pmv_revert(me); - MEM_freeN(me->pv); - me->pv= NULL; - } -} - /* basic vertex data functions */ int minmax_mesh(Mesh *me, float min[3], float max[3]) { diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index ec24f72874d..4295133b469 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -38,6 +38,7 @@ #include "BLI_utildefines.h" #include "BLI_edgehash.h" +#include "BLI_math_base.h" #include "BKE_DerivedMesh.h" @@ -117,7 +118,7 @@ static int search_face_cmp(const void *v1, const void *v2) #define PRINT if(do_verbose) printf -int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totvert, MEdge *medges, unsigned int totedge, MFace *mfaces, unsigned int totface, const short do_verbose, const short do_fixes) +int BKE_mesh_validate_arrays(Mesh *me, MVert *mverts, unsigned int totvert, MEdge *medges, unsigned int totedge, MFace *mfaces, unsigned int totface, const short do_verbose, const short do_fixes) { # define REMOVE_EDGE_TAG(_med) { _med->v2= _med->v1; do_edge_free= 1; } # define REMOVE_FACE_TAG(_mf) { _mf->v3=0; do_face_free= 1; } @@ -126,10 +127,12 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve MEdge *med; MFace *mf; MFace *mf_prev; + MVert *mvert= mverts; unsigned int i; int do_face_free= FALSE; int do_edge_free= FALSE; + int verts_fixed= FALSE; int do_edge_recalc= FALSE; @@ -149,6 +152,29 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve do_edge_recalc= TRUE; } + for(i=1; i<totvert; i++, mvert++) { + int j; + int fix_normal= TRUE; + + for(j=0; j<3; j++) { + if(isnan(mvert->co[j]) || !finite(mvert->co[j])) { + PRINT(" vertex %u: has invalid coordinate\n", i); + zero_v3(mvert->co); + + verts_fixed= TRUE; + } + + if(mvert->no[j]!=0) + fix_normal= FALSE; + } + + if(fix_normal) { + PRINT(" vertex %u: has zero normal, assuming Z-up normal\n", i); + mvert->no[2]= SHRT_MAX; + verts_fixed= TRUE; + } + } + for(i=0, med= medges; i<totedge; i++, med++) { int remove= FALSE; if(med->v1 == med->v2) { @@ -300,7 +326,7 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve } } - return (do_face_free || do_edge_free || do_edge_recalc); + return (verts_fixed || do_face_free || do_edge_free || do_edge_recalc); } static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes) diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 382e1d70387..75d8ec584e8 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -369,19 +369,7 @@ static MovieClip *movieclip_alloc(const char *name) clip->aspx= clip->aspy= 1.0f; - clip->tracking.camera.sensor_width= 35.0f; - clip->tracking.camera.pixel_aspect= 1.0f; - clip->tracking.camera.units= CAMERA_UNITS_MM; - - clip->tracking.settings.frames_limit= 0; - clip->tracking.settings.keyframe1= 1; - clip->tracking.settings.keyframe2= 30; - clip->tracking.settings.dist= 1; - - clip->tracking.stabilization.scaleinf= 1.0f; - clip->tracking.stabilization.locinf= 1.0f; - clip->tracking.stabilization.rotinf= 1.0f; - clip->tracking.stabilization.maxscale= 2.0f; + BKE_tracking_init_settings(&clip->tracking); clip->proxy.build_size_flag= IMB_PROXY_25; clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN|IMB_TC_FREE_RUN|IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index ae0774eb34f..458fb895b64 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -32,6 +32,9 @@ #include "MEM_guardedalloc.h" +/* for reading old multires */ +#define DNA_DEPRECATED_ALLOW + #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index d0858ea032a..635680a18d9 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -122,6 +122,7 @@ void clear_workob(Object *workob) memset(workob, 0, sizeof(Object)); workob->size[0]= workob->size[1]= workob->size[2]= 1.0f; + workob->dscale[0]= workob->dscale[1]= workob->dscale[2]= 1.0f; workob->rotmode= ROT_MODE_EUL; } @@ -784,6 +785,7 @@ Object *add_only_object(int type, const char *name) ob->col[3]= 1.0; ob->size[0]= ob->size[1]= ob->size[2]= 1.0; + ob->dscale[0]= ob->dscale[1]= ob->dscale[2]= 1.0; /* objects should default to having Euler XYZ rotations, * but rotations default to quaternions @@ -1242,12 +1244,12 @@ void make_local_object(Object *ob) extern_local_object(ob); } else if(is_local && is_lib) { - Object *obn= copy_object(ob); + Object *ob_new= copy_object(ob); - obn->id.us= 0; + ob_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &obn->id); + BKE_id_lib_local_paths(bmain, ob->id.lib, &ob_new->id); sce= bmain->scene.first; while(sce) { @@ -1255,8 +1257,8 @@ void make_local_object(Object *ob) base= sce->base.first; while(base) { if(base->object==ob) { - base->object= obn; - obn->id.us++; + base->object= ob_new; + ob_new->id.us++; ob->id.us--; } base= base->next; @@ -1405,7 +1407,6 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) ob->matbits= NULL; if ((target->totcol) && (target->mat) && OB_TYPE_SUPPORT_MATERIAL(ob->type)) { int i; - ob->colbits = target->colbits; ob->actcol= target->actcol; ob->totcol= target->totcol; @@ -1451,7 +1452,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) void object_scale_to_mat3(Object *ob, float mat[][3]) { float vec[3]; - add_v3_v3v3(vec, ob->size, ob->dsize); + mul_v3_v3v3(vec, ob->size, ob->dscale); size_to_mat3( mat,vec); } @@ -1537,7 +1538,7 @@ void object_tfm_protected_backup(const Object *ob, TFMCPY3D(loc); TFMCPY3D(dloc); TFMCPY3D(size); - TFMCPY3D(dsize); + TFMCPY3D(dscale); TFMCPY3D(rot); TFMCPY3D(drot); TFMCPY4D(quat); @@ -1567,7 +1568,7 @@ void object_tfm_protected_restore(Object *ob, if (protectflag & (OB_LOCK_SCALEX<<i)) { ob->size[i]= obtfm->size[i]; - ob->dsize[i]= obtfm->dsize[i]; + ob->dscale[i]= obtfm->dscale[i]; } if (protectflag & (OB_LOCK_ROTX<<i)) { @@ -1613,7 +1614,11 @@ void object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const } sub_v3_v3(ob->loc, ob->dloc); - sub_v3_v3(ob->size, ob->dsize); + + if (ob->dscale[0] != 0.0f) ob->size[0] /= ob->dscale[0]; + if (ob->dscale[1] != 0.0f) ob->size[1] /= ob->dscale[1]; + if (ob->dscale[2] != 0.0f) ob->size[2] /= ob->dscale[2]; + /* object_mat3_to_rot handles delta rotations */ } @@ -2421,7 +2426,7 @@ void BKE_scene_foreach_display_point( /* copied from DNA_object_types.h */ typedef struct ObTfmBack { float loc[3], dloc[3], orig[3]; - float size[3], dsize[3]; /* scale and delta scale */ + float size[3], dscale[3]; /* scale and delta scale */ float rot[3], drot[3]; /* euler rotation */ float quat[4], dquat[4]; /* quaternion rotation */ float rotAxis[3], drotAxis[3]; /* axis angle rotation - axis part */ @@ -2439,7 +2444,7 @@ void *object_tfm_backup(Object *ob) copy_v3_v3(obtfm->dloc, ob->dloc); copy_v3_v3(obtfm->orig, ob->orig); copy_v3_v3(obtfm->size, ob->size); - copy_v3_v3(obtfm->dsize, ob->dsize); + copy_v3_v3(obtfm->dscale, ob->dscale); copy_v3_v3(obtfm->rot, ob->rot); copy_v3_v3(obtfm->drot, ob->drot); copy_qt_qt(obtfm->quat, ob->quat); @@ -2463,7 +2468,7 @@ void object_tfm_restore(Object *ob, void *obtfm_pt) copy_v3_v3(ob->dloc, obtfm->dloc); copy_v3_v3(ob->orig, obtfm->orig); copy_v3_v3(ob->size, obtfm->size); - copy_v3_v3(ob->dsize, obtfm->dsize); + copy_v3_v3(ob->dscale, obtfm->dscale); copy_v3_v3(ob->rot, obtfm->rot); copy_v3_v3(ob->drot, obtfm->drot); copy_qt_qt(ob->quat, obtfm->quat); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 56ce853bfb9..fe848f3d76c 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -90,15 +90,28 @@ void paint_brush_set(Paint *p, Brush *br) } } +/* are we in vertex paint or weight pain face select mode? */ int paint_facesel_test(Object *ob) { - return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))); + return ( (ob != NULL) && + (ob->type == OB_MESH) && + (ob->data != NULL) && + (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && + (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) + ); } +/* are we in weight paint vertex select mode? */ int paint_vertsel_test(Object *ob) { - return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && (ob->mode & OB_MODE_WEIGHT_PAINT)); + return ( (ob != NULL) && + (ob->type == OB_MESH) && + (ob->data != NULL) && + (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && + (ob->mode & OB_MODE_WEIGHT_PAINT) + ); } + void paint_init(Paint *p, const char col[3]) { Brush *brush; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 7c71df9fece..0f2d14e3858 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3643,20 +3643,20 @@ void make_local_particlesettings(ParticleSettings *part) expand_local_particlesettings(part); } else if(is_local && is_lib) { - ParticleSettings *partn= psys_copy_settings(part); + ParticleSettings *part_new= psys_copy_settings(part); - partn->id.us= 0; + part_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &partn->id); + BKE_id_lib_local_paths(bmain, part->id.lib, &part_new->id); /* do objects */ for(ob= bmain->object.first; ob; ob= ob->id.next) { ParticleSystem *psys; for(psys= ob->particlesystem.first; psys; psys=psys->next){ if(psys->part==part && ob->id.lib==0) { - psys->part= partn; - partn->id.us++; + psys->part= part_new; + part_new->id.us++; part->id.us--; } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 33fb15faa56..5a57299cf25 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -401,10 +401,6 @@ Scene *add_scene(const char *name) sce->r.simplify_shadowsamples= 16; sce->r.simplify_aosss= 1.0f; - sce->r.cineonblack= 95; - sce->r.cineonwhite= 685; - sce->r.cineongamma= 1.7f; - sce->r.border.xmin= 0.0f; sce->r.border.ymin= 0.0f; sce->r.border.xmax= 1.0f; @@ -1035,15 +1031,11 @@ void scene_update_tagged(Main *bmain, Scene *scene) if (scene->physics_settings.quick_cache_step) BKE_ptcache_quick_cache_all(bmain, scene); - /* notify editors about recalc */ - DAG_ids_check_recalc(bmain); - - /* keep this last */ + /* notify editors and python about recalc */ BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST); -} + DAG_ids_check_recalc(bmain, scene, FALSE); -void scene_clear_tagged(Main *bmain, Scene *UNUSED(scene)) -{ + /* clear recalc flags */ DAG_ids_clear_recalc(bmain); } @@ -1088,10 +1080,13 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) /* object_handle_update() on all objects, groups and sets */ scene_update_tagged_recursive(bmain, sce, sce); - /* keep this last */ + /* notify editors and python about recalc */ BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST); BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST); + DAG_ids_check_recalc(bmain, sce, TRUE); + + /* clear recalc flags */ DAG_ids_clear_recalc(bmain); } diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index a14233e9179..d2c8a8031ee 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -106,19 +106,19 @@ void make_local_speaker(Speaker *spk) id_clear_lib_data(bmain, &spk->id); } else if(is_local && is_lib) { - Speaker *spkn= copy_speaker(spk); - spkn->id.us= 0; + Speaker *spk_new= copy_speaker(spk); + spk_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &spkn->id); + BKE_id_lib_local_paths(bmain, spk->id.lib, &spk_new->id); ob= bmain->object.first; while(ob) { if(ob->data==spk) { if(ob->id.lib==NULL) { - ob->data= spkn; - spkn->id.us++; + ob->data= spk_new; + spk_new->id.us++; spk->id.us--; } } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 1ad811c6580..b37c9a8f0b4 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -481,10 +481,10 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, fVerts[2] = SET_INT_IN_POINTER(mf->v3); fVerts[3] = SET_INT_IN_POINTER(mf->v4); - // this is very bad, means mesh is internally consistent. - // it is not really possible to continue without modifying - // other parts of code significantly to handle missing faces. - // since this really shouldn't even be possible we just bail. + /* this is very bad, means mesh is internally inconsistent. + * it is not really possible to continue without modifying + * other parts of code significantly to handle missing faces. + * since this really shouldn't even be possible we just bail.*/ if(ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), fVerts[3] ? 4 : 3, fVerts, &f) == eCCGError_InvalidValue) { static int hasGivenError = 0; @@ -1368,7 +1368,11 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) } /* Only used by non-editmesh types */ -static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) { +static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, + int (*setMaterial)(int, void *attribs), + int (*setDrawOptions)(void *userData, int index), + void *userData) +{ CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; GPUVertexAttribs gattribs; @@ -1725,6 +1729,7 @@ static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), uns static void ccgDM_drawFacesTex_common(DerivedMesh *dm, int (*drawParams)(MTFace *tface, int has_mcol, int matnr), int (*drawParamsMapped)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; @@ -1735,6 +1740,8 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm, int i, totface, flag, gridSize = ccgSubSurf_getGridSize(ss); int gridFaces = gridSize - 1; + (void) compareDrawOptions; + ccgdm_pbvh_update(ccgdm); if(!mcol) @@ -1865,14 +1872,20 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm, } } -static void ccgDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr)) +static void ccgDM_drawFacesTex(DerivedMesh *dm, + int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) { - ccgDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL); + ccgDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData); } -static void ccgDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData) +static void ccgDM_drawMappedFacesTex(DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData) { - ccgDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData); + ccgDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData); } static void ccgDM_drawUVEdges(DerivedMesh *dm) @@ -1908,8 +1921,12 @@ static void ccgDM_drawUVEdges(DerivedMesh *dm) } } -static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs), - int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) { +static void ccgDM_drawMappedFaces(DerivedMesh *dm, + int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), + int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index), + void *userData, int useColors) +{ CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; MCol *mcol= NULL; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 28d68892a2a..60cc029bf6e 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -479,17 +479,11 @@ void unlink_text(Main *bmain, Text *text) bScreen *scr; ScrArea *area; SpaceLink *sl; - Scene *scene; Object *ob; bController *cont; bConstraint *con; short update; - /* dome */ - for(scene=bmain->scene.first; scene; scene=scene->id.next) - if(scene->r.dometext == text) - scene->r.dometext = NULL; - for(ob=bmain->object.first; ob; ob=ob->id.next) { /* game controllers */ for(cont=ob->controllers.first; cont; cont=cont->next) { diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index a67a61c7638..93404dc25fb 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -709,11 +709,7 @@ void default_mtex(MTex *mtex) mtex->size[1]= 1.0; mtex->size[2]= 1.0; mtex->tex= NULL; - - /* MTEX_BUMP_FLIPPED is temporary before 2.61 release to prevent flipping normals - when creating file in 2.60, opening it in 2.59, saving and opening in 2.60 again */ - mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE | MTEX_BUMP_FLIPPED; - + mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE; mtex->colormodel= 0; mtex->r= 1.0; mtex->g= 0.0; @@ -973,20 +969,20 @@ void make_local_texture(Tex *tex) extern_local_texture(tex); } else if(is_local && is_lib) { - Tex *texn= copy_texture(tex); + Tex *tex_new= copy_texture(tex); - texn->id.us= 0; + tex_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &texn->id); + BKE_id_lib_local_paths(bmain, tex->id.lib, &tex_new->id); ma= bmain->mat.first; while(ma) { for(a=0; a<MAX_MTEX; a++) { if(ma->mtex[a] && ma->mtex[a]->tex==tex) { if(ma->id.lib==NULL) { - ma->mtex[a]->tex= texn; - texn->id.us++; + ma->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -998,8 +994,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(la->mtex[a] && la->mtex[a]->tex==tex) { if(la->id.lib==NULL) { - la->mtex[a]->tex= texn; - texn->id.us++; + la->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1011,8 +1007,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) { if(wrld->id.lib==NULL) { - wrld->mtex[a]->tex= texn; - texn->id.us++; + wrld->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1023,8 +1019,8 @@ void make_local_texture(Tex *tex) while(br) { if(br->mtex.tex==tex) { if(br->id.lib==NULL) { - br->mtex.tex= texn; - texn->id.us++; + br->mtex.tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1035,8 +1031,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(pa->mtex[a] && pa->mtex[a]->tex==tex) { if(pa->id.lib==NULL) { - pa->mtex[a]->tex= texn; - texn->id.us++; + pa->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 474b00e626b..4b5dc917cb6 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -70,14 +70,37 @@ typedef struct MovieDistortion { /*********************** common functions *************************/ +void BKE_tracking_init_settings(MovieTracking *tracking) +{ + tracking->camera.sensor_width= 35.0f; + tracking->camera.pixel_aspect= 1.0f; + tracking->camera.units= CAMERA_UNITS_MM; + + tracking->settings.default_tracker= TRACKER_KLT; + tracking->settings.default_pyramid_levels= 2; + tracking->settings.default_minimum_correlation= 0.75; + tracking->settings.default_pattern_size= 11; + tracking->settings.default_search_size= 51; + tracking->settings.default_pyramid_levels= 2; + tracking->settings.keyframe1= 1; + tracking->settings.keyframe2= 30; + tracking->settings.dist= 1; + + tracking->stabilization.scaleinf= 1.0f; + tracking->stabilization.locinf= 1.0f; + tracking->stabilization.rotinf= 1.0f; + tracking->stabilization.maxscale= 2.0f; +} + void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event) { int a; float pat_min[2]; float pat_max[2]; float max_pyramid_level_factor = 1.0; + if (track->tracker == TRACKER_KLT) { - max_pyramid_level_factor = 1 << (track->pyramid_levels - 1); + max_pyramid_level_factor= 1 << (track->pyramid_levels - 1); } /* sort */ @@ -105,17 +128,17 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event) } else if(event==CLAMP_PAT_POS) { float dim[2]; - sub_v2_v2v2(dim, track->pat_max, pat_min); + sub_v2_v2v2(dim, track->pat_max, track->pat_min); for(a= 0; a<2; a++) { /* pattern shouldn't be moved outside of search */ if(pat_min[a] < track->search_min[a]) { track->pat_min[a]= track->search_min[a] - (pat_min[a] - track->pat_min[a]); - track->pat_max[a]= (pat_min[a] - track->pat_min[a])+dim[a]; + track->pat_max[a]= track->pat_min[a] + dim[a]; } if(track->pat_max[a] > track->search_max[a]) { track->pat_max[a]= track->search_max[a] - (pat_max[a] - track->pat_max[a]); - track->pat_min[a]= track->pat_max[a]-dim[a] - (pat_min[a] - track->pat_min[a]); + track->pat_min[a]= track->pat_max[a] - dim[a]; } } } @@ -146,7 +169,7 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event) float dim[2]; sub_v2_v2v2(dim, track->pat_max, track->pat_min); { - float search_ratio = 2.3f * max_pyramid_level_factor; + float search_ratio= 2.3f * max_pyramid_level_factor; /* resize the search area to something sensible based * on the number of pyramid levels */ @@ -190,25 +213,27 @@ MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, float x, flo { MovieTrackingTrack *track; MovieTrackingMarker marker; + MovieTrackingSettings *settings= &tracking->settings; - /* pick reasonable defaults */ - float pat[2]= {5.5f, 5.5f}, search[2]= {25.5f, 25.5f}; /* TODO: move to default setting? */ + float half_pattern= (float)settings->default_pattern_size/2.0f; + float half_search= (float)settings->default_search_size/2.0f; + float pat[2], search[2]; - pat[0] /= (float)width; - pat[1] /= (float)height; + pat[0]= half_pattern/(float)width; + pat[1]= half_pattern/(float)height; - search[0] /= (float)width; - search[1] /= (float)height; + search[0]= half_search/(float)width; + search[1]= half_search/(float)height; track= MEM_callocN(sizeof(MovieTrackingTrack), "add_marker_exec track"); strcpy(track->name, "Track"); - /* default to KLT tracker */ - track->tracker = TRACKER_KLT; - track->pyramid_levels = 2; - - /* set SAD defaults even though it's not selected by default */ - track->minimum_correlation= 0.75f; + track->tracker= settings->default_tracker; + track->pyramid_levels= settings->default_pyramid_levels; + track->minimum_correlation= settings->default_minimum_correlation; + track->margin= settings->default_margin; + track->pattern_match= settings->default_pattern_match; + track->frames_limit= settings->default_frames_limit; memset(&marker, 0, sizeof(marker)); marker.pos[0]= x; @@ -223,6 +248,9 @@ MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, float x, flo BKE_tracking_insert_marker(track, &marker); + if(track->tracker == TRACKER_KLT) + BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS); + BLI_addtail(&tracking->tracks, track); BKE_track_unique_name(tracking, track); @@ -360,18 +388,6 @@ void BKE_tracking_free_track(MovieTrackingTrack *track) if(track->markers) MEM_freeN(track->markers); } -MovieTrackingTrack *BKE_tracking_copy_track(MovieTrackingTrack *track) -{ - MovieTrackingTrack *new_track= MEM_dupallocN(track); - - new_track->next= new_track->prev= NULL; - - if(new_track->markers) - new_track->markers= MEM_dupallocN(new_track->markers); - - return new_track; -} - static void put_disabled_marker(MovieTrackingTrack *track, MovieTrackingMarker *ref_marker, int before, int overwrite) { MovieTrackingMarker marker_new; @@ -528,11 +544,173 @@ void BKE_tracking_free(MovieTracking *tracking) BKE_tracking_distortion_destroy(tracking->camera.intrinsics); } -/*********************** tracking *************************/ +/*********************** tracks map *************************/ -typedef struct TrackContext { +typedef struct TracksMap { + int num_tracks; + int customdata_size; + + char *customdata; + MovieTrackingTrack *tracks; + + GHash *hash; + + int ptr; +} TracksMap; + +static TracksMap *tracks_map_new(int num_tracks, int customdata_size) +{ + TracksMap *map= MEM_callocN(sizeof(TracksMap), "TrackingsMap"); + + map->num_tracks= num_tracks; + map->customdata_size= customdata_size; + + map->tracks= MEM_callocN(sizeof(MovieTrackingTrack)*num_tracks, "TrackingsMap tracks"); + + if(customdata_size) + map->customdata= MEM_callocN(customdata_size*num_tracks, "TracksMap customdata"); + + map->hash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "TracksMap hash"); + + return map; +} + +static int tracks_map_size(TracksMap *map) +{ + return map->num_tracks; +} + +static void tracks_map_get(TracksMap *map, int index, MovieTrackingTrack **track, void **customdata) +{ + *track= &map->tracks[index]; + + if(map->customdata) + *customdata= &map->customdata[index*map->customdata_size]; +} + +static void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track, void *customdata) +{ + MovieTrackingTrack new_track= *track; + + new_track.markers= MEM_dupallocN(new_track.markers); + + map->tracks[map->ptr]= new_track; + + if(customdata) + memcpy(&map->customdata[map->ptr*map->customdata_size], customdata, map->customdata_size); + + BLI_ghash_insert(map->hash, &map->tracks[map->ptr], track); + + map->ptr++; +} + +static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) +{ MovieTrackingTrack *track; + ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL}; + ListBase *old_tracks= &tracking->tracks; + int a; + + /* duplicate currently operating tracks to temporary list. + this is needed to keep names in unique state and it's faster to change names + of currently operating tracks (if needed) */ + for(a= 0; a<map->num_tracks; a++) { + int replace_sel= 0; + MovieTrackingTrack *new_track, *old; + + track= &map->tracks[a]; + + /* find original of operating track in list of previously displayed tracks */ + old= BLI_ghash_lookup(map->hash, track); + if(old) { + MovieTrackingTrack *cur= old_tracks->first; + + while(cur) { + if(cur==old) + break; + + cur= cur->next; + } + + /* original track was found, re-use flags and remove this track */ + if(cur) { + if(cur==tracking->act_track) + replace_sel= 1; + + track->flag= cur->flag; + track->pat_flag= cur->pat_flag; + track->search_flag= cur->search_flag; + + BKE_tracking_free_track(cur); + BLI_freelinkN(old_tracks, cur); + } + } + + new_track= MEM_callocN(sizeof(MovieTrackingTrack), "tracksMapMerge new_track"); + *new_track= *track; + new_track->markers= MEM_dupallocN(new_track->markers); + + BLI_ghash_remove(map->hash, track, NULL, NULL); /* XXX: are we actually need this */ + BLI_ghash_insert(map->hash, track, new_track); + + if(replace_sel) /* update current selection in clip */ + tracking->act_track= new_track; + + BLI_addtail(&tracks, new_track); + } + + /* move all tracks, which aren't operating */ + track= old_tracks->first; + while(track) { + MovieTrackingTrack *next= track->next; + + track->next= track->prev= NULL; + BLI_addtail(&new_tracks, track); + + track= next; + } + + /* now move all tracks which are currently operating and keep their names unique */ + track= tracks.first; + while(track) { + MovieTrackingTrack *next= track->next; + + BLI_remlink(&tracks, track); + + track->next= track->prev= NULL; + BLI_addtail(&new_tracks, track); + + BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); + + track= next; + } + + tracking->tracks= new_tracks; +} + +static void tracks_map_free(TracksMap *map, void (*customdata_free) (void *customdata)) +{ + int i= 0; + + BLI_ghash_free(map->hash, NULL, NULL); + + for(i= 0; i<map->num_tracks; i++) { + if(map->customdata && customdata_free) + customdata_free(&map->customdata[i*map->customdata_size]); + + BKE_tracking_free_track(&map->tracks[i]); + } + + if(map->customdata) + MEM_freeN(map->customdata); + + MEM_freeN(map->tracks); + MEM_freeN(map); +} +/*********************** tracking *************************/ + +typedef struct TrackContext { #ifdef WITH_LIBMV float keyframed_pos[2]; @@ -541,9 +719,11 @@ typedef struct TrackContext { float *patch; /* keyframed patch */ /* ** SAD tracker ** */ - int patsize; /* size of pattern (currently only 16x16 due to libmv side) */ + int pattern_size; /* size of pattern */ unsigned char *pattern; /* keyframed pattern */ unsigned char *warped; /* warped version of reference */ +#else + int pad; #endif } TrackContext; @@ -553,11 +733,8 @@ typedef struct MovieTrackingContext { int first_time, frames; - TrackContext *track_context; - int num_tracks; - - GHash *hash; MovieTrackingSettings settings; + TracksMap *tracks_map; short backwards, disable_failed; int sync_frame; @@ -569,12 +746,11 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u MovieTracking *tracking= &clip->tracking; MovieTrackingSettings *settings= &tracking->settings; MovieTrackingTrack *track; - TrackContext *track_context; + int num_tracks= 0; context->settings= *settings; context->backwards= backwards; context->disable_failed= disable_failed; - context->hash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "tracking trackHash"); context->sync_frame= user->framenr; context->first_time= 1; @@ -585,38 +761,42 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr); if((marker->flag&MARKER_DISABLED)==0) - context->num_tracks++; + num_tracks++; } track= track->next; } - if(context->num_tracks) { + if(num_tracks) { int width, height; + context->tracks_map= tracks_map_new(num_tracks, sizeof(TrackContext)); + BKE_movieclip_get_size(clip, user, &width, &height); /* create tracking data */ - context->track_context= MEM_callocN(sizeof(TrackContext)*context->num_tracks, "tracking track_context"); - - track_context= context->track_context; track= tracking->tracks.first; while(track) { if(TRACK_SELECTED(track) && (track->flag&TRACK_LOCKED)==0) { MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr); if((marker->flag&MARKER_DISABLED)==0) { - MovieTrackingTrack *new_track= BKE_tracking_copy_track(track); + TrackContext track_context; + + memset(&track_context, 0, sizeof(TrackContext)); - track_context->track= new_track; #ifdef WITH_LIBMV { - if(track_context->track->tracker==TRACKER_KLT) { + float patx, paty; + patx= (int)((track->pat_max[0]-track->pat_min[0])*width); + paty= (int)((track->pat_max[1]-track->pat_min[1])*height); + + if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) { float search_size_x= (track->search_max[0]-track->search_min[0])*width; float search_size_y= (track->search_max[1]-track->search_min[1])*height; float pattern_size_x= (track->pat_max[0]-track->pat_min[0])*width; float pattern_size_y= (track->pat_max[1]-track->pat_min[1])*height; - int wndx, wndy; + int wndx= (int)patx/2, wndy= (int)paty/2; /* compute the maximum pyramid size */ float search_to_pattern_ratio= MIN2(search_size_x, search_size_y) @@ -627,22 +807,20 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u /* try to accomodate the user's choice of pyramid level in a way * that doesn't cause the coarsest pyramid pattern to be larger * than the search size */ - int level= MIN2(track_context->track->pyramid_levels, max_pyramid_levels); - - wndx= (int)((track->pat_max[0]-track->pat_min[0])*width)/2; - wndy= (int)((track->pat_max[1]-track->pat_min[1])*height)/2; + int level= MIN2(track->pyramid_levels, max_pyramid_levels); - track_context->region_tracker= libmv_regionTrackerNew(100, level, MAX2(wndx, wndy)); + if(track->tracker==TRACKER_KLT) + track_context.region_tracker= libmv_pyramidRegionTrackerNew(100, level, MAX2(wndx, wndy)); + else + track_context.region_tracker= libmv_hybridRegionTrackerNew(100, MAX2(wndx, wndy)); } - else if(track_context->track->tracker==TRACKER_SAD) { - /* nothing to initialize */ + else if(track->tracker==TRACKER_SAD) { + track_context.pattern_size= MAX2(patx, paty); } } #endif - BLI_ghash_insert(context->hash, new_track, track); - - track_context++; + tracks_map_insert(context->tracks_map, track, &track_context); } } @@ -656,35 +834,30 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u return context; } -void BKE_tracking_context_free(MovieTrackingContext *context) +static void track_context_free(void *customdata) { - int a; - TrackContext *track_context; - - for(a= 0, track_context= context->track_context; a<context->num_tracks; a++, track_context++) { - BKE_tracking_free_track(context->track_context[a].track); + TrackContext *track_context= (TrackContext *)customdata; #if WITH_LIBMV - if(track_context->region_tracker) - libmv_regionTrackerDestroy(track_context->region_tracker); + if(track_context->region_tracker) + libmv_regionTrackerDestroy(track_context->region_tracker); - if(track_context->patch) - MEM_freeN(track_context->patch); + if(track_context->patch) + MEM_freeN(track_context->patch); - if(track_context->pattern) - MEM_freeN(track_context->pattern); + if(track_context->pattern) + MEM_freeN(track_context->pattern); - if(track_context->warped) - MEM_freeN(track_context->warped); + if(track_context->warped) + MEM_freeN(track_context->warped); +#else + (void) track_context; #endif +} - MEM_freeN(track_context->track); - } - - if(context->track_context) - MEM_freeN(context->track_context); - - BLI_ghash_free(context->hash, NULL, NULL); +void BKE_tracking_context_free(MovieTrackingContext *context) +{ + tracks_map_free(context->tracks_map, track_context_free); MEM_freeN(context); } @@ -909,7 +1082,7 @@ static ImBuf *get_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTrack { ImBuf *ibuf= NULL; - if(context->settings.adjframes == 0) { + if(track->pattern_match == TRACK_MATCH_KEYFRAME) { ibuf= get_keyframed_ibuf(context, track, marker, marker_keyed); } else { ibuf= get_frame_ibuf(context, curfra); @@ -925,10 +1098,10 @@ static void get_warped(TrackContext *track_context, int x, int y, int width, uns { int i, j; - for(i=0; i<track_context->patsize; i++) { - for(j=0; j<track_context->patsize; j++) { - track_context->warped[i*track_context->patsize+j]= - image[(y+i-track_context->patsize/2)*width+x+j-track_context->patsize/2]; + for(i=0; i<track_context->pattern_size; i++) { + for(j=0; j<track_context->pattern_size; j++) { + track_context->warped[i*track_context->pattern_size+j]= + image[(y+i-track_context->pattern_size/2)*width+x+j-track_context->pattern_size/2]; } } } @@ -937,86 +1110,10 @@ static void get_warped(TrackContext *track_context, int x, int y, int width, uns void BKE_tracking_sync(MovieTrackingContext *context) { - TrackContext *track_context; MovieTracking *tracking= &context->clip->tracking; - MovieTrackingTrack *track; - ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL}; - ListBase *old_tracks= &context->clip->tracking.tracks; - int a, newframe; + int newframe; - /* duplicate currently tracking tracks to temporary list. - this is needed to keep names in unique state and it's faster to change names - of currently tracking tracks (if needed) */ - for(a= 0, track_context= context->track_context; a<context->num_tracks; a++, track_context++) { - int replace_sel= 0; - MovieTrackingTrack *new_track, *old; - - track= track_context->track; - - /* find original of tracking track in list of previously displayed tracks */ - old= BLI_ghash_lookup(context->hash, track); - if(old) { - MovieTrackingTrack *cur= old_tracks->first; - - while(cur) { - if(cur==old) - break; - - cur= cur->next; - } - - /* original track was found, re-use flags and remove this track */ - if(cur) { - if(cur==tracking->act_track) - replace_sel= 1; - - track->flag= cur->flag; - track->pat_flag= cur->pat_flag; - track->search_flag= cur->search_flag; - - BKE_tracking_free_track(cur); - BLI_freelinkN(old_tracks, cur); - } - } - - new_track= BKE_tracking_copy_track(track); - - BLI_ghash_remove(context->hash, track, NULL, NULL); /* XXX: are we actually need this */ - BLI_ghash_insert(context->hash, track, new_track); - - if(replace_sel) /* update current selection in clip */ - tracking->act_track= new_track; - - BLI_addtail(&tracks, new_track); - } - - /* move all tracks, which aren't tracking */ - track= old_tracks->first; - while(track) { - MovieTrackingTrack *next= track->next; - - track->next= track->prev= NULL; - BLI_addtail(&new_tracks, track); - - track= next; - } - - /* now move all tracks which are currently tracking and keep their names unique */ - track= tracks.first; - while(track) { - MovieTrackingTrack *next= track->next; - - BLI_remlink(&tracks, track); - - track->next= track->prev= NULL; - BLI_addtail(&new_tracks, track); - - BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); - - track= next; - } - - context->clip->tracking.tracks= new_tracks; + tracks_map_merge(context->tracks_map, tracking); if(context->backwards) newframe= context->user.framenr+1; else newframe= context->user.framenr-1; @@ -1033,10 +1130,12 @@ int BKE_tracking_next(MovieTrackingContext *context) { ImBuf *ibuf_new; int curfra= context->user.framenr; - int a, ok= 0; + int a, ok= 0, map_size; + + map_size= tracks_map_size(context->tracks_map); /* nothing to track, avoid unneeded frames reading to save time and memory */ - if(!context->num_tracks) + if(!map_size) return 0; if(context->backwards) context->user.framenr--; @@ -1046,11 +1145,15 @@ int BKE_tracking_next(MovieTrackingContext *context) if(!ibuf_new) return 0; - #pragma omp parallel for private(a) shared(ibuf_new, ok) if(context->num_tracks>1) - for(a= 0; a<context->num_tracks; a++) { - TrackContext *track_context= &context->track_context[a]; - MovieTrackingTrack *track= track_context->track; - MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, curfra); + #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1) + for(a= 0; a<map_size; a++) { + TrackContext *track_context; + MovieTrackingTrack *track; + MovieTrackingMarker *marker; + + tracks_map_get(context->tracks_map, a, &track, (void**)&track_context); + + marker= BKE_tracking_exact_marker(track, curfra); if(marker && (marker->flag&MARKER_DISABLED)==0) { #ifdef WITH_LIBMV @@ -1062,8 +1165,10 @@ int BKE_tracking_next(MovieTrackingContext *context) int onbound= 0, coords_correct= 0; int nextfra; - if(!context->settings.adjframes) need_readjust= context->first_time; - else need_readjust= context->frames%context->settings.adjframes == 0; + if(track->pattern_match==TRACK_MATCH_KEYFRAME) + need_readjust= context->first_time; + else + need_readjust= 1; if(context->backwards) nextfra= curfra-1; else nextfra= curfra+1; @@ -1071,15 +1176,15 @@ int BKE_tracking_next(MovieTrackingContext *context) /* margin from frame boundaries */ sub_v2_v2v2(margin, track->pat_max, track->pat_min); - margin[0]= MAX2(margin[0], (float)context->settings.margin / ibuf_new->x); - margin[1]= MAX2(margin[1], (float)context->settings.margin / ibuf_new->y); + margin[0]= MAX2(margin[0], (float)track->margin / ibuf_new->x); + margin[1]= MAX2(margin[1], (float)track->margin / ibuf_new->y); /* do not track markers which are too close to boundary */ if(marker->pos[0]<margin[0] || marker->pos[0]>1.0f-margin[0] || marker->pos[1]<margin[1] || marker->pos[1]>1.0f-margin[1]) { onbound= 1; } - else if(track_context->track->tracker==TRACKER_KLT) { + else if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) { float *patch_new; if(need_readjust) { @@ -1107,7 +1212,7 @@ int BKE_tracking_next(MovieTrackingContext *context) MEM_freeN(patch_new); } - else if(track_context->track->tracker==TRACKER_SAD) { + else if(track->tracker==TRACKER_SAD) { unsigned char *image_new; float correlation; float warp[3][2]={{0}}; @@ -1126,13 +1231,12 @@ int BKE_tracking_next(MovieTrackingContext *context) warp[2][0]= pos[0]; warp[2][1]= pos[1]; - /* pattern size is hardcoded to 16x16px in libmv */ - track_context->patsize= 16; - - if(!track_context->pattern) - track_context->pattern= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking pattern"); + if(!track_context->pattern) { + int square= track_context->pattern_size*track_context->pattern_size; + track_context->pattern= MEM_callocN(sizeof(unsigned char)*square, "trackking pattern"); + } - libmv_SADSamplePattern(image, width, warp, track_context->pattern); + libmv_SADSamplePattern(image, width, warp, track_context->pattern, track_context->pattern_size); MEM_freeN(image); IMB_freeImBuf(ibuf); @@ -1145,8 +1249,10 @@ int BKE_tracking_next(MovieTrackingContext *context) ibuf= get_frame_ibuf(context, curfra); - if(track_context->warped==NULL) - track_context->warped= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking warped"); + if(track_context->warped==NULL) { + int square= track_context->pattern_size*track_context->pattern_size; + track_context->warped= MEM_callocN(sizeof(unsigned char)*square, "trackking warped"); + } image_old= get_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin); get_warped(track_context, pos[0], pos[1], width, image_old); @@ -1160,12 +1266,13 @@ int BKE_tracking_next(MovieTrackingContext *context) warp[2][0]= pos[0]; warp[2][1]= pos[1]; - correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped, image_new, width, width, height, warp); + correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped, + track_context->pattern_size, image_new, width, width, height, warp); x2= warp[2][0]; y2= warp[2][1]; - tracked= track_context->track->minimum_correlation < correlation; + tracked= track->minimum_correlation < correlation; if(tracked) get_warped(track_context, x2, y2, width, image_new); @@ -1179,7 +1286,7 @@ int BKE_tracking_next(MovieTrackingContext *context) #pragma omp critical { /* check if there's no keyframe/tracked markers before tracking marker. - if so -- create disabled marker before currently tracking "segment" */ + if so -- create disabled marker before currently tracking "segment" */ put_disabled_marker(track, marker, 1, 0); } } @@ -1231,6 +1338,36 @@ int BKE_tracking_next(MovieTrackingContext *context) return ok; } +/*********************** camera solving *************************/ + +typedef struct MovieReconstructContext { +#ifdef WITH_LIBMV + struct libmv_Tracks *tracks; + int keyframe1, keyframe2; + short refine_flags; + + struct libmv_Reconstruction *reconstruction; +#endif + + float focal_length; + float principal_point[2]; + float k1, k2, k3; + + float reprojection_error; + + TracksMap *tracks_map; + + int sfra, efra; +} MovieReconstructContext; + +typedef struct ReconstructProgressData { + short *stop; + short *do_update; + float *progress; + char *stats_message; + int message_size; +} ReconstructProgressData; + #if WITH_LIBMV static struct libmv_Tracks *create_libmv_tracks(MovieTracking *tracking, int width, int height) { @@ -1257,8 +1394,9 @@ static struct libmv_Tracks *create_libmv_tracks(MovieTracking *tracking, int wid return tracks; } -static void retrieve_libmv_reconstruct_intrinscis(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction) +static void retrieve_libmv_reconstruct_intrinscis(MovieReconstructContext *context, MovieTracking *tracking) { + struct libmv_Reconstruction *libmv_reconstruction= context->reconstruction; struct libmv_CameraIntrinsics *libmv_intrinsics = libmv_ReconstructionExtractIntrinsics(libmv_reconstruction); float aspy= 1.0f/tracking->camera.pixel_aspect; @@ -1278,14 +1416,14 @@ static void retrieve_libmv_reconstruct_intrinscis(MovieTracking *tracking, struc tracking->camera.k2= k2; } -static int retrieve_libmv_reconstruct_tracks(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction) +static int retrieve_libmv_reconstruct_tracks(MovieReconstructContext *context, MovieTracking *tracking) { - int tracknr= 0; - int sfra= INT_MAX, efra= INT_MIN, a, origin_set= 0; - MovieTrackingTrack *track; + struct libmv_Reconstruction *libmv_reconstruction= context->reconstruction; MovieTrackingReconstruction *reconstruction= &tracking->reconstruction; MovieReconstructedCamera *reconstructed; - int ok= 1; + MovieTrackingTrack *track; + int ok= 1, tracknr= 0, a, origin_set= 0; + int sfra= context->sfra, efra= context->efra; float imat[4][4]; unit_m4(imat); @@ -1308,30 +1446,6 @@ static int retrieve_libmv_reconstruct_tracks(MovieTracking *tracking, struct lib printf("No bundle for track #%d '%s'\n", tracknr, track->name); } - if(track->markersnr) { - int first= 0, last= track->markersnr; - MovieTrackingMarker *first_marker= &track->markers[0]; - MovieTrackingMarker *last_marker= &track->markers[track->markersnr-1]; - - /* find first not-disabled marker */ - while(first<track->markersnr-1 && first_marker->flag&MARKER_DISABLED) { - first++; - first_marker++; - } - - /* find last not-disabled marker */ - while(last>=0 && last_marker->flag&MARKER_DISABLED) { - last--; - last_marker--; - } - - if(first<track->markersnr-1) - sfra= MIN2(sfra, first_marker->framenr); - - if(last>=0) - efra= MAX2(efra, last_marker->framenr); - } - track= track->next; tracknr++; } @@ -1394,12 +1508,14 @@ static int retrieve_libmv_reconstruct_tracks(MovieTracking *tracking, struct lib return ok; } -static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reconstruction *libmv_reconstruction) +static int retrieve_libmv_reconstruct(MovieReconstructContext *context, MovieTracking *tracking) { + tracks_map_merge(context->tracks_map, tracking); + /* take the intrinscis back from libmv */ - retrieve_libmv_reconstruct_intrinscis(tracking, libmv_reconstruction); + retrieve_libmv_reconstruct_intrinscis(context, tracking); - return retrieve_libmv_reconstruct_tracks(tracking, libmv_reconstruction); + return retrieve_libmv_reconstruct_tracks(context, tracking); } static int get_refine_intrinsics_flags(MovieTracking *tracking) @@ -1441,7 +1557,7 @@ static int count_tracks_on_both_keyframes(MovieTracking *tracking) } #endif -int BKE_tracking_can_solve(MovieTracking *tracking, char *error_msg, int error_size) +int BKE_tracking_can_reconstruct(MovieTracking *tracking, char *error_msg, int error_size) { #if WITH_LIBMV if(count_tracks_on_both_keyframes(tracking)<8) { @@ -1452,46 +1568,165 @@ int BKE_tracking_can_solve(MovieTracking *tracking, char *error_msg, int error_s return 1; #else BLI_strncpy(error_msg, "Blender is compiled without motion tracking library", error_size); - (void)tracking; + (void) tracking; return 0; #endif } -float BKE_tracking_solve_reconstruction(MovieTracking *tracking, int width, int height) +MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *tracking, + int keyframe1, int keyframe2, int width, int height) { -#if WITH_LIBMV - { - MovieTrackingCamera *camera= &tracking->camera; - float aspy= 1.0f/tracking->camera.pixel_aspect; - struct libmv_Tracks *tracks= create_libmv_tracks(tracking, width, height*aspy); - struct libmv_Reconstruction *reconstruction = libmv_solveReconstruction(tracks, - tracking->settings.keyframe1, tracking->settings.keyframe2, - get_refine_intrinsics_flags(tracking), - camera->focal, - camera->principal[0], camera->principal[1]*aspy, - camera->k1, camera->k2, camera->k3); - float error= libmv_reprojectionError(reconstruction); + MovieReconstructContext *context= MEM_callocN(sizeof(MovieReconstructContext), "MovieReconstructContext data"); + MovieTrackingCamera *camera= &tracking->camera; + float aspy= 1.0f/tracking->camera.pixel_aspect; + int num_tracks= BLI_countlist(&tracking->tracks); + int sfra= INT_MAX, efra= INT_MIN; + MovieTrackingTrack *track; + + context->tracks_map= tracks_map_new(num_tracks, 0); + track= tracking->tracks.first; + while(track) { + int first= 0, last= track->markersnr; + MovieTrackingMarker *first_marker= &track->markers[0]; + MovieTrackingMarker *last_marker= &track->markers[track->markersnr-1]; + + /* find first not-disabled marker */ + while(first<track->markersnr-1 && first_marker->flag&MARKER_DISABLED) { + first++; + first_marker++; + } - tracking->reconstruction.error= error; + /* find last not-disabled marker */ + while(last>=0 && last_marker->flag&MARKER_DISABLED) { + last--; + last_marker--; + } - if(!retrieve_libmv_reconstruct(tracking, reconstruction)) - error= -1.0f; + if(first<track->markersnr-1) + sfra= MIN2(sfra, first_marker->framenr); - libmv_destroyReconstruction(reconstruction); - libmv_tracksDestroy(tracks); + if(last>=0) + efra= MAX2(efra, last_marker->framenr); - tracking->reconstruction.flag|= TRACKING_RECONSTRUCTED; + tracks_map_insert(context->tracks_map, track, NULL); - return error; + track= track->next; } + + context->sfra= sfra; + context->efra= efra; + +#ifdef WITH_LIBMV + context->tracks= create_libmv_tracks(tracking, width, height*aspy); + context->keyframe1= keyframe1; + context->keyframe2= keyframe2; + context->refine_flags= get_refine_intrinsics_flags(tracking); #else - (void)tracking; - (void)width; - (void)height; + (void) width; + (void) height; + (void) keyframe1; + (void) keyframe2; +#endif + + context->focal_length= camera->focal; + context->principal_point[0]= camera->principal[0]; + context->principal_point[1]= camera->principal[1]*aspy; + + context->k1= camera->k1; + context->k2= camera->k2; + context->k2= camera->k2; + + return context; +} + +void BKE_tracking_reconstruction_context_free(MovieReconstructContext *context) +{ +#ifdef WITH_LIBMV + if(context->reconstruction) + libmv_destroyReconstruction(context->reconstruction); - return -1.0f; + libmv_tracksDestroy(context->tracks); #endif + + tracks_map_free(context->tracks_map, NULL); + + MEM_freeN(context); +} + +#ifdef WITH_LIBMV +static void solve_reconstruction_update_cb(void *customdata, double progress, const char *message) +{ + ReconstructProgressData *progressdata= customdata; + + if(progressdata->progress) { + *progressdata->progress= progress; + *progressdata->do_update= 1; + } + + BLI_snprintf(progressdata->stats_message, progressdata->message_size, + "Solving camera | %s", message); +} +#endif + +#if 0 +static int solve_reconstruction_testbreak_cb(void *customdata) +{ + ReconstructProgressData *progressdata= customdata; + + if(progressdata->stop && *progressdata->stop) + return 1; + + return G.afbreek; +} +#endif + +void BKE_tracking_solve_reconstruction(MovieReconstructContext *context, short *stop, + short *do_update, float *progress, char *stats_message, int message_size) +{ +#ifdef WITH_LIBMV + float error; + + ReconstructProgressData progressdata; + + progressdata.stop= stop; + progressdata.do_update= do_update; + progressdata.progress= progress; + progressdata.stats_message= stats_message; + progressdata.message_size= message_size; + + context->reconstruction = libmv_solveReconstruction(context->tracks, + context->keyframe1, context->keyframe2, + context->refine_flags, + context->focal_length, + context->principal_point[0], context->principal_point[1], + context->k1, context->k2, context->k3, + solve_reconstruction_update_cb, &progressdata); + + error= libmv_reprojectionError(context->reconstruction); + + context->reprojection_error= error; +#else + (void) context; + (void) stop; + (void) do_update; + (void) progress; + (void) stats_message; + (void) message_size; +#endif +} + +int BKE_tracking_finish_reconstruction(MovieReconstructContext *context, MovieTracking *tracking) +{ + tracking->reconstruction.error= context->reprojection_error; + tracking->reconstruction.flag|= TRACKING_RECONSTRUCTED; + +#ifdef WITH_LIBMV + if(!retrieve_libmv_reconstruct(context, tracking)) + return 0; +#endif + + return 1; } void BKE_track_unique_name(MovieTracking *tracking, MovieTrackingTrack *track) diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 1d6972b9d61..b3f1e140829 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -190,17 +190,17 @@ void make_local_world(World *wrld) id_clear_lib_data(bmain, &wrld->id); } else if(is_local && is_lib) { - World *wrldn= copy_world(wrld); - wrldn->id.us= 0; + World *wrld_new= copy_world(wrld); + wrld_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &wrldn->id); + BKE_id_lib_local_paths(bmain, wrld->id.lib, &wrld_new->id); for(sce= bmain->scene.first; sce; sce= sce->id.next) { if(sce->world == wrld) { if(sce->id.lib==NULL) { - sce->world= wrldn; - wrldn->id.us++; + sce->world= wrld_new; + wrld_new->id.us++; wrld->id.us--; } } diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index a2a4ffdc830..d494d63f56b 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -260,6 +260,8 @@ MINLINE void madd_sh_shfl(float r[9], const float sh[3], const float f); float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], float v3[3], float v4[3]); +void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3]); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index f98919fadd3..77896709285 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -55,6 +55,7 @@ void *BLI_mempool_calloc(BLI_mempool *pool); void BLI_mempool_free(BLI_mempool *pool, void *addr); void BLI_mempool_destroy(BLI_mempool *pool); int BLI_mempool_count(BLI_mempool *pool); +void *BLI_mempool_findelem(BLI_mempool *pool, int index); /** iteration stuff. note: this may easy to produce bugs with **/ /*private structure*/ diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 19ae89da8ea..0060878587b 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -68,8 +68,9 @@ typedef struct BLI_mempool_chunk { struct BLI_mempool { struct ListBase chunks; - int esize, csize, pchunk; /* size of elements and chunks in bytes - * and number of elements per chunk*/ + int esize; /* element size in bytes */ + int csize; /* chunk size in bytes */ + int pchunk; /* number of elements per chunk */ short use_sysmalloc, allow_iter; /* keeps aligned to 16 bits */ @@ -240,6 +241,24 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) } } +void *BLI_mempool_findelem(BLI_mempool *pool, int index) +{ + if (!pool->allow_iter) { + fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__); + return NULL; + } + else if ((index >= 0) && (index < pool->totused)) { + /* we could have some faster mem chunk stepping code inline */ + BLI_mempool_iter iter; + void *elem; + BLI_mempool_iternew(pool, &iter); + for (elem= BLI_mempool_iterstep(&iter); index-- != 0; elem= BLI_mempool_iterstep(&iter)) { }; + return elem; + } + + return NULL; +} + void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) { if (!pool->allow_iter) { diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 80a5421aff3..a2d996366bf 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -56,6 +56,7 @@ #include "DNA_image_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" +#include "DNA_movieclip_types.h" #include "DNA_object_fluidsim.h" #include "DNA_object_force.h" #include "DNA_object_types.h" @@ -550,6 +551,12 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla } } break; + case ID_MC: + { + MovieClip *clip= (MovieClip *)id; + rewrite_path_fixed(clip->name, visit_cb, absbase, bpath_user_data); + } + break; default: /* Nothing to do for other IDs that don't contain file paths. */ break; diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index ae3cba7e94f..0b2411af009 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -39,7 +39,7 @@ #define BLI_MATH_BASE_INLINE_H /* A few small defines. Keep'em local! */ -#define SMALL_NUMBER 1.e-8 +#define SMALL_NUMBER 1.e-8f MINLINE float sqrt3f(float f) { @@ -106,7 +106,7 @@ MINLINE float interpf(float target, float origin, float fac) * the distance gets very high, 180d would be inf, but this case isn't valid */ MINLINE float shell_angle_to_dist(const float angle) { - return (angle < (float)SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle)); + return (angle < SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle)); } /* used for zoom values*/ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 9d42ee347d4..382448ebb1c 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -133,7 +133,8 @@ float area_poly_v3(int nr, float verts[][3], const float normal[3]) float *cur, *prev; int a, px=0, py=1; - /* first: find dominant axis: 0==X, 1==Y, 2==Z */ + /* first: find dominant axis: 0==X, 1==Y, 2==Z + * don't use 'axis_dominant_v3()' because we need max axis too */ x= fabsf(normal[0]); y= fabsf(normal[1]); z= fabsf(normal[2]); @@ -1689,6 +1690,18 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, /****************************** Interpolation ********************************/ +/* get the 2 dominant axis values, 0==X, 1==Y, 2==Z */ +void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3]) +{ + const float xn= fabsf(axis[0]); + const float yn= fabsf(axis[1]); + const float zn= fabsf(axis[2]); + + if (zn >= xn && zn >= yn) { *axis_a= 0; *axis_b= 1; } + else if (yn >= xn && yn >= zn) { *axis_a= 0; *axis_b= 2; } + else { *axis_a= 1; *axis_b= 2; } +} + static float tri_signed_area(const float v1[3], const float v2[3], const float v3[3], const int i, const int j) { return 0.5f*((v1[i]-v2[i])*(v2[j]-v3[j]) + (v1[j]-v2[j])*(v3[i]-v2[i])); @@ -1696,17 +1709,10 @@ static float tri_signed_area(const float v1[3], const float v2[3], const float v static int barycentric_weights(const float v1[3], const float v2[3], const float v3[3], const float co[3], const float n[3], float w[3]) { - float xn, yn, zn, a1, a2, a3, asum; - short i, j; - - /* find best projection of face XY, XZ or YZ: barycentric weights of - the 2d projected coords are the same and faster to compute */ - xn= fabsf(n[0]); - yn= fabsf(n[1]); - zn= fabsf(n[2]); - if(zn>=xn && zn>=yn) {i= 0; j= 1;} - else if(yn>=xn && yn>=zn) {i= 0; j= 2;} - else {i= 1; j= 2;} + float a1, a2, a3, asum; + int i, j; + + axis_dominant_v3(&i, &j, n); a1= tri_signed_area(v2, v3, co, i, j); a2= tri_signed_area(v3, v1, co, i, j); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index b2c9a5706a3..37cb49fc17b 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -1121,18 +1121,18 @@ void blend_m3_m3m3(float out[][3], float dst[][3], float src[][3], const float s { float srot[3][3], drot[3][3]; float squat[4], dquat[4], fquat[4]; - float ssize[3], dsize[3], fsize[3]; + float sscale[3], dscale[3], fsize[3]; float rmat[3][3], smat[3][3]; - mat3_to_rot_size(drot, dsize, dst); - mat3_to_rot_size(srot, ssize, src); + mat3_to_rot_size(drot, dscale, dst); + mat3_to_rot_size(srot, sscale, src); mat3_to_quat(dquat, drot); mat3_to_quat(squat, srot); /* do blending */ interp_qt_qtqt(fquat, dquat, squat, srcweight); - interp_v3_v3v3(fsize, dsize, ssize, srcweight); + interp_v3_v3v3(fsize, dscale, sscale, srcweight); /* compose new matrix */ quat_to_mat3(rmat,fquat); @@ -1145,10 +1145,10 @@ void blend_m4_m4m4(float out[][4], float dst[][4], float src[][4], const float s float sloc[3], dloc[3], floc[3]; float srot[3][3], drot[3][3]; float squat[4], dquat[4], fquat[4]; - float ssize[3], dsize[3], fsize[3]; + float sscale[3], dscale[3], fsize[3]; - mat4_to_loc_rot_size(dloc, drot, dsize, dst); - mat4_to_loc_rot_size(sloc, srot, ssize, src); + mat4_to_loc_rot_size(dloc, drot, dscale, dst); + mat4_to_loc_rot_size(sloc, srot, sscale, src); mat3_to_quat(dquat, drot); mat3_to_quat(squat, srot); @@ -1156,7 +1156,7 @@ void blend_m4_m4m4(float out[][4], float dst[][4], float src[][4], const float s /* do blending */ interp_v3_v3v3(floc, dloc, sloc, srcweight); interp_qt_qtqt(fquat, dquat, squat, srcweight); - interp_v3_v3v3(fsize, dsize, ssize, srcweight); + interp_v3_v3v3(fsize, dscale, sscale, srcweight); /* compose new matrix */ loc_quat_size_to_mat4(out, floc, fquat, fsize); diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 41b1fea32a6..369984c1719 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -96,7 +96,7 @@ ListBase fillvertbase = {NULL, NULL}; ListBase filledgebase = {NULL, NULL}; ListBase fillfacebase = {NULL, NULL}; -static short cox, coy; +static int cox, coy; /* **** FUBCTIONS FOR QSORT *************************** */ @@ -825,19 +825,7 @@ int BLI_edgefill(short mat_nr) if(len==0.0f) return 0; /* no fill possible */ - norm[0]= fabs(norm[0]); - norm[1]= fabs(norm[1]); - norm[2]= fabs(norm[2]); - - if(norm[2]>=norm[0] && norm[2]>=norm[1]) { - cox= 0; coy= 1; - } - else if(norm[1]>=norm[0] && norm[1]>=norm[2]) { - cox= 0; coy= 2; - } - else { - cox= 1; coy= 2; - } + axis_dominant_v3(&cox, &coy, norm); /* STEP 1: COUNT POLYS */ eve= fillvertbase.first; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9246773bdc1..51cece9db6e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -48,6 +48,9 @@ #include "BLI_winstuff.h" #endif +/* allow readfile to use deprecated functionality */ +#define DNA_DEPRECATED_ALLOW + #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_actuator_types.h" @@ -107,7 +110,7 @@ #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_deform.h" -#include "BKE_effect.h" /* give_parteff */ +#include "BKE_effect.h" #include "BKE_fcurve.h" #include "BKE_global.h" // for G #include "BKE_group.h" @@ -3716,22 +3719,13 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) mesh->adt= newdataadr(fd, mesh->adt); direct_link_animdata(fd, mesh->adt); - /* Partial-mesh visibility (do this before using totvert, totface, or totedge!) */ - mesh->pv= newdataadr(fd, mesh->pv); - if(mesh->pv) { - mesh->pv->vert_map= newdataadr(fd, mesh->pv->vert_map); - mesh->pv->edge_map= newdataadr(fd, mesh->pv->edge_map); - mesh->pv->old_faces= newdataadr(fd, mesh->pv->old_faces); - mesh->pv->old_edges= newdataadr(fd, mesh->pv->old_edges); - } - /* normally direct_link_dverts should be called in direct_link_customdata, but for backwards compat in do_versions to work we do it here */ - direct_link_dverts(fd, mesh->pv ? mesh->pv->totvert : mesh->totvert, mesh->dvert); + direct_link_dverts(fd, mesh->totvert, mesh->dvert); - direct_link_customdata(fd, &mesh->vdata, mesh->pv ? mesh->pv->totvert : mesh->totvert); - direct_link_customdata(fd, &mesh->edata, mesh->pv ? mesh->pv->totedge : mesh->totedge); - direct_link_customdata(fd, &mesh->fdata, mesh->pv ? mesh->pv->totface : mesh->totface); + direct_link_customdata(fd, &mesh->vdata, mesh->totvert); + direct_link_customdata(fd, &mesh->edata, mesh->totedge); + direct_link_customdata(fd, &mesh->fdata, mesh->totface); mesh->bb= NULL; mesh->mselect = NULL; @@ -3785,7 +3779,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) TFace *tf= mesh->tface; unsigned int i; - for (i=0; i< (mesh->pv ? mesh->pv->totface : mesh->totface); i++, tf++) { + for (i=0; i< (mesh->totface); i++, tf++) { SWITCH_INT(tf->col[0]); SWITCH_INT(tf->col[1]); SWITCH_INT(tf->col[2]); @@ -5980,6 +5974,7 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip) clip->anim= NULL; clip->tracking_context= NULL; + clip->tracking.stats= NULL; clip->tracking.stabilization.ok= 0; clip->tracking.stabilization.scaleibuf= NULL; @@ -7269,6 +7264,40 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) } } +/* deprecated, only keep this for readfile.c */ +static PartEff *do_version_give_parteff_245(Object *ob) +{ + PartEff *paf; + + paf= ob->effect.first; + while(paf) { + if(paf->type==EFF_PARTICLE) return paf; + paf= paf->next; + } + return NULL; +} +static void do_version_free_effect_245(Effect *eff) +{ + PartEff *paf; + + if(eff->type==EFF_PARTICLE) { + paf= (PartEff *)eff; + if(paf->keys) MEM_freeN(paf->keys); + } + MEM_freeN(eff); +} +static void do_version_free_effects_245(ListBase *lb) +{ + Effect *eff; + + eff= lb->first; + while(eff) { + BLI_remlink(lb, eff); + do_version_free_effect_245(eff); + eff= lb->first; + } +} + static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) { MTex *mtex; @@ -7844,7 +7873,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob = main->object.first; PartEff *paf; while (ob) { - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if (paf->staticstep == 0) { paf->staticstep= 5; @@ -8860,11 +8889,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) View3D *v3d= (View3D *)sl; if(v3d->twtype==0) v3d->twtype= V3D_MANIP_TRANSLATE; } - else if(sl->spacetype==SPACE_TIME) { - SpaceTime *stime= (SpaceTime *)sl; - if(stime->redraws==0) - stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; - } } } } @@ -9053,7 +9077,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf) { if(paf->disp == 0) paf->disp = 100; @@ -10061,7 +10085,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* convert old particles to new system */ - if((paf = give_parteff(ob))) { + if((paf = do_version_give_parteff_245(ob))) { ParticleSystem *psys; ModifierData *md; ParticleSystemModifierData *psmd; @@ -10174,7 +10198,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->type = PART_FLUID; } - free_effects(&ob->effect); + do_version_free_effects_245(&ob->effect); printf("Old particle system converted to new system.\n"); } @@ -10588,13 +10612,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->maxphystep = 5; } } - - if (main->versionfile < 249) { - Scene *sce; - for (sce= main->scene.first; sce; sce= sce->id.next) - sce->r.renderer= 0; - - } // correct introduce of seed for wind force if (main->versionfile < 249 && main->subversionfile < 1) { @@ -12155,7 +12172,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put compatibility code here until next subversion bump */ if (main->versionfile < 255 || (main->versionfile == 255 && main->subversionfile < 3)) { Object *ob; @@ -12172,8 +12188,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put compatibility code here until next subversion bump */ - if (main->versionfile < 256) { bScreen *sc; ScrArea *sa; @@ -12618,34 +12632,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce->gm.recastData.detailsamplemaxerror = 1.0f; } } - - { - /* flip normals */ - Material *ma= main->mat.first; - while(ma) { - int a; - for(a= 0; a<MAX_MTEX; a++) { - MTex *mtex= ma->mtex[a]; - - if(mtex) { - if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) { - if((mtex->mapto&MAP_DISPLACE)==0) { - if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) { - Tex *tex= newlibadr(fd, lib, mtex->tex); - - if(!tex || (tex->imaflag&TEX_NORMALMAP)==0) { - mtex->norfac= -mtex->norfac; - mtex->texflag|= MTEX_BUMP_FLIPPED; - } - } - } - } - } - } - - ma= ma->id.next; - } - } } if (main->versionfile < 260){ @@ -12792,14 +12778,63 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - /* put compatibility code here until next subversion bump */ + if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 6)) { Scene *sce; + MovieClip *clip; + bScreen *sc; + for(sce = main->scene.first; sce; sce = sce->id.next) { - if (sce->r.im_format.depth == 0) { - do_versions_image_settings_2_60(sce); + do_versions_image_settings_2_60(sce); + } + + for (clip= main->movieclip.first; clip; clip= clip->id.next) { + MovieTrackingSettings *settings= &clip->tracking.settings; + + if(settings->default_pyramid_levels==0) { + settings->default_tracker= TRACKER_KLT; + settings->default_pyramid_levels= 2; + settings->default_minimum_correlation= 0.75; + settings->default_pattern_size= 11; + settings->default_search_size= 51; + } + } + + for (sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + for (sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D *)sl; + v3d->flag2&= ~V3D_RENDER_SHADOW; + } + } } } + + { + Object *ob; + for (ob= main->object.first; ob; ob= ob->id.next) { + /* convert delta addition into delta scale */ + int i; + for (i= 0; i < 3; i++) { + if ( (ob->dsize[i] == 0.0f) || /* simple case, user never touched dsize */ + (ob->size[i] == 0.0f)) /* cant scale the dsize to give a non zero result, so fallback to 1.0f */ + { + ob->dscale[i]= 1.0f; + } + else { + ob->dscale[i]= (ob->size[i] + ob->dsize[i]) / ob->size[i]; + } + } + } + } + } + + /* put compatibility code here until next subversion bump */ + { + /* nothing! */ } /* default values in Freestyle settings */ @@ -13641,7 +13676,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, ob->mat[a]); } - paf = give_parteff(ob); + paf = do_version_give_parteff_245(ob); if (paf && paf->group) expand_doit(fd, mainvar, paf->group); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 74aa502d982..68ef9fac3ae 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1692,27 +1692,9 @@ static void write_meshs(WriteData *wd, ListBase *idbase) writedata(wd, DATA, sizeof(void *)*mesh->totcol, mesh->mat); - if(mesh->pv) { - write_customdata(wd, &mesh->id, mesh->pv->totvert, &mesh->vdata, -1, 0); - write_customdata(wd, &mesh->id, mesh->pv->totedge, &mesh->edata, - CD_MEDGE, mesh->totedge); - write_customdata(wd, &mesh->id, mesh->pv->totface, &mesh->fdata, - CD_MFACE, mesh->totface); - } - else { - write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0); - write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0); - write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0); - } - - /* PMV data */ - if(mesh->pv) { - writestruct(wd, DATA, "PartialVisibility", 1, mesh->pv); - writedata(wd, DATA, sizeof(unsigned int)*mesh->pv->totvert, mesh->pv->vert_map); - writedata(wd, DATA, sizeof(int)*mesh->pv->totedge, mesh->pv->edge_map); - writestruct(wd, DATA, "MFace", mesh->pv->totface, mesh->pv->old_faces); - writestruct(wd, DATA, "MEdge", mesh->pv->totedge, mesh->pv->old_edges); - } + write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0); + write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0); + write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0); } mesh= mesh->id.next; } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 9f466ef52d3..4595bf3f64f 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -310,10 +310,17 @@ int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag) beztr.vec[1][1]= y; beztr.vec[2][0]= x+1.0f; beztr.vec[2][1]= y; - beztr.ipo= U.ipo_new; /* use default interpolation mode here... */ beztr.f1= beztr.f2= beztr.f3= SELECT; beztr.h1= beztr.h2= U.keyhandles_new; /* use default handle type here */ //BEZKEYTYPE(&beztr)= scene->keytype; /* default keyframe type */ + + /* use default interpolation mode, with exceptions for int/discrete values */ + beztr.ipo= U.ipo_new; + + if(fcu->flag & FCURVE_DISCRETE_VALUES) + beztr.ipo = BEZT_IPO_CONST; + else if(beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES)) + beztr.ipo = BEZT_IPO_LIN; /* add temp beztriple to keyframes */ a= insert_bezt_fcurve(fcu, &beztr, flag); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 40d2d80f2b7..502da1be8ac 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1608,7 +1608,7 @@ static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y mdb->phi[acenter]= phi/totweight; } -static void meshdeform_matrix_solve(MeshDeformBind *mdb) +static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind *mdb) { NLContext *context; float vec[3], gridvec[3]; @@ -1710,7 +1710,8 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb) } } else { - error("Mesh Deform: failed to find solution"); + modifier_setError(&mmd->modifier, "Failed to find bind solution (increase precision?)."); + error("Mesh Deform: failed to find bind solution."); break; } @@ -1819,7 +1820,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa meshdeform_check_semibound(mdb, x, y, z); /* solve */ - meshdeform_matrix_solve(mdb); + meshdeform_matrix_solve(mmd, mdb); /* assign results */ if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) { diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 6a43564e5f1..80278c95d05 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index d40831f9e87..cf3961e0820 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -703,7 +703,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) dflag |= GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_IEDITHACK; } break; - +#if 0 /* removed since 2.5x, needs to be added back */ case SPACE_SEQ: /* sequence */ { SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first; @@ -728,7 +728,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) dflag |= GP_DRAWDATA_ONLYI2D; } break; - +#endif default: /* for spacetype not yet handled */ offsx= 0; offsy= 0; diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 57dd1ef5572..760faf01b6c 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -125,7 +125,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con /* active */ block= uiLayoutGetBlock(sub); icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF; - but= uiDefIconBut(block, BUT, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Set active layer"); + but= uiDefIconButBitI(block, TOG, GP_LAYER_ACTIVE, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, &gpd->flag, 0.0, 0.0, 0.0, 0.0, "Set active layer"); uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl); /* locked */ diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 39d6ba8bc1b..5c7d9249c5f 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -102,8 +102,11 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode); int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer); -struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer); +int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, + float *loc, float *rot, int *enter_editmode, unsigned int *layer); + +struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, + float *rot, int enter_editmode, unsigned int layer); void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full); void ED_object_single_user(struct Scene *scene, struct Object *ob); diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 7461f5e9e9f..73776f7234b 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -36,6 +36,7 @@ struct Main; struct MTex; struct Render; struct RenderInfo; +struct Scene; /* render_ops.c */ @@ -45,7 +46,7 @@ void ED_operatortypes_render(void); void ED_render_id_flush_update(struct Main *bmain, struct ID *id); void ED_render_engine_changed(struct Main *bmain); -void ED_render_engine_update_tagged(struct bContext *C, struct Main *bmain); +void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated); /* render_preview.c */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 05537004927..e0ff5cddf85 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -65,6 +65,7 @@ void ED_region_header_init(struct ARegion *ar); void ED_region_header(const struct bContext *C, struct ARegion *ar); void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar); void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct); +void ED_region_info_draw(struct ARegion *ar, const char *text, int block, float alpha); /* spaces */ void ED_spacetypes_init(void); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 26c3ffed91c..476cf2ac109 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -75,6 +75,12 @@ typedef struct ViewDepths { char damaged; } ViewDepths; +/* enum for passing to foreach functions to test RV3D_CLIPPING */ +typedef enum eV3DClipTest { + V3D_CLIP_TEST_OFF = 0, /* clipping is off */ + V3D_CLIP_TEST_RV3D_CLIPPING = 1, /* clip single points */ + V3D_CLIP_TEST_REGION = 2 /* use for edges to check if both verts are in the view, but not RV3D_CLIPPING */ +} eV3DClipTest; float *give_cursor(struct Scene *scene, struct View3D *v3d); @@ -214,8 +220,8 @@ void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struc void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float size_r[2]); /* drawobject.c iterators */ -void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts); -void mesh_foreachScreenEdge(struct ViewContext *vc, void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts); +void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, eV3DClipTest clipVerts); +void mesh_foreachScreenEdge(struct ViewContext *vc, void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, eV3DClipTest clipVerts); void mesh_foreachScreenFace(struct ViewContext *vc, void (*func)(void *userData, struct EditFace *efa, int x, int y, int index), void *userData); void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData); void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData); diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index e739417519f..683d35daf66 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -5,10 +5,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index da94fd9237a..f3a99ecf6b8 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1475,14 +1475,18 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) { ImBuf *scaleibuf; int x, y, w= ibuf->x*zoomx, h= ibuf->y*zoomy; + const float scalex= 1.0f/zoomx; + const float scaley= 1.0f/zoomy; + scaleibuf= IMB_allocImBuf(w, h, 32, IB_rect); for(y= 0; y<scaleibuf->y; y++) { for (x= 0; x<scaleibuf->x; x++) { int pixel= scaleibuf->x*y + x; - int orig_pixel= ibuf->x*(int)(((float)y)/zoomy) + (int)(((float)x)/zoomx); + int orig_pixel= ibuf->x*(int)(scaley*(float)y) + (int)(scalex*(float)x); char *rrgb= (char*)scaleibuf->rect + pixel*4; char *orig_rrgb= (char*)ibuf->rect + orig_pixel*4; + rrgb[0]= orig_rrgb[0]; rrgb[1]= orig_rrgb[1]; rrgb[2]= orig_rrgb[2]; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index cd3243bb9dc..c24d07f73b9 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3795,6 +3795,8 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt } if (sel == -1) { + int i; + /* if the click didn't select anything, check if it's clicked on the * curve itself, and if so, add a point */ fx= ((float)mx - but->x1)/zoomx + offsx; @@ -3804,8 +3806,10 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt /* loop through the curve segment table and find what's near the mouse. * 0.05 is kinda arbitrary, but seems to be what works nicely. */ - for(a=0; a<=CM_TABLE; a++) { - if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) { + for(i=0; i<=CM_TABLE; i++) { + if ( (fabsf(fx - cmp[i].x) < 0.05f) && + (fabsf(fy - cmp[i].y) < 0.05f)) + { curvemap_insert(cuma, fx, fy); curvemapping_changed(cumap, 0); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index d66e6852f1d..1edfa2f4ea6 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -455,6 +455,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r hrect= *rect; if(dir == 'h') { hrect.xmin= rect->xmin+pnl_icons; + hrect.ymin += 2.0f/block->aspect; uiStyleFontDraw(&style->paneltitle, &hrect, activename); } else { @@ -494,7 +495,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) /* calculate header rect */ /* + 0.001f to prevent flicker due to float inaccuracy */ headrect= *rect; - headrect.ymin= headrect.ymax - 2.0f/block->aspect; + headrect.ymin= headrect.ymax; headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); { @@ -508,7 +509,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) /* draw with background color */ glEnable(GL_BLEND); glColor4ubv((unsigned char*)btheme->tui.panel.header); - glRectf(minx, headrect.ymin, maxx, y); + glRectf(minx, headrect.ymin+1, maxx, y); fdrawline(minx, y, maxx, y); fdrawline(minx, y, maxx, y); @@ -519,9 +520,9 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) maxx -= 5.0f/block->aspect; glColor4f(0.0f, 0.0f, 0.0f, 0.5f); - fdrawline(minx, y+1, maxx, y+1); - glColor4f(1.0f, 1.0f, 1.0f, 0.25f); fdrawline(minx, y, maxx, y); + glColor4f(1.0f, 1.0f, 1.0f, 0.25f); + fdrawline(minx, y-1, maxx, y-1); glDisable(GL_BLEND); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 4c6bb64b6bd..03bb9d6def9 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1224,7 +1224,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M uiDefButS(block, ROW, B_MATPRV, IFACE_("World"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); uiDefButS(block, ROW, B_MATPRV, IFACE_("Both"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); - /* Alpha buton for texture preview */ + /* Alpha button for texture preview */ if(*pr_texture!=TEX_PR_OTHER) { row = uiLayoutRow(layout, 0); uiItemR(row, &texture_ptr, "use_preview_alpha", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index b47b03d19a3..419388560a9 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index e1652202c83..c8cd85d7a57 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -744,7 +744,8 @@ void make_editMesh(Scene *scene, Object *ob) EditSelection *ese; float *co, (*keyco)[3]= NULL; int tot, a, eekadoodle= 0; - const short is_paint_sel= paint_facesel_test(ob); + const short is_paint_face_sel= paint_facesel_test(ob); + const short is_paint_vert_sel= is_paint_face_sel ? FALSE : paint_vertsel_test(ob); if(me->edit_mesh==NULL) me->edit_mesh= MEM_callocN(sizeof(EditMesh), "editmesh"); @@ -795,8 +796,8 @@ void make_editMesh(Scene *scene, Object *ob) evlist[a]= eve; /* face select sets selection in next loop */ - if(!is_paint_sel) - eve->f |= (mvert->flag & 1); + if(!is_paint_face_sel) + eve->f |= (mvert->flag & SELECT); if (mvert->flag & ME_HIDE) eve->h= 1; normal_short_to_float_v3(eve->no, mvert->no); @@ -822,16 +823,26 @@ void make_editMesh(Scene *scene, Object *ob) eed= addedgelist(em, evlist[medge->v1], evlist[medge->v2], NULL); /* eed can be zero when v1 and v2 are identical, dxf import does this... */ if(eed) { + int is_sel; + if (is_paint_vert_sel) { + /* when from vertex select, flush flags to edges, + * allow selection, code below handles editmode selection conversion */ + is_sel= (eed->v1->f & SELECT) && (eed->v2->f & SELECT); + } + else { + is_sel= (medge->flag & SELECT); + } + eed->crease= ((float)medge->crease)/255.0f; eed->bweight= ((float)medge->bweight)/255.0f; if(medge->flag & ME_SEAM) eed->seam= 1; if(medge->flag & ME_SHARP) eed->sharp = 1; if(medge->flag & ME_FREESTYLE_EDGE) eed->freestyle = 1; - if(medge->flag & SELECT) eed->f |= SELECT; if(medge->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines! if(medge->flag & ME_HIDE) eed->h |= 1; - if(em->selectmode==SCE_SELECT_EDGE) + if(is_sel) eed->f |= SELECT; + if(em->selectmode==SCE_SELECT_EDGE) EM_select_edge(eed, eed->f & SELECT); // force edge selection to vertices, seems to be needed ... CustomData_to_em_block(&me->edata,&em->edata, a, &eed->data); } @@ -861,15 +872,30 @@ void make_editMesh(Scene *scene, Object *ob) if(mface->flag & ME_HIDE) { efa->h= 1; } else { + int is_sel; + + if (!is_paint_vert_sel) { + is_sel= (mface->flag & ME_FACE_SEL); + } + else { + /* when from vertex select, flush flags to edges, + * allow selection, code below handles editmode selection conversion */ + is_sel= ( (efa->v1->f & SELECT) && + (efa->v2->f & SELECT) && + (efa->v3->f & SELECT) && + (efa->v4 == NULL || efa->v4->f & SELECT) + ); + } + if (a==me->act_face) { EM_set_actFace(em, efa); } /* dont allow hidden and selected */ - if(mface->flag & ME_FACE_SEL) { + if(is_sel) { efa->f |= SELECT; - if(is_paint_sel) { + if(is_paint_face_sel) { EM_select_face(efa, 1); /* flush down */ } diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 1965e8e1613..a687b412403 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -448,11 +448,11 @@ EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short strict) ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); - mesh_foreachScreenVert(vc, findnearestvert__doClosest, &data, 1); + mesh_foreachScreenVert(vc, findnearestvert__doClosest, &data, V3D_CLIP_TEST_RV3D_CLIPPING); if (data.dist>3) { data.pass = 1; - mesh_foreachScreenVert(vc, findnearestvert__doClosest, &data, 1); + mesh_foreachScreenVert(vc, findnearestvert__doClosest, &data, V3D_CLIP_TEST_RV3D_CLIPPING); } *dist = data.dist; @@ -540,7 +540,7 @@ EditEdge *findnearestedge(ViewContext *vc, int *dist) data.closest = NULL; ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); - mesh_foreachScreenEdge(vc, findnearestedge__doClosest, &data, 2); + mesh_foreachScreenEdge(vc, findnearestedge__doClosest, &data, V3D_CLIP_TEST_REGION); *dist = data.dist; return data.closest; @@ -4222,20 +4222,10 @@ static int smooth_vertex(bContext *C, wmOperator *op) for (eve= em->verts.first; eve; eve= eve->next) { if(eve->f & SELECT) { - switch(mmd->axis){ - case 0: - if (fabsf(eve->co[0]) < mmd->tolerance) - eve->f2 |= 1; - break; - case 1: - if (fabsf(eve->co[1]) < mmd->tolerance) - eve->f2 |= 2; - break; - case 2: - if (fabsf(eve->co[2]) < mmd->tolerance) - eve->f2 |= 4; - break; - } + if (mmd->flag & MOD_MIR_AXIS_X && fabsf(eve->co[0]) < mmd->tolerance) eve->f2 |= 1; + if (mmd->flag & MOD_MIR_AXIS_Y && fabsf(eve->co[1]) < mmd->tolerance) eve->f2 |= 2; + if (mmd->flag & MOD_MIR_AXIS_Z && fabsf(eve->co[2]) < mmd->tolerance) eve->f2 |= 4; + } } } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4bae6afc2ef..fa0454db741 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -547,7 +547,7 @@ static void xsortvert_flag(bContext *C, int flag) sortblock[i].v1 = eve; ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d); - mesh_foreachScreenVert(&vc, xsortvert_flag__doSetX, sortblock, 0); + mesh_foreachScreenVert(&vc, xsortvert_flag__doSetX, sortblock, V3D_CLIP_TEST_OFF); qsort(sortblock, amount, sizeof(xvertsort), vergxco); @@ -2666,20 +2666,11 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float if(mmd->flag & MOD_MIR_CLIPPING) { for (eve= em->verts.first; eve; eve= eve->next) { eve->f2= 0; - switch(mmd->axis){ - case 0: - if (fabsf(eve->co[0]) < mmd->tolerance) - eve->f2 |= 1; - break; - case 1: - if (fabsf(eve->co[1]) < mmd->tolerance) - eve->f2 |= 2; - break; - case 2: - if (fabsf(eve->co[2]) < mmd->tolerance) - eve->f2 |= 4; - break; - } + + if (mmd->flag & MOD_MIR_AXIS_X && fabsf(eve->co[0]) < mmd->tolerance) eve->f2 |= 1; + if (mmd->flag & MOD_MIR_AXIS_Y && fabsf(eve->co[1]) < mmd->tolerance) eve->f2 |= 2; + if (mmd->flag & MOD_MIR_AXIS_Z && fabsf(eve->co[2]) < mmd->tolerance) eve->f2 |= 4; + } } } diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index aa94b48c1e9..7253d426ca6 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -418,7 +418,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) { /* identifiers */ ot->name= "Assign Image to UV Map"; - ot->description= "Assigns Image to active UV Map, or creates a UV Map"; + ot->description= "Assign Image to active UV Map, or create an UV Map"; ot->idname= "MESH_OT_drop_named_image"; /* api callbacks */ diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 3caafb12f82..707936351cf 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -497,7 +497,6 @@ int join_mesh_exec(bContext *C, wmOperator *op) MEM_freeN(matar); ob->totcol= me->totcol= totcol; - ob->colbits= 0; if (matmap) MEM_freeN(matmap); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index a77a34e05ec..414d3344511 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -40,6 +40,7 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "DNA_defs.h" #include "DNA_meta_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index bcd8b8903e7..855b67b71bc 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -244,7 +244,8 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev return op->type->exec(C, op); } -int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer) +int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, + float *rot, int *enter_editmode, unsigned int *layer) { View3D *v3d = CTX_wm_view3d(C); int a, layer_values[20]; @@ -305,7 +306,8 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, floa /* for object add primitive operators */ /* do not call undo push in this function (users of this function have to) */ -Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer) +Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, + int enter_editmode, unsigned int layer) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -326,7 +328,9 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, int en DAG_id_type_tag(bmain, ID_OB); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } if(enter_editmode) ED_object_enter_editmode(C, EM_IGNORE_LAYER); @@ -1809,7 +1813,9 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag set_sca_new_poins_ob(ob); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } return basen; } diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 5dc1c1b0f03..d1d41af1e50 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -636,6 +636,13 @@ static void *init_normal_data(MultiresBakeRender *bkr, Image *UNUSED(ima)) return (void*)normal_data; } +static void free_normal_data(void *bake_data) +{ + MNormalBakeData *normal_data= (MNormalBakeData*)bake_data; + + MEM_freeN(normal_data); +} + static void apply_heights_data(void *bake_data) { MHeightBakeData *height_data= (MHeightBakeData*)bake_data; @@ -849,7 +856,7 @@ static void bake_images(MultiresBakeRender *bkr) switch(bkr->mode) { case RE_BAKE_NORMALS: - do_multires_bake(bkr, ima, apply_tangmat_callback, init_normal_data, NULL, NULL); + do_multires_bake(bkr, ima, apply_tangmat_callback, init_normal_data, NULL, free_normal_data); break; case RE_BAKE_DISPLACEMENT: do_multires_bake(bkr, ima, apply_heights_callback, init_heights_data, @@ -1073,6 +1080,8 @@ static int multiresbake_image_exec_locked(bContext *C, wmOperator *op) ob= base->object; + multires_force_update(ob); + /* copy data stored in job descriptor */ bkr.bake_filter= scene->r.bake_filter; bkr.mode= scene->r.bake_mode; @@ -1110,6 +1119,8 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) MultiresBakerJobData *data; ob= base->object; + multires_force_update(ob); + data= MEM_callocN(sizeof(MultiresBakerJobData), "multiresBaker derivedMesh_data"); data->lores_dm = multiresbake_create_loresdm(scene, ob, &data->lvl); data->hires_dm = multiresbake_create_hiresdm(scene, ob, &data->tot_lvl, &data->simple); @@ -1248,9 +1259,7 @@ static int test_bake_internal(bContext *C, ReportList *reports) { Scene *scene= CTX_data_scene(C); - if(scene->r.renderer!=R_INTERN) { - BKE_report(reports, RPT_ERROR, "Bake only supported for Internal Renderer"); - } else if((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) { + if((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) { BKE_report(reports, RPT_ERROR, "No active object"); } else if(scene->r.bake_mode==RE_BAKE_AO && scene->world==NULL) { diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 40d52e0b261..2a45a7df735 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -766,7 +766,7 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op) where_is_pose(scene, ob); } else if (ob) { - Object workob = {{NULL}}; + Object workob; /* use what_does_parent to find inverse - just like for normal parenting */ what_does_parent(scene, ob, &workob); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 722e7057ece..07ab80f6d15 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -439,9 +439,6 @@ void ED_object_enter_editmode(bContext *C, int flag) ob->mode= OB_MODE_EDIT; if(ob->type==OB_MESH) { - Mesh *me= ob->data; - - if(me->pv) mesh_pmv_off(me); ok= 1; scene->obedit= ob; // context sees this @@ -1142,7 +1139,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) } else if(event==3) { /* size */ copy_v3_v3(base->object->size, ob->size); - copy_v3_v3(base->object->dsize, ob->dsize); + copy_v3_v3(base->object->dscale, ob->dscale); } else if(event==4) { /* drawtype */ base->object->dt= ob->dt; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 86477eb9dbd..240fb8017f2 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -456,7 +456,6 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes"); return 0; } - mesh_pmv_off(me); dm = mesh_create_derived_for_modifier(scene, ob, md); if (!dm) { @@ -506,8 +505,6 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, return 0; } - mesh_pmv_off(me); - /* Multires: ensure that recent sculpting is applied */ if(md->type == eModifierType_Multires) multires_force_update(ob); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 3a4cd6135cf..6b517b6eeb0 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -340,7 +340,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) /* Add new object for the proxy */ newob= add_object(scene, OB_EMPTY); - BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name); + BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name+2); rename_id(&newob->id, name); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index e2039739be2..a83896e7280 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -188,15 +188,15 @@ static void object_clear_scale(Object *ob) { /* clear scale factors which are not locked */ if ((ob->protectflag & OB_LOCK_SCALEX)==0) { - ob->dsize[0]= 0.0f; + ob->dscale[0]= 1.0f; ob->size[0]= 1.0f; } if ((ob->protectflag & OB_LOCK_SCALEY)==0) { - ob->dsize[1]= 0.0f; + ob->dscale[1]= 1.0f; ob->size[1]= 1.0f; } if ((ob->protectflag & OB_LOCK_SCALEZ)==0) { - ob->dsize[2]= 0.0f; + ob->dscale[2]= 1.0f; ob->size[2]= 1.0f; } } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index d6300dc1fe3..55d72bcf165 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -99,6 +99,7 @@ int ED_vgroup_object_is_edit_mode(Object *ob) bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name) { bDeformGroup *defgroup; + if(!ob || !OB_TYPE_SUPPORT_VGROUP(ob->type)) return NULL; @@ -1576,13 +1577,21 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr, } } else { - /* dvert should always be the target */ + /* dvert should always be the target, only swaps pointer */ if(sel_mirr) { SWAP(MDeformVert *, dvert, dvert_mirr); } - if(mirror_weights) - defvert_copy(dvert, dvert_mirr); + if(mirror_weights) { + if (all_vgroups) { + defvert_copy(dvert, dvert_mirr); + } + else { + defvert_copy_index(dvert, dvert_mirr, act_vgroup); + } + } + + /* flip map already modified for 'all_vgroups' */ if(flip_vgroups) { defvert_flip(dvert, flip_map, flip_map_len); } diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h index 9d6b5884cbd..0dae8b362cd 100644 --- a/source/blender/editors/physics/physics_intern.h +++ b/source/blender/editors/physics/physics_intern.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 3a2d9f137d7..35b21c626ed 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -123,17 +123,6 @@ static void screen_opengl_render_apply(OGLRender *oglrender) rr= RE_AcquireResultRead(oglrender->re); - /* note on color management: - * looked into how best to deal with color management here and found heres how it should work. - * - * OpenGL materials etc are color corrected, so a float buffer from the graphics card is - * color corrected, without running any conversion functions. - * - * With color correction disabled blender expects the rr->rectf to be non-color managed so - * just do a direct copy from the byte array to the rectf with no conversion too. - * notice IMB_float_from_rect has the profile set so no conversion is done. - */ - if(view_context) { GPU_offscreen_bind(oglrender->ofs); /* bind */ @@ -208,13 +197,32 @@ static void screen_opengl_render_apply(OGLRender *oglrender) if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW)) BKE_stamp_buf(scene, camera, NULL, rr->rectf, rr->rectx, rr->recty, 4); + /* note on color management: + * + * OpenGL renders into sRGB colors, but render buffers are expected to be + * linear if color management is enabled. So we convert to linear here, so + * the conversion back to bytes using the color management flag can make it + * sRGB again, and so that e.g. openexr saving also saves the correct linear + * float buffer. */ + + if(oglrender->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) { + float *rctf = rr->rectf; + int i; + + for (i = oglrender->sizex * oglrender->sizey; i > 0; i--, rctf+=4) { + rctf[0]= srgb_to_linearrgb(rctf[0]); + rctf[1]= srgb_to_linearrgb(rctf[1]); + rctf[2]= srgb_to_linearrgb(rctf[2]); + } + } + RE_ReleaseResult(oglrender->re); /* update byte from float buffer */ ibuf= BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock); if(ibuf) { - image_buffer_rect_update(NULL, rr, ibuf, NULL); + image_buffer_rect_update(scene, rr, ibuf, NULL); if(oglrender->write_still) { char name[FILE_MAX]; @@ -307,15 +315,18 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->scene->customdata_mask_modal= ED_view3d_datamask(oglrender->scene, oglrender->v3d); } + /* create render */ + oglrender->re= RE_NewRender(scene->id.name); + /* create image and image user */ oglrender->ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); BKE_image_signal(oglrender->ima, NULL, IMA_SIGNAL_FREE); + BKE_image_backup_render(oglrender->scene, oglrender->ima); oglrender->iuser.scene= scene; oglrender->iuser.ok= 1; - /* create render and render result */ - oglrender->re= RE_NewRender(scene->id.name); + /* create render result */ RE_InitState(oglrender->re, NULL, &scene->r, NULL, sizex, sizey, NULL); rr= RE_AcquireResultWrite(oglrender->re); diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index f353a090305..d921308aad5 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -41,6 +41,7 @@ #include "DNA_view3d_types.h" #include "DNA_world_types.h" +#include "BLI_threads.h" #include "BLI_utildefines.h" #include "BKE_context.h" @@ -65,13 +66,25 @@ /***************************** Render Engines ********************************/ -void ED_render_engine_update_tagged(bContext *C, Main *bmain) +void ED_render_scene_update(Main *bmain, Scene *scene, int updated) { /* viewport rendering update on data changes, happens after depsgraph * updates if there was any change. context is set to the 3d view */ - bScreen *sc, *prev_sc= CTX_wm_screen(C); - ScrArea *sa, *prev_sa= CTX_wm_area(C); - ARegion *ar, *prev_ar= CTX_wm_region(C); + bContext *C; + bScreen *sc; + ScrArea *sa; + ARegion *ar; + + /* don't do this render engine update if we're updating the scene from + other threads doing e.g. rendering or baking jobs */ + if(!BLI_thread_is_main()) + return; + + C= CTX_create(); + CTX_data_main_set(C, bmain); + CTX_data_scene_set(C, scene); + + CTX_wm_manager_set(C, bmain->wm.first); for(sc=bmain->screen.first; sc; sc=sc->id.next) { for(sa=sc->areabase.first; sa; sa=sa->next) { @@ -88,7 +101,7 @@ void ED_render_engine_update_tagged(bContext *C, Main *bmain) rv3d= ar->regiondata; engine= rv3d->render_engine; - if(engine && (engine->flag & RE_ENGINE_DO_UPDATE)) { + if(engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) { CTX_wm_screen_set(C, sc); CTX_wm_area_set(C, sa); CTX_wm_region_set(C, ar); @@ -100,9 +113,7 @@ void ED_render_engine_update_tagged(bContext *C, Main *bmain) } } - CTX_wm_screen_set(C, prev_sc); - CTX_wm_area_set(C, prev_sa); - CTX_wm_region_set(C, prev_ar); + CTX_free(C); } void ED_render_engine_changed(Main *bmain) @@ -134,32 +145,6 @@ void ED_render_engine_changed(Main *bmain) } } -static void tag_render_engines(Main *bmain) -{ - /* tag running render engines for update later on */ - bScreen *sc; - ScrArea *sa; - ARegion *ar; - - for(sc=bmain->screen.first; sc; sc=sc->id.next) { - for(sa=sc->areabase.first; sa; sa=sa->next) { - if(sa->spacetype != SPACE_VIEW3D) - continue; - - for(ar=sa->regionbase.first; ar; ar=ar->next) { - RegionView3D *rv3d; - - if(ar->regiontype != RGN_TYPE_WINDOW) - continue; - - rv3d= ar->regiondata; - if(rv3d->render_engine) - rv3d->render_engine->flag |= RE_ENGINE_DO_UPDATE; - } - } - } -} - /***************************** Updates *********************************** * ED_render_id_flush_update gets called from DAG_id_tag_update, to do * * editor level updates when the ID changes. when these ID blocks are in * @@ -357,11 +342,6 @@ static void scene_changed(Main *bmain, Scene *UNUSED(scene)) void ED_render_id_flush_update(Main *bmain, ID *id) { - if(!id) { - tag_render_engines(bmain); - return; - } - switch(GS(id->name)) { case ID_MA: material_changed(bmain, (Material*)id); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f3d087d6986..7aacd9f7b86 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -262,12 +262,12 @@ static void region_draw_azone_tab_plus(AZone *az) break; } - glColor4f(0.05f, 0.05f, 0.05f, 0.5f); + glColor4f(0.05f, 0.05f, 0.05f, 0.4f); uiRoundBox((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f); glEnable(GL_BLEND); - glColor4f(0.8f, 0.8f, 0.8f, 0.5f); + glColor4f(0.8f, 0.8f, 0.8f, 0.4f); draw_azone_plus((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2); glDisable(GL_BLEND); @@ -711,8 +711,8 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar) } } -#define AZONEPAD_TAB_PLUSW 16 -#define AZONEPAD_TAB_PLUSH 16 +#define AZONEPAD_TAB_PLUSW 14 +#define AZONEPAD_TAB_PLUSH 14 /* region already made zero sized, in shape of edge */ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar) @@ -739,9 +739,9 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar) az->y2= ar->winrct.ymin; break; case AE_LEFT_TO_TOPRIGHT: - az->x1= ar->winrct.xmin + 1 - AZONEPAD_TAB_PLUSH; + az->x1= ar->winrct.xmin - AZONEPAD_TAB_PLUSH; az->y1= ar->winrct.ymax - 2.5*AZONEPAD_TAB_PLUSW; - az->x2= ar->winrct.xmin + 1; + az->x2= ar->winrct.xmin; az->y2= ar->winrct.ymax - 1.5*AZONEPAD_TAB_PLUSW; break; case AE_RIGHT_TO_TOPLEFT: @@ -1596,7 +1596,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char * if(pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) { /* for enabled buttons */ panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, - triangle, UI_UNIT_Y+style->panelspace, UI_UNIT_Y, 1, style); + triangle, UI_UNIT_Y+style->panelspace+2, UI_UNIT_Y, 1, style); pt->draw_header(C, panel); @@ -1776,3 +1776,38 @@ int ED_area_headersize(void) { return UI_UNIT_Y+6; } + +void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha) +{ + const int header_height = 18; + uiStyle *style= UI_GetStyle(); + int fontid= style->widget.uifont_id; + rcti rect; + + BLF_size(fontid, 11.0f, 72); + + /* background box */ + rect= ar->winrct; + rect.xmin= 0; + rect.ymin= ar->winrct.ymax - ar->winrct.ymin - header_height; + + if(block) { + rect.xmax= ar->winrct.xmax - ar->winrct.xmin; + } + else { + rect.xmax= rect.xmin + BLF_width(fontid, text) + 24; + } + + rect.ymax= ar->winrct.ymax - ar->winrct.ymin; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0.0f, 0.0f, 0.0f, alpha); + glRecti(rect.xmin, rect.ymin, rect.xmax+1, rect.ymax+1); + glDisable(GL_BLEND); + + /* text */ + UI_ThemeColor(TH_TEXT_HI); + BLF_position(fontid, 12, rect.ymin + 5, 0.0f); + BLF_draw(fontid, text, strlen(text)); +} diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7144ae3e31a..a5bd38d6696 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1150,7 +1150,7 @@ static char *gen_lock_flags(Object* ob, int defbase_tot) lock_flags[i] = ((defgroup->flag & DG_LOCK_WEIGHT) != 0); is_locked |= lock_flags[i]; } - if(is_locked){ + if (is_locked) { return lock_flags; } @@ -1273,12 +1273,12 @@ static float redistribute_change(MDeformVert *ndv, char *change_status, int chan /* left overs */ return totchange; } - +static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_change); /* observe the changes made to the weights of groups. * make sure all locked groups on the vertex have the same deformation * by moving the changes made to groups onto other unlocked groups */ -static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, - const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize) +static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, char *defbase_sel, + const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize, char do_multipaint) { float totchange = 0.0f; float totchange_allowed = 0.0f; @@ -1289,13 +1289,10 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, unsigned int i; MDeformWeight *ndw; MDeformWeight *odw; - MDeformWeight *ndw2; - MDeformWeight *odw2; - int designatedw = -1; - int designatedw_changed = FALSE; - float storedw; + + float changed_sum = 0.0f; + char *change_status; - char new_weight_has_zero = FALSE; if(!lock_flags || !has_locked_group(ndv, lock_flags)) { return; @@ -1308,7 +1305,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, odw = defvert_find_index(odv, i); /* the weights are zero, so we can assume a lot */ if(!ndw || !odw) { - if (!lock_flags[i] && vgroup_validmap[i]){ + if (!lock_flags[i] && vgroup_validmap[i]) { defvert_verify_index(odv, i); defvert_verify_index(ndv, i); total_valid++; @@ -1322,16 +1319,11 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, } else if(ndw->weight != odw->weight) { /* changed groups are handled here */ totchange += ndw->weight - odw->weight; + changed_sum += ndw->weight; change_status[i] = 2; /* was altered already */ total_changed++; - if(ndw->weight == 0) { - new_weight_has_zero = TRUE; - } - else if(designatedw == -1){ - designatedw = i; - } } /* unchanged, unlocked bone groups are handled here */ - else if (vgroup_validmap[i]){ + else if (vgroup_validmap[i]) { totchange_allowed += ndw->weight; total_valid++; change_status[i] = 1; /* can be altered while redistributing */ @@ -1369,30 +1361,12 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, totchange_allowed = redistribute_change(ndv, change_status, 1, -1, totchange_allowed, total_valid, do_auto_normalize); left_over += totchange_allowed; if(left_over) { - /* more than one nonzero weights were changed with the same ratio, so keep them changed that way! */ - if(total_changed > 1 && !new_weight_has_zero && designatedw >= 0) { - /* this dw is special, it is used as a base to determine how to change the others */ - ndw = defvert_find_index(ndv, designatedw); - odw = defvert_find_index(odv, designatedw); - storedw = ndw->weight; - for(i = 0; i < ndv->totweight; i++) { - if(ndv->dw[i].def_nr == designatedw) { - continue; - } - ndw2 = &ndv->dw[i]; - if(change_status[ndw2->def_nr] == 2) { - odw2 = &odv->dw[i]; - - if(!designatedw_changed) { - ndw->weight = (-left_over + odw->weight + odw2->weight)/(1.0f + ndw2->weight/ndw->weight); - designatedw_changed = TRUE; - } - ndw2->weight = ndw->weight * ndw2->weight / storedw; - } - } - } - /* a weight was changed to zero, only one weight was changed, - * or designatedw is still -1 put weight back as evenly as possible */ + /* more than one nonzero weights were changed with the same ratio with multipaint, so keep them changed that way! */ + if(total_changed > 1 && do_multipaint) { + float undo_change = get_mp_change(ndv, defbase_sel, left_over); + multipaint_selection(ndv, undo_change, defbase_sel, defbase_tot); + } + /* or designatedw is still -1 put weight back as evenly as possible */ else { redistribute_change(ndv, change_status, 2, -2, left_over, total_changed, do_auto_normalize); } @@ -1513,7 +1487,7 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, } clamp_weights(dv); - enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize); + enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize, wpi->do_multipaint); do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 630038d4c6b..3f9ec3f3c82 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -191,31 +191,21 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar) { + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; char str[256]= {0}; + int block= 0; - if(sc->flag&SC_LOCK_SELECTION) - strcpy(str, "Locked"); - - if(str[0]) { - uiStyle *style= UI_GetStyle(); - int fontsize, fontwidth; - int fontid= style->widget.uifont_id; - - BLF_size(fontid, 11.0f, U.dpi); - fontsize= BLF_height(fontid, str); - fontwidth= BLF_width(fontid, str); - - glEnable(GL_BLEND); - - glColor4f(0.0f, 0.0f, 0.0f, 0.6f); - glRecti(0, ar->winy-fontsize-9, fontwidth+12, ar->winy); - - glColor3f(1.0f, 1.0f, 1.0f); - BLF_position(fontid, 6.0f, ar->winy-fontsize-5.0f, 0.0f); - BLF_draw(fontid, str, strlen(str)); - - glDisable(GL_BLEND); + if(tracking->stats) { + BLI_strncpy(str, tracking->stats->message, sizeof(str)); + block= 1; + } else { + if(sc->flag&SC_LOCK_SELECTION) + strcpy(str, "Locked"); } + + if(str[0]) + ED_region_info_draw(ar, str, block, 0.6f); } static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index c4a858797e5..491014357e4 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -893,7 +893,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog BKE_tracking_distortion_destroy(distortion); } -static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) +static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) { wmJob * steve; ProxyJob *pj; @@ -929,10 +929,10 @@ void CLIP_OT_rebuild_proxy(wmOperatorType *ot) /* identifiers */ ot->name= "Rebuild Proxy and Timecode Indices"; ot->idname= "CLIP_OT_rebuild_proxy"; - ot->description= "Rebuild all selected proxies and timecode indeces in the background"; + ot->description= "Rebuild all selected proxies and timecode indices in the background"; /* api callbacks */ - ot->exec= sequencer_rebuild_proxy_exec; + ot->exec= clip_rebuild_proxy_exec; ot->poll= ED_space_clip_poll; /* flags */ diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index e5a5109d796..3d004ab73da 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -684,7 +684,7 @@ static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *trac epsy= MIN4(track->pat_min[1]-track->search_min[1], track->search_max[1]-track->pat_max[1], fabsf(track->pat_min[1]), fabsf(track->pat_max[1])) / 2; - epsx= MAX2(epsy, 2.0f / width); + epsx= MAX2(epsx, 2.0f / width); epsy= MAX2(epsy, 2.0f / height); if(sc->flag&SC_SHOW_MARKER_SEARCH) @@ -741,7 +741,7 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, MovieClip *clip, fl d2= dist_to_rect(co, marker->pos, cur->pat_min, cur->pat_max); /* distance to search boundbox */ - if(sc->flag&SC_SHOW_MARKER_SEARCH) + if(sc->flag&SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur)) d3= dist_to_rect(co, marker->pos, cur->search_min, cur->search_max); /* choose minimal distance. useful for cases of overlapped markers. */ @@ -1209,11 +1209,16 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip) { int tot= 0; MovieTrackingTrack *track; + int framenr= sc->user.framenr; track= clip->tracking.tracks.first; while(track) { - if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) - tot++; + if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) { + MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, framenr); + + if (!marker || (marker->flag&MARKER_DISABLED) == 0) + tot++; + } track= track->next; } @@ -1221,10 +1226,11 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip) return tot; } -static void track_init_markers(SpaceClip *sc, MovieClip *clip) +static void track_init_markers(SpaceClip *sc, MovieClip *clip, int *frames_limit_r) { MovieTrackingTrack *track; int framenr= sc->user.framenr, hidden= 0; + int frames_limit= 0; if((sc->flag&SC_SHOW_MARKER_PATTERN)==0) hidden|= TRACK_AREA_PAT; if((sc->flag&SC_SHOW_MARKER_SEARCH)==0) hidden|= TRACK_AREA_SEARCH; @@ -1235,12 +1241,22 @@ static void track_init_markers(SpaceClip *sc, MovieClip *clip) BKE_tracking_track_flag(track, hidden, SELECT, 1); if(TRACK_SELECTED(track)) { - if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) + if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) { BKE_tracking_ensure_marker(track, framenr); + + if(track->frames_limit) { + if(frames_limit==0) + frames_limit= track->frames_limit; + else + frames_limit= MIN2(frames_limit, track->frames_limit); + } + } } track= track->next; } + + *frames_limit_r= frames_limit; } static int track_markers_check_direction(int backwards, int curfra, int efra) @@ -1261,6 +1277,9 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward MovieClip *clip= ED_space_clip(sc); Scene *scene= CTX_data_scene(C); MovieTrackingSettings *settings= &clip->tracking.settings; + int frames_limit; + + track_init_markers(sc, clip, &frames_limit); tmj->sfra= sc->user.framenr; tmj->clip= clip; @@ -1270,9 +1289,9 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward else tmj->efra= EFRA; /* limit frames to be tracked by user setting */ - if(settings->frames_limit) { - if(backwards) tmj->efra= MAX2(tmj->efra, tmj->sfra-settings->frames_limit); - else tmj->efra= MIN2(tmj->efra, tmj->sfra+settings->frames_limit); + if(frames_limit) { + if(backwards) tmj->efra= MAX2(tmj->efra, tmj->sfra-frames_limit); + else tmj->efra= MIN2(tmj->efra, tmj->sfra+frames_limit); } if(settings->speed!=TRACKING_SPEED_FASTEST) { @@ -1283,8 +1302,6 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward else if(settings->speed==TRACKING_SPEED_DOUBLE) tmj->delay/= 2; } - track_init_markers(sc, clip); - tmj->context= BKE_tracking_context_new(clip, &sc->user, backwards, 1); clip->tracking_context= tmj->context; @@ -1376,25 +1393,25 @@ static int track_markers_exec(bContext *C, wmOperator *op) int sfra= framenr, efra; int backwards= RNA_boolean_get(op->ptr, "backwards"); int sequence= RNA_boolean_get(op->ptr, "sequence"); - MovieTrackingSettings *settings= &clip->tracking.settings; + int frames_limit; if(track_count_markers(sc, clip)==0) return OPERATOR_CANCELLED; + track_init_markers(sc, clip, &frames_limit); + if(backwards) efra= SFRA; else efra= EFRA; /* limit frames to be tracked by user setting */ - if(settings->frames_limit) { - if(backwards) efra= MAX2(efra, sfra-settings->frames_limit); - else efra= MIN2(efra, sfra+settings->frames_limit); + if(frames_limit) { + if(backwards) efra= MAX2(efra, sfra-frames_limit); + else efra= MIN2(efra, sfra+frames_limit); } if(!track_markers_check_direction(backwards, framenr, efra)) return OPERATOR_CANCELLED; - track_init_markers(sc, clip); - /* do not disable tracks due to threshold when tracking frame-by-frame */ context= BKE_tracking_context_new(clip, &sc->user, backwards, sequence); @@ -1473,7 +1490,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { - /* no running blender, remove handler and pass through */ + /* no running tracking, remove handler and pass through */ if(0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; @@ -1510,61 +1527,201 @@ void CLIP_OT_track_markers(wmOperatorType *ot) /********************** solve camera operator *********************/ -static int solve_camera_exec(bContext *C, wmOperator *op) +typedef struct { + Scene *scene; + MovieClip *clip; + MovieClipUser user; + + ReportList *reports; + + char stats_message[256]; + + struct MovieReconstructContext *context; +} SolveCameraJob; + +static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op, char *error_msg, int max_error) { SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= ED_space_clip(sc); Scene *scene= CTX_data_scene(C); MovieTracking *tracking= &clip->tracking; + MovieTrackingSettings *settings= &clip->tracking.settings; int width, height; - float error; - char error_msg[255]; - - if(!BKE_tracking_can_solve(tracking, error_msg, sizeof(error_msg))) { - BKE_report(op->reports, RPT_ERROR, error_msg); - return OPERATOR_CANCELLED; - } + if(!BKE_tracking_can_reconstruct(tracking, error_msg, max_error)) + return 0; /* could fail if footage uses images with different sizes */ BKE_movieclip_get_size(clip, &sc->user, &width, &height); - error= BKE_tracking_solve_reconstruction(tracking, width, height); + scj->clip= clip; + scj->scene= scene; + scj->reports= op->reports; + scj->user= sc->user; + + scj->context= BKE_tracking_reconstruction_context_new(tracking, + settings->keyframe1, settings->keyframe2, width, height); - if(error<0) - BKE_report(op->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details"); + tracking->stats= MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats"); + + return 1; +} + +static void solve_camera_updatejob(void *scv) +{ + SolveCameraJob *scj= (SolveCameraJob *)scv; + MovieTracking *tracking= &scj->clip->tracking; + + BLI_strncpy(tracking->stats->message, scj->stats_message, sizeof(tracking->stats->message)); +} + +static void solve_camera_startjob(void *scv, short *stop, short *do_update, float *progress) +{ + SolveCameraJob *scj= (SolveCameraJob *)scv; + + BKE_tracking_solve_reconstruction(scj->context, stop, do_update, progress, + scj->stats_message, sizeof(scj->stats_message)); +} + +static void solve_camera_freejob(void *scv) +{ + SolveCameraJob *scj= (SolveCameraJob *)scv; + MovieTracking *tracking= &scj->clip->tracking; + Scene *scene= scj->scene; + MovieClip *clip= scj->clip; + int solved; + + if(!scj->context) { + /* job weren't fully initialized due to some error */ + MEM_freeN(scj); + return; + } + + solved= BKE_tracking_finish_reconstruction(scj->context, tracking); + + if(!solved) + BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details"); else - BKE_reportf(op->reports, RPT_INFO, "Average reprojection error %.3f", error); + BKE_reportf(scj->reports, RPT_INFO, "Average reprojection error %.3f", tracking->reconstruction.error); + /* set currently solved clip as active for scene */ if(scene->clip) id_us_min(&clip->id); scene->clip= clip; id_us_plus(&clip->id); + /* set blender camera focal length so result would look fine there */ if(!scene->camera) scene->camera= scene_find_camera(scene); if(scene->camera) { - /* set blender camera focal length so result would look fine there */ Camera *camera= (Camera*)scene->camera->data; + int width, height; + + BKE_movieclip_get_size(clip, &scj->user, &width, &height); BKE_tracking_camera_to_blender(tracking, scene, camera, width, height); - WM_event_add_notifier(C, NC_OBJECT, camera); + WM_main_add_notifier(NC_OBJECT, camera); } + MEM_freeN(tracking->stats); + tracking->stats= NULL; + DAG_id_tag_update(&clip->id, 0); - WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); - WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + WM_main_add_notifier(NC_MOVIECLIP|NA_EVALUATED, clip); + WM_main_add_notifier(NC_OBJECT|ND_TRANSFORM, NULL); /* update active clip displayed in scene buttons */ - WM_event_add_notifier(C, NC_SCENE, scene); + WM_main_add_notifier(NC_SCENE, scene); + + BKE_tracking_reconstruction_context_free(scj->context); + MEM_freeN(scj); +} + +static int solve_camera_exec(bContext *C, wmOperator *op) +{ + SolveCameraJob *scj; + char error_msg[256]= "\0"; + + scj= MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data"); + if(!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) { + if(error_msg[0]) + BKE_report(op->reports, RPT_ERROR, error_msg); + + solve_camera_freejob(scj); + + return OPERATOR_CANCELLED; + } + + solve_camera_startjob(scj, NULL, NULL, NULL); + + solve_camera_freejob(scj); return OPERATOR_FINISHED; } +static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + SolveCameraJob *scj; + ScrArea *sa= CTX_wm_area(C); + SpaceClip *sc= CTX_wm_space_clip(C); + MovieClip *clip= ED_space_clip(sc); + MovieTracking *tracking= &clip->tracking; + wmJob *steve; + char error_msg[256]= "\0"; + + scj= MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data"); + if(!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) { + if(error_msg[0]) + BKE_report(op->reports, RPT_ERROR, error_msg); + + solve_camera_freejob(scj); + + return OPERATOR_CANCELLED; + } + + BLI_strncpy(tracking->stats->message, "Solving camera | Preparing solve", sizeof(tracking->stats->message)); + + /* hide reconstruction statistics from previous solve */ + clip->tracking.reconstruction.flag&= ~TRACKING_RECONSTRUCTED; + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip); + + /* setup job */ + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Solve Camera", WM_JOB_PROGRESS); + WM_jobs_customdata(steve, scj, solve_camera_freejob); + WM_jobs_timer(steve, 0.1, NC_MOVIECLIP|NA_EVALUATED, 0); + WM_jobs_callbacks(steve, solve_camera_startjob, NULL, solve_camera_updatejob, NULL); + + G.afbreek= 0; + + WM_jobs_start(CTX_wm_manager(C), steve); + WM_cursor_wait(0); + + /* add modal handler for ESC */ + WM_event_add_modal_handler(C, op); + + return OPERATOR_RUNNING_MODAL; +} + +static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +{ + /* no running solver, remove handler and pass through */ + if(0==WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C))) + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; + + /* running tracking */ + switch (event->type) { + case ESCKEY: + return OPERATOR_RUNNING_MODAL; + break; + } + + return OPERATOR_PASS_THROUGH; +} + void CLIP_OT_solve_camera(wmOperatorType *ot) { /* identifiers */ @@ -1574,6 +1731,8 @@ void CLIP_OT_solve_camera(wmOperatorType *ot) /* api callbacks */ ot->exec= solve_camera_exec; + ot->invoke= solve_camera_invoke; + ot->modal= solve_camera_modal; ot->poll= ED_space_clip_poll; /* flags */ diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index cd4c22df418..0a8824e473d 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 6c68ba0ea71..c647ff3df53 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -383,6 +383,10 @@ static char *layer_menu(RenderResult *rr, short *UNUSED(curlay)) a+= sprintf(str+a, "|Composite %%x0"); nr= 1; } + else if(rr->rect32) { + a+= sprintf(str+a, "|Sequence %%x0"); + nr= 1; + } for(rl= rr->layers.first; rl; rl= rl->next, nr++) { a+= sprintf(str+a, "|%s %%x%d", rl->name, nr); } @@ -443,7 +447,10 @@ static void image_multi_inclay_cb(bContext *C, void *rr_v, void *iuser_v) { RenderResult *rr= rr_v; ImageUser *iuser= iuser_v; - int tot= BLI_countlist(&rr->layers) + (rr->rectf?1:0); /* fake compo result layer */ + int tot= BLI_countlist(&rr->layers); + + if(rr->rectf || rr->rect32) + tot++; /* fake compo/sequencer layer */ if(iuser->layer<tot-1) { iuser->layer++; @@ -468,7 +475,11 @@ static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v) RenderLayer *rl= BLI_findlink(&rr->layers, iuser->layer); if(rl) { - int tot= BLI_countlist(&rl->passes) + (rl->rectf?1:0); /* builtin render result has no combined pass in list */ + int tot= BLI_countlist(&rl->passes); + + if(rr->rectf || rr->rect32) + tot++; /* fake compo/sequencer layer */ + if(iuser->pass<tot-1) { iuser->pass++; BKE_image_multilayer_index(rr, iuser); @@ -509,7 +520,7 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image uiBlock *block= uiLayoutGetBlock(layout); uiBut *but; RenderLayer *rl= NULL; - int wmenu1, wmenu2, wmenu3; + int wmenu1, wmenu2, wmenu3, layer; char *strp; uiLayoutRow(layout, 1); @@ -532,8 +543,12 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0,0,0,0, "Select Layer"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); + + layer = iuser->layer; + if(rr->rectf || rr->rect32) + layer--; /* fake compo/sequencer layer */ - rl= BLI_findlink(&rr->layers, iuser->layer - (rr->rectf?1:0)); /* fake compo layer, return NULL is meant to be */ + rl= BLI_findlink(&rr->layers, layer); /* return NULL is meant to be */ strp= pass_menu(rl, &iuser->pass); but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0,0,0,0, "Select Pass"); uiButSetFunc(but, image_multi_cb, rr, iuser); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 77ac577792c..dc712e286a1 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -63,6 +63,7 @@ #include "ED_gpencil.h" #include "ED_image.h" +#include "ED_screen.h" #include "UI_interface.h" #include "UI_resources.h" @@ -99,29 +100,11 @@ static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage) static void draw_render_info(Scene *scene, Image *ima, ARegion *ar) { RenderResult *rr; - rcti rect; - float colf[3]; rr= BKE_image_acquire_renderresult(scene, ima); if(rr && rr->text) { - rect= ar->winrct; - rect.xmin= 0; - rect.ymin= ar->winrct.ymax - ar->winrct.ymin - HEADER_HEIGHT; - rect.xmax= ar->winrct.xmax - ar->winrct.xmin; - rect.ymax= ar->winrct.ymax - ar->winrct.ymin; - - /* clear header rect */ - UI_GetThemeColor3fv(TH_BACK, colf); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glColor4f(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 0.5f); - glRecti(rect.xmin, rect.ymin, rect.xmax, rect.ymax+1); - glDisable(GL_BLEND); - - UI_ThemeColor(TH_TEXT_HI); - - UI_DrawString(12, rect.ymin + 5, rr->text); + ED_region_info_draw(ar, rr->text, 1, 0.25); } BKE_image_release_renderresult(scene, ima); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4e9ac08d8c8..bd5292e5154 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2595,18 +2595,32 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t glEnd(); } - UI_ThemeColor(th_col1); + /* XXX using GL_LINES for shaded node lines is a workaround + * for Intel hardware, this breaks with GL_LINE_STRIP and + * changing color in begin/end blocks. + */ glLineWidth(1.5f); - - glBegin(GL_LINE_STRIP); - for(i=0; i<=LINK_RESOL; i++) { - if(do_shaded) { + if(do_shaded) { + glBegin(GL_LINES); + for(i=0; i<LINK_RESOL; i++) { UI_ThemeColorBlend(th_col1, th_col2, spline_step); + glVertex2fv(coord_array[i]); + + UI_ThemeColorBlend(th_col1, th_col2, spline_step+dist); + glVertex2fv(coord_array[i+1]); + spline_step += dist; } - glVertex2fv(coord_array[i]); + glEnd(); + } + else { + UI_ThemeColor(th_col1); + glBegin(GL_LINE_STRIP); + for(i=0; i<=LINK_RESOL; i++) { + glVertex2fv(coord_array[i]); + } + glEnd(); } - glEnd(); glDisable(GL_LINE_SMOOTH); @@ -2663,14 +2677,31 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int UI_ThemeColor(th_col1); glLineWidth(1.5f); - glBegin(GL_LINE_STRIP); - for (i=0; i < LINK_RESOL; ++i) { - float t= (float)i/(float)(LINK_RESOL-1); - if(do_shaded) + /* XXX using GL_LINES for shaded node lines is a workaround + * for Intel hardware, this breaks with GL_LINE_STRIP and + * changing color in begin/end blocks. + */ + if(do_shaded) { + glBegin(GL_LINES); + for (i=0; i < LINK_RESOL-1; ++i) { + float t= (float)i/(float)(LINK_RESOL-1); UI_ThemeColorBlend(th_col1, th_col2, t); - glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]); + glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]); + + t= (float)(i+1)/(float)(LINK_RESOL-1); + UI_ThemeColorBlend(th_col1, th_col2, t); + glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]); + } + glEnd(); + } + else { + glBegin(GL_LINE_STRIP); + for (i=0; i < LINK_RESOL; ++i) { + float t= (float)i/(float)(LINK_RESOL-1); + glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]); + } + glEnd(); } - glEnd(); glDisable(GL_LINE_SMOOTH); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index cd4e99900e7..4074e35f860 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -3276,10 +3276,6 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op)) SpaceNode *snode= CTX_wm_space_node(C); bNode *node; - /* no disabling inside of groups */ - if(node_tree_get_editgroup(snode->nodetree)) - return OPERATOR_CANCELLED; - ED_preview_kill_jobs(C); for(node= snode->edittree->nodes.first; node; node= node->next) { diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index cf9bf3de1b8..86031ca7104 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -893,9 +893,11 @@ struct DrawIconArg { static void tselem_draw_icon_uibut(struct DrawIconArg *arg, int icon) { /* restrict collumn clip... it has been coded by simply overdrawing, doesnt work for buttons */ - if(arg->x >= arg->xmax) - UI_icon_draw(arg->x, arg->y, icon); - else { + if(arg->x >= arg->xmax) { + glEnable(GL_BLEND); + UI_icon_draw_aspect(arg->x, arg->y, icon, 1.0f, arg->alpha); + glDisable(GL_BLEND); + } else { /* XXX investigate: button placement of icons is way different than UI_icon_draw? */ float ufac= UI_UNIT_X/20.0f; uiBut *but= uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : ""); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 42fe14cd59c..aa50b3d5154 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -237,7 +237,6 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so if(set) { ob->actcol= te->index+1; ob->matbits[te->index]= 1; // make ob material active too - ob->colbits |= (1<<te->index); } else { if(ob->actcol == te->index+1) @@ -249,7 +248,6 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so if(set) { ob->actcol= te->index+1; ob->matbits[te->index]= 0; // make obdata material active too - ob->colbits &= ~(1<<te->index); } else { if(ob->actcol == te->index+1) diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index f4e46d0255d..09a125692d2 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -307,10 +307,15 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto } } -static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) +static void id_local_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { if (tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) { - id_clear_lib_data(NULL, tselem->id); + /* if the ID type has no special local function, + * just clear the lib */ + if (id_make_local(tselem->id, FALSE) == FALSE) { + Main *bmain= CTX_data_main(C); + id_clear_lib_data(bmain, tselem->id); + } } } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index bf268b0e304..303f6912ff1 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -105,7 +105,6 @@ static SpaceLink *sequencer_new(const bContext *C) sseq= MEM_callocN(sizeof(SpaceSeq), "initsequencer"); sseq->spacetype= SPACE_SEQ; - sseq->zoom= 4; sseq->chanshown = 0; sseq->view = SEQ_VIEW_SEQUENCE; sseq->mainb = SEQ_DRAW_IMG_IMBUF; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 2465d42bbf1..637c8fcdbcf 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1689,6 +1689,9 @@ void draw_text_main(SpaceText *st, ARegion *ar) int i, x, y, winx, linecount= 0, lineno= 0; int wraplinecount= 0, wrap_skip= 0; + if(st->lheight) st->viewlines= (int)ar->winy/st->lheight; + else st->viewlines= 0; + /* if no text, nothing to do */ if(!text) return; @@ -1699,9 +1702,6 @@ void draw_text_main(SpaceText *st, ARegion *ar) if(!text->curl || !text->sell || !text->lines.first || !text->lines.last) txt_clean_text(text); - if(st->lheight) st->viewlines= (int)ar->winy/st->lheight; - else st->viewlines= 0; - /* update rects for scroll */ calc_text_rcts(st, ar, &scroll, &back); /* scroll will hold the entire bar size */ diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index b3baccde5c9..65ef3273e30 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -580,7 +580,6 @@ static SpaceLink *time_new(const bContext *C) stime= MEM_callocN(sizeof(SpaceTime), "inittime"); stime->spacetype= SPACE_TIME; - stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; // XXX: depreceated stime->flag |= TIME_DRAWFRAMES; /* header */ diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 1bc55b8d73f..e83591b73f5 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -180,7 +180,7 @@ static void draw_mesh_face_select(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* dull unselected faces so as not to get in the way of seeing color */ glColor4ub(96, 96, 96, 64); - dm->drawMappedFacesTex(dm, draw_mesh_face_select__drawFaceOptsInv, (void*)me); + dm->drawMappedFacesTex(dm, draw_mesh_face_select__drawFaceOptsInv, NULL, (void*)me); glDisable(GL_BLEND); } @@ -513,7 +513,7 @@ static int draw_tface_mapped__set_draw(void *userData, int index) static int draw_em_tf_mapped__set_draw(void *userData, int index) { - struct {EditMesh *em; short has_mcol; short has_mtface;} *data = userData; + struct {DerivedMesh *dm; EditMesh *em; short has_mcol; short has_mtface;} *data = userData; EditMesh *em = data->em; EditFace *efa= EM_get_face_for_index(index); MTFace *tface; @@ -629,6 +629,36 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) ddm->release(ddm); } +static int compareDrawOptions(void *userData, int cur_index, int next_index) +{ + DerivedMesh *dm= (DerivedMesh*) userData; + MFace *mf = DM_get_face_data_layer(dm, CD_MFACE); + MTFace *tf = DM_get_face_data_layer(dm, CD_MTFACE); + + if(mf && mf[cur_index].mat_nr != mf[next_index].mat_nr) + return 0; + + if(tf && tf[cur_index].tpage != tf[next_index].tpage) + return 0; + + return 1; +} + +static int compareDrawOptionsEm(void *userData, int cur_index, int next_index) +{ + struct {DerivedMesh *dm; EditMesh *em; short has_mcol; short has_mtface;} *data= userData; + MFace *mf = DM_get_face_data_layer(data->dm, CD_MFACE); + MTFace *tf = DM_get_face_data_layer(data->dm, CD_MTFACE); + + if(mf && mf[cur_index].mat_nr != mf[next_index].mat_nr) + return 0; + + if(tf && tf[cur_index].tpage != tf[next_index].tpage) + return 0; + + return 1; +} + void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_flags) { Mesh *me= ob->data; @@ -643,32 +673,33 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec glColor4f(1.0f,1.0f,1.0f,1.0f); if(ob->mode & OB_MODE_EDIT) { - struct {EditMesh *em; short has_mcol; short has_mtface;} data; + struct {DerivedMesh *dm; EditMesh *em; short has_mcol; short has_mtface;} data; + data.dm = dm; data.em= me->edit_mesh; data.has_mcol= CustomData_has_layer(&me->edit_mesh->fdata, CD_MCOL); data.has_mtface= CustomData_has_layer(&me->edit_mesh->fdata, CD_MTFACE); - dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, &data); + dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, compareDrawOptionsEm, &data); } else if(draw_flags & DRAW_FACE_SELECT) { if(ob->mode & OB_MODE_WEIGHT_PAINT) - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me, 1); else - dm->drawMappedFacesTex(dm, me->mface ? draw_tface_mapped__set_draw : NULL, me); + dm->drawMappedFacesTex(dm, me->mface ? draw_tface_mapped__set_draw : NULL, NULL, me); } else { if(GPU_buffer_legacy(dm)) { if (draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW) - dm->drawFacesTex(dm, draw_mcol__set_draw_legacy); + dm->drawFacesTex(dm, draw_mcol__set_draw_legacy, NULL, NULL); else - dm->drawFacesTex(dm, draw_tface__set_draw_legacy); + dm->drawFacesTex(dm, draw_tface__set_draw_legacy, NULL, NULL); } else { if(!CustomData_has_layer(&dm->faceData,CD_TEXTURE_MCOL)) add_tface_color_layer(dm); - dm->drawFacesTex(dm, draw_tface__set_draw); + dm->drawFacesTex(dm, draw_tface__set_draw, compareDrawOptions, dm); } } @@ -806,7 +837,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o int useColors= 1; dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, - ob->data, useColors, GPU_enable_material, NULL); + GPU_enable_material, NULL, ob->data, useColors); } else { Mesh *me= ob->data; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index be3a599330b..2d49ed533da 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -149,7 +149,7 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt) /* ************* only use while object drawing ************** * or after running ED_view3d_init_mats_rv3d * */ -static void view3d_project_short_clip(ARegion *ar, const float vec[3], short *adr, int local) +static void view3d_project_short_clip(ARegion *ar, const float vec[3], short adr[2], int local) { RegionView3D *rv3d= ar->regiondata; float fx, fy, vec4[4]; @@ -184,7 +184,7 @@ static void view3d_project_short_clip(ARegion *ar, const float vec[3], short *ad } /* only use while object drawing */ -static void view3d_project_short_noclip(ARegion *ar, const float vec[3], short *adr) +static void view3d_project_short_noclip(ARegion *ar, const float vec[3], short adr[2]) { RegionView3D *rv3d= ar->regiondata; float fx, fy, vec4[4]; @@ -212,7 +212,7 @@ static void view3d_project_short_noclip(ARegion *ar, const float vec[3], short * } /* same as view3d_project_short_clip but use persmat instead of persmatob for projection */ -static void view3d_project_short_clip_persmat(ARegion *ar, float *vec, short *adr, int local) +static void view3d_project_short_clip_persmat(ARegion *ar, float *vec, short adr[2], int local) { RegionView3D *rv3d= ar->regiondata; float fx, fy, vec4[4]; @@ -689,7 +689,8 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3], const float size= ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f; float verts[CIRCLE_RESOL][3]; - /* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */ + /* using gldepthfunc guarantees that it does write z values, + * but not checks for it, so centers remain visible independt order of drawing */ if(v3d->zbuf) glDepthFunc(GL_ALWAYS); glEnable(GL_BLEND); @@ -750,10 +751,14 @@ void view3d_cached_text_draw_begin(void) CachedTextLevel++; } -void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs, short flag, const unsigned char col[4]) +void view3d_cached_text_draw_add(const float co[3], + const char *str, + short xoffs, short flag, + const unsigned char col[4]) { int alloc_len= strlen(str) + 1; ListBase *strings= &CachedText[CachedTextLevel-1]; + /* TODO, replace with more efficient malloc, perhaps memarena per draw? */ ViewCachedString *vos= MEM_callocN(sizeof(ViewCachedString) + alloc_len, "ViewCachedString"); BLI_addtail(strings, vos); @@ -815,7 +820,9 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa else glDepthMask(0); for(vos= strings->first; vos; vos= vos->next) { -#if 0 // too slow, reading opengl info while drawing is very bad, better to see if we can use the zbuffer while in pixel space - campbell + /* too slow, reading opengl info while drawing is very bad, + * better to see if we can use the zbuffer while in pixel space - campbell */ +#if 0 if(v3d->zbuf && (vos->flag & V3D_CACHE_TEXT_ZBUF)) { gluProject(vos->vec[0], vos->vec[1], vos->vec[2], mats.modelview, mats.projection, (GLint *)mats.viewport, &ux, &uy, &uz); glReadPixels(ar->winrct.xmin+vos->mval[0]+vos->xoffs, ar->winrct.ymin+vos->mval[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth); @@ -831,12 +838,14 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa glColor3ubv(vos->col.ub); col_pack_prev= vos->col.pack; } - if(vos->flag & V3D_CACHE_TEXT_ASCII) { - BLF_draw_default_ascii((float)vos->sco[0]+vos->xoffs, (float)vos->sco[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); - } - else { - BLF_draw_default((float)vos->sco[0]+vos->xoffs, (float)vos->sco[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); - } + ((vos->flag & V3D_CACHE_TEXT_ASCII) ? + BLF_draw_default_ascii : + BLF_draw_default + ) ( (float)vos->sco[0] + vos->xoffs, + (float)vos->sco[1], + (depth_write) ? 0.0f: 2.0f, + str, + vos->str_len); } } @@ -891,8 +900,12 @@ static void drawcube(void) static void drawcube_size(float size) { glBegin(GL_LINE_STRIP); - glVertex3f(-size,-size,-size); glVertex3f(-size,-size,size);glVertex3f(-size,size,size); glVertex3f(-size,size,-size); - glVertex3f(-size,-size,-size); glVertex3f(size,-size,-size);glVertex3f(size,-size,size); glVertex3f(size,size,size); + glVertex3f(-size,-size,-size); glVertex3f(-size,-size,size); + glVertex3f(-size,size,size); glVertex3f(-size,size,-size); + + glVertex3f(-size,-size,-size); glVertex3f(size,-size,-size); + glVertex3f(size,-size,size); glVertex3f(size,size,size); + glVertex3f(size,size,-size); glVertex3f(size,-size,-size); glEnd(); @@ -1717,7 +1730,8 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base } /* flag similar to draw_object() */ -static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D *UNUSED(rv3d), Object *UNUSED(ob), int UNUSED(flag)) +static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D *UNUSED(rv3d), + Object *UNUSED(ob), int UNUSED(flag)) { //Speaker *spk = ob->data; @@ -1900,13 +1914,15 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) * use the object matrix in the useual way */ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { - struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData; + struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); + void *userData; ViewContext vc; eV3DClipTest clipVerts; } *data = userData; + EditVert *eve = EM_get_vert_for_index(index); if (eve->h==0) { short s[2]= {IS_CLIPPED, 0}; - if (data->clipVerts) { + if (data->clipVerts != V3D_CLIP_TEST_OFF) { view3d_project_short_clip(data->vc.ar, co, s, 1); } else { view3d_project_short_noclip(data->vc.ar, co, s); @@ -1917,9 +1933,14 @@ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co } } -void mesh_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, EditVert *eve, int x, int y, int index), void *userData, int clipVerts) +void mesh_foreachScreenVert( + ViewContext *vc, + void (*func)(void *userData, EditVert *eve, int x, int y, int index), + void *userData, eV3DClipTest clipVerts) { - struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } data; + struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); + void *userData; ViewContext vc; eV3DClipTest clipVerts; } data; + DerivedMesh *dm = editmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH); data.vc= *vc; @@ -1927,7 +1948,7 @@ void mesh_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, EditVe data.userData = userData; data.clipVerts = clipVerts; - if(clipVerts) + if(clipVerts != V3D_CLIP_TEST_OFF) ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */ EM_init_index_arrays(vc->em, 1, 0, 0); @@ -1963,24 +1984,36 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert); glEnd(); } +static int is_co_in_region(ARegion *ar, const short co[2]) +{ + return ( (co[0] != IS_CLIPPED) && /* may be the only initialized value, check first */ + (co[0] >= 0) && + (co[0] < ar->winx) && + (co[1] >= 0) && + (co[1] < ar->winy)); +} static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co) { - struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData; + struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); + void *userData; ViewContext vc; eV3DClipTest clipVerts; } *data = userData; EditEdge *eed = EM_get_edge_for_index(index); short s[2][2]; if (eed->h==0) { - if (data->clipVerts==1) { + if (data->clipVerts == V3D_CLIP_TEST_RV3D_CLIPPING) { view3d_project_short_clip(data->vc.ar, v0co, s[0], 1); view3d_project_short_clip(data->vc.ar, v1co, s[1], 1); - } else { + } + else { view3d_project_short_noclip(data->vc.ar, v0co, s[0]); view3d_project_short_noclip(data->vc.ar, v1co, s[1]); - if (data->clipVerts==2) { - if (!(s[0][0]>=0 && s[0][1]>= 0 && s[0][0]<data->vc.ar->winx && s[0][1]<data->vc.ar->winy)) - if (!(s[1][0]>=0 && s[1][1]>= 0 && s[1][0]<data->vc.ar->winx && s[1][1]<data->vc.ar->winy)) - return; + if (data->clipVerts == V3D_CLIP_TEST_REGION) { + if ( !is_co_in_region(data->vc.ar, s[0]) && + !is_co_in_region(data->vc.ar, s[1])) + { + return; + } } } @@ -1988,9 +2021,13 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0 } } -void mesh_foreachScreenEdge(ViewContext *vc, void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts) +void mesh_foreachScreenEdge( + ViewContext *vc, + void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index), + void *userData, eV3DClipTest clipVerts) { - struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; ViewContext vc; int clipVerts; } data; + struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); + void *userData; ViewContext vc; eV3DClipTest clipVerts; } data; DerivedMesh *dm = editmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH); data.vc= *vc; @@ -1998,7 +2035,7 @@ void mesh_foreachScreenEdge(ViewContext *vc, void (*func)(void *userData, EditEd data.userData = userData; data.clipVerts = clipVerts; - if(clipVerts) + if(clipVerts != V3D_CLIP_TEST_OFF) ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */ EM_init_index_arrays(vc->em, 0, 1, 0); @@ -2023,7 +2060,10 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *ce } } -void mesh_foreachScreenFace(ViewContext *vc, void (*func)(void *userData, EditFace *efa, int x, int y, int index), void *userData) +void mesh_foreachScreenFace( + ViewContext *vc, + void (*func)(void *userData, EditFace *efa, int x, int y, int index), + void *userData) { struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; ViewContext vc; } data; DerivedMesh *dm = editmesh_get_derived_cage(vc->scene, vc->obedit, vc->em, CD_MASK_BAREMESH); @@ -2042,7 +2082,10 @@ void mesh_foreachScreenFace(ViewContext *vc, void (*func)(void *userData, EditFa dm->release(dm); } -void nurbs_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y), void *userData) +void nurbs_foreachScreenVert( + ViewContext *vc, + void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y), + void *userData) { Curve *cu= vc->obedit->data; short s[2] = {IS_CLIPPED, 0}; @@ -2317,7 +2360,7 @@ static void draw_dm_edges_freestyle(DerivedMesh *dm) * return 2 for the active face so it renders with stipple enabled */ static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r)) { - struct { unsigned char *cols[4]; EditFace *efa_act; } * data = userData; + struct { DerivedMesh *dm; unsigned char *cols[4]; EditFace *efa_act; } * data = userData; EditFace *efa = EM_get_face_for_index(index); unsigned char *col; @@ -2337,11 +2380,18 @@ static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNU static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int next_index) { - struct { unsigned char *cols[4]; EditFace *efa_act; } * data = userData; - EditFace *efa = EM_get_face_for_index(index); - EditFace *next_efa = EM_get_face_for_index(next_index); + struct { DerivedMesh *dm; unsigned char *cols[4]; EditFace *efa_act; } *data = userData; + int *orig_index= DM_get_face_data_layer(data->dm, CD_ORIGINDEX); + EditFace *efa; + EditFace *next_efa; unsigned char *col, *next_col; + if(!orig_index) + return 0; + + efa= EM_get_face_for_index(orig_index[index]); + next_efa= EM_get_face_for_index(orig_index[next_index]); + if(efa == next_efa) return 1; @@ -2360,14 +2410,15 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int /* also draws the active face */ static void draw_dm_faces_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol, unsigned char *markCol, unsigned char *actCol, EditFace *efa_act) { - struct { unsigned char *cols[4]; EditFace *efa_act; } data; + struct { DerivedMesh *dm; unsigned char *cols[4]; EditFace *efa_act; } data; + data.dm= dm; data.cols[0] = baseCol; data.cols[1] = selCol; data.cols[2] = markCol; data.cols[3] = actCol; data.efa_act = efa_act; - dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, &data, 0, GPU_enable_material, draw_dm_faces_sel__compareDrawOptions); + dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, GPU_enable_material, draw_dm_faces_sel__compareDrawOptions, &data, 0); } static int draw_dm_creases__setDrawOptions(void *UNUSED(userData), int index) @@ -2434,7 +2485,8 @@ static void draw_dm_bweights(Scene *scene, DerivedMesh *dm) /* EditMesh drawing routines*/ -static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, DerivedMesh *cageDM, EditVert *eve_act) +static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, + DerivedMesh *cageDM, EditVert *eve_act) { ToolSettings *ts= scene->toolsettings; int sel; @@ -2491,7 +2543,9 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, Deriv glPointSize(1.0); } -static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh *cageDM, short sel_only, EditEdge *eed_act) +static void draw_em_fancy_edges(Scene *scene, View3D *v3d, + Mesh *me, DerivedMesh *cageDM, short sel_only, + EditEdge *eed_act) { ToolSettings *ts= scene->toolsettings; int pass; @@ -2549,7 +2603,8 @@ static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh } } -static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, EditMesh *em, UnitSettings *unit) +static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, + Object *ob, EditMesh *em, UnitSettings *unit) { Mesh *me= ob->data; EditEdge *eed; @@ -2734,7 +2789,8 @@ static int draw_em_fancy__setGLSLFaceOpts(void *UNUSED(userData), int index) return (efa->h==0); } -static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, EditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, int dt) +static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, + Object *ob, EditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, int dt) { Mesh *me = ob->data; EditFace *efa_act = EM_get_actFace(em, 0); /* annoying but active faces is stored differently */ @@ -2759,11 +2815,11 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object if(CHECK_OB_DRAWTEXTURE(v3d, dt)) { if(draw_glsl_material(scene, ob, v3d, dt)) { glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - + finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material, - draw_em_fancy__setGLSLFaceOpts, NULL); + draw_em_fancy__setGLSLFaceOpts, em); GPU_disable_material(); - + glFrontFace(GL_CCW); } else { @@ -2771,14 +2827,14 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object } } else { - /* 3 floats for position, 3 for normal and times two because the faces may actually be quads instead of triangles */ + /* 3 floats for position, + * 3 for normal and times two because the faces may actually be quads instead of triangles */ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED); - + glEnable(GL_LIGHTING); glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - - finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material, NULL); - + finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, GPU_enable_material, NULL, NULL, 0); + glFrontFace(GL_CCW); glDisable(GL_LIGHTING); } @@ -2881,7 +2937,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object if(me->drawflag & ME_DRAWBWEIGHTS) { draw_dm_bweights(scene, cageDM); } - + draw_em_fancy_edges(scene, v3d, me, cageDM, 0, eed_act); } if(em) { @@ -2898,8 +2954,11 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object draw_dm_vert_normals(scene, cageDM); } - if(me->drawflag & (ME_DRAWEXTRA_EDGELEN|ME_DRAWEXTRA_FACEAREA|ME_DRAWEXTRA_FACEANG) && !((v3d->flag2 & V3D_RENDER_OVERRIDE))) + if ( (me->drawflag & (ME_DRAWEXTRA_EDGELEN|ME_DRAWEXTRA_FACEAREA|ME_DRAWEXTRA_FACEANG)) && + !(v3d->flag2 & V3D_RENDER_OVERRIDE)) + { draw_em_measure_stats(v3d, rv3d, ob, em, &scene->unit); + } } if(dt>OB_WIRE) { @@ -2953,7 +3012,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D int /* totvert,*/ totedge, totface; DerivedMesh *dm= mesh_get_derived_final(scene, ob, scene->customdata_mask); ModifierData *md = NULL; - int draw_flags = (ob==OBACT && paint_facesel_test(ob)) ? DRAW_FACE_SELECT : 0; + const short is_obact= (ob != NULL && ob == OBACT); + int draw_flags = (is_obact && paint_facesel_test(ob)) ? DRAW_FACE_SELECT : 0; if(!dm) return; @@ -3000,7 +3060,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D else if(dt==OB_WIRE || totface==0) { draw_wire= OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */ } - else if ( (draw_flags & DRAW_FACE_SELECT || (ob==OBACT && ob->mode & OB_MODE_TEXTURE_PAINT)) || + else if ( (draw_flags & DRAW_FACE_SELECT || (is_obact && ob->mode & OB_MODE_TEXTURE_PAINT)) || CHECK_OB_DRAWTEXTURE(v3d, dt)) { if ( (v3d->flag & V3D_SELECT_OUTLINE) && @@ -3028,7 +3088,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D if(!(draw_flags & DRAW_FACE_SELECT)) { if(base->flag & SELECT) - UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); + UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT); else UI_ThemeColor(TH_WIRE); @@ -3037,11 +3097,11 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } else if(dt==OB_SOLID) { - if(ob==OBACT && ob && ob->mode & OB_MODE_WEIGHT_PAINT) { + if(is_obact && ob->mode & OB_MODE_WEIGHT_PAINT) { /* weight paint in solid mode, special case. focus on making the weights clear * rather than the shading, this is also forced in wire view */ GPU_enable_material(0, NULL); - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me->mface, 1); bglPolygonOffset(rv3d->dist, 1.0); glDepthMask(0); // disable write in zbuffer, selected edge wires show better @@ -3093,7 +3153,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); - dm->drawMappedFaces(dm, NULL, NULL, 1, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, NULL, GPU_enable_material, NULL, NULL, 1); glDisable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); @@ -3141,7 +3201,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D glDisable(GL_LIGHTING); if(base->flag & SELECT) { - UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); + UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT); } else { UI_ThemeColor(TH_WIRE); } @@ -3150,7 +3210,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } else if(dt==OB_PAINT) { - if(ob==OBACT) { + if (is_obact) { if(ob && ob->mode & OB_MODE_WEIGHT_PAINT) { /* enforce default material settings */ GPU_enable_material(0, NULL); @@ -3165,7 +3225,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me->mface, 1); glDisable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); @@ -3173,10 +3233,10 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) { if(me->mcol) - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, NULL, 1); else { glColor3f(1.0f, 1.0f, 1.0f); - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, NULL, 0); } } } @@ -3185,12 +3245,12 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D /* set default draw color back for wire or for draw-extra later on */ if (dt!=OB_WIRE) { if(base->flag & SELECT) { - if(ob==OBACT && ob->flag & OB_FROMGROUP) + if (is_obact && ob->flag & OB_FROMGROUP) UI_ThemeColor(TH_GROUP_ACTIVE); else if(ob->flag & OB_FROMGROUP) UI_ThemeColorShade(TH_GROUP_ACTIVE, -16); else if(flag!=DRAW_CONSTCOLOR) - UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); + UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT); else glColor3ub(80,80,80); } else { @@ -3209,7 +3269,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D /* When using wireframe object traw in particle edit mode * the mesh gets in the way of seeing the particles, fade the wire color * with the background. */ - if(ob==OBACT && (ob->mode & OB_MODE_PARTICLE_EDIT)) { + if(is_obact && (ob->mode & OB_MODE_PARTICLE_EDIT)) { float col_wire[4], col_bg[4], col[3]; UI_GetThemeColor3fv(TH_BACK, col_bg); @@ -3241,7 +3301,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D } } - if(paint_vertsel_test(ob)) { + if(is_obact && paint_vertsel_test(ob)) { glColor3f(0.0f, 0.0f, 0.0f); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); @@ -3742,7 +3802,8 @@ static void draw_particle_arrays(int draw_as, int totpoint, int ob_dt, int selec break; } } -static void draw_particle(ParticleKey *state, int draw_as, short draw, float pixsize, float imat[4][4], float *draw_line, ParticleBillboardData *bb, ParticleDrawData *pdd) +static void draw_particle(ParticleKey *state, int draw_as, short draw, float pixsize, + float imat[4][4], float *draw_line, ParticleBillboardData *bb, ParticleDrawData *pdd) { float vec[3], vec2[3]; float *vd = NULL; @@ -3897,7 +3958,8 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix /* 5. start filling the arrays */ /* 6. draw the arrays */ /* 7. clean up */ -static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int ob_dt) +static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, + Base *base, ParticleSystem *psys, int ob_dt) { Object *ob=base->object; ParticleEditSettings *pset = PE_settings(scene); @@ -5819,9 +5881,8 @@ static void draw_bb_quadric(BoundBox *bb, char type) } else if(type==OB_BOUND_CONE) { float radius = size[0] > size[1] ? size[0] : size[1]; - glTranslatef(cent[0], cent[2]-size[2], cent[1]); - glScalef(radius, 2.0f * size[2], radius); - glRotatef(-90., 1.0, 0.0, 0.0); + glTranslatef(cent[0], cent[1], cent[2]-size[2]); + glScalef(radius, radius, 2.0f * size[2]); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); } glPopMatrix(); @@ -6065,7 +6126,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) { static int warning_recursive= 0; ModifierData *md = NULL; - Object *ob; + Object *ob= base->object; Curve *cu; RegionView3D *rv3d= ar->regiondata; float vec1[3], vec2[3]; @@ -6073,12 +6134,11 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) int /*sel, drawtype,*/ colindex= 0; int i, selstart, selend, empty_object=0; short dt, dtx, zbufoff= 0; + const short is_obact= (ob != NULL && ob == OBACT); /* only once set now, will be removed too, should become a global standard */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - ob= base->object; - if (ob!=scene->obedit) { if (ob->restrictflag & OB_RESTRICT_VIEW) return; @@ -6204,7 +6264,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) dtx= 0; /* faceselect exception: also draw solid when dt==wire, except in editmode */ - if(ob==OBACT && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { + if (is_obact && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { if(ob->type==OB_MESH) { if(ob->mode & OB_MODE_EDIT); @@ -6400,9 +6460,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } break; case OB_CAMERA: - if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */ - drawcamera(scene, v3d, rv3d, base, flag); + if ( (v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || + (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */ + { + drawcamera(scene, v3d, rv3d, base, flag); break; + } case OB_SPEAKER: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) drawspeaker(scene, v3d, rv3d, ob, flag); @@ -6466,7 +6529,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) for(psys=ob->particlesystem.first; psys; psys=psys->next) { /* run this so that possible child particles get cached */ - if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) { + if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) { PTCacheEdit *edit = PE_create_current(scene, ob); if(edit && edit->psys == psys) draw_update_ptcache_edit(scene, ob, edit); @@ -6484,12 +6547,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* draw edit particles last so that they can draw over child particles */ - if( (warning_recursive==0) && - (flag & DRAW_PICKING)==0 && - (!scene->obedit) - ) { + if ( (warning_recursive==0) && + (flag & DRAW_PICKING)==0 && + (!scene->obedit)) + { - if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) { + if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) { PTCacheEdit *edit = PE_create_current(scene, ob); if(edit) { glLoadMatrixf(rv3d->viewmat); @@ -6549,7 +6612,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) // #if 0 smd->domain->tex = NULL; GPU_create_smoke(smd, 0); - draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow); + draw_volume(ar, smd->domain->tex, + smd->domain->p0, smd->domain->p1, + smd->domain->res, smd->domain->dx, + smd->domain->tex_shadow); GPU_free_smoke(smd); // #endif #if 0 @@ -6600,7 +6666,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) { smd->domain->tex = NULL; GPU_create_smoke(smd, 1); - draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow); + draw_volume(ar, smd->domain->tex, + smd->domain->p0, smd->domain->p1, + smd->domain->res_wt, smd->domain->dx_wt, + smd->domain->tex_shadow); GPU_free_smoke(smd); } } @@ -6681,7 +6750,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(v3d->flag2 & V3D_RENDER_OVERRIDE) return; /* object centers, need to be drawn in viewmat space for speed, but OK for picking select */ - if(ob!=OBACT || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { + if (!is_obact || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { int do_draw_center= -1; /* defines below are zero or positive... */ if(v3d->flag2 & V3D_RENDER_OVERRIDE) { @@ -6864,12 +6933,13 @@ static void bbs_mesh_solid__drawCenter(void *UNUSED(userData), int index, float } /* two options, facecolors or black */ -static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh *dm, int facecol) +static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, + Object *ob, DerivedMesh *dm, int facecol) { cpack(0); if (facecol) { - dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, 0, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, GPU_enable_material, NULL, (void*)(intptr_t) 1, 0); if(check_ob_drawface_dot(scene, v3d, ob->dt)) { glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE)); @@ -6880,7 +6950,7 @@ static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh } } else { - dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*) 0, 0, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, GPU_enable_material, NULL, (void*) 0, 0); } } @@ -6919,9 +6989,11 @@ static void bbs_mesh_solid(Scene *scene, Object *ob) Mesh *me = (Mesh*)ob->data; glColor3ub(0, 0, 0); - - if((me->editflag & ME_EDIT_PAINT_MASK)) dm->drawMappedFaces(dm, bbs_mesh_solid_hide__setDrawOpts, me, 0, GPU_enable_material, NULL); - else dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, me, 0, GPU_enable_material, NULL); + + if((me->editflag & ME_EDIT_PAINT_MASK)) + dm->drawMappedFaces(dm, bbs_mesh_solid_hide__setDrawOpts, GPU_enable_material, NULL, me, 0); + else + dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, GPU_enable_material, NULL, me, 0); dm->release(dm); } @@ -6979,7 +7051,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask); glColor3ub(0, 0, 0); - dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, me, 0, GPU_enable_material, NULL); + dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, GPU_enable_material, NULL, me, 0); bbs_obmode_mesh_verts(ob, dm, 1); @@ -7045,7 +7117,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r GPU_end_object_materials(); } else if(edm) - edm->drawMappedFaces(edm, NULL, NULL, 0, GPU_enable_material, NULL); + edm->drawMappedFaces(edm, NULL, GPU_enable_material, NULL, NULL, 0); glDisable(GL_LIGHTING); } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 5dfb9cfb5b6..3f979787a1f 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1506,6 +1506,10 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) (bgpic->view & (1<<rv3d->view)) || /* check agaist flags */ (rv3d->persp==RV3D_CAMOB && bgpic->view == (1<<RV3D_VIEW_CAMERA)) ) { + /* disable individual images */ + if((bgpic->flag&V3D_BGPIC_DISABLED)) + continue; + freeibuf= NULL; if(bgpic->source==V3D_BGPIC_IMAGE) { ima= bgpic->ima; @@ -2643,28 +2647,10 @@ static int view3d_main_area_draw_engine(const bContext *C, ARegion *ar) static void view3d_main_area_draw_engine_info(RegionView3D *rv3d, ARegion *ar) { - rcti rect; - const int header_height = 18; - if(!rv3d->render_engine || !rv3d->render_engine->text) return; - - /* background box */ - rect= ar->winrct; - rect.xmin= 0; - rect.ymin= ar->winrct.ymax - ar->winrct.ymin - header_height; - rect.xmax= ar->winrct.xmax - ar->winrct.xmin; - rect.ymax= ar->winrct.ymax - ar->winrct.ymin; - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glColor4f(0.0f, 0.0f, 0.0f, 0.25f); - glRecti(rect.xmin, rect.ymin, rect.xmax+1, rect.ymax+1); - glDisable(GL_BLEND); - - /* text */ - UI_ThemeColor(TH_TEXT_HI); - UI_DrawString(12, rect.ymin + 5, rv3d->render_engine->text); + ED_region_info_draw(ar, rv3d->render_engine->text, 1, 0.25); } /* warning: this function has duplicate drawing in ED_view3d_draw_offscreen() */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index b9513ab0880..0c9ea3c6a2a 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -283,16 +283,16 @@ static char *view3d_modeselect_pup(Scene *scene) BLI_strncpy(str, title, sizeof(string)); str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA); - + if(ob==NULL || ob->data==NULL) return string; if(ob->id.lib) return string; - + if(!((ID *)ob->data)->lib) { /* if active object is editable */ if ( ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) { - + str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT); } else if (ob->type == OB_ARMATURE) { @@ -310,7 +310,7 @@ static char *view3d_modeselect_pup(Scene *scene) str += modeselect_addmode(str, N_("Weight Paint"), OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT); } } - + /* if active object is an armature */ if (ob->type==OB_ARMATURE) { str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT); @@ -485,10 +485,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockSetEmboss(block, UI_EMBOSS); /* mode */ - if(ob) + if(ob) { v3d->modeselect = ob->mode; - else + } + else { v3d->modeselect = OB_MODE_OBJECT; + } row= uiLayoutRow(layout, 1); uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 0163c29c9aa..33f7acf2a37 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -521,17 +521,17 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, EM_backbuf_checkAndSelectVerts(vc->em, select); } else { - mesh_foreachScreenVert(vc, do_lasso_select_mesh__doSelectVert, &data, 1); + mesh_foreachScreenVert(vc, do_lasso_select_mesh__doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING); } } if(ts->selectmode & SCE_SELECT_EDGE) { /* Does both bbsel and non-bbsel versions (need screen cos for both) */ data.pass = 0; - mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, 0); + mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF); if (data.done==0) { data.pass = 1; - mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, 0); + mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF); } } @@ -1644,18 +1644,18 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten if (bbsel) { EM_backbuf_checkAndSelectVerts(vc->em, select); } else { - mesh_foreachScreenVert(vc, do_mesh_box_select__doSelectVert, &data, 1); + mesh_foreachScreenVert(vc, do_mesh_box_select__doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING); } } if(ts->selectmode & SCE_SELECT_EDGE) { /* Does both bbsel and non-bbsel versions (need screen cos for both) */ data.pass = 0; - mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, 0); + mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF); if (data.done==0) { data.pass = 1; - mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, 0); + mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF); } } @@ -2170,7 +2170,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f if(bbsel) { EM_backbuf_checkAndSelectVerts(vc->em, select==LEFTMOUSE); } else { - mesh_foreachScreenVert(vc, mesh_circle_doSelectVert, &data, 1); + mesh_foreachScreenVert(vc, mesh_circle_doSelectVert, &data, V3D_CLIP_TEST_RV3D_CLIPPING); } } @@ -2178,7 +2178,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f if (bbsel) { EM_backbuf_checkAndSelectEdges(vc->em, select==LEFTMOUSE); } else { - mesh_foreachScreenEdge(vc, mesh_circle_doSelectEdge, &data, 0); + mesh_foreachScreenEdge(vc, mesh_circle_doSelectEdge, &data, V3D_CLIP_TEST_OFF); } } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 8b8ae95631c..fcc285d52f0 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -130,7 +130,7 @@ typedef struct TransDataExtension { // float drotAngle; /* Initial object drotAngle, TODO: not yet implimented */ // float drotAxis[3]; /* Initial object drotAxis, TODO: not yet implimented */ float dquat[4]; /* Initial object dquat */ - float dsize[3]; /* Initial object dsize */ + float dscale[3]; /* Initial object dscale */ float *rot; /* Rotation of the data to transform (Faculative) */ float irot[3]; /* Initial rotation */ float *quat; /* Rotation quaternion of the data to transform (Faculative) */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index e19c115b194..5527ab0d331 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4314,7 +4314,7 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) td->ext->size = ob->size; copy_v3_v3(td->ext->isize, ob->size); - copy_v3_v3(td->ext->dsize, ob->dsize); + copy_v3_v3(td->ext->dscale, ob->dscale); copy_v3_v3(td->center, ob->obmat[3]); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 72f10a532d7..d0857958a4b 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1552,7 +1552,7 @@ void calculateCenter(TransInfo *t) if(t->obedit->type == OB_MESH) { EditSelection ese; EditMesh *em = BKE_mesh_get_editmesh(t->obedit->data); - + if (EM_get_actSelection(em, &ese)) { EM_editselection_center(t->center, &ese); calculateCenter2D(t); @@ -1570,7 +1570,7 @@ void calculateCenter(TransInfo *t) } } } /* END EDIT MODE ACTIVE ELEMENT */ - + calculateCenterMedian(t); if((t->flag & (T_EDIT|T_POSE))==0) { diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 3de68a6e312..a4f03e76fd1 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -189,16 +189,16 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { - float length; - float distance; + double length; + double distance; + double dx, dy; int *data = mi->data; - int dx, dy; if (data) { dx = data[2] - data[0]; dy = data[3] - data[1]; - length = (float)sqrtf(dx*dx + dy*dy); + length = sqrt(dx*dx + dy*dy); if (mi->precision) { /* deal with Shift key by adding motion / 10 to motion before shift press */ @@ -216,7 +216,7 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mva distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f; } - output[0] = (length != 0.0f)? distance / length: 0.0f; + output[0] = (float)((length != 0.0f)? distance / length: 0.0f); } } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 527537b5efb..f0055bd6008 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -125,6 +125,12 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) Object *obact= CTX_data_active_object(C); ScrArea *sa= CTX_wm_area(C); + /* undo during jobs are running can easily lead to freeing data using by jobs, + or they can just lead to freezing job in some other cases */ + if(WM_jobs_has_running(CTX_wm_manager(C))) { + return OPERATOR_CANCELLED; + } + /* grease pencil can be can be used in plenty of spaces, so check it first */ if(ED_gpencil_session_active()) { return ED_undo_gpencil_step(C, step, undoname); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c565e2fc305..830dc224c94 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1342,16 +1342,9 @@ static int cube_project_exec(bContext *C, wmOperator *op) if(efa->f & SELECT) { tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); normal_tri_v3( no,efa->v1->co, efa->v2->co, efa->v3->co); - - no[0]= fabs(no[0]); - no[1]= fabs(no[1]); - no[2]= fabs(no[2]); - - cox=0; coy= 1; - if(no[2]>=no[0] && no[2]>=no[1]); - else if(no[1]>=no[0] && no[1]>=no[2]) coy= 2; - else { cox= 1; coy= 2; } - + + axis_dominant_v3(&cox, &coy, no); + tf->uv[0][0]= 0.5f+0.5f*cube_size*(loc[cox] + efa->v1->co[cox]); tf->uv[0][1]= 0.5f+0.5f*cube_size*(loc[coy] + efa->v1->co[coy]); dx = floor(tf->uv[0][0]); diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h index 5e0eff69047..9e551f637de 100644 --- a/source/blender/gpu/GPU_buffers.h +++ b/source/blender/gpu/GPU_buffers.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 5813fe21265..dc1f80ca903 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -1,21 +1,18 @@ /* * ***** BEGIN GPL LICENSE BLOCK ***** * - * This shader is free software; you can redistribute it and/or + * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This shader is distributed in the hope that it will be useful, + * 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 shader; if not, write to the Free Software Foundation, + * 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) 2005 Blender Foundation. diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 3fff79390e3..d827fda0844 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -1,21 +1,18 @@ /* * ***** BEGIN GPL LICENSE BLOCK ***** * - * This shader is free software; you can redistribute it and/or + * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This shader is distributed in the hope that it will be useful, + * 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 shader; if not, write to the Free Software Foundation, + * 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) 2005 Blender Foundation. diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index e838d801dc1..418bea5fe9c 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -1,21 +1,18 @@ /* * ***** BEGIN GPL LICENSE BLOCK ***** * - * This shader is free software; you can redistribute it and/or + * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This shader is distributed in the hope that it will be useful, + * 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 shader; if not, write to the Free Software Foundation, + * 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) 2005 Blender Foundation. diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 8d72bd64e29..bba8786b092 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 4a923e66356..185f9eb185e 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index 06378b088de..f52b5bb627e 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 05b980cd88c..afd22fb70a0 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 184eac9519e..79db125c21f 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl b/source/blender/gpu/intern/gpu_shader_material.glsl index 5d2da31ac5f..4e5ee71431a 100644 --- a/source/blender/gpu/intern/gpu_shader_material.glsl +++ b/source/blender/gpu/intern/gpu_shader_material.glsl @@ -2127,6 +2127,7 @@ void node_light_path( out float is_shadow_ray, out float is_diffuse_ray, out float is_glossy_ray, + out float is_singular_ray, out float is_reflection_ray, out float is_transmission_ray) { @@ -2134,6 +2135,7 @@ void node_light_path( is_shadow_ray = 0.0; is_diffuse_ray = 0.0; is_glossy_ray = 0.0; + is_singular_ray = 0.0; is_reflection_ray = 0.0; is_transmission_ray = 0.0; } diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl.c b/source/blender/gpu/intern/gpu_shader_material.glsl.c index 0b7bd5d48bf..1d7e5f94d5f 100644 --- a/source/blender/gpu/intern/gpu_shader_material.glsl.c +++ b/source/blender/gpu/intern/gpu_shader_material.glsl.c @@ -1,1466 +1,1468 @@ /* DataToC output of file <gpu_shader_material_glsl> */ -int datatoc_gpu_shader_material_glsl_size= 46865; +int datatoc_gpu_shader_material_glsl_size= 46917; char datatoc_gpu_shader_material_glsl[]= { - 10,102,108,111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101, -114, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10, 9,114,101,116,117,114,110, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, - 49, 56, 50, 56, 52, 54, 44, 32,102, 41, 59, 10,125, 10, 10,118,111,105,100, 32,114,103, 98, 95,116,111, 95,104,115,118, 40,118, -101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,108,111, - 97,116, 32, 99,109, 97,120, 44, 32, 99,109,105,110, 44, 32,104, 44, 32,115, 44, 32,118, 44, 32, 99,100,101,108,116, 97, 59, 10, - 9,118,101, 99, 51, 32, 99, 59, 10, 10, 9, 99,109, 97,120, 32, 61, 32,109, 97,120, 40,114,103, 98, 91, 48, 93, 44, 32,109, 97, -120, 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98, 91, 50, 93, 41, 41, 59, 10, 9, 99,109,105,110, 32, 61, 32,109,105,110, 40, -114,103, 98, 91, 48, 93, 44, 32,109,105,110, 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98, 91, 50, 93, 41, 41, 59, 10, 9, 99, -100,101,108,116, 97, 32, 61, 32, 99,109, 97,120, 45, 99,109,105,110, 59, 10, 10, 9,118, 32, 61, 32, 99,109, 97,120, 59, 10, 9, -105,102, 32, 40, 99,109, 97,120, 33, 61, 48, 46, 48, 41, 10, 9, 9,115, 32, 61, 32, 99,100,101,108,116, 97, 47, 99,109, 97,120, - 59, 10, 9,101,108,115,101, 32,123, 10, 9, 9,115, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, - 9,125, 10, 10, 9,105,102, 32, 40,115, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, - 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9, 99, 32, 61, 32, 40,118,101, 99, 51, 40, 99,109, 97,120, 44, 32, 99,109, 97, -120, 44, 32, 99,109, 97,120, 41, 32, 45, 32,114,103, 98, 46,120,121,122, 41, 47, 99,100,101,108,116, 97, 59, 10, 10, 9, 9,105, -102, 32, 40,114,103, 98, 46,120, 61, 61, 99,109, 97,120, 41, 32,104, 32, 61, 32, 99, 91, 50, 93, 32, 45, 32, 99, 91, 49, 93, 59, - 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,114,103, 98, 46,121, 61, 61, 99,109, 97,120, 41, 32,104, 32, 61, 32, 50, 46, 48, - 32, 43, 32, 99, 91, 48, 93, 32, 45, 32, 32, 99, 91, 50, 93, 59, 10, 9, 9,101,108,115,101, 32,104, 32, 61, 32, 52, 46, 48, 32, - 43, 32, 99, 91, 49, 93, 32, 45, 32, 99, 91, 48, 93, 59, 10, 10, 9, 9,104, 32, 47, 61, 32, 54, 46, 48, 59, 10, 10, 9, 9,105, -102, 32, 40,104, 60, 48, 46, 48, 41, 10, 9, 9, 9,104, 32, 43, 61, 32, 49, 46, 48, 59, 10, 9,125, 10, 10, 9,111,117,116, 99, -111,108, 32, 61, 32,118,101, 99, 52, 40,104, 44, 32,115, 44, 32,118, 44, 32,114,103, 98, 46,119, 41, 59, 10,125, 10, 10,118,111, -105,100, 32,104,115,118, 95,116,111, 95,114,103, 98, 40,118,101, 99, 52, 32,104,115,118, 44, 32,111,117,116, 32,118,101, 99, 52, - 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,105, 44, 32,102, 44, 32,112, 44, 32,113, 44, 32,116, 44, - 32,104, 44, 32,115, 44, 32,118, 59, 10, 9,118,101, 99, 51, 32,114,103, 98, 59, 10, 10, 9,104, 32, 61, 32,104,115,118, 91, 48, - 93, 59, 10, 9,115, 32, 61, 32,104,115,118, 91, 49, 93, 59, 10, 9,118, 32, 61, 32,104,115,118, 91, 50, 93, 59, 10, 10, 9,105, -102, 40,115, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,118, 44, 32,118, - 41, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,104, 61, 61, 49, 46, 48, 41, 10, 9, 9, 9,104, 32, - 61, 32, 48, 46, 48, 59, 10, 9, 9, 10, 9, 9,104, 32, 42, 61, 32, 54, 46, 48, 59, 10, 9, 9,105, 32, 61, 32,102,108,111,111, -114, 40,104, 41, 59, 10, 9, 9,102, 32, 61, 32,104, 32, 45, 32,105, 59, 10, 9, 9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40, -102, 44, 32,102, 44, 32,102, 41, 59, 10, 9, 9,112, 32, 61, 32,118, 42, 40, 49, 46, 48, 45,115, 41, 59, 10, 9, 9,113, 32, 61, - 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42,102, 41, 41, 59, 10, 9, 9,116, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42, - 40, 49, 46, 48, 45,102, 41, 41, 41, 59, 10, 9, 9, 10, 9, 9,105,102, 32, 40,105, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,103, - 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,116, 44, 32,112, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, - 61, 61, 32, 49, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,113, 44, 32,118, 44, 32,112, 41, 59, 10, 9, 9,101, -108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 50, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32, -118, 44, 32,116, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 51, 46, 48, 41, 32,114,103, 98, 32, - 61, 32,118,101, 99, 51, 40,112, 44, 32,113, 44, 32,118, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, - 32, 52, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,116, 44, 32,112, 44, 32,118, 41, 59, 10, 9, 9,101,108,115, -101, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,112, 44, 32,113, 41, 59, 10, 9,125, 10, 10, 9,111,117,116, 99, -111,108, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 44, 32,104,115,118, 46,119, 41, 59, 10,125, 10, 10,102,108,111, 97,116, 32, -115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40,102,108,111, 97,116, 32, 99, 41, 10,123, 10, 9,105,102, - 40, 99, 32, 60, 32, 48, 46, 48, 52, 48, 52, 53, 41, 10, 9, 9,114,101,116,117,114,110, 32, 40, 99, 32, 60, 32, 48, 46, 48, 41, - 63, 32, 48, 46, 48, 58, 32, 99, 32, 42, 32, 40, 49, 46, 48, 47, 49, 50, 46, 57, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9, -114,101,116,117,114,110, 32,112,111,119, 40, 40, 99, 32, 43, 32, 48, 46, 48, 53, 53, 41, 42, 40, 49, 46, 48, 47, 49, 46, 48, 53, - 53, 41, 44, 32, 50, 46, 52, 41, 59, 10,125, 10, 10,102,108,111, 97,116, 32,108,105,110,101, 97,114,114,103, 98, 95,116,111, 95, -115,114,103, 98, 40,102,108,111, 97,116, 32, 99, 41, 10,123, 10, 9,105,102, 40, 99, 32, 60, 32, 48, 46, 48, 48, 51, 49, 51, 48, - 56, 41, 10, 9, 9,114,101,116,117,114,110, 32, 40, 99, 32, 60, 32, 48, 46, 48, 41, 63, 32, 48, 46, 48, 58, 32, 99, 32, 42, 32, - 49, 50, 46, 57, 50, 59, 10, 9,101,108,115,101, 10, 9, 9,114,101,116,117,114,110, 32, 49, 46, 48, 53, 53, 32, 42, 32,112,111, -119, 40, 99, 44, 32, 49, 46, 48, 47, 50, 46, 52, 41, 32, 45, 32, 48, 46, 48, 53, 53, 59, 10,125, 10, 10,118,111,105,100, 32,115, -114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 95,102,114,111,109, 44, 32, -111,117,116, 32,118,101, 99, 52, 32, 99,111,108, 95,116,111, 41, 10,123, 10, 9, 99,111,108, 95,116,111, 46,114, 32, 61, 32,115, -114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46,114, 41, 59, 10, 9, 99, -111,108, 95,116,111, 46,103, 32, 61, 32,115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40, 99,111,108, 95, -102,114,111,109, 46,103, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 98, 32, 61, 32,115,114,103, 98, 95,116,111, 95,108,105,110, -101, 97,114,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46, 98, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 97, 32, 61, 32, - 99,111,108, 95,102,114,111,109, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,108,105,110,101, 97,114,114,103, 98, 95,116,111, - 95,115,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 95,102,114,111,109, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111, -108, 95,116,111, 41, 10,123, 10, 9, 99,111,108, 95,116,111, 46,114, 32, 61, 32,108,105,110,101, 97,114,114,103, 98, 95,116,111, - 95,115,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46,114, 41, 59, 10, 9, 99,111,108, 95,116,111, 46,103, 32, 61, 32,108, -105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46,103, 41, 59, 10, 9, 99, -111,108, 95,116,111, 46, 98, 32, 61, 32,108,105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40, 99,111,108, 95, -102,114,111,109, 46, 98, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 97, 32, 61, 32, 99,111,108, 95,102,114,111,109, 46, 97, 59, - 10,125, 10, 10, 35,100,101,102,105,110,101, 32, 77, 95, 80, 73, 32, 51, 46, 49, 52, 49, 53, 57, 50, 54, 53, 51, 53, 56, 57, 55, - 57, 51, 50, 51, 56, 52, 54, 10, 35,100,101,102,105,110,101, 32, 77, 95, 49, 95, 80, 73, 32, 48, 46, 51, 49, 56, 51, 48, 57, 56, - 56, 54, 49, 56, 51, 55, 57, 48, 54, 57, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 83, 72, 65, 68, 69, 82, 32, - 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,118, 99,111, -108, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 52, 32, 97,116,116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, - 99, 52, 32,118, 99,111,108, 41, 10,123, 10, 9,118, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 97,116,116,118, 99,111,108, 46, -120, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111,108, 46,121, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111, -108, 46,122, 47, 50, 53, 53, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,117,118, 95, 97,116,116,114, -105, 98,117,116,101, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, - 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,118,101, 99, 50, 40, 49, 46, 48, - 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,103,101,111,109, 40,118,101, 99, 51, 32, - 99,111, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,118, -101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,118,101, 99, 52, 32, 97,116, -116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, - 32,108,111, 99, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99, 51, 32, -111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, - 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 99,111, -108, 95, 97,108,112,104, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102,114,111,110,116, 98, 97, 99,107, 41, 10,123, 10, - 9,108,111, 99, 97,108, 32, 61, 32, 99,111, 59, 10, 9,118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, -111, 99, 97,108, 41, 59, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, - 52, 40,108,111, 99, 97,108, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111, -114, 99,111, 59, 10, 9,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,117,118, 44, 32,117,118, 41, 59, 10, 9, -110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,110,111,114, 41, 59, 9, 47, 42, 32, 98,108,101, -110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, - 10, 9,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116,118, 99,111,108, 44, 32,118, 99,111,108, 41, 59, - 10, 9,118, 99,111,108, 95, 97,108,112,104, 97, 32, 61, 32, 97,116,116,118, 99,111,108, 46, 97, 59, 10, 9,102,114,111,110,116, - 98, 97, 99,107, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,112,112,105,110,103, 40,118,101, 99, 51, - 32,118,101, 99, 44, 32,109, 97,116, 52, 32,109, 97,116, 44, 32,118,101, 99, 51, 32,109,105,110,118,101, 99, 44, 32,118,101, 99, - 51, 32,109, 97,120,118,101, 99, 44, 32,102,108,111, 97,116, 32,100,111,109,105,110, 44, 32,102,108,111, 97,116, 32,100,111,109, - 97,120, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, - 32, 40,109, 97,116, 32, 42, 32,118,101, 99, 52, 40,118,101, 99, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,105,102, - 40,100,111,109,105,110, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109, 97,120, 40,111,117, -116,118,101, 99, 44, 32,109,105,110,118,101, 99, 41, 59, 10, 9,105,102, 40,100,111,109, 97,120, 32, 61, 61, 32, 49, 46, 48, 41, - 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109,105,110, 40,111,117,116,118,101, 99, 44, 32,109, 97,120,118,101, 99, 41, 59, - 10,125, 10, 10,118,111,105,100, 32, 99, 97,109,101,114, 97, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, - 51, 32,111,117,116,118,105,101,119, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,101,112,116,104, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,111,117,116,100,105,115,116, 41, 10,123, 10, 9,111,117,116,100,101,112,116,104, 32, 61, 32, - 97, 98,115, 40, 99,111, 46,122, 41, 59, 10, 9,111,117,116,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40, 99,111, 41, - 59, 10, 9,111,117,116,118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 59, 10,125, 10, 10,118, -111,105,100, 32,109, 97,116,104, 95, 97,100,100, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, - 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, - 32, 61, 32,118, 97,108, 49, 32, 43, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,117, 98, -116,114, 97, 99,116, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117, -116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, - 32, 45, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,117,108,116,105,112,108,121, 40,102, -108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, - 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 42, 32,118, 97,108, 50, - 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,100,105,118,105,100,101, 40,102,108,111, 97,116, 32,118, 97,108, 49, - 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10, -123, 10, 9,105,102, 32, 40,118, 97,108, 50, 32, 61, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, - 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 47, 32,118, 97,108, 50, - 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,115,105,110, - 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 99,111,115,105,110,101, 40,102,108,111, 97,116, - 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97, -108, 32, 61, 32, 99,111,115, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,116, 97,110,103,101, -110,116, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10, -123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97, -116,104, 95, 97,115,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, -118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, - 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97,115,105,110, 40,118, 97,108, 41, 59, 10, 9,101,108, -115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, - 97, 99,111,115, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, - 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, - 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97, 99,111,115, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, - 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,116, 97, -110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, - 10, 9,111,117,116,118, 97,108, 32, 61, 32, 97,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97, -116,104, 95,112,111,119, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 49, 32, 62, 61, 32, - 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,112,111,119, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, - 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, - 97,116,104, 95,108,111,103, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32, -111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32, 48, - 46, 48, 32, 32, 38, 38, 32,118, 97,108, 50, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 61, 32,108,111,103, - 50, 40,118, 97,108, 49, 41, 32, 47, 32,108,111,103, 50, 40,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117, -116,118, 97,108, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109, 97,120, 40,102,108,111, 97, -116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117, -116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, - 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32, + 10,102,108,111, 97, +116, 32,101,120,112, 95, 98,108,101,110,100,101,114, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10, 9,114,101,116,117,114,110, + 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 50, 56, 52, 54, 44, 32,102, 41, 59, 10,125, 10, 10,118,111,105,100, 32, +114,103, 98, 95,116,111, 95,104,115,118, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117, +116, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, 99,109, 97,120, 44, 32, 99,109,105,110, 44, 32,104, 44, 32,115, 44, + 32,118, 44, 32, 99,100,101,108,116, 97, 59, 10, 9,118,101, 99, 51, 32, 99, 59, 10, 10, 9, 99,109, 97,120, 32, 61, 32,109, 97, +120, 40,114,103, 98, 91, 48, 93, 44, 32,109, 97,120, 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98, 91, 50, 93, 41, 41, 59, 10, + 9, 99,109,105,110, 32, 61, 32,109,105,110, 40,114,103, 98, 91, 48, 93, 44, 32,109,105,110, 40,114,103, 98, 91, 49, 93, 44, 32, +114,103, 98, 91, 50, 93, 41, 41, 59, 10, 9, 99,100,101,108,116, 97, 32, 61, 32, 99,109, 97,120, 45, 99,109,105,110, 59, 10, 10, + 9,118, 32, 61, 32, 99,109, 97,120, 59, 10, 9,105,102, 32, 40, 99,109, 97,120, 33, 61, 48, 46, 48, 41, 10, 9, 9,115, 32, 61, + 32, 99,100,101,108,116, 97, 47, 99,109, 97,120, 59, 10, 9,101,108,115,101, 32,123, 10, 9, 9,115, 32, 61, 32, 48, 46, 48, 59, + 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 10, 9,105,102, 32, 40,115, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, + 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9, 99, 32, 61, 32, 40,118,101, + 99, 51, 40, 99,109, 97,120, 44, 32, 99,109, 97,120, 44, 32, 99,109, 97,120, 41, 32, 45, 32,114,103, 98, 46,120,121,122, 41, 47, + 99,100,101,108,116, 97, 59, 10, 10, 9, 9,105,102, 32, 40,114,103, 98, 46,120, 61, 61, 99,109, 97,120, 41, 32,104, 32, 61, 32, + 99, 91, 50, 93, 32, 45, 32, 99, 91, 49, 93, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,114,103, 98, 46,121, 61, 61, 99, +109, 97,120, 41, 32,104, 32, 61, 32, 50, 46, 48, 32, 43, 32, 99, 91, 48, 93, 32, 45, 32, 32, 99, 91, 50, 93, 59, 10, 9, 9,101, +108,115,101, 32,104, 32, 61, 32, 52, 46, 48, 32, 43, 32, 99, 91, 49, 93, 32, 45, 32, 99, 91, 48, 93, 59, 10, 10, 9, 9,104, 32, + 47, 61, 32, 54, 46, 48, 59, 10, 10, 9, 9,105,102, 32, 40,104, 60, 48, 46, 48, 41, 10, 9, 9, 9,104, 32, 43, 61, 32, 49, 46, + 48, 59, 10, 9,125, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,104, 44, 32,115, 44, 32,118, 44, 32,114, +103, 98, 46,119, 41, 59, 10,125, 10, 10,118,111,105,100, 32,104,115,118, 95,116,111, 95,114,103, 98, 40,118,101, 99, 52, 32,104, +115,118, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,105, 44, + 32,102, 44, 32,112, 44, 32,113, 44, 32,116, 44, 32,104, 44, 32,115, 44, 32,118, 59, 10, 9,118,101, 99, 51, 32,114,103, 98, 59, + 10, 10, 9,104, 32, 61, 32,104,115,118, 91, 48, 93, 59, 10, 9,115, 32, 61, 32,104,115,118, 91, 49, 93, 59, 10, 9,118, 32, 61, + 32,104,115,118, 91, 50, 93, 59, 10, 10, 9,105,102, 40,115, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 32, 61, 32, +118,101, 99, 51, 40,118, 44, 32,118, 44, 32,118, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,104, + 61, 61, 49, 46, 48, 41, 10, 9, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 10, 9, 9,104, 32, 42, 61, 32, 54, 46, 48, + 59, 10, 9, 9,105, 32, 61, 32,102,108,111,111,114, 40,104, 41, 59, 10, 9, 9,102, 32, 61, 32,104, 32, 45, 32,105, 59, 10, 9, + 9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,102, 44, 32,102, 44, 32,102, 41, 59, 10, 9, 9,112, 32, 61, 32,118, 42, 40, 49, + 46, 48, 45,115, 41, 59, 10, 9, 9,113, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42,102, 41, 41, 59, 10, 9, 9,116, 32, + 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42, 40, 49, 46, 48, 45,102, 41, 41, 41, 59, 10, 9, 9, 10, 9, 9,105,102, 32, 40, +105, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,116, 44, 32,112, 41, 59, 10, 9, + 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 49, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,113, + 44, 32,118, 44, 32,112, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 50, 46, 48, 41, 32,114,103, + 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,118, 44, 32,116, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, + 61, 61, 32, 51, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,113, 44, 32,118, 41, 59, 10, 9, 9,101, +108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 52, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,116, 44, 32, +112, 44, 32,118, 41, 59, 10, 9, 9,101,108,115,101, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,112, 44, 32,113, + 41, 59, 10, 9,125, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 44, 32,104,115,118, 46,119, + 41, 59, 10,125, 10, 10,102,108,111, 97,116, 32,115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40,102,108, +111, 97,116, 32, 99, 41, 10,123, 10, 9,105,102, 40, 99, 32, 60, 32, 48, 46, 48, 52, 48, 52, 53, 41, 10, 9, 9,114,101,116,117, +114,110, 32, 40, 99, 32, 60, 32, 48, 46, 48, 41, 63, 32, 48, 46, 48, 58, 32, 99, 32, 42, 32, 40, 49, 46, 48, 47, 49, 50, 46, 57, + 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,114,101,116,117,114,110, 32,112,111,119, 40, 40, 99, 32, 43, 32, 48, 46, 48, 53, + 53, 41, 42, 40, 49, 46, 48, 47, 49, 46, 48, 53, 53, 41, 44, 32, 50, 46, 52, 41, 59, 10,125, 10, 10,102,108,111, 97,116, 32,108, +105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40,102,108,111, 97,116, 32, 99, 41, 10,123, 10, 9,105,102, 40, + 99, 32, 60, 32, 48, 46, 48, 48, 51, 49, 51, 48, 56, 41, 10, 9, 9,114,101,116,117,114,110, 32, 40, 99, 32, 60, 32, 48, 46, 48, + 41, 63, 32, 48, 46, 48, 58, 32, 99, 32, 42, 32, 49, 50, 46, 57, 50, 59, 10, 9,101,108,115,101, 10, 9, 9,114,101,116,117,114, +110, 32, 49, 46, 48, 53, 53, 32, 42, 32,112,111,119, 40, 99, 44, 32, 49, 46, 48, 47, 50, 46, 52, 41, 32, 45, 32, 48, 46, 48, 53, + 53, 59, 10,125, 10, 10,118,111,105,100, 32,115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40,118,101, 99, + 52, 32, 99,111,108, 95,102,114,111,109, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108, 95,116,111, 41, 10,123, 10, 9, + 99,111,108, 95,116,111, 46,114, 32, 61, 32,115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40, 99,111,108, + 95,102,114,111,109, 46,114, 41, 59, 10, 9, 99,111,108, 95,116,111, 46,103, 32, 61, 32,115,114,103, 98, 95,116,111, 95,108,105, +110,101, 97,114,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46,103, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 98, 32, 61, + 32,115,114,103, 98, 95,116,111, 95,108,105,110,101, 97,114,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46, 98, 41, 59, 10, + 9, 99,111,108, 95,116,111, 46, 97, 32, 61, 32, 99,111,108, 95,102,114,111,109, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32, +108,105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 95,102,114,111,109, 44, + 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108, 95,116,111, 41, 10,123, 10, 9, 99,111,108, 95,116,111, 46,114, 32, 61, 32, +108,105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46,114, 41, 59, 10, 9, + 99,111,108, 95,116,111, 46,103, 32, 61, 32,108,105,110,101, 97,114,114,103, 98, 95,116,111, 95,115,114,103, 98, 40, 99,111,108, + 95,102,114,111,109, 46,103, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 98, 32, 61, 32,108,105,110,101, 97,114,114,103, 98, 95, +116,111, 95,115,114,103, 98, 40, 99,111,108, 95,102,114,111,109, 46, 98, 41, 59, 10, 9, 99,111,108, 95,116,111, 46, 97, 32, 61, + 32, 99,111,108, 95,102,114,111,109, 46, 97, 59, 10,125, 10, 10, 35,100,101,102,105,110,101, 32, 77, 95, 80, 73, 32, 51, 46, 49, + 52, 49, 53, 57, 50, 54, 53, 51, 53, 56, 57, 55, 57, 51, 50, 51, 56, 52, 54, 10, 35,100,101,102,105,110,101, 32, 77, 95, 49, 95, + 80, 73, 32, 48, 46, 51, 49, 56, 51, 48, 57, 56, 56, 54, 49, 56, 51, 55, 57, 48, 54, 57, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 32, 83, 72, 65, 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 47, 10, 10,118,111,105,100, 32,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 52, 32, 97,116,116, +118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 41, 10,123, 10, 9,118, 99,111,108, 32, 61, 32,118, +101, 99, 52, 40, 97,116,116,118, 99,111,108, 46,120, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111,108, 46,121, 47, 50, + 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111,108, 46,122, 47, 50, 53, 53, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10, +118,111,105,100, 32,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117, +116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, + 48, 32, 45, 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105, +100, 32,103,101,111,109, 40,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,109, 97,116, 52, 32,118, +105,101,119,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,118,101, 99, 50, 32, 97,116, +116,117,118, 44, 32,118,101, 99, 52, 32, 97,116,116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, + 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,111, 99, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101, +119, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111, +117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 44, 32,111, +117,116, 32,102,108,111, 97,116, 32,118, 99,111,108, 95, 97,108,112,104, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, +114,111,110,116, 98, 97, 99,107, 41, 10,123, 10, 9,108,111, 99, 97,108, 32, 61, 32, 99,111, 59, 10, 9,118,105,101,119, 32, 61, + 32,110,111,114,109, 97,108,105,122,101, 40,108,111, 99, 97,108, 41, 59, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105, +101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40,108,111, 99, 97,108, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, + 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10, 9,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40, 97, +116,116,117,118, 44, 32,117,118, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40, +110,111,114, 41, 59, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105, +115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40, 97,116,116, +118, 99,111,108, 44, 32,118, 99,111,108, 41, 59, 10, 9,118, 99,111,108, 95, 97,108,112,104, 97, 32, 61, 32, 97,116,116,118, 99, +111,108, 46, 97, 59, 10, 9,102,114,111,110,116, 98, 97, 99,107, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32, +109, 97,112,112,105,110,103, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,109, 97,116, 52, 32,109, 97,116, 44, 32,118,101, 99, 51, + 32,109,105,110,118,101, 99, 44, 32,118,101, 99, 51, 32,109, 97,120,118,101, 99, 44, 32,102,108,111, 97,116, 32,100,111,109,105, +110, 44, 32,102,108,111, 97,116, 32,100,111,109, 97,120, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, + 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 40,109, 97,116, 32, 42, 32,118,101, 99, 52, 40,118,101, 99, 44, 32, 49, 46, + 48, 41, 41, 46,120,121,122, 59, 10, 9,105,102, 40,100,111,109,105,110, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, +118,101, 99, 32, 61, 32,109, 97,120, 40,111,117,116,118,101, 99, 44, 32,109,105,110,118,101, 99, 41, 59, 10, 9,105,102, 40,100, +111,109, 97,120, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109,105,110, 40,111,117,116,118, +101, 99, 44, 32,109, 97,120,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99, 97,109,101,114, 97, 40,118,101, 99, 51, + 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,105,101,119, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,111,117,116,100,101,112,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,105,115,116, 41, 10,123, 10, + 9,111,117,116,100,101,112,116,104, 32, 61, 32, 97, 98,115, 40, 99,111, 46,122, 41, 59, 10, 9,111,117,116,100,105,115,116, 32, + 61, 32,108,101,110,103,116,104, 40, 99,111, 41, 59, 10, 9,111,117,116,118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105, +122,101, 40, 99,111, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,100,100, 40,102,108,111, 97,116, 32,118, + 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97, +108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 43, 32,118, 97,108, 50, 59, 10,125, 10, 10,118, +111,105,100, 32,109, 97,116,104, 95,115,117, 98,116,114, 97, 99,116, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108, +111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111, +117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 45, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116, +104, 95,109,117,108,116,105,112,108,121, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, + 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, + 32,118, 97,108, 49, 32, 42, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,100,105,118,105,100, +101, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 50, 32, 61, 61, 32, 48, 46, 48, 41, 10, + 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, + 32,118, 97,108, 49, 32, 47, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,105,110,101, 40, +102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9, +111,117,116,118, 97,108, 32, 61, 32,115,105,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, + 99,111,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, + 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,115, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105, +100, 32,109, 97,116,104, 95,116, 97,110,103,101,110,116, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,116, 97,110, 40,118, 97,108, 41, + 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,115,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111, +117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, + 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97,115, +105,110, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, + 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97, 99,111,115, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32, +102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, + 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97, 99,111,115, 40, +118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118, +111,105,100, 32,109, 97,116,104, 95, 97,116, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, + 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 97,116, 97,110, 40,118, 97,108, 41, + 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,112,111,119, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102, +108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9, +105,102, 32, 40,118, 97,108, 49, 32, 62, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,112,111,119, 40, +118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, + 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,111,103, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32, 102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, - 9,111,117,116,118, 97,108, 32, 61, 32,109,105,110, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111, -105,100, 32,109, 97,116,104, 95,114,111,117,110,100, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 61, 32,102,108,111,111,114, 40,118, 97,108, 32, - 43, 32, 48, 46, 53, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,101,115,115, 95,116,104, 97,110, 40,102, -108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, - 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 60, 32,118, 97,108, 50, 41, 10, 9, 9,111,117, -116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, - 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,103,114,101, 97,116,101,114, 95,116,104, 97,110, 40,102,108,111, 97, -116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117, -116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97, -108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, - 10, 10,118,111,105,100, 32,115,113,117,101,101,122,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,102,108,111, 97,116, 32, -119,105,100,116,104, 44, 32,102,108,111, 97,116, 32, 99,101,110,116,101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111, -117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 47, 40, 49, 46, 48, 32, 43, 32,112,111, -119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 51, 44, 32, 45, 40, 40,118, 97,108, 45, 99,101,110,116,101,114, 41, 42,119,105,100, -116,104, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,100,100, 40,118,101, 99, 51, - 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, - 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, - 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, - 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,115,117, 98, 40,118,101, 99, - 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32, -111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, - 32, 45, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, - 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, - 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,118,101,114, 97,103, -101, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, + 9,105,102, 40,118, 97,108, 49, 32, 62, 32, 48, 46, 48, 32, 32, 38, 38, 32,118, 97,108, 50, 32, 62, 32, 48, 46, 48, 41, 10, 9, + 9,111,117,116,118, 97,108, 61, 32,108,111,103, 50, 40,118, 97,108, 49, 41, 32, 47, 32,108,111,103, 50, 40,118, 97,108, 50, 41, + 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, + 97,116,104, 95,109, 97,120, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32, +111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97, +120, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,105,110, 40, +102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97, +116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109,105,110, 40,118, 97,108, 49, 44, 32, +118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,114,111,117,110,100, 40,102,108,111, 97,116, 32, +118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, + 61, 32,102,108,111,111,114, 40,118, 97,108, 32, 43, 32, 48, 46, 53, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, + 95,108,101,115,115, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, + 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, + 60, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9, +111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,103,114,101, 97,116, +101,114, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32, +111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32,118, + 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, +118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,113,117,101,101,122,101, 40,102,108,111, 97,116, + 32,118, 97,108, 44, 32,102,108,111, 97,116, 32,119,105,100,116,104, 44, 32,102,108,111, 97,116, 32, 99,101,110,116,101,114, 44, + 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, + 46, 48, 47, 40, 49, 46, 48, 32, 43, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 51, 44, 32, 45, 40, 40,118, 97,108, + 45, 99,101,110,116,101,114, 41, 42,119,105,100,116,104, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, + 97,116,104, 95, 97,100,100, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, + 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9, +111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, + 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, + 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95, +109, 97,116,104, 95,115,117, 98, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118, +101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, + 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 45, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98, +115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, + 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, + 95,109, 97,116,104, 95, 97,118,101,114, 97,103,101, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32, +111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97, +108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, + 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, + 97,108,105,122,101, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, +100,111,116, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111, +117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, +101, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 44, 32, 48, 44, 32, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,100,111, +116, 40,118, 49, 44, 32,118, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 99,114,111,115, +115, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, - 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116, -118,101, 99, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,118,101, 99, - 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,100,111,116, 40,118,101, 99, 51, 32,118, 49, 44, - 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102, -108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 44, - 32, 48, 44, 32, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,100,111,116, 40,118, 49, 44, 32,118, 50, 41, 59, 10,125, - 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 99,114,111,115,115, 40,118,101, 99, 51, 32,118, 49, 44, 32,118, -101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 99,114,111,115,115, 40,118, 49, 44, - 32,118, 50, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10, -125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,111,114,109, 97,108,105,122,101, 40,118,101, 99, 51, 32, -118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117, -116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,118, 41, 59, 10, 9,111,117, -116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, - 95,109, 97,116,104, 95,110,101,103, 97,116,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117, -116,118, 41, 10,123, 10, 9,111,117,116,118, 32, 61, 32, 45,118, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,114,109, 97,108, - 40,118,101, 99, 51, 32,100,105,114, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117, -116,110,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,111,116, 41, 10,123, 10, 9,111,117,116,110,111, -114, 32, 61, 32,100,105,114, 59, 10, 9,111,117,116,100,111,116, 32, 61, 32, 45,100,111,116, 40,100,105,114, 44, 32,110,111,114, - 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,118,101, 99, 40,102,108,111, 97,116, 32,102, 97, 99, 44, - 32,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111, -117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 46,120, 32, 61, 32,116,101, -120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,120, 32, 43, 32, - 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10, 9,111,117,116,118,101, 99, 46,121, 32, 61, 32,116, -101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,121, 32, 43, - 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,121, 59, 10, 9,111,117,116,118,101, 99, 46,122, 32, 61, 32, -116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 40,118,101, 99, 46,122, 32, - 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,122, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, - 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32, 40,111,117,116,118,101, 99, 42,102, 97, 99, 41, 32, 43, - 32, 40,118,101, 99, 42, 40, 49, 46, 48, 45,102, 97, 99, 41, 41, 59, 10, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101, -115, 95,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,115, 97,109,112,108, -101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10, -123, 10, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, - 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, - 99,111,108, 46,114, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,114, 59, 10, 9,111,117,116, 99,111,108, - 46,103, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101, -120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46,103, 44, 32, 48, 46, - 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,103, 59, 10, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,101,120,116, -117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99, -117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46, 98, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, - 48, 41, 41, 46, 98, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111, -108, 32, 61, 32, 40,111,117,116, 99,111,108, 42,102, 97, 99, 41, 32, 43, 32, 40, 99,111,108, 42, 40, 49, 46, 48, 45,102, 97, 99, - 41, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32, -115,101,116, 95,118, 97,108,117,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111, -117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32, -115,101,116, 95,114,103, 98, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111, -108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95, -114,103, 98, 97, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10, -123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108, -117,101, 95,122,101,114,111, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116, -118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 95,111,110,101, - 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, - 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99, - 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59, - 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 95,122,101,114,111, 40,111,117,116, 32,118,101, 99, 52, 32, -111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 48, 41, 59, 10,125, - 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 52, 32,118, 97,108, 44, 32,111,117,116, 32,118,101, - 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118, -111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 51, 32,118, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32, -111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, - 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 50, 32,118, 97,108, 44, 32,111,117,116, 32,118,101, 99, 50, 32,111,117,116, -118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111, -112,121, 95,114, 97,119, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, - 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, - 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, + 32, 61, 32, 99,114,111,115,115, 40,118, 49, 44, 32,118, 50, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103, +116,104, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,111,114, +109, 97,108,105,122,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32, +111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101, +110,103,116,104, 40,118, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 41, 59, + 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,101,103, 97,116,101, 40,118,101, 99, 51, 32,118, 44, + 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 41, 10,123, 10, 9,111,117,116,118, 32, 61, 32, 45,118, 59, 10,125, 10, + 10,118,111,105,100, 32,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,100,105,114, 44, 32,118,101, 99, 51, 32,110,111,114, 44, + 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100, +111,116, 41, 10,123, 10, 9,111,117,116,110,111,114, 32, 61, 32,100,105,114, 59, 10, 9,111,117,116,100,111,116, 32, 61, 32, 45, +100,111,116, 40,100,105,114, 44, 32,110,111,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,118,101, + 99, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, + 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111, +117,116,118,101, 99, 46,120, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, + 99, 50, 40, 40,118,101, 99, 46,120, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10, 9, +111,117,116,118,101, 99, 46,121, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118, +101, 99, 50, 40, 40,118,101, 99, 46,121, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,121, 59, 10, + 9,111,117,116,118,101, 99, 46,122, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, +118,101, 99, 50, 40, 40,118,101, 99, 46,122, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 44, 32, 48, 46, 48, 41, 41, 46,122, 59, + 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32, 40,111, +117,116,118,101, 99, 42,102, 97, 99, 41, 32, 43, 32, 40,118,101, 99, 42, 40, 49, 46, 48, 45,102, 97, 99, 41, 41, 59, 10, 10,125, + 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, + 52, 32, 99,111,108, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118, +101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,101,120,116,117,114, +101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114, +118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46,114, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, + 41, 46,114, 59, 10, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101, +109, 97,112, 44, 32,118,101, 99, 50, 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, + 99, 50, 40, 99,111,108, 46,103, 44, 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46,103, 59, 10, 9,111,117,116, + 99,111,108, 46, 98, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, + 40,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40, 99,111,108, 46, 98, 44, + 32, 48, 46, 48, 41, 41, 46, 97, 44, 32, 48, 46, 48, 41, 41, 46, 98, 59, 10, 10, 9,105,102, 32, 40,102, 97, 99, 32, 33, 61, 32, + 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32, 40,111,117,116, 99,111,108, 42,102, 97, 99, 41, 32, 43, 32, 40, + 99,111,108, 42, 40, 49, 46, 48, 45,102, 97, 99, 41, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, + 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, + 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, + 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117, +116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10, +125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118, +101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10, +118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 95,122,101,114,111, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117, +116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115, +101,116, 95,118, 97,108,117,101, 95,111,110,101, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, + 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 95, +122,101,114,111, 40,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, + 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 95,122,101, +114,111, 40,111,117,116, 32,118,101, 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, +118,101, 99, 52, 40, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 52, + 32,118, 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, + 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 51, 32,118, 97, +108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, +118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,118,101, 99, 50, 32,118, 97,108, 44, 32, +111,117,116, 32,118,101, 99, 50, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, + 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,112,121, 95,114, 97,119, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117, +116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, + 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, + 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, + 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, + 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 50, 44, 32,102, 97, + 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32, +109,105,120, 95, 97,100,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, + 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, + 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, + 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, + 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, +109,117,108,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, + 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, + 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32, +109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 42, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117, +116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 99,114, +101,101,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99, +111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99, +108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, + 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 49, 46, + 48, 41, 32, 45, 32, 40,118,101, 99, 52, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99, 42, 40,118,101, 99, 52, 40, 49, 46, 48, + 41, 32, 45, 32, 99,111,108, 50, 41, 41, 42, 40,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9, +111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,111, +118,101,114,108, 97,121, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, - 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, - 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, - 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 97,100,100, 40,102,108,111, 97, -116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, - 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, - 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, - 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, - 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,109,117,108,116, 40,102,108,111, 97,116, 32,102, + 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, + 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, + 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, +114, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,101,108,115, +101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, + 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99, +111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117, +116, 99,111,108, 46,103, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, + 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, + 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, + 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, + 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111, +108, 50, 46, 98, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, +102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46, 98, 41, 41, 42, 40, + 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,117, 98, + 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, + 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109, +112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, + 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 45, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, + 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,118, 40,102,108,111, + 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117, +116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, + 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, + 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, + 50, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99, +111,108, 46,114, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46,114, 47, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40, + 99,111,108, 50, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111, +117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46,103, 47, 99,111,108, 50, 46,103, 59, 10, 9, +105,102, 40, 99,111,108, 50, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99, +109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46, 98, 47, 99,111,108, 50, 46, 98, + 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,102,102, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, + 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, + 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, + 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 97, 98,115, 40, 99,111,108, 49, + 32, 45, 32, 99,111,108, 50, 41, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, + 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32, +118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111, +117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, + 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,103, 98, 32, 61, 32,109,105,110, 40, 99,111,108, 49, 46,114,103, 98, + 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, + 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,102, 97, 99, + 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, + 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, + 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,103, 98, 32, 61, 32,109, 97,120, 40, 99,111,108, 49, 46,114, +103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99, +111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,111,100,103,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, - 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111, -108, 49, 32, 42, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, - 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,102, 97, - 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, - 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, - 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, - 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 52, 40,102, - 97, 99,109, 41, 32, 43, 32,102, 97, 99, 42, 40,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 50, 41, 41, 42, 40, -118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99, -111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,111,118,101,114,108, 97,121, 40,102,108,111, 97,116, - 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32, -118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, - 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32, -102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111, -108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, - 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, - 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, - 99,111,108, 50, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40, -111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 42, 61, 32,102, 97, - 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, - 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, - 46, 48, 32, 45, 32, 99,111,108, 50, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, - 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, - 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,101,108,115,101, 10, - 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, - 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46, 98, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, - 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,117, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32, + 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111, +117,116, 99,111,108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, + 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, + 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, + 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,114, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111, +117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46, +114, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, + 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46, +103, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, + 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,103, + 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, + 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, + 40,111,117,116, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, + 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, + 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105, +102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, + 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111, +108, 46, 98, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,117,114,110, 40,102, +108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32, +111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, +102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,116,109,112, 44, 32,102, 97, 99,109, + 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, + 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40,116,109, +112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115, +101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, + 46,114, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, + 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, +114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, + 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40, +116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101, +108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99, +111,108, 46,103, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, + 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111, +108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109, +112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,105, +102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, + 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117, +116, 99,111,108, 46, 98, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, + 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, + 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, +116,109,112, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,104,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32, 118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111, 117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, - 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 45, - 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, - 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,118, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, - 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111, -108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, - 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, - 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32, -111,117,116, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99, 42,111, -117,116, 99,111,108, 46,114, 47, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 50, 46,103, 32, 33, 61, 32, 48, 46, - 48, 41, 32,111,117,116, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, - 99, 42,111,117,116, 99,111,108, 46,103, 47, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 33, 61, - 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, - 32,102, 97, 99, 42,111,117,116, 99,111,108, 46, 98, 47, 99,111,108, 50, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,105, -120, 95,100,105,102,102, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, + 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, + 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, + 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, + 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104, +115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46, +120, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111, +117,116, 99,111,108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, + 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109, +105,120, 95,115, 97,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, - 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, - 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 97, 98,115, 40, 99,111,108, 49, 32, 45, 32, 99,111,108, 50, 41, 44, 32,102, 97, - 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32, -109,105,120, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118, -101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, - 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111, -108, 46,114,103, 98, 32, 61, 32,109,105,110, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, - 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, - 32,109,105,120, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, + 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, + 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, + 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, +111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, + 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9, 9, +104,115,118, 46,121, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,121, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,121, 59, + 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 9,125, 10,125, + 10, 10,118,111,105,100, 32,109,105,120, 95,118, 97,108, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99, +111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, + 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, + 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32, +104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 49, 44, 32,104,115,118, + 41, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,104,115, +118, 46,122, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,122, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,122, 59, 10, 9, +104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, + 32,109,105,120, 95, 99,111,108,111,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9, -102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, - 99,111,108, 46,114,103, 98, 32, 61, 32,109, 97,120, 40, 99,111,108, 49, 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, - 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111, -105,100, 32,109,105,120, 95,100,111,100,103,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, - 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, - 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111, -117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 33, 61, 32, 48, - 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111, -108, 50, 46,114, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, - 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111, -108, 46,114, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, - 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, - 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116, -109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9, 9,105,102, 40,116,109,112, 32, - 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115, -101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,103, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, - 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117, -116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 33, 61, - 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, - 99,111,108, 50, 46, 98, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99, -111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, - 99,111,108, 46, 98, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, - 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10, 9, -125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,117,114,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, - 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, - 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, - 48, 41, 59, 10, 9,102,108,111, 97,116, 32,116,109,112, 44, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, - 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, - 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, -111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, - 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 47,116,109,112, 41, 41, 32, 60, 32, - 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, -116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108, -115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99, -109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, - 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, - 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 47,116,109,112, 41, 41, 32, - 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105, -102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9, -101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, - 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, - 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109, -112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 47,116,109,112, 41, - 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, - 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, - 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10,125, 10, 10,118,111,105,100, - 32,109,105,120, 95,104,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118, -101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, - 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, - 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111, -108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95, -116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, - 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104, -115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 95,116,111, 95, -114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, -111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, - 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, 97,116, 40,102,108,111, 97,116, - 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32, -118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, - 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32, -102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, - 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, - 59, 10, 10, 9,105,102, 40,104,115,118, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95, -104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,102, 97, 99,109, - 42,104,115,118, 46,121, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, - 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,118, - 97,108, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111, -108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, - 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, - 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9, -114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 49, 44, 32,104,115,118, 41, 59, 10, 9,114,103, 98, 95,116,111, 95,104, -115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,104,115,118, 46,122, 32, 61, 32,102, 97, 99,109, 42,104, -115,118, 46,122, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,122, 59, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104, -115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 99,111,108,111,114, 40,102, -108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32, -111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, -102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, - 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, - 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, - 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, - 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, - 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 46,121, 32, 61, 32,104,115,118, 50, 46,121, 59, 10, 9, - 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111, -108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, - 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115, -111,102,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99, -111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99, -108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, - 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, 32,111,110,101, 61, 32,118,101, 99, 52, 40, 49, - 46, 48, 41, 59, 10, 9,118,101, 99, 52, 32,115, 99,114, 61, 32,111,110,101, 32, 45, 32, 40,111,110,101, 32, 45, 32, 99,111,108, - 50, 41, 42, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,102, 97, 99,109, 42, - 99,111,108, 49, 32, 43, 32,102, 97, 99, 42, 40, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 42, 99,111,108, 50, 42, 99,111, -108, 49, 32, 43, 32, 99,111,108, 49, 42,115, 99,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,108,105,110,101, - 97,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111, -108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, - 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99, -111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, - 46,114, 61, 32, 99,111,108, 49, 46,114, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 32, 45, 32, - 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 61, 32, 99,111,108, 49, 46,114, 32, - 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, - 40, 99,111,108, 50, 46,103, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46, -103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,103, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101, -108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, - 48, 42, 40, 99,111,108, 50, 46,103, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 62, - 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, - 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, - 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, - 41, 32, 45, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118, 97,108,116,111,114,103, 98, 40,102,108,111, 97,116, - 32,102, 97, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,111,108,111,114,109, 97,112, 44, 32,111,117,116, 32,118,101, - 99, 52, 32,111,117,116, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, 97,108,112,104, 97, 41, 10,123, - 10, 9,111,117,116, 99,111,108, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,111,108,111,114,109, 97,112, 44, 32,118, -101, 99, 50, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 41, 59, 10, 9,111,117,116, 97,108,112,104, 97, 32, 61, 32,111,117,116, 99, -111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,114,103, 98,116,111, 98,119, 40,118,101, 99, 52, 32, 99,111,108,111,114, - 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 32, 32, 10,123, 10, 9,111,117,116,118, 97,108, 32, - 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 53, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 52, 53, 32, 43, 32, - 99,111,108,111,114, 46, 98, 42, 48, 46, 50, 59, 32, 47, 42, 32,107,101,101,112, 32,116,104,101,115,101, 32,102, 97, 99,116,111, -114,115, 32,105,110, 32,115,121,110, 99, 32,119,105,116,104, 32,116,101,120,116,117,114,101, 46,104, 58, 82, 71, 66, 84, 79, 66, - 87, 32, 42, 47, 10,125, 10, 10,118,111,105,100, 32,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118, -101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, - 99,111,108, 46,120,121,122, 32, 61, 32,109,105,120, 40, 99,111,108, 46,120,121,122, 44, 32,118,101, 99, 51, 40, 49, 46, 48, 44, - 32, 49, 46, 48, 44, 32, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 46,120,121,122, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, - 99,111,108, 46,119, 32, 61, 32, 99,111,108, 46,119, 59, 10,125, 10, 10,118,111,105,100, 32,104,117,101, 95,115, 97,116, 40,102, -108,111, 97,116, 32,104,117,101, 44, 32,102,108,111, 97,116, 32,115, 97,116, 44, 32,102,108,111, 97,116, 32,118, 97,108,117,101, - 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32, -111,117,116, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32,104,115,118, 59, 10, 10, 9,114,103, 98, 95,116,111, 95,104,115, -118, 40, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,104,115,118, 91, 48, 93, 32, 43, 61, 32, 40,104,117,101, 32, 45, 32, - 48, 46, 53, 41, 59, 10, 9,105,102, 40,104,115,118, 91, 48, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 48, 93, 45, 61, 49, 46, - 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 48, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 48, 93, 43, 61, 32, - 49, 46, 48, 59, 10, 9,104,115,118, 91, 49, 93, 32, 42, 61, 32,115, 97,116, 59, 10, 9,105,102, 40,104,115,118, 91, 49, 93, 62, - 49, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 49, 93, - 60, 48, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 48, 46, 48, 59, 10, 9,104,115,118, 91, 50, 93, 32, 42, 61, 32,118, 97, -108,117,101, 59, 10, 9,105,102, 40,104,115,118, 91, 50, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 49, 46, 48, - 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 50, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 48, 46, - 48, 59, 10, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 10, 9, -111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 44, 32,111,117,116, 99,111,108, 44, 32,102, 97, 99, 41, 59, 10, -125, 10, 10,118,111,105,100, 32,115,101,112, 97,114, 97,116,101, 95,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,103, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32, 98, 41, 10,123, 10, 9,114, 32, 61, 32, 99,111,108, 46,114, 59, 10, 9,103, 32, 61, 32, 99,111,108, 46,103, 59, 10, - 9, 98, 32, 61, 32, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32, 99,111,109, 98,105,110,101, 95,114,103, 98, 40, -102,108,111, 97,116, 32,114, 44, 32,102,108,111, 97,116, 32,103, 44, 32,102,108,111, 97,116, 32, 98, 44, 32,111,117,116, 32,118, -101, 99, 52, 32, 99,111,108, 41, 10,123, 10, 9, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114, 44, 32,103, 44, 32, 98, 44, 32, - 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,111,117,116,112,117,116, 95,110,111,100,101, 40,118,101, 99, 52, 32,114, -103, 98, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, - 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32, 97,108,112,104, - 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 84, 69, 88, 84, 85, 82, 69, 83, 32, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,102,108,105,112, - 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, - 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 46,121,120,122, 59, 10,125, 10, 10,118,111,105,100, 32,116, -101,120,116,117,114,101, 95, 98,108,101,110,100, 95,108,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102, -108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 49, 46, 48, 43,118,101, - 99, 46,120, 41, 47, 50, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95, -113,117, 97,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, - 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, - 44, 32, 48, 46, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 42, 61, 32,111,117,116,118, 97,108, 59, 10,125, 10, 10,118,111, -105,100, 32,116,101,120,116,117,114,101, 95,119,111,111,100, 95,115,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117, -116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111, -117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, 97, 32, 61, 32,115,113,114, -116, 40,118,101, 99, 46,120, 42,118,101, 99, 46,120, 32, 43, 32,118,101, 99, 46,121, 42,118,101, 99, 46,121, 32, 43, 32,118,101, - 99, 46,122, 42,118,101, 99, 46,122, 41, 42, 50, 48, 46, 48, 59, 10, 9,102,108,111, 97,116, 32,119,105, 32, 61, 32, 48, 46, 53, - 32, 43, 32, 48, 46, 53, 42,115,105,110, 40, 97, 41, 59, 10, 10, 9,118, 97,108,117,101, 32, 61, 32,119,105, 59, 10, 9, 99,111, -108,111,114, 32, 61, 32,118,101, 99, 52, 40,119,105, 44, 32,119,105, 44, 32,119,105, 44, 32, 49, 46, 48, 41, 59, 10, 9,110,111, -114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118, -111,105,100, 32,116,101,120,116,117,114,101, 95,105,109, 97,103,101, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112, -108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32, -118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, - 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 40,118,101, 99, 46,120,121, 32, 43, - 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 41, 42, 48, 46, 53, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, - 49, 46, 48, 59, 10, 10, 9,110,111,114,109, 97,108, 46,120, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46,114, 32, 45, - 32, 48, 46, 53, 41, 59, 10, 9,110,111,114,109, 97,108, 46,121, 32, 61, 32, 50, 46, 48, 42, 40, 48, 46, 53, 32, 45, 32, 99,111, -108,111,114, 46,103, 41, 59, 10, 9,110,111,114,109, 97,108, 46,122, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46, 98, - 32, 45, 32, 48, 46, 53, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 77, 84, 69, 88, 32, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111, -114, 99,111, 40,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 41, - 10,123, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99, -111, 95,117,118, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10, - 9, 47, 42, 32,100,105,115, 97, 98,108,101,100, 32,102,111,114, 32,110,111,119, 44, 32,119,111,114,107,115, 32,116,111,103,101, -116,104,101,114, 32,119,105,116,104, 32,108,101, 97,118,105,110,103, 32,111,117,116, 32,109,116,101,120, 95, 50,100, 95,109, 97, -112,112,105,110,103, 10, 9, 32, 32, 32,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32, -118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 32, 42, 47, 10, 9,117,118, 32, 61, 32,118, -101, 99, 51, 40, 97,116,116,117,118, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,110, -111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114, -109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 99,111,114,114,101,115,112,111,110,100,115, 32,116,111, 32,115,104,105, 45, 62,111, -114,110, 44, 32,119,104,105, 99,104, 32,105,115, 32,110,101,103, 97,116,101,100, 32,115,111, 32, 99, 97,110, 99,101,108,115, 10, - 9, 32, 32, 32,111,117,116, 32, 98,108,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,110,101,103, 97,116,105,111,110, 32, - 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108, - 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97, -110,103,101,110,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116, 97,110,103,101,110,116, 41, 10,123, 10, 9,111, -117,116,116, 97,110,103,101,110,116, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,116, 97,110,103,101,110,116, 46,120,121, -122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,103,108,111, 98, 97,108, 40,109, 97,116, 52, 32,118,105, -101,119,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, - 97,108, 41, 10,123, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, - 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111, 98, -106,101, 99,116, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,109, 97,116, 52, 32,111, 98,105,110,118, -109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111, 98,106,101, 99,116, 41, 10,123, - 10, 9,111, 98,106,101, 99,116, 32, 61, 32, 40,111, 98,105,110,118,109, 97,116, 42, 40,118,105,101,119,105,110,118,109, 97,116, - 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101, -120, 99,111, 95,114,101,102,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, - 32,118,101, 99, 51, 32,114,101,102, 41, 10,123, 10, 9,114,101,102, 32, 61, 32,118,105,101,119, 32, 45, 32, 50, 46, 48, 42,100, -111,116, 40,118,110, 44, 32,118,105,101,119, 41, 42,118,110, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,110, -111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114, -109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, - 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114, -109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, - 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, - 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, - 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, - 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111, -108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, - 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,109,117,108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, +102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, + 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, + 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, + 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46, +121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,108, 44, + 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118, 46,121, + 32, 61, 32,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, + 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, + 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, + 10, 10,118,111,105,100, 32,109,105,120, 95,115,111,102,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, + 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, + 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, + 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99, 52, + 32,111,110,101, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10, 9,118,101, 99, 52, 32,115, 99,114, 61, 32,111,110,101, 32, + 45, 32, 40,111,110,101, 32, 45, 32, 99,111,108, 50, 41, 42, 40,111,110,101, 32, 45, 32, 99,111,108, 49, 41, 59, 10, 9,111,117, +116, 99,111,108, 32, 61, 32,102, 97, 99,109, 42, 99,111,108, 49, 32, 43, 32,102, 97, 99, 42, 40, 40,111,110,101, 32, 45, 32, 99, +111,108, 49, 41, 42, 99,111,108, 50, 42, 99,111,108, 49, 32, 43, 32, 99,111,108, 49, 42,115, 99,114, 41, 59, 10,125, 10, 10,118, +111,105,100, 32,109,105,120, 95,108,105,110,101, 97,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99, +111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, + 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, + 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,114, 32, 62, 32, 48, + 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 61, 32, 99,111,108, 49, 46,114, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, + 48, 42, 40, 99,111,108, 50, 46,114, 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111, +108, 46,114, 61, 32, 99,111,108, 49, 46,114, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,114, 41, 32, + 45, 32, 49, 46, 48, 41, 59, 10, 10, 9,105,102, 40, 99,111,108, 50, 46,103, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, + 99,111,108, 46,103, 61, 32, 99,111,108, 49, 46,103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,103, + 32, 45, 32, 48, 46, 53, 41, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 61, 32, 99,111,108, 49, + 46,103, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46,103, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10, 10, + 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 62, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 61, 32, 99,111, +108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, 32, 45, 32, 48, 46, 53, 41, 41, 59, + 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 61, 32, 99,111,108, 49, 46, 98, 32, 43, 32,102, 97, 99, 42, + 40, 50, 46, 48, 42, 40, 99,111,108, 50, 46, 98, 41, 32, 45, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118, 97, +108,116,111,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,111,108,111, +114,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,111,117,116, 97,108,112,104, 97, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, + 40, 99,111,108,111,114,109, 97,112, 44, 32,118,101, 99, 50, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 41, 59, 10, 9,111,117,116, + 97,108,112,104, 97, 32, 61, 32,111,117,116, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,114,103, 98,116,111, 98, +119, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 32, + 32, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 53, 32, 43, 32, 99,111,108, +111,114, 46,103, 42, 48, 46, 52, 53, 32, 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 50, 59, 32, 47, 42, 32,107,101,101,112, + 32,116,104,101,115,101, 32,102, 97, 99,116,111,114,115, 32,105,110, 32,115,121,110, 99, 32,119,105,116,104, 32,116,101,120,116, +117,114,101, 46,104, 58, 82, 71, 66, 84, 79, 66, 87, 32, 42, 47, 10,125, 10, 10,118,111,105,100, 32,105,110,118,101,114,116, 40, +102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117, +116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,120,121,122, 32, 61, 32,109,105,120, 40, 99,111,108, 46,120,121, +122, 44, 32,118,101, 99, 51, 40, 49, 46, 48, 44, 32, 49, 46, 48, 44, 32, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 46,120,121,122, + 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46,119, 32, 61, 32, 99,111,108, 46,119, 59, 10,125, 10, 10,118,111, +105,100, 32,104,117,101, 95,115, 97,116, 40,102,108,111, 97,116, 32,104,117,101, 44, 32,102,108,111, 97,116, 32,115, 97,116, 44, + 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111, +108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32,104,115,118, 59, + 10, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,104,115,118, 91, 48, + 93, 32, 43, 61, 32, 40,104,117,101, 32, 45, 32, 48, 46, 53, 41, 59, 10, 9,105,102, 40,104,115,118, 91, 48, 93, 62, 49, 46, 48, + 41, 32,104,115,118, 91, 48, 93, 45, 61, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 48, 93, 60, 48, 46, + 48, 41, 32,104,115,118, 91, 48, 93, 43, 61, 32, 49, 46, 48, 59, 10, 9,104,115,118, 91, 49, 93, 32, 42, 61, 32,115, 97,116, 59, + 10, 9,105,102, 40,104,115,118, 91, 49, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 49, 46, 48, 59, 32,101,108, +115,101, 32,105,102, 40,104,115,118, 91, 49, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 48, 46, 48, 59, 10, 9, +104,115,118, 91, 50, 93, 32, 42, 61, 32,118, 97,108,117,101, 59, 10, 9,105,102, 40,104,115,118, 91, 50, 93, 62, 49, 46, 48, 41, + 32,104,115,118, 91, 50, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 50, 93, 60, 48, 46, 48, + 41, 32,104,115,118, 91, 50, 93, 61, 32, 48, 46, 48, 59, 10, 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, + 32,111,117,116, 99,111,108, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 44, 32,111,117, +116, 99,111,108, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,112, 97,114, 97,116,101, 95,114,103, 98, + 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114, 44, 32,111,117,116, 32,102,108,111, 97, +116, 32,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 98, 41, 10,123, 10, 9,114, 32, 61, 32, 99,111,108, 46,114, 59, 10, + 9,103, 32, 61, 32, 99,111,108, 46,103, 59, 10, 9, 98, 32, 61, 32, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32, + 99,111,109, 98,105,110,101, 95,114,103, 98, 40,102,108,111, 97,116, 32,114, 44, 32,102,108,111, 97,116, 32,103, 44, 32,102,108, +111, 97,116, 32, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108, 41, 10,123, 10, 9, 99,111,108, 32, 61, 32,118,101, + 99, 52, 40,114, 44, 32,103, 44, 32, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,111,117,116,112,117,116, + 95,110,111,100,101, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, + 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114, +103, 98, 46,114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, + 84, 69, 88, 84, 85, 82, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32, +116,101,120,116,117,114,101, 95,102,108,105,112, 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, + 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 46,121,120, +122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95,108,105,110, 40,118,101, 99, + 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, + 97,108, 32, 61, 32, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,116,101, +120,116,117,114,101, 95, 98,108,101,110,100, 95,113,117, 97,100, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102, +108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40, 40, 49, 46, + 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10, 9,111,117,116,118, 97,108, 32, 42, 61, 32,111, +117,116,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,119,111,111,100, 95,115,105,110, 40, +118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118, +101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9,102, +108,111, 97,116, 32, 97, 32, 61, 32,115,113,114,116, 40,118,101, 99, 46,120, 42,118,101, 99, 46,120, 32, 43, 32,118,101, 99, 46, +121, 42,118,101, 99, 46,121, 32, 43, 32,118,101, 99, 46,122, 42,118,101, 99, 46,122, 41, 42, 50, 48, 46, 48, 59, 10, 9,102,108, +111, 97,116, 32,119,105, 32, 61, 32, 48, 46, 53, 32, 43, 32, 48, 46, 53, 42,115,105,110, 40, 97, 41, 59, 10, 10, 9,118, 97,108, +117,101, 32, 61, 32,119,105, 59, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40,119,105, 44, 32,119,105, 44, 32,119, +105, 44, 32, 49, 46, 48, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, + 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,105,109, 97,103,101, 40,118,101, + 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, + 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, + 97, 44, 32, 40,118,101, 99, 46,120,121, 32, 43, 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 41, 42, 48, 46, 53, + 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10, 10, 9,110,111,114,109, 97,108, 46,120, 32, 61, 32, 50, 46, + 48, 42, 40, 99,111,108,111,114, 46,114, 32, 45, 32, 48, 46, 53, 41, 59, 10, 9,110,111,114,109, 97,108, 46,121, 32, 61, 32, 50, + 46, 48, 42, 40, 48, 46, 53, 32, 45, 32, 99,111,108,111,114, 46,103, 41, 59, 10, 9,110,111,114,109, 97,108, 46,122, 32, 61, 32, + 50, 46, 48, 42, 40, 99,111,108,111,114, 46, 98, 32, 45, 32, 48, 46, 53, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 32, 77, 84, 69, 88, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10, +118,111,105,100, 32,116,101,120, 99,111, 95,111,114, 99,111, 40,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,111,117, +116, 32,118,101, 99, 51, 32,111,114, 99,111, 41, 10,123, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10, +125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,117,118, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, + 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10, 9, 47, 42, 32,100,105,115, 97, 98,108,101,100, 32,102,111,114, 32,110,111,119, + 44, 32,119,111,114,107,115, 32,116,111,103,101,116,104,101,114, 32,119,105,116,104, 32,108,101, 97,118,105,110,103, 32,111,117, +116, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103, 10, 9, 32, 32, 32,117,118, 32, 61, 32,118,101, 99, 51, 40, + 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, + 59, 32, 42, 47, 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10, +118,111,105,100, 32,116,101,120, 99,111, 95,110,111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, + 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 99,111,114,114,101,115,112,111,110, +100,115, 32,116,111, 32,115,104,105, 45, 62,111,114,110, 44, 32,119,104,105, 99,104, 32,105,115, 32,110,101,103, 97,116,101,100, + 32,115,111, 32, 99, 97,110, 99,101,108,115, 10, 9, 32, 32, 32,111,117,116, 32, 98,108,101,110,100,101,114, 32,110,111,114,109, + 97,108, 32,110,101,103, 97,116,105,111,110, 32, 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, + 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,116, 97,110, +103,101,110,116, 40,118,101, 99, 52, 32,116, 97,110,103,101,110,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116, + 97,110,103,101,110,116, 41, 10,123, 10, 9,111,117,116,116, 97,110,103,101,110,116, 32, 61, 32,110,111,114,109, 97,108,105,122, +101, 40,116, 97,110,103,101,110,116, 46,120,121,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,103,108, +111, 98, 97,108, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111, +117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 41, 10,123, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,105,101, +119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10,125, 10, 10,118, +111,105,100, 32,116,101,120, 99,111, 95,111, 98,106,101, 99,116, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, + 44, 32,109, 97,116, 52, 32,111, 98,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, + 99, 51, 32,111, 98,106,101, 99,116, 41, 10,123, 10, 9,111, 98,106,101, 99,116, 32, 61, 32, 40,111, 98,105,110,118,109, 97,116, + 42, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 41, 46,120,121,122, + 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,114,101,102,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, + 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99, 51, 32,114,101,102, 41, 10,123, 10, 9,114,101,102, 32, 61, 32, +118,105,101,119, 32, 45, 32, 50, 46, 48, 42,100,111,116, 40,118,110, 44, 32,118,105,101,119, 41, 42,118,110, 59, 10,125, 10, 10, +118,111,105,100, 32,115,104, 97,100,101, 95,110,111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, + 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114, +101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,111,117,116,110, +111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118, +111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32, +118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, + 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, + 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45, +102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, + 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,109,117,108, 40, +118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32, +102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, + 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, + 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, + 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,114,103, 98, 95,115, 99,114,101,101,110, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118, +101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, + 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, +109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, + 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 51, + 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99,116, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,116,101,120, 99,111, +108, 41, 41, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,114,103, 98, 95,111,118,101,114,108, 97,121, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32, +118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, + 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, + 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45, +102, 97, 99,103, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99, +111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, + 42,116,101,120, 99,111,108, 46,114, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32, 49, 46, + 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99, +111,108, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117, +116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, + 46,103, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 41, 59, 10, 9, +101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, + 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, + 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, + 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, + 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46, + 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, + 45, 32,116,101,120, 99,111,108, 46, 98, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, + 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,117, 98, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32, -102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, - 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, - 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101, -120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, - 99,114,101,101,110, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32, -102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, - 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, - 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, - 32, 61, 32,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 51, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99, -116, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40,118,101, 99, 51, 40, 49, 46, - 48, 41, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,111, -118,101,114,108, 97,121, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, +102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, + 32, 45,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10, +118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 97,100,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118, +101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, + 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32,102, + 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,118, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, + 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, + 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, + 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, + 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,114, 32, + 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,114, 47, +116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,105, +110, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99,116, 42,111,117, +116, 99,111,108, 46,103, 47,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46, 98, 32, 33, 61, + 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32, +102, 97, 99,116, 42,111,117,116, 99,111,108, 46, 98, 47,116,101,120, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32, +109,116,101,120, 95,114,103, 98, 95,100,105,102,102, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32, +116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32, +111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, + 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, + 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98, +115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, + 95,114,103, 98, 95,100, 97,114,107, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99, +111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32, +118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, + 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, + 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, + 32, 60, 32,111,117,116, 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, + 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, + 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,103, 41, 32,105, +110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, + 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, + 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32, +101,108,115,101, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, + 32,109,116,101,120, 95,114,103, 98, 95,108,105,103,104,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, + 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, + 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, + 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, + 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9, +105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, + 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, + 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111, +108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, + 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, + 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, + 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, + 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,104,117,101, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, + 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32, +102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111, +108, 59, 10, 10, 9,109,105,120, 95,104,117,101, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, + 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111, +108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,114,103, 98, 95,115, 97,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, + 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, + 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9, +109,105,120, 95,115, 97,116, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, + 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9, +105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101, +120, 95,114,103, 98, 95,118, 97,108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99, +111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32, +118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,118, + 97,108, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, + 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, + 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, + 95, 99,111,108,111,114, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, - 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, - 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,102, 40,111, -117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111, -108, 46,114, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 41, 59, 10, - 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, - 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, - 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, - 41, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 42, 40,102, 97, 99,109, 32, 43, 32, 50, - 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, - 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, - 32, 45, 32,116,101,120, 99,111,108, 46,103, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, - 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, - 32,111,117,116, 99,111,108, 46, 98, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111, -108, 46, 98, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, - 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46, 98, 41, 41, - 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, -114,103, 98, 95,115,117, 98, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, - 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, - 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32, 45,102, 97, 99,116, 42,102, 97, 99,103, 42, -116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, - 98, 95, 97,100,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32, -102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, - 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, - 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100, -105,118, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, - 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, - 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, - 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111, -108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111, -108, 46,114, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,114, 47,116,101,120, 99,111,108, 46,114, 59, 10, 9,105, -102, 40,116,101,120, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32,102, 97, 99, -109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,103, 47,116,101,120, 99,111, -108, 46,103, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46, - 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46, - 98, 47,116,101,120, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,102, -102, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97, -116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99, -111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99, -103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, - 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111, -117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100, 97,114,107, 40,118,101, - 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, - 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10, -123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, - 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, - 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,114, 41, - 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111, -117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9, -105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, - 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, - 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111, -108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98, - 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,108,105, -103,104,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108, -111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105, -110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, - 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111, -108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, - 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, - 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111, -108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, - 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, - 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, - 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105, -110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, -114,103, 98, 95,104,117,101, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, - 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, - 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,104,117,101, - 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118, -101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114, -103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, - 97,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, - 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, - 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,115, 97,116, 40,102, 97, 99,116, - 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116, -101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, - 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,118, 97,108, 40,118,101, - 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, - 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10, -123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95,118, 97,108, 40,102, 97, 99,116, 42,102, 97, 99,103, - 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, - 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114, -103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 99,111,108,111,114, 40,118,101, 99, 51, 32, -111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, - 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9, -118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95, 99,111,108,111,114, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, - 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, - 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, - 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,105,110,111,117,116, - 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32,102, 97, 99,109, 41, 10,123, 10, 9,102, 97, 99,116, 32, 42, 61, 32, 97, 98,115, 40,102, 97, 99,103, 41, 59, 10, 9, -102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,102, 40,102, 97, 99,103, 32, 60, 32, 48, 46, 48, - 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32,102, 97, 99,116, 59, 10, 9, 9,102, 97, 99,116, 32, 61, - 32,102, 97, 99,109, 59, 10, 9, 9,102, 97, 99,109, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32, -109,116,101,120, 95,118, 97,108,117,101, 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102, + 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95, 99,111,108,111, +114, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, +118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46, +114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117, +101, 95,118, 97,114,115, 40,105,110,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, + 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99,109, 41, 10,123, 10, 9,102, 97, 99,116, 32, 42, 61, 32, + 97, 98,115, 40,102, 97, 99,103, 41, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9,105, +102, 40,102, 97, 99,103, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32,102, 97, + 99,116, 59, 10, 9, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,109, 59, 10, 9, 9,102, 97, 99,109, 32, 61, 32,116,109,112, 59, + 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 98,108,101,110,100, 40,102,108,111, + 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, + 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, + 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114, +115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, + 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,109,117,108, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102, 108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, - 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, - 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, - 95,109,117,108, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, - 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, - 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, - 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, - 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32, -109,116,101,120, 95,118, 97,108,117,101, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32, -102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32, -102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, -102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99, -103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9, -105,110, 99,111,108, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42, 40, 49, 46, 48, 32, - 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111, -105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115,117, 98, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32, -102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32, -102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, -102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99, -103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32, 45,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, - 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, - 32,109,116,101,120, 95,118, 97,108,117,101, 95, 97,100,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108, -111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, - 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, - 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, - 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, -102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116, -101,120, 95,118, 97,108,117,101, 95,100,105,118, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, - 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, - 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, - 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, - 99,109, 41, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9,105,110, 99,111,108, - 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 47,116,101,120, - 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105, -100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,102,102, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32, -102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32, -102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, -102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99, -103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, - 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10, -118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,111,117,116, 99,111, -108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, - 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, - 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32, -102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42, -116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32, - 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118, -111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,111,117,116, 99,111, -108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, - 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, - 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32, -102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42, -116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32, - 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118, -111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 95,112,111,115,105,116,105,118,101, 40,102,108, -111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117, -116,102, 97, 99, 32, 61, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116, -101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108, -111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, - 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104, 97,114, 95,100, -105,118,105,100,101, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97, -114, 41, 10,123, 10, 9,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 47, 49, 50, 56, 46, 48, 59, 10,125, 10, 10,118,111,105, -100, 32,109,116,101,120, 95,104, 97,114, 95,109,117,108,116,105,112,108,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32, -104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,104, 97,114, 32, 42, 61, - 32, 49, 50, 56, 46, 48, 59, 10, 10, 9,105,102, 40,104, 97,114, 32, 60, 32, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, - 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,104, 97,114, 32, 62, 32, 53, 49, 49, 46, 48, 41, 32,111,117,116,104, - 97,114, 32, 61, 32, 53, 49, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 59, 10, -125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,102,114,111,109, 95, 99,111,108, 40,118,101, 99, 52, - 32, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 41, 10,123, 10, 9, 97,108,112,104, 97, 32, - 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,116,111, 95, 99, -111,108, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, - 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46, -114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,116,111,105, -110,116, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, - 41, 10,123, 10, 9,105,110,116,101,110,115,105,116,121, 32, 61, 32,100,111,116, 40,118,101, 99, 51, 40, 48, 46, 51, 53, 44, 32, - 48, 46, 52, 53, 44, 32, 48, 46, 50, 41, 44, 32,114,103, 98, 46,114,103, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116, -101,120, 95,118, 97,108,117,101, 95,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,105,110,118, 97,108,117,101, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,117,101, 41, 10,123, 10, 9,111,117,116,118, 97,108,117,101, 32, 61, - 32, 49, 46, 48, 32, 45, 32,105,110,118, 97,108,117,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, - 95,105,110,118,101,114,116, 40,118,101, 99, 52, 32,105,110,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, -114,103, 98, 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, - 45, 32,105,110,114,103, 98, 46,114,103, 98, 44, 32,105,110,114,103, 98, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, -116,101,120, 95,118, 97,108,117,101, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, - 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115, -116,101,110, 99,105,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,110,116,101,110,115,105,116,121, 41, 10, -123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,105,110,116,101,110,115,105,116,121, 59, 10, 9,111,117,116,105, -110,116,101,110,115,105,116,121, 32, 61, 32,105,110,116,101,110,115,105,116,121, 42,115,116,101,110, 99,105,108, 59, 10, 9,111, + 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105, +110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99, +111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115, 99,114,101,101,110, 40,102,108, +111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32, +102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111, +108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97, +114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49, + 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, + 43, 32,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117, +116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115,117, 98, 40,102,108, +111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32, +102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111, +108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97, +114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32, 45, +102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, + 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 97,100,100, 40,102,108,111, 97, +116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, + 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, + 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, + 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99, +116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, + 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,118, 40,102,108,111, 97,116, 32,111, +117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, + 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, + 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, + 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 32, 33, 61, 32, + 48, 46, 48, 41, 10, 9, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99, +116, 42,111,117,116, 99,111,108, 47,116,101,120, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 32, 61, + 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,102,102, 40,102,108, +111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32, +102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111, +108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97, +114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, +102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32, +111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100, 97,114,107, + 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, + 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105, +110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, + 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, + 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117, +116, 99,111,108, 41, 32,105,110, 99,111,108, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32, +111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,108,105,103,104,116, + 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, + 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105, +110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, + 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 41, 59, 10, 10, 9,102,108,111, 97,116, + 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117, +116, 99,111,108, 41, 32,105,110, 99,111,108, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32, +111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, + 95,112,111,115,105,116,105,118,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111, +117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, + 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, + 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, + 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105, +100, 32,109,116,101,120, 95,104, 97,114, 95,100,105,118,105,100,101, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116, + 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 47, 49, + 50, 56, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104, 97,114, 95,109,117,108,116,105,112,108,121, 95, + 99,108, 97,109,112, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97, +114, 41, 10,123, 10, 9,104, 97,114, 32, 42, 61, 32, 49, 50, 56, 46, 48, 59, 10, 10, 9,105,102, 40,104, 97,114, 32, 60, 32, 49, + 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,104, 97,114, 32, 62, + 32, 53, 49, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32, 53, 49, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,111,117, +116,104, 97,114, 32, 61, 32,104, 97,114, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,102, +114,111,109, 95, 99,111,108, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 97,108,112,104, + 97, 41, 10,123, 10, 9, 97,108,112,104, 97, 32, 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101, +120, 95, 97,108,112,104, 97, 95,116,111, 95, 99,111,108, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32, 97, +108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, + 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125, 10, 10,118,111,105,100, + 32,109,116,101,120, 95,114,103, 98,116,111,105,110,116, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, + 97,116, 32,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,105,110,116,101,110,115,105,116,121, 32, 61, 32,100,111,116, + 40,118,101, 99, 51, 40, 48, 46, 51, 53, 44, 32, 48, 46, 52, 53, 44, 32, 48, 46, 50, 41, 44, 32,114,103, 98, 46,114,103, 98, 41, + 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,105,110,118,101,114,116, 40,102,108,111, 97, +116, 32,105,110,118, 97,108,117,101, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,117,101, 41, 10,123, + 10, 9,111,117,116,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 32, 45, 32,105,110,118, 97,108,117,101, 59, 10,125, 10, 10,118, +111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,105,110,118,101,114,116, 40,118,101, 99, 52, 32,105,110,114,103, 98, 44, 32, +111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, + 52, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,105,110,114,103, 98, 46,114,103, 98, 44, 32,105,110,114,103, 98, 46, 97, + 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115,116,101,110, 99,105,108, 40,102,108, +111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, 44, 32,111,117, +116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117, +116,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,105,110,116,101, +110,115,105,116,121, 59, 10, 9,111,117,116,105,110,116,101,110,115,105,116,121, 32, 61, 32,105,110,116,101,110,115,105,116,121, + 42,115,116,101,110, 99,105,108, 59, 10, 9,111,117,116,115,116,101,110, 99,105,108, 32, 61, 32,115,116,101,110, 99,105,108, 42, +102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,116,101,110, 99,105,108, 40,102, +108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97, +116, 32,111,117,116,115,116,101,110, 99,105,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, + 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,114,103, 98, 46, 97, 59, 10, 9,111,117,116,114,103, 98, 32, 61, 32, +118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32,114,103, 98, 46, 97, 42,115,116,101,110, 99,105,108, 41, 59, 10, 9,111, 117,116,115,116,101,110, 99,105,108, 32, 61, 32,115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105, -100, 32,109,116,101,120, 95,114,103, 98, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, - 44, 32,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108, - 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, - 32, 61, 32,114,103, 98, 46, 97, 59, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, - 44, 32,114,103, 98, 46, 97, 42,115,116,101,110, 99,105,108, 41, 59, 10, 9,111,117,116,115,116,101,110, 99,105,108, 32, 61, 32, -115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105, -110,103, 95,111,102,115, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,111,102,115, 44, 32,111,117,116, - 32,118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,116,101, -120, 99,111, 32, 43, 32,111,102,115, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95, -115,105,122,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,115,105,122,101, 44, 32,111,117,116, 32, -118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,115,105,122, -101, 42,116,101,120, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103, - 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111, -117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40,118,101, 99, 46,120,121, 42, 48, 46, 53, 32, 43, 32,118,101, 99, 50, 40, 48, - 46, 53, 44, 32, 48, 46, 53, 41, 44, 32,118,101, 99, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,105, -109, 97,103,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32, -111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, - 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, - 46,120,121, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, - 95,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, - 97, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 47, 32, 84,104,101, 32,105,110, -118,101,114,116, 32,111,102, 32,116,104,101, 32,114,101,100, 32, 99,104, 97,110,110,101,108, 32,105,115, 32,116,111, 32,109, 97, -107,101, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,109, 97,112, 32, 99,111,109,112,108,105, 97,110,116, 32, -119,105,116,104, 32,116,104,101, 32,111,117,116,115,105,100,101, 32,119,111,114,108,100, 46, 10, 9, 47, 47, 32, 73,116, 32,110, -101,101,100,115, 32,116,111, 32, 98,101, 32,100,111,110,101, 32, 98,101, 99, 97,117,115,101, 32,105,110, 32, 66,108,101,110,100, -101,114, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,117,115,101,100, 32,112,111,105,110,116,115, 32,105,110, -119, 97,114,100, 46, 10, 9, 47, 47, 32, 83,104,111,117,108,100, 32,116,104,105,115, 32,101,118,101,114, 32, 99,104, 97,110,103, -101, 32,116,104,105,115, 32,110,101,103, 97,116,101, 32,109,117,115,116, 32, 98,101, 32,114,101,109,111,118,101,100, 46, 10, 32, - 32, 32, 32,118,101, 99, 52, 32, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116, -101,120, 99,111, 46,120,121, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 50, 46, 48, 42, 40,118,101, 99, 51, 40, 45, 99, -111,108,111,114, 46,114, 44, 32, 99,111,108,111,114, 46,103, 44, 32, 99,111,108,111,114, 46, 98, 41, 32, 45, 32,118,101, 99, 51, - 40, 45, 48, 46, 53, 44, 32, 48, 46, 53, 44, 32, 48, 46, 53, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, - 98,117,109,112, 95,110,111,114,109, 97,108,115, 95,105,110,105,116, 40, 32,118,101, 99, 51, 32,118, 78, 44, 32,111,117,116, 32, -118,101, 99, 51, 32,118, 78,111,114,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 44, 32,111,117,116, 32, -102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 32, 41, 10,123, 10, 9,118, 78,111,114,103, 32, - 61, 32,118, 78, 59, 10, 9,118, 78, 97, 99, 99, 32, 61, 32,118, 78, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117, -100,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 42, 32,104,101,108,112,101,114, 32,109,101,116,104,111,100, 32,116, -111, 32,101,120,116,114, 97, 99,116, 32,116,104,101, 32,117,112,112,101,114, 32,108,101,102,116, 32, 51,120, 51, 32,109, 97,116, -114,105,120, 32,102,114,111,109, 32, 97, 32, 52,120, 52, 32,109, 97,116,114,105,120, 32, 42, 47, 10,109, 97,116, 51, 32,116,111, - 95,109, 97,116, 51, 40,109, 97,116, 52, 32,109, 52, 41, 10,123, 10, 9,109, 97,116, 51, 32,109, 51, 59, 10, 9,109, 51, 91, 48, - 93, 32, 61, 32,109, 52, 91, 48, 93, 46,120,121,122, 59, 10, 9,109, 51, 91, 49, 93, 32, 61, 32,109, 52, 91, 49, 93, 46,120,121, -122, 59, 10, 9,109, 51, 91, 50, 93, 32, 61, 32,109, 52, 91, 50, 93, 46,120,121,122, 59, 10, 9,114,101,116,117,114,110, 32,109, - 51, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,111, 98,106,115,112, 97, - 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114, -109, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,109, 97,116, 52, 32,109, 86,105,101,119, 44, 32,109, 97,116, 52, 32,109, 86,105, -101,119, 73,110,118, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 73,110,118, 44, 32, - 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105, -110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102, -108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, - 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32, -118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101, -116, 32, 41, 32, 10,123, 10, 9,109, 97,116, 51, 32,111, 98,106, 50,118,105,101,119, 32, 61, 32,116,111, 95,109, 97,116, 51, 40, -109, 86,105,101,119, 32, 42, 32,109, 79, 98,106, 41, 59, 10, 9,109, 97,116, 51, 32,118,105,101,119, 50,111, 98,106, 32, 61, 32, -116,111, 95,109, 97,116, 51, 40,109, 79, 98,106, 73,110,118, 32, 42, 32,109, 86,105,101,119, 73,110,118, 41, 59, 10, 9, 10, 9, -118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,118,105,101,119, 50,111, 98,106, 32, 42, 32,100, 70,100,120, 40, 32, -115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,118,105,101,119, - 50,111, 98,106, 32, 42, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, - 78, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,115,117,114,102, 95,110,111,114,109, 32, 42, 32,111, 98,106, 50,118, -105,101,119, 32, 41, 59, 10, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, - 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, - 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, - 10, 9, 10, 9, 47, 42, 32,112,114,101,116,114, 97,110,115,102,111,114,109, 32,118, 78, 97, 99, 99, 32, 40,105,110, 32,109,116, -101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 41, 32,117,115,105,110,103, 32,116,104,101, 32,105,110,118,101,114,115,101, - 32,116,114, 97,110,115,112,111,115,101,100, 32, 42, 47, 10, 9,118, 82, 49, 32, 61, 32,118, 82, 49, 32, 42, 32,118,105,101,119, - 50,111, 98,106, 59, 10, 9,118, 82, 50, 32, 61, 32,118, 82, 50, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9,118, 78, - 32, 61, 32,118, 78, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110, -105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 32, 42, 32,108,101,110,103,116,104, 40,118, 78, 41, 59, 10, - 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116, -117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, - 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118, -111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,116,101,120,116,117,114,101,115,112, 97, 99,101, 40, - 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 32, - 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95, -105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, - 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118, -101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, - 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, -102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,100, 70,100,120, 40, 32, -115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,100, 70,100,121, - 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,115,117,114,102, 95,110,111, -114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111,108, 97,116,101,100, 32,118, -101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32,110,111,114,109, 97,108,105, -122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 32, 41, 59, 10, 9,118, 82, 50, - 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, - 32, 41, 32, 41, 59, 10, 9,102, 68,101,116, 32, 61, 32,115,105,103,110, 40, 32,100,111,116, 40,118, 83,105,103,109, 97, 83, 44, - 32,118, 82, 49, 41, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 97, - 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, - 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105, -110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105, -116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,118,105,101, -119,115,112, 97, 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, 32,115,117,114,102, - 95,110,111,114,109, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103, -110,105,116,117,100,101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, - 9, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, - 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, - 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, - 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, - 32,100, 70,100,120, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, - 32, 61, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32, -115,117,114,102, 95,110,111,114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110,116,101,114,112,111, -108, 97,116,101,100, 32,118,101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32, - 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111, -115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, - 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, 97,103,110, -105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32, -118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97, -103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, - 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, - 95,116, 97,112, 51, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, - 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, - 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 83, 84,108,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 59, 10, 9, -118,101, 99, 50, 32, 83, 84,108,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,100, 70,100,120, 40,116,101,120, 99, -111, 46,120,121, 41, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32, -100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, 32, 72,108,108, 44, 72,108, -114, 44, 72,117,108, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, - 83, 84,108,108, 41, 44, 32, 72,108,108, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, - 68, 40,105,109, 97, 44, 32, 83, 84,108,114, 41, 44, 32, 72,108,114, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116, -101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117,108, 41, 44, 32, 72,117,108, 32, 41, 59, 10, 9, 10, 9,100, - 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,108,114, 32, 45, 32, 72,108,108, 41, 59, 10, 9,100, 66,116, 32, - 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117,108, 32, 45, 32, 72,108,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32, -109,116,101,120, 95, 98,117,109,112, 95,116, 97,112, 53, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112, -108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117, -116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, - 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100, -121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 50, 32, 83, 84, 99, 32, 61, 32,116,101,120, 99,111, 46, -120,121, 59, 10, 9,118,101, 99, 50, 32, 83, 84,108, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 45, 32, 48, 46, 53, 32, 42, - 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32, - 48, 46, 53, 32, 42, 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,100, 32, 61, 32,116,101,120, 99,111, 46, -120,121, 32, 45, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117, 32, 61, 32,116, -101,120, 99,111, 46,120,121, 32, 43, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, - 32, 72, 99, 44, 72,108, 44, 72,114, 44, 72,100, 44, 72,117, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117, -114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84, 99, 41, 44, 32, 72, 99, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32, -116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108, 41, 44, 32, 72,108, 32, 41, 59, 10, 9,114,103, 98,116, -111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,114, 41, 44, 32, 72,114, 32, 41, 59, 10, - 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,100, 41, 44, 32, 72, -100, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84, -117, 41, 44, 32, 72,117, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,114, 32, - 45, 32, 72,108, 41, 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117, 32, 45, 32, 72,100, 41, - 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,100,101,114,105,118, 40, 32,118,101, 99, 51, 32, -116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95, -120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66, -115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,102,108,111, 97,116, 32,115, 32, 61, - 32, 49, 46, 48, 59, 9, 9, 47, 47, 32,110,101,103, 97,116,101, 32,116,104,105,115, 32,105,102, 32,102,108,105,112,112,101,100, - 32,116,101,120,116,117,114,101, 32, 99,111,111,114,100,105,110, 97,116,101, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, - 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32, -100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9, 10, 9, 47, 47, 32,116,104,105,115, 32,118, 97,114,105, 97, -110,116, 32,117,115,105,110,103, 32, 97, 32,100,101,114,105,118, 97,116,105,118,101, 32,109, 97,112, 32,105,115, 32,100,101,115, - 99,114,105, 98,101,100, 32,104,101,114,101, 10, 9, 47, 47, 32,104,116,116,112, 58, 47, 47,109,109,105,107,107,101,108,115,101, -110, 51,100, 46, 98,108,111,103,115,112,111,116, 46, 99,111,109, 47, 50, 48, 49, 49, 47, 48, 55, 47,100,101,114,105,118, 97,116, -105,118,101, 45,109, 97,112,115, 46,104,116,109,108, 10, 9,118,101, 99, 50, 32,100,105,109, 32, 61, 32,118,101, 99, 50, 40,105, -109, 97, 95,120, 44, 32,105,109, 97, 95,121, 41, 59, 10, 9,118,101, 99, 50, 32,100, 66,100,117,118, 32, 61, 32,104, 83, 99, 97, -108,101, 42,100,105,109, 42, 40, 50, 46, 48, 42,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, - 46,120,121, 41, 46,120,121, 45, 49, 46, 48, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84, -101,120, 68,120, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,120, 46,121, 59, 10, 9,100, 66,116, - 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,121, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84, -101,120, 68,121, 46,121, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 40, - 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,102,108,111, 97,116, 32,100, 66, -116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, - 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, - 32,111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118, -101, 99, 51, 32,118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32,100, - 66,115, 32, 42, 32,118, 82, 49, 32, 43, 32,100, 66,116, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 10, 9,118, 78, 97, 99, 99, - 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101, -114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95, -111,117,116, 32, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 95,116, -101,120,115,112, 97, 99,101, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32, -102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, 50, 44, 10, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97, -109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,102,108,111, 97,116, 32,105, -109, 97, 95,120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, - 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, -111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,101, +100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,111,102,115, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118, +101, 99, 51, 32,111,102,115, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111, +117,116,116,101,120, 99,111, 32, 61, 32,116,101,120, 99,111, 32, 43, 32,111,102,115, 59, 10,125, 10, 10,118,111,105,100, 32,109, +116,101,120, 95,109, 97,112,112,105,110,103, 95,115,105,122,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, + 51, 32,115,105,122,101, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117, +116,116,101,120, 99,111, 32, 61, 32,115,105,122,101, 42,116,101,120, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101, +120, 95, 50,100, 95,109, 97,112,112,105,110,103, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32, +111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40,118,101, 99, 46,120,121, 42, + 48, 46, 53, 32, 43, 32,118,101, 99, 50, 40, 48, 46, 53, 44, 32, 48, 46, 53, 41, 44, 32,118,101, 99, 46,122, 41, 59, 10,125, 10, + 10,118,111,105,100, 32,109,116,101,120, 95,105,109, 97,103,101, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109, +112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, + 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, + 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10, +125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32, +115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10, +123, 10, 9, 47, 47, 32, 84,104,101, 32,105,110,118,101,114,116, 32,111,102, 32,116,104,101, 32,114,101,100, 32, 99,104, 97,110, +110,101,108, 32,105,115, 32,116,111, 32,109, 97,107,101, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,109, 97, +112, 32, 99,111,109,112,108,105, 97,110,116, 32,119,105,116,104, 32,116,104,101, 32,111,117,116,115,105,100,101, 32,119,111,114, +108,100, 46, 10, 9, 47, 47, 32, 73,116, 32,110,101,101,100,115, 32,116,111, 32, 98,101, 32,100,111,110,101, 32, 98,101, 99, 97, +117,115,101, 32,105,110, 32, 66,108,101,110,100,101,114, 10, 9, 47, 47, 32,116,104,101, 32,110,111,114,109, 97,108, 32,117,115, +101,100, 32,112,111,105,110,116,115, 32,105,110,119, 97,114,100, 46, 10, 9, 47, 47, 32, 83,104,111,117,108,100, 32,116,104,105, +115, 32,101,118,101,114, 32, 99,104, 97,110,103,101, 32,116,104,105,115, 32,110,101,103, 97,116,101, 32,109,117,115,116, 32, 98, +101, 32,114,101,109,111,118,101,100, 46, 10, 32, 32, 32, 32,118,101, 99, 52, 32, 99,111,108,111,114, 32, 61, 32,116,101,120,116, +117,114,101, 50, 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, + 50, 46, 48, 42, 40,118,101, 99, 51, 40, 45, 99,111,108,111,114, 46,114, 44, 32, 99,111,108,111,114, 46,103, 44, 32, 99,111,108, +111,114, 46, 98, 41, 32, 45, 32,118,101, 99, 51, 40, 45, 48, 46, 53, 44, 32, 48, 46, 53, 44, 32, 48, 46, 53, 41, 41, 59, 10,125, + 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,110,111,114,109, 97,108,115, 95,105,110,105,116, 40, 32,118, +101, 99, 51, 32,118, 78, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78,111,114,103, 44, 32,111,117,116, 32,118,101, 99, 51, + 32,118, 78, 97, 99, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, + 32, 41, 10,123, 10, 9,118, 78,111,114,103, 32, 61, 32,118, 78, 59, 10, 9,118, 78, 97, 99, 99, 32, 61, 32,118, 78, 59, 10, 9, +102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 42, 32,104,101,108, +112,101,114, 32,109,101,116,104,111,100, 32,116,111, 32,101,120,116,114, 97, 99,116, 32,116,104,101, 32,117,112,112,101,114, 32, +108,101,102,116, 32, 51,120, 51, 32,109, 97,116,114,105,120, 32,102,114,111,109, 32, 97, 32, 52,120, 52, 32,109, 97,116,114,105, +120, 32, 42, 47, 10,109, 97,116, 51, 32,116,111, 95,109, 97,116, 51, 40,109, 97,116, 52, 32,109, 52, 41, 10,123, 10, 9,109, 97, +116, 51, 32,109, 51, 59, 10, 9,109, 51, 91, 48, 93, 32, 61, 32,109, 52, 91, 48, 93, 46,120,121,122, 59, 10, 9,109, 51, 91, 49, + 93, 32, 61, 32,109, 52, 91, 49, 93, 46,120,121,122, 59, 10, 9,109, 51, 91, 50, 93, 32, 61, 32,109, 52, 91, 50, 93, 46,120,121, +122, 59, 10, 9,114,101,116,117,114,110, 32,109, 51, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, + 95,105,110,105,116, 95,111, 98,106,115,112, 97, 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118, +101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,109, 97,116, 52, 32,109, 86,105, +101,119, 44, 32,109, 97,116, 52, 32,109, 86,105,101,119, 73,110,118, 44, 32,109, 97,116, 52, 32,109, 79, 98,106, 44, 32,109, 97, +116, 52, 32,109, 79, 98,106, 73,110,118, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114,101, +118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, + 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95, +111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, 9, 9, + 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, 44, 32,111, +117,116, 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,109, 97,116, 51, 32,111, 98,106, 50,118,105,101, +119, 32, 61, 32,116,111, 95,109, 97,116, 51, 40,109, 86,105,101,119, 32, 42, 32,109, 79, 98,106, 41, 59, 10, 9,109, 97,116, 51, + 32,118,105,101,119, 50,111, 98,106, 32, 61, 32,116,111, 95,109, 97,116, 51, 40,109, 79, 98,106, 73,110,118, 32, 42, 32,109, 86, +105,101,119, 73,110,118, 41, 59, 10, 9, 10, 9,118,101, 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,118,105,101,119, 50, +111, 98,106, 32, 42, 32,100, 70,100,120, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83, +105,103,109, 97, 84, 32, 61, 32,118,105,101,119, 50,111, 98,106, 32, 42, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111, +115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,115,117,114,102, 95, +110,111,114,109, 32, 42, 32,111, 98,106, 50,118,105,101,119, 32, 41, 59, 10, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115, + 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118, + 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105, +103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, 9, 47, 42, 32,112,114,101,116,114, 97,110,115,102,111,114,109, 32, +118, 78, 97, 99, 99, 32, 40,105,110, 32,109,116,101,120, 95, 98,117,109,112, 95, 97,112,112,108,121, 41, 32,117,115,105,110,103, + 32,116,104,101, 32,105,110,118,101,114,115,101, 32,116,114, 97,110,115,112,111,115,101,100, 32, 42, 47, 10, 9,118, 82, 49, 32, + 61, 32,118, 82, 49, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9,118, 82, 50, 32, 61, 32,118, 82, 50, 32, 42, 32,118, +105,101,119, 50,111, 98,106, 59, 10, 9,118, 78, 32, 61, 32,118, 78, 32, 42, 32,118,105,101,119, 50,111, 98,106, 59, 10, 9, 10, + 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 32, 42, 32, +108,101,110,103,116,104, 40,118, 78, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105, +110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, + 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103, +110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,105,110,105,116, 95,116, +101,120,116,117,114,101,115,112, 97, 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111,115, 44, 32,118,101, 99, 51, + 32,115,117,114,102, 95,110,111,114,109, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 9, 32, 32,102,108,111, 97,116, 32,102, 80,114, +101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, + 9, 9, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100, +101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32, 10, 9, 9, 9, 9, + 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 50, + 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,105,103, +109, 97, 83, 32, 61, 32,100, 70,100,120, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32,118, 83, +105,103,109, 97, 84, 32, 61, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9,118,101, 99, 51, 32, +118, 78, 32, 61, 32,115,117,114,102, 95,110,111,114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108,105,122,101,100, 32,105,110, +116,101,114,112,111,108, 97,116,101,100, 32,118,101,114,116,101,120, 32,110,111,114,109, 97,108, 32, 42, 47, 10, 9, 10, 9,118, + 82, 49, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32, +118, 78, 32, 41, 32, 41, 59, 10, 9,118, 82, 50, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32, 99,114,111,115,115, 40, + 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 41, 59, 10, 9,102, 68,101,116, 32, 61, 32,115,105,103,110, 40, 32, +100,111,116, 40,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 41, 32, 41, 59, 10, 9, 10, 9,102,108,111, 97,116, 32,102, 77, + 97,103,110,105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 59, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, + 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117,100,101, 32, 47, 32,102, 80,114,101, +118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95, +111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98, +117,109,112, 95,105,110,105,116, 95,118,105,101,119,115,112, 97, 99,101, 40, 32,118,101, 99, 51, 32,115,117,114,102, 95,112,111, +115, 44, 32,118,101, 99, 51, 32,115,117,114,102, 95,110,111,114,109, 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,102,108, +111, 97,116, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, + 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 80,114,101,118, 77, + 97,103,110,105,116,117,100,101, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,111,117,116, + 44, 32, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,111,117,116, 32,118, +101, 99, 51, 32,118, 82, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 68,101,116, 32, 41, 32, 10,123, 10, 9,118,101, + 99, 51, 32,118, 83,105,103,109, 97, 83, 32, 61, 32,100, 70,100,120, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, 10, 9, +118,101, 99, 51, 32,118, 83,105,103,109, 97, 84, 32, 61, 32,100, 70,100,121, 40, 32,115,117,114,102, 95,112,111,115, 32, 41, 59, + 10, 9,118,101, 99, 51, 32,118, 78, 32, 61, 32,115,117,114,102, 95,110,111,114,109, 59, 32, 47, 42, 32,110,111,114,109, 97,108, +105,122,101,100, 32,105,110,116,101,114,112,111,108, 97,116,101,100, 32,118,101,114,116,101,120, 32,110,111,114,109, 97,108, 32, + 42, 47, 10, 9, 10, 9,118, 82, 49, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 83,105,103,109, 97, 84, 44, 32,118, 78, 32, 41, + 59, 10, 9,118, 82, 50, 32, 61, 32, 99,114,111,115,115, 40, 32,118, 78, 44, 32,118, 83,105,103,109, 97, 83, 32, 41, 32, 59, 10, + 9,102, 68,101,116, 32, 61, 32,100,111,116, 32, 40, 32,118, 83,105,103,109, 97, 83, 44, 32,118, 82, 49, 32, 41, 59, 10, 9, 10, + 9,102,108,111, 97,116, 32,102, 77, 97,103,110,105,116,117,100,101, 32, 61, 32, 97, 98,115, 40,102, 68,101,116, 41, 59, 10, 9, +118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 42, 32, 40,102, 77, 97,103,110,105,116,117, +100,101, 32, 47, 32,102, 80,114,101,118, 77, 97,103,110,105,116,117,100,101, 95,105,110, 41, 59, 10, 9,102, 80,114,101,118, 77, + 97,103,110,105,116,117,100,101, 95,111,117,116, 32, 61, 32,102, 77, 97,103,110,105,116,117,100,101, 59, 10,125, 10, 10,118,111, +105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,116, 97,112, 51, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, + 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, + 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 83, 84,108,108, 32, 61, + 32,116,101,120, 99,111, 46,120,121, 59, 10, 9,118,101, 99, 50, 32, 83, 84,108,114, 32, 61, 32,116,101,120, 99,111, 46,120,121, + 32, 43, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,117,108, 32, 61, + 32,116,101,120, 99,111, 46,120,121, 32, 43, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 32, 59, 10, 9, 10, 9, +102,108,111, 97,116, 32, 72,108,108, 44, 72,108,114, 44, 72,117,108, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120, +116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108,108, 41, 44, 32, 72,108,108, 32, 41, 59, 10, 9,114,103, 98,116,111, + 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108,114, 41, 44, 32, 72,108,114, 32, 41, 59, + 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117,108, 41, 44, + 32, 72,117,108, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,108,114, 32, 45, + 32, 72,108,108, 41, 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99, 97,108,101, 32, 42, 32, 40, 72,117,108, 32, 45, 32, 72,108, +108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95,116, 97,112, 53, 40, 32,118,101, 99, 51, + 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,102,108,111, 97,116, 32,104, 83, 99, + 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,111,117,116, 32,102, +108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, - 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 51, 32, -118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101,116, 41, 32, 42, 32, 40, 32, 10, 9, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,115, 32, 47, 32,108,101,110,103,116,104, 40, 32,118,101, 99, 50, 40,105,109, 97, 95, -120, 42, 84,101,120, 68,120, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,120, 46,121, 41, 32, 41, 32, 42, 32,118, 82, - 49, 32, 43, 32, 10, 9, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,116, 32, 47, 32,108,101,110,103,116,104, 40, 32, -118,101, 99, 50, 40,105,109, 97, 95,120, 42, 84,101,120, 68,121, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, 68,121, 46, -121, 41, 32, 41, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 9, 9, 9, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32, -118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, 59, 10, 9,112,101,114,116,117,114, 98,101,100, - 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,111,117,116, 32, 41, 59, 10, -125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,101,103, 97,116,101, 95,116,101,120,110,111,114,109, 97,108, 40,118,101, - 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, - 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 45,110,111,114,109, 97,108, 46,120, 44, 32, 45,110, -111,114,109, 97,108, 46,121, 44, 32,110,111,114,109, 97,108, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, - 95,110,115,112, 97, 99,101, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, 32,116, 97,110,103,101,110,116, 44, 32,118,101, - 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,116,101,120,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118, -101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,118,101, 99, 51, 32, 66, 32, 61, 32,116, 97,110,103,101, -110,116, 46,119, 32, 42, 32, 99,114,111,115,115, 40,110,111,114,109, 97,108, 44, 32,116, 97,110,103,101,110,116, 46,120,121,122, - 41, 59, 10, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,116,101,120,110,111,114,109, 97,108, 46,120, 42,116, 97,110, -103,101,110,116, 46,120,121,122, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,121, 42, 66, 32, 43, 32,116,101,120,110,111, -114,109, 97,108, 46,122, 42,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, - 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98, -108,101,110,100, 95,110,111,114,109, 97,108, 40,102,108,111, 97,116, 32,110,111,114,102, 97, 99, 44, 32,118,101, 99, 51, 32,110, -111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,110,101,119,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32, -111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32, 40, 49, 46, 48, 32, 45, - 32,110,111,114,102, 97, 99, 41, 42,110,111,114,109, 97,108, 32, 43, 32,110,111,114,102, 97, 99, 42,110,101,119,110,111,114,109, - 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111, -114,109, 97,108, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 32, 77, 65, 84, 69, 82, 73, 65, 76, 32, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,117,110, - 95,104,101,109,105, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, - 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, - 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32,108, 97,109,112,118,101, 99, 59, 10, 9,100,105,115,116, 32, 61, 32, 49, 46, 48, - 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118, -105,115,105, 98,105,108,105,116,121, 95,111,116,104,101,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,108, 97, -109,112, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115, -116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32, 99,111, - 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 9,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40,108,118, 41, 59, 10, 9, -108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, - 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,108,105,110,101, - 97,114, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, - 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 41, 59, 10,125, 10, 10,118,111, -105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,115,113,117, 97,114,101, 40,102,108,111, 97,116, 32, -108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, -118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40, -108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, - 97,109,112, 95,102, 97,108,108,111,102,102, 95,115,108,105,100,101,114,115, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105, -115,116, 44, 32,102,108,111, 97,116, 32,108,100, 49, 44, 32,102,108,111, 97,116, 32,108,100, 50, 44, 32,102,108,111, 97,116, 32, -100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97, -116, 32,108, 97,109,112,100,105,115,116,107,119, 32, 61, 32,108, 97,109,112,100,105,115,116, 42,108, 97,109,112,100,105,115,116, - 59, 10, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, - 32, 43, 32,108,100, 49, 42,100,105,115,116, 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 42, 61, 32,108, 97,109,112,100,105, -115,116,107,119, 47, 40,108, 97,109,112,100,105,115,116,107,119, 32, 43, 32,108,100, 50, 42,100,105,115,116, 42,100,105,115,116, - 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95, 99,117,114,118,101, 40,102,108, -111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32, 99,117,114,118,101,109, 97,112, - 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, - 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40, 99,117,114,118,101,109, 97,112, - 44, 32,118,101, 99, 50, 40,100,105,115,116, 47,108, 97,109,112,100,105,115,116, 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10,125, - 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,104,101,114,101, 40,102,108, -111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,102,108,111, 97,116, 32, -118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, - 10, 9,102,108,111, 97,116, 32,116, 61, 32,108, 97,109,112,100,105,115,116, 32, 45, 32,100,105,115,116, 59, 10, 10, 9,111,117, -116,118,105,115,105,102, 97, 99, 61, 32,118,105,115,105,102, 97, 99, 42,109, 97,120, 40,116, 44, 32, 48, 46, 48, 41, 47,108, 97, -109,112,100,105,115,116, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, -115,112,111,116, 95,115,113,117, 97,114,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,109, 97,116, 52, 32,108, - 97,109,112,105,109, 97,116, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112,114, - 41, 10,123, 10, 9,105,102, 40,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 62, 32, 48, 46, 48, 41, 32, -123, 10, 9, 9,118,101, 99, 51, 32,108,118,114,111,116, 32, 61, 32, 40,108, 97,109,112,105,109, 97,116, 42,118,101, 99, 52, 40, -108,118, 44, 32, 48, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9, 9,102,108,111, 97,116, 32,120, 32, 61, 32,109, 97,120, 40, 97, - 98,115, 40,108,118,114,111,116, 46,120, 47,108,118,114,111,116, 46,122, 41, 44, 32, 97, 98,115, 40,108,118,114,111,116, 46,121, - 47,108,118,114,111,116, 46,122, 41, 41, 59, 10, 10, 9, 9,105,110,112,114, 32, 61, 32, 49, 46, 48, 47,115,113,114,116, 40, 49, - 46, 48, 32, 43, 32,120, 42,120, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 10, 9, 9,105,110,112,114, 32, 61, 32, 48, 46, 48, - 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 95, 99, -105,114, 99,108,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, - 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,105,110,112,114, 32, 61, 32,100,111,116, 40,108,118, 44, 32,108, - 97,109,112,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, - 95,115,112,111,116, 40,102,108,111, 97,116, 32,115,112,111,116,115,105, 44, 32,102,108,111, 97,116, 32,115,112,111,116, 98,108, - 44, 32,102,108,111, 97,116, 32,105,110,112,114, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, - 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 32, 61, 32, -115,112,111,116,115,105, 59, 10, 10, 9,105,102, 40,105,110,112,114, 32, 60, 61, 32,116, 41, 32,123, 10, 9, 9,111,117,116,118, -105,115,105,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 32, 61, 32,105, -110,112,114, 32, 45, 32,116, 59, 10, 10, 9, 9, 47, 42, 32,115,111,102,116, 32, 97,114,101, 97, 32, 42, 47, 10, 9, 9,105,102, - 40,115,112,111,116, 98,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,105,110,112,114, 32, 42, 61, 32,115,109,111,111,116, -104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,116, 47,115,112,111,116, 98,108, 41, 59, 10, 10, 9, 9,111,117, -116,118,105,115,105,102, 97, 99, 32, 61, 32,118,105,115,105,102, 97, 99, 42,105,110,112,114, 59, 10, 9,125, 10,125, 10, 10,118, -111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32, + 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 10, 9,118,101, 99, 50, 32, + 83, 84, 99, 32, 61, 32,116,101,120, 99,111, 46,120,121, 59, 10, 9,118,101, 99, 50, 32, 83, 84,108, 32, 61, 32,116,101,120, 99, +111, 46,120,121, 32, 45, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, 83, 84,114, 32, 61, + 32,116,101,120, 99,111, 46,120,121, 32, 43, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,120, 32, 59, 10, 9,118,101, 99, 50, 32, + 83, 84,100, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 45, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68,121, 32, 59, 10, 9, +118,101, 99, 50, 32, 83, 84,117, 32, 61, 32,116,101,120, 99,111, 46,120,121, 32, 43, 32, 48, 46, 53, 32, 42, 32, 84,101,120, 68, +121, 32, 59, 10, 9, 10, 9,102,108,111, 97,116, 32, 72, 99, 44, 72,108, 44, 72,114, 44, 72,100, 44, 72,117, 59, 10, 9,114,103, + 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84, 99, 41, 44, 32, 72, 99, 32, 41, + 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,108, 41, 44, + 32, 72,108, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, + 83, 84,114, 41, 44, 32, 72,114, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117,114,101, 50, 68, 40, +105,109, 97, 44, 32, 83, 84,100, 41, 44, 32, 72,100, 32, 41, 59, 10, 9,114,103, 98,116,111, 98,119, 40, 32,116,101,120,116,117, +114,101, 50, 68, 40,105,109, 97, 44, 32, 83, 84,117, 41, 44, 32, 72,117, 32, 41, 59, 10, 9, 10, 9,100, 66,115, 32, 61, 32,104, + 83, 99, 97,108,101, 32, 42, 32, 40, 72,114, 32, 45, 32, 72,108, 41, 59, 10, 9,100, 66,116, 32, 61, 32,104, 83, 99, 97,108,101, + 32, 42, 32, 40, 72,117, 32, 45, 32, 72,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,117,109,112, 95, +100,101,114,105,118, 40, 32,118,101, 99, 51, 32,116,101,120, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, + 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,102,108,111, 97, +116, 32,104, 83, 99, 97,108,101, 44, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, +111,117,116, 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100, 66,116, 32, 41, 32, 10, +123, 10, 9,102,108,111, 97,116, 32,115, 32, 61, 32, 49, 46, 48, 59, 9, 9, 47, 47, 32,110,101,103, 97,116,101, 32,116,104,105, +115, 32,105,102, 32,102,108,105,112,112,101,100, 32,116,101,120,116,117,114,101, 32, 99,111,111,114,100,105,110, 97,116,101, 10, + 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9,118, +101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46,120,121, 41, 59, 10, 9, 10, 9, 47, + 47, 32,116,104,105,115, 32,118, 97,114,105, 97,110,116, 32,117,115,105,110,103, 32, 97, 32,100,101,114,105,118, 97,116,105,118, +101, 32,109, 97,112, 32,105,115, 32,100,101,115, 99,114,105, 98,101,100, 32,104,101,114,101, 10, 9, 47, 47, 32,104,116,116,112, + 58, 47, 47,109,109,105,107,107,101,108,115,101,110, 51,100, 46, 98,108,111,103,115,112,111,116, 46, 99,111,109, 47, 50, 48, 49, + 49, 47, 48, 55, 47,100,101,114,105,118, 97,116,105,118,101, 45,109, 97,112,115, 46,104,116,109,108, 10, 9,118,101, 99, 50, 32, +100,105,109, 32, 61, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 44, 32,105,109, 97, 95,121, 41, 59, 10, 9,118,101, 99, 50, 32, +100, 66,100,117,118, 32, 61, 32,104, 83, 99, 97,108,101, 42,100,105,109, 42, 40, 50, 46, 48, 42,116,101,120,116,117,114,101, 50, + 68, 40,105,109, 97, 44, 32,116,101,120, 99,111, 46,120,121, 41, 46,120,121, 45, 49, 46, 48, 41, 59, 10, 9, 10, 9,100, 66,115, + 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,120, 46,120, 32, 43, 32,115, 42,100, 66,100,117,118, 46,121, 42, 84, +101,120, 68,120, 46,121, 59, 10, 9,100, 66,116, 32, 61, 32,100, 66,100,117,118, 46,120, 42, 84,101,120, 68,121, 46,120, 32, 43, + 32,115, 42,100, 66,100,117,118, 46,121, 42, 84,101,120, 68,121, 46,121, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, + 95, 98,117,109,112, 95, 97,112,112,108,121, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, 32,102,108,111, 97,116, 32,100, + 66,115, 44, 32,102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, 32,118,101, 99, 51, 32,118, 82, + 50, 44, 32,118,101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 32, 32,111,117,116, 32,118,101, 99, + 51, 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95, +110,111,114,109, 32, 41, 32, 10,123, 10, 9,118,101, 99, 51, 32,118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, + 40,102, 68,101,116, 41, 32, 42, 32, 40, 32,100, 66,115, 32, 42, 32,118, 82, 49, 32, 43, 32,100, 66,116, 32, 42, 32,118, 82, 50, + 32, 41, 59, 10, 9, 10, 9,118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83, +117,114,102, 71,114, 97,100, 59, 10, 9,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97, +108,105,122,101, 40, 32,118, 78, 97, 99, 99, 95,111,117,116, 32, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, + 98,117,109,112, 95, 97,112,112,108,121, 95,116,101,120,115,112, 97, 99,101, 40, 32,102,108,111, 97,116, 32,102, 68,101,116, 44, + 32,102,108,111, 97,116, 32,100, 66,115, 44, 32,102,108,111, 97,116, 32,100, 66,116, 44, 32,118,101, 99, 51, 32,118, 82, 49, 44, + 32,118,101, 99, 51, 32,118, 82, 50, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,118,101, 99, 51, 32,116,101, +120, 99,111, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,120, 44, 32,102,108,111, 97,116, 32,105,109, 97, 95,121, 44, 32,118, +101, 99, 51, 32,118, 78, 97, 99, 99, 95,105,110, 44, 10, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32,111,117,116, 32,118,101, 99, 51, + 32,118, 78, 97, 99, 99, 95,111,117,116, 44, 32,111,117,116, 32,118,101, 99, 51, 32,112,101,114,116,117,114, 98,101,100, 95,110, +111,114,109, 32, 41, 32, 10,123, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,120, 32, 61, 32,100, 70,100,120, 40,116,101,120, 99, +111, 46,120,121, 41, 59, 10, 9,118,101, 99, 50, 32, 84,101,120, 68,121, 32, 61, 32,100, 70,100,121, 40,116,101,120, 99,111, 46, +120,121, 41, 59, 10, 10, 9,118,101, 99, 51, 32,118, 83,117,114,102, 71,114, 97,100, 32, 61, 32,115,105,103,110, 40,102, 68,101, +116, 41, 32, 42, 32, 40, 32, 10, 9, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66,115, 32, 47, 32,108,101,110,103,116, +104, 40, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 42, 84,101,120, 68,120, 46,120, 44, 32,105,109, 97, 95,121, 42, 84,101,120, + 68,120, 46,121, 41, 32, 41, 32, 42, 32,118, 82, 49, 32, 43, 32, 10, 9, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,100, 66, +116, 32, 47, 32,108,101,110,103,116,104, 40, 32,118,101, 99, 50, 40,105,109, 97, 95,120, 42, 84,101,120, 68,121, 46,120, 44, 32, +105,109, 97, 95,121, 42, 84,101,120, 68,121, 46,121, 41, 32, 41, 32, 42, 32,118, 82, 50, 32, 41, 59, 10, 9, 9, 9, 9, 10, 9, +118, 78, 97, 99, 99, 95,111,117,116, 32, 61, 32,118, 78, 97, 99, 99, 95,105,110, 32, 45, 32,118, 83,117,114,102, 71,114, 97,100, + 59, 10, 9,112,101,114,116,117,114, 98,101,100, 95,110,111,114,109, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 32,118, + 78, 97, 99, 99, 95,111,117,116, 32, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,101,103, 97,116,101, 95, +116,101,120,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32, +111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 45, +110,111,114,109, 97,108, 46,120, 44, 32, 45,110,111,114,109, 97,108, 46,121, 44, 32,110,111,114,109, 97,108, 46,122, 41, 59, 10, +125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,115,112, 97, 99,101, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 52, + 32,116, 97,110,103,101,110,116, 44, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,116,101,120,110, +111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,118,101, + 99, 51, 32, 66, 32, 61, 32,116, 97,110,103,101,110,116, 46,119, 32, 42, 32, 99,114,111,115,115, 40,110,111,114,109, 97,108, 44, + 32,116, 97,110,103,101,110,116, 46,120,121,122, 41, 59, 10, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,116,101,120, +110,111,114,109, 97,108, 46,120, 42,116, 97,110,103,101,110,116, 46,120,121,122, 32, 43, 32,116,101,120,110,111,114,109, 97,108, + 46,121, 42, 66, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,122, 42,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110, +111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, + 10,118,111,105,100, 32,109,116,101,120, 95, 98,108,101,110,100, 95,110,111,114,109, 97,108, 40,102,108,111, 97,116, 32,110,111, +114,102, 97, 99, 44, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,110,101,119,110,111,114,109, 97, +108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,110,111,114, +109, 97,108, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32,110,111,114,102, 97, 99, 41, 42,110,111,114,109, 97,108, 32, 43, 32,110,111, +114,102, 97, 99, 42,110,101,119,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114, +109, 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 32, 77, + 65, 84, 69, 82, 73, 65, 76, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105, +115,105, 98,105,108,105,116,121, 95,115,117,110, 95,104,101,109,105, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32, +111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, + 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32,108, 97,109,112,118,101, 99, 59, + 10, 9,100,105,115,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, + 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,111,116,104,101,114, 40,118,101, 99, 51, + 32, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111, +117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, + 41, 10,123, 10, 9,108,118, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 9,100,105,115,116, 32, 61, 32,108, +101,110,103,116,104, 40,108,118, 41, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, + 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108, +108,111,102,102, 95,105,110,118,108,105,110,101, 97,114, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102, +108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, + 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32, +100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,110,118,115, +113,117, 97,114,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, + 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, + 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 42,100,105,115,116, + 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,115,108,105,100,101,114,115, 40, +102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,108,100, 49, 44, 32,102,108,111, 97,116, + 32,108,100, 50, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105, +102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116,107,119, 32, 61, 32,108, 97,109,112,100, +105,115,116, 42,108, 97,109,112,100,105,115,116, 59, 10, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105, +115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,108,100, 49, 42,100,105,115,116, 41, 59, 10, 9,118,105,115,105,102, + 97, 99, 32, 42, 61, 32,108, 97,109,112,100,105,115,116,107,119, 47, 40,108, 97,109,112,100,105,115,116,107,119, 32, 43, 32,108, +100, 50, 42,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108, +111,102,102, 95, 99,117,114,118,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,115, 97,109,112,108,101, +114, 50, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,116,101,120,116,117,114, +101, 50, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,118,101, 99, 50, 40,100,105,115,116, 47,108, 97,109,112,100,105,115,116, + 44, 32, 48, 46, 48, 41, 41, 46,120, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105, +116,121, 95,115,112,104,101,114,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32, +100,105,115,116, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111, +117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 61, 32,108, 97,109,112,100,105,115,116, 32, + 45, 32,100,105,115,116, 59, 10, 10, 9,111,117,116,118,105,115,105,102, 97, 99, 61, 32,118,105,115,105,102, 97, 99, 42,109, 97, +120, 40,116, 44, 32, 48, 46, 48, 41, 47,108, 97,109,112,100,105,115,116, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, + 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 95,115,113,117, 97,114,101, 40,118,101, 99, 51, 32,108, 97,109, +112,118,101, 99, 44, 32,109, 97,116, 52, 32,108, 97,109,112,105,109, 97,116, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117, +116, 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,105,102, 40,100,111,116, 40,108,118, 44, 32,108, 97,109,112, +118,101, 99, 41, 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,118,114,111,116, 32, 61, 32, 40,108, 97, +109,112,105,109, 97,116, 42,118,101, 99, 52, 40,108,118, 44, 32, 48, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9, 9,102,108,111, + 97,116, 32,120, 32, 61, 32,109, 97,120, 40, 97, 98,115, 40,108,118,114,111,116, 46,120, 47,108,118,114,111,116, 46,122, 41, 44, + 32, 97, 98,115, 40,108,118,114,111,116, 46,121, 47,108,118,114,111,116, 46,122, 41, 41, 59, 10, 10, 9, 9,105,110,112,114, 32, + 61, 32, 49, 46, 48, 47,115,113,114,116, 40, 49, 46, 48, 32, 43, 32,120, 42,120, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 10, + 9, 9,105,110,112,114, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98, +105,108,105,116,121, 95,115,112,111,116, 95, 99,105,114, 99,108,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32, +118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,105,110,112,114, + 32, 61, 32,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109, +112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,111,116, 40,102,108,111, 97,116, 32,115,112,111,116,115,105, 44, 32, +102,108,111, 97,116, 32,115,112,111,116, 98,108, 44, 32,102,108,111, 97,116, 32,105,110,112,114, 44, 32,102,108,111, 97,116, 32, 118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, - 10, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 40,118,105,115,105,102, 97, 99, 32, 60, 32, 48, 46, 48, 48, 49, 41, - 63, 32, 48, 46, 48, 58, 32,118,105,115,105,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,118,105, -101,119, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 41, 10,123, 10, 9, 47, 42, - 32,104, 97,110,100,108,101, 32,112,101,114,115,112,101, 99,116,105,118,101, 47,111,114,116,104,111,103,114, 97,112,104,105, 99, - 32, 42, 47, 10, 9,118,105,101,119, 32, 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, - 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 58, 32,118, -101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 45, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97, -100,101, 95,116, 97,110,103,101,110,116, 95,118, 40,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,116, 97,110,103, 44, - 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99, 32, 61, 32, 99,114,111,115,115, 40, -108,118, 44, 32,116, 97,110,103, 41, 59, 10, 9,118,101, 99, 51, 32,118,110,111,114, 32, 61, 32, 99,114,111,115,115, 40, 99, 44, - 32,116, 97,110,103, 41, 59, 10, 10, 9,118,110, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,118,110,111,114, 41, 59, - 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, - 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,105,110,112, 32, 61, 32,100,111,116, - 40,118,110, 44, 32,108,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,110,111, 95,100,105, -102,102,117,115,101, 40,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 48, 59, - 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,104,101,109,105, 40,102,108,111, 97,116, 32,105,110,112, - 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 53, 42,105,110,112, 32, - 43, 32, 48, 46, 53, 59, 10,125, 10, 10,102,108,111, 97,116, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, - 40,109, 97,116, 52, 32, 97,114,101, 97, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, - 9,118,101, 99, 51, 32,118,101, 99, 91, 52, 93, 44, 32, 99, 91, 52, 93, 59, 10, 9,102,108,111, 97,116, 32,114, 97,100, 91, 52, - 93, 44, 32,102, 97, 99, 59, 10, 9, 10, 9,118,101, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, - 32, 45, 32, 97,114,101, 97, 91, 48, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97, -108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 49, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 50, 93, 32, - 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 50, 93, 46,120,121,122, 41, 59, 10, 9, -118,101, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 51, 93, 46, -120,121,122, 41, 59, 10, 10, 9, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118, -101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9, 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,108,105, -122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9, 99, 91, 50, 93, - 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, - 93, 41, 41, 59, 10, 9, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, - 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,114, 97,100, 91, 48, 93, 32, 61, 32, 97, 99,111,115, 40,100, -111,116, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 49, 93, 32, 61, 32, 97, - 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 50, - 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10, 9, -114, 97,100, 91, 51, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, - 41, 41, 59, 10, 10, 9,102, 97, 99, 61, 32, 32,114, 97,100, 91, 48, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 48, 93, 41, - 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 49, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 49, 93, 41, 59, 10, 9, -102, 97, 99, 43, 61, 32,114, 97,100, 91, 50, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 50, 93, 41, 59, 10, 9,102, 97, 99, - 43, 61, 32,114, 97,100, 91, 51, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 51, 93, 41, 59, 10, 10, 9,114,101,116,117,114, -110, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105, -110,112, 95, 97,114,101, 97, 40,118,101, 99, 51, 32,112,111,115,105,116,105,111,110, 44, 32,118,101, 99, 51, 32,108, 97,109,112, - 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,109, 97,116, 52, 32, - 97,114,101, 97, 44, 32,102,108,111, 97,116, 32, 97,114,101, 97,115,105,122,101, 44, 32,102,108,111, 97,116, 32,107, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99,111, 32, 61, 32,112,111,115,105,116, -105,111,110, 59, 10, 9,118,101, 99, 51, 32,118,101, 99, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 10, 9, -105,102, 40,100,111,116, 40,118,101, 99, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, -105,110,112, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,105,110, -116,101,110,115, 32, 61, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, 40, 97,114,101, 97, 44, 32, 99,111, - 44, 32,118,110, 41, 59, 10, 10, 9, 9,105,110,112, 32, 61, 32,112,111,119, 40,105,110,116,101,110,115, 42, 97,114,101, 97,115, -105,122,101, 44, 32,107, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115, -101, 95,111,114,101,110, 95,110, 97,121,101,114, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118, -101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104, 44, 32,111,117,116, 32, -102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, -118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, - 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32, -118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,114,101, 97,108,110,108, 32, 61, 32,100,111,116, 40,110, 44, - 32,108, 41, 59, 10, 10, 9,105,102, 40,114,101, 97,108,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, - 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, -105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,118,104, 32, - 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 76, -105,116, 95, 65, 32, 61, 32, 97, 99,111,115, 40,114,101, 97,108,110,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 86,105,101, -119, 95, 65, 32, 61, 32, 97, 99,111,115, 40,110,118, 41, 59, 10, 10, 9, 9,118,101, 99, 51, 32, 76,105,116, 95, 66, 32, 61, 32, -110,111,114,109, 97,108,105,122,101, 40,108, 32, 45, 32,114,101, 97,108,110,108, 42,110, 41, 59, 10, 9, 9,118,101, 99, 51, 32, - 86,105,101,119, 95, 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 45, 32,110,118, 42,110, 41, 59, 10, 10, 9, - 9,102,108,111, 97,116, 32,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 76,105,116, 95, 66, 44, 32, 86,105,101,119, 95, 66, - 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 97, 44, 32, 98, 59, 10, 10, 9, 9,105,102, 40, 76,105, -116, 95, 65, 32, 62, 32, 86,105,101,119, 95, 65, 41, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9, - 9, 98, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 97, 32, 61, - 32, 86,105,101,119, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9,125, 10, 10, 9, 9,102,108, -111, 97,116, 32, 65, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 48, 46, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, - 41, 47, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 51, 51, 41, 41, 41, 59, 10, 9, 9,102,108, -111, 97,116, 32, 66, 32, 61, 32, 48, 46, 52, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47, 40, 40,114,111, -117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 48, 57, 41, 41, 59, 10, 10, 9, 9, 98, 32, 42, 61, 32, 48, 46, 57, - 53, 59, 10, 9, 9,105,115, 32, 61, 32,110,108, 42, 40, 65, 32, 43, 32, 40, 66, 32, 42, 32,116, 32, 42, 32,115,105,110, 40, 97, - 41, 32, 42, 32,116, 97,110, 40, 98, 41, 41, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100, -105,102,102,117,115,101, 95,116,111,111,110, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, - 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, - 40,110, 44, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, - 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,105,115, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115, -101, 32,105,102, 40, 97,110,103, 32, 62, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116, -115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105, -115, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41, - 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,109,105,110,110, 97,101,114,116, - 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, - 32,100, 97,114,107,110,101,115,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,102, 40,110, -108, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, - 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, - 46, 48, 41, 59, 10, 10, 9, 9,105,102, 40,100, 97,114,107,110,101,115,115, 32, 60, 61, 32, 49, 46, 48, 41, 10, 9, 9, 9,105, -115, 32, 61, 32,110,108, 42,112,111,119, 40,109, 97,120, 40,110,118, 42,110,108, 44, 32, 48, 46, 49, 41, 44, 32,100, 97,114,107, -110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112, -111,119, 40, 49, 46, 48, 48, 48, 49, 32, 45, 32,110,118, 44, 32,100, 97,114,107,110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, - 10, 9,125, 10,125, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,102, 97, 99, 40,118,101, 99, 51, 32,118,105, -101,119, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,102,108,111, 97,116, 32,103,114, 97,100, 44, 32,102,108,111, 97,116, 32,102, - 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 49, 44, 32,116, 50, 59, 10, 9,102,108,111, 97,116, 32,102,102, 97, 99, - 59, 10, 10, 9,105,102, 40,102, 97, 99, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, - 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 49, 61, 32,100,111,116, 40,118,105,101,119, 44, 32,118,110, 41, 59, - 10, 9, 9,105,102, 40,116, 49, 62, 48, 46, 48, 41, 32, 32,116, 50, 61, 32, 49, 46, 48, 43,116, 49, 59, 10, 9, 9,101,108,115, -101, 32,116, 50, 61, 32, 49, 46, 48, 45,116, 49, 59, 10, 10, 9, 9,116, 50, 61, 32,103,114, 97,100, 32, 43, 32, 40, 49, 46, 48, - 45,103,114, 97,100, 41, 42,112,111,119, 40,116, 50, 44, 32,102, 97, 99, 41, 59, 10, 10, 9, 9,105,102, 40,116, 50, 60, 48, 46, - 48, 41, 32,102,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40,116, 50, 62, 49, 46, 48, 41, - 32,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,102,102, 97, 99, 32, 61, 32,116, 50, 59, 10, 9, -125, 10, 10, 9,114,101,116,117,114,110, 32,102,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100, -105,102,102,117,115,101, 95,102,114,101,115,110,101,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, - 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 95,105, 44, 32,102,108,111, 97,116, 32,102, - 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32,102,114,101,115,110,101, -108, 95,102, 97, 99, 40,108,118, 44, 32,118,110, 44, 32,102, 97, 99, 95,105, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111, -105,100, 32,115,104, 97,100,101, 95, 99,117, 98,105, 99, 40,102,108,111, 97,116, 32,105,115, 44, 32,111,117,116, 32,102,108,111, - 97,116, 32,111,117,116,105,115, 41, 10,123, 10, 9,105,102, 40,105,115, 62, 48, 46, 48, 32, 38, 38, 32,105,115, 60, 49, 46, 48, - 41, 10, 9, 9,111,117,116,105,115, 61, 32,115,109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32, -105,115, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,105,115, 61, 32,105,115, 59, 10,125, 10, 10,118,111,105,100, 32, -115,104, 97,100,101, 95,118,105,115,105,102, 97, 99, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,118,105,115, -105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,114,101,102,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105, - 41, 10,123, 10, 9, 47, 42,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 42, 47, 10, 9, 9,111,117,116,105, 32, 61, 32,109, 97, -120, 40,105, 42,118,105,115,105,102, 97, 99, 42,114,101,102,108, 44, 32, 48, 46, 48, 41, 59, 10, 9, 47, 42,101,108,115,101, 10, - 9, 9,111,117,116,105, 32, 61, 32,105, 59, 42, 47, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116, 97,110,103, -101,110,116, 95,118, 95,115,112,101, 99, 40,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118, -110, 41, 10,123, 10, 9,118,110, 32, 61, 32,116, 97,110,103, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97, -100,100, 95,116,111, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,105, 44, 32,118,101, 99, 51, 32,108, 97,109,112, - 99,111,108, 44, 32,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10, -123, 10, 9,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,105, 42,108, 97,109,112, - 99,111,108, 42, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 48, - 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,104,101,109, -105, 95,115,112,101, 99, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,118,105, -101,119, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,102,108,111, 97, -116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,108,118, 32, 43, 61, - 32,118,105,101,119, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10, 10, 9,116, 32, - 61, 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10, 9,116, 32, 61, 32, 48, 46, 53, 42,116, 32, 43, 32, 48, 46, 53, 59, - 10, 10, 9,116, 32, 61, 32,118,105,115,105,102, 97, 99, 42,115,112,101, 99, 42,112,111,119, 40,116, 44, 32,104, 97,114,100, 41, - 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,112,104,111,110,103, 95,115,112,101, 99, 40,118,101, 99, 51, 32, -110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111, -117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111, -114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,109, 97, -120, 40,100,111,116, 40,104, 44, 32,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,112, -111,119, 40,114,115,108,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 99,111, -111,107,116,111,114,114, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, - 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, - 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, - 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 10, 9,105,102, 40,110,104, 32, - 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108, -115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, - 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,105, 32, 61, 32,112,111,119, 40,110,104, 44, 32,104, 97,114,100, 41, - 59, 10, 10, 9, 9,105, 32, 61, 32,105, 47, 40, 48, 46, 49, 43,110,118, 41, 59, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, - 32,105, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 98,108,105,110,110, 95,115,112,101, 99, 40, -118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,101, -102,114, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 95,112,111,119,101,114, 44, 32,111,117,116, 32,102,108,111, 97, -116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,105,102, 40,114,101,102,114, 97, 99, 32, 60, 32, 49, 46, 48, 41, 32,123, - 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,115,112, -101, 99, 95,112,111,119,101,114, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, - 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,115,112,101, 99, 95,112,111,119,101,114, 60, 49, - 48, 48, 46, 48, 41, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32,115,113,114,116, 40, 49, 46, 48, 47,115,112, -101, 99, 95,112,111,119,101,114, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, - 32, 49, 48, 46, 48, 47,115,112,101, 99, 95,112,111,119,101,114, 59, 10, 10, 9, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111, -114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, - 40,110, 44, 32,104, 41, 59, 10, 9, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, 9,115,112,101, 99, -102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9,102,108,111, 97,116, - 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 9, 9, 9,102, -108,111, 97,116, 32,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9, 9, 9,105,102, 40,110,108, 32, 60, 61, - 32, 48, 46, 48, 49, 41, 32,123, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 9,125, - 10, 9, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,120, 40,100,111, -116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97, 32, 61, 32, 49, - 46, 48, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 98, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,118, 41, 47,118,104, - 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 99, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,108, 41, 47,118,104, 59, 10, - 10, 9, 9, 9, 9,102,108,111, 97,116, 32,103, 32, 61, 32, 48, 46, 48, 59, 10, 10, 9, 9, 9, 9,105,102, 40, 97, 32, 60, 32, - 98, 32, 38, 38, 32, 97, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 97, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,102, 40, 98, - 32, 60, 32, 97, 32, 38, 38, 32, 98, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 98, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105, -102, 40, 99, 32, 60, 32, 97, 32, 38, 38, 32, 99, 32, 60, 32, 98, 41, 32,103, 32, 61, 32, 99, 59, 10, 10, 9, 9, 9, 9,102,108, -111, 97,116, 32,112, 32, 61, 32,115,113,114,116, 40, 40, 40,114,101,102,114, 97, 99, 32, 42, 32,114,101,102,114, 97, 99, 41, 43, - 40,118,104, 42,118,104, 41, 45, 49, 46, 48, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,102, 32, 61, 32, 40, 40, 40, -112, 45,118,104, 41, 42, 40,112, 45,118,104, 41, 41, 47, 40, 40,112, 43,118,104, 41, 42, 40,112, 43,118,104, 41, 41, 41, 42, 40, - 49, 46, 48, 43, 40, 40, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 42, 40, 40,118,104, 42, 40,112, 43, -118,104, 41, 41, 45, 49, 46, 48, 41, 41, 47, 40, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 42, 40, 40, -118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 41, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97,110, -103, 32, 61, 32, 97, 99,111,115, 40,110,104, 41, 59, 10, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,109, 97,120, - 40,102, 42,103, 42,101,120,112, 95, 98,108,101,110,100,101,114, 40, 40, 45, 40, 97,110,103, 42, 97,110,103, 41, 47, 40, 50, 46, - 48, 42,115,112,101, 99, 95,112,111,119,101,114, 42,115,112,101, 99, 95,112,111,119,101,114, 41, 41, 41, 44, 32, 48, 46, 48, 41, - 59, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119, 97,114,100, -105,115,111, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, - 32,102,108,111, 97,116, 32,114,109,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, - 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108, -111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, - 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 48, 49, - 41, 59, 10, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,108, 41, 44, 32, 48, 46, - 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103,108,101, 32, 61, 32,116, 97,110, 40, 97, 99,111,115, 40,110,104, - 41, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,108,112,104, 97, 32, 61, 32,109, 97,120, 40,114,109,115, 44, 32, 48, 46, 48, 48, - 49, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 61, 32,110,108, 32, 42, 32, 40, 49, 46, 48, 47, 40, 52, 46, 48, 42, 77, 95, - 80, 73, 42, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 42, 40,101,120,112, 95, 98,108,101,110,100,101,114, 40, 45, 40, - 97,110,103,108,101, 42, 97,110,103,108,101, 41, 47, 40, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 47, 40,115,113,114, -116, 40,110,118, 42,110,108, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116,111,111,110, 95,115, -112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97, -116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116, - 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, -108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,104, 44, 32,110, 41, 59, - 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,105,102, 40, 97, -110,103, 32, 60, 32,115,105,122,101, 41, 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, - 97,110,103, 32, 62, 61, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,115,109,111,111, -116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,115,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,114,115,108, -116, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,111,116,104, 41, - 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,114,115,108,116, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100, -101, 95,115,112,101, 99, 95, 97,114,101, 97, 95,105,110,112, 40,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 44, 32,102, -108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,112,101, 99,102, 97, 99, 41, 10, -123, 10, 9,111,117,116,115,112,101, 99,102, 97, 99, 32, 61, 32,115,112,101, 99,102, 97, 99, 42,105,110,112, 59, 10,125, 10, 10, -118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101, 99, 95,116, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, - 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,102,108,111, 97, -116, 32,115,112,101, 99,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,116, 32, 61, 32,115, -104, 97,100,102, 97, 99, 42,115,112,101, 99, 42,118,105,115,105,102, 97, 99, 42,115,112,101, 99,102, 97, 99, 59, 10,125, 10, 10, -118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,115,112,101, 99, 40,102,108,111, 97,116, 32,116, 44, 32,118,101, 99, - 51, 32,108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32,115,112,101, 99, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, - 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,116, 42,108, 97,109,112, 99,111,108, 42, -115,112,101, 99, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 40,118,101, 99, 52, 32, - 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, - 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 59, 10,125, 10, 10,118,111, -105,100, 32,115,104, 97,100,101, 95,109, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,111,108, + 10, 9,102,108,111, 97,116, 32,116, 32, 61, 32,115,112,111,116,115,105, 59, 10, 10, 9,105,102, 40,105,110,112,114, 32, 60, 61, + 32,116, 41, 32,123, 10, 9, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108, +115,101, 32,123, 10, 9, 9,116, 32, 61, 32,105,110,112,114, 32, 45, 32,116, 59, 10, 10, 9, 9, 47, 42, 32,115,111,102,116, 32, + 97,114,101, 97, 32, 42, 47, 10, 9, 9,105,102, 40,115,112,111,116, 98,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,105, +110,112,114, 32, 42, 61, 32,115,109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,116, 47,115,112, +111,116, 98,108, 41, 59, 10, 10, 9, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32,118,105,115,105,102, 97, 99, 42,105, +110,112,114, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, + 99,108, 97,109,112, 40,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111, +117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 40,118,105,115,105, +102, 97, 99, 32, 60, 32, 48, 46, 48, 48, 49, 41, 63, 32, 48, 46, 48, 58, 32,118,105,115,105,102, 97, 99, 59, 10,125, 10, 10,118, +111,105,100, 32,115,104, 97,100,101, 95,118,105,101,119, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, + 32,118,105,101,119, 41, 10,123, 10, 9, 47, 42, 32,104, 97,110,100,108,101, 32,112,101,114,115,112,101, 99,116,105,118,101, 47, +111,114,116,104,111,103,114, 97,112,104,105, 99, 32, 42, 47, 10, 9,118,105,101,119, 32, 61, 32, 40,103,108, 95, 80,114,111,106, +101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,110,111,114,109, + 97,108,105,122,101, 40, 99,111, 41, 58, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 45, 49, 46, 48, 41, 59, + 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116, 97,110,103,101,110,116, 95,118, 40,118,101, 99, 51, 32,108,118, + 44, 32,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, + 51, 32, 99, 32, 61, 32, 99,114,111,115,115, 40,108,118, 44, 32,116, 97,110,103, 41, 59, 10, 9,118,101, 99, 51, 32,118,110,111, +114, 32, 61, 32, 99,114,111,115,115, 40, 99, 44, 32,116, 97,110,103, 41, 59, 10, 10, 9,118,110, 32, 61, 32, 45,110,111,114,109, + 97,108,105,122,101, 40,118,110,111,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 40,118, +101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10, +123, 10, 9,105,110,112, 32, 61, 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, + 97,100,101, 95,105,115, 95,110,111, 95,100,105,102,102,117,115,101, 40,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10, +123, 10, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,104,101, +109,105, 40,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105, +115, 32, 61, 32, 48, 46, 53, 42,105,110,112, 32, 43, 32, 48, 46, 53, 59, 10,125, 10, 10,102,108,111, 97,116, 32, 97,114,101, 97, + 95,108, 97,109,112, 95,101,110,101,114,103,121, 40,109, 97,116, 52, 32, 97,114,101, 97, 44, 32,118,101, 99, 51, 32, 99,111, 44, + 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51, 32,118,101, 99, 91, 52, 93, 44, 32, 99, 91, 52, 93, 59, 10, + 9,102,108,111, 97,116, 32,114, 97,100, 91, 52, 93, 44, 32,102, 97, 99, 59, 10, 9, 10, 9,118,101, 99, 91, 48, 93, 32, 61, 32, +110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 48, 93, 46,120,121,122, 41, 59, 10, 9,118,101, + 99, 91, 49, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 49, 93, 46,120,121, +122, 41, 59, 10, 9,118,101, 99, 91, 50, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, + 97, 91, 50, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99, +111, 32, 45, 32, 97,114,101, 97, 91, 51, 93, 46,120,121,122, 41, 59, 10, 10, 9, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97, +108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9, 99, 91, + 49, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, + 91, 50, 93, 41, 41, 59, 10, 9, 99, 91, 50, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118, +101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10, 9, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105, +122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,114, 97,100, + 91, 48, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, + 10, 9,114, 97,100, 91, 49, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, + 50, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 50, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 50, 93, 44, + 32,118,101, 99, 91, 51, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 51, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, + 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,102, 97, 99, 61, 32, 32,114, 97,100, 91, 48, 93, 42,100, +111,116, 40,118,110, 44, 32, 99, 91, 48, 93, 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 49, 93, 42,100,111,116, 40, +118,110, 44, 32, 99, 91, 49, 93, 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 50, 93, 42,100,111,116, 40,118,110, 44, + 32, 99, 91, 50, 93, 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 51, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, + 51, 93, 41, 59, 10, 10, 9,114,101,116,117,114,110, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10, +118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 95, 97,114,101, 97, 40,118,101, 99, 51, 32,112,111,115,105,116,105,111, +110, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, + 99, 51, 32,118,110, 44, 32,109, 97,116, 52, 32, 97,114,101, 97, 44, 32,102,108,111, 97,116, 32, 97,114,101, 97,115,105,122,101, + 44, 32,102,108,111, 97,116, 32,107, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,118,101, 99, + 51, 32, 99,111, 32, 61, 32,112,111,115,105,116,105,111,110, 59, 10, 9,118,101, 99, 51, 32,118,101, 99, 32, 61, 32, 99,111, 32, + 45, 32,108, 97,109,112, 99,111, 59, 10, 10, 9,105,102, 40,100,111,116, 40,118,101, 99, 44, 32,108, 97,109,112,118,101, 99, 41, + 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,110,112, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32, +123, 10, 9, 9,102,108,111, 97,116, 32,105,110,116,101,110,115, 32, 61, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101, +114,103,121, 40, 97,114,101, 97, 44, 32, 99,111, 44, 32,118,110, 41, 59, 10, 10, 9, 9,105,110,112, 32, 61, 32,112,111,119, 40, +105,110,116,101,110,115, 42, 97,114,101, 97,115,105,122,101, 44, 32,107, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32, +115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,111,114,101,110, 95,110, 97,121,101,114, 40,102,108,111, 97,116, 32,110, +108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, + 32,114,111,117,103,104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, + 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32, +109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, + 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,114,101, 97, +108,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 10, 9,105,102, 40,114,101, 97,108,110,108, 32, 60, 32, 48, + 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,110,108, + 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, + 10, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, + 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 76,105,116, 95, 65, 32, 61, 32, 97, 99,111,115, 40,114,101, 97,108,110,108, 41, 59, + 10, 9, 9,102,108,111, 97,116, 32, 86,105,101,119, 95, 65, 32, 61, 32, 97, 99,111,115, 40,110,118, 41, 59, 10, 10, 9, 9,118, +101, 99, 51, 32, 76,105,116, 95, 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 45, 32,114,101, 97,108,110,108, + 42,110, 41, 59, 10, 9, 9,118,101, 99, 51, 32, 86,105,101,119, 95, 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, + 32, 45, 32,110,118, 42,110, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 76, +105,116, 95, 66, 44, 32, 86,105,101,119, 95, 66, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 97, 44, + 32, 98, 59, 10, 10, 9, 9,105,102, 40, 76,105,116, 95, 65, 32, 62, 32, 86,105,101,119, 95, 65, 41, 32,123, 10, 9, 9, 9, 97, + 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9,125, 10, 9, 9,101, +108,115,101, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 76,105,116, 95, + 65, 59, 10, 9, 9,125, 10, 10, 9, 9,102,108,111, 97,116, 32, 65, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 48, 46, 53, 42, 40, + 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, + 46, 51, 51, 41, 41, 41, 59, 10, 9, 9,102,108,111, 97,116, 32, 66, 32, 61, 32, 48, 46, 52, 53, 42, 40, 40,114,111,117,103,104, + 42,114,111,117,103,104, 41, 47, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 48, 57, 41, 41, 59, + 10, 10, 9, 9, 98, 32, 42, 61, 32, 48, 46, 57, 53, 59, 10, 9, 9,105,115, 32, 61, 32,110,108, 42, 40, 65, 32, 43, 32, 40, 66, + 32, 42, 32,116, 32, 42, 32,115,105,110, 40, 97, 41, 32, 42, 32,116, 97,110, 40, 98, 41, 41, 41, 59, 10, 9,125, 10,125, 10, 10, +118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,116,111,111,110, 40,118,101, 99, 51, 32,110, 44, 32, +118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97, +116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,102,108,111, 97, +116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, + 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,105,115, + 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 97,110,103, 32, 62, 32, 40,115,105,122,101, 32, 43, 32,116, +115,109,111,111,116,104, 41, 32,124,124, 32,116,115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,105,115, 32, 61, 32, + 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,115, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105, +122,101, 41, 47,116,115,109,111,111,116,104, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102, +117,115,101, 95,109,105,110,110, 97,101,114,116, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118, +101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,100, 97,114,107,110,101,115,115, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,105,115, 41, 10,123, 10, 9,105,102, 40,110,108, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, + 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40, +100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,105,102, 40,100, 97,114,107,110,101,115,115, 32, + 60, 61, 32, 49, 46, 48, 41, 10, 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112,111,119, 40,109, 97,120, 40,110,118, 42,110,108, + 44, 32, 48, 46, 49, 41, 44, 32,100, 97,114,107,110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9, 9,101,108,115,101, 10, + 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112,111,119, 40, 49, 46, 48, 48, 48, 49, 32, 45, 32,110,118, 44, 32,100, 97,114,107, +110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9,125, 10,125, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, + 95,102, 97, 99, 40,118,101, 99, 51, 32,118,105,101,119, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,102,108,111, 97,116, 32,103, +114, 97,100, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 49, 44, 32,116, 50, 59, + 10, 9,102,108,111, 97,116, 32,102,102, 97, 99, 59, 10, 10, 9,105,102, 40,102, 97, 99, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, + 9,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 49, 61, 32,100,111, +116, 40,118,105,101,119, 44, 32,118,110, 41, 59, 10, 9, 9,105,102, 40,116, 49, 62, 48, 46, 48, 41, 32, 32,116, 50, 61, 32, 49, + 46, 48, 43,116, 49, 59, 10, 9, 9,101,108,115,101, 32,116, 50, 61, 32, 49, 46, 48, 45,116, 49, 59, 10, 10, 9, 9,116, 50, 61, + 32,103,114, 97,100, 32, 43, 32, 40, 49, 46, 48, 45,103,114, 97,100, 41, 42,112,111,119, 40,116, 50, 44, 32,102, 97, 99, 41, 59, + 10, 10, 9, 9,105,102, 40,116, 50, 60, 48, 46, 48, 41, 32,102,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,101,108,115, +101, 32,105,102, 40,116, 50, 62, 49, 46, 48, 41, 32,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32, +102,102, 97, 99, 32, 61, 32,116, 50, 59, 10, 9,125, 10, 10, 9,114,101,116,117,114,110, 32,102,102, 97, 99, 59, 10,125, 10, 10, +118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,102,114,101,115,110,101,108, 40,118,101, 99, 51, 32, +118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,102, 97, + 99, 95,105, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, + 9,105,115, 32, 61, 32,102,114,101,115,110,101,108, 95,102, 97, 99, 40,108,118, 44, 32,118,110, 44, 32,102, 97, 99, 95,105, 44, + 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 99,117, 98,105, 99, 40,102,108,111, 97,116, + 32,105,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,115, 41, 10,123, 10, 9,105,102, 40,105,115, 62, 48, + 46, 48, 32, 38, 38, 32,105,115, 60, 49, 46, 48, 41, 10, 9, 9,111,117,116,105,115, 61, 32,115,109,111,111,116,104,115,116,101, +112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,105,115, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,105,115, 61, 32, +105,115, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,118,105,115,105,102, 97, 99, 40,102,108,111, 97,116, 32, +105, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,114,101,102,108, 44, 32,111,117, +116, 32,102,108,111, 97,116, 32,111,117,116,105, 41, 10,123, 10, 9, 47, 42,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 42, 47, + 10, 9, 9,111,117,116,105, 32, 61, 32,109, 97,120, 40,105, 42,118,105,115,105,102, 97, 99, 42,114,101,102,108, 44, 32, 48, 46, + 48, 41, 59, 10, 9, 47, 42,101,108,115,101, 10, 9, 9,111,117,116,105, 32, 61, 32,105, 59, 42, 47, 10,125, 10, 10,118,111,105, +100, 32,115,104, 97,100,101, 95,116, 97,110,103,101,110,116, 95,118, 95,115,112,101, 99, 40,118,101, 99, 51, 32,116, 97,110,103, + 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,110, 32, 61, 32,116, 97,110,103, 59, 10,125, 10, 10, +118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,116,111, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32, +105, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118, +101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, + 99,111,108, 32, 61, 32,105, 42,108, 97,109,112, 99,111,108, 42, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, + 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111, +105,100, 32,115,104, 97,100,101, 95,104,101,109,105, 95,115,112,101, 99, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, + 32,108,118, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97, +116, 32,104, 97,114,100, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,116, 41, 10,123, 10, 9,108,118, 32, 43, 61, 32,118,105,101,119, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105, +122,101, 40,108,118, 41, 59, 10, 10, 9,116, 32, 61, 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10, 9,116, 32, 61, 32, + 48, 46, 53, 42,116, 32, 43, 32, 48, 46, 53, 59, 10, 10, 9,116, 32, 61, 32,118,105,115,105,102, 97, 99, 42,115,112,101, 99, 42, +112,111,119, 40,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,112,104,111,110, +103, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102, +108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, + 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, + 97,116, 32,114,115,108,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40,104, 44, 32,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, + 9,115,112,101, 99,102, 97, 99, 32, 61, 32,112,111,119, 40,114,115,108,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118, +111,105,100, 32,115,104, 97,100,101, 95, 99,111,111,107,116,111,114,114, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32, +118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32, +102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97, +108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32, +104, 41, 59, 10, 10, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, + 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97, +120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,105, 32, 61, 32,112, +111,119, 40,110,104, 44, 32,104, 97,114,100, 41, 59, 10, 10, 9, 9,105, 32, 61, 32,105, 47, 40, 48, 46, 49, 43,110,118, 41, 59, + 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,105, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, + 95, 98,108,105,110,110, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, + 32,118, 44, 32,102,108,111, 97,116, 32,114,101,102,114, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 95,112,111,119, +101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,105,102, 40,114,101,102, +114, 97, 99, 32, 60, 32, 49, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, + 10, 9,101,108,115,101, 32,105,102, 40,115,112,101, 99, 95,112,111,119,101,114, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, + 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40, +115,112,101, 99, 95,112,111,119,101,114, 60, 49, 48, 48, 46, 48, 41, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, + 32,115,113,114,116, 40, 49, 46, 48, 47,115,112,101, 99, 95,112,111,119,101,114, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, + 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32, 49, 48, 46, 48, 47,115,112,101, 99, 95,112,111,119,101,114, 59, 10, 10, 9, + 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9, 9,102,108, +111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 9, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, + 48, 41, 32,123, 10, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,125, 10, 9, 9,101,108,115, +101, 32,123, 10, 9, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, + 32, 48, 46, 48, 49, 41, 59, 10, 9, 9, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, + 10, 9, 9, 9,105,102, 40,110,108, 32, 60, 61, 32, 48, 46, 48, 49, 41, 32,123, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, + 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 9,125, 10, 9, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 9,102,108,111, 97,116, + 32,118,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 10, 9, 9, 9, + 9,102,108,111, 97,116, 32, 97, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 98, 32, 61, 32, 40, 50, + 46, 48, 42,110,104, 42,110,118, 41, 47,118,104, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 99, 32, 61, 32, 40, 50, 46, 48, + 42,110,104, 42,110,108, 41, 47,118,104, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,103, 32, 61, 32, 48, 46, 48, 59, 10, + 10, 9, 9, 9, 9,105,102, 40, 97, 32, 60, 32, 98, 32, 38, 38, 32, 97, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 97, 59, 10, 9, + 9, 9, 9,101,108,115,101, 32,105,102, 40, 98, 32, 60, 32, 97, 32, 38, 38, 32, 98, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 98, + 59, 10, 9, 9, 9, 9,101,108,115,101, 32,105,102, 40, 99, 32, 60, 32, 97, 32, 38, 38, 32, 99, 32, 60, 32, 98, 41, 32,103, 32, + 61, 32, 99, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,112, 32, 61, 32,115,113,114,116, 40, 40, 40,114,101,102,114, 97, + 99, 32, 42, 32,114,101,102,114, 97, 99, 41, 43, 40,118,104, 42,118,104, 41, 45, 49, 46, 48, 41, 41, 59, 10, 9, 9, 9, 9,102, +108,111, 97,116, 32,102, 32, 61, 32, 40, 40, 40,112, 45,118,104, 41, 42, 40,112, 45,118,104, 41, 41, 47, 40, 40,112, 43,118,104, + 41, 42, 40,112, 43,118,104, 41, 41, 41, 42, 40, 49, 46, 48, 43, 40, 40, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, + 46, 48, 41, 42, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 41, 47, 40, 40, 40,118,104, 42, 40,112, 45, +118,104, 41, 41, 43, 49, 46, 48, 41, 42, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 41, 41, 41, 59, 10, + 9, 9, 9, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,110,104, 41, 59, 10, 10, 9, 9, 9, 9,115, +112,101, 99,102, 97, 99, 32, 61, 32,109, 97,120, 40,102, 42,103, 42,101,120,112, 95, 98,108,101,110,100,101,114, 40, 40, 45, 40, + 97,110,103, 42, 97,110,103, 41, 47, 40, 50, 46, 48, 42,115,112,101, 99, 95,112,111,119,101,114, 42,115,112,101, 99, 95,112,111, +119,101,114, 41, 41, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10,125, 10, 10,118,111,105, +100, 32,115,104, 97,100,101, 95,119, 97,114,100,105,115,111, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, + 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,109,115, 44, 32,111,117,116, 32,102,108,111, 97, +116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, + 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32, +104, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40, +110, 44, 32,118, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,109, 97,120, 40,100, +111,116, 40,110, 44, 32,108, 41, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103,108,101, 32, 61, + 32,116, 97,110, 40, 97, 99,111,115, 40,110,104, 41, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,108,112,104, 97, 32, 61, 32,109, + 97,120, 40,114,109,115, 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 61, 32,110,108, 32, 42, 32, + 40, 49, 46, 48, 47, 40, 52, 46, 48, 42, 77, 95, 80, 73, 42, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 42, 40,101,120, +112, 95, 98,108,101,110,100,101,114, 40, 45, 40, 97,110,103,108,101, 42, 97,110,103,108,101, 41, 47, 40, 97,108,112,104, 97, 42, + 97,108,112,104, 97, 41, 41, 47, 40,115,113,114,116, 40,110,118, 42,110,108, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32, +115,104, 97,100,101, 95,116,111,111,110, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32, +118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116, +104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, + 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, + 61, 32,100,111,116, 40,104, 44, 32,110, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114, +115,108,116, 41, 59, 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,114,115,108,116, 32, 61, 32, 49, 46, + 48, 59, 10, 9,101,108,115,101, 32,105,102, 40, 97,110,103, 32, 62, 61, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111, +116,104, 41, 32,124,124, 32,116,115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,115,108,116, 32, 61, 32, 48, 46, + 48, 59, 10, 9,101,108,115,101, 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105, +122,101, 41, 47,116,115,109,111,111,116,104, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,114,115,108,116, 59, 10, +125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101, 99, 95, 97,114,101, 97, 95,105,110,112, 40,102,108,111, 97, +116, 32,115,112,101, 99,102, 97, 99, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, +111,117,116,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99,102, 97, 99, 32, 61, 32,115,112,101, 99, +102, 97, 99, 42,105,110,112, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101, 99, 95,116, 40,102,108, +111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,118, +105,115,105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, + 32,116, 41, 10,123, 10, 9,116, 32, 61, 32,115,104, 97,100,102, 97, 99, 42,115,112,101, 99, 42,118,105,115,105,102, 97, 99, 42, +115,112,101, 99,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,115,112,101, 99, 40, +102,108,111, 97,116, 32,116, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32,115,112,101, 99, + 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, + 61, 32,116, 42,108, 97,109,112, 99,111,108, 42,115,112,101, 99, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97, +100,101, 95, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, + 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, + 32, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100, 40,118,101, 99, 52, 32, 99, +111,108, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, + 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32, 99,111,108, + 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95, 99,108, 97,109,112,101, +100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, + 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32,109, 97,120, 40, + 99,111,108, 50, 44, 32,118,101, 99, 52, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, + 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, + 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32, +118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,109, + 97,120, 40, 99,111,108, 49, 42, 99,111,108, 50, 44, 32,118,101, 99, 52, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, + 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100,102, 40,118,101, 99, + 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,111,117,116, 32,118, +101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,102, 42, + 99,111,108, 49, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, - 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118, -111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, - 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9, -111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32,109, 97,120, 40, 99,111,108, 50, 44, 32,118,101, 99, 52, 40, 48, - 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97, -100,101, 95,109, 97,100,100, 95, 99,108, 97,109,112,101,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32, 99, -111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, - 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,109, 97,120, 40, 99,111,108, 49, 42, 99,111,108, 50, - 44, 32,118,101, 99, 52, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 41, 59, 10,125, 10, 10, -118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100,102, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,111, 97,116, - 32,102, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10, -123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,102, 42, 99,111,108, 49, 59, 10,125, 10, 10,118,111,105, -100, 32,115,104, 97,100,101, 95,109,117,108, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, - 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99, -111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 95,118, 97,108,117, -101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32, -111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 42,102, 97, 99, 59, 10,125, 10, 10, -118,111,105,100, 32,115,104, 97,100,101, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, - 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, - 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 42,111, 98, 99,111,108, 46,114,103, 98, 44, 32, 99,111, -108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,114, 97,109,112, 95,114,103, 98,116,111, 98,119, 40,118,101, 99, 51, 32, - 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, - 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46, 53, 56, 32, - 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 49, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110, -108,121, 95,115,104, 97,100,111,119, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, - 44, 32,102,108,111, 97,116, 32,101,110,101,114,103,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,104, 97, -100,102, 97, 99, 41, 10,123, 10, 9,111,117,116,115,104, 97,100,102, 97, 99, 32, 61, 32,105, 42,101,110,101,114,103,121, 42, 40, - 49, 46, 48, 32, 45, 32,115,104, 97,100,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110, -108,121, 95,115,104, 97,100,111,119, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, - 32,118,101, 99, 51, 32,114,103, 98, 44, 32,118,101, 99, 52, 32,100,105,102,102, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111, -117,116,100,105,102,102, 41, 10,123, 10, 9,111,117,116,100,105,102,102, 32, 61, 32,100,105,102,102, 32, 45, 32,118,101, 99, 52, - 40,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100, -101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,115,112,101, 99,117,108, 97,114, 40,102,108,111, 97,116, 32,115,104, 97, -100,102, 97, 99, 44, 32,118,101, 99, 51, 32,115,112,101, 99,114,103, 98, 44, 32,118,101, 99, 52, 32,115,112,101, 99, 44, 32,111, -117,116, 32,118,101, 99, 52, 32,111,117,116,115,112,101, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99, 32, 61, 32,115,112, -101, 99, 32, 45, 32,118,101, 99, 52, 40,115,112,101, 99,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, - 10,125, 10, 10,118,111,105,100, 32,116,101,115,116, 95,115,104, 97,100,111,119, 98,117,102, 40,118,101, 99, 51, 32,114, 99,111, - 44, 32,115, 97,109,112,108,101,114, 50, 68, 83,104, 97,100,111,119, 32,115,104, 97,100,111,119,109, 97,112, 44, 32,109, 97,116, - 52, 32,115,104, 97,100,111,119,112,101,114,115,109, 97,116, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,111,119, 98,105, 97, -115, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 41, 10, -123, 10, 9,105,102, 40,105,110,112, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32, 48, - 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,118,101, 99, 52, 32, 99,111, 32, 61, 32,115,104, 97,100,111, -119,112,101,114,115,109, 97,116, 42,118,101, 99, 52, 40,114, 99,111, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9, 9, 47, 47,102,108, -111, 97,116, 32, 98,105, 97,115, 32, 61, 32, 40, 49, 46, 53, 32, 45, 32,105,110,112, 42,105,110,112, 41, 42,115,104, 97,100,111, -119, 98,105, 97,115, 59, 10, 9, 9, 99,111, 46,122, 32, 45, 61, 32,115,104, 97,100,111,119, 98,105, 97,115, 42, 99,111, 46,119, - 59, 10, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32,115,104, 97,100,111,119, 50, 68, 80,114,111,106, 40,115,104, 97,100,111, -119,109, 97,112, 44, 32, 99,111, 41, 46,120, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,101,120, -112,111,115,117,114,101, 95, 99,111,114,114,101, 99,116, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,102,108,111, 97,116, 32,108, -105,110,102, 97, 99, 44, 32,102,108,111, 97,116, 32,108,111,103,102, 97, 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117, -116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,108,105,110,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, -101,120,112, 40, 99,111,108, 42,108,111,103,102, 97, 99, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, -109,105,115,116, 95,102, 97, 99,116,111,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,109,105,115,116,115, -116, 97, 44, 32,102,108,111, 97,116, 32,109,105,115,116,100,105,115,116, 44, 32,102,108,111, 97,116, 32,109,105,115,116,116,121, -112,101, 44, 32,102,108,111, 97,116, 32,109,105,115,105, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, - 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 44, 32,122, 99,111,114, 59, 10, 10, 9,122, 99,111,114, 32, 61, 32, 40, -103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, - 41, 63, 32,108,101,110,103,116,104, 40, 99,111, 41, 58, 32, 45, 99,111, 91, 50, 93, 59, 10, 9, 10, 9,102, 97, 99, 32, 61, 32, - 99,108, 97,109,112, 40, 40,122, 99,111,114, 45,109,105,115,116,115,116, 97, 41, 47,109,105,115,116,100,105,115,116, 44, 32, 48, - 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, 48, 46, 48, 41, 32,102, - 97, 99, 32, 42, 61, 32,102, 97, 99, 59, 10, 9,101,108,115,101, 32,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, - 49, 46, 48, 41, 59, 10, 9,101,108,115,101, 32,102, 97, 99, 32, 61, 32,115,113,114,116, 40,102, 97, 99, 41, 59, 10, 10, 9,111, -117,116,102, 97, 99, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 45,102, 97, 99, 41, 42, 40, 49, 46, 48, 45,109,105,115, -105, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119,111,114,108,100, 95,109,105,120, 40,118,101, 99, 51, - 32,104,111,114, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, - 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, 99,111,108, 46, 97, 44, 32, 48, 46, 48, - 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,109,105,120, 40,104,111,114, 44, 32, - 99,111,108, 46,114,103, 98, 44, 32,102, 97, 99, 41, 44, 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115, -104, 97,100,101, 95, 97,108,112,104, 97, 95,111,112, 97,113,117,101, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32, -118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111, -108, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,108,112,104, 97, - 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111, -117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, - 40, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 42,111, 98, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10, 47, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 85, 84, 73, 76, 73, 84, 73, 69, 83, 32, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,100,105, -101,108,101, 99,116,114,105, 99, 40,118,101, 99, 51, 32, 73,110, 99,111,109,105,110,103, 44, 32,118,101, 99, 51, 32, 78,111,114, -109, 97,108, 44, 32,102,108,111, 97,116, 32,101,116, 97, 41, 10,123, 10, 32, 32, 32, 32, 47, 42, 32, 99,111,109,112,117,116,101, - 32,102,114,101,115,110,101,108, 32,114,101,102,108,101, 99,116, 97,110, 99,101, 32,119,105,116,104,111,117,116, 32,101,120,112, -108,105, 99,105,116,108,121, 32, 99,111,109,112,117,116,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32,116,104,101, 32,114,101,102, -114, 97, 99,116,101,100, 32,100,105,114,101, 99,116,105,111,110, 32, 42, 47, 10, 32, 32, 32, 32,102,108,111, 97,116, 32, 99, 32, - 61, 32, 97, 98,115, 40,100,111,116, 40, 73,110, 99,111,109,105,110,103, 44, 32, 78,111,114,109, 97,108, 41, 41, 59, 10, 32, 32, - 32, 32,102,108,111, 97,116, 32,103, 32, 61, 32,101,116, 97, 32, 42, 32,101,116, 97, 32, 45, 32, 49, 46, 48, 32, 43, 32, 99, 32, - 42, 32, 99, 59, 10, 32, 32, 32, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 59, 10, 10, 32, 32, 32, 32,105,102, 40,103, - 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, 32, 61, 32,115,113,114,116, 40,103, 41, 59, 10, 32, - 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 65, 32, 61, 40,103, 32, 45, 32, 99, 41, 47, 40,103, 32, 43, 32, 99, 41, 59, - 10, 32, 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 66, 32, 61, 40, 99, 32, 42, 40,103, 32, 43, 32, 99, 41, 45, 32, 49, - 46, 48, 41, 47, 40, 99, 32, 42, 40,103, 32, 45, 32, 99, 41, 43, 32, 49, 46, 48, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,114, -101,115,117,108,116, 32, 61, 32, 48, 46, 53, 32, 42, 32, 65, 32, 42, 32, 65, 32, 42, 40, 49, 46, 48, 32, 43, 32, 66, 32, 42, 32, - 66, 41, 59, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108, -116, 32, 61, 32, 49, 46, 48, 59, 32, 32, 47, 42, 32, 84, 73, 82, 32, 40,110,111, 32,114,101,102,114, 97, 99,116,101,100, 32, 99, -111,109,112,111,110,101,110,116, 41, 32, 42, 47, 10, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108,116, 59, - 10,125, 10, 10,102,108,111, 97,116, 32,104,121,112,111,116, 40,102,108,111, 97,116, 32,120, 44, 32,102,108,111, 97,116, 32,121, - 41, 10,123, 10, 9,114,101,116,117,114,110, 32,115,113,114,116, 40,120, 42,120, 32, 43, 32,121, 42,121, 41, 59, 10,125, 10, 10, - 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10, 35,100,101,102,105,110,101, 32, 78, 85, 77, 95, 76, 73, 71, 72, - 84, 83, 32, 51, 10, 10, 47, 42, 32, 98,115,100,102,115, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100, -102, 95,100,105,102,102,117,115,101, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103, -104,110,101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10, -123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, 42, 47, 10, 9,118,101, 99, 51, 32, 76, 32, 61, - 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,116,105,111,110, 97,108, 32,108,105,103, -104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60, 32, 78, 85, 77, 95, 76, - 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,112,111,115,105,116, -105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,112,111,115,105,116,105,111,110, - 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,100,105,102,102,117,115,101, 32, 61, 32,103,108, 95, - 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,100,105,102,102,117,115,101, 46,114,103, 98, 59, 10, 10, 9, 9,102, -108,111, 97,116, 32, 98,115,100,102, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 78, 44, 32,108,105,103,104,116, 95,112,111,115, -105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95,100,105,102,102,117, -115,101, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61, 32,118,101, 99, 52, 40, 76, 42, 99,111, -108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, - 95,103,108,111,115,115,121, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110, -101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101, -115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, 42, 47, 10, 9,118,101, - 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114,101, 99,116,105,111,110, - 97,108, 32,108,105,103,104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60, - 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, - 95,112,111,115,105,116,105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,112,111, -115,105,116,105,111,110, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32, 72, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83, -111,117,114, 99,101, 91,105, 93, 46,104, 97,108,102, 86,101, 99,116,111,114, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32, -108,105,103,104,116, 95,100,105,102,102,117,115,101, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, - 93, 46,100,105,102,102,117,115,101, 46,114,103, 98, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,115,112,101, 99, -117,108, 97,114, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,115,112,101, 99,117,108, 97, -114, 46,114,103, 98, 59, 10, 10, 9, 9, 47, 42, 32,119,101, 32,109,105,120, 32,105,110, 32,115,111,109,101, 32,100,105,102,102, -117,115,101, 32,115,111, 32,108,111,119, 32,114,111,117,103,104,110,101,115,115, 32,115,116,105,108,108, 32,115,104,111,119,115, - 32,117,112, 32, 42, 47, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, 61, 32, 48, 46, 53, 42,112,111,119, 40,109, 97, -120, 40,100,111,116, 40, 78, 44, 32, 72, 41, 44, 32, 48, 46, 48, 41, 44, 32, 49, 46, 48, 47,114,111,117,103,104,110,101,115,115, - 41, 59, 10, 9, 9, 98,115,100,102, 32, 43, 61, 32, 48, 46, 53, 42,109, 97,120, 40,100,111,116, 40, 78, 44, 32,108,105,103,104, -116, 95,112,111,115,105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95, -115,112,101, 99,117,108, 97,114, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, 32, 61, 32,118,101, 99, - 52, 40, 76, 42, 99,111,108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100, -101, 95, 98,115,100,102, 95, 97,110,105,115,111,116,114,111,112,105, 99, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102, -108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 85, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, - 86, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117, -108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, - 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115, -100,102, 95,103,108, 97,115,115, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104, -110,101,115,115, 44, 32,102,108,111, 97,116, 32,105,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, - 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100, -105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, - 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,116,114, 97,110,115,108,117, 99,101,110,116, 40,118,101, 99, - 52, 32, 99,111,108,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, - 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, - 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, - 95,116,114, 97,110,115,112, 97,114,101,110,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, - 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32,116,104,105,115, 32,105,115,110, 39,116, 32,114,105,103,104,116, - 32, 42, 47, 10, 9,114,101,115,117,108,116, 46,114, 32, 61, 32, 99,111,108,111,114, 46,114, 59, 10, 9,114,101,115,117,108,116, - 46,103, 32, 61, 32, 99,111,108,111,114, 46,103, 59, 10, 9,114,101,115,117,108,116, 46, 98, 32, 61, 32, 99,111,108,111,114, 46, - 98, 59, 10, 9,114,101,115,117,108,116, 46, 97, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, - 95, 98,115,100,102, 95,118,101,108,118,101,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,115, -105,103,109, 97, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, - 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, - 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10, 47, 42, 32,101,109,105,115,115,105,111,110, 32, 42, 47, 10, 10,118, -111,105,100, 32,110,111,100,101, 95,101,109,105,115,115,105,111,110, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108, -111, 97,116, 32,115,116,114,101,110,103,116,104, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114, -101,115,117,108,116, 41, 10,123, 10, 9,114,101,115,117,108,116, 32, 61, 32, 99,111,108,111,114, 42,115,116,114,101,110,103,116, -104, 59, 10,125, 10, 10, 47, 42, 32, 99,108,111,115,117,114,101,115, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95, -109,105,120, 95,115,104, 97,100,101,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32,115,104, 97,100,101, -114, 49, 44, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,115,104, 97,100,101, -114, 41, 10,123, 10, 9,115,104, 97,100,101,114, 32, 61, 32,109,105,120, 40,115,104, 97,100,101,114, 49, 44, 32,115,104, 97,100, -101,114, 50, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 97,100,100, 95,115,104, 97,100, -101,114, 40,118,101, 99, 52, 32,115,104, 97,100,101,114, 49, 44, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 50, 44, 32,111, -117,116, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 41, 10,123, 10, 9,115,104, 97,100,101,114, 32, 61, 32,115,104, 97,100, -101,114, 49, 32, 43, 32,115,104, 97,100,101,114, 50, 59, 10,125, 10, 10, 47, 42, 32,102,114,101,115,110,101,108, 32, 42, 47, 10, - 10,118,111,105,100, 32,110,111,100,101, 95,102,114,101,115,110,101,108, 40,102,108,111, 97,116, 32,105,111,114, 44, 32,118,101, - 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114,101,115,117,108,116, 41, 10, -123, 10, 9,102,108,111, 97,116, 32,101,116, 97, 32, 61, 32,109, 97,120, 40,105,111,114, 44, 32, 48, 46, 48, 48, 48, 48, 49, 41, - 59, 10, 9,114,101,115,117,108,116, 32, 61, 32,102,114,101,115,110,101,108, 95,100,105,101,108,101, 99,116,114,105, 99, 40, 73, - 44, 32, 78, 44, 32,101,116, 97, 41, 59, 32, 47, 47, 98, 97, 99,107,102, 97, 99,105,110,103, 40, 41, 63, 32, 49, 46, 48, 47,101, -116, 97, 58, 32,101,116, 97, 41, 59, 10,125, 10, 10, 47, 42, 32,103,101,111,109,101,116,114,121, 32, 42, 47, 10, 10,118,111,105, -100, 32,110,111,100,101, 95,103,101,111,109,101,116,114,121, 40,118,101, 99, 51, 32, 73, 44, 32,118,101, 99, 51, 32, 78, 44, 32, -109, 97,116, 52, 32,116,111,119,111,114,108,100, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32,112,111,115,105,116,105,111,110, - 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,116, 97,110,103, -101,110,116, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32,116,114,117,101, 95,110,111,114,109, 97,108, 44, 32,111,117,116, 32, -118,101, 99, 51, 32,105,110, 99,111,109,105,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,112, 97,114, 97,109,101,116,114, -105, 99, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32, 98, 97, 99,107,102, 97, 99,105,110,103, 41, 10,123, 10, 9,112,111, -115,105,116,105,111,110, 32, 61, 32, 40,116,111,119,111,114,108,100, 42,118,101, 99, 52, 40, 73, 44, 32, 49, 46, 48, 41, 41, 46, -120,121,122, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 78, 59, 10, 9,116, 97,110,103,101,110,116, 32, 61, 32,118,101, 99, - 51, 40, 48, 46, 48, 41, 59, 10, 9,116,114,117,101, 95,110,111,114,109, 97,108, 32, 61, 32, 78, 59, 10, 9,105,110, 99,111,109, -105,110,103, 32, 61, 32, 73, 59, 10, 9,112, 97,114, 97,109,101,116,114,105, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, - 59, 10, 9, 98, 97, 99,107,102, 97, 99,105,110,103, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100, -101, 95,116,101,120, 95, 99,111,111,114,100, 40,118,101, 99, 51, 32, 73, 44, 32,118,101, 99, 51, 32, 78, 44, 32,109, 97,116, 52, - 32,116,111,119,111,114,108,100, 44, 10, 9,118,101, 99, 51, 32, 97,116,116,114, 95,111,114, 99,111, 44, 32,118,101, 99, 51, 32, - 97,116,116,114, 95,117,118, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32,103,101,110,101,114, 97,116,101,100, 44, 32,111,117, -116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111, 98,106,101, 99,116, 44, 10, 9,111,117,116, - 32,118,101, 99, 51, 32, 99, 97,109,101,114, 97, 44, 32,111,117,116, 32,118,101, 99, 51, 32,119,105,110,100,111,119, 44, 32,111, -117,116, 32,118,101, 99, 51, 32,114,101,102,108,101, 99,116,105,111,110, 41, 10,123, 10, 9,103,101,110,101,114, 97,116,101,100, - 32, 61, 32, 97,116,116,114, 95,111,114, 99,111, 59, 10, 9,117,118, 32, 61, 32, 97,116,116,114, 95,117,118, 59, 10, 9,111, 98, -106,101, 99,116, 32, 61, 32, 73, 59, 10, 9, 99, 97,109,101,114, 97, 32, 61, 32, 73, 59, 10, 9,119,105,110,100,111,119, 32, 61, - 32,103,108, 95, 70,114, 97,103, 67,111,111,114,100, 46,120,121,122, 59, 10, 9,114,101,102,108,101, 99,116,105,111,110, 32, 61, - 32,114,101,102,108,101, 99,116, 40, 78, 44, 32, 73, 41, 59, 10, 10,125, 10, 10, 47, 42, 32,116,101,120,116,117,114,101,115, 32, - 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95, 98,108,101,110,100, 40,118,101, 99, 51, 32, 99,111, 44, - 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, - 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95, 99,108,111,117,100,115, 40,118,101, 99, 51, 32, 99,111, 44, 32,102, -108,111, 97,116, 32,115,105,122,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102, + 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, + 97,100,101, 95,109,117,108, 95,118, 97,108,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111, +108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, + 99,111,108, 42,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111, 98, 99,111,108,111,114, 40,118, +101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117, +116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 42,111, + 98, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,114, 97,109,112, 95,114, +103, 98,116,111, 98,119, 40,118,101, 99, 51, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, +118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 32, 43, 32, 99, +111,108,111,114, 46,103, 42, 48, 46, 53, 56, 32, 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 49, 50, 59, 10,125, 10, 10,118, +111,105,100, 32,115,104, 97,100,101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 40,102,108,111, 97,116, 32,105, 44, 32,102, +108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,102,108,111, 97,116, 32,101,110,101,114,103,121, 44, 32,111,117,116, 32, +102,108,111, 97,116, 32,111,117,116,115,104, 97,100,102, 97, 99, 41, 10,123, 10, 9,111,117,116,115,104, 97,100,102, 97, 99, 32, + 61, 32,105, 42,101,110,101,114,103,121, 42, 40, 49, 46, 48, 32, 45, 32,115,104, 97,100,102, 97, 99, 41, 59, 10,125, 10, 10,118, +111,105,100, 32,115,104, 97,100,101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,100,105,102,102,117,115,101, 40,102,108, +111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,118,101, 99, 51, 32,114,103, 98, 44, 32,118,101, 99, 52, 32,100,105,102,102, + 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,100,105,102,102, 41, 10,123, 10, 9,111,117,116,100,105,102,102, 32, 61, + 32,100,105,102,102, 32, 45, 32,118,101, 99, 52, 40,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10, +125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,115,112,101, 99,117,108, + 97,114, 40,102,108,111, 97,116, 32,115,104, 97,100,102, 97, 99, 44, 32,118,101, 99, 51, 32,115,112,101, 99,114,103, 98, 44, 32, +118,101, 99, 52, 32,115,112,101, 99, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,115,112,101, 99, 41, 10,123, 10, 9, +111,117,116,115,112,101, 99, 32, 61, 32,115,112,101, 99, 32, 45, 32,118,101, 99, 52, 40,115,112,101, 99,114,103, 98, 42,115,104, + 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,115,116, 95,115,104, 97,100,111,119, + 98,117,102, 40,118,101, 99, 51, 32,114, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 83,104, 97,100,111,119, 32,115,104, + 97,100,111,119,109, 97,112, 44, 32,109, 97,116, 52, 32,115,104, 97,100,111,119,112,101,114,115,109, 97,116, 44, 32,102,108,111, + 97,116, 32,115,104, 97,100,111,119, 98,105, 97,115, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,105,102, 40,105,110,112, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, + 9, 9,114,101,115,117,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,118,101, 99, + 52, 32, 99,111, 32, 61, 32,115,104, 97,100,111,119,112,101,114,115,109, 97,116, 42,118,101, 99, 52, 40,114, 99,111, 44, 32, 49, + 46, 48, 41, 59, 10, 10, 9, 9, 47, 47,102,108,111, 97,116, 32, 98,105, 97,115, 32, 61, 32, 40, 49, 46, 53, 32, 45, 32,105,110, +112, 42,105,110,112, 41, 42,115,104, 97,100,111,119, 98,105, 97,115, 59, 10, 9, 9, 99,111, 46,122, 32, 45, 61, 32,115,104, 97, +100,111,119, 98,105, 97,115, 42, 99,111, 46,119, 59, 10, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32,115,104, 97,100,111,119, + 50, 68, 80,114,111,106, 40,115,104, 97,100,111,119,109, 97,112, 44, 32, 99,111, 41, 46,120, 59, 10, 9,125, 10,125, 10, 10,118, +111,105,100, 32,115,104, 97,100,101, 95,101,120,112,111,115,117,114,101, 95, 99,111,114,114,101, 99,116, 40,118,101, 99, 51, 32, + 99,111,108, 44, 32,102,108,111, 97,116, 32,108,105,110,102, 97, 99, 44, 32,102,108,111, 97,116, 32,108,111,103,102, 97, 99, 44, + 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,108,105, +110,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32,101,120,112, 40, 99,111,108, 42,108,111,103,102, 97, 99, 41, 41, 59, 10,125, 10, + 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,105,115,116, 95,102, 97, 99,116,111,114, 40,118,101, 99, 51, 32, 99,111, 44, + 32,102,108,111, 97,116, 32,109,105,115,116,115,116, 97, 44, 32,102,108,111, 97,116, 32,109,105,115,116,100,105,115,116, 44, 32, +102,108,111, 97,116, 32,109,105,115,116,116,121,112,101, 44, 32,102,108,111, 97,116, 32,109,105,115,105, 44, 32,111,117,116, 32, +102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 44, 32,122, 99,111,114, + 59, 10, 10, 9,122, 99,111,114, 32, 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, + 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,108,101,110,103,116,104, 40, 99,111, 41, 58, 32, 45, 99,111, 91, 50, + 93, 59, 10, 9, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, 40,122, 99,111,114, 45,109,105,115,116,115,116, 97, 41, + 47,109,105,115,116,100,105,115,116, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,105,102, 40,109,105,115,116,116,121, +112,101, 32, 61, 61, 32, 48, 46, 48, 41, 32,102, 97, 99, 32, 42, 61, 32,102, 97, 99, 59, 10, 9,101,108,115,101, 32,105,102, 40, +109,105,115,116,116,121,112,101, 32, 61, 61, 32, 49, 46, 48, 41, 59, 10, 9,101,108,115,101, 32,102, 97, 99, 32, 61, 32,115,113, +114,116, 40,102, 97, 99, 41, 59, 10, 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 45,102, + 97, 99, 41, 42, 40, 49, 46, 48, 45,109,105,115,105, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119,111, +114,108,100, 95,109,105,120, 40,118,101, 99, 51, 32,104,111,114, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32, +118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 32, 61, 32, 99,108, 97,109, +112, 40, 99,111,108, 46, 97, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, + 99, 52, 40,109,105,120, 40,104,111,114, 44, 32, 99,111,108, 46,114,103, 98, 44, 32,102, 97, 99, 41, 44, 32, 99,111,108, 46, 97, + 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,108,112,104, 97, 95,111,112, 97,113,117,101, 40,118,101, + 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99, +111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, + 32,115,104, 97,100,101, 95, 97,108,112,104, 97, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118, +101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111, +117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 42,111, 98, 99,111, +108, 46, 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, 68, 69, 82, + 32, 85, 84, 73, 76, 73, 84, 73, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,102,108,111, 97, +116, 32,102,114,101,115,110,101,108, 95,100,105,101,108,101, 99,116,114,105, 99, 40,118,101, 99, 51, 32, 73,110, 99,111,109,105, +110,103, 44, 32,118,101, 99, 51, 32, 78,111,114,109, 97,108, 44, 32,102,108,111, 97,116, 32,101,116, 97, 41, 10,123, 10, 32, 32, + 32, 32, 47, 42, 32, 99,111,109,112,117,116,101, 32,102,114,101,115,110,101,108, 32,114,101,102,108,101, 99,116, 97,110, 99,101, + 32,119,105,116,104,111,117,116, 32,101,120,112,108,105, 99,105,116,108,121, 32, 99,111,109,112,117,116,105,110,103, 10, 32, 32, + 32, 32, 32, 32, 32,116,104,101, 32,114,101,102,114, 97, 99,116,101,100, 32,100,105,114,101, 99,116,105,111,110, 32, 42, 47, 10, + 32, 32, 32, 32,102,108,111, 97,116, 32, 99, 32, 61, 32, 97, 98,115, 40,100,111,116, 40, 73,110, 99,111,109,105,110,103, 44, 32, + 78,111,114,109, 97,108, 41, 41, 59, 10, 32, 32, 32, 32,102,108,111, 97,116, 32,103, 32, 61, 32,101,116, 97, 32, 42, 32,101,116, + 97, 32, 45, 32, 49, 46, 48, 32, 43, 32, 99, 32, 42, 32, 99, 59, 10, 32, 32, 32, 32,102,108,111, 97,116, 32,114,101,115,117,108, +116, 59, 10, 10, 32, 32, 32, 32,105,102, 40,103, 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103, 32, + 61, 32,115,113,114,116, 40,103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 65, 32, 61, 40,103, 32, 45, + 32, 99, 41, 47, 40,103, 32, 43, 32, 99, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,108,111, 97,116, 32, 66, 32, 61, 40, 99, + 32, 42, 40,103, 32, 43, 32, 99, 41, 45, 32, 49, 46, 48, 41, 47, 40, 99, 32, 42, 40,103, 32, 45, 32, 99, 41, 43, 32, 49, 46, 48, + 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108,116, 32, 61, 32, 48, 46, 53, 32, 42, 32, 65, 32, 42, 32, 65, 32, + 42, 40, 49, 46, 48, 32, 43, 32, 66, 32, 42, 32, 66, 41, 59, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, + 32, 32, 32, 32, 32, 32, 32,114,101,115,117,108,116, 32, 61, 32, 49, 46, 48, 59, 32, 32, 47, 42, 32, 84, 73, 82, 32, 40,110,111, + 32,114,101,102,114, 97, 99,116,101,100, 32, 99,111,109,112,111,110,101,110,116, 41, 32, 42, 47, 10, 10, 32, 32, 32, 32,114,101, +116,117,114,110, 32,114,101,115,117,108,116, 59, 10,125, 10, 10,102,108,111, 97,116, 32,104,121,112,111,116, 40,102,108,111, 97, +116, 32,120, 44, 32,102,108,111, 97,116, 32,121, 41, 10,123, 10, 9,114,101,116,117,114,110, 32,115,113,114,116, 40,120, 42,120, + 32, 43, 32,121, 42,121, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 78, 69, 87, 32, 83, 72, 65, + 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10, 35,100,101,102, +105,110,101, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 32, 51, 10, 10, 47, 42, 32, 98,115,100,102,115, 32, 42, 47, 10, 10,118, +111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40,118,101, 99, 52, 32, 99,111,108,111,114, + 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118, +101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32,108,105,103,104,116, 32, + 42, 47, 10, 9,118,101, 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, 47, 42, 32,100,105,114, +101, 99,116,105,111,110, 97,108, 32,108,105,103,104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110,116, 32,105, 32, 61, 32, + 48, 59, 32,105, 32, 60, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, 9, 9,118,101, 99, 51, + 32,108,105,103,104,116, 95,112,111,115,105,116,105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, + 91,105, 93, 46,112,111,115,105,116,105,111,110, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,100, +105,102,102,117,115,101, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,100,105,102,102,117, +115,101, 46,114,103, 98, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, 61, 32,109, 97,120, 40,100,111,116, 40, + 78, 44, 32,108,105,103,104,116, 95,112,111,115,105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9, 76, 32, 43, 61, + 32,108,105,103,104,116, 95,100,105,102,102,117,115,101, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9,114,101,115,117,108,116, + 32, 61, 32,118,101, 99, 52, 40, 76, 42, 99,111,108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111, +105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,103,108,111,115,115,121, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32, +102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, + 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32, 97,109, 98,105,101,110,116, 32, +108,105,103,104,116, 32, 42, 47, 10, 9,118,101, 99, 51, 32, 76, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 50, 41, 59, 10, 10, 9, + 47, 42, 32,100,105,114,101, 99,116,105,111,110, 97,108, 32,108,105,103,104,116,115, 32, 42, 47, 10, 9,102,111,114, 40,105,110, +116, 32,105, 32, 61, 32, 48, 59, 32,105, 32, 60, 32, 78, 85, 77, 95, 76, 73, 71, 72, 84, 83, 59, 32,105, 43, 43, 41, 32,123, 10, + 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,112,111,115,105,116,105,111,110, 32, 61, 32,103,108, 95, 76,105,103,104,116, + 83,111,117,114, 99,101, 91,105, 93, 46,112,111,115,105,116,105,111,110, 46,120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32, 72, + 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,104, 97,108,102, 86,101, 99,116,111,114, 46, +120,121,122, 59, 10, 9, 9,118,101, 99, 51, 32,108,105,103,104,116, 95,100,105,102,102,117,115,101, 32, 61, 32,103,108, 95, 76, +105,103,104,116, 83,111,117,114, 99,101, 91,105, 93, 46,100,105,102,102,117,115,101, 46,114,103, 98, 59, 10, 9, 9,118,101, 99, + 51, 32,108,105,103,104,116, 95,115,112,101, 99,117,108, 97,114, 32, 61, 32,103,108, 95, 76,105,103,104,116, 83,111,117,114, 99, +101, 91,105, 93, 46,115,112,101, 99,117,108, 97,114, 46,114,103, 98, 59, 10, 10, 9, 9, 47, 42, 32,119,101, 32,109,105,120, 32, +105,110, 32,115,111,109,101, 32,100,105,102,102,117,115,101, 32,115,111, 32,108,111,119, 32,114,111,117,103,104,110,101,115,115, + 32,115,116,105,108,108, 32,115,104,111,119,115, 32,117,112, 32, 42, 47, 10, 9, 9,102,108,111, 97,116, 32, 98,115,100,102, 32, + 61, 32, 48, 46, 53, 42,112,111,119, 40,109, 97,120, 40,100,111,116, 40, 78, 44, 32, 72, 41, 44, 32, 48, 46, 48, 41, 44, 32, 49, + 46, 48, 47,114,111,117,103,104,110,101,115,115, 41, 59, 10, 9, 9, 98,115,100,102, 32, 43, 61, 32, 48, 46, 53, 42,109, 97,120, + 40,100,111,116, 40, 78, 44, 32,108,105,103,104,116, 95,112,111,115,105,116,105,111,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, + 9, 76, 32, 43, 61, 32,108,105,103,104,116, 95,115,112,101, 99,117,108, 97,114, 42, 98,115,100,102, 59, 10, 9,125, 10, 10, 9, +114,101,115,117,108,116, 32, 61, 32,118,101, 99, 52, 40, 76, 42, 99,111,108,111,114, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, + 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95, 97,110,105,115,111,116,114,111,112,105, 99, 40,118, +101, 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 85, 44, 32,102,108,111, + 97,116, 32,114,111,117,103,104,110,101,115,115, 86, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111, +117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102, +102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10, +118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,103,108, 97,115,115, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, + 32,102,108,111, 97,116, 32,114,111,117,103,104,110,101,115,115, 44, 32,102,108,111, 97,116, 32,105,111,114, 44, 32,118,101, 99, + 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, + 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, + 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,116,114, 97, +110,115,108,117, 99,101,110,116, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, + 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117, +115,101, 40, 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10,118,111, +105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,116,114, 97,110,115,112, 97,114,101,110,116, 40,118,101, 99, 52, 32, 99,111, +108,111,114, 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9, 47, 42, 32,116,104,105,115, + 32,105,115,110, 39,116, 32,114,105,103,104,116, 32, 42, 47, 10, 9,114,101,115,117,108,116, 46,114, 32, 61, 32, 99,111,108,111, +114, 46,114, 59, 10, 9,114,101,115,117,108,116, 46,103, 32, 61, 32, 99,111,108,111,114, 46,103, 59, 10, 9,114,101,115,117,108, +116, 46, 98, 32, 61, 32, 99,111,108,111,114, 46, 98, 59, 10, 9,114,101,115,117,108,116, 46, 97, 32, 61, 32, 48, 46, 48, 59, 10, +125, 10, 10,118,111,105,100, 32,110,111,100,101, 95, 98,115,100,102, 95,118,101,108,118,101,116, 40,118,101, 99, 52, 32, 99,111, +108,111,114, 44, 32,102,108,111, 97,116, 32,115,105,103,109, 97, 44, 32,118,101, 99, 51, 32, 78, 44, 32,111,117,116, 32,118,101, + 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,110,111,100,101, 95, 98,115,100,102, 95,100,105,102,102,117,115,101, 40, + 99,111,108,111,114, 44, 32, 48, 46, 48, 44, 32, 78, 44, 32,114,101,115,117,108,116, 41, 59, 10,125, 10, 10, 47, 42, 32,101,109, +105,115,115,105,111,110, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,101,109,105,115,115,105,111,110, 40,118,101, + 99, 52, 32, 99,111,108,111,114, 44, 32,102,108,111, 97,116, 32,115,116,114,101,110,103,116,104, 44, 32,118,101, 99, 51, 32, 78, + 44, 32,111,117,116, 32,118,101, 99, 52, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,114,101,115,117,108,116, 32, 61, 32, 99, +111,108,111,114, 42,115,116,114,101,110,103,116,104, 59, 10,125, 10, 10, 47, 42, 32, 99,108,111,115,117,114,101,115, 32, 42, 47, + 10, 10,118,111,105,100, 32,110,111,100,101, 95,109,105,120, 95,115,104, 97,100,101,114, 40,102,108,111, 97,116, 32,102, 97, 99, + 44, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 49, 44, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 50, 44, 32,111,117, +116, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 41, 10,123, 10, 9,115,104, 97,100,101,114, 32, 61, 32,109,105,120, 40,115, +104, 97,100,101,114, 49, 44, 32,115,104, 97,100,101,114, 50, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110, +111,100,101, 95, 97,100,100, 95,115,104, 97,100,101,114, 40,118,101, 99, 52, 32,115,104, 97,100,101,114, 49, 44, 32,118,101, 99, + 52, 32,115,104, 97,100,101,114, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,115,104, 97,100,101,114, 41, 10,123, 10, 9,115, +104, 97,100,101,114, 32, 61, 32,115,104, 97,100,101,114, 49, 32, 43, 32,115,104, 97,100,101,114, 50, 59, 10,125, 10, 10, 47, 42, + 32,102,114,101,115,110,101,108, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,102,114,101,115,110,101,108, 40,102, +108,111, 97,116, 32,105,111,114, 44, 32,118,101, 99, 51, 32, 78, 44, 32,118,101, 99, 51, 32, 73, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,114,101,115,117,108,116, 41, 10,123, 10, 9,102,108,111, 97,116, 32,101,116, 97, 32, 61, 32,109, 97,120, 40,105, +111,114, 44, 32, 48, 46, 48, 48, 48, 48, 49, 41, 59, 10, 9,114,101,115,117,108,116, 32, 61, 32,102,114,101,115,110,101,108, 95, +100,105,101,108,101, 99,116,114,105, 99, 40, 73, 44, 32, 78, 44, 32,101,116, 97, 41, 59, 32, 47, 47, 98, 97, 99,107,102, 97, 99, +105,110,103, 40, 41, 63, 32, 49, 46, 48, 47,101,116, 97, 58, 32,101,116, 97, 41, 59, 10,125, 10, 10, 47, 42, 32,103,101,111,109, +101,116,114,121, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,103,101,111,109,101,116,114,121, 40,118,101, 99, 51, + 32, 73, 44, 32,118,101, 99, 51, 32, 78, 44, 32,109, 97,116, 52, 32,116,111,119,111,114,108,100, 44, 10, 9,111,117,116, 32,118, +101, 99, 51, 32,112,111,115,105,116,105,111,110, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111, +117,116, 32,118,101, 99, 51, 32,116, 97,110,103,101,110,116, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32,116,114,117,101, 95, +110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,109,105,110,103, 44, 32,111,117,116, 32,118, +101, 99, 51, 32,112, 97,114, 97,109,101,116,114,105, 99, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32, 98, 97, 99,107,102, + 97, 99,105,110,103, 41, 10,123, 10, 9,112,111,115,105,116,105,111,110, 32, 61, 32, 40,116,111,119,111,114,108,100, 42,118,101, + 99, 52, 40, 73, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 78, 59, 10, 9,116, + 97,110,103,101,110,116, 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59, 10, 9,116,114,117,101, 95,110,111,114,109, 97,108, + 32, 61, 32, 78, 59, 10, 9,105,110, 99,111,109,105,110,103, 32, 61, 32, 73, 59, 10, 9,112, 97,114, 97,109,101,116,114,105, 99, + 32, 61, 32,118,101, 99, 51, 40, 48, 46, 48, 41, 59, 10, 9, 98, 97, 99,107,102, 97, 99,105,110,103, 32, 61, 32, 48, 46, 48, 59, + 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95, 99,111,111,114,100, 40,118,101, 99, 51, 32, 73, 44, 32, +118,101, 99, 51, 32, 78, 44, 32,109, 97,116, 52, 32,116,111,119,111,114,108,100, 44, 10, 9,118,101, 99, 51, 32, 97,116,116,114, + 95,111,114, 99,111, 44, 32,118,101, 99, 51, 32, 97,116,116,114, 95,117,118, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32,103, +101,110,101,114, 97,116,101,100, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32, +111, 98,106,101, 99,116, 44, 10, 9,111,117,116, 32,118,101, 99, 51, 32, 99, 97,109,101,114, 97, 44, 32,111,117,116, 32,118,101, + 99, 51, 32,119,105,110,100,111,119, 44, 32,111,117,116, 32,118,101, 99, 51, 32,114,101,102,108,101, 99,116,105,111,110, 41, 10, +123, 10, 9,103,101,110,101,114, 97,116,101,100, 32, 61, 32, 97,116,116,114, 95,111,114, 99,111, 59, 10, 9,117,118, 32, 61, 32, + 97,116,116,114, 95,117,118, 59, 10, 9,111, 98,106,101, 99,116, 32, 61, 32, 73, 59, 10, 9, 99, 97,109,101,114, 97, 32, 61, 32, + 73, 59, 10, 9,119,105,110,100,111,119, 32, 61, 32,103,108, 95, 70,114, 97,103, 67,111,111,114,100, 46,120,121,122, 59, 10, 9, +114,101,102,108,101, 99,116,105,111,110, 32, 61, 32,114,101,102,108,101, 99,116, 40, 78, 44, 32, 73, 41, 59, 10, 10,125, 10, 10, + 47, 42, 32,116,101,120,116,117,114,101,115, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95, 98,108, +101,110,100, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, + 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95, 99,108,111,117,100, +115, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, + 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, + 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32, +110,111,100,101, 95,116,101,120, 95,100,105,115,116,110,111,105,115,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97, +116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,100,105,115,116,111,114,116,105,111,110, 44, 32,111,117,116, 32,102,108, +111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110, +111,100,101, 95,116,101,120, 95,101,110,118,105,114,111,110,109,101,110,116, 40,118,101, 99, 51, 32, 99,111, 44, 32,115, 97,109, +112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9,102, +108,111, 97,116, 32,117, 32, 61, 32, 40, 97,116, 97,110, 40, 99,111, 46,121, 44, 32, 99,111, 46,120, 41, 32, 43, 32, 77, 95, 80, + 73, 41, 47, 40, 50, 46, 48, 42, 77, 95, 80, 73, 41, 59, 10, 9,102,108,111, 97,116, 32,118, 32, 61, 32, 97,116, 97,110, 40, 99, +111, 46,122, 44, 32,104,121,112,111,116, 40, 99,111, 46,120, 44, 32, 99,111, 46,121, 41, 41, 47, 77, 95, 80, 73, 32, 43, 32, 48, + 46, 53, 59, 10, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,118,101, 99, + 50, 40,117, 44, 32,118, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,105,109, 97,103,101, + 40,118,101, 99, 51, 32, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,118,101, 99, + 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, + 97, 44, 32, 99,111, 46,120,121, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,109, 97,103,105, + 99, 40,118,101, 99, 51, 32,112, 44, 32,102,108,111, 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,102,108,111, 97, +116, 32,110, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116,117, +114, 98, 32, 61, 32,116,117,114, 98,117,108,101,110, 99,101, 47, 53, 46, 48, 59, 10, 10, 9,102,108,111, 97,116, 32,120, 32, 61, + 32,115,105,110, 40, 40,112, 46,120, 32, 43, 32,112, 46,121, 32, 43, 32,112, 46,122, 41, 42, 53, 46, 48, 41, 59, 10, 9,102,108, +111, 97,116, 32,121, 32, 61, 32, 99,111,115, 40, 40, 45,112, 46,120, 32, 43, 32,112, 46,121, 32, 45, 32,112, 46,122, 41, 42, 53, + 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,122, 32, 61, 32, 45, 99,111,115, 40, 40, 45,112, 46,120, 32, 45, 32,112, 46,121, + 32, 43, 32,112, 46,122, 41, 42, 53, 46, 48, 41, 59, 10, 10, 9,105,102, 40,110, 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, +120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, 9,122, 32, 42, 61, 32,116, +117,114, 98, 59, 10, 9, 9,121, 32, 61, 32, 45, 99,111,115, 40,120, 45,121, 43,122, 41, 59, 10, 9, 9,121, 32, 42, 61, 32,116, +117,114, 98, 59, 10, 10, 9, 9,105,102, 40,110, 32, 62, 32, 49, 46, 48, 41, 32,123, 10, 9, 9, 9,120, 61, 32, 99,111,115, 40, +120, 45,121, 45,122, 41, 59, 10, 9, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9,105,102, 40,110, 32, 62, + 32, 50, 46, 48, 41, 32,123, 10, 9, 9, 9, 9,122, 61, 32,115,105,110, 40, 45,120, 45,121, 45,122, 41, 59, 10, 9, 9, 9, 9, +122, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 51, 46, 48, 41, 32,123, 10, 9, 9, + 9, 9, 9,120, 61, 32, 45, 99,111,115, 40, 45,120, 43,121, 45,122, 41, 59, 10, 9, 9, 9, 9, 9,120, 32, 42, 61, 32,116,117, +114, 98, 59, 10, 10, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 52, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9,121, 61, + 32, 45,115,105,110, 40, 45,120, 43,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, + 10, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 53, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9,121, 61, 32, 45, + 99,111,115, 40, 45,120, 43,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, + 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 54, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9,120, 61, 32, + 99,111,115, 40,120, 43,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, + 9, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 55, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,122, + 61, 32,115,105,110, 40,120, 43,121, 45,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,122, 32, 42, 61, 32,116,117,114, 98, + 59, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 56, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9,120, 61, 32, 45, 99,111,115, 40, 45,120, 45,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,120, + 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 57, 46, 48, 41, + 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,121, 61, 32, 45,115,105,110, 40,120, 45,121, 43,122, 41, 59, 10, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,125, 10, + 9, 9, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, + 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9,125, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10, 10, + 9,105,102, 40,116,117,114, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,116,117,114, 98, 32, 42, 61, 32, 50, 46, 48, + 59, 10, 9, 9,120, 32, 47, 61, 32,116,117,114, 98, 59, 10, 9, 9,121, 32, 47, 61, 32,116,117,114, 98, 59, 10, 9, 9,122, 32, + 47, 61, 32,116,117,114, 98, 59, 10, 9,125, 10, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 53, 32, 45, + 32,120, 44, 32, 48, 46, 53, 32, 45, 32,121, 44, 32, 48, 46, 53, 32, 45, 32,122, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118, +111,105,100, 32,110,111,100,101, 95,116,101,120, 95,109, 97,114, 98,108,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, + 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,111,117,116, 32,102, +108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32, +110,111,100,101, 95,116,101,120, 95,109,117,115,103,114, 97,118,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, + 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,100,105,109,101,110,115,105,111,110, 44, 32,102,108,111, 97,116, 32,108, 97, + 99,117,110, 97,114,105,116,121, 44, 32,102,108,111, 97,116, 32,111, 99,116, 97,118,101,115, 44, 32,102,108,111, 97,116, 32,111, +102,102,115,101,116, 44, 32,102,108,111, 97,116, 32,103, 97,105,110, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, + 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, + 95,110,111,105,115,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32, +111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 49, + 46, 48, 41, 59, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101, +120, 95,115,107,121, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, + 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100, +101, 95,116,101,120, 95,115,116,117, 99, 99,105, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, + 44, 32,102,108,111, 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, + 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101, +120, 95,118,111,114,111,110,111,105, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102, +108,111, 97,116, 32,119,101,105,103,104,116, 49, 44, 32,102,108,111, 97,116, 32,119,101,105,103,104,116, 50, 44, 32,102,108,111, + 97,116, 32,119,101,105,103,104,116, 51, 44, 32,102,108,111, 97,116, 32,119,101,105,103,104,116, 52, 44, 32,102,108,111, 97,116, + 32,101,120,112,111,110,101,110,116, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102, 108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10, - 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,100,105,115, -116,110,111,105,115,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97, -116, 32,100,105,115,116,111,114,116,105,111,110, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9, -102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,101,110,118,105, -114,111,110,109,101,110,116, 40,118,101, 99, 51, 32, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32, -111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9,102,108,111, 97,116, 32,117, 32, 61, 32, 40, 97,116, - 97,110, 40, 99,111, 46,121, 44, 32, 99,111, 46,120, 41, 32, 43, 32, 77, 95, 80, 73, 41, 47, 40, 50, 46, 48, 42, 77, 95, 80, 73, - 41, 59, 10, 9,102,108,111, 97,116, 32,118, 32, 61, 32, 97,116, 97,110, 40, 99,111, 46,122, 44, 32,104,121,112,111,116, 40, 99, -111, 46,120, 44, 32, 99,111, 46,121, 41, 41, 47, 77, 95, 80, 73, 32, 43, 32, 48, 46, 53, 59, 10, 10, 9, 99,111,108,111,114, 32, - 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32,118,101, 99, 50, 40,117, 44, 32,118, 41, 41, 59, 10,125, 10, - 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,105,109, 97,103,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,115, 97, -109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9, - 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97, 44, 32, 99,111, 46,120,121, 41, 59, 10,125, - 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,109, 97,103,105, 99, 40,118,101, 99, 51, 32,112, 44, 32,102,108, -111, 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,102,108,111, 97,116, 32,110, 44, 32,111,117,116, 32,118,101, 99, - 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116,117,114, 98, 32, 61, 32,116,117,114, 98,117,108,101, -110, 99,101, 47, 53, 46, 48, 59, 10, 10, 9,102,108,111, 97,116, 32,120, 32, 61, 32,115,105,110, 40, 40,112, 46,120, 32, 43, 32, -112, 46,121, 32, 43, 32,112, 46,122, 41, 42, 53, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,121, 32, 61, 32, 99,111,115, 40, - 40, 45,112, 46,120, 32, 43, 32,112, 46,121, 32, 45, 32,112, 46,122, 41, 42, 53, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32, -122, 32, 61, 32, 45, 99,111,115, 40, 40, 45,112, 46,120, 32, 45, 32,112, 46,121, 32, 43, 32,112, 46,122, 41, 42, 53, 46, 48, 41, - 59, 10, 10, 9,105,102, 40,110, 32, 62, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, - 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, 9,122, 32, 42, 61, 32,116,117,114, 98, 59, 10, 9, 9,121, 32, 61, 32, 45, - 99,111,115, 40,120, 45,121, 43,122, 41, 59, 10, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9,105,102, 40,110, - 32, 62, 32, 49, 46, 48, 41, 32,123, 10, 9, 9, 9,120, 61, 32, 99,111,115, 40,120, 45,121, 45,122, 41, 59, 10, 9, 9, 9,120, - 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9,105,102, 40,110, 32, 62, 32, 50, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, -122, 61, 32,115,105,110, 40, 45,120, 45,121, 45,122, 41, 59, 10, 9, 9, 9, 9,122, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, - 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 51, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9,120, 61, 32, 45, 99,111,115, 40, 45, -120, 43,121, 45,122, 41, 59, 10, 9, 9, 9, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9,105,102, - 40,110, 32, 62, 32, 52, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9,121, 61, 32, 45,115,105,110, 40, 45,120, 43,121, 43,122, - 41, 59, 10, 9, 9, 9, 9, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, - 62, 32, 53, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9,121, 61, 32, 45, 99,111,115, 40, 45,120, 43,121, 43,122, 41, 59, - 10, 9, 9, 9, 9, 9, 9, 9,121, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, - 62, 32, 54, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9,120, 61, 32, 99,111,115, 40,120, 43,121, 43,122, 41, 59, 10, - 9, 9, 9, 9, 9, 9, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, - 32, 62, 32, 55, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,122, 61, 32,115,105,110, 40,120, 43,121, 45,122, 41, - 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,122, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, -105,102, 40,110, 32, 62, 32, 56, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,120, 61, 32, 45, 99,111,115, 40, - 45,120, 45,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,120, 32, 42, 61, 32,116,117,114, 98, 59, 10, 10, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9,105,102, 40,110, 32, 62, 32, 57, 46, 48, 41, 32,123, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9,121, 61, 32, 45,115,105,110, 40,120, 45,121, 43,122, 41, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,121, 32, 42, - 61, 32,116,117,114, 98, 59, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, - 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9, 9,125, 10, 9, 9, 9, 9, 9,125, - 10, 9, 9, 9, 9,125, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10, 10, 9,105,102, 40,116,117,114, 98, 32, 33, 61, 32, - 48, 46, 48, 41, 32,123, 10, 9, 9,116,117,114, 98, 32, 42, 61, 32, 50, 46, 48, 59, 10, 9, 9,120, 32, 47, 61, 32,116,117,114, - 98, 59, 10, 9, 9,121, 32, 47, 61, 32,116,117,114, 98, 59, 10, 9, 9,122, 32, 47, 61, 32,116,117,114, 98, 59, 10, 9,125, 10, - 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 53, 32, 45, 32,120, 44, 32, 48, 46, 53, 32, 45, 32,121, 44, - 32, 48, 46, 53, 32, 45, 32,122, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, - 95,109, 97,114, 98,108,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, - 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, - 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,109,117,115, -103,114, 97,118,101, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, - 32,100,105,109,101,110,115,105,111,110, 44, 32,102,108,111, 97,116, 32,108, 97, 99,117,110, 97,114,105,116,121, 44, 32,102,108, -111, 97,116, 32,111, 99,116, 97,118,101,115, 44, 32,102,108,111, 97,116, 32,111,102,102,115,101,116, 44, 32,102,108,111, 97,116, - 32,103, 97,105,110, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, - 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,110,111,105,115,101, 40,118,101, 99, 51, 32, - 99,111, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, - 99, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10, 9,102, 97, 99, 32, 61, 32, - 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,115,107,121, 40,118,101, 99, 51, 32, 99, -111, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, - 99, 52, 40, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,115,116,117, 99, 99,105, - 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,117,114, 98, -117,108,101,110, 99,101, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, - 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,118,111,114,111,110,111,105, 40,118,101, - 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,119,101,105,103,104,116, 49, - 44, 32,102,108,111, 97,116, 32,119,101,105,103,104,116, 50, 44, 32,102,108,111, 97,116, 32,119,101,105,103,104,116, 51, 44, 32, -102,108,111, 97,116, 32,119,101,105,103,104,116, 52, 44, 32,102,108,111, 97,116, 32,101,120,112,111,110,101,110,116, 44, 32,111, -117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, - 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40, 49, 46, 48, 41, 59, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, -125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,119,111,111,100, 40,118,101, 99, 51, 32, 99,111, 44, 32,102, -108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,117,114, 98,117,108,101,110, 99,101, 44, 32,111,117,116, - 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 32, -108,105,103,104,116, 32,112, 97,116,104, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,108,105,103,104,116, 95,112, - 97,116,104, 40, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95, 99, 97,109,101,114, 97, 95,114, 97,121, 44, 10, 9, -111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,115,104, 97,100,111,119, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108, -111, 97,116, 32,105,115, 95,100,105,102,102,117,115,101, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105, -115, 95,103,108,111,115,115,121, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,114,101,102,108, -101, 99,116,105,111,110, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,116,114, 97,110,115,109, -105,115,115,105,111,110, 95,114, 97,121, 41, 10,123, 10, 9,105,115, 95, 99, 97,109,101,114, 97, 95,114, 97,121, 32, 61, 32, 49, - 46, 48, 59, 10, 9,105,115, 95,115,104, 97,100,111,119, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,100,105, -102,102,117,115,101, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,103,108,111,115,115,121, 95,114, 97,121, 32, + 9,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,100,101, 95,116,101,120, 95,119,111,111, +100, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,117,114, + 98,117,108,101,110, 99,101, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102, 97, 99, 32, 61, + 32, 49, 46, 48, 59, 10,125, 10, 10, 47, 42, 32,108,105,103,104,116, 32,112, 97,116,104, 32, 42, 47, 10, 10,118,111,105,100, 32, +110,111,100,101, 95,108,105,103,104,116, 95,112, 97,116,104, 40, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95, 99, + 97,109,101,114, 97, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,115,104, 97,100,111,119, 95, +114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,100,105,102,102,117,115,101, 95,114, 97,121, 44, 10, + 9,111,117,116, 32,102,108,111, 97,116, 32,105,115, 95,103,108,111,115,115,121, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102, +108,111, 97,116, 32,105,115, 95,115,105,110,103,117,108, 97,114, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, + 32,105,115, 95,114,101,102,108,101, 99,116,105,111,110, 95,114, 97,121, 44, 10, 9,111,117,116, 32,102,108,111, 97,116, 32,105, +115, 95,116,114, 97,110,115,109,105,115,115,105,111,110, 95,114, 97,121, 41, 10,123, 10, 9,105,115, 95, 99, 97,109,101,114, 97, + 95,114, 97,121, 32, 61, 32, 49, 46, 48, 59, 10, 9,105,115, 95,115,104, 97,100,111,119, 95,114, 97,121, 32, 61, 32, 48, 46, 48, + 59, 10, 9,105,115, 95,100,105,102,102,117,115,101, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,103,108,111, +115,115,121, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,115,105,110,103,117,108, 97,114, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,114,101,102,108,101, 99,116,105,111,110, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10, 9,105,115, 95,116,114, 97,110,115,109,105,115,115,105,111,110, 95,114, 97,121, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10, 47, 42, 32,111,117,116,112,117,116, 32, 42, 47, 10, 10,118,111,105,100, 32,110,111,100,101, 95,111,117,116,112,117,116, 95,109, diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index d08c86aacbc..d85251a8ccb 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -1,7 +1,4 @@ /* - * allocimbuf.c - * - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -47,8 +44,8 @@ #include "imbuf.h" -#include "MEM_CacheLimiterC-Api.h" #include "MEM_guardedalloc.h" +#include "MEM_CacheLimiterC-Api.h" void imb_freemipmapImBuf(ImBuf *ibuf) { diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 41278e8381a..19eb917469d 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -309,7 +309,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im if (img != NULL) { stat(path, &info); - BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime); + BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime); BLI_snprintf(cwidth, sizeof(cwidth), "%d", img->x); BLI_snprintf(cheight, sizeof(cheight), "%d", img->y); } @@ -327,7 +327,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im IMB_free_anim(anim); } stat(path, &info); - BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime); + BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime); } if (!img) return NULL; diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 551639ed330..48a013e06ec 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -583,7 +583,7 @@ typedef struct SpaceAction { short blockhandler[8]; - View2D v2d; /* depricated, copied to region */ + View2D v2d DNA_DEPRECATED; /* copied to region */ bAction *action; /* the currently active action */ bDopeSheet ads; /* the currently active context (when not showing action) */ diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index 292f920da66..ff04a7fd366 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -31,6 +31,8 @@ * \ingroup DNA */ +#include "DNA_defs.h" + #include "DNA_ID.h" #ifdef __cplusplus @@ -59,7 +61,7 @@ typedef struct Camera { The name was not changed so that no other files need to be modified */ float YF_dofdist; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Object *dof_ob; diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index c85ef72d337..4aff540a948 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -33,6 +33,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" #include "DNA_listBase.h" @@ -66,7 +67,7 @@ typedef struct bConstraint { float headtail; /* Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/ int pad; - struct Ipo *ipo; /* local influence ipo or driver */ // XXX depreceated for 2.5... old animation system hack + struct Ipo *ipo DNA_DEPRECATED; /* local influence ipo or driver */ /* old animation system, deprecated for 2.5 */ /* below are readonly fields that are set at runtime by the solver for use in the GE (only IK atm) */ float lin_error; /* residual error on constraint expressed in blender unit*/ diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 236d6dd4732..8214a32e9fb 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_vec_types.h" #include "DNA_ID.h" @@ -174,7 +175,7 @@ typedef struct Curve { EditNurb *editnurb; /* edited data, not in file, use pointer so we can check for it */ struct Object *bevobj, *taperobj, *textoncurve; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ Path *path; struct Key *key; struct Material **mat; diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h new file mode 100644 index 00000000000..88401d3d2d4 --- /dev/null +++ b/source/blender/makesdna/DNA_defs.h @@ -0,0 +1,45 @@ +/* + * ***** 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. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef DNA_DEFS_H +#define DNA_DEFS_H + +/** \file DNA_defs.h + * \ingroup DNA + */ + +/* makesdna ignores */ +#ifdef DNA_DEPRECATED_ALLOW + /* allow use of deprecated items */ +# define DNA_DEPRECATED +#else +# ifndef DNA_DEPRECATED +# ifdef __GNUC__ +# define DNA_DEPRECATED __attribute__ ((deprecated)) +# else + /* TODO, msvc & others */ +# define DNA_DEPRECATED +# endif +# endif +#endif + +#endif /* DNA_DEFS_H */ diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h index 105aa4280ef..12fb9b92602 100644 --- a/source/blender/makesdna/DNA_key_types.h +++ b/source/blender/makesdna/DNA_key_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_ID.h" @@ -62,10 +63,10 @@ typedef struct Key { KeyBlock *refkey; char elemstr[32]; int elemsize; - float curval; + float curval DNA_DEPRECATED; ListBase block; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ ID *from; @@ -93,4 +94,3 @@ typedef struct Key { #define KEYBLOCK_LOCKED (1<<2) #endif - diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h index 91930f5766e..1c22583b82c 100644 --- a/source/blender/makesdna/DNA_lamp_types.h +++ b/source/blender/makesdna/DNA_lamp_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" #ifndef MAX_MTEX @@ -97,7 +98,7 @@ typedef struct Lamp { short sky_colorspace; char pad4[6]; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct MTex *mtex[18]; /* MAX_MTEX */ short pr_texture, use_nodes; char pad6[4]; diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h index f694e611089..baa2f5f911a 100644 --- a/source/blender/makesdna/DNA_lattice_types.h +++ b/source/blender/makesdna/DNA_lattice_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" struct AnimData; @@ -60,7 +61,7 @@ typedef struct Lattice { struct BPoint *def; - struct Ipo *ipo; /* XXX: depreceated... old animation system */ + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Key *key; struct MDeformVert *dvert; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index cc7638bd502..a693e946cc4 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" #include "DNA_listBase.h" @@ -150,7 +151,7 @@ typedef struct Material { struct MTex *mtex[18]; /* MAX_MTEX */ struct bNodeTree *nodetree; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Group *group; /* light group */ struct PreviewImage * preview; diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 647da56ffab..cd76944e1b0 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_ID.h" #include "DNA_customdata_types.h" @@ -47,7 +48,6 @@ struct MSticky; struct Mesh; struct OcInfo; struct Multires; -struct PartialVisibility; struct EditMesh; struct AnimData; @@ -57,7 +57,7 @@ typedef struct Mesh { struct BoundBox *bb; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Key *key; struct Material **mat; @@ -92,14 +92,13 @@ typedef struct Mesh { short texflag, drawflag; short smoothresh, flag; - short subdiv, subdivr; - char subsurftype; /* only kept for backwards compat, not used anymore */ + short subdiv DNA_DEPRECATED, subdivr DNA_DEPRECATED; + char subsurftype DNA_DEPRECATED; /* only kept for backwards compat, not used anymore */ char editflag; short totcol; - struct Multires *mr; /* deprecated multiresolution modeling data, only keep for loading old files */ - struct PartialVisibility *pv; + struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */ } Mesh; /* deprecated by MTFace, only here for file reading */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index ac447fc0257..44cfc7b7aa0 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -174,14 +174,6 @@ typedef struct Multires { /** End Multires **/ -typedef struct PartialVisibility { - unsigned int *vert_map; /* vert_map[Old Index]= New Index */ - int *edge_map; /* edge_map[Old Index]= New Index, -1= hidden */ - MFace *old_faces; - MEdge *old_edges; - unsigned int totface, totedge, totvert, pad; -} PartialVisibility; - typedef struct MRecast{ int i; } MRecast; @@ -200,8 +192,8 @@ typedef struct MRecast{ /* reserve 16 for ME_HIDE */ #define ME_EDGERENDER (1<<5) #define ME_LOOSEEDGE (1<<7) -#define ME_SEAM_LAST (1<<8) -#define ME_SHARP (1<<9) +/* #define ME_SEAM_LAST (1<<8) */ /* UNUSED */ +#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */ #define ME_FREESTYLE_EDGE (1<<10) /* puno = vertexnormal (mface) */ diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h index 12345ede3c4..1ce90e7d526 100644 --- a/source/blender/makesdna/DNA_meta_types.h +++ b/source/blender/makesdna/DNA_meta_types.h @@ -70,7 +70,7 @@ typedef struct MetaBall { ListBase elems; ListBase disp; ListBase *editelems; /* not saved in files, note we use pointer for editmode check */ - struct Ipo *ipo; // XXX... depreceated (old animation system) + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ /* material of the mother ball will define the material used of all others */ struct Material **mat; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 4abbbd7146d..5edc0869d9b 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -25,6 +25,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_listBase.h" @@ -238,7 +239,7 @@ typedef struct ArrayModifierData { typedef struct MirrorModifierData { ModifierData modifier; - short axis; /* deprecated, use flag instead */ + short axis DNA_DEPRECATED; /* deprecated, use flag instead */ short flag; float tolerance; struct Object *mirror_ob; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 8f22b1b31cb..845d8a87c5b 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -91,7 +91,7 @@ typedef struct bNodeSocket { /* internal data to retrieve relations and groups */ int own_index; /* group socket identifiers, to find matching pairs after reading files */ - int to_index; /* XXX deprecated, only used for restoring old group node links */ + int to_index DNA_DEPRECATED; /* XXX deprecated, only used for restoring old group node links */ struct bNodeSocket *groupsock; struct bNodeLink *link; /* a link pointer, set in ntreeUpdateTree */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 29568fdd0fb..e4237197fca 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -32,6 +32,7 @@ * \brief Object is a sort of wrapper for general info. */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_ID.h" #include "DNA_action_types.h" /* bAnimVizSettings */ @@ -110,10 +111,10 @@ typedef struct Object { /* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */ /* proxy_from is set in target back to the proxy. */ struct Object *proxy, *proxy_group, *proxy_from; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ /* struct Path *path; */ struct BoundBox *bb; - struct bAction *action; // XXX depreceated... old animation system + struct bAction *action DNA_DEPRECATED; // XXX depreceated... old animation system struct bAction *poselib; struct bPose *pose; /* pose data, armature objects only */ void *data; /* pointer to objects data - an 'ID' or NULL */ @@ -123,8 +124,8 @@ typedef struct Object { bAnimVizSettings avs; /* settings for visualisation of object-transform animation */ bMotionPath *mpath; /* motion path cache for this object */ - ListBase constraintChannels; // XXX depreceated... old animation system - ListBase effect; // XXX depreceated... keep for readfile + ListBase constraintChannels DNA_DEPRECATED; // XXX depreceated... old animation system + ListBase effect DNA_DEPRECATED; // XXX depreceated... keep for readfile ListBase disp; /* list of DispList, used by lattice, metaballs curve & surfaces */ ListBase defbase; /* list of bDeformGroup (vertex groups) names and flag only */ ListBase modifiers; /* list of ModifierData structures */ @@ -134,13 +135,15 @@ typedef struct Object { /* materials */ struct Material **mat; /* material slots */ - char *matbits; /* 1 if material linked to object */ + char *matbits; /* a boolean field, with each byte 1 if corrusponding material is linked to object */ int totcol; /* copy of mesh or curve or meta */ int actcol; /* currently selected material in the UI */ /* rot en drot have to be together! (transform('r' en 's')) */ float loc[3], dloc[3], orig[3]; - float size[3], dsize[3]; /* scale and delta scale */ + float size[3]; /* scale infact */ + float dsize[3] DNA_DEPRECATED ; /* DEPRECATED, 2.60 and older only */ + float dscale[3]; /* ack!, changing */ float rot[3], drot[3]; /* euler rotation */ float quat[4], dquat[4]; /* quaternion rotation */ float rotAxis[3], drotAxis[3]; /* axis angle rotation - axis part */ @@ -158,8 +161,10 @@ typedef struct Object { unsigned int lay; /* copy of Base's layer in the scene */ + int pad6; + short flag; /* copy of Base */ - short colbits; /* deprecated */ + short colbits DNA_DEPRECATED; /* deprecated */ short transflag, protectflag; /* transformation settings and transform locks */ short trackflag, upflag; @@ -229,8 +234,8 @@ typedef struct Object { float anisotropicFriction[3]; ListBase constraints; /* object constraints */ - ListBase nlastrips; // XXX depreceated... old animation system - ListBase hooks; // XXX depreceated... old animation system + ListBase nlastrips DNA_DEPRECATED; // XXX depreceated... old animation system + ListBase hooks DNA_DEPRECATED; // XXX depreceated... old animation system ListBase particlesystem; /* particle systems */ struct PartDeflect *pd; /* particle deflector/attractor/collision data */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 11a6460b1fc..c56d771d3b3 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -32,6 +32,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" #include "DNA_boid_types.h" @@ -225,10 +226,10 @@ typedef struct ParticleSettings { struct Group *dup_group; struct ListBase dupliweights; - struct Group *eff_group; // deprecated + struct Group *eff_group DNA_DEPRECATED; // deprecated struct Object *dup_ob; struct Object *bb_ob; - struct Ipo *ipo; // xxx depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct PartDeflect *pd; struct PartDeflect *pd2; } ParticleSettings; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 770f09780b5..6960e6e7d7f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -31,6 +31,8 @@ * \ingroup DNA */ +#include "DNA_defs.h" + // XXX, temp feature - campbell #define DURIAN_CAMERA_SWITCH @@ -336,11 +338,11 @@ typedef struct RenderData { /** For UR edge rendering: give the edges this color */ float edgeR, edgeG, edgeB; - short fullscreen, xplay, yplay, freqplay; /* standalone player */ // XXX deprecated since 2.5 - short depth, attrib; /* standalone player */ // XXX deprecated since 2.5 + short fullscreen DNA_DEPRECATED, xplay DNA_DEPRECATED, yplay DNA_DEPRECATED, freqplay DNA_DEPRECATED; /* standalone player */ // XXX deprecated since 2.5 + short depth DNA_DEPRECATED, attrib DNA_DEPRECATED; /* standalone player */ // XXX deprecated since 2.5 int frame_step; /* frames to jump during render/playback */ - short stereomode; /* standalone player stereo settings */ // XXX deprecated since 2.5 + short stereomode DNA_DEPRECATED; /* standalone player stereo settings */ // XXX deprecated since 2.5 short dimensionspreset; /* for the dimensions presets menu */ @@ -365,7 +367,7 @@ typedef struct RenderData { */ short yparts; - short planes, imtype, subimtype, quality; /*deprecated!*/ + short planes DNA_DEPRECATED, imtype DNA_DEPRECATED, subimtype DNA_DEPRECATED, quality DNA_DEPRECATED; /*deprecated!*/ /** * Render to image editor, fullscreen or to new window. @@ -392,8 +394,7 @@ typedef struct RenderData { */ short raytrace_structure; - /* renderer (deprecated) */ - short renderer; + short pad1; /* octree resolution */ short ocres; @@ -439,7 +440,7 @@ typedef struct RenderData { /* color management settings - color profiles, gamma correction, etc */ int color_mgt_flag; - /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */ + /** post-production settings. deprecated, but here for upwards compat (initialized to 1) */ float postgamma, posthue, postsat; /* Dither noise intensity */ @@ -478,19 +479,19 @@ typedef struct RenderData { float simplify_aosss; /* cineon */ - short cineonwhite, cineonblack; /*deprecated*/ - float cineongamma; /*deprecated*/ + short cineonwhite DNA_DEPRECATED, cineonblack DNA_DEPRECATED; /*deprecated*/ + float cineongamma DNA_DEPRECATED; /*deprecated*/ /* jpeg2000 */ - short jp2_preset, jp2_depth; /*deprecated*/ + short jp2_preset DNA_DEPRECATED, jp2_depth DNA_DEPRECATED; /*deprecated*/ int rpad3; /* Dome variables */ // XXX deprecated since 2.5 - short domeres, domemode; // XXX deprecated since 2.5 - short domeangle, dometilt; // XXX deprecated since 2.5 - float domeresbuf; // XXX deprecated since 2.5 - float pad2; // XXX deprecated since 2.5 - struct Text *dometext; // XXX deprecated since 2.5 + short domeres DNA_DEPRECATED, domemode DNA_DEPRECATED; // XXX deprecated since 2.5 + short domeangle DNA_DEPRECATED, dometilt DNA_DEPRECATED; // XXX deprecated since 2.5 + float domeresbuf DNA_DEPRECATED; // XXX deprecated since 2.5 + float pad2; + struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5 /* render engine */ char engine[32]; @@ -749,7 +750,7 @@ typedef struct VPaint { #define VP_NORMALS 8 #define VP_SPRAY 16 -// #define VP_MIRROR_X 32 // depricated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) +// #define VP_MIRROR_X 32 // deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) #define VP_ONLYVGROUP 128 @@ -961,7 +962,7 @@ typedef struct Scene { ListBase keyingsets; /* KeyingSets for the given frame */ /* Game Settings */ - struct GameFraming framing; // XXX deprecated since 2.5 + struct GameFraming framing DNA_DEPRECATED; // XXX deprecated since 2.5 struct GameData gm; /* Units */ @@ -1040,10 +1041,6 @@ typedef struct Scene { #define R_FILTER_MITCH 6 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */ -/* yafray: renderer flag (not only exclusive to yafray) */ -#define R_INTERN 0 -#define R_YAFRAY 1 - /* raytrace structure */ #define R_RAYSTRUCTURE_AUTO 0 #define R_RAYSTRUCTURE_OCTREE 1 diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 399ae0208bd..ce01f100239 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -32,6 +32,7 @@ * \author nzc */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_vec_types.h" @@ -142,7 +143,7 @@ typedef struct Sequence { Strip *strip; - struct Ipo *ipo; // xxx depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Scene *scene; struct Object *scene_camera; /* override scene camera */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 01bb6a5235e..6bcea71b5e9 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -32,6 +32,7 @@ * \author nzc */ +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_color_types.h" /* for Histogram */ #include "DNA_vec_types.h" @@ -76,17 +77,17 @@ typedef struct SpaceLink { struct SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; /* XXX depricate this */ - short blockhandler[8]; /* XXX depricate this */ + float blockscale DNA_DEPRECATED; /* XXX make deprecated */ + short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */ } SpaceLink; typedef struct SpaceInfo { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; /* XXX depricate this */ + short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */ char rpt_mask; char pad[7]; @@ -107,10 +108,10 @@ typedef struct SpaceIpo { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; - View2D v2d; /* deprecated, copied to region */ + short blockhandler[8] DNA_DEPRECATED; + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */ @@ -128,13 +129,13 @@ typedef struct SpaceButs { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; struct RenderInfo *ri; - View2D v2d; /* deprecated, copied to region */ + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ short mainb, mainbo, mainbuser; /* context tabs */ short re_align, align; /* align for panels */ @@ -153,19 +154,19 @@ typedef struct SpaceSeq { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; - View2D v2d; /* deprecated, copied to region */ + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ - float xof, yof; /* deprecated: offset for drawing the image preview */ + float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */ short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */ short render_size; short chanshown; short zebra; int flag; - float zoom; /* deprecated, handled by View2D now */ + float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */ int view; /* see SEQ_VIEW_* below */ int pad; @@ -232,11 +233,11 @@ typedef struct SpaceOops { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; - View2D v2d; /* deprecated, copied to region */ + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ ListBase tree; struct TreeStore *treestore; @@ -283,25 +284,25 @@ typedef struct SpaceNla { struct SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; short autosnap; /* this uses the same settings as autosnap for Action Editor */ short flag; int pad; struct bDopeSheet *ads; - View2D v2d; /* deprecated, copied to region */ + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ } SpaceNla; typedef struct SpaceText { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; struct Text *text; @@ -352,7 +353,7 @@ typedef struct SpaceScript { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; struct Script *script; short flags, menunr; @@ -372,31 +373,29 @@ typedef struct SpaceTime { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; - - View2D v2d; /* deprecated, copied to region */ + float blockscale DNA_DEPRECATED; + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ + ListBase caches; - int cache_display, pad; - - int flag, redraws; /* redraws is deprecated... moved to screen */ - + + int cache_display; + int flag; } SpaceTime; typedef struct SpaceNode { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; - View2D v2d; /* deprecated, copied to region */ + View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ struct ID *id, *from; /* context, no need to save in file? well... pinning... */ - short flag, menunr; /* menunr: browse id block in header */ + short flag, pad1; /* menunr: browse id block in header */ float aspect; - void *curfont; float xof, yof; /* offset for drawing the backdrop */ float zoom, padf; /* zoom for backdrop */ @@ -433,9 +432,9 @@ typedef struct SpaceLogic { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; + float blockscale DNA_DEPRECATED; - short blockhandler[8]; + short blockhandler[8] DNA_DEPRECATED; short flag, scaflag; int pad; @@ -467,9 +466,9 @@ typedef struct SpaceConsole { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; // XXX are these needed? + float blockscale DNA_DEPRECATED; // XXX are these needed? - short blockhandler[8]; // XXX are these needed? + short blockhandler[8] DNA_DEPRECATED; // XXX are these needed? /* space vars */ int lheight, pad; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 619df428f7c..cb545d2ee73 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -33,6 +33,7 @@ * \author nzc */ +#include "DNA_defs.h" #include "DNA_ID.h" #include "DNA_image_types.h" /* ImageUser */ @@ -263,7 +264,7 @@ typedef struct Tex { struct ImageUser iuser; struct bNodeTree *nodetree; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Image *ima; struct PluginTex *plugin; struct ColorBand *coba; @@ -492,7 +493,7 @@ typedef struct ColorMapping { #define MTEX_5TAP_BUMP 512 #define MTEX_BUMP_OBJECTSPACE 1024 #define MTEX_BUMP_TEXTURESPACE 2048 -#define MTEX_BUMP_FLIPPED 4096 /* temp flag for 2.59/2.60 */ +/* #define MTEX_BUMP_FLIPPED 4096 */ /* UNUSED */ /* blendtype */ #define MTEX_BLEND 0 diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h index cbac3721ac3..82ccbf87c0b 100644 --- a/source/blender/makesdna/DNA_tracking_types.h +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -100,33 +100,40 @@ typedef struct MovieTrackingTrack { float color[3]; /* custom color for track */ /* tracking algorithm to use; can be KLT or SAD */ - short tracker; - char pad4[2]; + short frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */ + short margin; /* margin from frame boundaries */ + short pattern_match; /* re-adjust every N frames */ - /* ** SAD tracker settings ** */ - float minimum_correlation; /* minimal correlation which is still treated as successful tracking */ + short tracker; /* tracking algorithm used for this track */ /* ** KLT tracker settings ** */ - int pyramid_levels; /* number of pyramid levels to use for KLT tracking */ - char pad5[4]; + short pyramid_levels, pad2; /* number of pyramid levels to use for KLT tracking */ + + /* ** SAD tracker settings ** */ + float minimum_correlation; /* minimal correlation which is still treated as successful tracking */ } MovieTrackingTrack; typedef struct MovieTrackingSettings { + int flag; + + /* ** default tracker settings */ + short default_tracker; /* tracking algorithm used by default */ + short default_pyramid_levels; /* number of pyramid levels to use for KLT tracking */ + float default_minimum_correlation; /* minimal correlation which is still treated as successful tracking */ + short default_pattern_size; /* size of pattern area for new tracks */ + short default_search_size; /* size of search area for new tracks */ + short default_frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */ + short default_margin; /* margin from frame boundaries */ + short default_pattern_match; /* re-adjust every N frames */ + /* ** common tracker settings ** */ short speed; /* speed of tracking */ - short frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */ - short margin; /* margin from frame boundaries */ - char pad[2]; - - int adjframes; /* re-adjust every N frames */ /* ** reconstruction settings ** */ int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */ /* ** which camera intrinsics to refine. uses on the REFINE_* flags */ - short refine_camera_intrinsics; - - char pad2[6]; + short refine_camera_intrinsics, pad2; /* ** tool settings ** */ @@ -135,7 +142,7 @@ typedef struct MovieTrackingSettings { /* cleanup */ int clean_frames, clean_action; - float clean_error; + float clean_error, pad; } MovieTrackingSettings; typedef struct MovieTrackingStabilization { @@ -165,15 +172,19 @@ typedef struct MovieTrackingReconstruction { struct MovieReconstructedCamera *cameras; /* reconstructed cameras */ } MovieTrackingReconstruction; +typedef struct MovieTrackingStats { + char message[256]; +} MovieTrackingStats; + typedef struct MovieTracking { MovieTrackingSettings settings; /* different tracking-related settings */ - char pad2[4]; - MovieTrackingCamera camera; /* camera intrinsics */ ListBase tracks; /* all tracks */ MovieTrackingReconstruction reconstruction; /* reconstruction data */ MovieTrackingStabilization stabilization; /* stabilization data */ MovieTrackingTrack *act_track; /* active track */ + + MovieTrackingStats *stats; /* statistics displaying in clip editor */ } MovieTracking; /* MovieTrackingCamera->units */ @@ -197,9 +208,17 @@ enum { #define TRACK_CUSTOMCOLOR (1<<7) #define TRACK_USE_2D_STAB (1<<8) -/* MovieTrackingSettings->tracker */ +/* MovieTrackingTrack->tracker */ #define TRACKER_KLT 0 #define TRACKER_SAD 1 +#define TRACKER_HYBRID 2 + +/* MovieTrackingTrack->adjframes */ +#define TRACK_MATCH_KEYFRAME 0 +#define TRACK_MATCH_PREVFRAME 1 + +/* MovieTrackingSettings->flag */ +#define TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED (1<<0) /* MovieTrackingSettings->speed */ #define TRACKING_SPEED_FASTEST 0 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index dfc7761bc26..a382f76bfe8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -357,7 +357,7 @@ typedef struct UserDef { struct ListBase themes; struct ListBase uifonts; struct ListBase uistyles; - struct ListBase keymaps; /* deprecated in favor of user_keymaps */ + struct ListBase keymaps DNA_DEPRECATED; /* deprecated in favor of user_keymaps */ struct ListBase user_keymaps; struct ListBase addons; char keyconfigstr[64]; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 93f4b209712..51ee8f63df5 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -55,6 +55,7 @@ struct wmTimer; #define far clipend #endif +#include "DNA_defs.h" #include "DNA_listBase.h" #include "DNA_image_types.h" #include "DNA_movieclip_types.h" @@ -150,8 +151,9 @@ typedef struct View3D { int spacetype; float blockscale; short blockhandler[8]; - - float viewquat[4], dist; /* XXX depricated */ + + float viewquat[4] DNA_DEPRECATED; + float dist DNA_DEPRECATED; float bundle_size; /* size of bundles in reconstructed data */ short bundle_drawtype; /* display style for bundle */ @@ -160,13 +162,13 @@ typedef struct View3D { unsigned int lay_used; /* used while drawing */ - short persp; /* XXX depricated */ - short view; /* XXX depricated */ + short persp DNA_DEPRECATED; + short view DNA_DEPRECATED; struct Object *camera, *ob_centre; struct ListBase bgpicbase; - struct BGpic *bgpic; /* deprecated, use bgpicbase, only kept for do_versions(...) */ + struct BGpic *bgpic DNA_DEPRECATED; /* deprecated, use bgpicbase, only kept for do_versions(...) */ struct View3D *localvd; /* allocated backup of its self while in localview */ @@ -185,7 +187,7 @@ typedef struct View3D { float lens, grid; float near, far; - float ofs[3]; /* XXX deprecated */ + float ofs[3] DNA_DEPRECATED; /* XXX deprecated */ float cursor[3]; short modeselect; @@ -208,8 +210,8 @@ typedef struct View3D { void *properties_storage; /* Nkey panel stores stuff here (runtime only!) */ - /* XXX depricated? */ - struct bGPdata *gpd; /* Grease-Pencil Data (annotation layers) */ + /* XXX deprecated? */ + struct bGPdata *gpd DNA_DEPRECATED; /* Grease-Pencil Data (annotation layers) */ } View3D; @@ -308,6 +310,7 @@ typedef struct View3D { /* may want to use 1 for select ?*/ #define V3D_BGPIC_EXPANDED 2 #define V3D_BGPIC_CAMERACLIP 4 +#define V3D_BGPIC_DISABLED 8 /* BGPic->source */ /* may want to use 1 for select ?*/ diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index 0c455022db4..1e8a4574120 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -31,6 +31,7 @@ * \ingroup DNA */ +#include "DNA_defs.h" #include "DNA_ID.h" struct AnimData; @@ -96,7 +97,7 @@ typedef struct World { float misi, miststa, mistdist, misthi; - float starr, starg, starb, stark; /* Deprecated */ + float starr DNA_DEPRECATED, starg DNA_DEPRECATED, starb DNA_DEPRECATED, stark DNA_DEPRECATED; /* Deprecated */ float starsize, starmindist; float stardist, starcolnoise; @@ -119,7 +120,7 @@ typedef struct World { float *aosphere, *aotables; - struct Ipo *ipo; // XXX depreceated... old animation system + struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct MTex *mtex[18]; /* MAX_MTEX */ short pr_texture, use_nodes, pad[2]; diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 2186a067c10..0dba78ff97e 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -804,7 +804,6 @@ static int elem_strcmp(const char *name, const char *oname) if(name[a]==0) break; a++; } - if(name[a] != oname[a]) return 1; return 0; } diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 6d96f423afb..e869ccc3d77 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -311,8 +311,9 @@ static int add_name(const char *str) if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]); j++; } - if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]); - if (debugSDNA > 3) printf("special after offset %d\n", j); + if (debugSDNA > 3) printf("seen %c ( %d) \n" + "special after offset%d\n", + str[j], str[j], j); if (!isfuncptr) { /* multidimensional array pointer case */ @@ -476,6 +477,13 @@ static int preprocess_include(char *maindata, int len) if(comment); else if( cp[0]==' ' && cp[1]==' ' ); else if( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */ + + /* skip special keywords */ + else if (strncmp("DNA_DEPRECATED", cp, 14)==0) { + /* single values are skipped already, so decrement 1 less */ + a -= 13; + cp += 13; + } else { md[0]= cp[0]; md++; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index b9b90ae3c88..66531fdc02c 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -87,7 +87,7 @@ extern StructRNA RNA_BoidState; extern StructRNA RNA_Bone; extern StructRNA RNA_BoneGroup; extern StructRNA RNA_BooleanModifier; -extern StructRNA RNA_BooleanProperty; +extern StructRNA RNA_BoolProperty; extern StructRNA RNA_Brush; extern StructRNA RNA_BrushTextureSlot; extern StructRNA RNA_BuildModifier; @@ -1029,7 +1029,7 @@ StructRNA *ID_code_to_RNA_type(short idcode); #ifdef __GNUC__ # define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args) #else -# define RNA_warning(format, args, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__) +# define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__) #endif void _RNA_warning(const char *format, ...) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index e837725a75b..bb9fa28dd3f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1196,7 +1196,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; if(!prop->arraydimension) { if(!bprop->get && !bprop->set && !dp->booleanbit) @@ -1812,7 +1812,7 @@ static void rna_sort(BlenderRNA *brna) static const char *rna_property_structname(PropertyType type) { switch(type) { - case PROP_BOOLEAN: return "BooleanPropertyRNA"; + case PROP_BOOLEAN: return "BoolPropertyRNA"; case PROP_INT: return "IntPropertyRNA"; case PROP_FLOAT: return "FloatPropertyRNA"; case PROP_STRING: return "StringPropertyRNA"; @@ -2154,7 +2154,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr break; } case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; unsigned int i; if(prop->arraydimension && prop->totarraylength) { @@ -2243,7 +2243,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), rna_function_string(bprop->set), rna_function_string(bprop->getarray), rna_function_string(bprop->setarray), bprop->defaultvalue); if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d3666e28338..fa2fb061e3e 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1580,7 +1580,7 @@ void RNA_property_update_cache_free(void) int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1596,7 +1596,7 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1623,7 +1623,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1671,7 +1671,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1729,7 +1729,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) == 0); @@ -1739,7 +1739,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values) { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != 0); @@ -4682,8 +4682,8 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE if(!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) { switch(parm->type) { case PROP_BOOLEAN: - if(parm->arraydimension) memcpy(data, ((BooleanPropertyRNA*)parm)->defaultarray, size); - else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size); + if(parm->arraydimension) memcpy(data, ((BoolPropertyRNA*)parm)->defaultarray, size); + else memcpy(data, &((BoolPropertyRNA*)parm)->defaultvalue, size); break; case PROP_INT: if(parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 60658e98c8d..4fb672fd203 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -336,7 +336,7 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_range(prop, 0, M_PI*2); - RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation"); + RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index e911c936df8..e55559c39dc 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -580,7 +580,7 @@ void RNA_free(BlenderRNA *brna) static size_t rna_property_type_sizeof(PropertyType type) { switch(type) { - case PROP_BOOLEAN: return sizeof(BooleanPropertyRNA); + case PROP_BOOLEAN: return sizeof(BoolPropertyRNA); case PROP_INT: return sizeof(IntPropertyRNA); case PROP_FLOAT: return sizeof(FloatPropertyRNA); case PROP_STRING: return sizeof(StringPropertyRNA); @@ -1308,7 +1308,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value) switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; bprop->defaultvalue= value; break; } @@ -1325,7 +1325,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array) switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; bprop->defaultarray= array; break; } @@ -1889,7 +1889,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; if(prop->arraydimension) { if(get) bprop->getarray= (PropBooleanArrayGetFunc)get; @@ -2806,7 +2806,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; if(bprop->defaultarray) { iarray= MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store"); @@ -2875,7 +2875,7 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) switch(prop->type) { case PROP_BOOLEAN: { - BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop; if(bprop->defaultarray) MEM_freeN((void*)bprop->defaultarray); break; } diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index ec6504fbbcb..960d3155fd5 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -185,7 +185,7 @@ struct PropertyRNA { /* Property Types */ -typedef struct BooleanPropertyRNA { +typedef struct BoolPropertyRNA { PropertyRNA property; PropBooleanGetFunc get; @@ -196,7 +196,7 @@ typedef struct BooleanPropertyRNA { int defaultvalue; const int *defaultarray; -} BooleanPropertyRNA; +} BoolPropertyRNA; typedef struct IntPropertyRNA { PropertyRNA property; diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index c783fc2238c..7de2d550875 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -172,9 +172,9 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_texture_coordinates_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates"}, - {TEXCO_VIEW, "VIEW", 0, "View", "Uses view coordinates for the texture coordinates"}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, + {TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LampTextureSlot", "TextureSlot"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 6400946d582..35c720b5069 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -480,12 +480,12 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF); - RNA_def_property_ui_text(prop, "Diffuse", "The texture to affects the value of the materials diffuse reflectivity"); + RNA_def_property_ui_text(prop, "Diffuse", "The texture affects the value of diffuse reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC); - RNA_def_property_ui_text(prop, "Specular", "The texture to affects the value of specular reflectivity"); + RNA_def_property_ui_text(prop, "Specular", "The texture affects the value of specular reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 6a2f06b6096..b426afe972d 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -743,7 +743,7 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type PropertyRNA *prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, type); RNA_def_property_enum_items(prop, prop_subdivision_type_items); - RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of subdivision algorithm"); + RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -784,7 +784,7 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) static void rna_def_modifier_generic_map_info(StructRNA *srna) { static EnumPropertyItem prop_texture_coordinates_items[] = { - {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Use the local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use the local coordinate system for the texture coordinates"}, {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use the global coordinate system for the texture coordinates"}, {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use the linked object's local coordinate system for the texture coordinates"}, {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"}, @@ -1010,13 +1010,13 @@ static void rna_def_modifier_build(BlenderRNA *brna) prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "start"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect"); + RNA_def_property_ui_text(prop, "Start", "Start frame of the effect"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "length"); RNA_def_property_range(prop, 1, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires"); + RNA_def_property_ui_text(prop, "Length", "Total time the build effect requires"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE); @@ -1026,7 +1026,7 @@ static void rna_def_modifier_build(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Seed", "Specify the seed for random if used"); + RNA_def_property_ui_text(prop, "Seed", "Seed for random if used"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -1057,7 +1057,7 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING); - RNA_def_property_ui_text(prop, "Clip", "Prevents vertices from going through the mirror during transform"); + RNA_def_property_ui_text(prop, "Clip", "Prevent vertices from going through the mirror during transform"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE); @@ -1108,7 +1108,7 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "percent"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 1, 2); - RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to"); + RNA_def_property_ui_text(prop, "Ratio", "Ratio of triangles to reduce to"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE); @@ -1184,7 +1184,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the waves damps out after it dies"); + RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the wave damps out after it dies"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE); @@ -1205,7 +1205,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "starty"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); - RNA_def_property_ui_text(prop, "Start Position Y", "Z coordinate of the start position"); + RNA_def_property_ui_text(prop, "Start Position Y", "Y coordinate of the start position"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); @@ -1598,7 +1598,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier"); - RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to sets UVs from a projector"); + RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector"); RNA_def_struct_sdna(srna, "UVProjectModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT); @@ -1726,7 +1726,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "CastModifier", "Modifier"); - RNA_def_struct_ui_text(srna, "Cast Modifier", "Cast modifier to cast to other shapes"); + RNA_def_struct_ui_text(srna, "Cast Modifier", "Modifier to cast to other shapes"); RNA_def_struct_sdna(srna, "CastModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_CAST); @@ -1783,7 +1783,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 5, 2); - RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto.)"); + RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -1839,7 +1839,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) prop= RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND); - RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming.)"); + RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); #if 0 @@ -2175,15 +2175,15 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem shrink_type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrinks the mesh to the nearest target surface"}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the mesh to the nearest target surface along a given axis"}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the mesh to the nearest target vertex"}, + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrink the mesh to the nearest target surface"}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrink the mesh to the nearest target surface along a given axis"}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the mesh to the nearest target vertex"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem shrink_face_cull_items[] = { - {0, "OFF", 0, "Off", ""}, - {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", ""}, - {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", ""}, + {0, "OFF", 0, "Off", "No culling"}, + {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", "No projection when in front of the face"}, + {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", "No projection when behind the face"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier"); @@ -2201,7 +2201,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "shrinkOpts"); RNA_def_property_enum_items(prop, shrink_face_cull_items); RNA_def_property_enum_funcs(prop, "rna_ShrinkwrapModifier_face_cull_get", "rna_ShrinkwrapModifier_face_cull_set", NULL); - RNA_def_property_ui_text(prop, "Face Cull", "Stop vertices from projecting to a the face on the target when facing towards/away"); + RNA_def_property_ui_text(prop, "Face Cull", "Stop vertices from projecting to a face on the target when facing towards/away"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -2329,10 +2329,10 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem simple_deform_mode_items[] = { - {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotates around the Z axis of the modifier space"}, - {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bends the mesh over the Z axis of the modifier space"}, - {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scales along Z axis of the modifier space"}, - {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretches the object along the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotate around the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bend the mesh over the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scale along Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretch the object along the Z axis of the modifier space"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier"); @@ -2359,7 +2359,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL); - RNA_def_property_ui_text(prop, "Relative", "Sets the origin of deform space to be relative to the object"); + RNA_def_property_ui_text(prop, "Relative", "Set the origin of deform space to be relative to the object"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); @@ -2675,7 +2675,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG); RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold " - "from vgroup"); + "from vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE); @@ -2713,7 +2713,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) static void rna_def_modifier_weightvgmix(BlenderRNA *brna) { static EnumPropertyItem weightvg_mix_modes_items[] = { - {MOD_WVG_MIX_SET, "SET", 0, "Replace", "Replace VGroup A's weights by VGroup b's ones"}, + {MOD_WVG_MIX_SET, "SET", 0, "Replace", "Replace VGroup A's weights by VGroup B's ones"}, {MOD_WVG_MIX_ADD, "ADD", 0, "Add", "Add VGroup B's weights to VGroup A's ones"}, {MOD_WVG_MIX_SUB, "SUB", 0, "Subtract", "Subtract VGroup B's weights from VGroup A's ones"}, {MOD_WVG_MIX_MUL, "MUL", 0, "Multiply", "Multiply VGroup A's weights by VGroup B's ones"}, @@ -2755,20 +2755,20 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if " - "it is not in the first vgroup"); + "it is not in the first A vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if " - "it is not in the second vgroup"); + "it is not in the second B vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mix_modes_items); - RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup 2 affect weights " - "of vgroup 1"); + RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup B affect weights " + "of vgroup A"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE); @@ -2826,6 +2826,7 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_proximity_modes_items); + RNA_def_property_enum_default(prop, MOD_WVG_PROXIMITY_GEOMETRY); RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -2833,6 +2834,7 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "proximity_flags"); RNA_def_property_enum_items(prop, proximity_geometry_items); RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */ + RNA_def_property_enum_default(prop, MOD_WVG_PROXIMITY_GEOM_FACES); RNA_def_property_ui_text(prop, "Proximity Geometry", "Use the shortest computed distance to target object's geometry " "as weight"); @@ -2847,13 +2849,13 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0); - RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0 (or weight 1.0 if above Highest Dist)"); + RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0); - RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0 (or weight 0.0 if below Lowest Dist)"); + RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); @@ -2871,8 +2873,8 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem geometry_items[]= { - {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generates ocean surface geometry at the specified resolution"}, - {MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displaces existing geometry according to simulation"}, + {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generate ocean surface geometry at the specified resolution"}, + {MOD_OCEAN_GEOM_DISPLACE, "DISPLACE", 0, "Displace", "Displace existing geometry according to simulation"}, //{MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"}, {0, NULL, 0, NULL, NULL}}; @@ -2918,13 +2920,13 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) prop= RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_NORMALS); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Generate Normals", "Outputs normals for bump mapping - disabling can speed up performance if its not needed"); + RNA_def_property_ui_text(prop, "Generate Normals", "Output normals for bump mapping - disabling can speed up performance if its not needed"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); prop= RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_FOAM); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Generate Foam", "Generates foam mask as a vertex color channel"); + RNA_def_property_ui_text(prop, "Generate Foam", "Generate foam mask as a vertex color channel"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); @@ -3034,7 +3036,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) prop= RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cached", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Ocean is Cached", "Whether the ocean is useing cached data or simulating"); + RNA_def_property_ui_text(prop, "Ocean is Cached", "Whether the ocean is using cached data or simulating"); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "cachepath"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 349f5cddcfb..8e567d0ac70 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -126,9 +126,9 @@ EnumPropertyItem prop_noise_type_items[] = { #if 0 EnumPropertyItem prop_wave_items[] = { - {SHD_WAVE_SINE, "SINE", 0, "Sine", "Uses a sine wave to produce bands"}, - {SHD_WAVE_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, - {SHD_WAVE_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {SHD_WAVE_SINE, "SINE", 0, "Sine", "Use a sine wave to produce bands"}, + {SHD_WAVE_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"}, + {SHD_WAVE_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"}, {0, NULL, 0, NULL, NULL}}; #endif @@ -1292,13 +1292,13 @@ static void def_sh_tex_image(StructRNA *srna) static void def_sh_tex_gradient(StructRNA *srna) { static EnumPropertyItem prop_gradient_type[] = { - {SHD_BLEND_LINEAR, "LINEAR", 0, "Linear", "Creates a linear progression"}, - {SHD_BLEND_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"}, - {SHD_BLEND_EASING, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"}, - {SHD_BLEND_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"}, - {SHD_BLEND_SPHERICAL, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"}, - {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, - {SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Creates a radial progression"}, + {SHD_BLEND_LINEAR, "LINEAR", 0, "Linear", "Create a linear progression"}, + {SHD_BLEND_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Create a quadratic progression"}, + {SHD_BLEND_EASING, "EASING", 0, "Easing", "Create a progression easing from one step to the next"}, + {SHD_BLEND_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"}, + {SHD_BLEND_SPHERICAL, "SPHERICAL", 0, "Spherical", "Create a spherical progression"}, + {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"}, + {SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Create a radial progression"}, {0, NULL, 0, NULL, NULL}}; PropertyRNA *prop; @@ -1308,7 +1308,7 @@ static void def_sh_tex_gradient(StructRNA *srna) prop= RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_gradient_type); - RNA_def_property_ui_text(prop, "Gradient Type", "Sets the style of the color blending"); + RNA_def_property_ui_text(prop, "Gradient Type", "Style of the color blending"); RNA_def_property_update(prop, 0, "rna_Node_update"); } @@ -1376,8 +1376,8 @@ static void def_sh_tex_voronoi(StructRNA *srna) static void def_sh_tex_wave(StructRNA *srna) { static EnumPropertyItem prop_wave_type_items[] = { - {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Uses standard wave texture in bands"}, - {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Uses wave texture in rings"}, + {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Use standard wave texture in bands"}, + {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Use wave texture in rings"}, {0, NULL, 0, NULL, NULL}}; PropertyRNA *prop; @@ -1521,12 +1521,12 @@ static void def_cmp_blur(StructRNA *srna) prop = RNA_def_property(srna, "use_bokeh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1); - RNA_def_property_ui_text(prop, "Bokeh", "Uses circular filter (slower)"); + RNA_def_property_ui_text(prop, "Bokeh", "Use circular filter (slower)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_gamma_correction", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1); - RNA_def_property_ui_text(prop, "Gamma", "Applies filter on gamma corrected values"); + RNA_def_property_ui_text(prop, "Gamma", "Apply filter on gamma corrected values"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } @@ -1602,7 +1602,7 @@ static void def_cmp_vector_blur(StructRNA *srna) prop = RNA_def_property(srna, "speed_min", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minspeed"); RNA_def_property_range(prop, 0, 1024); - RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred; used to separate background from foreground"); + RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred (used to separate background from foreground)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "speed_max", PROP_INT, PROP_NONE); @@ -1614,7 +1614,7 @@ static void def_cmp_vector_blur(StructRNA *srna) prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors; actually 'shutter speed' in frames"); + RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors (actually, 'shutter speed', in frames)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_curved", PROP_BOOLEAN, PROP_NONE); @@ -2037,7 +2037,7 @@ static void def_cmp_channel_matte(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "channel"); RNA_def_property_enum_items(prop, prop_tri_channel_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); - RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channels value"); + RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channel's value"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); @@ -2141,7 +2141,7 @@ static void def_cmp_defocus(StructRNA *srna) prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "rotation"); RNA_def_property_range(prop, 0.0f, DEG2RADF(90.0f)); - RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees"); + RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_gamma_correction", PROP_BOOLEAN, PROP_NONE); @@ -2187,7 +2187,7 @@ static void def_cmp_defocus(StructRNA *srna) prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_range(prop, 0.0f, 1000.0f); - RNA_def_property_ui_text(prop, "Z-Scale", "Scales the Z input when not using a z-buffer, controls maximum blur designated by the color white or input value 1"); + RNA_def_property_ui_text(prop, "Z-Scale", "Scale the Z input when not using a z-buffer, controls maximum blur designated by the color white or input value 1"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } @@ -2522,12 +2522,12 @@ static void def_cmp_lensdist(StructRNA *srna) prop = RNA_def_property(srna, "use_projector", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "proj", 1); - RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode. Effect is applied in horizontal direction only"); + RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode (the effect is applied in horizontal direction only)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "jit", 1); - RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering; faster, but also noisier"); + RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering (faster, but also noisier)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_fit", PROP_BOOLEAN, PROP_NONE); @@ -2622,7 +2622,7 @@ static void def_cmp_zcombine(StructRNA *srna) prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 0); - RNA_def_property_ui_text(prop, "Use Alpha", "Takes Alpha channel into account when doing the Z operation"); + RNA_def_property_ui_text(prop, "Use Alpha", "Take Alpha channel into account when doing the Z operation"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 78be14ebf7e..d8fabad824e 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -74,7 +74,7 @@ DefNode( ShaderNode, SH_NODE_VOLUME_TRANSPARENT, 0, "VO DefNode( ShaderNode, SH_NODE_VOLUME_ISOTROPIC, 0, "VOLUME_ISOTROPIC", VolumeIsotropic, "Isotropic Volume", "" ) DefNode( ShaderNode, SH_NODE_EMISSION, 0, "EMISSION", Emission, "Emission", "" ) DefNode( ShaderNode, SH_NODE_NEW_GEOMETRY, 0, "NEW_GEOMETRY", NewGeometry, "Geometry", "" ) -DefNode( ShaderNode, SH_NODE_LIGHT_PATH, 0, "LIGHT_PATH", Light_path, "Light_path", "" ) +DefNode( ShaderNode, SH_NODE_LIGHT_PATH, 0, "LIGHT_PATH", Light_path, "Light Path", "" ) DefNode( ShaderNode, SH_NODE_TEX_IMAGE, def_sh_tex_image, "TEX_IMAGE", TexImage, "Image Texture", "" ) DefNode( ShaderNode, SH_NODE_TEX_ENVIRONMENT, def_sh_tex_environment, "TEX_ENVIRONMENT", TexEnvironment, "Environment Texture","" ) DefNode( ShaderNode, SH_NODE_TEX_SKY, def_sh_tex_sky, "TEX_SKY", TexSky, "Sky Texture", "" ) @@ -90,7 +90,7 @@ DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWE DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" ) DefNode( CompositorNode, CMP_NODE_VALUE, 0, "VALUE", Value, "Value", "" ) DefNode( CompositorNode, CMP_NODE_MIX_RGB, def_mix_rgb, "MIX_RGB", MixRGB, "Mix RGB", "" ) -DefNode( CompositorNode, CMP_NODE_VALTORGB, def_colorramp, "VALTORGB", ValToRGB, "Val to RGB", "" ) +DefNode( CompositorNode, CMP_NODE_VALTORGB, def_colorramp, "VALTORGB", ValToRGB, "Value to RGB", "" ) DefNode( CompositorNode, CMP_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB to BW", "" ) DefNode( CompositorNode, CMP_NODE_NORMAL, 0, "NORMAL", Normal, "Normal", "" ) DefNode( CompositorNode, CMP_NODE_CURVE_VEC, def_vector_curve, "CURVE_VEC", CurveVec, "Vector Curve", "" ) @@ -138,7 +138,7 @@ DefNode( CompositorNode, CMP_NODE_GAMMA, 0, "GAMMA DefNode( CompositorNode, CMP_NODE_INVERT, def_cmp_invert, "INVERT", Invert, "Invert", "" ) DefNode( CompositorNode, CMP_NODE_NORMALIZE, 0, "NORMALIZE", Normalize, "Normalize", "" ) DefNode( CompositorNode, CMP_NODE_CROP, def_cmp_crop, "CROP", Crop, "Crop", "" ) -DefNode( CompositorNode, CMP_NODE_DBLUR, def_cmp_dblur, "DBLUR", DBlur, "DBlur", "" ) +DefNode( CompositorNode, CMP_NODE_DBLUR, def_cmp_dblur, "DBLUR", DBlur, "Directional Blur", "" ) DefNode( CompositorNode, CMP_NODE_BILATERALBLUR, def_cmp_bilateral_blur, "BILATERALBLUR", Bilateralblur, "Bilateral Blur", "" ) DefNode( CompositorNode, CMP_NODE_PREMULKEY, def_cmp_premul_key, "PREMULKEY", PremulKey, "Premul Key", "" ) DefNode( CompositorNode, CMP_NODE_GLARE, def_cmp_glare, "GLARE", Glare, "Glare", "" ) @@ -160,8 +160,8 @@ DefNode( TextureNode, TEX_NODE_TEXTURE, def_texture, "TEXTU DefNode( TextureNode, TEX_NODE_BRICKS, def_tex_bricks, "BRICKS", Bricks, "Bricks", "" ) DefNode( TextureNode, TEX_NODE_MATH, def_math, "MATH", Math, "Math", "" ) DefNode( TextureNode, TEX_NODE_MIX_RGB, def_mix_rgb, "MIX_RGB", MixRGB, "Mix RGB", "" ) -DefNode( TextureNode, TEX_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB To BW", "" ) -DefNode( TextureNode, TEX_NODE_VALTORGB, def_colorramp, "VALTORGB", ValToRGB, "Val To RGB", "" ) +DefNode( TextureNode, TEX_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB to BW", "" ) +DefNode( TextureNode, TEX_NODE_VALTORGB, def_colorramp, "VALTORGB", ValToRGB, "Value to RGB", "" ) DefNode( TextureNode, TEX_NODE_IMAGE, def_tex_image, "IMAGE", Image, "Image", "" ) DefNode( TextureNode, TEX_NODE_CURVE_RGB, def_rgb_curve, "CURVE_RGB", CurveRGB, "RGB Curve", "" ) DefNode( TextureNode, TEX_NODE_INVERT, 0, "INVERT", Invert, "Invert", "" ) @@ -174,7 +174,7 @@ DefNode( TextureNode, TEX_NODE_COORD, 0, "COORD DefNode( TextureNode, TEX_NODE_DISTANCE, 0, "DISTANCE", Distance, "Distance", "" ) DefNode( TextureNode, TEX_NODE_COMPOSE, 0, "COMPOSE", Compose, "Compose", "" ) DefNode( TextureNode, TEX_NODE_DECOMPOSE, 0, "DECOMPOSE", Decompose, "Decompose", "" ) -DefNode( TextureNode, TEX_NODE_VALTONOR, 0, "VALTONOR", ValToNor, "Val to Nor", "" ) +DefNode( TextureNode, TEX_NODE_VALTONOR, 0, "VALTONOR", ValToNor, "Value to Normal", "" ) DefNode( TextureNode, TEX_NODE_SCALE, 0, "SCALE", Scale, "Scale", "" ) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 11c248adac7..f7df7c3928e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2071,7 +2071,7 @@ static void rna_def_object(BlenderRNA *brna) #endif prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ); - RNA_def_property_float_sdna(prop, NULL, "dsize"); + RNA_def_property_float_sdna(prop, NULL, "dscale"); RNA_def_property_ui_text(prop, "Delta Scale", "Extra scaling added to the scale of the object"); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index fb6e837365d..2c71fffb5b5 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1233,18 +1233,18 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem texco_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates"}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"}, - {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates"}, - {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object"}, - {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, + {TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"}, + {TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, + {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mapping_items[] = { - {MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly"}, - {MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector"}, - {MTEX_TUBE, "TUBE", 0, "Tube", "Maps with Z as central axis"}, - {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Maps with Z as central axis"}, + {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"}, + {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"}, + {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"}, + {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_x_mapping_items[] = { diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 424a08f15cb..9a141dde3db 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -413,7 +413,7 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr) rna_idproperty_check(&prop, ptr); /* XXX ptr? */ switch(prop->type) { - case PROP_BOOLEAN: return &RNA_BooleanProperty; + case PROP_BOOLEAN: return &RNA_BoolProperty; case PROP_INT: return &RNA_IntProperty; case PROP_FLOAT: return &RNA_FloatProperty; case PROP_STRING: return &RNA_StringProperty; @@ -578,7 +578,7 @@ static int rna_BoolProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; rna_idproperty_check(&prop, ptr); - return ((BooleanPropertyRNA*)prop)->defaultvalue; + return ((BoolPropertyRNA*)prop)->defaultvalue; } static int rna_IntProperty_default_get(PointerRNA *ptr) @@ -615,7 +615,7 @@ static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values) { PropertyRNA *prop= (PropertyRNA*)ptr->data; - BooleanPropertyRNA *nprop= (BooleanPropertyRNA*)prop; + BoolPropertyRNA *nprop= (BoolPropertyRNA*)prop; rna_idproperty_check(&prop, ptr); if(nprop->defaultarray) { @@ -746,7 +746,7 @@ static int rna_StringProperty_max_length_get(PointerRNA *ptr) return ((StringPropertyRNA*)prop)->maxlength; } -static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) +static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop_parent, int *free) { PropertyRNA *prop= (PropertyRNA*)ptr->data; EnumPropertyRNA *eprop; @@ -754,6 +754,11 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA rna_idproperty_check(&prop, ptr); eprop= (EnumPropertyRNA*)prop; + /* incompatible default attributes */ + if ((prop_parent->flag & PROP_ENUM_FLAG) != (prop->flag & PROP_ENUM_FLAG)) { + return NULL; + } + if( (eprop->itemf == NULL) || (eprop->itemf == rna_EnumProperty_default_itemf) || (ptr->type == &RNA_EnumProperty) || @@ -1350,8 +1355,8 @@ void RNA_def_rna(BlenderRNA *brna) /* Property */ rna_def_property(brna); - /* BooleanProperty */ - srna= RNA_def_struct(brna, "BooleanProperty", "Property"); + /* BoolProperty */ + srna= RNA_def_struct(brna, "BoolProperty", "Property"); RNA_def_struct_ui_text(srna, "Boolean Definition", "RNA boolean property definition"); rna_def_number_property(srna, PROP_BOOLEAN); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 9d0149726c3..14e518da4b5 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -69,7 +69,6 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) static void rna_Scene_update_tagged(Scene *scene) { scene_update_tagged(G.main, scene); - scene_clear_tagged(G.main, scene); } static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name) diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index d0a50ba6bad..a15ca5de5c1 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -304,7 +304,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); - RNA_def_property_ui_text(prop, "Normals", "Applies the vertex normal before painting"); + RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting"); prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); @@ -348,7 +348,7 @@ static void rna_def_image_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_ui_text(prop, "Clone Map", - "Use another UV map as clone source, otherwise use 3D the cursor as the source"); + "Use another UV map as clone source, otherwise use the 3D cursor as the source"); /* integers */ diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index ba58a66a2d6..6459c145a3a 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -387,7 +387,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, mouse_event_items); - RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on"); + RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -442,7 +442,7 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "targetName"); - RNA_def_property_ui_text(prop, "Target", "Property that receive the keystrokes in case a string is logged"); + RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE); @@ -490,12 +490,12 @@ static void rna_def_property_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Minimum Value", "Specify minimum value in Interval type"); + RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "maxvalue"); - RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type"); + RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -533,7 +533,7 @@ static void rna_def_armature_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "value"); - RNA_def_property_ui_text(prop, "Compare Value", "Specify value to be used in comparison"); + RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -574,7 +574,7 @@ static void rna_def_delay_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT); - RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics"); + RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option (if selected, the sensor restarts after Delay+Duration logic tics)"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -589,7 +589,7 @@ static void rna_def_collision_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE); - RNA_def_property_ui_text(prop, "Pulse", "Changes to the set of colliding objects generates pulse"); + RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); @@ -599,13 +599,13 @@ static void rna_def_collision_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "materialName"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /*//XXX either use a datablock look up to store the string name (material) @@ -614,7 +614,7 @@ static void rna_def_collision_sensor(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); */ } @@ -637,12 +637,12 @@ static void rna_def_radar_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the radar cone is cast"); + RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast"); RNA_def_property_update(prop, NC_LOGIC, NULL); //XXX TODO - use radians internally then change to PROP_ANGLE @@ -669,7 +669,7 @@ static void rna_def_random_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 1000); - RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random)"); + RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -703,12 +703,12 @@ static void rna_def_ray_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "propname"); - RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property (blank = all objects)"); + RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "matname"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* //XXX either use a datablock look up to store the string name (material) @@ -717,7 +717,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_sdna(prop, NULL, "ma"); - RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material (blank = all objects)"); + RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); */ prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); @@ -733,7 +733,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axisflag"); RNA_def_property_enum_items(prop, axis_items); - RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast"); + RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -747,7 +747,7 @@ static void rna_def_message_sensor(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bMessageSensor", "data"); prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all"); + RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -788,7 +788,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "joyindex"); - RNA_def_property_ui_text(prop, "Index", "Specify which joystick to use"); + RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -800,26 +800,26 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop= RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT); - RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joysticks current type (axis/button/hat)"); + RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joystick's current type (axis/button/hat)"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Button */ prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "button"); - RNA_def_property_ui_text(prop, "Button Number", "Specify which button to use"); + RNA_def_property_ui_text(prop, "Button Number", "Which button to use"); RNA_def_property_range(prop, 0, 18); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Axis */ prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "axis"); - RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is usually the main direction input"); + RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input"); RNA_def_property_range(prop, 1, 8); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "precision"); - RNA_def_property_ui_text(prop, "Axis Threshold", "Specify the precision of the axis"); + RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis"); RNA_def_property_range(prop, 0, 32768); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -832,21 +832,21 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) /* Single Axis */ prop= RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "axis_single"); - RNA_def_property_ui_text(prop, "Axis Number", "Specify a single axis (verticle/horizontal/other) to detect"); + RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect"); RNA_def_property_range(prop, 1, 16); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Hat */ prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "hat"); - RNA_def_property_ui_text(prop, "Hat Number", "Specify which hat to use"); + RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use"); RNA_def_property_range(prop, 1, 2); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hatf"); RNA_def_property_enum_items(prop, hat_direction_items); - RNA_def_property_ui_text(prop, "Hat Direction", "Specify hat direction"); + RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction"); RNA_def_property_update(prop, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4db23443895..64adac7dd5e 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1618,7 +1618,7 @@ static void rna_def_glow(BlenderRNA *brna) prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fClamp"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity"); + RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); @@ -1722,7 +1722,7 @@ static void rna_def_solid_color(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence"); - RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single g"); + RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color"); RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 495a83f4bbe..f0a008b4939 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1234,7 +1234,7 @@ static void rna_def_background_image(BlenderRNA *brna) static EnumPropertyItem bgpic_source_items[] = { {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""}, - {V3D_BGPIC_MOVIE, "MOVIE", 0, "Movie", ""}, + {V3D_BGPIC_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1311,6 +1311,11 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP); RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED); + RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop) @@ -2612,6 +2617,12 @@ static void rna_def_space_filebrowser(BlenderRNA *brna) prop= RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "op"); RNA_def_property_ui_text(prop, "Active Operator", ""); + + /* keep this for compatibility with existing presets, + not exposed in c++ api because of keyword conflict */ + prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "op"); + RNA_def_property_ui_text(prop, "Active Operator", ""); } static void rna_def_space_info(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index eb3512083aa..5a2ef54cfc1 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -53,6 +53,40 @@ #include "WM_api.h" +static void rna_tracking_defaultSettings_levelsUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTracking *tracking= &clip->tracking; + MovieTrackingSettings *settings= &tracking->settings; + + if(settings->default_tracker==TRACKER_KLT) { + int max_pyramid_level_factor= 1 << (settings->default_pyramid_levels - 1); + float search_ratio= 2.3f * max_pyramid_level_factor; + + settings->default_search_size= settings->default_pattern_size*search_ratio; + } +} + +static void rna_tracking_defaultSettings_patternUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTracking *tracking= &clip->tracking; + MovieTrackingSettings *settings= &tracking->settings; + + if(settings->default_search_size<settings->default_pattern_size) + settings->default_search_size= settings->default_pattern_size; +} + +static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) +{ + MovieClip *clip= (MovieClip*)ptr->id.data; + MovieTracking *tracking= &clip->tracking; + MovieTrackingSettings *settings= &tracking->settings; + + if(settings->default_pattern_size>settings->default_search_size) + settings->default_pattern_size= settings->default_search_size; +} + static void rna_tracking_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; @@ -232,6 +266,17 @@ static MovieTrackingMarker *rna_trackingTrack_marker_find_frame(MovieTrackingTra #else +static EnumPropertyItem tracker_items[] = { + {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker which works with most of video clips, a bit slower than SAD"}, + {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker which can be used when KLT tracker fails"}, + {TRACKER_HYBRID, "Hybrid", 0, "Hybrid", "A hybrid tracker that uses SAD for rough tracking, KLT for refinement."}, + {0, NULL, 0, NULL, NULL}}; + +static EnumPropertyItem pattern_match_items[] = { + {TRACK_MATCH_KEYFRAME, "KEYFRAME", 0, "Keyframe", "Track pattern from keyframe to next frame"}, + {TRACK_MATCH_PREVFRAME, "PREV_FRAME", 0, "Previous frame", "Track pattern from current frame to next frame"}, + {0, NULL, 0, NULL, NULL}}; + static int rna_matrix_dimsize_4x4[]= {4, 4}; static void rna_def_trackingSettings(BlenderRNA *brna) @@ -280,27 +325,6 @@ static void rna_def_trackingSettings(BlenderRNA *brna) RNA_def_property_enum_items(prop, speed_items); RNA_def_property_ui_text(prop, "Speed", "Limit speed of tracking to make visual feedback easier (this does not affect the tracking quality)"); - /* limit frames */ - prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_int_sdna(prop, NULL, "frames_limit"); - RNA_def_property_range(prop, 0, SHRT_MAX); - RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this amount of frames are tracked"); - - /* adjust frames */ - prop= RNA_def_property(srna, "frames_adjust", PROP_INT, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_int_sdna(prop, NULL, "adjframes"); - RNA_def_property_range(prop, 0, INT_MAX); - RNA_def_property_ui_text(prop, "Adjust Frames", "Automatically re-adjust marker position using position on each N frames. 0 means only keyframed position is used"); - - /* margin */ - prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_int_sdna(prop, NULL, "margin"); - RNA_def_property_range(prop, 0, 300); - RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking"); - /* keyframe_a */ prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -348,6 +372,76 @@ static void rna_def_trackingSettings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, cleanup_items); RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute"); + + /* ** default tracker settings ** */ + prop= RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED); + RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface"); + RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); + + /* limit frames */ + prop= RNA_def_property(srna, "default_frames_limit", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "default_frames_limit"); + RNA_def_property_range(prop, 0, SHRT_MAX); + RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked"); + + /* pattern match */ + prop= RNA_def_property(srna, "default_pattern_match", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "default_pattern_match"); + RNA_def_property_enum_items(prop, pattern_match_items); + RNA_def_property_ui_text(prop, "Pattern Match", "Track pattern from given frame when tracking marker to next frame"); + + /* margin */ + prop= RNA_def_property(srna, "default_margin", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "default_margin"); + RNA_def_property_range(prop, 0, 300); + RNA_def_property_ui_text(prop, "Margin", "Default distance from image boudary at which marker stops tracking"); + + /* tracking algorithm */ + prop= RNA_def_property(srna, "default_tracker", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, tracker_items); + RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_levelsUpdate"); + RNA_def_property_ui_text(prop, "Tracker", "Default tracking algorithm to use"); + + /* pyramid level for pyramid klt tracking */ + prop= RNA_def_property(srna, "default_pyramid_levels", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "default_pyramid_levels"); + RNA_def_property_range(prop, 1, 16); + RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_levelsUpdate"); + RNA_def_property_ui_text(prop, "Pyramid levels", "Default number of pyramid levels (increase on blurry footage)"); + + /* minmal correlation - only used for SAD tracker */ + prop= RNA_def_property(srna, "default_correlation_min", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_float_sdna(prop, NULL, "default_minimum_correlation"); + RNA_def_property_range(prop, -1.0f, 1.0f); + RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); + RNA_def_property_ui_text(prop, "Correlation", "Default minimal value of correlation between matched pattern and reference which is still treated as successful tracking"); + + /* default pattern size */ + prop= RNA_def_property(srna, "default_pattern_size", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "default_pattern_size"); + RNA_def_property_range(prop, 5, 1000); + RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_patternUpdate"); + RNA_def_property_ui_text(prop, "Pattern Size", "Size of pattern area for newly created tracks"); + + /* default search size */ + prop= RNA_def_property(srna, "default_search_size", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "default_search_size"); + RNA_def_property_range(prop, 5, 1000); + RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_searchUpdate"); + RNA_def_property_ui_text(prop, "Search Size", "Size of search area for newly created tracks"); } static void rna_def_trackingCamera(BlenderRNA *brna) @@ -465,11 +559,6 @@ static void rna_def_trackingTrack(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - static EnumPropertyItem tracker_items[] = { - {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi tracker which works with most of video clips, a bit slower than SAD"}, - {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker which can be used when MLT tracker fails"}, - {0, NULL, 0, NULL, NULL}}; - rna_def_trackingMarker(brna); srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL); @@ -514,6 +603,27 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Search Max", "Right-bottom corner of search area in normalized coordinates relative to marker position"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update"); + /* limit frames */ + prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "frames_limit"); + RNA_def_property_range(prop, 0, SHRT_MAX); + RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked"); + + /* pattern match */ + prop= RNA_def_property(srna, "pattern_match", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_sdna(prop, NULL, "pattern_match"); + RNA_def_property_enum_items(prop, pattern_match_items); + RNA_def_property_ui_text(prop, "Pattern Match", "Track pattern from given frame when tracking marker to next frame"); + + /* margin */ + prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_int_sdna(prop, NULL, "margin"); + RNA_def_property_range(prop, 0, 300); + RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking"); + /* tracking algorithm */ prop= RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -535,7 +645,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "minimum_correlation"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); - RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between mathed pattern and reference which is still treated as successful tracking"); + RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between matched pattern and reference which is still treated as successful tracking"); /* markers */ prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE); @@ -685,7 +795,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) prop= RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "maxscale"); RNA_def_property_range(prop, 0.0f, 10.0f); - RNA_def_property_ui_text(prop, "Maximal Scale", "Limits the amount of automatic scaling"); + RNA_def_property_ui_text(prop, "Maximal Scale", "Limit the amount of automatic scaling"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); /* influence_location */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 418e9120458..ac9506ea54b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2626,6 +2626,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"}, {13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"}, {9, "SPANISH", 0, "Spanish (Español)", "es"}, + {14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"}, {0, "", 0, "In progress", ""}, {2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"}, {3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"}, @@ -2635,7 +2636,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) {10, "CATALAN", 0, "Catalan (Català)", "ca_AD"}, {11, "CZECH", 0, "Czech (Český)", "cs_CZ"}, {12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"}, - {14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"}, {16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"}, {17, "SERBIAN", 0, "Serbian (Српском језику)", "sr_RS"}, {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"}, diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h index cc077694384..3208f0d3aab 100644 --- a/source/blender/modifiers/MOD_modifiertypes.h +++ b/source/blender/modifiers/MOD_modifiertypes.h @@ -4,18 +4,15 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful; + * 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; + * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor(s): Ben Batt diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 8696bd12502..6541b15f66e 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -572,6 +572,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, /* unused */ (void)fluidmd; (void)scene; + (void)ob; (void)dm; (void)useRenderParams; return NULL; diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 2e744337b97..5336cb03efa 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -64,7 +64,6 @@ static void copyData(ModifierData *md, ModifierData *target) MirrorModifierData *mmd = (MirrorModifierData*) md; MirrorModifierData *tmmd = (MirrorModifierData*) target; - tmmd->axis = mmd->axis; tmmd->flag = mmd->flag; tmmd->tolerance = mmd->tolerance; tmmd->mirror_ob = mmd->mirror_ob; diff --git a/source/blender/modifiers/intern/MOD_none.c b/source/blender/modifiers/intern/MOD_none.c index 6b014a869b7..967532adf3c 100644 --- a/source/blender/modifiers/intern/MOD_none.c +++ b/source/blender/modifiers/intern/MOD_none.c @@ -4,18 +4,15 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful; + * 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; + * 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) 2005 Blender Foundation. diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 01c7f31b67a..0521b45c863 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -4,18 +4,15 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful; + * 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; + * 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) 2005 Blender Foundation. diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h index 262f27f0f1b..86909efb96c 100644 --- a/source/blender/modifiers/intern/MOD_util.h +++ b/source/blender/modifiers/intern/MOD_util.h @@ -4,18 +4,15 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful; + * 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; + * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor(s): Ben Batt diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index c2a9ae7555d..e206000f41d 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -240,51 +240,6 @@ static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float we dv->totweight++; } -/* Removes the given vertex from the vertex group, specified either by its defgrp_idx, - * or directly by its MDeformWeight pointer, if dw is not NULL. - * WARNING: This function frees the given MDeformWeight, do not use it afterward! */ -static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw) -{ - /* TODO, move this into deform.c as a generic function. */ - MDeformWeight *newdw; - int i; - - /* Get index of removed MDeformWeight. */ - if(dw == NULL) { - dw = dv->dw; - for (i = dv->totweight; i > 0; i--, dw++) { - if (dw->def_nr == defgrp_idx) - break; - } - i--; - } - else { - i = dw - dv->dw; - /* Security check! */ - if(i < 0 || i >= dv->totweight) - return; - } - - dv->totweight--; - /* If there are still other deform weights attached to this vert then remove - * this deform weight, and reshuffle the others. - */ - if(dv->totweight) { - newdw = MEM_mallocN(sizeof(MDeformWeight)*(dv->totweight), "defvert_remove_from_group, new deformWeight"); - if(dv->dw){ - memcpy(newdw, dv->dw, sizeof(MDeformWeight)*i); - memcpy(newdw+i, dv->dw+i+1, sizeof(MDeformWeight)*(dv->totweight-i)); - MEM_freeN(dv->dw); - } - dv->dw = newdw; - } - /* If there are no other deform weights left then just remove this one. */ - else { - MEM_freeN(dv->dw); - dv->dw = NULL; - } -} - /* Applies weights to given vgroup (defgroup), and optionnaly add/remove vertices from the group. * If dws is not NULL, it must be an array of MDeformWeight pointers of same length as weights (and @@ -309,7 +264,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws, /* If the vertex is in this vgroup, remove it if needed, or just update it. */ if(dw != NULL) { if(do_rem && w < rem_thresh) { - defvert_remove_from_group(dv, defgrp_idx, dw); + defvert_remove_index(dv, defgrp_idx, dw); } else { dw->weight = w; diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h index b74342ab516..97a5afec7da 100644 --- a/source/blender/nodes/NOD_composite.h +++ b/source/blender/nodes/NOD_composite.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h index 293ce466574..ae255517733 100644 --- a/source/blender/nodes/NOD_shader.h +++ b/source/blender/nodes/NOD_shader.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/nodes/NOD_texture.h b/source/blender/nodes/NOD_texture.h index b3fdbf0e250..cb727ef071a 100644 --- a/source/blender/nodes/NOD_texture.h +++ b/source/blender/nodes/NOD_texture.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index d95cc1460df..3ec75dfa4fd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -62,7 +62,7 @@ void register_node_type_sh_camera(bNodeTreeType *ttype) static bNodeType ntype; node_type_base(ttype, &ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING); + node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_camera_out); node_type_size(&ntype, 95, 95, 120); node_type_storage(&ntype, "node_camera", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index bfdcb5d0917..0f85196a45d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -85,7 +85,7 @@ void register_node_type_sh_hue_sat(bNodeTreeType *ttype) static bNodeType ntype; node_type_base(ttype, &ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS); - node_type_compatibility(&ntype, NODE_OLD_SHADING); + node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_hue_sat_in, sh_node_hue_sat_out); node_type_size(&ntype, 150, 80, 250); node_type_exec(&ntype, node_shader_exec_hue_sat); diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index 6d21b93fb65..2c20df2274d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -77,7 +77,7 @@ void register_node_type_sh_invert(bNodeTreeType *ttype) static bNodeType ntype; node_type_base(ttype, &ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS); - node_type_compatibility(&ntype, NODE_OLD_SHADING); + node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_invert_in, sh_node_invert_out); node_type_size(&ntype, 90, 80, 100); node_type_exec(&ntype, node_shader_exec_invert); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c index 09371a8a5ae..bd4f084d156 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c @@ -61,7 +61,7 @@ void register_node_type_sh_seprgb(bNodeTreeType *ttype) static bNodeType ntype; node_type_base(ttype, &ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING); + node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out); node_type_size(&ntype, 80, 40, 140); node_type_exec(&ntype, node_shader_exec_seprgb); @@ -101,7 +101,7 @@ void register_node_type_sh_combrgb(bNodeTreeType *ttype) static bNodeType ntype; node_type_base(ttype, &ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS); - node_type_compatibility(&ntype, NODE_OLD_SHADING); + node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out); node_type_size(&ntype, 80, 40, 140); node_type_exec(&ntype, node_shader_exec_combrgb); diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index bd9731a277a..9a73911d697 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -37,14 +37,12 @@ set(SRC blf_py_api.c bpy_internal_import.c idprop_py_api.c - noise_py_api.c py_capi_utils.c bgl.h blf_py_api.h bpy_internal_import.h idprop_py_api.h - noise_py_api.h py_capi_utils.h ) diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 73d954057c9..c31dadff3e1 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -151,9 +151,9 @@ PyObject *BPy_IDGroup_WrapData(ID *id, IDProperty *prop, IDProperty *parent) case IDP_GROUP: return idprop_py_from_idp_group(id, prop, parent); case IDP_ARRAY: - return idprop_py_from_idp_idparray(id, prop); + return idprop_py_from_idp_array(id, prop); case IDP_IDPARRAY: /* this could be better a internal type */ - idprop_py_from_idp_array(id, prop); + return idprop_py_from_idp_idparray(id, prop); default: Py_RETURN_NONE; } diff --git a/source/blender/python/generic/noise_py_api.c b/source/blender/python/generic/noise_py_api.c deleted file mode 100644 index 902e64eb7c1..00000000000 --- a/source/blender/python/generic/noise_py_api.c +++ /dev/null @@ -1,792 +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) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * This is a new part of Blender. - * - * Contributor(s): eeshlo, Campbell Barton - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/python/generic/noise_py_api.c - * \ingroup pygen - * - * This file defines the 'noise' module, a general purpose module to access - * blenders noise functions. - */ - - -/************************/ -/* Blender Noise Module */ -/************************/ - -#include <Python.h> - -#include "structseq.h" - -#include "BLI_blenlib.h" -#include "BLI_utildefines.h" - -#include "DNA_texture_types.h" - -#include "noise_py_api.h" - -/*-----------------------------------------*/ -/* 'mersenne twister' random number generator */ - -/* - A C-program for MT19937, with initialization improved 2002/2/10. - Coded by Takuji Nishimura and Makoto Matsumoto. - This is a faster version by taking Shawn Cokus's optimization, - Matthe Bellew's simplification, Isaku Wada's real version. - - Before using, initialize the state by using init_genrand(seed) - or init_by_array(init_key, key_length). - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - Any feedback is very welcome. - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) -*/ - -/* 2.5 update - * Noise.setRandomSeed --> seed_set - * Noise.randuvec --> random_unit_vector - * Noise.vNoise --> noise_vector - * Noise.vTurbulence --> turbulence_vector - * Noise.multiFractal --> multi_fractal - * Noise.cellNoise --> cell - * Noise.cellNoiseV --> cell_vector - * Noise.vlNoise --> vl_vector - * Noise.heteroTerrain --> hetero_terrain - * Noise.hybridMFractal --> hybrid_multi_fractal - * Noise.fBm --> fractal - * Noise.ridgedMFractal --> ridged_multi_fractal - * - * Const's * - * Noise.NoiseTypes --> types - * Noise.DistanceMetrics --> distance_metrics - */ - -/* Period parameters */ -#define N 624 -#define M 397 -#define MATRIX_A 0x9908b0dfUL /* constant vector a */ -#define UMASK 0x80000000UL /* most significant w-r bits */ -#define LMASK 0x7fffffffUL /* least significant r bits */ -#define MIXBITS(u,v) (((u) & UMASK) | ((v) & LMASK)) -#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL)) - -static unsigned long state[N]; /* the array for the state vector */ -static int left = 1; -static int initf = 0; -static unsigned long *next; - -/* initializes state[N] with a seed */ -static void init_genrand(unsigned long s) -{ - int j; - state[0] = s & 0xffffffffUL; - for (j = 1; j < N; j++) { - state[j] = - (1812433253UL * - (state[j - 1] ^ (state[j - 1] >> 30)) + j); - /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ - /* In the previous versions, MSBs of the seed affect */ - /* only MSBs of the array state[]. */ - /* 2002/01/09 modified by Makoto Matsumoto */ - state[j] &= 0xffffffffUL; /* for >32 bit machines */ - } - left = 1; - initf = 1; -} - -static void next_state(void) -{ - unsigned long *p = state; - int j; - - /* if init_genrand() has not been called, */ - /* a default initial seed is used */ - if (initf == 0) - init_genrand(5489UL); - - left = N; - next = state; - - for (j = N - M + 1; --j; p++) - *p = p[M] ^ TWIST(p[0], p[1]); - - for (j = M; --j; p++) - *p = p[M - N] ^ TWIST(p[0], p[1]); - - *p = p[M - N] ^ TWIST(p[0], state[0]); -} - -/*------------------------------------------------------------*/ - -static void setRndSeed(int seed) -{ - if (seed == 0) - init_genrand(time(NULL)); - else - init_genrand(seed); -} - -/* float number in range [0, 1) using the mersenne twister rng */ -static float frand(void) -{ - unsigned long y; - - if (--left == 0) - next_state(); - y = *next++; - - /* Tempering */ - y ^= (y >> 11); - y ^= (y << 7) & 0x9d2c5680UL; - y ^= (y << 15) & 0xefc60000UL; - y ^= (y >> 18); - - return (float) y / 4294967296.f; -} - -/*------------------------------------------------------------*/ - -/* returns random unit vector */ -static void randuvec(float v[3]) -{ - float r; - v[2] = 2.f * frand() - 1.f; - if ((r = 1.f - v[2] * v[2]) > 0.f) { - float a = (float)(6.283185307f * frand()); - r = (float)sqrt(r); - v[0] = (float)(r * cosf(a)); - v[1] = (float)(r * sinf(a)); - } - else { - v[2] = 1.f; - } -} - -static PyObject *Noise_random(PyObject *UNUSED(self)) -{ - return PyFloat_FromDouble(frand()); -} - -static PyObject *Noise_random_unit_vector(PyObject *UNUSED(self)) -{ - float v[3] = {0.0f, 0.0f, 0.0f}; - randuvec(v); - return Py_BuildValue("[fff]", v[0], v[1], v[2]); -} - -/*---------------------------------------------------------------------*/ - -/* Random seed init. Only used for MT random() & randuvec() */ - -static PyObject *Noise_seed_set(PyObject *UNUSED(self), PyObject *args) -{ - int s; - if (!PyArg_ParseTuple(args, "i:seed_set", &s)) - return NULL; - setRndSeed(s); - Py_RETURN_NONE; -} - -/*-------------------------------------------------------------------------*/ - -/* General noise */ - -static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)|i:noise", &x, &y, &z, &nb)) - return NULL; - - return PyFloat_FromDouble((2.0f * BLI_gNoise(1.0f, x, y, z, 0, nb) - 1.0f)); -} - -/*-------------------------------------------------------------------------*/ - -/* General Vector noise */ - -static void noise_vector(float x, float y, float z, int nb, float v[3]) -{ - /* Simply evaluate noise at 3 different positions */ - v[0]= (float)(2.0f * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0, - nb) - 1.0f); - v[1]= (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f); - v[2]= (float)(2.0f * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0, - nb) - 1.0f); -} - -static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, v[3]; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)|i:vector", &x, &y, &z, &nb)) - return NULL; - noise_vector(x, y, z, nb, v); - return Py_BuildValue("[fff]", v[0], v[1], v[2]); -} - -/*---------------------------------------------------------------------------*/ - -/* General turbulence */ - -static float turb(float x, float y, float z, int oct, int hard, int nb, - float ampscale, float freqscale) -{ - float amp, out, t; - int i; - amp = 1.f; - out = (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f); - if (hard) - out = fabsf(out); - for (i = 1; i < oct; i++) { - amp *= ampscale; - x *= freqscale; - y *= freqscale; - z *= freqscale; - t = (float)(amp * (2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f)); - if (hard) - t = fabsf(t); - out += t; - } - return out; -} - -static PyObject *Noise_turbulence(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z; - int oct, hd, nb = 1; - float as = 0.5, fs = 2.0; - if (!PyArg_ParseTuple(args, "(fff)ii|iff:turbulence", &x, &y, &z, &oct, &hd, &nb, &as, &fs)) - return NULL; - - return PyFloat_FromDouble(turb(x, y, z, oct, hd, nb, as, fs)); -} - -/*--------------------------------------------------------------------------*/ - -/* Turbulence Vector */ - -static void vTurb(float x, float y, float z, int oct, int hard, int nb, - float ampscale, float freqscale, float v[3]) -{ - float amp, t[3]; - int i; - amp = 1.f; - noise_vector(x, y, z, nb, v); - if (hard) { - v[0] = fabsf(v[0]); - v[1] = fabsf(v[1]); - v[2] = fabsf(v[2]); - } - for (i = 1; i < oct; i++) { - amp *= ampscale; - x *= freqscale; - y *= freqscale; - z *= freqscale; - noise_vector(x, y, z, nb, t); - if (hard) { - t[0] = fabsf(t[0]); - t[1] = fabsf(t[1]); - t[2] = fabsf(t[2]); - } - v[0] += amp * t[0]; - v[1] += amp * t[1]; - v[2] += amp * t[2]; - } -} - -static PyObject *Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, v[3]; - int oct, hd, nb = 1; - float as = 0.5, fs = 2.0; - if (!PyArg_ParseTuple(args, "(fff)ii|iff:turbulence_vector", &x, &y, &z, &oct, &hd, &nb, &as, &fs)) - return NULL; - vTurb(x, y, z, oct, hd, nb, as, fs, v); - return Py_BuildValue("[fff]", v[0], v[1], v[2]); -} - -/*---------------------------------------------------------------------*/ - -/* F. Kenton Musgrave's fractal functions */ - -static PyObject *Noise_fractal(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, H, lac, oct; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)fff|i:fractal", &x, &y, &z, &H, &lac, &oct, &nb)) - return NULL; - return PyFloat_FromDouble(mg_fBm(x, y, z, H, lac, oct, nb)); -} - -/*------------------------------------------------------------------------*/ - -static PyObject *Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, H, lac, oct; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)fff|i:multi_fractal", &x, &y, &z, &H, &lac, &oct, &nb)) - return NULL; - - return PyFloat_FromDouble(mg_MultiFractal(x, y, z, H, lac, oct, nb)); -} - -/*------------------------------------------------------------------------*/ - -static PyObject *Noise_vl_vector(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, d; - int nt1 = 1, nt2 = 1; - if (!PyArg_ParseTuple(args, "(fff)f|ii:vl_vector", &x, &y, &z, &d, &nt1, &nt2)) - return NULL; - return PyFloat_FromDouble(mg_VLNoise(x, y, z, d, nt1, nt2)); -} - -/*-------------------------------------------------------------------------*/ - -static PyObject *Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, H, lac, oct, ofs; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)ffff|i:hetero_terrain", &x, &y, &z, &H, &lac, &oct, &ofs, &nb)) - return NULL; - - return PyFloat_FromDouble(mg_HeteroTerrain(x, y, z, H, lac, oct, ofs, nb)); -} - -/*-------------------------------------------------------------------------*/ - -static PyObject *Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, H, lac, oct, ofs, gn; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)fffff|i:hybrid_multi_fractal", &x, &y, &z, &H, &lac, &oct, &ofs, &gn, &nb)) - return NULL; - - return PyFloat_FromDouble(mg_HybridMultiFractal(x, y, z, H, lac, oct, ofs, gn, nb)); -} - -/*------------------------------------------------------------------------*/ - -static PyObject *Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, H, lac, oct, ofs, gn; - int nb = 1; - if (!PyArg_ParseTuple(args, "(fff)fffff|i:ridged_multi_fractal", &x, &y, &z, &H, &lac, &oct, &ofs, &gn, &nb)) - return NULL; - return PyFloat_FromDouble(mg_RidgedMultiFractal(x, y, z, H, lac, oct, ofs, gn, nb)); -} - -/*-------------------------------------------------------------------------*/ - -static PyObject *Noise_voronoi(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, da[4], pa[12]; - int dtype = 0; - float me = 2.5; /* default minkovsky exponent */ - if (!PyArg_ParseTuple(args, "(fff)|if:voronoi", &x, &y, &z, &dtype, &me)) - return NULL; - voronoi(x, y, z, da, pa, me, dtype); - return Py_BuildValue("[[ffff][[fff][fff][fff][fff]]]", - da[0], da[1], da[2], da[3], - pa[0], pa[1], pa[2], - pa[3], pa[4], pa[5], - pa[6], pa[7], pa[8], pa[9], pa[10], pa[11]); -} - -/*-------------------------------------------------------------------------*/ - -static PyObject *Noise_cell(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z; - if (!PyArg_ParseTuple(args, "(fff):cell", &x, &y, &z)) - return NULL; - - return PyFloat_FromDouble(cellNoise(x, y, z)); -} - -/*--------------------------------------------------------------------------*/ - -static PyObject *Noise_cell_vector(PyObject *UNUSED(self), PyObject *args) -{ - float x, y, z, ca[3]; - if (!PyArg_ParseTuple(args, "(fff):cell_vector", &x, &y, &z)) - return NULL; - cellNoiseV(x, y, z, ca); - return Py_BuildValue("[fff]", ca[0], ca[1], ca[2]); -} - -/*--------------------------------------------------------------------------*/ -/* For all other Blender modules, this stuff seems to be put in a header file. - This doesn't seem really appropriate to me, so I just put it here, feel free to change it. - In the original module I actually kept the docs stings with the functions themselves, - but I grouped them here so that it can easily be moved to a header if anyone thinks that is necessary. */ - -PyDoc_STRVAR(random__doc__, -"() No arguments.\n\n\ -Returns a random floating point number in the range [0, 1)" -); - -PyDoc_STRVAR(random_unit_vector__doc__, -"() No arguments.\n\nReturns a random unit vector (3-float list)." -); - -PyDoc_STRVAR(seed_set__doc__, -"(seed value)\n\n\ -Initializes random number generator.\n\ -if seed is zero, the current time will be used instead." -); - -PyDoc_STRVAR(noise__doc__, -"((x,y,z) tuple, [noisetype])\n\n\ -Returns general noise of the optional specified type.\n\ -Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(noise_vector__doc__, -"((x,y,z) tuple, [noisetype])\n\n\ -Returns noise vector (3-float list) of the optional specified type.\ -Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(turbulence__doc__, -"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\ -Returns general turbulence value using the optional specified noisebasis function.\n\ -octaves (integer) is the number of noise values added.\n\ -hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned value always positive).\n\ -Optional arguments:\n\ -noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\ -ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\ -freqscale sets the frequency scale factor, 2.0 by default." -); - -PyDoc_STRVAR(turbulence_vector__doc__, -"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\ -Returns general turbulence vector (3-float list) using the optional specified noisebasis function.\n\ -octaves (integer) is the number of noise values added.\n\ -hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned vector always positive).\n\ -Optional arguments:\n\ -noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\ -ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\ -freqscale sets the frequency scale factor, 2.0 by default." -); - -PyDoc_STRVAR(fractal__doc__, -"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\ -Returns Fractal Brownian Motion noise value(fBm).\n\ -H is the fractal increment parameter.\n\ -lacunarity is the gap between successive frequencies.\n\ -octaves is the number of frequencies in the fBm.\n\ -Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(multi_fractal__doc__, -"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\ -Returns Multifractal noise value.\n\ -H determines the highest fractal dimension.\n\ -lacunarity is gap between successive frequencies.\n\ -octaves is the number of frequencies in the fBm.\n\ -Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(vl_vector__doc__, -"((x,y,z) tuple, distortion, [noisetype1], [noisetype2])\n\n\ -Returns Variable Lacunarity Noise value, a distorted variety of noise.\n\ -distortion sets the amount of distortion.\n\ -Optional arguments noisetype1 and noisetype2 set the noisetype to distort and the noisetype used for the distortion respectively.\n\ -See NoiseTypes, both are STDPERLIN by default." -); - -PyDoc_STRVAR(hetero_terrain__doc__, -"((x,y,z) tuple, H, lacunarity, octaves, offset, [noisebasis])\n\n\ -returns Heterogeneous Terrain value\n\ -H determines the fractal dimension of the roughest areas.\n\ -lacunarity is the gap between successive frequencies.\n\ -octaves is the number of frequencies in the fBm.\n\ -offset raises the terrain from 'sea level'.\n\ -Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(hybrid_multi_fractal__doc__, -"((x,y,z) tuple, H, lacunarity, octaves, offset, gain, [noisebasis])\n\n\ -returns Hybrid Multifractal value.\n\ -H determines the fractal dimension of the roughest areas.\n\ -lacunarity is the gap between successive frequencies.\n\ -octaves is the number of frequencies in the fBm.\n\ -offset raises the terrain from 'sea level'.\n\ -gain scales the values.\n\ -Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(ridged_multi_fractal__doc__, -"((x,y,z) tuple, H, lacunarity, octaves, offset, gain [noisebasis])\n\n\ -returns Ridged Multifractal value.\n\ -H determines the fractal dimension of the roughest areas.\n\ -lacunarity is the gap between successive frequencies.\n\ -octaves is the number of frequencies in the fBm.\n\ -offset raises the terrain from 'sea level'.\n\ -gain scales the values.\n\ -Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes." -); - -PyDoc_STRVAR(voronoi__doc__, -"((x,y,z) tuple, distance_metric, [exponent])\n\n\ -returns a list, containing a list of distances in order of closest feature,\n\ -and a list containing the positions of the four closest features\n\ -Optional arguments:\n\ -distance_metric: see DistanceMetrics, default is DISTANCE\n\ -exponent is only used with MINKOVSKY, default is 2.5." -); - -PyDoc_STRVAR(cell__doc__, -"((x,y,z) tuple)\n\n\ -returns cellnoise float value." -); - -PyDoc_STRVAR(cell_vector__doc__, -"((x,y,z) tuple)\n\n\ -returns cellnoise vector/point/color (3-float list)." -); - -PyDoc_STRVAR(Noise__doc__, -"Blender Noise and Turbulence Module\n\n\ -This module can be used to generate noise of various types.\n\ -This can be used for terrain generation, to create textures,\n\ -make animations more 'animated', object deformation, etc.\n\ -As an example, this code segment when scriptlinked to a framechanged event,\n\ -will make the camera sway randomly about, by changing parameters this can\n\ -look like anything from an earthquake to a very nervous or maybe even drunk cameraman...\n\ -(the camera needs an ipo with at least one Loc & Rot key for this to work!):\n\ -\n\ -\tfrom Blender import Get, Scene, Noise\n\ -\n\ -\t####################################################\n\ -\t# This controls jitter speed\n\ -\tsl = 0.025\n\ -\t# This controls the amount of position jitter\n\ -\tsp = 0.1\n\ -\t# This controls the amount of rotation jitter\n\ -\tsr = 0.25\n\ -\t####################################################\n\ -\n\ -\ttime = Get('curtime')\n\ -\tob = Scene.GetCurrent().getCurrentCamera()\n\ -\tps = (sl*time, sl*time, sl*time)\n\ -\t# To add jitter only when the camera moves, use this next line instead\n\ -\t#ps = (sl*ob.LocX, sl*ob.LocY, sl*ob.LocZ)\n\ -\trv = Noise.turbulence_vector(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN)\n\ -\tob.dloc = (sp*rv[0], sp*rv[1], sp*rv[2])\n\ -\tob.drot = (sr*rv[0], sr*rv[1], sr*rv[2])\n\ -\n" -); - -/* Just in case, declarations for a header file */ -/* -static PyObject *Noise_random(PyObject *UNUSED(self)); -static PyObject *Noise_random_unit_vector(PyObject *UNUSED(self)); -static PyObject *Noise_seed_set(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_turbulence(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_fractal(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_vl_vector(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_voronoi(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_cell(PyObject *UNUSED(self), PyObject *args); -static PyObject *Noise_cell_vector(PyObject *UNUSED(self), PyObject *args); -*/ - -static PyMethodDef NoiseMethods[] = { - {"seed_set", (PyCFunction) Noise_seed_set, METH_VARARGS, seed_set__doc__}, - {"random", (PyCFunction) Noise_random, METH_NOARGS, random__doc__}, - {"random_unit_vector", (PyCFunction) Noise_random_unit_vector, METH_NOARGS, random_unit_vector__doc__}, - {"noise", (PyCFunction) Noise_noise, METH_VARARGS, noise__doc__}, - {"vector", (PyCFunction) Noise_vector, METH_VARARGS, noise_vector__doc__}, - {"turbulence", (PyCFunction) Noise_turbulence, METH_VARARGS, turbulence__doc__}, - {"turbulence_vector", (PyCFunction) Noise_turbulence_vector, METH_VARARGS, turbulence_vector__doc__}, - {"fractal", (PyCFunction) Noise_fractal, METH_VARARGS, fractal__doc__}, - {"multi_fractal", (PyCFunction) Noise_multi_fractal, METH_VARARGS, multi_fractal__doc__}, - {"vl_vector", (PyCFunction) Noise_vl_vector, METH_VARARGS, vl_vector__doc__}, - {"hetero_terrain", (PyCFunction) Noise_hetero_terrain, METH_VARARGS, hetero_terrain__doc__}, - {"hybrid_multi_fractal", (PyCFunction) Noise_hybrid_multi_fractal, METH_VARARGS, hybrid_multi_fractal__doc__}, - {"ridged_multi_fractal", (PyCFunction) Noise_ridged_multi_fractal, METH_VARARGS, ridged_multi_fractal__doc__}, - {"voronoi", (PyCFunction) Noise_voronoi, METH_VARARGS, voronoi__doc__}, - {"cell", (PyCFunction) Noise_cell, METH_VARARGS, cell__doc__}, - {"cell_vector", (PyCFunction) Noise_cell_vector, METH_VARARGS, cell_vector__doc__}, - {NULL, NULL, 0, NULL} -}; - -/*----------------------------------------------------------------------*/ - -static struct PyModuleDef noise_module_def = { - PyModuleDef_HEAD_INIT, - "noise", /* m_name */ - Noise__doc__, /* m_doc */ - 0, /* m_size */ - NoiseMethods, /* m_methods */ - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ -}; - -PyObject *BPyInit_noise(void) -{ - PyObject *submodule = PyModule_Create(&noise_module_def); - - /* use current time as seed for random number generator by default */ - setRndSeed(0); - - /* Constant noisetype dictionary */ - if (submodule) { - static PyStructSequence_Field noise_types_fields[] = { - {(char *)"BLENDER", NULL}, - {(char *)"STDPERLIN", NULL}, - {(char *)"NEWPERLIN", NULL}, - {(char *)"VORONOI_F1", NULL}, - {(char *)"VORONOI_F2", NULL}, - {(char *)"VORONOI_F3", NULL}, - {(char *)"VORONOI_F4", NULL}, - {(char *)"VORONOI_F2F1", NULL}, - {(char *)"VORONOI_CRACKLE", NULL}, - {(char *)"CELLNOISE", NULL}, - {NULL} - }; - - static PyStructSequence_Desc noise_types_info_desc = { - (char *)"noise.types", /* name */ - (char *)"Noise type", /* doc */ - noise_types_fields, /* fields */ - (sizeof(noise_types_fields)/sizeof(PyStructSequence_Field)) - 1 - }; - - static PyTypeObject NoiseType; - - PyObject *noise_types; - - int pos = 0; - - PyStructSequence_InitType(&NoiseType, &noise_types_info_desc); - - noise_types = PyStructSequence_New(&NoiseType); - if (noise_types == NULL) { - return NULL; - } - - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_BLENDER)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_STDPERLIN)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_NEWPERLIN)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_F1)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_F2)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_F3)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_F4)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_F2F1)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_VORONOI_CRACKLE)); - PyStructSequence_SET_ITEM(noise_types, pos++, PyLong_FromLong(TEX_CELLNOISE)); - - PyModule_AddObject(submodule, "types", noise_types); - } - - if (submodule) { - static PyStructSequence_Field distance_metrics_fields[] = { - {(char *)"DISTANCE", NULL}, - {(char *)"DISTANCE_SQUARED", NULL}, - {(char *)"MANHATTAN", NULL}, - {(char *)"CHEBYCHEV", NULL}, - {(char *)"MINKOVSKY_HALF", NULL}, - {(char *)"MINKOVSKY_FOUR", NULL}, - {(char *)"MINKOVSKY", NULL}, - {NULL} - }; - - static PyStructSequence_Desc noise_types_info_desc = { - (char *)"noise.distance_metrics", /* name */ - (char *)"Distance Metrics for noise module.", /* doc */ - distance_metrics_fields, /* fields */ - (sizeof(distance_metrics_fields)/sizeof(PyStructSequence_Field)) - 1 - }; - - static PyTypeObject DistanceMetrics; - - PyObject *distance_metrics; - - int pos = 0; - - PyStructSequence_InitType(&DistanceMetrics, &noise_types_info_desc); - - distance_metrics = PyStructSequence_New(&DistanceMetrics); - if (distance_metrics == NULL) { - return NULL; - } - - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_DISTANCE)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_DISTANCE_SQUARED)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_MANHATTAN)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_CHEBYCHEV)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_MINKOVSKY_HALF)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_MINKOVSKY_FOUR)); - PyStructSequence_SET_ITEM(distance_metrics, pos++, PyLong_FromLong(TEX_MINKOVSKY)); - - PyModule_AddObject(submodule, "distance_metrics", distance_metrics); - } - - return submodule; -} diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index d2d9c51643f..81882317244 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -205,10 +205,14 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj return PyUnicode_DecodeFSDefault(path); } -static PyMethodDef meth_bpy_script_paths= {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}; -static PyMethodDef meth_bpy_blend_paths= {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}; -static PyMethodDef meth_bpy_user_resource= {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL}; -static PyMethodDef meth_bpy_resource_path= {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc}; +static PyMethodDef meth_bpy_script_paths= + {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}; +static PyMethodDef meth_bpy_blend_paths= + {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}; +static PyMethodDef meth_bpy_user_resource= + {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL}; +static PyMethodDef meth_bpy_resource_path= + {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc}; static PyObject *bpy_import_test(const char *modname) @@ -260,16 +264,21 @@ void BPy_init_modules(void) /* run first, initializes rna types */ BPY_rna_init(); - PyModule_AddObject(mod, "types", BPY_rna_types()); /* needs to be first so bpy_types can run */ - PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); /* metaclass for idprop types, bpy_types.py needs access */ + /* needs to be first so bpy_types can run */ + PyModule_AddObject(mod, "types", BPY_rna_types()); - bpy_lib_init(mod); /* adds '_bpy._library_load', must be called before 'bpy_types' which uses it */ + /* metaclass for idprop types, bpy_types.py needs access */ + PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); + + /* needs to be first so bpy_types can run */ + bpy_lib_init(mod); bpy_import_test("bpy_types"); PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ bpy_import_test("bpy_types"); - PyModule_AddObject(mod, "props", BPY_rna_props()); - PyModule_AddObject(mod, "ops", BPY_operator_module()); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "props", BPY_rna_props()); + /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "ops", BPY_operator_module()); PyModule_AddObject(mod, "app", BPY_app_struct()); /* bpy context */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index b5ae225fda7..1f99503202a 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -159,6 +159,10 @@ static PyObject *make_app_info(void) /* a few getsets because it makes sense for them to be in bpy.app even though * they are not static */ + +PyDoc_STRVAR(bpy_app_debug_doc, +"Boolean, set when blender is running in debug mode (started with --debug)" +); static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyBool_FromLong(G.f & G_DEBUG); @@ -179,6 +183,9 @@ static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUS return 0; } +PyDoc_STRVAR(bpy_app_debug_value_doc, +"Int, number which can be set to non-zero values for testing purposes" +); static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyLong_FromSsize_t(G.rt); @@ -198,11 +205,17 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void return 0; } +PyDoc_STRVAR(bpy_app_tempdir_doc, +"String, the temp directory used by blender (read-only)" +); static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure)) { return PyC_UnicodeFromByte(BLI_temporary_dir()); } +PyDoc_STRVAR(bpy_app_driver_dict_doc, +"Dictionary for drivers namespace, editable in-place, reset on file load (read-only)" +); static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure)) { if (bpy_pydriver_Dict == NULL) @@ -217,10 +230,10 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl static PyGetSetDef bpy_app_getsets[]= { - {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)"Boolean, set when blender is running in debug mode (started with -d)", NULL}, - {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)"Int, number which can be set to non-zero values for testing purposes.", NULL}, - {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)"String, the temp directory used by blender (read-only)", NULL}, - {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)"Dictionary for drivers namespace, editable in-place, reset on file load (read-only)", NULL}, + {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, NULL}, + {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, + {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL}, + {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} }; @@ -253,4 +266,3 @@ PyObject *BPY_app_struct(void) return ret; } - diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 2aad4d8f2fe..34270c832ea 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -82,7 +82,7 @@ int bpy_pydriver_create_dict(void) } /* add noise to global namespace */ - mod= PyImport_ImportModuleLevel((char *)"noise", NULL, NULL, NULL, 0); + mod= PyImport_ImportModuleLevel((char *)"mathutils.noise", NULL, NULL, NULL, 0); if (mod) { PyDict_SetItemString(bpy_pydriver_Dict, "noise", mod); Py_DECREF(mod); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index b7ead49633c..14d74bcf5d0 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -71,7 +71,6 @@ /* inittab initialization functions */ #include "../generic/bgl.h" #include "../generic/blf_py_api.h" -#include "../generic/noise_py_api.h" #include "../mathutils/mathutils.h" /* for internal use, when starting and ending python scripts */ @@ -134,9 +133,12 @@ void bpy_context_clear(bContext *UNUSED(C), PyGILState_STATE *gilstate) fprintf(stderr, "ERROR: Python context internal state bug. this should not happen!\n"); } else if (py_call_level==0) { - // XXX - Calling classes currently wont store the context :\, cant set NULL because of this. but this is very flakey still. - //BPy_SetContext(NULL); - //bpy_import_main_set(NULL); + /* XXX - Calling classes currently wont store the context :\, + * cant set NULL because of this. but this is very flakey still. */ +#if 0 + BPy_SetContext(NULL); + bpy_import_main_set(NULL); +#endif #ifdef TIME_PY_RUN bpy_timer_run_tot += PIL_check_seconds_timer() - bpy_timer_run; @@ -178,9 +180,9 @@ extern PyObject *AUD_initPython(void); extern PyObject *CYCLES_initPython(void); static struct _inittab bpy_internal_modules[]= { - {(char *)"noise", BPyInit_noise}, {(char *)"mathutils", PyInit_mathutils}, // {(char *)"mathutils.geometry", PyInit_mathutils_geometry}, +// {(char *)"mathutils.noise", PyInit_mathutils_noise}, {(char *)"bgl", BPyInit_bgl}, {(char *)"blf", BPyInit_blf}, #ifdef WITH_AUDASPACE @@ -329,7 +331,8 @@ typedef struct { } PyModuleObject; #endif -static int python_script_exec(bContext *C, const char *fn, struct Text *text, struct ReportList *reports, const short do_jump) +static int python_script_exec(bContext *C, const char *fn, struct Text *text, + struct ReportList *reports, const short do_jump) { PyObject *main_mod= NULL; PyObject *py_dict= NULL, *py_result= NULL; @@ -717,7 +720,10 @@ void bpy_module_delay_init(PyObject *bpy_proxy) { const int argc= 1; const char *argv[2]; - PyObject *filename_obj= PyModule_GetFilenameObject(bpy_proxy); /* updating the module dict below will loose the reference to __file__ */ + + /* updating the module dict below will loose the reference to __file__ */ + PyObject *filename_obj= PyModule_GetFilenameObject(bpy_proxy); + const char *filename_rel= _PyUnicode_AsString(filename_obj); /* can be relative */ char filename_abs[1024]; diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index b91948cc0b8..a6426a02e18 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -265,8 +265,8 @@ static PyObject *bpy_lib_enter(BPy_Library *self, PyObject *UNUSED(args)) /* create a dummy */ self_from= PyObject_New(BPy_Library, &bpy_lib_Type); - BLI_strncpy(self_from->relpath, self->relpath, sizeof(BPy_Library)); - BLI_strncpy(self_from->abspath, self->abspath, sizeof(BPy_Library)); + BLI_strncpy(self_from->relpath, self->relpath, sizeof(self_from->relpath)); + BLI_strncpy(self_from->abspath, self->abspath, sizeof(self_from->abspath)); self_from->blo_handle= NULL; self_from->flag= 0; @@ -396,6 +396,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args)) return NULL; } else { + Library *lib= mainl->curlib; /* newly added lib, assign before append end */ BLO_library_append_end(NULL, mainl, &(self->blo_handle), 0, self->flag); BLO_blendhandle_close(self->blo_handle); self->blo_handle= NULL; @@ -406,9 +407,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args)) /* append, rather than linking */ if ((self->flag & FILE_LINK)==0) { - Library *lib= BLI_findstring(&G.main->library, self->abspath, offsetof(Library, name)); - if (lib) BKE_library_make_local(bmain, lib, 1); - else BLI_assert(!"cant find name of just added library!"); + BKE_library_make_local(bmain, lib, 1); } } @@ -426,7 +425,10 @@ static PyObject *bpy_lib_dir(BPy_Library *self) int bpy_lib_init(PyObject *mod_par) { - static PyMethodDef load_meth= {"load", (PyCFunction)bpy_lib_load, METH_STATIC|METH_VARARGS|METH_KEYWORDS, bpy_lib_load_doc}; + static PyMethodDef load_meth= {"load", (PyCFunction)bpy_lib_load, + METH_STATIC|METH_VARARGS|METH_KEYWORDS, + bpy_lib_load_doc}; + PyModule_AddObject(mod_par, "_library_load", PyCFunction_New(&load_meth, NULL)); /* some compilers dont like accessing this directly, delay assignment */ diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 3fd4e8a128b..70346a65bf9 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -31,11 +31,6 @@ * which fakes exposing operators as modules/functions using its own classes. */ - -/* Note, this module is not to be used directly by the user. - * Internally its exposed as '_bpy.ops', which provides functions for 'bpy.ops', a python package. - * */ - #include <Python.h> #include "RNA_types.h" @@ -78,7 +73,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) int context= WM_OP_EXEC_DEFAULT; - // XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it... + /* XXX Todo, work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it... */ bContext *C= (bContext *)BPy_GetContext(); if (C==NULL) { @@ -152,7 +148,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) /* note that context is an int, python does the conversion in this case */ int context= WM_OP_EXEC_DEFAULT; - // XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it... + /* XXX Todo, work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it... */ bContext *C= (bContext *)BPy_GetContext(); if (C==NULL) { diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 950aa9458d5..c0d796669d6 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -233,7 +233,7 @@ static void bpy_prop_update_cb(struct bContext *C, struct PointerRNA *ptr, struc static int bpy_prop_callback_check(PyObject *py_func, int argcount) { - if (py_func) { + if (py_func && py_func != Py_None) { if (!PyFunction_Check(py_func)) { PyErr_Format(PyExc_TypeError, "update keyword: expected a function type, not a %.200s", @@ -301,7 +301,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int) if (srna==NULL) { \ if (PyErr_Occurred()) \ return NULL; \ - return bpy_prop_deferred_return((void *)pymeth_##_func, kw); \ + return bpy_prop_deferred_return(pymeth_##_func, kw); \ } \ /* terse macros for error checks shared between all funcs cant use function @@ -370,7 +370,8 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier) #endif -/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna along +/* Function that sets RNA, NOTE - self is NULL when called from python, + * but being abused from C so we can pass the srna along. * This isnt incorrect since its a python object - but be careful */ PyDoc_STRVAR(BPy_BoolProperty_doc, ".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE', update=None)\n" @@ -392,7 +393,8 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(BoolProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int def=0; @@ -459,7 +461,8 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(BoolVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "options", "subtype", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "options", "subtype", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int def[PYRNA_STACK_ARRAY]={0}; @@ -485,7 +488,9 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_SUBTYPE_CHECK(BoolVectorProperty, property_flag_items, property_subtype_array_items) if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "BoolVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "BoolVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -534,7 +539,8 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(IntProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0; @@ -603,7 +609,9 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(IntVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "options", "subtype", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0}; @@ -631,7 +639,9 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_SUBTYPE_CHECK(IntVectorProperty, property_flag_items, property_subtype_array_items) if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "IntVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "IntVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -682,7 +692,9 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(FloatProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "precision", "options", "subtype", "unit", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f; @@ -761,7 +773,9 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec BPY_PROPDEF_HEAD(FloatVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "size", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "min", "max", "soft_min", "soft_max", + "step", "precision", "options", "subtype", "unit", "size", "update", NULL}; const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f}; @@ -796,7 +810,9 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec } if (size < 1 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "FloatVectorProperty(size=%d): size must be between 0 and " STRINGIFY(PYRNA_STACK_ARRAY), size); + PyErr_Format(PyExc_TypeError, + "FloatVectorProperty(size=%d): size must be between 0 and " + STRINGIFY(PYRNA_STACK_ARRAY), size); return NULL; } @@ -845,7 +861,8 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw BPY_PROPDEF_HEAD(StringProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", "maxlen", "options", "subtype", "update", NULL}; + static const char *kwlist[]= {"attr", "name", "description", "default", + "maxlen", "options", "subtype", "update", NULL}; const char *id=NULL, *name="", *description="", *def=""; int id_len; int maxlen=0; @@ -913,7 +930,10 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i if (is_enum_flag) { if (seq_len > RNA_ENUM_BITFLAG_SIZE) { - PyErr_SetString(PyExc_TypeError, "EnumProperty(...): maximum " STRINGIFY(RNA_ENUM_BITFLAG_SIZE) " members for a ENUM_FLAG type property"); + PyErr_SetString(PyExc_TypeError, + "EnumProperty(...): maximum " + STRINGIFY(RNA_ENUM_BITFLAG_SIZE) + " members for a ENUM_FLAG type property"); return NULL; } if (def && !PySet_Check(def)) { @@ -1026,7 +1046,8 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i * immediately after use, so we need to duplicate them, ugh. * annoying because it works most of the time without this. */ { - EnumPropertyItem *items_dup= MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), "enum_items_from_py2"); + EnumPropertyItem *items_dup= MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), + "enum_items_from_py2"); EnumPropertyItem *items_ptr= items_dup; char *buf= ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1)); memcpy(items_dup, items, sizeof(EnumPropertyItem) * (seq_len + 1)); @@ -1077,7 +1098,9 @@ static EnumPropertyItem *bpy_props_enum_itemf(struct bContext *C, PointerRNA *pt PyObject *items_fast; int defvalue_dummy=0; - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): return value from the callback was not a sequence"))) { + if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + "return value from the callback was not a sequence"))) + { err= -1; } else { @@ -1137,7 +1160,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(EnumProperty) if (srna) { - static const char *kwlist[]= {"attr", "items", "name", "description", "default", "options", "update", NULL}; + static const char *kwlist[]= {"attr", "items", "name", "description", "default", + "options", "update", NULL}; const char *id=NULL, *name="", *description=""; PyObject *def= NULL; int id_len; @@ -1187,7 +1211,9 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) eitems= DummyRNA_NULL_items; } else { - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): expected a sequence of tuples for the enum items or a function"))) { + if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + "expected a sequence of tuples for the enum items or a function"))) + { return NULL; } @@ -1206,7 +1232,10 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if (is_itemf) { RNA_def_enum_funcs(prop, bpy_props_enum_itemf); RNA_def_enum_py_data(prop, (void *)items); - /* Py_INCREF(items); */ /* watch out!, if user is tricky they can probably crash blender if they manage to free the callback, take care! */ + + /* watch out!, if a user is tricky they can probably crash blender + * if they manage to free the callback, take care! */ + /* Py_INCREF(items); */ } if (pyopts) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 9b42335dfe5..f099994fc57 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -367,7 +367,8 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item #ifdef USE_MATHUTILS #include "../mathutils/mathutils.h" /* so we can have mathutils callbacks */ -static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length); +static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length); static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_eul_order, short order_fallback); /* bpyrna vector/euler/quat callbacks */ @@ -589,7 +590,15 @@ static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_ /* note that PROP_NONE is included as a vector subtype. this is because its handy to * have x/y access to fcurve keyframes and other fixed size float arrays of length 2-4. */ -#define PROP_ALL_VECTOR_SUBTYPES PROP_COORDS: case PROP_TRANSLATION: case PROP_DIRECTION: case PROP_VELOCITY: case PROP_ACCELERATION: case PROP_XYZ: case PROP_XYZ_LENGTH +#define PROP_ALL_VECTOR_SUBTYPES \ + PROP_COORDS: \ + case PROP_TRANSLATION: \ + case PROP_DIRECTION: \ + case PROP_VELOCITY: \ + case PROP_ACCELERATION: \ + case PROP_XYZ: \ + case PROP_XYZ_LENGTH \ + PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop) { @@ -2098,8 +2107,18 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons /* static PyObject *pyrna_prop_array_subscript_str(BPy_PropertyRNA *self, char *keyname) */ /* special case: bpy.data.objects["some_id_name", "//some_lib_name.blend"] - * also for: bpy.data.objects.get(("some_id_name", "//some_lib_name.blend"), fallback) */ -static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const short err_not_found) + * also for: bpy.data.objects.get(("some_id_name", "//some_lib_name.blend"), fallback) + * + * note: + * error codes since this is not to be called directly from python, + * this matches pythons __contains__ values capi. + * -1: exception set + * 0: not found + * 1: found */ +int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyObject *key, + const char *err_prefix, const short err_not_found, + PointerRNA *r_ptr + ) { char *keyname; @@ -2108,24 +2127,24 @@ static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *s PyErr_Format(PyExc_KeyError, "%s: tuple key must be a pair, not size %d", err_prefix, PyTuple_GET_SIZE(key)); - return NULL; + return -1; } else if (self->ptr.type != &RNA_BlendData) { PyErr_Format(PyExc_KeyError, "%s: is only valid for bpy.data collections, not %.200s", err_prefix, RNA_struct_identifier(self->ptr.type)); - return NULL; + return -1; } else if ((keyname= _PyUnicode_AsString(PyTuple_GET_ITEM(key, 0))) == NULL) { PyErr_Format(PyExc_KeyError, "%s: id must be a string, not %.200s", err_prefix, Py_TYPE(PyTuple_GET_ITEM(key, 0))->tp_name); - return NULL; + return -1; } else { PyObject *keylib= PyTuple_GET_ITEM(key, 1); Library *lib; - PyObject *ret= NULL; + int found= FALSE; if (keylib == Py_None) { lib= NULL; @@ -2140,16 +2159,19 @@ static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *s "%s: lib name '%.240s' " "does not reference a valid library", err_prefix, keylib_str); + return -1; + } + else { + return 0; } - return NULL; } } else { PyErr_Format(PyExc_KeyError, "%s: lib must be a sting or None, not %.200s", err_prefix, Py_TYPE(keylib)->tp_name); - return NULL; + return -1; } /* lib is either a valid poniter or NULL, @@ -2158,23 +2180,43 @@ static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *s RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { ID *id= itemptr.data; /* always an ID */ if (id->lib == lib && (strncmp(keyname, id->name+2, sizeof(id->name)-2) == 0)) { - ret= pyrna_struct_CreatePyObject(&itemptr); + found= TRUE; + if (r_ptr) { + *r_ptr= itemptr; + } break; } } RNA_PROP_END; /* we may want to fail silently as with collection.get() */ - if ((ret == NULL) && err_not_found) { + if ((found == FALSE) && err_not_found) { /* only runs for getitem access so use fixed string */ PyErr_SetString(PyExc_KeyError, "bpy_prop_collection[key, lib]: not found"); + return -1; } + else { + return found; /* 1 / 0, no exception */ + } + } +} - return ret; +static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *self, PyObject *key, + const char *err_prefix, const short err_not_found) +{ + PointerRNA ptr; + const int contains= pyrna_prop_collection_subscript_str_lib_pair_ptr(self, key, err_prefix, err_not_found, &ptr); + + if (contains == 1) { + return pyrna_struct_CreatePyObject(&ptr); + } + else { + return NULL; } } + static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop) { CollectionPropertyIterator rna_macro_iter; @@ -2188,7 +2230,10 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py list= PyList_New(0); /* first loop up-until the start */ - for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { + for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); + rna_macro_iter.valid; + RNA_property_collection_next(&rna_macro_iter)) + { /* PointerRNA itemptr= rna_macro_iter.ptr; */ if (count == start) { break; @@ -2197,7 +2242,9 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py } /* add items until stop */ - for (; rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { + for (; rna_macro_iter.valid; + RNA_property_collection_next(&rna_macro_iter)) + { item= pyrna_struct_CreatePyObject(&rna_macro_iter.ptr); PyList_Append(list, item); Py_DECREF(item); @@ -2217,7 +2264,8 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py * note: could also use pyrna_prop_array_to_py_index(self, count) in a loop but its a lot slower * since at the moment it reads (and even allocates) the entire array for each index. */ -static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length) +static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, + Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length) { int count, totdim; PyObject *tuple; @@ -2347,7 +2395,8 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject } else if (PyTuple_Check(key)) { /* special case, for ID datablocks we */ - return pyrna_prop_collection_subscript_str_lib_pair(self, key, "bpy_prop_collection[id, lib]", TRUE); + return pyrna_prop_collection_subscript_str_lib_pair(self, key, + "bpy_prop_collection[id, lib]", TRUE); } else { PyErr_Format(PyExc_TypeError, @@ -2532,7 +2581,8 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject } /* could call (pyrna_py_to_prop_array_index(self, i, value) in a loop but it is slow */ -static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length, PyObject *value_orig) +static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, + int start, int stop, int length, PyObject *value_orig) { PyObject *value; int count; @@ -2540,7 +2590,8 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, in int ret= 0; if (value_orig == NULL) { - PyErr_SetString(PyExc_TypeError, "bpy_prop_array[slice]= value: deleting with list types is not supported by bpy_struct"); + PyErr_SetString(PyExc_TypeError, + "bpy_prop_array[slice]= value: deleting with list types is not supported by bpy_struct"); return -1; } @@ -2550,7 +2601,8 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, PropertyRNA *prop, in if (PySequence_Fast_GET_SIZE(value) != stop-start) { Py_DECREF(value); - PyErr_SetString(PyExc_TypeError, "bpy_prop_array[slice]= value: resizing bpy_struct arrays isn't supported"); + PyErr_SetString(PyExc_TypeError, + "bpy_prop_array[slice]= value: resizing bpy_struct arrays isn't supported"); return -1; } @@ -2751,22 +2803,30 @@ static int pyrna_prop_array_contains(BPy_PropertyRNA *self, PyObject *value) return pyrna_array_contains_py(&self->ptr, self->prop, value); } -static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *value) +static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *key) { PointerRNA newptr; /* not used, just so RNA_property_collection_lookup_string runs */ - /* key in dict style check */ - const char *keyname= _PyUnicode_AsString(value); - - if (keyname==NULL) { - PyErr_SetString(PyExc_TypeError, "bpy_prop_collection.__contains__: expected a string"); - return -1; + if (PyTuple_Check(key)) { + /* special case, for ID datablocks we */ + return pyrna_prop_collection_subscript_str_lib_pair_ptr(self, key, + "(id, lib) in bpy_prop_collection", FALSE, NULL); } + else { - if (RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) - return 1; + /* key in dict style check */ + const char *keyname= _PyUnicode_AsString(key); - return 0; + if (keyname==NULL) { + PyErr_SetString(PyExc_TypeError, "bpy_prop_collection.__contains__: expected a string or a typle of strings"); + return -1; + } + + if (RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) + return 1; + + return 0; + } } static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value) @@ -3459,9 +3519,12 @@ static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname) #endif //--------------- setattr------------------------------------------- -static int pyrna_is_deferred_prop(PyObject *value) +static int pyrna_is_deferred_prop(const PyObject *value) { - return PyTuple_CheckExact(value) && PyTuple_GET_SIZE(value)==2 && PyCallable_Check(PyTuple_GET_ITEM(value, 0)) && PyDict_CheckExact(PyTuple_GET_ITEM(value, 1)); + return PyTuple_CheckExact(value) && + PyTuple_GET_SIZE(value) == 2 && + PyCFunction_Check(PyTuple_GET_ITEM(value, 0)) && + PyDict_CheckExact(PyTuple_GET_ITEM(value, 1)); } #if 0 @@ -3472,7 +3535,7 @@ static PyObject *pyrna_struct_meta_idprop_getattro(PyObject *cls, PyObject *attr /* Allows: * >>> bpy.types.Scene.foo= BoolProperty() * >>> bpy.types.Scene.foo - * <bpy_struct, BooleanProperty("foo")> + * <bpy_struct, BoolProperty("foo")> * ...rather than returning the deferred class register tuple as checked by pyrna_is_deferred_prop() * * Disable for now, this is faking internal behavior in a way thats too tricky to maintain well. */ @@ -3499,8 +3562,9 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb { StructRNA *srna= srna_from_self(cls, "StructRNA.__setattr__"); const int is_deferred_prop= (value && pyrna_is_deferred_prop(value)); + const char *attr_str= _PyUnicode_AsString(attr); - if (srna && !pyrna_write_check() && (is_deferred_prop || RNA_struct_type_find_property(srna, _PyUnicode_AsString(attr)))) { + if (srna && !pyrna_write_check() && (is_deferred_prop || RNA_struct_type_find_property(srna, attr_str))) { PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() " "can't set in readonly state '%.200s.%S'", @@ -3538,14 +3602,12 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb } else { /* remove existing property if its set or we also end up with confusion */ - const char *attr_str= _PyUnicode_AsString(attr); RNA_def_property_free_identifier(srna, attr_str); /* ignore on failure */ } } else { /* __delattr__ */ /* first find if this is a registered property */ - const char *attr_str= _PyUnicode_AsString(attr); - int ret= RNA_def_property_free_identifier(srna, attr_str); + const int ret= RNA_def_property_free_identifier(srna, attr_str); if (ret == -1) { PyErr_Format(PyExc_TypeError, "struct_meta_idprop.detattr(): '%s' not a dynamic property", @@ -3801,6 +3863,10 @@ static PyObject *pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObje Py_RETURN_NONE; } + +PyDoc_STRVAR(pyrna_struct_get_id_data_doc, +"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)" +); static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) { /* used for struct and pointer since both have a ptr */ @@ -3813,11 +3879,17 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) Py_RETURN_NONE; } +PyDoc_STRVAR(pyrna_struct_get_data_doc, +"The data this property is using, *type* :class:`bpy.types.bpy_struct`" +); static PyObject *pyrna_struct_get_data(BPy_DummyPointerRNA *self) { return pyrna_struct_CreatePyObject(&self->ptr); } +PyDoc_STRVAR(pyrna_struct_get_rna_type_doc, +"The property type for introspection" +); static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) { PointerRNA tptr; @@ -3832,18 +3904,18 @@ static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, - {(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)"The data this property is using, *type* :class:`bpy.types.bpy_struct`", NULL}, - {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL}, + {(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)pyrna_struct_get_data_doc, NULL}, + {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)pyrna_struct_get_rna_type_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; - static PyGetSetDef pyrna_struct_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; + PyDoc_STRVAR(pyrna_prop_collection_keys_doc, ".. method:: keys()\n" "\n" @@ -3908,7 +3980,8 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self) MEM_freeN(nameptr); } else { - PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); /* a bit strange but better then returning an empty list */ + /* a bit strange but better then returning an empty list */ + PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); } PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&itemptr)); @@ -4030,7 +4103,8 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args return pyrna_struct_CreatePyObject(&newptr); } else if (PyTuple_Check(key_ob)) { - PyObject *ret= pyrna_prop_collection_subscript_str_lib_pair(self, key_ob, "bpy_prop_collection.get((id, lib))", FALSE); + PyObject *ret= pyrna_prop_collection_subscript_str_lib_pair(self, key_ob, + "bpy_prop_collection.get((id, lib))", FALSE); if (ret) { return ret; } @@ -4066,10 +4140,12 @@ static void foreach_attr_type( BPy_PropertyRNA *self, const char *attr, /* pyrna_prop_collection_foreach_get/set both use this */ static int foreach_parse_args( - BPy_PropertyRNA *self, PyObject *args, + BPy_PropertyRNA *self, PyObject *args, /*values to assign */ - const char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed) + const char **attr, PyObject **seq, int *tot, int *size, + RawPropertyType *raw_type, int *attr_tot, int *attr_signed + ) { #if 0 int array_tot; @@ -4748,7 +4824,8 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject const char *fn; int lineno; PyC_FileAndNum(&fn, &lineno); - printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno); + printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n", + RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno); } */ @@ -5899,7 +5976,9 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) // if (!descr) descr= "(no docs)"; // "__doc__", descr - if (RNA_struct_idprops_check(srna) && !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) { + if ( RNA_struct_idprops_check(srna) && + !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) + { metaclass= (PyObject *)&pyrna_struct_meta_idprop_Type; } else { @@ -5907,7 +5986,8 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) } /* always use O not N when calling, N causes refcount errors */ - newclass= PyObject_CallFunction(metaclass, (char *)"s(O){sss()}", idname, py_base, "__module__","bpy.types", "__slots__"); + newclass= PyObject_CallFunction(metaclass, (char *)"s(O){sss()}", + idname, py_base, "__module__","bpy.types", "__slots__"); /* newclass will now have 2 ref's, ???, probably 1 is internal since decrefing here segfaults */ @@ -6535,7 +6615,8 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun arg_count= ((PyCodeObject *)PyFunction_GET_CODE(item))->co_argcount; /* note, the number of args we check for and the number of args we give to - * @classmethods are different (quirk of python), this is why rna_function_arg_count() doesn't return the value -1*/ + * @classmethods are different (quirk of python), + * this is why rna_function_arg_count() doesn't return the value -1*/ if (flag & FUNC_NO_SELF) func_arg_count++; @@ -6870,7 +6951,9 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param /* only useful for single argument returns, we'll need another list loop for multiple */ if (flag & PROP_OUTPUT) { - err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:"); + err= pyrna_py_to_prop(&funcptr, parm, iter.data, + PyTuple_GET_ITEM(ret, i++), + "calling class function:"); if (err) { break; } @@ -7069,7 +7152,8 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class identifier= ((PyTypeObject*)py_class)->tp_name; - srna_new= reg(CTX_data_main(C), &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free); + srna_new= reg(CTX_data_main(C), &reports, py_class, identifier, + bpy_class_validate, bpy_class_call, bpy_class_free); if (BPy_reports_to_error(&reports, PyExc_RuntimeError, TRUE) == -1) return NULL; @@ -7167,7 +7251,9 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla unreg= RNA_struct_unregister(srna); if (!unreg) { - PyErr_SetString(PyExc_ValueError, "unregister_class(...): expected a Type subclassed from a registerable rna type (no unregister supported)"); + PyErr_SetString(PyExc_ValueError, + "unregister_class(...): " + "expected a Type subclassed from a registerable rna type (no unregister supported)"); return NULL; } diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index edc6e672238..8f88814b3e4 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -55,8 +55,9 @@ #define FALSE 0 /* for keyframes and drivers */ -static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefix, const char *path, - const char **path_full, int *index) +static int pyrna_struct_anim_args_parse( + PointerRNA *ptr, const char *error_prefix, const char *path, + const char **path_full, int *index) { const int is_idbase= RNA_struct_is_ID(ptr->type); PropertyRNA *prop; @@ -146,8 +147,9 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi } /* internal use for insert and delete */ -static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, - const char **path_full, int *index, float *cfra, const char **group_name) /* return values */ +static int pyrna_struct_keyframe_parse( + PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, + const char **path_full, int *index, float *cfra, const char **group_name) /* return values */ { static const char *kwlist[]= {"data_path", "index", "frame", "group", NULL}; const char *path; diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 73e9e0a44d9..1d1cab1c66d 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -176,7 +176,8 @@ static int count_items(PyObject *seq, int dim) } /* Modifies property array length if needed and PROP_DYNAMIC flag is set. */ -static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int *totitem, const char *error_prefix) +static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, int *totitem, const char *error_prefix) { int dimsize[MAX_ARRAY_DIMENSION]; int tot, totdim, len; @@ -249,7 +250,9 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA return 0; } -static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, const char *error_prefix) +static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, + const char *error_prefix) { int dimsize[MAX_ARRAY_DIMENSION]; int totdim= RNA_property_array_dimension(ptr, prop, dimsize); @@ -262,7 +265,9 @@ static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, return validate_array_length(rvalue, ptr, prop, lvalue_dim, totitem, error_prefix); } -static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *prop, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) +static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *prop, + char *data, unsigned int item_size, int *index, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) { if (!data) { char value[sizeof(int)]; @@ -279,7 +284,9 @@ static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *pro return data; } -static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) +static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, + int dim, char *data, unsigned int item_size, int *index, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) { int totdim= RNA_property_array_dimension(ptr, prop, NULL); const Py_ssize_t seq_size= PySequence_Size(seq); @@ -320,7 +327,9 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int return data; } -static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) +static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, + char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, + ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) { /*int totdim, dim_size[MAX_ARRAY_DIMENSION];*/ int totitem; @@ -372,7 +381,10 @@ static int py_to_array(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char * return 0; } -static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int arrayoffset, int index, ItemTypeCheckFunc check_item_type, const char *item_type_str, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) +static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, + int lvalue_dim, int arrayoffset, int index, + ItemTypeCheckFunc check_item_type, const char *item_type_str, + ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) { int totdim, dimsize[MAX_ARRAY_DIMENSION]; int totitem, i; @@ -465,18 +477,22 @@ static void bool_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void * RNA_property_boolean_set_index(ptr, prop, index, *(int*)value); } -int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix) +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, + PyObject *py, const char *error_prefix) { int ret; switch (RNA_property_type(prop)) { case PROP_FLOAT: - ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), + py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); break; case PROP_INT: - ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), + py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); break; case PROP_BOOLEAN: - ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), + py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); break; default: PyErr_SetString(PyExc_TypeError, "not an array type"); @@ -486,18 +502,22 @@ int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyOb return ret; } -int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix) +int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, + PyObject *py, const char *error_prefix) { int ret; switch (RNA_property_type(prop)) { case PROP_FLOAT: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_float_check, "float", py_to_float, float_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_float_check, "float", py_to_float, float_set_index, error_prefix); break; case PROP_INT: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_int_check, "int", py_to_int, int_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_int_check, "int", py_to_int, int_set_index, error_prefix); break; case PROP_BOOLEAN: - ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix); + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, + py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix); break; default: PyErr_SetString(PyExc_TypeError, "not an array type"); diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index 5045f6708b5..599c4312985 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -146,7 +146,10 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset) PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */ PyErr_Print(); - for (tb= (PyTracebackObject *)PySys_GetObject("last_traceback"); tb && (PyObject *)tb != Py_None; tb= tb->tb_next) { + for (tb= (PyTracebackObject *)PySys_GetObject("last_traceback"); + tb && (PyObject *)tb != Py_None; + tb= tb->tb_next) + { PyObject *coerce; const char *tb_filepath= traceback_filepath(tb, &coerce); const int match= strcmp(tb_filepath, filepath) != 0; diff --git a/source/blender/python/intern/gpu.h b/source/blender/python/intern/gpu.h index 95656e7e147..bffbae13ba2 100644 --- a/source/blender/python/intern/gpu.h +++ b/source/blender/python/intern/gpu.h @@ -1,21 +1,18 @@ /* * ***** BEGIN GPL LICENSE BLOCK ***** * - * This shader is free software; you can redistribute it and/or + * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * of the License, or (at your option) any later version. * - * This shader is distributed in the hope that it will be useful, + * 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 shader; if not, write to the Free Software Foundation, + * 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) 2005 Blender Foundation. diff --git a/source/blender/python/mathutils/CMakeLists.txt b/source/blender/python/mathutils/CMakeLists.txt index b28496d612e..dae1c665ebc 100644 --- a/source/blender/python/mathutils/CMakeLists.txt +++ b/source/blender/python/mathutils/CMakeLists.txt @@ -38,6 +38,7 @@ set(SRC mathutils_Quaternion.c mathutils_Vector.c mathutils_geometry.c + mathutils_noise.c mathutils.h mathutils_Color.h @@ -46,6 +47,7 @@ set(SRC mathutils_Quaternion.h mathutils_Vector.h mathutils_geometry.h + mathutils_noise.h ) diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index 41c1568dbde..121c5e26e73 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -39,7 +39,9 @@ PyDoc_STRVAR(M_Mathutils_doc, "This module provides access to matrices, eulers, quaternions and vectors." ); -static int mathutils_array_parse_fast(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix) +static int mathutils_array_parse_fast(float *array, + int array_min, int array_max, + PyObject *value, const char *error_prefix) { PyObject *value_fast= NULL; PyObject *item; @@ -72,7 +74,9 @@ static int mathutils_array_parse_fast(float *array, int array_min, int array_max i= size; do { i--; - if (((array[i]= PyFloat_AsDouble((item= PySequence_Fast_GET_ITEM(value_fast, i)))) == -1.0f) && PyErr_Occurred()) { + if ( ((array[i]= PyFloat_AsDouble((item= PySequence_Fast_GET_ITEM(value_fast, i)))) == -1.0f) && + PyErr_Occurred()) + { PyErr_Format(PyExc_TypeError, "%.200s: sequence index %d expected a number, " "found '%.200s' type, ", @@ -347,6 +351,7 @@ PyMODINIT_FUNC PyInit_mathutils(void) { PyObject *submodule; PyObject *item; + PyObject *sys_modules= PyThreadState_GET()->interp->modules; if (PyType_Ready(&vector_Type) < 0) return NULL; @@ -373,7 +378,12 @@ PyMODINIT_FUNC PyInit_mathutils(void) /* XXX, python doesnt do imports with this usefully yet * 'from mathutils.geometry import PolyFill' * ...fails without this. */ - PyDict_SetItemString(PyThreadState_GET()->interp->modules, "mathutils.geometry", item); + PyDict_SetItemString(sys_modules, "mathutils.geometry", item); + Py_INCREF(item); + + /* Noise submodule */ + PyModule_AddObject(submodule, "noise", (item=PyInit_mathutils_noise())); + PyDict_SetItemString(sys_modules, "mathutils.noise", item); Py_INCREF(item); mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb); diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h index 70b0ef93ebd..a8170b8145c 100644 --- a/source/blender/python/mathutils/mathutils.h +++ b/source/blender/python/mathutils/mathutils.h @@ -40,24 +40,30 @@ extern char BaseMathObject_Wrapped_doc[]; extern char BaseMathObject_Owner_doc[]; -#define BASE_MATH_MEMBERS(_data) \ - PyObject_VAR_HEAD \ - float *_data; /* array of data (alias), wrapped status depends on wrapped status */ \ - PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ \ - unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ \ - unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ \ - unsigned char wrapped; /* wrapped data type? */ \ +#define BASE_MATH_MEMBERS(_data) \ + PyObject_VAR_HEAD \ + float *_data; /* array of data (alias), wrapped status depends on wrapped status */ \ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, \ + * *Note* this owns its reference */ \ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ \ + unsigned char cb_subtype; /* subtype: location, rotation... \ + * to avoid defining many new functions for every attribute of the same type */ \ + unsigned char wrapped /* wrapped data type? */ \ typedef struct { - BASE_MATH_MEMBERS(data) + BASE_MATH_MEMBERS(data); } BaseMathObject; +/* types */ #include "mathutils_Vector.h" #include "mathutils_Matrix.h" #include "mathutils_Quaternion.h" #include "mathutils_Euler.h" #include "mathutils_Color.h" + +/* utility submodules */ #include "mathutils_geometry.h" +#include "mathutils_noise.h" PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * ); PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * ); @@ -76,11 +82,11 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); typedef struct Mathutils_Callback Mathutils_Callback; -typedef int (*BaseMathCheckFunc)(BaseMathObject *); /* checks the user is still valid */ -typedef int (*BaseMathGetFunc)(BaseMathObject *, int); /* gets the vector from the user */ -typedef int (*BaseMathSetFunc)(BaseMathObject *, int); /* sets the users vector values once the vector is modified */ -typedef int (*BaseMathGetIndexFunc)(BaseMathObject *, int, int); /* same as above but only for an index */ -typedef int (*BaseMathSetIndexFunc)(BaseMathObject *, int, int); /* same as above but only for an index */ +typedef int (*BaseMathCheckFunc)(BaseMathObject *); /* checks the user is still valid */ +typedef int (*BaseMathGetFunc)(BaseMathObject *, int); /* gets the vector from the user */ +typedef int (*BaseMathSetFunc)(BaseMathObject *, int); /* sets the users vector values once its modified */ +typedef int (*BaseMathGetIndexFunc)(BaseMathObject *, int, int); /* same as above but only for an index */ +typedef int (*BaseMathSetIndexFunc)(BaseMathObject *, int, int); /* same as above but only for an index */ struct Mathutils_Callback { BaseMathCheckFunc check; @@ -98,10 +104,14 @@ int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index); int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index); /* since this is called so often avoid where possible */ -#define BaseMath_ReadCallback(_self) (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self):0)) -#define BaseMath_WriteCallback(_self) (((_self)->cb_user ?_BaseMathObject_WriteCallback((BaseMathObject *)_self):0)) -#define BaseMath_ReadIndexCallback(_self, _index) (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index):0)) -#define BaseMath_WriteIndexCallback(_self, _index) (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index):0)) +#define BaseMath_ReadCallback(_self) \ + (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self):0)) +#define BaseMath_WriteCallback(_self) \ + (((_self)->cb_user ?_BaseMathObject_WriteCallback((BaseMathObject *)_self):0)) +#define BaseMath_ReadIndexCallback(_self, _index) \ + (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index):0)) +#define BaseMath_WriteIndexCallback(_self, _index) \ + (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index):0)) /* utility func */ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix); diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h index f218d653ec9..7e8a99089ad 100644 --- a/source/blender/python/mathutils/mathutils_Color.h +++ b/source/blender/python/mathutils/mathutils_Color.h @@ -39,7 +39,7 @@ extern PyTypeObject color_Type; #define ColorObject_Check(_v) PyObject_TypeCheck((_v), &color_Type) typedef struct { - BASE_MATH_MEMBERS(col) + BASE_MATH_MEMBERS(col); } ColorObject; /*struct data contains a pointer to the actual data that the diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 9bf6687fb5e..7e769da14cb 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -264,8 +264,11 @@ static PyObject *Euler_make_compatible(EulerObject * self, PyObject *value) if (BaseMath_ReadCallback(self) == -1) return NULL; - if (mathutils_array_parse(teul, EULER_SIZE, EULER_SIZE, value, "euler.make_compatible(other), invalid 'other' arg") == -1) + if (mathutils_array_parse(teul, EULER_SIZE, EULER_SIZE, value, + "euler.make_compatible(other), invalid 'other' arg") == -1) + { return NULL; + } compatible_eul(self->eul, teul); diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h index 5760d08e1f6..130384a1792 100644 --- a/source/blender/python/mathutils/mathutils_Euler.h +++ b/source/blender/python/mathutils/mathutils_Euler.h @@ -39,7 +39,7 @@ extern PyTypeObject euler_Type; #define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type) typedef struct { - BASE_MATH_MEMBERS(eul) + BASE_MATH_MEMBERS(eul); unsigned char order; /* rotation order */ } EulerObject; diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 2f62f7141cf..ea636ef52fb 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -125,7 +125,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) switch(PyTuple_GET_SIZE(args)) { case 0: - return (PyObject *) Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, type); + return Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, type); case 1: { PyObject *arg= PyTuple_GET_ITEM(args, 0); @@ -478,7 +478,9 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) int vec_size= (matSize == 2 ? 2 : 3); float tvec[4]; - if (mathutils_array_parse(tvec, vec_size, vec_size, axis, "Matrix.OrthoProjection(axis, size), invalid 'axis' arg") == -1) { + if (mathutils_array_parse(tvec, vec_size, vec_size, axis, + "Matrix.OrthoProjection(axis, size), invalid 'axis' arg") == -1) + { return NULL; } @@ -827,12 +829,12 @@ static PyObject *Matrix_to_4x4(MatrixObject *self) return NULL; if (self->col_size==4 && self->row_size==4) { - return (PyObject *)Matrix_CreatePyObject(self->contigPtr, 4, 4, Py_NEW, Py_TYPE(self)); + return Matrix_CreatePyObject(self->contigPtr, 4, 4, Py_NEW, Py_TYPE(self)); } else if (self->col_size==3 && self->row_size==3) { float mat[4][4]; copy_m4_m3(mat, (float (*)[3])self->contigPtr); - return (PyObject *)Matrix_CreatePyObject((float *)mat, 4, 4, Py_NEW, Py_TYPE(self)); + return Matrix_CreatePyObject((float *)mat, 4, 4, Py_NEW, Py_TYPE(self)); } /* TODO, 2x2 matrix */ @@ -1133,7 +1135,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args) return NULL; } - return (PyObject*)Matrix_CreatePyObject(mat, self->row_size, self->col_size, Py_NEW, Py_TYPE(self)); + return Matrix_CreatePyObject(mat, self->row_size, self->col_size, Py_NEW, Py_TYPE(self)); } /*---------------------------matrix.determinant() ----------------*/ @@ -1286,7 +1288,7 @@ static PyObject *Matrix_copy(MatrixObject *self) if (BaseMath_ReadCallback(self) == -1) return NULL; - return (PyObject*)Matrix_CreatePyObject((float (*))self->contigPtr, self->row_size, self->col_size, Py_NEW, Py_TYPE(self)); + return Matrix_CreatePyObject((float (*))self->contigPtr, self->row_size, self->col_size, Py_NEW, Py_TYPE(self)); } /*----------------------------print object (internal)-------------*/ @@ -1470,7 +1472,9 @@ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *va /*parse each sub sequence*/ PyObject *item= PySequence_Fast_GET_ITEM(value_fast, i); - if (mathutils_array_parse(&mat[i * self->col_size], self->col_size, self->col_size, item, "matrix[begin:end] = value assignment") < 0) { + if (mathutils_array_parse(&mat[i * self->col_size], self->col_size, self->col_size, item, + "matrix[begin:end] = value assignment") < 0) + { return -1; } } @@ -1956,7 +1960,9 @@ self->matrix[1][1] = self->contigPtr[4] */ (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *Matrix_CreatePyObject(float *mat, const unsigned short rowSize, const unsigned short colSize, int type, PyTypeObject *base_type) +PyObject *Matrix_CreatePyObject(float *mat, + const unsigned short rowSize, const unsigned short colSize, + int type, PyTypeObject *base_type) { MatrixObject *self; int x, row, col; diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h index d1984d7299d..6dfcbb1faf9 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.h +++ b/source/blender/python/mathutils/mathutils_Matrix.h @@ -39,7 +39,7 @@ extern PyTypeObject matrix_Type; #define MATRIX_MAX_DIM 4 typedef struct { - BASE_MATH_MEMBERS(contigPtr) + BASE_MATH_MEMBERS(contigPtr); float *matrix[MATRIX_MAX_DIM]; /* ptr to the contigPtr (accessor) */ unsigned short row_size; unsigned short col_size; @@ -51,7 +51,9 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ /*prototypes*/ -PyObject *Matrix_CreatePyObject(float *mat, const unsigned short row_size, const unsigned short col_size, int type, PyTypeObject *base_type); +PyObject *Matrix_CreatePyObject(float *mat, + const unsigned short row_size, const unsigned short col_size, + int type, PyTypeObject *base_type); PyObject *Matrix_CreatePyObject_cb(PyObject *user, int row_size, int col_size, int cb_type, int cb_subtype); extern int mathutils_matrix_vector_cb_index; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 44cd28a7c3d..cf817003a98 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -218,8 +218,11 @@ static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value) if (BaseMath_ReadCallback(self) == -1) return NULL; - if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.dot(other), invalid 'other' arg") == -1) + if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, + "Quaternion.dot(other), invalid 'other' arg") == -1) + { return NULL; + } return PyFloat_FromDouble(dot_qtqt(self->quat, tquat)); } @@ -241,8 +244,11 @@ static PyObject *Quaternion_rotation_difference(QuaternionObject *self, PyObject if (BaseMath_ReadCallback(self) == -1) return NULL; - if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.difference(other), invalid 'other' arg") == -1) + if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, + "Quaternion.difference(other), invalid 'other' arg") == -1) + { return NULL; + } rotation_between_quats_to_quat(quat, self->quat, tquat); @@ -276,8 +282,11 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args) if (BaseMath_ReadCallback(self) == -1) return NULL; - if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.slerp(other), invalid 'other' arg") == -1) + if (mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, + "Quaternion.slerp(other), invalid 'other' arg") == -1) + { return NULL; + } if (fac > 1.0f || fac < 0.0f) { PyErr_SetString(PyExc_ValueError, @@ -982,7 +991,7 @@ static PyObject *Quaternion_getAxisVec(QuaternionObject *self, void *UNUSED(clos quat__axis_angle_sanitize(axis, NULL); - return (PyObject *) Vector_CreatePyObject(axis, 3, Py_NEW, NULL); + return Vector_CreatePyObject(axis, 3, Py_NEW, NULL); } static int Quaternion_setAxisVec(QuaternionObject *self, PyObject *value, void *UNUSED(closure)) @@ -1054,7 +1063,7 @@ static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObjec PyObject *ret_dummy= quat_func(ret); if (ret_dummy) { Py_DECREF(ret_dummy); - return (PyObject *)ret; + return ret; } else { /* error */ Py_DECREF(ret); diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h index a34720769fa..edd5ec55312 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.h +++ b/source/blender/python/mathutils/mathutils_Quaternion.h @@ -39,7 +39,7 @@ extern PyTypeObject quaternion_Type; #define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type) typedef struct { - BASE_MATH_MEMBERS(quat) + BASE_MATH_MEMBERS(quat); } QuaternionObject; /*struct data contains a pointer to the actual data that the diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 1dff33887e3..9d1a22adb12 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -589,10 +589,10 @@ PyDoc_STRVAR(Vector_angle_doc, ); static PyObject *Vector_angle(VectorObject *self, PyObject *args) { - const int size= self->size; + const int size= MIN2(self->size, 3); /* 4D angle makes no sense */ float tvec[MAX_DIMENSIONS]; PyObject *value; - double dot = 0.0f, test_v1 = 0.0f, test_v2 = 0.0f; + double dot= 0.0f, dot_self= 0.0f, dot_other= 0.0f; int x; PyObject *fallback= NULL; @@ -602,14 +602,18 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args) if (BaseMath_ReadCallback(self) == -1) return NULL; - if (mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1) + /* don't use clamped size, rule of thumb is vector sizes must match, + * even though n this case 'w' is ignored */ + if (mathutils_array_parse(tvec, self->size, self->size, value, "Vector.angle(other), invalid 'other' arg") == -1) return NULL; for (x = 0; x < size; x++) { - test_v1 += (double)(self->vec[x] * self->vec[x]); - test_v2 += (double)(tvec[x] * tvec[x]); + dot_self += (double)self->vec[x] * (double)self->vec[x]; + dot_other += (double)tvec[x] * (double)tvec[x]; + dot += (double)self->vec[x] * (double)tvec[x]; } - if (!test_v1 || !test_v2) { + + if (!dot_self || !dot_other) { /* avoid exception */ if (fallback) { Py_INCREF(fallback); @@ -623,13 +627,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args) } } - //dot product - for (x = 0; x < self->size; x++) { - dot += (double)(self->vec[x] * tvec[x]); - } - dot /= (sqrt(test_v1) * sqrt(test_v2)); - - return PyFloat_FromDouble(saacos(dot)); + return PyFloat_FromDouble(saacos(dot / (sqrt(dot_self) * sqrt(dot_other)))); } PyDoc_STRVAR(Vector_rotation_difference_doc, @@ -1755,7 +1753,10 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure) size_from= axis_from; } - else if (PyErr_Clear(), (size_from=mathutils_array_parse(vec_assign, 2, 4, value, "mathutils.Vector.**** = swizzle assignment")) == -1) { + else if ( (PyErr_Clear()), /* run but ignore the result */ + (size_from=mathutils_array_parse(vec_assign, 2, 4, value, + "mathutils.Vector.**** = swizzle assignment")) == -1) + { return -1; } diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h index c1550aabb25..0f7fa174d18 100644 --- a/source/blender/python/mathutils/mathutils_Vector.h +++ b/source/blender/python/mathutils/mathutils_Vector.h @@ -39,7 +39,7 @@ extern PyTypeObject vector_Type; #define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type) typedef struct { - BASE_MATH_MEMBERS(vec) + BASE_MATH_MEMBERS(vec); unsigned char size; /* vec size 2,3 or 4 */ } VectorObject; diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c new file mode 100644 index 00000000000..bd490d62e94 --- /dev/null +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -0,0 +1,911 @@ +/* + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * This is a new part of Blender. + * + * Contributor(s): eeshlo, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/python/mathutils/mathutils_noise.c + * \ingroup mathutils + * + * This file defines the 'noise' module, a general purpose module to access + * blenders noise functions. + */ + + +/************************/ +/* Blender Noise Module */ +/************************/ + +#include <Python.h> + +#include "structseq.h" + +#include "BLI_blenlib.h" +#include "BLI_math.h" +#include "BLI_utildefines.h" + +#include "MEM_guardedalloc.h" + +#include "DNA_texture_types.h" + +#include "mathutils.h" +#include "mathutils_noise.h" + +/* 2.6 update + * Moved to submodule of mathutils. + * All vector functions now return mathutils.Vector + * Updated docs to be compatible with autodocs generation. + * Updated vector functions to use nD array functions. + * noise.vl_vector --> noise.variable_lacunarity + * noise.vector --> noise.noise_vector + */ + +/*-----------------------------------------*/ +/* 'mersenne twister' random number generator */ + +/* + A C-program for MT19937, with initialization improved 2002/2/10. + Coded by Takuji Nishimura and Makoto Matsumoto. + This is a faster version by taking Shawn Cokus's optimization, + Matthe Bellew's simplification, Isaku Wada's real version. + + Before using, initialize the state by using init_genrand(seed) + or init_by_array(init_key, key_length). + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Any feedback is very welcome. + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) +*/ + +/* Period parameters */ +#define N 624 +#define M 397 +#define MATRIX_A 0x9908b0dfUL /* constant vector a */ +#define UMASK 0x80000000UL /* most significant w-r bits */ +#define LMASK 0x7fffffffUL /* least significant r bits */ +#define MIXBITS(u,v) (((u) & UMASK) | ((v) & LMASK)) +#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL)) + +static unsigned long state[N]; /* the array for the state vector */ +static int left = 1; +static int initf = 0; +static unsigned long *next; + +/* initializes state[N] with a seed */ +static void init_genrand(unsigned long s) +{ + int j; + state[0] = s & 0xffffffffUL; + for (j = 1; j < N; j++) { + state[j] = + (1812433253UL * + (state[j - 1] ^ (state[j - 1] >> 30)) + j); + /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ + /* In the previous versions, MSBs of the seed affect */ + /* only MSBs of the array state[]. */ + /* 2002/01/09 modified by Makoto Matsumoto */ + state[j] &= 0xffffffffUL; /* for >32 bit machines */ + } + left = 1; + initf = 1; +} + +static void next_state(void) +{ + unsigned long *p = state; + int j; + + /* if init_genrand() has not been called, */ + /* a default initial seed is used */ + if (initf == 0) + init_genrand(5489UL); + + left = N; + next = state; + + for (j = N - M + 1; --j; p++) + *p = p[M] ^ TWIST(p[0], p[1]); + + for (j = M; --j; p++) + *p = p[M - N] ^ TWIST(p[0], p[1]); + + *p = p[M - N] ^ TWIST(p[0], state[0]); +} + +/*------------------------------------------------------------*/ + +static void setRndSeed(int seed) +{ + if (seed == 0) + init_genrand(time(NULL)); + else + init_genrand(seed); +} + +/* float number in range [0, 1) using the mersenne twister rng */ +static float frand(void) +{ + unsigned long y; + + if (--left == 0) + next_state(); + y = *next++; + + /* Tempering */ + y ^= (y >> 11); + y ^= (y << 7) & 0x9d2c5680UL; + y ^= (y << 15) & 0xefc60000UL; + y ^= (y >> 18); + + return (float) y / 4294967296.f; +} + +/*------------------------------------------------------------*/ +/* Utility Functions */ +/*------------------------------------------------------------*/ + +/* Fills an array of length size with random numbers in the range (-1, 1)*/ +static void rand_vn(float *array_tar, const int size) +{ + float *array_pt= array_tar + (size-1); + int i= size; + while(i--) { *(array_pt--) = 2.0f * frand() - 1.0f; } +} + +/* Fills an array of length 3 with noise values */ +static void noise_vector(float x, float y, float z, int nb, float v[3]) +{ + /* Simply evaluate noise at 3 different positions */ + v[0]= (float)(2.0f * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0, nb) - 1.0f); + v[1]= (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f); + v[2]= (float)(2.0f * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0, nb) - 1.0f); +} + +/* Returns a turbulence value for a given position (x, y, z) */ +static float turb(float x, float y, float z, int oct, int hard, int nb, + float ampscale, float freqscale) +{ + float amp, out, t; + int i; + amp = 1.f; + out = (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f); + if (hard) + out = fabsf(out); + for (i = 1; i < oct; i++) { + amp *= ampscale; + x *= freqscale; + y *= freqscale; + z *= freqscale; + t = (float)(amp * (2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f)); + if (hard) + t = fabsf(t); + out += t; + } + return out; +} + +/* Fills an array of length 3 with the turbulence vector for a given +position (x, y, z) */ +static void vTurb(float x, float y, float z, int oct, int hard, int nb, + float ampscale, float freqscale, float v[3]) +{ + float amp, t[3]; + int i; + amp = 1.f; + noise_vector(x, y, z, nb, v); + if (hard) { + v[0] = fabsf(v[0]); + v[1] = fabsf(v[1]); + v[2] = fabsf(v[2]); + } + for (i = 1; i < oct; i++) { + amp *= ampscale; + x *= freqscale; + y *= freqscale; + z *= freqscale; + noise_vector(x, y, z, nb, t); + if (hard) { + t[0] = fabsf(t[0]); + t[1] = fabsf(t[1]); + t[2] = fabsf(t[2]); + } + v[0] += amp * t[0]; + v[1] += amp * t[1]; + v[2] += amp * t[2]; + } +} + +/*-------------------------DOC STRINGS ---------------------------*/ +PyDoc_STRVAR(M_Noise_doc, +"The Blender noise module" +); + +/*------------------------------------------------------------*/ +/* Python Functions */ +/*------------------------------------------------------------*/ + +PyDoc_STRVAR(M_Noise_random_doc, +".. function:: random()\n" +"\n" +" Returns a random number in the range [0, 1].\n" +"\n" +" :return: The random number.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_random(PyObject *UNUSED(self)) +{ + return PyFloat_FromDouble(frand()); +} + +PyDoc_STRVAR(M_Noise_random_unit_vector_doc, +".. function:: random_unit_vector(size=3)\n" +"\n" +" Returns a unit vector with random entries.\n" +"\n" +" :arg size: The size of the vector to be produced.\n" +" :type size: Int\n" +" :return: The random unit vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *M_Noise_random_unit_vector(PyObject *UNUSED(self), PyObject *args) +{ + float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + float norm= 2.0f; + int size= 3; + + if (!PyArg_ParseTuple(args, "|i:random_vector", &size)) + return NULL; + + if (size > 4 || size < 2) { + PyErr_SetString(PyExc_ValueError, "Vector(): invalid size"); + return NULL; + } + + while (norm==0.0f || norm>=1.0f) { + rand_vn(vec, size); + norm= normalize_vn(vec, size); + } + + return Vector_CreatePyObject(vec, size, Py_NEW, NULL); +} +/* This is dumb, most people will want a unit vector anyway, since this doesn't have uniform distribution over a sphere*/ +/* +PyDoc_STRVAR(M_Noise_random_vector_doc, +".. function:: random_vector(size=3)\n" +"\n" +" Returns a vector with random entries in the range [0, 1).\n" +"\n" +" :arg size: The size of the vector to be produced.\n" +" :type size: Int\n" +" :return: The random vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *M_Noise_random_vector(PyObject *UNUSED(self), PyObject *args) +{ + float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f}; + int size= 3; + + if (!PyArg_ParseTuple(args, "|i:random_vector", &size)) + return NULL; + + if (size > 4 || size < 2) { + PyErr_SetString(PyExc_ValueError, "Vector(): invalid size"); + return NULL; + } + + rand_vn(vec, size); + + return Vector_CreatePyObject(vec, size, Py_NEW, NULL); +} +*/ + +PyDoc_STRVAR(M_Noise_seed_set_doc, +".. function:: seed_set(seed)\n" +"\n" +" Sets the random seed used for random_unit_vector, random_vector and random.\n" +"\n" +" :arg seed: Seed used for the random generator.\n" +" :type seed: Int\n" +); +static PyObject *M_Noise_seed_set(PyObject *UNUSED(self), PyObject *args) +{ + int s; + if (!PyArg_ParseTuple(args, "i:seed_set", &s)) + return NULL; + setRndSeed(s); + Py_RETURN_NONE; +} + +PyDoc_STRVAR(M_Noise_noise_doc, +".. function:: noise(position, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns noise value from the noise basis at the position specified.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The noise value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_noise(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + int nb= 1; + if (!PyArg_ParseTuple(args, "O|i:noise", &value, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "noise: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble((2.0f * BLI_gNoise(1.0f, vec[0], vec[1], vec[2], 0, nb) - 1.0f)); +} + +PyDoc_STRVAR(M_Noise_noise_vector_doc, +".. function:: noise_vector(position, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns the noise vector from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The noise vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *M_Noise_noise_vector(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3], r_vec[3]; + int nb= 1; + + if (!PyArg_ParseTuple(args, "O|i:noise_vector", &value, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "noise_vector: invalid 'position' arg") == -1) + return NULL; + + noise_vector(vec[0], vec[1], vec[2], nb, r_vec); + + return Vector_CreatePyObject(r_vec, 3, Py_NEW, NULL); +} + +PyDoc_STRVAR(M_Noise_turbulence_doc, +".. function:: turbulence(position, octaves, hard, noise_basis=noise.types.STDPERLIN, amplitude_scale=0.5, frequency_scale=2.0)\n" +"\n" +" Returns the turbulence value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or soft (smooth transitions).\n" +" :type hard: :boolean\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in mathutils.noise.types or int\n" +" :arg amplitude_scale: The amplitude scaling factor.\n" +" :type amplitude_scale: float\n" +" :arg frequency_scale: The frequency scaling factor\n" +" :type frequency_scale: Value in noise.types or int\n" +" :return: The turbulence value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_turbulence(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + int oct, hd, nb= 1; + float as= 0.5f, fs= 2.0f; + + if (!PyArg_ParseTuple(args, "Oii|iff:turbulence", &value, &oct, &hd, &nb, &as, &fs)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "turbulence: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(turb(vec[0], vec[1], vec[2], oct, hd, nb, as, fs)); +} + +PyDoc_STRVAR(M_Noise_turbulence_vector_doc, +".. function:: turbulence_vector(position, octaves, hard, noise_basis=noise.types.STDPERLIN, amplitude_scale=0.5, frequency_scale=2.0)\n" +"\n" +" Returns the turbulence vector from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or soft (smooth transitions).\n" +" :type hard: :boolean\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in mathutils.noise.types or int\n" +" :arg amplitude_scale: The amplitude scaling factor.\n" +" :type amplitude_scale: float\n" +" :arg frequency_scale: The frequency scaling factor\n" +" :type frequency_scale: Value in noise.types or int\n" +" :return: The turbulence vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *M_Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3], r_vec[3]; + int oct, hd, nb= 1; + float as =0.5f, fs= 2.0f; + if (!PyArg_ParseTuple(args, "Oii|iff:turbulence_vector", &value, &oct, &hd, &nb, &as, &fs)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "turbulence_vector: invalid 'position' arg") == -1) + return NULL; + + vTurb(vec[0], vec[1], vec[2], oct, hd, nb, as, fs, r_vec); + return Vector_CreatePyObject(r_vec, 3, Py_NEW, NULL); +} + +/* F. Kenton Musgrave's fractal functions */ +PyDoc_STRVAR(M_Noise_fractal_doc, +".. function:: fractal(position, H, lacunarity, octaves, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns the fractal Brownian motion (fBm) noise value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg H: The fractal increment factor.\n" +" :type H: float\n" +" :arg lacunarity: The gap between successive frequencies.\n" +" :type lacunarity: float\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The fractal Brownian motion noise value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_fractal(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float H, lac, oct; + int nb= 1; + + if (!PyArg_ParseTuple(args, "Offf|i:fractal", &value, &H, &lac, &oct, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "fractal: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_fBm(vec[0], vec[1], vec[2], H, lac, oct, nb)); +} + +PyDoc_STRVAR(M_Noise_multi_fractal_doc, +".. function:: multi_fractal(position, H, lacunarity, octaves, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns multifractal noise value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg H: The fractal increment factor.\n" +" :type H: float\n" +" :arg lacunarity: The gap between successive frequencies.\n" +" :type lacunarity: float\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The multifractal noise value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float H, lac, oct; + int nb= 1; + + if (!PyArg_ParseTuple(args, "Offf|i:multi_fractal", &value, &H, &lac, &oct, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "multi_fractal: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_MultiFractal(vec[0], vec[1], vec[2], H, lac, oct, nb)); +} + +PyDoc_STRVAR(M_Noise_variable_lacunarity_doc, +".. function:: variable_lacunarity(position, distortion, noise_type1=noise.types.STDPERLIN, noise_type2=noise.types.STDPERLIN)\n" +"\n" +" Returns variable lacunarity noise value, a distorted variety of noise, from noise type 1 distorted by noise type 2 at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg distortion: The amount of distortion.\n" +" :type distortion: float\n" +" :arg noise_type1: The type of noise to be distorted.\n" +" :type noise_type1: Value in noise.types or int\n" +" :arg noise_type2: The type of noise used to distort noise_type1.\n" +" :type noise_type2: Value in noise.types or int\n" +" :return: The variable lacunarity noise value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_variable_lacunarity(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float d; + int nt1= 1, nt2= 1; + + if (!PyArg_ParseTuple(args, "Of|ii:variable_lacunarity", &value, &d, &nt1, &nt2)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "variable_lacunarity: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_VLNoise(vec[0], vec[1], vec[2], d, nt1, nt2)); +} + +PyDoc_STRVAR(M_Noise_hetero_terrain_doc, +".. function:: hetero_terrain(position, H, lacunarity, octaves, offset, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns the heterogeneous terrain value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg H: The fractal dimension of the roughest areas.\n" +" :type H: float\n" +" :arg lacunarity: The gap between successive frequencies.\n" +" :type lacunarity: float\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg offset: The height of the terrain above 'sea level'.\n" +" :type offset: float\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The heterogeneous terrain value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float H, lac, oct, ofs; + int nb= 1; + + if (!PyArg_ParseTuple(args, "Offff|i:hetero_terrain", &value, &H, &lac, &oct, &ofs, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "hetero_terrain: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_HeteroTerrain(vec[0], vec[1], vec[2], H, lac, oct, ofs, nb)); +} + +PyDoc_STRVAR(M_Noise_hybrid_multi_fractal_doc, +".. function:: hybrid_multi_fractal(position, H, lacunarity, octaves, offset, gain, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns hybrid multifractal value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg H: The fractal dimension of the roughest areas.\n" +" :type H: float\n" +" :arg lacunarity: The gap between successive frequencies.\n" +" :type lacunarity: float\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg offset: The height of the terrain above 'sea level'.\n" +" :type offset: float\n" +" :arg gain: Scaling applied to the values.\n" +" :type gain: float\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The hybrid multifractal value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float H, lac, oct, ofs, gn; + int nb= 1; + + if (!PyArg_ParseTuple(args, "Offfff|i:hybrid_multi_fractal", &value, &H, &lac, &oct, &ofs, &gn, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "hybrid_multi_fractal: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_HybridMultiFractal(vec[0], vec[1], vec[2], H, lac, oct, ofs, gn, nb)); +} + +PyDoc_STRVAR(M_Noise_ridged_multi_fractal_doc, +".. function:: ridged_multi_fractal(position, H, lacunarity, octaves, offset, gain, noise_basis=noise.types.STDPERLIN)\n" +"\n" +" Returns ridged multifractal value from the noise basis at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg H: The fractal dimension of the roughest areas.\n" +" :type H: float\n" +" :arg lacunarity: The gap between successive frequencies.\n" +" :type lacunarity: float\n" +" :arg octaves: The number of different noise frequencies used.\n" +" :type octaves: int\n" +" :arg offset: The height of the terrain above 'sea level'.\n" +" :type offset: float\n" +" :arg gain: Scaling applied to the values.\n" +" :type gain: float\n" +" :arg noise_basis: The type of noise to be evaluated.\n" +" :type noise_basis: Value in noise.types or int\n" +" :return: The ridged multifractal value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + float H, lac, oct, ofs, gn; + int nb= 1; + + if (!PyArg_ParseTuple(args, "Offfff|i:ridged_multi_fractal", &value, &H, &lac, &oct, &ofs, &gn, &nb)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "ridged_multi_fractal: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(mg_RidgedMultiFractal(vec[0], vec[1], vec[2], H, lac, oct, ofs, gn, nb)); +} + +PyDoc_STRVAR(M_Noise_voronoi_doc, +".. function:: voronoi(position, distance_metric=noise.distance_metrics.DISTANCE, exponent=2.5)\n" +"\n" +" Returns a list of distances to the four closest features and their locations.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :arg distance_metric: Method of measuring distance.\n" +" :type distance_metric: Value in noise.distance_metrics or int\n" +" :arg exponent: The exponent for Minkovsky distance metric.\n" +" :type exponent: float\n" +" :return: A list of distances to the four closest features and their locations.\n" +" :rtype: [list of four floats, list of four :class:`mathutils.Vector`s]\n" +); +static PyObject *M_Noise_voronoi(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + PyObject *list; + float vec[3]; + float da[4], pa[12]; + int dtype= 0; + float me= 2.5f; /* default minkovsky exponent */ + + int i; + + if (!PyArg_ParseTuple(args, "O|if:voronoi", &value, &dtype, &me)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "voronoi: invalid 'position' arg") == -1) + return NULL; + + list= PyList_New(4); + + voronoi(vec[0], vec[1], vec[2], da, pa, me, dtype); + + for (i=0; i<4; i++) { + PyList_SET_ITEM(list, i, Vector_CreatePyObject(pa + 3*i, 3, Py_NEW, NULL)); + } + + return Py_BuildValue("[[ffff]O]", da[0], da[1], da[2], da[3], list); +} + +PyDoc_STRVAR(M_Noise_cell_doc, +".. function:: cell(position)\n" +"\n" +" Returns cell noise value at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :return: The cell noise value.\n" +" :rtype: float\n" +); +static PyObject *M_Noise_cell(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3]; + + if (!PyArg_ParseTuple(args, "O:cell", &value)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "cell: invalid 'position' arg") == -1) + return NULL; + + return PyFloat_FromDouble(cellNoise(vec[0], vec[1], vec[2])); +} + +PyDoc_STRVAR(M_Noise_cell_vector_doc, +".. function:: cell_vector(position)\n" +"\n" +" Returns cell noise vector at the specified position.\n" +"\n" +" :arg position: The position to evaluate the selected noise function at.\n" +" :type position: :class:`mathutils.Vector`\n" +" :return: The cell noise vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *M_Noise_cell_vector(PyObject *UNUSED(self), PyObject *args) +{ + PyObject *value; + float vec[3], r_vec[3]; + + if (!PyArg_ParseTuple(args, "O:cell_vector", &value)) + return NULL; + + if (mathutils_array_parse(vec, 3, 3, value, "cell_vector: invalid 'position' arg") == -1) + return NULL; + + cellNoiseV(vec[0], vec[1], vec[2], r_vec); + return Vector_CreatePyObject(NULL, 3, Py_NEW, NULL);; +} + +static PyMethodDef M_Noise_methods[] = { + {"seed_set", (PyCFunction) M_Noise_seed_set, METH_VARARGS, M_Noise_seed_set_doc}, + {"random", (PyCFunction) M_Noise_random, METH_NOARGS, M_Noise_random_doc}, + {"random_unit_vector", (PyCFunction) M_Noise_random_unit_vector, METH_VARARGS, M_Noise_random_unit_vector_doc}, + /*{"random_vector", (PyCFunction) M_Noise_random_vector, METH_VARARGS, M_Noise_random_vector_doc},*/ + {"noise", (PyCFunction) M_Noise_noise, METH_VARARGS, M_Noise_noise_doc}, + {"noise_vector", (PyCFunction) M_Noise_noise_vector, METH_VARARGS, M_Noise_noise_vector_doc}, + {"turbulence", (PyCFunction) M_Noise_turbulence, METH_VARARGS, M_Noise_turbulence_doc}, + {"turbulence_vector", (PyCFunction) M_Noise_turbulence_vector, METH_VARARGS, M_Noise_turbulence_vector_doc}, + {"fractal", (PyCFunction) M_Noise_fractal, METH_VARARGS, M_Noise_fractal_doc}, + {"multi_fractal", (PyCFunction) M_Noise_multi_fractal, METH_VARARGS, M_Noise_multi_fractal_doc}, + {"variable_lacunarity", (PyCFunction) M_Noise_variable_lacunarity, METH_VARARGS, M_Noise_variable_lacunarity_doc}, + {"hetero_terrain", (PyCFunction) M_Noise_hetero_terrain, METH_VARARGS, M_Noise_hetero_terrain_doc}, + {"hybrid_multi_fractal", (PyCFunction) M_Noise_hybrid_multi_fractal, METH_VARARGS, M_Noise_hybrid_multi_fractal_doc}, + {"ridged_multi_fractal", (PyCFunction) M_Noise_ridged_multi_fractal, METH_VARARGS, M_Noise_ridged_multi_fractal_doc}, + {"voronoi", (PyCFunction) M_Noise_voronoi, METH_VARARGS, M_Noise_voronoi_doc}, + {"cell", (PyCFunction) M_Noise_cell, METH_VARARGS, M_Noise_cell_doc}, + {"cell_vector", (PyCFunction) M_Noise_cell_vector, METH_VARARGS, M_Noise_cell_vector_doc}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef M_Noise_module_def = { + PyModuleDef_HEAD_INIT, + "mathutils.noise", /* m_name */ + M_Noise_doc, /* m_doc */ + 0, /* m_size */ + M_Noise_methods, /* m_methods */ + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL, /* m_free */ +}; + +/*----------------------------MODULE INIT-------------------------*/ +PyMODINIT_FUNC PyInit_mathutils_noise(void) +{ + PyObject *submodule = PyModule_Create(&M_Noise_module_def); + PyObject *item_types, *item_metrics; + + /* use current time as seed for random number generator by default */ + setRndSeed(0); + + PyModule_AddObject(submodule, "types", (item_types=PyInit_mathutils_noise_types())); + PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.types", item_types); + Py_INCREF(item_types); + + PyModule_AddObject(submodule, "distance_metrics", (item_metrics=PyInit_mathutils_noise_metrics())); + PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.distance_metrics", item_metrics); + Py_INCREF(item_metrics); + + return submodule; +} + +/*----------------------------SUBMODULE INIT-------------------------*/ +static struct PyModuleDef M_NoiseTypes_module_def = { + PyModuleDef_HEAD_INIT, + "mathutils.noise.types", /* m_name */ + NULL, /* m_doc */ + 0, /* m_size */ + NULL, /* m_methods */ + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL, /* m_free */ +}; + +PyMODINIT_FUNC PyInit_mathutils_noise_types(void) +{ + PyObject *submodule = PyModule_Create(&M_NoiseTypes_module_def); + + PyModule_AddIntConstant(submodule, (char *)"BLENDER", TEX_BLENDER); + PyModule_AddIntConstant(submodule, (char *)"STDPERLIN", TEX_STDPERLIN); + PyModule_AddIntConstant(submodule, (char *)"NEWPERLIN", TEX_NEWPERLIN); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_F1", TEX_VORONOI_F1); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2", TEX_VORONOI_F2); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_F3", TEX_VORONOI_F3); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_F4", TEX_VORONOI_F4); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2F1", TEX_VORONOI_F2F1); + PyModule_AddIntConstant(submodule, (char *)"VORONOI_CRACKLE", TEX_VORONOI_CRACKLE); + PyModule_AddIntConstant(submodule, (char *)"CELLNOISE", TEX_CELLNOISE); + + return submodule; +} + +static struct PyModuleDef M_NoiseMetrics_module_def = { + PyModuleDef_HEAD_INIT, + "mathutils.noise.distance_metrics", /* m_name */ + NULL, /* m_doc */ + 0, /* m_size */ + NULL, /* m_methods */ + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL, /* m_free */ +}; + +PyMODINIT_FUNC PyInit_mathutils_noise_metrics(void) +{ + PyObject *submodule = PyModule_Create(&M_NoiseMetrics_module_def); + + PyModule_AddIntConstant(submodule, (char *)"DISTANCE", TEX_DISTANCE); + PyModule_AddIntConstant(submodule, (char *)"DISTANCE_SQUARED", TEX_DISTANCE_SQUARED); + PyModule_AddIntConstant(submodule, (char *)"MANHATTAN", TEX_MANHATTAN); + PyModule_AddIntConstant(submodule, (char *)"CHEBYCHEV", TEX_CHEBYCHEV); + PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_HALF", TEX_MINKOVSKY_HALF); + PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_FOUR", TEX_MINKOVSKY_FOUR); + PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY", TEX_MINKOVSKY); + + return submodule; +} diff --git a/source/blender/python/generic/noise_py_api.h b/source/blender/python/mathutils/mathutils_noise.h index 60f43e16158..6a6527588ef 100644 --- a/source/blender/python/generic/noise_py_api.h +++ b/source/blender/python/mathutils/mathutils_noise.h @@ -20,13 +20,17 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/python/generic/noise_py_api.h - * \ingroup pygen +/** \file blender/python/mathutils/mathutils_noise.h + * \ingroup mathutils */ -#ifndef NOISE_PY_API_H -#define NOISE_PY_API_H +#ifndef MATHUTILS_NOISE_H +#define MATHUTILS_NOISE_H -PyObject *BPyInit_noise(void); +#include "mathutils.h" -#endif // NOISE_PY_API_H +PyMODINIT_FUNC PyInit_mathutils_noise(void); +PyMODINIT_FUNC PyInit_mathutils_noise_types(void); +PyMODINIT_FUNC PyInit_mathutils_noise_metrics(void); + +#endif // MATHUTILS_NOISE_H diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index b26781d8026..c2e364b6080 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -213,7 +213,7 @@ void makeqtstring (RenderData *rd, char *string) { BLI_make_existing_file(string); if (BLI_strcasecmp(string + strlen(string) - 4, ".mov")) { - sprintf(txt, "%04d_%04d.mov", (rd->sfra) , (rd->efra) ); + sprintf(txt, "%04d-%04d.mov", (rd->sfra) , (rd->efra) ); strcat(string, txt); } } diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index ffda20ead7f..18c1ed23f8a 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -507,7 +507,7 @@ void filepath_qt(char *string, RenderData *rd) { BLI_make_existing_file(string); if (BLI_strcasecmp(string + strlen(string) - 4, ".mov")) { - sprintf(txt, "%04d_%04d.mov", (rd->sfra) , (rd->efra) ); + sprintf(txt, "%04d-%04d.mov", (rd->sfra) , (rd->efra) ); strcat(string, txt); } } diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index e521479bbcd..02a94e56462 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -107,6 +107,8 @@ void RE_engine_report(RenderEngine *engine, int type, const char *msg); int RE_engine_render(struct Render *re, int do_all); +int RE_engine_is_external(struct Render *re); + /* Engine Types */ void RE_engines_init(void); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 9e522fae4e4..f016b0860d7 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -636,7 +636,6 @@ typedef struct LampRen { #define R_DUPLI_TRANSFORMED 1 #define R_ENV_TRANSFORMED 2 #define R_TRANSFORMED (1|2) -#define R_NEED_VECTORS 4 #endif /* RENDER_TYPES_H */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 48625192fb2..0f563f6fa32 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1719,7 +1719,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem sd.adapt_angle = cosf(DEG2RADF((float)part->adapt_angle)); } - if(re->r.renderer==R_INTERN && part->draw&PART_DRAW_REN_STRAND) { + if (part->draw & PART_DRAW_REN_STRAND) { strandbuf= RE_addStrandBuffer(obr, (totpart+totchild)*(path_nbr+1)); strandbuf->ma= ma; strandbuf->lay= ob->lay; @@ -2392,7 +2392,7 @@ static void do_displacement(Render *re, ObjectRen *obr, float mat[][4], float im /* Object Size with parenting */ obt=obr->ob; while(obt){ - mul_v3_v3v3(temp, obt->size, obt->dsize); + mul_v3_v3v3(temp, obt->size, obt->dscale); scale[0]*=temp[0]; scale[1]*=temp[1]; scale[2]*=temp[2]; obt=obt->parent; } @@ -3916,8 +3916,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) } } } - /* yafray: shadow flag should not be cleared, only used with internal renderer */ - if (re->r.renderer==R_INTERN) { + + /* old code checked for internal render (aka not yafray) */ + { /* to make sure we can check ray shadow easily in the render code */ if(lar->mode & LA_SHAD_RAY) { if( (re->r.mode & R_RAYTRACE)==0) @@ -4586,7 +4587,7 @@ static void init_render_object_data(Render *re, ObjectRen *obr, int timeoffset) re->totstrand += obr->totstrand; } -static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *dob, int timeoffset, int vectorlay) +static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *dob, int timeoffset) { ObjectRen *obr; ObjectInstanceRen *obi; @@ -4616,8 +4617,6 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject * obr->flag |= R_INSTANCEABLE; copy_m4_m4(obr->obmat, ob->obmat); } - if(obr->lay & vectorlay) - obr->flag |= R_NEED_VECTORS; init_render_object_data(re, obr, timeoffset); /* only add instance for objects that have not been used for dupli */ @@ -4644,8 +4643,6 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject * obr->flag |= R_INSTANCEABLE; copy_m4_m4(obr->obmat, ob->obmat); } - if(obr->lay & vectorlay) - obr->flag |= R_NEED_VECTORS; if(dob) psys->flag |= PSYS_USE_IMAT; init_render_object_data(re, obr, timeoffset); @@ -4665,7 +4662,7 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject * /* par = pointer to duplicator parent, needed for object lookup table */ /* index = when duplicater copies same object (particle), the counter */ -static void init_render_object(Render *re, Object *ob, Object *par, DupliObject *dob, int timeoffset, int vectorlay) +static void init_render_object(Render *re, Object *ob, Object *par, DupliObject *dob, int timeoffset) { static double lasttime= 0.0; double time; @@ -4674,7 +4671,7 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject if(ob->type==OB_LAMP) add_render_lamp(re, ob); else if(render_object_type(ob->type)) - add_render_object(re, ob, par, dob, timeoffset, vectorlay); + add_render_object(re, ob, par, dob, timeoffset); else { mul_m4_m4m4(mat, ob->obmat, re->viewmat); invert_m4_m4(ob->imat, mat); @@ -4872,7 +4869,7 @@ static int get_vector_renderlayers(Scene *sce) return lay; } -static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, int onlyselected, Object *actob, int timeoffset, int vectorlay, int level) +static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, int onlyselected, Object *actob, int timeoffset, int level) { GroupObject *go; Object *ob; @@ -4888,11 +4885,11 @@ static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, in if(ob->flag & OB_DONE) { if(ob->transflag & OB_RENDER_DUPLI) { if(allow_render_object(re, ob, nolamps, onlyselected, actob)) { - init_render_object(re, ob, NULL, 0, timeoffset, vectorlay); + init_render_object(re, ob, NULL, 0, timeoffset); ob->transflag &= ~OB_RENDER_DUPLI; if(ob->dup_group) - add_group_render_dupli_obs(re, ob->dup_group, nolamps, onlyselected, actob, timeoffset, vectorlay, level+1); + add_group_render_dupli_obs(re, ob->dup_group, nolamps, onlyselected, actob, timeoffset, level+1); } } } @@ -4948,7 +4945,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp * it still needs to create the ObjectRen containing the data */ if(ob->transflag & OB_RENDER_DUPLI) { if(allow_render_object(re, ob, nolamps, onlyselected, actob)) { - init_render_object(re, ob, NULL, 0, timeoffset, vectorlay); + init_render_object(re, ob, NULL, 0, timeoffset); ob->transflag &= ~OB_RENDER_DUPLI; } } @@ -5040,7 +5037,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp if(obi==NULL) /* can't instance, just create the object */ - init_render_object(re, obd, ob, dob, timeoffset, vectorlay); + init_render_object(re, obd, ob, dob, timeoffset); if(dob->type != OB_DUPLIGROUP) { obd->flag |= OB_DONE; @@ -5048,17 +5045,17 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp } } else - init_render_object(re, obd, ob, dob, timeoffset, vectorlay); + init_render_object(re, obd, ob, dob, timeoffset); if(re->test_break(re->tbh)) break; } free_object_duplilist(lb); if(allow_render_object(re, ob, nolamps, onlyselected, actob)) - init_render_object(re, ob, NULL, 0, timeoffset, vectorlay); + init_render_object(re, ob, NULL, 0, timeoffset); } else if(allow_render_object(re, ob, nolamps, onlyselected, actob)) - init_render_object(re, ob, NULL, 0, timeoffset, vectorlay); + init_render_object(re, ob, NULL, 0, timeoffset); } if(re->test_break(re->tbh)) break; @@ -5067,7 +5064,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp /* objects in groups with OB_RENDER_DUPLI set still need to be created, * since they may not be part of the scene */ for(group= re->main->group.first; group; group=group->id.next) - add_group_render_dupli_obs(re, group, nolamps, onlyselected, actob, timeoffset, renderlay, 0); + add_group_render_dupli_obs(re, group, nolamps, onlyselected, actob, timeoffset, 0); if(!re->test_break(re->tbh)) RE_makeRenderInstances(re); @@ -5174,10 +5171,9 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l /* SHADOW BUFFER */ threaded_makeshadowbufs(re); - - /* yafray: 'direct' radiosity, environment maps and raytree init not needed for yafray render */ - /* although radio mode could be useful at some point, later */ - if (re->r.renderer==R_INTERN) { + + /* old code checked for internal render (aka not yafray) */ + { /* raytree */ if(!re->test_break(re->tbh)) { if(re->r.mode & R_RAYTRACE) { @@ -5202,14 +5198,12 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l /* Occlusion */ if((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh)) if(re->wrld.ao_gather_method == WO_AOGATHER_APPROX) - if(re->r.renderer==R_INTERN) - if(re->r.mode & R_SHADOW) - make_occ_tree(re); + if(re->r.mode & R_SHADOW) + make_occ_tree(re); /* SSS */ if((re->r.mode & R_SSS) && !re->test_break(re->tbh)) - if(re->r.renderer==R_INTERN) - make_sss_tree(re); + make_sss_tree(re); if(!re->test_break(re->tbh)) if(re->r.mode & R_RAYTRACE) @@ -5670,6 +5664,8 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned RE_Database_FromScene(re, bmain, sce, lay, 1); if(!re->test_break(re->tbh)) { + int vectorlay= get_vector_renderlayers(re->scene); + for(step= 0; step<2; step++) { if(step) @@ -5682,7 +5678,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned int ok= 1; FluidsimModifierData *fluidmd; - if(!(obi->obr->flag & R_NEED_VECTORS)) + if(!(obi->lay & vectorlay)) continue; obi->totvector= obi->obr->totvert; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 38ace8d5121..2b44bad82ab 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -113,6 +113,12 @@ RenderEngineType *RE_engines_find(const char *idname) return type; } +int RE_engine_is_external(Render *re) +{ + RenderEngineType *type= RE_engines_find(re->r.engine); + return (type && type->render); +} + /* Create, Free */ RenderEngine *RE_engine_create(RenderEngineType *type) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b3948bcde77..deb621ad433 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1852,7 +1852,7 @@ static void do_render_3d(Render *re) add_halo_flare(re); /* Freestyle */ - if( re->r.mode & R_EDGE_FRS && re->r.renderer==R_INTERN) + if( re->r.mode & R_EDGE_FRS) if(!re->test_break(re->tbh)) add_freestyle(re); @@ -2908,12 +2908,6 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r BKE_report(reports, RPT_ERROR, "All RenderLayers are disabled"); return 0; } - - /* renderer */ - if(!ELEM(scene->r.renderer, R_INTERN, R_YAFRAY)) { - BKE_report(reports, RPT_ERROR, "Unknown render engine set"); - return 0; - } return 1; } @@ -2925,6 +2919,11 @@ static void validate_render_settings(Render *re) if(re->r.osa==0) re->r.scemode &= ~R_FULL_SAMPLE; } else re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */ + + if(RE_engine_is_external(re)) { + /* not supported yet */ + re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE); + } } static void update_physics_cache(Render *re, Scene *scene, int UNUSED(anim_init)) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 1a58a665e0a..b8c4b05de50 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -485,18 +485,12 @@ void makeraytree(Render *re) /* if(shi->osatex) */ static void shade_ray_set_derivative(ShadeInput *shi) { - float detsh, t00, t10, t01, t11, xn, yn, zn; + float detsh, t00, t10, t01, t11; int axis1, axis2; /* find most stable axis to project */ - xn= fabs(shi->facenor[0]); - yn= fabs(shi->facenor[1]); - zn= fabs(shi->facenor[2]); - - if(zn>=xn && zn>=yn) { axis1= 0; axis2= 1; } - else if(yn>=xn && yn>=zn) { axis1= 0; axis2= 2; } - else { axis1= 1; axis2= 2; } - + axis_dominant_v3(&axis1, &axis2, shi->facenor); + /* compute u,v and derivatives */ if(shi->obi->flag & R_TRANSFORMED) { float v1[3], v2[3], v3[3]; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 9459745cdbc..ae48b0f777f 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -3494,17 +3494,11 @@ void render_realtime_texture(ShadeInput *shi, Image *ima) static void textured_face_generate_uv(float *uv, float *normal, float *hit, float *v1, float *v2, float *v3) { - float detsh, t00, t10, t01, t11, xn, yn, zn; + float detsh, t00, t10, t01, t11; int axis1, axis2; /* find most stable axis to project */ - xn= fabs(normal[0]); - yn= fabs(normal[1]); - zn= fabs(normal[2]); - - if(zn>=xn && zn>=yn) { axis1= 0; axis2= 1; } - else if(yn>=xn && yn>=zn) { axis1= 0; axis2= 2; } - else { axis1= 1; axis2= 2; } + axis_dominant_v3(&axis1, &axis2, normal); /* compute u,v and derivatives */ t00= v3[axis1]-v1[axis1]; t01= v3[axis2]-v1[axis2]; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 5559d2ff34c..96f9918891a 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2371,7 +2371,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v) isec.skip = RE_SKIP_VLR_NEIGHBOUR; if(bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) { - if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) { + if(!hit || len_squared_v3v3(shi->co, co) < len_squared_v3v3(shi->co, minco)) { minisec= isec; mindist= dist; copy_v3_v3(minco, co); diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index f2a053e89d9..dd026740c33 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -756,17 +756,11 @@ void shade_input_set_uv(ShadeInput *shi) } else { /* most of this could become re-used for faces */ - float detsh, t00, t10, t01, t11, xn, yn, zn; + float detsh, t00, t10, t01, t11; int axis1, axis2; /* find most stable axis to project */ - xn= fabs(shi->facenor[0]); - yn= fabs(shi->facenor[1]); - zn= fabs(shi->facenor[2]); - - if(zn>=xn && zn>=yn) { axis1= 0; axis2= 1; } - else if(yn>=xn && yn>=zn) { axis1= 0; axis2= 2; } - else { axis1= 1; axis2= 2; } + axis_dominant_v3(&axis1, &axis2, shi->facenor); /* compute u,v and derivatives */ t00= v3[axis1]-v1[axis1]; t01= v3[axis2]-v1[axis2]; diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 33bbcb74835..521074463e0 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -105,6 +105,10 @@ if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() +if(WITH_HEADLESS) + add_definitions(-DWITH_HEADLESS) +endif() + if(WITH_PYTHON) list(APPEND INC ../python diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index fcdb6d25083..1d8161086b0 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -316,6 +316,8 @@ void WM_jobs_stop(struct wmWindowManager *wm, void *owner, void *startjob); void WM_jobs_kill(struct wmWindowManager *wm, void *owner, void (*)(void *, short int *, short int *, float *)); void WM_jobs_stop_all(struct wmWindowManager *wm); +int WM_jobs_has_running(struct wmWindowManager *wm); + /* clipboard */ char *WM_clipboard_text_get(int selection); void WM_clipboard_text_set(char *buf, int selection); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index a7c3e973a39..9d8f68115cf 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -321,10 +321,6 @@ void wm_event_do_notifiers(bContext *C) win->screen->scene->customdata_mask |= win->screen->scene->customdata_mask_modal; scene_update_tagged(bmain, win->screen->scene); - - ED_render_engine_update_tagged(C, bmain); - - scene_clear_tagged(bmain, win->screen->scene); } } @@ -2671,6 +2667,11 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U key we don't want the key modifier */ if(event.keymodifier == event.type) event.keymodifier= 0; + /* this case happened with an external numpad, it's not really clear + why, but it's also impossible to map a key modifier to an unknwon + key, so it shouldn't harm */ + if(event.keymodifier == UNKNOWNKEY) + event.keymodifier= 0; /* if test_break set, it catches this. XXX Keep global for now? */ if(event.type==ESCKEY) diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 0795bc8deee..2695f3d680d 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -132,7 +132,7 @@ void WM_init(bContext *C, int argc, const char **argv) set_free_windowmanager_cb(wm_close_and_free); /* library.c */ set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ - DAG_editors_update_cb(ED_render_id_flush_update); /* depsgraph.c */ + DAG_editors_update_cb(ED_render_id_flush_update, ED_render_scene_update); /* depsgraph.c */ ED_spacetypes_init(); /* editors/space_api/spacetype.c */ diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 16691ac5ab0..2d0d0f92a44 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -505,3 +505,13 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt) } } +int WM_jobs_has_running(wmWindowManager *wm) +{ + wmJob *steve; + + for(steve= wm->jobs.first; steve; steve= steve->next) + if(steve->running) + return 1; + + return 0; +} diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 26f59189e47..fa6521b3ec0 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1289,7 +1289,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemL(col, "Links", ICON_NONE); uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); - uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-260"); + uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-261"); uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 3c93d718bb3..fed9e60a638 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -164,8 +164,6 @@ endif() list(APPEND BLENDER_SORTED_LIBS extern_lzma) endif() - list(APPEND BLENDER_SORTED_LIBS extern_colamd) - if(WITH_LIBMV) list(APPEND BLENDER_SORTED_LIBS extern_libmv) endif() diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 7699e86f19f..2f5125a63dd 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -765,7 +765,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) { KX_GameObject* gameObj = (KX_GameObject*)parentList->GetValue(g); Object* blenderObject = gameObj->GetBlenderObject(); - if (blenderObject && blenderObject->parent==NULL && gameObj->GetPhysicsController() != NULL) + if (blenderObject && blenderObject->parent==NULL && gameObj->IsDynamic()) { //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController(); diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp index bfbdb4a1f6a..f9d60c57adc 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp @@ -1,35 +1,26 @@ -/** -* Simulation for obstacle avoidance behavior -* -* -* ***** 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. The Blender -* Foundation also sells licenses for use in proprietary software under -* the Blender License. See http://www.blender.org/BL/ for information -* about this. -* -* 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) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -*/ +/* + * Simulation for obstacle avoidance behavior + * + * ***** 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. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ #include "KX_ObstacleSimulation.h" #include "KX_NavMeshObject.h" diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.h b/source/gameengine/Ketsji/KX_ObstacleSimulation.h index d6af8f7d59a..f429d7480c9 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.h +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.h @@ -7,10 +7,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 @@ -21,11 +18,6 @@ * 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) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index cca50be7eb0..5058af18d15 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -7,10 +7,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 484b137c2f5..d9509894748 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index 91c85c7f595..232b907d9a8 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -1,35 +1,32 @@ -/** -* Add steering behaviors -* -* -* ***** 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. The Blender -* Foundation also sells licenses for use in proprietary software under -* the Blender License. See http://www.blender.org/BL/ for information -* about this. -* -* 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) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -*/ +/* + * Add steering behaviors + * + * + * ***** 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) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ #include "BLI_math.h" #include "KX_SteeringActuator.h" diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h index a0ae8e0d1d9..0e9d4c7e3a0 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.h +++ b/source/gameengine/Ketsji/KX_SteeringActuator.h @@ -1,36 +1,28 @@ -/** -* Add steering behaviors -* -* -* -* ***** 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. The Blender -* Foundation also sells licenses for use in proprietary software under -* the Blender License. See http://www.blender.org/BL/ for information -* about this. -* -* 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) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL LICENSE BLOCK ***** -*/ +/* + * Add steering behaviors + * + * ***** 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: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ #ifndef __KX_STEERINGACTUATOR #define __KX_STEERINGACTUATOR diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 725d00aa5cd..4eadf8e3e66 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -4,10 +4,7 @@ * 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. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. + * 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 @@ -18,11 +15,6 @@ * 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) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 56c0f46865a..f5787dad41e 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -896,7 +896,7 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) //ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); current_blmat_nr = current_polymat->GetMaterialIndex(); current_image = current_polymat->GetBlenderImage(); - ms.m_pDerivedMesh->drawFacesTex(ms.m_pDerivedMesh, CheckTexDM); + ms.m_pDerivedMesh->drawFacesTex(ms.m_pDerivedMesh, CheckTexDM, NULL, NULL); } return; } diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index a025f5e3ec9..3e8dcaffcfe 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -51,6 +51,8 @@ set(INC_SYS ${GLEW_INCLUDE_PATH} ) +add_definitions(-DGLEW_STATIC) + set(SRC Exception.cpp FilterBase.cpp |