diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-21 01:22:15 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-21 01:22:15 +0400 |
commit | 9c42afb1c02cafa21632bd2e19b47c012a230368 (patch) | |
tree | 90d7e190e9ba59437f1e3e31337984a2200aa764 | |
parent | 5582d9fac13123397297db54a0478a63a1b75194 (diff) | |
parent | 8f5112f191e24aac86da7b70f461a50825e764da (diff) |
Merged changes in the trunk up to revision 40413.
Conflicts resolved:
source/blender/makesrna/intern/rna_scene.c
393 files changed, 16062 insertions, 5316 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d6e6bf06f31..2c0e069cf5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,6 +105,7 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE ) get_blender_version() + # Blender internal features option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON) mark_as_advanced(WITH_BLENDER) @@ -1150,6 +1151,18 @@ if(WITH_RAYOPTIMIZATION) unset(_sse2) endif() + +# set the endian define +include(TestBigEndian) +test_big_endian(_SYSTEM_BIG_ENDIAN) +if(_SYSTEM_BIG_ENDIAN) + add_definitions(-D__BIG_ENDIAN__) +else() + add_definitions(-D__LITTLE_ENDIAN__) +endif() +unset(_SYSTEM_BIG_ENDIAN) + + if(WITH_IMAGE_OPENJPEG) if(UNIX AND NOT APPLE) # dealt with above diff --git a/GNUmakefile b/GNUmakefile index 7da60ce951b..9915406e52c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -36,7 +36,7 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]') BLENDER_DIR:=$(shell pwd -P) BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE) BUILD_TYPE:=Release -BUILD_CMAKE_ARGS:="" +BUILD_CMAKE_ARGS:= # ----------------------------------------------------------------------------- @@ -77,6 +77,16 @@ ifeq ($(OS), NetBSD) NPROCS:=$(shell sysctl -a | grep "hw.ncpu " | cut -d" " -f3 ) endif + +# ----------------------------------------------------------------------------- +# Macro for configuring cmake + +CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \ + -H$(BLENDER_DIR) \ + -B$(BUILD_DIR) \ + -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) + + # ----------------------------------------------------------------------------- # Build Blender all: @@ -84,7 +94,7 @@ all: @echo Configuring Blender ... if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \ - cmake $(BUILD_CMAKE_ARGS) -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE); \ + $(CMAKE_CONFIG); \ fi @echo @@ -120,6 +130,10 @@ help: @echo " * package_pacman - build an arch linux pacmanpackage" @echo " * package_archive - build an archive package" @echo "" + @echo "Other Targets" + @echo " * translations - update blenders translation files in po/" + # TODO, doxygen and sphinx docs + @echo "" @echo "Testing Targets (not assosiated with building blender)" @echo " * test - run ctest, currently tests import/export, operator execution and that python modules load" @echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions" @@ -147,6 +161,16 @@ package_archive: # ----------------------------------------------------------------------------- +# Other Targets +# +translations: + $(BUILD_DIR)/bin/blender --background --python po/update_msg.py + python3 po/update_pot.py + python3 po/update_po.py + python3 po/update_mo.py + + +# ----------------------------------------------------------------------------- # Tests # test: @@ -186,12 +210,15 @@ project_eclipse: # check_cppcheck: + $(CMAKE_CONFIG) cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py check_splint: + $(CMAKE_CONFIG) cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py check_sparse: + $(CMAKE_CONFIG) cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py diff --git a/SConstruct b/SConstruct index 06e6fe3473d..42ee3342031 100644 --- a/SConstruct +++ b/SConstruct @@ -337,6 +337,17 @@ if env['BF_NO_ELBEEM'] == 1: env['CXXFLAGS'].append('-DDISABLE_ELBEEM') env['CCFLAGS'].append('-DDISABLE_ELBEEM') + +if btools.ENDIAN == "big": + env['CPPFLAGS'].append('-D__BIG_ENDIAN__') + env['CXXFLAGS'].append('-D__BIG_ENDIAN__') + env['CCFLAGS'].append('-D__BIG_ENDIAN__') +else: + env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__') + env['CXXFLAGS'].append('-D__LITTLE_ENDIAN__') + env['CCFLAGS'].append('-D__LITTLE_ENDIAN__') + + # TODO, make optional env['CPPFLAGS'].append('-DWITH_AUDASPACE') env['CXXFLAGS'].append('-DWITH_AUDASPACE') @@ -501,31 +512,35 @@ datafilestargetlist = [] dottargetlist = [] scriptinstall = [] -if env['OURPLATFORM']!='darwin': - for dp, dn, df in os.walk('bin/.blender'): +if env['OURPLATFORM']!='darwin': + for dp, dn, df in os.walk('release/bin/.blender'): + dp = os.path.normpath(dp) + if '.svn' in dn: dn.remove('.svn') if '_svn' in dn: dn.remove('_svn') for f in df: + # This files aren't used anymore + if f in ['.Blanguages', '.bfont.ttf']: + continue + if not env['WITH_BF_INTERNATIONAL']: if 'locale' in dp: continue - if f == '.Blanguages': - continue if not env['WITH_BF_FREETYPE']: if f.endswith('.ttf'): continue - if 'locale' in dp: + if 'locale' in dp or 'fonts' in dp: datafileslist.append(os.path.join(dp,f)) - dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin + dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:])) # skip bin datafilestargetlist.append(dir + os.sep + f) else: dotblendlist.append(os.path.join(dp, f)) - dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin + dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:])) # skip bin dottargetlist.append(dir + os.sep + f) dotblenderinstall = [] diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py index ad7c09933c6..cb63c1d3ffc 100644 --- a/build_files/buildbot/master_unpack.py +++ b/build_files/buildbot/master_unpack.py @@ -52,7 +52,7 @@ def get_platform(filename): platform_tokens = [] found = False - for i, token in enumerate(tokens): + for token in tokens: if not found: for platform in platforms: if platform in token.lower(): diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py index f6d46904794..6eb9d4da8b6 100644 --- a/build_files/cmake/cmake_static_check_cppcheck.py +++ b/build_files/cmake/cmake_static_check_cppcheck.py @@ -43,6 +43,7 @@ CHECKER_ARGS = [ # "--enable=all", # if you want sixty hundred pedantic suggestions ] + def main(): source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX) @@ -58,12 +59,12 @@ def main(): check_commands.append((c, cmd)) for i, (c, cmd) in enumerate(check_commands): - percent = 100.0 * (i / (len(check_commands)-1)) + percent = 100.0 * (i / (len(check_commands) - 1)) percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:" - + # if percent < 27.9: # continue - + # let cppcheck finish the line off... sys.stdout.write("%s " % percent_str) diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py index 7827d3a5120..aa13ef82e3c 100644 --- a/build_files/cmake/cmake_static_check_splint.py +++ b/build_files/cmake/cmake_static_check_splint.py @@ -58,6 +58,10 @@ CHECKER_ARGS = [ # re-definitions, rna causes most of these "-redef", "-syntax", + + # dummy, witjout this splint complains with: + # /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON + "-D_PC_MAX_CANON=0", ] diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py index c4b83d20ea5..670befbf2aa 100644 --- a/build_files/cmake/project_source_info.py +++ b/build_files/cmake/project_source_info.py @@ -27,7 +27,6 @@ __all__ = ( ) import os -import sys from os.path import join, dirname, normpath, abspath SOURCE_DIR = join(dirname(__file__), "..", "..") @@ -40,11 +39,6 @@ def is_c_header(filename): return (ext in (".h", ".hpp", ".hxx")) -def is_c_header(filename): - ext = os.path.splitext(filename)[1] - return (ext in (".h", ".hpp", ".hxx")) - - def is_c(filename): ext = os.path.splitext(filename)[1] return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc")) @@ -79,6 +73,7 @@ def do_ignore(filepath, ignore_prefix_list): def makefile_log(): import subprocess + import time # Check blender is not 2.5x until it supports playback again print("running make with --dry-run ...") process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"], diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 3e22e9a634f..280ba3dd3f1 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -96,7 +96,7 @@ BF_ZLIB_INC = '${BF_ZLIB}/include' BF_ZLIB_LIB = 'libz' BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib' -WITH_BF_INTERNATIONAL = False +WITH_BF_INTERNATIONAL = True BF_GETTEXT = LIBDIR + '/gettext' BF_GETTEXT_INC = '${BF_GETTEXT}/include' @@ -188,11 +188,6 @@ CXX_WARN = [] LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid'] -if BF_DEBUG: - BF_NUMJOBS=1 -else: - BF_NUMJOBS=6 - PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] BF_BUILDDIR = '..\\build\\blender25-win64-vc' diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 0996b626b50..20254464a83 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -564,11 +564,11 @@ def AppIt(target=None, source=None, env=None): # print cmd commands.getoutput(cmd) cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION) - shutil.copy(bldroot + '/release/bin/.blender/.bfont.ttf', cmd) - shutil.copy(bldroot + '/release/bin/.blender/.Blanguages', cmd) - cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) + cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION) commands.getoutput(cmd) - cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION) + cmd = 'cp -R %s/release/bin/.blender/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) + commands.getoutput(cmd) + cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) commands.getoutput(cmd) @@ -581,10 +581,6 @@ def AppIt(target=None, source=None, env=None): if binary == 'blender':#not copy everything for blenderplayer cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) - cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) - commands.getoutput(cmd) - cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) - commands.getoutput(cmd) cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary) commands.getoutput(cmd) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index be059241727..caa83ea41be 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -63,9 +63,27 @@ def get_revision(): return 'r' + build_rev + +# copied from: http://www.scons.org/wiki/AutoconfRecipes +def checkEndian(): + import struct + array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04') + i = struct.unpack('i', array) + # Little Endian + if i == struct.unpack('<i', array): + return "little" + # Big Endian + elif i == struct.unpack('>i', array): + return "big" + else: + raise Exception("cant find endian") + + # This is used in creating the local config directories VERSION, VERSION_DISPLAY = get_version() REVISION = get_revision() +ENDIAN = checkEndian() + def print_arguments(args, bc): if len(args): diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 4e17fcd8dda..b2ed52eaf84 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -773,7 +773,7 @@ def pyrna2sphinx(BASEPATH): fw(" .. attribute:: %s\n\n" % prop.identifier) if prop.description: fw(" %s\n\n" % prop.description) - + # special exception, cant use genric code here for enums if prop.type == "enum": enum_text = pyrna_enum2sphinx(prop) @@ -1044,8 +1044,12 @@ def rna2sphinx(BASEPATH): fw("copyright = u'Blender Foundation'\n") fw("version = '%s - API'\n" % version_string) fw("release = '%s - API'\n" % version_string) - fw("html_theme = 'blender-org'\n") - fw("html_theme_path = ['../']\n") + + # until we get a theme for 'Naiad' + if 0: + fw("html_theme = 'blender-org'\n") + fw("html_theme_path = ['../']\n") + fw("html_favicon = 'favicon.ico'\n") # not helpful since the source us generated, adds to upload size. fw("html_copy_source = False\n") diff --git a/extern/glew/README.txt b/extern/glew/README.txt deleted file mode 100644 index 1b19c53523f..00000000000 --- a/extern/glew/README.txt +++ /dev/null @@ -1,18 +0,0 @@ -See doc/index.html for more information. - -If you downloaded the tarball from the GLEW website, you just need to: - - Unix: - - make - - Windows: - - use the project file in build/vc6/ - -If you wish to build GLEW from scratch (update the extension data from -the net or add your own extension information), you need a Unix -environment (including wget, perl, and GNU make). The extension data -is regenerated from the top level source directory with: - - make extensions diff --git a/extern/glew/include/GL/glew.h b/extern/glew/include/GL/glew.h index 1775aa784dc..cdf5b70db59 100644 --- a/extern/glew/include/GL/glew.h +++ b/extern/glew/include/GL/glew.h @@ -199,9 +199,10 @@ typedef _W64 int ptrdiff_t; #include <stddef.h> -/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ -#if defined(__sgi) && !defined(__GNUC__) +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) #include <inttypes.h> #else #include <stdint.h> @@ -1490,8 +1491,8 @@ typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); @@ -2408,6 +2409,15 @@ typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); #endif /* GL_VERSION_4_1 */ +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + /* -------------------------- GL_3DFX_multisample -------------------------- */ #ifndef GL_3DFX_multisample @@ -2535,6 +2545,21 @@ typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GL #endif /* GL_AMD_draw_buffers_blend */ +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + /* ------------------------- GL_AMD_name_gen_delete ------------------------ */ #ifndef GL_AMD_name_gen_delete @@ -3033,6 +3058,23 @@ typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* #endif /* GL_ARB_ES2_compatibility */ +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + /* ----------------------- GL_ARB_blend_func_extended ---------------------- */ #ifndef GL_ARB_blend_func_extended @@ -3100,6 +3142,33 @@ typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp) #endif /* GL_ARB_compatibility */ +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + /* --------------------------- GL_ARB_copy_buffer -------------------------- */ #ifndef GL_ARB_copy_buffer @@ -3862,6 +3931,32 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuin #endif /* GL_ARB_instanced_arrays */ +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + /* ------------------------ GL_ARB_map_buffer_range ------------------------ */ #ifndef GL_ARB_map_buffer_range @@ -4175,6 +4270,7 @@ typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); @@ -4195,6 +4291,7 @@ typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint loc typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) #define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) #define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) #define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) @@ -4428,6 +4525,49 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); #endif /* GL_ARB_separate_shader_objects */ +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + /* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ #ifndef GL_ARB_shader_bit_encoding @@ -4437,6 +4577,86 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); #endif /* GL_ARB_shader_bit_encoding */ +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + /* ------------------------- GL_ARB_shader_objects ------------------------- */ #ifndef GL_ARB_shader_objects @@ -4639,6 +4859,15 @@ typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, G #endif /* GL_ARB_shading_language_100 */ +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + /* -------------------- GL_ARB_shading_language_include -------------------- */ #ifndef GL_ARB_shading_language_include @@ -4666,6 +4895,15 @@ typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, #endif /* GL_ARB_shading_language_include */ +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + /* ----------------------------- GL_ARB_shadow ----------------------------- */ #ifndef GL_ARB_shadow @@ -5159,6 +5397,34 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsiz #endif /* GL_ARB_texture_rgb10_a2ui */ +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + /* ------------------------- GL_ARB_texture_swizzle ------------------------ */ #ifndef GL_ARB_texture_swizzle @@ -5246,6 +5512,21 @@ typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint in #endif /* GL_ARB_transform_feedback3 */ +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + /* ------------------------ GL_ARB_transpose_matrix ------------------------ */ #ifndef GL_ARB_transpose_matrix @@ -7489,6 +7770,18 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum t #endif /* GL_EXT_framebuffer_multisample */ +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + /* ----------------------- GL_EXT_framebuffer_object ----------------------- */ #ifndef GL_EXT_framebuffer_object @@ -9622,17 +9915,17 @@ typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tl #define GL_KTX_Z_REGION 0x2 #define GL_KTX_STENCIL_REGION 0x3 -typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONEXTPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); -typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONEXTPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); -#define glBufferRegionEnabledEXT GLEW_GET_FUN(__glewBufferRegionEnabledEXT) -#define glDeleteBufferRegionEXT GLEW_GET_FUN(__glewDeleteBufferRegionEXT) -#define glDrawBufferRegionEXT GLEW_GET_FUN(__glewDrawBufferRegionEXT) -#define glNewBufferRegionEXT GLEW_GET_FUN(__glewNewBufferRegionEXT) -#define glReadBufferRegionEXT GLEW_GET_FUN(__glewReadBufferRegionEXT) +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) #define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) @@ -10516,6 +10809,242 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, #endif /* GL_NV_parameter_buffer_object2 */ +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_MOVE_TO_NV 0x02 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_NV 0x00100000 +#define GL_FONT_ASCENDER_NV 0x00200000 +#define GL_FONT_DESCENDER_NV 0x00400000 +#define GL_FONT_HEIGHT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000 +#define GL_FONT_HAS_KERNING_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLint units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + /* ------------------------- GL_NV_pixel_data_range ------------------------ */ #ifndef GL_NV_pixel_data_range @@ -13171,6 +13700,9 @@ GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSepa GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; @@ -13240,6 +13772,10 @@ GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; @@ -13372,6 +13908,8 @@ GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; @@ -13432,6 +13970,7 @@ GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; @@ -13530,6 +14069,11 @@ GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3 GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; @@ -13612,6 +14156,13 @@ GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; @@ -13629,6 +14180,9 @@ GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedback GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; @@ -14481,11 +15035,11 @@ GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; -GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT; -GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; @@ -14663,6 +15217,56 @@ GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParamet GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; @@ -15022,6 +15626,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; @@ -15030,6 +15635,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; @@ -15056,10 +15662,13 @@ GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; @@ -15085,6 +15694,8 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; @@ -15100,14 +15711,18 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; @@ -15133,10 +15748,12 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; @@ -15198,6 +15815,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; @@ -15322,6 +15940,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; diff --git a/extern/glew/include/GL/glxew.h b/extern/glew/include/GL/glxew.h index 2995318f691..6d249f73eaa 100644 --- a/extern/glew/include/GL/glxew.h +++ b/extern/glew/include/GL/glxew.h @@ -785,6 +785,21 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #endif /* GLX_MESA_set_3dfx_mode */ +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + /* --------------------------- GLX_NV_copy_image --------------------------- */ #ifndef GLX_NV_copy_image @@ -1385,6 +1400,9 @@ extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; +extern PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +extern PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; @@ -1504,6 +1522,7 @@ GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers; GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_EXPORT GLboolean __GLXEW_MESA_swap_control; GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image; GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer; GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage; diff --git a/extern/glew/include/GL/wglew.h b/extern/glew/include/GL/wglew.h index deb64682811..05f054fc855 100644 --- a/extern/glew/include/GL/wglew.h +++ b/extern/glew/include/GL/wglew.h @@ -193,6 +193,8 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 #define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); diff --git a/extern/glew/src/glew.c b/extern/glew/src/glew.c index b2244a03237..5d886ce7807 100644 --- a/extern/glew/src/glew.c +++ b/extern/glew/src/glew.c @@ -577,6 +577,9 @@ PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; @@ -646,6 +649,10 @@ PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; @@ -778,6 +785,8 @@ PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; @@ -838,6 +847,7 @@ PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; @@ -936,6 +946,11 @@ PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; @@ -1018,6 +1033,13 @@ PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; @@ -1035,6 +1057,9 @@ PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; @@ -1887,11 +1912,11 @@ PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; -PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT = NULL; -PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT = NULL; -PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT = NULL; -PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT = NULL; -PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT = NULL; +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; @@ -2069,6 +2094,56 @@ PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; @@ -2427,6 +2502,7 @@ GLboolean __GLEW_VERSION_3_2 = GL_FALSE; GLboolean __GLEW_VERSION_3_3 = GL_FALSE; GLboolean __GLEW_VERSION_4_0 = GL_FALSE; GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; GLboolean __GLEW_3DFX_multisample = GL_FALSE; GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; @@ -2435,6 +2511,7 @@ GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; GLboolean __GLEW_AMD_debug_output = GL_FALSE; GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; GLboolean __GLEW_AMD_sample_positions = GL_FALSE; @@ -2461,10 +2538,13 @@ GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; GLboolean __GLEW_ARB_cl_event = GL_FALSE; GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; GLboolean __GLEW_ARB_debug_output = GL_FALSE; GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; @@ -2490,6 +2570,8 @@ GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; GLboolean __GLEW_ARB_imaging = GL_FALSE; GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; GLboolean __GLEW_ARB_multisample = GL_FALSE; @@ -2505,14 +2587,18 @@ GLboolean __GLEW_ARB_sample_shading = GL_FALSE; GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; GLboolean __GLEW_ARB_shader_objects = GL_FALSE; GLboolean __GLEW_ARB_shader_precision = GL_FALSE; GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; GLboolean __GLEW_ARB_shadow = GL_FALSE; GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; GLboolean __GLEW_ARB_sync = GL_FALSE; @@ -2538,10 +2624,12 @@ GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; GLboolean __GLEW_ARB_texture_rg = GL_FALSE; GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; GLboolean __GLEW_ARB_timer_query = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; @@ -2603,6 +2691,7 @@ GLboolean __GLEW_EXT_fog_coord = GL_FALSE; GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; @@ -2727,6 +2816,7 @@ GLboolean __GLEW_NV_occlusion_query = GL_FALSE; GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; GLboolean __GLEW_NV_point_sprite = GL_FALSE; GLboolean __GLEW_NV_present_video = GL_FALSE; @@ -3257,6 +3347,10 @@ static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_VERSION_4_1 */ +#ifdef GL_VERSION_4_2 + +#endif /* GL_VERSION_4_2 */ + #ifdef GL_3DFX_multisample #endif /* GL_3DFX_multisample */ @@ -3322,6 +3416,20 @@ static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + #ifdef GL_AMD_name_gen_delete static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) @@ -3586,6 +3694,21 @@ static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + #ifdef GL_ARB_blend_func_extended static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) @@ -3630,6 +3753,14 @@ static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_compressed_texture_pixel_storage + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifdef GL_ARB_conservative_depth + +#endif /* GL_ARB_conservative_depth */ + #ifdef GL_ARB_copy_buffer static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) @@ -3940,6 +4071,23 @@ static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_map_buffer_alignment + +#endif /* GL_ARB_map_buffer_alignment */ + #ifdef GL_ARB_map_buffer_range static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) @@ -4095,6 +4243,7 @@ static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; @@ -4235,10 +4384,37 @@ static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_ #endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + #ifdef GL_ARB_shader_bit_encoding #endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ + #ifdef GL_ARB_shader_objects static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) @@ -4326,6 +4502,10 @@ static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) #endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_420pack + +#endif /* GL_ARB_shading_language_420pack */ + #ifdef GL_ARB_shading_language_include static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) @@ -4344,6 +4524,10 @@ static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF #endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shading_language_packing + +#endif /* GL_ARB_shading_language_packing */ + #ifdef GL_ARB_shadow #endif /* GL_ARB_shadow */ @@ -4505,6 +4689,24 @@ static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT #endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_storage + +static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage */ + #ifdef GL_ARB_texture_swizzle #endif /* GL_ARB_texture_swizzle */ @@ -4559,6 +4761,20 @@ static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT #endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ + #ifdef GL_ARB_transpose_matrix static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) @@ -5670,6 +5886,10 @@ static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_ #endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + #ifdef GL_EXT_framebuffer_object static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) @@ -6579,11 +6799,11 @@ static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; - r = ((glBufferRegionEnabledEXT = (PFNGLBUFFERREGIONENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabledEXT")) == NULL) || r; - r = ((glDeleteBufferRegionEXT = (PFNGLDELETEBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegionEXT")) == NULL) || r; - r = ((glDrawBufferRegionEXT = (PFNGLDRAWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegionEXT")) == NULL) || r; - r = ((glNewBufferRegionEXT = (PFNGLNEWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegionEXT")) == NULL) || r; - r = ((glReadBufferRegionEXT = (PFNGLREADBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegionEXT")) == NULL) || r; + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; return r; } @@ -7026,6 +7246,67 @@ static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_I #endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + #ifdef GL_NV_pixel_data_range static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) @@ -8108,7 +8389,8 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) } else { - CONST_CAST(GLEW_VERSION_4_1) = ( major > 4 ) || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_2) = ( major > 4 ) || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; @@ -8168,6 +8450,8 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) #endif /* GL_VERSION_4_0 */ #ifdef GL_VERSION_4_1 #endif /* GL_VERSION_4_1 */ +#ifdef GL_VERSION_4_2 +#endif /* GL_VERSION_4_2 */ #ifdef GL_3DFX_multisample CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); #endif /* GL_3DFX_multisample */ @@ -8195,6 +8479,10 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_multi_draw_indirect + CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_multi_draw_indirect */ #ifdef GL_AMD_name_gen_delete CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8286,6 +8574,10 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_base_instance + CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); + if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_base_instance */ #ifdef GL_ARB_blend_func_extended CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8301,6 +8593,12 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) #ifdef GL_ARB_compatibility CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); #endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_compressed_texture_pixel_storage + CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); +#endif /* GL_ARB_compressed_texture_pixel_storage */ +#ifdef GL_ARB_conservative_depth + CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); +#endif /* GL_ARB_conservative_depth */ #ifdef GL_ARB_copy_buffer CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8388,6 +8686,13 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_map_buffer_alignment + CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); +#endif /* GL_ARB_map_buffer_alignment */ #ifdef GL_ARB_map_buffer_range CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8444,9 +8749,17 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_atomic_counters */ #ifdef GL_ARB_shader_bit_encoding CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); #endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_image_load_store + CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_image_load_store */ #ifdef GL_ARB_shader_objects CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8467,10 +8780,16 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) #ifdef GL_ARB_shading_language_100 CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); #endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_420pack + CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); +#endif /* GL_ARB_shading_language_420pack */ #ifdef GL_ARB_shading_language_include CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shading_language_packing + CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); +#endif /* GL_ARB_shading_language_packing */ #ifdef GL_ARB_shadow CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); #endif /* GL_ARB_shadow */ @@ -8551,6 +8870,10 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) #ifdef GL_ARB_texture_rgb10_a2ui CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); #endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_storage + CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage */ #ifdef GL_ARB_texture_swizzle CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); #endif /* GL_ARB_texture_swizzle */ @@ -8566,6 +8889,10 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback_instanced */ #ifdef GL_ARB_transpose_matrix CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); @@ -8790,6 +9117,9 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ #ifdef GL_EXT_framebuffer_object CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); @@ -9220,6 +9550,10 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) #ifdef GL_NV_parameter_buffer_object2 CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); #endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_path_rendering + CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); + if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_path_rendering */ #ifdef GL_NV_pixel_data_range CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); @@ -10588,6 +10922,9 @@ PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; @@ -10704,6 +11041,7 @@ GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; GLboolean __GLXEW_NV_copy_image = GL_FALSE; GLboolean __GLXEW_NV_float_buffer = GL_FALSE; GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; @@ -10984,6 +11322,20 @@ static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) #endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + +static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + #ifdef GLX_NV_copy_image static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) @@ -11454,6 +11806,10 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_swap_control */ #ifdef GLX_NV_copy_image CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); @@ -11581,9 +11937,9 @@ const GLubyte* glewGetString (GLenum name) static const GLubyte* _glewString[] = { (const GLubyte*)NULL, - (const GLubyte*)"1.6.0", + (const GLubyte*)"1.7.0", (const GLubyte*)"1", - (const GLubyte*)"6", + (const GLubyte*)"7", (const GLubyte*)"0" }; const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; @@ -11722,6 +12078,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) { @@ -11784,6 +12147,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif #ifdef GL_AMD_name_gen_delete if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) { @@ -11972,6 +12342,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif #ifdef GL_ARB_blend_func_extended if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) { @@ -12000,6 +12377,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif #ifdef GL_ARB_copy_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) { @@ -12175,6 +12566,20 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif #ifdef GL_ARB_map_buffer_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) { @@ -12280,6 +12685,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif #ifdef GL_ARB_shader_bit_encoding if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) { @@ -12287,6 +12699,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif #ifdef GL_ARB_shader_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) { @@ -12329,6 +12748,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif #ifdef GL_ARB_shading_language_include if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) { @@ -12336,6 +12762,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif #ifdef GL_ARB_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) { @@ -12511,6 +12944,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif #ifdef GL_ARB_texture_swizzle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) { @@ -12539,6 +12979,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif #ifdef GL_ARB_transpose_matrix if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) { @@ -12975,6 +13422,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif #ifdef GL_EXT_framebuffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) { @@ -13873,6 +14327,13 @@ GLboolean glewIsSupported (const char* name) continue; } #endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif #ifdef GL_NV_pixel_data_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) { @@ -15266,6 +15727,13 @@ GLboolean glxewIsSupported (const char* name) continue; } #endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } +#endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { diff --git a/extern/recastnavigation/CMakeLists.txt b/extern/recastnavigation/CMakeLists.txt index 1af01b1b427..660b881dd07 100644 --- a/extern/recastnavigation/CMakeLists.txt +++ b/extern/recastnavigation/CMakeLists.txt @@ -25,7 +25,7 @@ # ***** END GPL LICENSE BLOCK ***** set(INC - Recast/Include + Recast/Include Detour/Include ) @@ -34,6 +34,10 @@ set(INC_SYS ) set(SRC + recast-capi.cpp + recast-capi.h + + Detour/Source/DetourCommon.cpp Detour/Source/DetourNode.cpp Detour/Source/DetourStatNavMesh.cpp @@ -47,7 +51,7 @@ set(SRC Detour/Include/DetourStatNavMeshBuilder.h Detour/Include/DetourTileNavMesh.h Detour/Include/DetourTileNavMeshBuilder.h - + Recast/Source/Recast.cpp Recast/Source/RecastContour.cpp Recast/Source/RecastFilter.cpp @@ -57,10 +61,10 @@ set(SRC Recast/Source/RecastRasterization.cpp Recast/Source/RecastRegion.cpp Recast/Source/RecastTimer.cpp - + Recast/Include/Recast.h Recast/Include/RecastLog.h - Recast/Include/RecastTimer.h + Recast/Include/RecastTimer.h ) blender_add_lib(extern_recastnavigation "${SRC}" "${INC}" "${INC_SYS}") diff --git a/extern/recastnavigation/SConscript b/extern/recastnavigation/SConscript index be10c33c327..2c15e518eb1 100644 --- a/extern/recastnavigation/SConscript +++ b/extern/recastnavigation/SConscript @@ -3,6 +3,7 @@ Import('env') sources = env.Glob('Recast/Source/*.cpp') + env.Glob('Detour/Source/*.cpp') +sources += ['recast-capi.cpp'] incs = 'Recast/Include Detour/Include' diff --git a/extern/recastnavigation/recast-capi.cpp b/extern/recastnavigation/recast-capi.cpp new file mode 100644 index 00000000000..52c4cdc90ed --- /dev/null +++ b/extern/recastnavigation/recast-capi.cpp @@ -0,0 +1,37 @@ +/* + * $Id$ + * + * ***** 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) 2011 Blender Foundation. + * All rights reserved. + * + * Contributor(s): Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "recast-capi.h" + +#include <math.h> +#include "Recast.h" + +int recast_buildMeshAdjacency(unsigned short* polys, const int npolys, + const int nverts, const int vertsPerPoly) +{ + return (int) buildMeshAdjacency(polys, npolys, nverts, vertsPerPoly); +} diff --git a/source/blender/blenkernel/BKE_endian.h b/extern/recastnavigation/recast-capi.h index 5647645e990..0d20fdf9981 100644 --- a/source/blender/blenkernel/BKE_endian.h +++ b/extern/recastnavigation/recast-capi.h @@ -17,34 +17,26 @@ * 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. + * The Original Code is Copyright (C) 2011 Blender Foundation. * All rights reserved. * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. + * Contributor(s): Sergey Sharybin * * ***** END GPL LICENSE BLOCK ***** - * Are we little or big endian? From Harbison&Steele. */ -#ifndef BKE_ENDIAN_H -#define BKE_ENDIAN_H -/** \file BKE_endian.h - * \ingroup bke - */ +#ifndef RECAST_C_API_H +#define RECAST_C_API_H -/** - * BKE_ENDIANNESS(a) returns 1 if big endian and returns 0 if little endian - */ -#define BKE_ENDIANNESS(a) { \ - union { \ - intptr_t l; \ - char c[sizeof (intptr_t)]; \ - } u; \ - u.l = 1; \ - a = (u.c[sizeof (intptr_t) - 1] == 1) ? 1 : 0; \ -} +#ifdef __cplusplus +extern "C" { +#endif + +int recast_buildMeshAdjacency(unsigned short* polys, const int npolys, + const int nverts, const int vertsPerPoly); +#ifdef __cplusplus +} #endif +#endif // RECAST_C_API_H diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index 25510ebd2a5..b7571adf3d5 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -67,6 +67,7 @@ set(SRC FX/AUD_SuperposeFactory.cpp FX/AUD_SuperposeReader.cpp FX/AUD_VolumeFactory.cpp + intern/AUD_3DMath.h intern/AUD_AnimateableProperty.cpp intern/AUD_AnimateableProperty.h @@ -99,6 +100,7 @@ set(SRC intern/AUD_IWriter.h intern/AUD_JOSResampleFactory.cpp intern/AUD_JOSResampleFactory.h + intern/AUD_JOSResampleReaderCoeff.cpp intern/AUD_JOSResampleReader.cpp intern/AUD_JOSResampleReader.h intern/AUD_LinearResampleFactory.cpp diff --git a/intern/audaspace/intern/AUD_ConverterReader.cpp b/intern/audaspace/intern/AUD_ConverterReader.cpp index b3d669379f8..7665f276c0a 100644 --- a/intern/audaspace/intern/AUD_ConverterReader.cpp +++ b/intern/audaspace/intern/AUD_ConverterReader.cpp @@ -36,9 +36,6 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_Reference<AUD_IReader> reader, AUD_EffectReader(reader), m_format(specs.format) { - int bigendian = 1; - bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian - switch(m_format) { case AUD_FORMAT_U8: @@ -48,10 +45,11 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_Reference<AUD_IReader> reader, m_convert = AUD_convert_float_s16; break; case AUD_FORMAT_S24: - if(bigendian) - m_convert = AUD_convert_float_s24_be; - else - m_convert = AUD_convert_float_s24_le; +#ifdef __BIG_ENDIAN__ + m_convert = AUD_convert_float_s24_be; +#else + m_convert = AUD_convert_float_s24_le; +#endif break; case AUD_FORMAT_S32: m_convert = AUD_convert_float_s32; diff --git a/intern/audaspace/intern/AUD_Mixer.cpp b/intern/audaspace/intern/AUD_Mixer.cpp index 74ff180627a..caeeac8d43c 100644 --- a/intern/audaspace/intern/AUD_Mixer.cpp +++ b/intern/audaspace/intern/AUD_Mixer.cpp @@ -37,9 +37,6 @@ AUD_Mixer::AUD_Mixer(AUD_DeviceSpecs specs) : m_specs(specs) { - int bigendian = 1; - bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian - switch(m_specs.format) { case AUD_FORMAT_U8: @@ -49,10 +46,12 @@ AUD_Mixer::AUD_Mixer(AUD_DeviceSpecs specs) : m_convert = AUD_convert_float_s16; break; case AUD_FORMAT_S24: - if(bigendian) - m_convert = AUD_convert_float_s24_be; - else - m_convert = AUD_convert_float_s24_le; + +#ifdef __BIG_ENDIAN__ + m_convert = AUD_convert_float_s24_be; +#else + m_convert = AUD_convert_float_s24_le; +#endif break; case AUD_FORMAT_S32: m_convert = AUD_convert_float_s32; diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 2421c25398a..c3ff851f3bc 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -124,10 +124,10 @@ static const char *check_memlist(MemHead *memh); /* locally used defines */ /* --------------------------------------------------------------------- */ -#if defined( __sgi) || defined (__sun) || defined (__sun__) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__)) -#define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) +#ifdef __BIG_ENDIAN__ +# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) #else -#define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) +# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) #endif #define MEMTAG1 MAKE_ID('M', 'E', 'M', 'O') diff --git a/intern/itasc/kdl/frames.hpp b/intern/itasc/kdl/frames.hpp index 01213f91d5a..2a1ed3296f9 100644 --- a/intern/itasc/kdl/frames.hpp +++ b/intern/itasc/kdl/frames.hpp @@ -299,7 +299,7 @@ public: double data[9]; inline Rotation() { - *this = Rotation::Identity(); + *this = Identity(); } inline Rotation(double Xx,double Yx,double Zx, double Xy,double Yy,double Zy, diff --git a/intern/smoke/CMakeLists.txt b/intern/smoke/CMakeLists.txt index 228ff6ec389..6e1d3eb0ab4 100644 --- a/intern/smoke/CMakeLists.txt +++ b/intern/smoke/CMakeLists.txt @@ -83,8 +83,13 @@ set(SRC intern/tnt/tnt_version.h ) +# quiet -Wundef +add_definitions(-DDDF_DEBUG=0) + if(WITH_OPENMP) add_definitions(-DPARALLEL=1) +else() + add_definitions(-DPARALLEL=0) endif() if(WITH_FFTW3) diff --git a/intern/string/intern/STR_String.cpp b/intern/string/intern/STR_String.cpp index 071f34e0ef9..ba097ba6046 100644 --- a/intern/string/intern/STR_String.cpp +++ b/intern/string/intern/STR_String.cpp @@ -45,7 +45,7 @@ #include <ctype.h> #include <string.h> #if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) || defined (_AIX) -#include <strings.h> +# include <strings.h> #endif #include "STR_String.h" diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 00000000000..4c791dd9369 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,222 @@ +release/scripts/modules/rna_prop_ui.py + +release/scripts/startup/bl_operators/animsys_update.py +release/scripts/startup/bl_operators/object.py +release/scripts/startup/bl_operators/object_align.py +release/scripts/startup/bl_operators/object_quick_effects.py +release/scripts/startup/bl_operators/object_randomize_transform.py +release/scripts/startup/bl_operators/presets.py +release/scripts/startup/bl_operators/screen_play_rendered_anim.py +release/scripts/startup/bl_operators/sequencer.py +release/scripts/startup/bl_operators/wm.py + +release/scripts/startup/bl_ui/properties_animviz.py +release/scripts/startup/bl_ui/properties_data_armature.py +release/scripts/startup/bl_ui/properties_data_bone.py +release/scripts/startup/bl_ui/properties_data_camera.py +release/scripts/startup/bl_ui/properties_data_curve.py +release/scripts/startup/bl_ui/properties_data_empty.py +release/scripts/startup/bl_ui/properties_data_lamp.py +release/scripts/startup/bl_ui/properties_data_lattice.py +release/scripts/startup/bl_ui/properties_data_mesh.py +release/scripts/startup/bl_ui/properties_data_metaball.py +release/scripts/startup/bl_ui/properties_data_modifier.py +release/scripts/startup/bl_ui/properties_game.py +release/scripts/startup/bl_ui/properties_material.py +release/scripts/startup/bl_ui/properties_object_constraint.py +release/scripts/startup/bl_ui/properties_object.py +release/scripts/startup/bl_ui/properties_particle.py +release/scripts/startup/bl_ui/properties_physics_cloth.py +release/scripts/startup/bl_ui/properties_physics_common.py +release/scripts/startup/bl_ui/properties_physics_field.py +release/scripts/startup/bl_ui/properties_physics_fluid.py +release/scripts/startup/bl_ui/properties_physics_smoke.py +release/scripts/startup/bl_ui/properties_physics_softbody.py +release/scripts/startup/bl_ui/properties_render.py +release/scripts/startup/bl_ui/properties_scene.py +release/scripts/startup/bl_ui/properties_texture.py +release/scripts/startup/bl_ui/properties_world.py + +release/scripts/startup/bl_ui/space_console.py +release/scripts/startup/bl_ui/space_dopesheet.py +release/scripts/startup/bl_ui/space_graph.py +release/scripts/startup/bl_ui/space_image.py +release/scripts/startup/bl_ui/space_info.py +release/scripts/startup/bl_ui/space_logic.py +release/scripts/startup/bl_ui/space_nla.py +release/scripts/startup/bl_ui/space_node.py +release/scripts/startup/bl_ui/space_outliner.py +release/scripts/startup/bl_ui/space_sequencer.py +release/scripts/startup/bl_ui/space_text.py +release/scripts/startup/bl_ui/space_time.py +release/scripts/startup/bl_ui/space_userpref.py +release/scripts/startup/bl_ui/space_userpref_keymap.py +release/scripts/startup/bl_ui/space_view3d.py +release/scripts/startup/bl_ui/space_view3d_toolbar.py + +source/blender/editors/animation/anim_channels_edit.c +source/blender/editors/animation/anim_markers.c +source/blender/editors/animation/anim_ops.c +source/blender/editors/animation/drivers.c +source/blender/editors/animation/keyframing.c +source/blender/editors/animation/keyingsets.c + +source/blender/editors/armature/armature_ops.c +source/blender/editors/armature/editarmature.c +source/blender/editors/armature/editarmature_sketch.c +source/blender/editors/armature/poselib.c +source/blender/editors/armature/poseobject.c +source/blender/editors/armature/poseSlide.c + +source/blender/editors/curve/editcurve.c +source/blender/editors/curve/editfont.c + +source/blender/editors/gpencil/gpencil_paint.c + +source/blender/editors/interface/interface_layout.c +source/blender/editors/interface/interface_ops.c +source/blender/editors/interface/interface_regions.c +source/blender/editors/interface/interface_templates.c +source/blender/editors/interface/interface_utils.c +source/blender/editors/interface/view2d_ops.c + +source/blender/editors/mesh/editmesh.c +source/blender/editors/mesh/editmesh_add.c +source/blender/editors/mesh/editmesh_loop.c +source/blender/editors/mesh/editmesh_mods.c +source/blender/editors/mesh/editmesh_tools.c +source/blender/editors/mesh/loopcut.c +source/blender/editors/mesh/mesh_data.c +source/blender/editors/mesh/mesh_ops.c + +source/blender/editors/metaball/mball_edit.c + +source/blender/editors/object/object_add.c +source/blender/editors/object/object_constraint.c +source/blender/editors/object/object_edit.c +source/blender/editors/object/object_group.c +source/blender/editors/object/object_lattice.c +source/blender/editors/object/object_modifier.c +source/blender/editors/object/object_ops.c +source/blender/editors/object/object_relations.c +source/blender/editors/object/object_select.c +source/blender/editors/object/object_shapekey.c +source/blender/editors/object/object_transform.c +source/blender/editors/object/object_vgroup.c + +source/blender/editors/physics/particle_edit.c +source/blender/editors/physics/particle_object.c +source/blender/editors/physics/physics_pointcache.c + +source/blender/editors/render/render_internal.c +source/blender/editors/render/render_opengl.c +source/blender/editors/render/render_shading.c +source/blender/editors/render/render_view.c + +source/blender/editors/screen/area.c +source/blender/editors/screen/screendump.c +source/blender/editors/screen/screen_ops.c + +source/blender/editors/sculpt_paint/paint_ops.c +source/blender/editors/sculpt_paint/paint_image.c +source/blender/editors/sculpt_paint/paint_utils.c +source/blender/editors/sculpt_paint/paint_vertex.c +source/blender/editors/sculpt_paint/sculpt.c + +source/blender/editors/sound/sound_ops.c + +source/blender/editors/space_action/action_edit.c +source/blender/editors/space_action/action_ops.c +source/blender/editors/space_action/action_select.c + +source/blender/editors/space_buttons/buttons_header.c +source/blender/editors/space_buttons/buttons_ops.c + +source/blender/editors/space_console/console_ops.c + +source/blender/editors/space_file/file_draw.c +source/blender/editors/space_file/file_ops.c +source/blender/editors/space_file/file_panels.c + +source/blender/editors/space_graph/graph_buttons.c +source/blender/editors/space_graph/graph_edit.c +source/blender/editors/space_graph/graph_ops.c +source/blender/editors/space_graph/graph_select.c + +source/blender/editors/space_image/image_buttons.c +source/blender/editors/space_image/image_ops.c + +source/blender/editors/space_info/info_ops.c +source/blender/editors/space_info/info_report.c +source/blender/editors/space_info/space_info.c + +source/blender/editors/space_logic/logic_buttons.c + +source/blender/editors/space_nla/nla_buttons.c +source/blender/editors/space_nla/nla_channels.c +source/blender/editors/space_nla/nla_edit.c +source/blender/editors/space_nla/nla_select.c + +source/blender/editors/space_node/node_buttons.c +source/blender/editors/space_node/node_edit.c +source/blender/editors/space_node/node_header.c +source/blender/editors/space_node/node_ops.c +source/blender/editors/space_node/node_select.c +source/blender/editors/space_node/node_state.c + +source/blender/editors/space_script/script_edit.c + +source/blender/editors/space_sequencer/sequencer_add.c +source/blender/editors/space_sequencer/sequencer_buttons.c +source/blender/editors/space_sequencer/sequencer_edit.c +source/blender/editors/space_sequencer/sequencer_select.c + +source/blender/editors/space_text/text_header.c +source/blender/editors/space_text/text_ops.c +source/blender/editors/space_time/time_ops.c + +source/blender/editors/space_view3d/view3d_buttons.c +source/blender/editors/space_view3d/view3d_draw.c +source/blender/editors/space_view3d/view3d_edit.c +source/blender/editors/space_view3d/view3d_fly.c +source/blender/editors/space_view3d/view3d_header.c +source/blender/editors/space_view3d/view3d_select.c +source/blender/editors/space_view3d/view3d_view.c +source/blender/editors/space_view3d/view3d_toolbar.c + +source/blender/editors/transform/transform.c +source/blender/editors/transform/transform_ops.c +source/blender/editors/transform/transform_orientations.c + +source/blender/editors/util/undo.c + +source/blender/editors/uvedit/uvedit_ops.c +source/blender/editors/uvedit/uvedit_unwrap_ops.c + +source/blender/makesrna/intern/rna_ID.c +source/blender/makesrna/intern/rna_action.c +source/blender/makesrna/intern/rna_color.c +source/blender/makesrna/intern/rna_constraint.c +source/blender/makesrna/intern/rna_curve.c +source/blender/makesrna/intern/rna_fcurve.c +source/blender/makesrna/intern/rna_material.c +source/blender/makesrna/intern/rna_mesh.c +source/blender/makesrna/intern/rna_modifier.c +source/blender/makesrna/intern/rna_object.c +source/blender/makesrna/intern/rna_object_force.c +source/blender/makesrna/intern/rna_particle.c +source/blender/makesrna/intern/rna_render.c +source/blender/makesrna/intern/rna_scene.c +source/blender/makesrna/intern/rna_space.c +source/blender/makesrna/intern/rna_texture.c +source/blender/makesrna/intern/rna_ui_api.c +source/blender/makesrna/intern/rna_userdef.c +source/blender/makesrna/intern/rna_wm.c +source/blender/makesrna/intern/rna_wm_api.c +source/blender/makesrna/intern/rna_world.c + +source/blender/windowmanager/intern/wm_files.c +source/blender/windowmanager/intern/wm_operators.c +source/blender/windowmanager/intern/wm_window.c + + diff --git a/po/messages.txt b/po/messages.txt new file mode 100644 index 00000000000..b491061cdc4 --- /dev/null +++ b/po/messages.txt @@ -0,0 +1,5433 @@ +The edited object +Bezier curve point with two handles defining a Keyframe on an F-Curve +Max Climb +Media Stop +System & OpenGL +Strips Selected +Active Keying Set +Action Blending +Bone is able to be selected +Defines where the color of the environment light comes from +Display files as short list +Build 75% proxy resolution +Right Mouse +Cubic Catmull-Rom +Particle system can be edited in particle mode +UV editor data for the image editor space +Editing hair +Zoom using opposite direction +Graph Editor space data +Create obstacle +Tiles +Align newly added objects to the world coordinates +Index of custom color set +Sample point for F-Curve +AVI Raw +Linear Drag +Color to display the marker with +Channels Region +Lower bound of envelope at this control-point +Fluid +Regions this area is subdivided in +Double Click +Disable simulation of linear motion along the X axis +Sequencer OpenGL +Child particles generated by the particle system +Point in a shape key for curves +Lock to Bone +Sun Size +Set modifier expanded in the user interface +Multiple Scattering +ID Name +Steering +Animation Visualisation +Keyed States +Fixed size vertex indices array +Normal Size +Track To +Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.) +Collection of keymaps +Texture datablocks +Number of vertical pixels in the screen +Fluid Simulation +Zooms in and out like scaling the view, mouse movements relative to center +Lattice Edit +Snap onto its self (editmode) +Only render what's in front of the solid z values +True when multiple enums +Backdrop Zoom +Causes mesh data to be duplicated with the object +Automatic +Small Caps +UV Project +UV Sync Selection +Cloth dynamics for hair +File Browser Main +Sensitivity +Amount of rotation around side vector +Specify how many frames the Map Old will last +Start Still +Unique datablock ID name +Active pose marker for this Action +Draw Channels +Smoothens emitted smoke to avoid blockiness +Tool Settings +Text Line +Bone Constraints +Toggle whether the material is linked to object data or the object block +Falloff power for transmissivity filter effect (1.0 is linear) +Only use case sensitive matches of search string +Screw +Region Text +Representation of alpha information in the RGBA pixels +Edges receive a drag force from surrounding media +Sequence Transform +Over Drop +Domain Settings +New F-Curve Colors - XYZ to RGB +Space that owner is evaluated in +Frame Step +Enumeration +Value of the item +Parent of this pose bone +B-Bone Z size +Up Arrow +For reactor systems, the object that has the target particle system (empty if same object) +Shift key pressed +Auto Refresh +Bone Color Sets +Positive values make strands rounder, negative makes strands spiky +Collection of images +Show actuators of active object +interpolate a global timestamp using the record date and time written by recording device +Main Lattices +Variable from some source/target for driver relationship +Z Location +Auto-Clamped handle selected color +Fixed Alternate +Game engine sensor to detect events +Include the frame number in image metadata +Bone does not deform any geometry +UV Textures +Game +Minimal Spring length * Ball Size +16384 +Line in which the marker is located +Offset X +Rasterized cell height +Edge Threshold +-Z +Set audio channels to mono +Jump Speed +HuffYUV +Active Bone +View3D Fly Modal +Sets the audio channel count +Rotation Damping +Max Air Acceleration +Snap center onto target +Spring Damping +Compact with Milliseconds +Maintain speed, flight level or wander +Interpolation type +Type Info +SIMD QBVH +active +Armature +Match case +16 Bit +XZY Rotation Order. Prone to Gimbal Lock +Auto handle selected color +Theme File Browser +Bake the normals in object space +Enable color range used for weight visualization in weight painting mode +Vorticity +Open window +Shows sensors for this object in the user interface +Radius of head of bone (for Envelope deform only) +Plain diffuse energy (white.) +Elasticity +Cache Step +View Sliders +Hair +Filter Movies +Material datablock used by this material slot +Smooth Emitter +Catalan (Català ) +RVO (cells) +Home +Action Mouse +Show Debug Info +Loads a saved environment map image from disk +is_baking +Scene datablocks +Wire +Group +On Land +Group Objects +Time Step +Keep UI +Bone inherits rotation or scale from parent bone +Show Selected Object +Theme settings for the Outliner +Time of key over the simulation +Header Text +Health +Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead +Blender Original +Deliver texture UV pass +Index number of the vertex +Stepped Interpolation +Adds diagonal springs on 4-gons +Shear +Tent +Strength of force field +Space that target is evaluated in +F11 +Star +Library datablocks +Line Input +Lighten +In Range +Use Blender units for widths instead of pixels +F17 +Node Socket +Quad-Buffer +Sets scaling for the texture's X, Y and Z sizes +F14 +Motion Path settings for animation visualisation +Make hairs longer +Set audio sample format to 32 bit float +Amount of anti-aliasing samples per pixel +type +Use optimized Bullet DBVT tree for view frustum and occlusion culling +Make this surface a closed loop in the V direction +Alpha Over +Media player for video & png/jpeg/sgi image sequences +Second input for the effect strip +Space Logic Editor +Snap during transform +Edit Methods +Left Handle +B-Bone Ease Out +Cyclic Offset +Subtype +Object Base +Vertex Group Clump +Letterbox +Set audio channels to 7.1 surround sound +V +Quaternion (WXYZ) +Image File +Preset configs for external animation players +Maximum Value +Make this nurbs curve or surface act like a Bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled) +uk_UA +3x3 bone matrix +Vertex Weight +Display Material +Use a custom transform orientation +GLSL Shaders +Text +Deliver shadow pass +From node +Keyframes +Main Brushes +Deliver diffuse pass +Header +Level detector, trigger controllers of new states(only applicable upon logic state transition) +Collision Compound +Increment +Trackball +Active Strip +Initial Rest Length +User defined layer of string text values +Edge Tag Mode +Invert tilt Axis +Deliver emission pass +Face Selected +Xor +Voronoi Crackle +Align the transformation axes to the window +Line sample +Default Goal (vertex target position) value, when no Vertex Group used +Type of raytrace accelerator structure +Area Spaces +Project individual elements on the surface of other objects +Use the angle between two bones +Aero +Zmask +Set audio sample format to 32 bit signed integer +Scene render size +Multiplier to convert blender units to physical distance +Free Image Textures +Metaball datablocks +DPI +Fill in Z values for solid faces in invisible layers, for masking +Active Action for this datablock +Use turntable style rotation in the viewport +Format +Use a Catmull-Rom filter for anti-aliasing +Link material to object or the object's data +Type of participation in the fluid simulation +face normal +Enable +Final 4x4 matrix after constraints and drivers are applied (object space) +Diameter of widget, in 10 pixel units +ID Property +Radius of tail of bone (for Envelope deform only) +Custom Shape Transform +Action FCurves +Envelope Deform Weight +A +Renders star shaped lines over halo +Fade-out Color +Syntax Built-in +Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC) +Camera datablocks +Bounding Box Center +Middle Mouse +Framerate base +Touch +Vortex +Manipulator Size +F-Curve Colors - XYZ to RGB +Invert Output +Calculate heights against unsubdivided low resolution mesh +Shrinkwrap +Window Deactivate +Y position of the sequence strip +The frame on which this sketch appears +Snap to increments of grid +Rest Length +All +Serbian (СÑпÑком ÑезикÑ) +Sample Method +Text Anti-aliasing +Only allows given density value in emitter area +Sequencer Preview Shading +Lower field first +File Name +Show timing in seconds not frames +Display the object as wire edges +Billboard with Z-axis constraint +Curves +Displays clock frequency of fullscreen display +X Rotation +Sphere +Select UVs that share mesh vertex, irrespective if they are in the same location +8 bit RAW +0.5 means no distance at all, 1.0 is maximum distance +Sequencer +Max Ghost Range +An object instance in a scene +User Interface +Alt +Vertex group name +PNG +Animated Selected +Blue +Damping of the spring force, when inside the physics distance area +Plugin Strip +Hide +Pose Matrix +Guide-free time from particle life's end +Frame is being edited (painted on) +Large Cursors +Limit Rotation +Draw only faces with the currently displayed image assigned +Record Run +Pixel width over which the reconstruction filter combines samples +Global Scene +Defines the structure of the header in the UI +Source List Text Highlight +User-editable keyframes +Scaling factor for action +Inner +Active Constraint +Side-by-side +Right Arrow +Causes the 1 to 0 keys to act as the numpad (useful for laptops) +A collection of pose channels, including settings for animating bones +Lennard-Jones +Use a maximum radial distance for the field to work +Location of tail end of the bone relative to armature +Edit All +estimate matrix .. split to COM , ROT ,SCALE +Use Coordinates +Theme User Preferences +Show line numbers next to the text +Minimum speed in air (relative to maximum speed) +Display keymap datablocks +, +Display Summary +Channel Driver (only set for Driver F-Curves) +Item +In/Out Node +Frame that modifier's influence ends (if Restrict Frame Range is in use) +Premultiplied +Number of frames cached +Description of the Struct's purpose +Tilt in 3D View +Show Debug +Offsets image horizontally from the world origin +region_data +Protect layer from further editing and/or frame changes +File Format +Retarget roll mode +IK rot control +Upper bound of envelope at this control-point +Interaction Radius +Syntax String +Vertex group to control density +Show Overexposed +Vertices +Kerning Style +IK X Minimum +Sets the factor by which the flare is larger than the halo +Absolute ball size or factor if not manual adjusted +Blend Opacity +Steps +Texture +Settings for the visualisation of motion +Group of vertices, used for armature deform and other purposes +Limit Distance +Minus +No interpolation, fast but blocky and low quality +Control +Full SMPTE timecode. Format is HH:MM:SS:FF +Open On Mouse Over +Show sensors of active object +Frame Server Port +Noise patterns will remain unchanged, faster and suitable for stills +Start +RLE (lossless) +True when the property is not saved in presets +Images are rendered in new Window +Theme Timeline +If this is set, the header gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_HT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_HT_hello" +The color that rays with no intersection within the Max Distance take (material color can be best for indoor scenes, sky color for outdoor) +Show Cursor +Goal Default +Shape Key Point +Object Origin Size +Orthographic +Invert y axis +Unit Scale +Collection of points for Bezier curves only +Mouse +Pivot Point +UV Layer to control billboard splitting +Only insert keyframes where they're needed in the relevant F-Curves +IK Z Minimum +Distance +Key rotation quaternion +Backscattered light +Texture effector weight +Volume rendering settings for a Material datablock +Which output node to use, for node-based textures +Handle 1 selection status +Always render a still frame from the voxel data sequence +Factor ++Z +Numpad 4 +Type +Action Groups +Styles +rv +Recast data for a Game datablock +Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method) +Description of the property for tooltips +Area in a subdivided screen, containing an editor +IK Z Maximum +Effect fader position +Particle System to render as points +Vertex Group Size Negate +Simplify Subdivision +Warp +3D View center is locked to this bone's position +Enable cluster collision between soft and rigid body +04 - Theme Color Set +Lamps +Color Picker Type +Location of the hair key in its internal coordinate system, relative to the emitting face +Properties Space +The view mode to use for displaying sequencer output +Hold +Prefetch Frames +Pose Tail Position +Amount of pixels to extend the baked result with, as post process filter +Dummy +Deliver full combined RGBA buffer +Long Key Selected +Extension +Complete Matches Only +Lines +The external source data file to use +The time (in minutes) to wait between automatic temporary saves +Undo Memory Size +Type of event mapping +Animation Data +Unique node identifier +Draw white edges +Show Menus +W +Inverse Kinematics +Number of times a map will be rendered recursively (mirror effects.) +Face Mask +Density is calculated as a factor of default density (depends on particle size) +Soft +Use a maximum distance for the field to work +Has IK +Power of Fresnel for transparency (Ray or ZTransp) +Name of PoseBone to use as target +Display files as thumbnails +Transparency blending mode +Multiple Engines +Bits +Active Boid Rule Index +Child Of +Metric +Proxy size 100% +Module name +Visible +NLA Strip references some Action +Average screen dimension of stars +Converter Node +Mirror +Method of calculating aerodynamic interaction +Curl +Main Objects +Only include channels relating to selected objects and data +Set audio mixing buffer size to 256 samples +Bake normals +Uses direction of strands as normal for tangent-shading +Textbox Width +Pose +Plasticity +Object scale factor +Boid effector weight +Mass Vertex Group +Fight +Adjust the offset to the beginning/end +Bone Solid +NLA Strip representing a sound event for speakers +Maximum contour edge length +Build free run time code index using Record Date/Time +End frame displayed in the sequence editor after offsets are applied +NLA Strip acts as a container for adjacent strips +Offsets image vertically from the world origin +Block anything else from using the cursor +Inverse Lift +Maximum for slider +Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes) +Render Solid faces in this Layer +Vertex Weight Edit +Rotation style in the viewport +Active Vertex Color Index +Show the active object's smoke cache +Action Extrapolation +Resolution X +Mesh +Progress Bar Widget Colors +Lock editing of rotation in the interface +Draw faces over the image +Press +Weight Color Range +Collection of vertex colors +Thickness of strokes (in pixels) +Resolution V +Particle Target +Object duplicate transformation matrix +Luma +Blend Out +B +B-Bone X size +Anti-Aliasing Level +Handle Vertex Size +IK Lin Weight +Negative +End Still +Y Offset +Edge +Amount of stickness to surface collision +Bone Matrix +Randomizes ring dimension and line location +Velocity +Respect the frame rate rather than rendering as many frames as possible +Distance to the view location +High res +Object to take point data from +Falloff type for proportional editing mode +Region width +Border Minimum Y +Flash Video +Active Section +Channel defining pose data for a bone in a Pose +Smoothed high quality interpolation, but slower +Sets the audio sample rate +Deliver raytraced refraction pass +Land Personal Space +Curve Splines +Operating system key pressed +14 - Theme Color Set +Grease pencil data for this space +Child particle interpolated from simulated or edited particles +Editor header containing UI elements +Select Head +Catmull-Rom +GLSL Nodes +Make edges 'sail' +Scattering +Wire Select +Unit +Bezier Points +Frame on which the simulation starts +Animation Player +Sequence Crop +Autoname +Dying +Floor +True when the property is hidden +Cache Compression +Keep Root +Render Output Directory +Multiple Caches +External Shadows +Points V +Show Debug Properties +White Level +Framing Color +Line Feed +Logarithmic dissolve +Circle +Show movie files +Maximum distance for the field to work +Vertex Group Kink +Enable anisotropic friction +Use color management for GLSL rendering +Exec Screen +Render Layer +Validity +Show sensors of all selected objects +Tessellation +- +F-Curve Modifier's effects will be tempered by a default factor +Paths Type +Cine-Scope 24fps 2048x858 +Use Mist +Object Duplicate Matrix +Repulsion force to apply on cloth when close to colliding +Marker is temporary +Collection of screens +Lock X Axis +Octree Resolution +Control how much mist density decreases with height +Custom Color Set +Texture Context +Active Vertex Group +Disallow movement around the Y axis +Edge Color +Datablocks +Channels of the image to draw +2D Cursor +Constant QMC +Shape Key Curve Point +Command output +turbulence_strength +Color used for active bones +3D View center is locked to this object's position +Vertex groups of the object +Weights for the vertex groups this vertex is member of +Invert Axes +Euler Rotation +Material to override all other materials in this render layer +Tag Sharp +Is part of an IK chain +Output image in JPEG format +Main Groups +Slider Min +Side +Bone +Square (HV + S) +Transforms include effects of parenting/restpose and constraints +Name of operator to call on input event +Particle Speed +Motion Blur +Nurb V-lines +Font size to use for displaying the text +Tools +Float +Dynamic +Scene +Color curve mapping to use for displaying the image +Set audio channels to 4 channels +Free handle color +16-bit Signed +Active object for this scene +Previous Angular Velocity +Material Link To +Solid Light +Property Value +Worldspace distance over which to blend in the surface normal +NLA Strip is active +Mini Axis Size +Multiply direct lighting with ambient occlusion, darkening the result +Moving things with a mouse drag confirms when releasing the button +Show Render +Camera this timeline sets to active +Update Automatically +Inwards component of the vortex force +Edit texture nodes from Brush +Current perspective matrix of the 3D region +Opaque +Goal (vertex target position) friction +All rules are averaged +Grease Pencil Stroke +Display Object Info +The maximum distance from which a boid can attack +Curve interpolation at this point: Bezier or vector +Both Z +Textbox Y Offset +Node group datablocks +Ogg Theora +Logic And +Identifier of operator to call on input event +Spaces contained in this area, the first being the active space. NOTE: Useful for example to restore a previously used 3d view space in a certain area to get the old view orientation +Set audio channels to stereo +Order V +View & Controls +Rec Run +Upward spring force, when inside the physics distance area +Mesh Texture Face Layer +Transformation orientation +Gives a radial field toward the center of object +layout +Extend +Collision margin for soft body. Small value makes the algorithm unstable +box radius +Cache Index +Free +Inbetween Move +Packed File +Capsule +UV projector used by the UV project modifier +F-Curve Modifier has invalid settings and will not be evaluated +Dopesheet +Only Selected +Replace Text +Freq +Sets maximum Y value for the render border +Compositing nodes +Waveform Opacity +Layers that contain something +Skip Save +Same Types +Include Missing NLA +Level +Free Unused Nodes +Maximum distance to apply repulsion force, must be greater then minimum distance +Display tooltips +Hold RMB Open Toolbox Delay +Random variation of friction +Proportional Editing Falloff +Object Modifiers +Logic Xnor +Move to center of neighbors and match their velocity +Stretch or squeeze the viewport to fill the display window +X +Show frame numbers of Keyframes on Motion Paths +Shaded +Enhance the resolution of smoke by this factor using noise +Backdrop +Selected +Refraction Exclude +Enable bitmap text on face +Button4 Mouse +The direction that the OpenGL light is shining +Images are rendered without forcing UI changes, optionally showing result +A circular Hue/Saturation color wheel, with Value slider +Input 3 +Input 2 +Input 1 +Engine to use for rendering +Active UV Texture Index +Include the render time in the stamp image +Disabled +Sets the amount mirror reflection for raytrace +Game Object Settings +Clear +Max Physics Steps +Find All +3D View far clipping distance +Activate or deactivate item +Blobby element in a MetaBall datablock +Only Render +Radius of the agent +Show Navigation Guide +Default Colors +Sets the dimension of the sub-flares, dots and circles +Dynamic Friction +fi_FI +Viewpoint Object +Display the object solid, lit with default OpenGL lights +Use Global Coordinates +Use the initial length as spring rest length instead of 2 * particle size +Priority +Render polygon transparent, depending on alpha channel of the texture +Active File +Manually determine the number of threads +User Defined +Vertex group to control clump +Enable/Disable Constraint +Object is detected by the Near and Radar sensor +VBOs +When false, this (sub)layout is greyed out +Select Mouse +The Drivers/Expressions for this datablock +Individual Centers +Enables automatic saving of preview images in the .blend file (Windows only) +Shape key in a shape keys datablock +Use left Mouse Button for selection +Pivot around the 3D cursor +Auto +Registered +Flares Sub +Short List +Sounds Directory +Interpolate +Game engine properties +Allow drawing multiple strokes at a time with Grease Pencil +Output image in (old!) SGI IRIS format +Left Alt +Sub Level Menu Open Delay +Number of frames at start of strip to fade in influence +Keyframe Points +Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point +Display error text +Vertex group for fine control over structural stiffness +RNA Path (from ID-block) to property used +Info +User preferences space data +C +Emit Exclude +Thumbnails +Collision Sensor, detects static and dynamic objects but not the other collision sensor objects +Lamp Sky Settings +3D View center is locked to the cursor's position +Manoeuvre to avoid collisions with other boids and deflector objects in near future +Global gravity weight +Curve or Surface subdivisions per segment +The nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate +Back scattering (-1.0) to Forward scattering (1.0) and the range in between +Library Path +Calculate shadows while rendering +Defines the strength of environment light +Mux packet size (byte) +Croatian (Hrvatski) +Separate Colors +Collider Friction +Goal minimum, vertex group weights are scaled to match this range +Gamma Cross +Driver for the value of a setting based on an external value +Unit System +Highlight Line +Constraint is the one being edited +Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance +Keying Set +UV Local View +Changing edges seam re-calculates UV unwrap +View3D Move Modal +Any Type +Image Paint +Set audio mixing buffer size to 16384 samples +Creates turbulence with a noise field +Active EditBone +Brush +Show only sensors connected to active states +Disable simulation of angular motion along the Z axis +3D View Generic +Shape used as a relative key +World Stars +Use Environment Lighting +X Location +Auto Save Temporary Files +Surface subdivisions per segment +Output image in OpenEXR format +Center +Air has normally some thickness which slows falling things down +Defines if the panel has to be open or collapsed at the time of its creation +Parameters for the function +Keep root keys unmodified +Interpolate new particles from the existing ones +Include visualization of Node related Animation data +25% +Sets the number of simulation substep per physic timestep, higher value give better physics precision +Space in which transforms are used +16x +Sets the number of images of a movie to use +Callback function defines for built-in Keying Sets +20 - Theme Color Set +How much heat effects smoke motion, higher value results in faster rising smoke +Display when not linked to a visible states controller +Collection of scenes +256 +Smooth View +Choose shading information to bake into the image +Sets the number of star shaped lines rendered over the halo +Textures +Active spline +Maximum bending stiffness value +Eye Separation +Window event timer +Armature EditBones +Game engine actuators to act on events +End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method) +Quad Split +Auto handles clamped to not overshoot +How much the spring has to be stretched/compressed in order to change it's rest length +Show Brush On Surface +. +Defines the structure of the panel in the UI +Handle 2 selected +Use lights for GLSL rendering +Groups +Textured +Camera rotation in horizontal axis +Blender RNA +Type of ID-block that can be used +Column number to show right margin at +Game Soft Body Settings +Activity Culling +Local Space +Sets the layer as active for rendering +Rotate From Normal +IK Y Lock +Amount of influence constraint will have on the final solution +The window relative horizontal location of the mouse +Set audio mixing buffer size to 2048 samples +Lighting Mode +Object to use as projector transform +Numpad - +Location to store the proxy files +Add directed noise to the density at render-time +Physics Sub Steps +Mesh Faces +Apply on spline +Armature Sketch +Render Halos in this Layer (on top of Solid) +Nla Strips +Weight used by the Bevel modifier +Color range used for weight visualization in weight painting mode +Boid Rules +Delay between repeated pulses(in logic tics, 0=no delay) +Billboard Time Index UV +Game Data +IK X Limit +Theora +Hook +Collection of materials +Lifetime mapped as 0.0 - 1.0 intensity +Property Editor +Vorbis +Allow Land +Tip select mode +Navigation Mesh +Limit the texture size to save graphics memory +Game engine user defined object property +Sticky vertex selection disabled +Display an isolated sub-set of objects, apart from the scene visibility +Straight Alpha +Wheel Out +Sequence Proxy +Text displayed and edited in this space +Custom Object +Numpad + +Menu +Active Point Cache Index +Starting frame of the stored range +Panel Style +Emphasize position of keyframes on Motion Paths +Libraries +Restrict Frame Range +Quadratic Drag +Display X Axis +Copy of the colors associated with the group's color set +Use a Mitchell-Netravali filter for anti-aliasing +ID of the item +Marker selection state +Good smoothness and speed +Use Onion Skinning +Draw type for drawing UV edges +id +Result strip replaces the accumulated results by amount specified by influence +Transform Space +Speed factor +Collection of group sockets +Highlight Keyframes +Hide files/datablocks that start with a dot(.*) +Use 3D transform manipulator +Value of shape key at the current frame +Python +Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample) +Perspective Matrix +Meta strip stack, last is currently edited meta strip +Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point +Auto Keyframe Insert Keying Set +2D Cursor Location +Vertex Weight Mix +Group Index +Add hairs +Bake textures +Crop to Border +Initial boid health when born +When rendering animations, save JPG preview images in same directory +The number of grid lines to display in perspective view +Worlds +The distance between 3D View grid lines +Vector font datablocks +Tag Bevel +Negate the effect of the kink vertex group +Use viscoelastic springs instead of Hooke's springs +Frameserver Port for Frameserver Rendering +Shows actuators for this object in the user interface +Show Info +Grease Pencil Euclidean Distance +Pixels moved by mouse per axis when drawing stroke +Color balance parameters for a sequence strip +Collision Quality +Triple Buffer +Face is used for shadow +Include visualization of World related Animation data +Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory +Regular Widget Colors +Y +Bezier Curve Point +To node +Puff Mode +Root +Deliver Z values pass +Coordinates of the control point +Transforms don't include parenting/restpose or constraints +Keying Set Path +Friction force if a collision happened. (higher = less movement) +Theme settings defining draw style and colors in the user interface +MPEG-4(divx) +Display reference images behind objects in the 3D View +Collection of Node Links +Follow Leader +Hide objects on these layers when generating the Environment Map +Line Number +Fields per Frame +Harmonic Damping +Weight hair particles +Use the Blender internal rendering engine for rendering +Rotation/Scaling Pivot +Minimum radial distance for the field's fall-off +Duration +Causes curve data to be duplicated with the object +Absolute +pt_BR +Active Layer +YCbCr (ITU 601) +Average distance between any two stars +Multitexture materials +GLSL +Current Scene +How many keys to make new particles with +Hide element +Main Meshes +Text character formatting settings +Main Material +Collection of object modifiers +Maximal resolution used in the fluid domain +Amount of light that gets emitted by the volume +Grid +Use For Growing Hair +Parent edit bone (in same Armature) +Use a column layout for toolbox +Sort by time +When transforming strips, changes to the animation data are flushed to other views +Theme settings for widget color sets +Inner Thickness +Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info) +Constant Jittered +Weight to assign in vertex groups +Bone Armature-Relative Matrix +Rest length of the harmonic force +user_preferences +Gimbal +Alpha Under +RNA property definition +YXZ Euler +Use shadows for GLSL rendering +IOR +Gives the flare extra strength +Editor menu containing buttons +Right handle selection status +Minimum Value +Action referenced by this strip +Display and edit the grease pencil freehand annotations overlay +Path edit mode +Smooth falloff +Preferences related to viewing data +Max Edge Error +A square showing Hue/Value, with Saturation slider +D +Material slot in an object +Set audio sample format to 8 bit unsigned integer +User defined integer number value in an integer properties layer +Output image to a frameserver +Single Layer +Radius of boids personal space in air (% of particle size) +YCbCr (Jpeg) +Length +Specular +Proportional Editing using connected geometry only +Convex Hull +Mid-range quality and speed +Scale of the added turbulent noise +Only use complete matches of search string +Show Splash +Wind +Repulsion Force +Method used to convert stroke to bones +Show Pose Markers +Frame on which the simulation stops +Warp Data +Key angular velocity +select_start +Show Linked to Controller +Struct in which this struct is always nested, and to which it logically belongs +Include a custom note in image metadata +Log conversion gamma +Transform Orientation +Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems) +Which style to use for font kerning +Fall-Off +Render voxels from a Blender smoke simulation +Draw the points which make up the strokes (for debugging purposes) +Frames +Original image height +Use face for collision and ray-sensor detection +Around Frame +Image Strip +Bounding Box +Device up/down directly controls your Z position +The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed +Original image width +Show Margin +Transform Modal Map +Stiff Quads +System +Spherical Panoramic +Onion Skinning settings for animation visualisation +KeyMap Items +Valid +MP2 +Handle 2 Type +Italic +Material Raytrace Mirror +Object Grouped Active +Use Frame Rate +sv_SE +Samples +Name +Material mode to use for rendering +Cube +Result color of the volume, after other light has been scattered/absorbed +Use Min +Display the center and axis during rotation +Multiplier for intensity values +Render Edge-enhance in this Layer (only works for Solid faces) +Material datablocks +/ +Arabic (اÙعربÙØ©) +Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary +Filter 2D +Lift +Lighting for a World datablock +External +Collection of metaballs +Sets the hardness of the halo +General rotation damping +Constraint name +Hardness +Syntax highlight for scripting +Parameters and Settings for the Filebrowser +Edit Path +Rot Matrix +Global Time +Grease Pencil Manhattan Distance +Grouping Method +Lock view rotation in side views +Effector Group +Collection of armature edit bones +Flare +Control Point selected +Freehand curves defining the sketch on this frame +Make this nurbs surface act like a Bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled) +Operator +Near +Use the pinned context +Display files as a detailed list +On Selected Bones Only +Has Reports +Property +Collection of related sketches +Control point mass values +Chance that the particle will pass through the mesh +Sticky Selection Mode +Font +Key Modifier +Clip +Edit texture nodes from Object +resolution_y +Storage of an operator being executed, or registered after execution +Image +Density Scale +Active Render Layer +Space DopeSheet Editor +Maximal +Indirect Factor +Pixel Filter +Upper field first +Static +AVI +Internal Friction +Global Hair +Level height +Bake Specular colors +DopeSheet space data +Registered Optionally +Causes actions to be duplicated with the object +Enable collisions with other objects +Theme settings for the Properties +Region ID +Strength +Use nodes for GLSL rendering +General Mass value +Damping Factor +Show Paint +Weight of a particle dupliobject in a group +Shows controllers for this object in the user interface +Allow the use of colors indicating constraints/keyed status +Target Object +Texture Paint +Defines how AO mixes with material shading +Driver Variable +Wrap words if there is not enough horizontal space +Point in a shape key for Bezier curves +Directory/name to save animations, # characters defines the position and length of frame numbers +Follow Path +Use a cubic filter for anti-aliasing +Media First +Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled +Draw Frames +Length of rays, defines how far away other faces give occlusion effect +Lock Scale +Method of attenuating density by distance from the point +8-bit Unsigned +File Paths +Point Source +cs_CZ +Pose Space +Sort the file list alphabetically +Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone +Collision Type +Collection of node trees +Occlusion Resolution +Apply sun effect on sky +Stamp Note Text +Traditional Chinese (ç¹é«ä¸æ) +Scene layers included in this render layer +Weight used by the Bevel modifier 'Only Vertices' option +IK Y Stiffness +The default directory to search for texture plugins +Vertex Group Velocity Negate +Modifiers +Invoke Region Window +Auto Perspective +Module +The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions +Display Camera +Subdivisions +Blendfile Data +Location of custom proxy file +Solidify +Do a full redraw each time, slow, only use for reference or when all else fails +Horizon Spread +06 - Theme Color Set +Show a visualization of physics bounds and interactions +Z +Quick Cache +Show Error +Left +Property that stores arbitrary, user defined properties +UV 4 +Resolution % +Scattering color +UV 1 +UV 3 +UV 2 +Handle 2 +Display datablocks in visible layers +Handle 1 +Left handle selection status +Active Keying Set Index +SMPTE (Full) +Use textures to affect material properties +Draw Modified Edges +Maximum caused damage on attack per second +Shape Key +Enable file compression when saving .blend files +Script datablocks (DEPRECATED) +Frame rate for the screencast to be played back +MPEG-1 +Use Sketching Sessions +MP3 +Use ObColor instead of vertex colors +Lock X Rotation Axis +Envelope Tail Radius +Causes armature data to be duplicated with the object +The menu label +Allow Flight +Keyed timing +Free Run (rec date) +Use a 3D manipulator widget for controlling transforms +Insert Keyframes - Only Needed +Show handles of Bezier control points +Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes) +Inverse Quadratic +ru_RU +Use the value from some RNA property (Default) +Calculate point velocities automatically +Actions +Modifiers affecting all the F-Curves in the referenced Action +Enables automatic saving of preview images in the .blend file +Animation Player Preset +16 - Theme Color Set +Vector handle color +Proxy render size +Clip Max X +Clip Max Y +Open in thumbnail view for images and movies +Physics Engine +Description +Sort files by size +Particle Cache +Action Influence +Envelope +View Perspective +IK X Maximum +Boid States +Display datablocks of selected objects +Full Sample +Animation data for datablock +Channel +Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe +Order U +Timecode +Distance moved by mouse when drawing stroke (in pixels) to include +Calculate radiosity in a pre-process before rendering +Selected to Active +For RGB curves, the color that black is mapped to +Mesh Texture Face +E +For Pose-Mode drawing, only draw ghosts for selected bones +Landing Smoothness +Grease Pencil Frame +Shift +Mouse Move +Button 3 +Auto-detect +Space Timeline Editor +Only Selected Keyframes Handles +Use smoke density as texture data +Operator has a set of reports (warnings and errors) from last execution +Layered +Object Vertices +Set audio mixing buffer size to 512 samples +Duplicate Metaball +Saves this datablock even if it has no users +Cine-Scope 48fps 2048x858 +Ad-hoc correction for over-occlusion due to the approximation +Line Info +Filtering Group +Choose the method used to split a quad into 2 triangles for baking +Menu Item Colors +Blending factor for Fresnel +Constant +Mitchell-Netravali +Color +Button 8 +IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC +Include visualization of Camera related Animation data +Free Run +Opacity of the points +Button 9 +Collection of speakers +Adaptive QMC +Layers the object base is on +NLA Generic +Sort by size +Friend +Velocity Min +The brightness of the icon +Show the active object's cloth point cache +Invoke Default +Amplification +Display warnings +Realtime +Size of the font used when rendering stamp text +Refraction +Third input for the effect strip +Snap to vertices +Global child particles percentage +Faces collide too, can be very slow +Disable collision for this object +Disable the time difference between fields +The default directory to search for loading fonts +Automatic keyframe insertion in available curves +Bake the normals in camera space +Show Header +layers +Color for all strokes in this layer +Top Level Menu Open Delay +Exec Area +Auto Render +Type of periodic offset on the curve +Key location +Use scaled and grid-fitted kerning distances +Stars setting for a World data-block +Burn +Set audio sample format to 24 bit signed integer +Standard +0 +Tag Crease +Image Sequence +Function is registered as callback as part of type registration +UV Layer to control billboard normals +Auto-Keying Mode +Bitrate +Back scattering weight +Select where rendered images will be displayed +The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent +Gamma Corrected Color +AutoMerge Keyframes +Hold the first frame if no previous strips in track, and always hold last frame +Active PoseChannel constraint +Scene Bases +Vertex Colors +Collection of mesh faces +string +Live search filtering string +Sequencers active strip +Number of scene samples to take with motion blur +Vertex Group for pinning of vertices +Display libraries +The number of fields per rendered frame (2 fields is 1 image) +Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source) +Frame of referenced Action to evaluate +Line Error +Plus +Coordinates +Roll CW +Envelope Control Point +Invert roll Axis +Source List Text +The file extension used for saving renders +Last selected element +Radial falloff power (real gravitational falloff = 2) +Face Normal +Fluid Simulation Settings +Disable or enable the render layer +Tap +Active Bone Group +Show render related properties +Number of vertical pixels in the rendered image +Child of this pose bone +Location of Center of mass +Show background image in back view +Max Land Acceleration +3D View +Snap to actual frames/seconds (nla-action time) +Two-side +Tag +Enables Anti-aliasing +Smoke domain settings +Tab +Default Closed +SPH Fluid Settings +Dome physical configurations +Theme settings for the User Preferences +Front-Truncated +Has the current session been saved to disk as a .blend file +12 - Theme Color Set +Box +Constraint modifying the transformation of objects and bones +Curve datablocks +Adjustment Layer +Velocity Scale +Field of View of the Dome - it only works in mode Fisheye and Truncated +Jitter +Audio Window +Use Grease Pencil +Filter Blender +Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame +Create springs for this number of frames since particles birth (0 is always) +Label +Object this base links to +Apply channel rotation as IK constraint +PCM +Percentage +Render Sky in this Layer +Red +pl_PL +Datablock whose nodes are being edited +Draw user interface text anti-aliased +Head +Subdivide stroke in bones of specific length +Use the depth under the mouse to improve view pan/rotate/zoom functionality +Texture to use as force +RNA type definition +PIZ (lossless) +Bit depth per channel +Billboard Split UV +Pxr24 (lossy) +Region height +Heat +Particle select and display mode +Normalized +Mux Packet Size +Diameter in Pixels for Object/Lamp origin display +Distance between subsequent volume depth samples +Swap the Mouse Wheel zoom direction +Sequence editor space data +The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type) +Bake from Multires +Start size of strands in pixels or Blender units +Shape Key datablocks +Targa +Particle Instance +Bezier V +Multiplier to bring particle speed within an acceptable range +Collision Group +Limit effectors to this Group +Display datablocks of all objects of same type as selected object +The constraint is applied relative to the local coordinate system of the object, with the parent transformation added +Deliver normal pass +Location of tail end of the bone +The transformation of the target is evaluated relative to the world coordinate system +File Path +O +FLAC +UV Layer to control billboard time index (X-Y) +Blender Units +Vertex Group Tangent Negate +Set color of selected color stop +Pivot center for rotation/scaling +Set audio sample format to 16 bit signed integer +Zooms in and out based on horizontal mouse movement +Invert Zoom +Alpha Mode +bl_use_postprocess +Land Stick Force +Create empty placeholder files while rendering frames (similar to Unix 'touch') +Face Collision +Automatic keyframe insertion for Objects and Bones +Damp +Disable simulation of angular motion along the X axis +RNA Array Index +Unsigned Number +Output video in MPEG format +Dead +Text Widget Colors +Auto Save Time +Freehand curve defining part of a sketch +Header Text Highlight +Seed +True when the Ctrl key is held +Raytrace Acceleration Structure +Which direction is used to calculate the effector force +Addon Key Configuration +Data point for freehand stroke curve +Number of cone samples averaged for blurry reflections +F8 +Filter Sound +Mass of cloth material +Matrix +Action Group that this F-Curve belongs to +Subdivide stroke adaptively, with more subdivision in curvier parts +How many steps to draw the path with +Space Text Editor +Handle Vertex +Render face two-sided +Mist uses inverse quadratic progression +DV +Has Maximum +Skip Quad to Triangles +Number of times to repeat the action range +Maximum Distance +is_baked +Amount of damping during collision +F9 +8192 +X Offset +Image Pin +Accuracy of attack +Continuously unwrap the selected UV island while transforming pinned vertices +Collection of grease pencils +Gesture Border +Exclude raytraced reflection pass from combined +Choose normal space for baking +Boid state for boid physics +Occluder for optimizing scene rendering +Axis Angle +Field settings for an object in physics simulation +Rotation Mode +Active Spline +Buoyancy +Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects +Start player with a visible mouse cursor +Bars +Armatures active edit bone +Breakdown +Color Mode +Diffuse +01 - Theme Color Set +Start position of the marker in the line +Consider objects as whole when finding volume center +Iris +Save Buffers +Time Scale +Split quads predictably (1,2,3) (1,3,0) +Constraint +Display Hidden +Receive shadows from sources outside the volume (temporary) +Required +Domain +Display Speaker +GLSL Ramps +Point data to use as renderable point density +Keyframe insertion only when keyframe needed +Audio Sample Rate +Area width +Time +Texture datablock used by this texture slot +Draw Waveform +DPX +Expression +Voxel data settings +Constraints +State Colors +Influence setting is controlled by an F-Curve rather than automatically determined +Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method) +Set audio sampling rate to 48000 samples per second +Order of video fields. Select which lines get rendered first, to create smooth motion for TV output +Surface Diffuse +Magnetic +Stamp Background +Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled +Show Warn +When bone has a parent, bone's head is struck to the parent's tail +Timer 0 +Timer 1 +Timer 2 +Display Y Axis +Frame player from IRIDAS +Children +Zoom To Mouse Position +Shadows +Use High Quality Drawing +Exclude emission pass from combined +Invert rotation axis +Plane +Drivers +Particle system in an object +Shader Nodes +Z-Buffer +Soft to Soft Body +Expanded in the user interface +After Current +Mix +Object Color +Fresnel +Main Cameras +Atmosphere Extinction +Use Indirect Lighting +Elastic Limit +Material Slot +Resolution of raytrace accelerator. Use higher resolutions for larger scenes +Falloff Power +Mesh Deform +Show influence curves on strips +Tweak timing for physics to control frequency and speed +IK X Stiffness +Theme settings for the File Browser +Images are saved with RGB (color) data +1 +Textured Fonts +Data type of the property +Gain +Scale X +Is Perspective +Metaball +IK Z Stiffness +B-Bone Display X Width +Space Console +Handle type for handles of new keyframes +Left Mouse +Macro +Average +Curve +Sketches for this layer on different frames +User interface layout in a panel or header +Error Tolerance +Axis of mouse movement to zoom in or out on +Disable auto (de)activation in physics simulation +Softness +Inherit Scale +Graph Editor +Method of shading, attenuating, and scattering light through the volume +View +Position Iterations +H.264 +Romanian (Român) +Still Frame Number +Extension Filter +Vertex Group Roughness End Negate +Specular Colors +Minimal Info +Face selection mode +Reflection Color +Node Editor +Proportional distance over which the light is diffused +Use Local Coords +Zmask Negate +Property that gives the name of the struct +Rotation in quaternions (keep normalized) +On Keyframes +Pulse False Level +Animated +Main Grease Pencils +Alpha Sort +Factor for ambient occlusion blending +Active vertex color index +Generator +Author +Restrict Animation Updates +Lock editing of four component rotations by components (instead of as Eulers) +NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled) +The diffuse color of the OpenGL light +Do not calculate lighting and shadows +Max Sample Error +Cut +Starting distance of the mist, measured from the camera +Damping +Push an undo event (needed for operator redo) +White +Sets the strength of the add effect +Collection of lamps +Animation +Parent bone (in same Armature) +Environment Maps +Inputs +Direction +Max difference in heights of obstacles to enable their interaction +group +75% +Hide this curve in editmode +Deformed Location +Include visualization of Lattice related Animation data +Weighted result of strip is multiplied with the accumulated results +Cloth Settings +Sharp edge for the EdgeSplit modifier +Collection of groups +window +Preset +Theme Outliner +Fast Navigate +Draw Smooth Edges +Collection of curves +Star Tips +NLA Evaluation Enabled +3D Cursor Location +Spline Bezier Points +Stereo +Page Up +Negate the effect of the field vertex group +Collide All +Items Expanded +Marker for noting points in the timeline +Z Direction +Causes lamp data to be duplicated with the object +Scene Strip +Boid state name +Simulation value to be used as a texture +64-bit Float +Domain Object +Right +Shape of clumping +XZY Euler +Group Sockets +Individual pose bones for the armature +Min Step +Manipulator Scale +Main Armatures +Die Time +Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method) +Placeholders +name +Unfitted +Minimum regions size. Smaller regions will be merged +Mesh Selection Mode +Method to draw in the sequencer view +Mute +Down Arrow +Render Strands in this Layer +Child Particles +Duplicate Action +IK Param +Main Images +Weight for cloth simulation +Index number of the vertex group +Collection of NLA Tracks +Sequence strip data for a single frame +Sculpt/Paint Use Unified Strength +Audio Mixing Buffer +ID-block that the specific property used can be found from (id_type property must be set first) +Linear physics +Use Collision Bounds +Passes +Noise algorithm - Original Perlin: Smooth interpolated noise +Additive +Handle 2 selection status +Trigger controllers only for an instant, even while the sensor remains true +Loose edge +Edit animation/keyframes displayed as 2D curves +Sculpt/Paint Use Unified Radius +Index to the specific property affected by F-Curve if applicable +Main Window Managers +Unit to use for displaying/editing rotation values +Editmode bone in an Armature datablock +Bending Stiffness Maximum +Selection state of the curve point +Enable pinning of cloth vertices to other objects/positions +Shared +Zoom = Up/Down +NLA Strips +Text to search for with the find tool +Use a DCI Standard preset for saving jpeg2000 +Blend Mode +Space Sequence Editor +Textures Directory +Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes +Include the name of the active scene in image metadata +F-Curve Name Filter +Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox +pin_id +Fluid interaction radius +NLA Strip 'transitions' between adjacent strips +Editable +Emission +Template armature that will be retargeted to the stroke +Selection status +Texture slot defining the mapping and influence of a texture +Connected +Key +Align the transformation axes to world space +Transform parameters for a sequence strip +Layer Opacity +Use the Bullet physics engine +Method for generating shadow samples (for Raytrace) +Effect particles' dynamic rotation +Show options for whether channels related to certain types of data are included +G +Collection of group objects +Make hairs shorter +Show properties marked for debugging while the game runs +Invert x axis +Greek (Îλληνικά) +Smooth +Sync view position between side views +Used Layers +Active File Text +F18 +F19 +Force effector weight +The distance over which the mist effect fades in +Edge Select +F12 +F13 +F10 +Display Meshes +F16 +Options +Grease Pencil datablocks +F15 +Output video in AVI JPEG format +Sky Color +blend_data +Temporary Directory +Current rendering engine is a game engine +100% +Vertex Group Roughness 2 +IK Rot Weight +Handle Type +Bevel Weight +F-Curve Modifier Type +int +No Sleeping +Save TIFF with 16 bits per channel +ID Property Group +Island selection mode +Collection of texts +Edges collide too +512 +Sets minimum Y value for the render border +Mouse X Position +Active screen showing in the window +Stamp Note +Number of horizontal tiles to use while rendering +Tilt +Child Particle +Action Start Frame +Media Last +Pass in multilayer image +Back Space +Outflow +Active Boid State Index +Enable cluster collision between soft and soft body +Instance support leads to effective memory reduction when using duplicates +Xvid +Realtime display of a modifier +Sets the layer as active for display and editing +Wireframe +Grease Pencil Eraser Radius +Accurate, but slow when noise-free results are required +Syntax Special +Repeat +Global undo works by keeping a full copy of the file itself in memory, so takes extra memory +Strength of noise +Vertical +Separate +Self Friction +Snap median onto target +Area +Falloff +REC709 +Smooth the normals of the surface or beveled curve +2D View Minimum Grid Spacing +Font Style +Image datablocks +3D region in this space, in case of quad view the camera region +Sound datablocks +Auto Velocity +Data +Bake the normals in world space +Lock Camera and Layers +Vertex group to control rotation +Global +Sun Brightness +Optional custom node label +Align to Normal +Directory displayed in the file browser +Deliver speed vector pass +Enabled +Frame player from Tweak Software +Weighted result of strip is removed from the accumulated results +A animation layer containing Actions referenced as NLA strips +Key configuration that can be extended by addons, and is added to the active configuration when handling events +Dominant +Line Output +Seam edge for UV unwrapping +Options for this panel type +Menu Widget Colors +Main Worlds +Shadowed +11 +Atmosphere +Create representation for obstacle simulation +Estimated rotation matrix +16 +Pose +Sun size +NodeTree +RGB +2048 +Anaglyph +Active Object +Collection of curve splines +Marker highlighting a portion of text in a Text datablock +DopeSheet +Magnetic effector weight +Render face transparent and add color of face +Previous Rotation +Display Shapekeys +Aggression +en_US +Color space to use for internal XYZ->RGB color conversion +Numpad 7 +Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime +Keying Sets All +Boid +Numpad 6 +Snap Element +it_IT +Include the name of the foreground sequence strip in image metadata +Metaballs +Active particle system being displayed +Toggle between moving the viewpoint or moving the scene being viewed +Use a Gaussian filter for anti-aliasing +ChannelDriver Variables +MetaBall +Combined +FFmpeg video codec #1 +Use Default Fade +Numpad 3 +ZXY Rotation Order. Prone to Gimbal Lock +Index to the specific setting if applicable +Bake Mirror values +Use vBVH +Apply channel size as IK constraint if stretching is enabled +Invert Zoom Direction +Numpad 1 +Edge Sharp +Unit Settings +Stamp Frame +Brush datablocks +use global timestamp written by recording device +Mapping +Snap active onto target +Rigid Body Joint +Rate control: buffer size (kb) +Scale factor along the Y for items in this (sub)layout +RGBA +Half +Sets the number of rings rendered over the halo +Turbulence +Graph Editor instance has some ghost curves stored +Halo +No display +Stiffness Scaling +Use a custom falloff curve +Contents Follow Opening Direction +Off +Seam +Sculpt +Sequences +Stiff viscosity is a factor of normal viscosity +Curve Guide +Proportional Editing disabled +Rotate Around Selection +Key Maps +Minimum +Align newly added objects facing the active 3D View direction +Tool Properties +Amount of noise for the force strength +Amount of ray samples. Higher values give smoother results and longer rendering times +Numpad 8 +] +Exclude specular pass from combined +Stamp Scene +Collection of grease pencil layers +Choose Collision Type +Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption) +Particle system has been edited in particle mode +Stroke conversion method +Properties acting as inputs for this driver +Point Cache +Window Manager Event +Collection of brushes +Don't use a physics engine +Material Override +Temperature difference to ambient temperature +State determining which controllers are displayed +All Object Origins +Uses extreme alpha +Node Tree +Before Current +Array +Collision settings for object in physics simulation +Stretch To +F-Curves for controlling the strip's influence and timing +Field Order +Hide Dot Files/Datablocks +Loose +Use Game Engine +Onion Skinning (ghosting) settings for visualisation +Draw dashed black-white edges +Align handle selected color +Minimum number of pixels between each gridline in 2D Viewports +Sky +Spring Frames +Location of head end of the bone +Active key configuration (preset) +Width +Action Group is selected +Collection of Texture Nodes +Collection of add-ons +States which are being used by controllers +Gravity or external force vector +NLA Track is active +Ogg +Roll +Grless +Wheel Down +Amount of friction during particle collision +Search in all text datablocks, instead of only the active one +View pivot location +Draw image with RGB colors and alpha transparency +Resolution +Use the scene's active camera and layers in this view, rather than local layers +Every point is effected by multiple springs +Vertex +Include the filename of the .blend file in image metadata +Maximum distance error from contour to cells +Output video in H.264 format +Action displayed and edited in this space +History +Local View +Stamp Text Color +Translation +IK Y Maximum +File Select Parameters +Shared Vertex +Safe Margin +Tip Size +Edge color +Negate the effect of the size vertex group +Game engine controllers to process events, connecting sensor to actuators +Triangle Mesh +NLA Strip is played back in reverse order (only when timing is automatically determined) +Scale Y +H +Main Lamps +Approximate +Controllers +Deliver specular pass +The number of old versions to maintain in the current directory, when manually saving +Theme settings for the NLA Editor +Nearest Marker +Randomize star colors +Theme settings for the Sequence Editor +Index of refraction (higher values are denser) +Local Location +Default Key Configuration +Show background image while looking to the right +The space where the header is going to be used in +Max number of vertices per polygon +Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's +Averaged Value +Use a box filter for anti-aliasing +Spin CCW +Color to use for stamp text +Wheel Invert Zoom +Lock Camera to View +New Interpolation Type +Main data structure representing a .blend file and all its datablocks +Calculate bone paths from heads +Layer of vertex colors in a Mesh datablock +Is this keymap item user defined (doesn't just replace a builtin item) +Main Textures +Enable soft body shape matching goal +How many self collision iterations should be done. (higher is better quality but slower) +Collection of scene bases +Show right margin +Ambient Occlusion +Frame this control-point occurs on +Snap to edges +Turbulence effector weight +Build record run time code index +float +Use Edges as springs +Rings +Color Ramp Elements +Charge +Thickness +Zmask Layers +The panel label, shows up in the panel header at the right of the triangle used to collapse the panel +Spread +Cluster Iterations +Location +Weight Paint +15 - Theme Color Set +space_data +Vertex group to control kink +If this is set, the menu gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_MT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_MT_hello" +Path is being edited +ShapeKey Editor +AC3 +Set audio channels to 5.1 surround sound +Minimum Size +Path to a custom animation/frame sequence player +Smoke inherits it's velocity from the emitter particle +Display Lists +Maximum number of frames on either side of the active frame to show (0 = show the 'first' available sketch on either side) +Compress File +Bezier U +Displace +Velocity Max +Use Right Mouse Button for selection +Box Backdrop Colors +Exec Default +3 +Path point is selected for editing +Bone Group +When calculating Bone Paths, use Head or Tips +Project Individual Elements +Parameters for IK solver +Show the object origin center dot for all (selected and unselected) objects +BLI BVH +Realtime Updates +Shutter +How strongly the fluid tries to keep from clustering (factor of stiffness) +Target +Scrollbar +Show controllers of all selected objects +Instead of per brush radius, the radius is shared across brushes +screen +Use large mouse cursors when available +Keymap is defined by the user +Grease Pencil Stroke Point +48 kHz +Use the manipulator for rotation transformations +Bullet +Armature Bones +Directory +TimeCode Style +Identifier +Does full Sky texture render for diffuse energy +Items in the keymap, linking an operator to an input event +AvMinMax +Multiply the current speed of the sequence with this number or remap current frame to this frame +Apply force only in 2d +MPEG +Is this keymap item modified by the user +Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center +How smoothly the boids land +region +Swedish (Svenska) +Region in a subdivided screen area +Add indirect light bouncing of surrounding objects +Factor Radius +Obstacle +Color used for selected bones +Line Numbers +Draw edges after modifiers are applied +Space Info +Multicam Selector +Reflection Exclude +Weight of scale constraint for IK +Node editor space data +Link between nodes in a node tree +Show the entire viewport in the display window, viewing more horizontally or vertically +Pixel distance around the handles to accept mouse clicks +Initial State +Sum Values +Channel Group +Tools can use this to tag data, (initial state is undefined) +The default directory to search for textures +Lin error +F-Curve is selected for editing +Keying Sets +Release confirms +64 +Title for the file browser +Sets the audio sample format +Invert y Axis +Include the name of the last marker in image metadata +Collection of keyframe points +3D View space data +Vortex effector weight +Object adds fluid to the simulation +Use smoke velocity as texture data +Maximum Radial Distance +The axis to display the image on +Keying set options +Horizon Brightness +Render Engine +Display Particle +Exclude AO pass from combined +Lights user to display objects in solid draw mode +Textbox Height +Point coordinates +Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector +Text Editor +Use display lists to speed up rendering by keeping geometry on the GPU +Actuators +Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled) +es_ES +Auto Run Python Scripts +Subtract +Screen Editing +Properties in the struct +Set audio sampling rate to 96000 samples per second +Scale to use when converting between blender units and dimensions +Mouse/Trackpad Zoom +X Ray +Maximum distance of reflected rays (reflections further than this range fade to sky color or material color) +True when this property is an output value from an RNA function +False when F-Curve could not be evaluated in past, so should be skipped when evaluating +Fresnel Factor +Minimum for slider +Use Goal +Sets how the texture is extrapolated past its original bounds +Minimum size of strands in pixels +Points +Motion Path +Emission Color +Global maximum shadow samples +Path +Action +Sets the number of sub-flares +Used State +Update other affected window spaces automatically to reflect changes during interactive operations such as transform +Filter Script +Method to interpolate/smooth values between voxel cells +Gives halo a texture +Show markers belonging to the active action instead of Scene markers (Action and Shape Key Editors only) +Divide +Proportional Editing mode, allows transforms with distance fall-off +Angular distortion between UV and 3D angles +Random variation of damping +Channels Selected +plugin +Spline IK +The frame on which the timeline marker appears +Snap to 1.0 frame/second intervals +Handle 1 selected +Free all image texture from memory after render, to save memory before compositing +Method used for combining Active Action's result with result of NLA stack +If enabled, stiffness can be scaled along a weight painted vertex group +Invert z Axis +Minimum regions size. Smaller regions will be deleted +Display Mode +Text bounding box for layout +Onion Skinning +Open +User Add-Ons +Output file format +Size +Backdrop X offset +Active Pose Marker Index +Text Marker +Number of preprocessing passes to reduce overocclusion +Modifiers affecting the shape of the F-Curve +Wheel In +Mesh Face +Rotation Angle +Path to a setting for use in a Keying Set +Sync Markers with keyframe edits +Whether to use minimum clipping value +Main Actions +Editing context being displayed +Raytraced refraction settings for a Material datablock +Enable image painting mode +Hidden +When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates +Only show and edit handles of selected keyframes +Cinema 48fps 2048x1080 +Max Rate +Envelope Head Radius +Use old Octree structure +Global maximum subdivision level +Use this object's coordinate system instead of global coordinate system +Viscosity +Theme Properties +Boolean Property +UV Selection Mode +Force the curve view to fit a defined boundary +Objects +Default (Default) +Shade Down +Grease Pencil Layers +Current Keying Set index +Shadow Exclude +Root Size +Rest Shade Key +Framerate, expressed in frames per second +Scrollback +Overlay Lock +Duplicate Text +Russian (Ð ÑÑÑкий) +10 - Theme Color Set +Collection of texture slots +ID Materials +I +The distance from which particles are affected fully +Action Pose Markers +Clamp velocity to this maximum speed +English (English) +JPEG +L +Display only files with extensions in the image select window +Theme Sequence Editor +ID From +All Scenes +Make hairs longer or shorter +Handle Vertex Select +With displacement normalize to the distance, with ambient occlusion normalize without using material settings +Physics +ID +Mesh Vertex Color Layer +Use curve weights to influence the particle influence along the curve +Cached location on path +Motion +Node tree being displayed and edited +Tangent Shading +Mesh Vertex Color +B-Spline +Based on distance/falloff it adds a portion of the entire path +Theme settings for the Audio Window +Displacement +Coordinates of the second handle +Rendering settings for a Scene datablock +Radius of boids personal space on land (% of particle size) +Live Edit +The length of the contents of this strip before the handles are applied +Display Armature +Length Mode +Display datablocks of active object +SDL +Collection of Nla Strips +Amount the Active Action contributes to the result of the NLA stack +Show only actuators connected to active states +Vertex group for fine control over bending stiffness +4 Channels +Bake displacement +Acceleration +Angular Velocity +Boid Rule +Action Group +Split quads predictably (0,1,2) (0,2,3) +Struct definition this is derived from +Include the current date in image metadata +Action Group is expanded +Draw title safe margins in preview +Output image in DPX format +Include visualization of Object-level Animation data (mostly Transforms) +Proxy size 25% +16 bit color channels +The default directory to search for sounds +Log +Redraw all overlapping regions, minimal memory usage but more redraws +International Fonts +5.1 Surround +Linear +Settings that should be keyframed together +Factor Repulsion +Overlap Flip +The active face for this mesh +Turn on SB diagnose console prints +Dome +Brazilian Portuguese (Português do Brasil) +Make hairs stand up +Uses the vertex normal to specify the dimension of the halo +Key maps configured as part of this configuration +Active Space +4 +Theme Text Editor +Method to display/shade objects in the 3D View +Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled) +Normalized Coordinates +Glow +Diffusion +Enemy +Co-ordinate system to cache vertices in +Show state panel +Show ghosts on keyframes +Anti-Aliasing +Zoom Axis +Reactor Target Particle System +First input for the effect strip +Radians +Free Nodes that are not used while compositing, to save memory +Transform +Free handle selected color +Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled) +Button 10 +Amplitude +Show Active States +Space Nla Editor +Vertex group to control length +In text window, paste with middle mouse button instead of panning +Collection of object constraints +Transparent RGB pixels are multiplied by the alpha channel +Calculates environment map at each rendering +Deform +Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels +Tweak Right +44.1 kHz +Include visualization of Texture related Animation data +Set layer Visibility +Deliver mist factor pass (0.0-1.0) +Sort files by modification time +Minimal # solver steps/frame +Have recent edits been saved to disk +Keying Set Paths to define settings that get keyframed together +Pressure of tablet at point when drawing it +Show background image while looking to the left +Sharp +Only include F-Curves with names containing search text +Number of spaces to display tabs with +Puff Volume +Video bitrate(kb/s) +Linear Stiffness +Vertex Group Tangent +Amount of dithering noise added to the rendered image to break up banding +Absorption +Find Wrap +Enable hair dynamics using cloth simulation +The type of the Sequencer view (sequencer, preview or both) +Number Widget Colors +File Extensions +Theme Node Editor +Object Duplicate +Goal Maximum +Size of element, use of components depends on element type +Word Wrap +Any +More than one rendering engine is available +Cached positions per frame +Control key pressed +Collection of armatures +Gloss Anisotropy +Tracking by taking the shortest path +Spherical falloff +Objects further than this are not visible to map +Driver could not be evaluated in past, so should be skipped +Insert Keyframes - Visual +Rule Evaluation +Negate the effect of the velocity vertex group +The frame number to always use +ca_AD +Visibility +Bone associated with this PoseBone +Envelope Deform Distance +Invoke Area +Theme Info +Current Keying Set index (negative for 'builtin' and positive for 'absolute') +Black +Lock editing of location in the interface +Interface +Auto Keying Enable +Save luminance-chrominance-chrominance channels instead of RGB colors +Left Ctrl +Multiplier to adjust velocity passed to smoke +Font size and resolution for display +Extreme +Show Controllers +Render engine +Render image to two fields per frame, for interlaced TV output +To socket +Activate TRUE level triggering (pulse mode) +Temp. Diff. +Expanded +Target particle system +Which part to snap onto the target +local space unit length normal vector for this face +Keying Set Name +Python Console +Show Hidden +The region relative horizontal location of the mouse +Nurb active V-lines +Set position of selected color stop +Fixed size UV coordinates array +Reactor Target Object +Node tree type to display and edit +Display datablocks in current scene +Color and Alpha +Causes texture data to be duplicated with the object +Item in a Key Map +3D View region data +Display face-assigned textures in solid view +Disable simulation of linear motion along the Z axis +Point of a curve used for a curve mapping +Include visualization of Metaball related Animation data +Structural Stiffness Maximum +Factor Density +Simple Deform +The default color for textures that don't return RGB or when RGB to intensity is enabled +Name of UV unwrapping layer +Outputs +Images +Message +Ray +Theme Bone Color Set +Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping) +IK stiffness around the Y axis +Edge spring stiffness when shorter than rest length +Menu Backdrop Colors +50% +Heads +Stereo Mode +Soft body simulation settings for an object in the game engine +Show Framerate and Profile +Right Shift +Direct conversion of frame numbers to seconds +Log conversion reference whitepoint +Radius +Linear stiffness of the soft body links +View3D Rotate Modal +SMPTE +Add +Show framerate and profiling information while the game runs +Degrees +Gather Method +Output +Set audio sampling rate to 192000 samples per second +End +Include visualization of Material related Animation data +Sets the layer as active for cloning +Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing +When bone doesn't have a parent, it receives cyclic offset effects +Enable self collisions +Property is registered as part of type registration +Syntax Comment +Draw Particles +area +Basis Matrix +Active vertex color layer +Image and UV editor space data +Set metaball as negative one +Collection +JPEG Quality of proxies to build +Zbuf +Show the Z axis line in perspective view +Tails +Show Active Object +Defines size of derivative offset used for calculating gradient and curl +Color Set +Integer +Output image in bitmap format +OpenAL +Particle Systems +Display the user preference datablocks +Size of packed file in bytes +Ukrainian (УкÑаÑнÑÑкий) +Mono +No proxy, full render +Fullscreen +Allow scaling of the bone for IK +Creates viscosity for expanding fluid) +J +Blend mode for combining sun sky with world sky +Global Undo +Quicktime +Draw frames rather than seconds +Bake shading on the surface of selected objects to the active object +Frame currently being displayed for this layer +Never None +alignment +Bulgarian (ÐÑлгаÑÑки) +Light +Maximal Spring length * Ball Size +Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option) +Text datablocks +Welding +Heavy +Quick Sketching +Method used to determine color of F-Curve in Graph Editor +Show UV Editor +Cut hairs +Expand +Effect particles' location +View Matrix +Allow boids to climb goal objects +Sequence +Bone Name +Seed of the noise +Motion Path Cache Point +Use modifier while in the edit mode +Meshes +For reactor systems, index of particle system on the target object +Billboard +Automatically set based on graphics card and driver +Macro Operator +DopeSheet Channel +Render and combine multiple samples per pixel to prevent jagged edges +Render Z-Transparent faces in this Layer (On top of Solid and Halos) +Output image in uncompressed Targa format +Paths +Left Arrow +Collection of spline bezirt points +Layout +Show Physics Visualization +Number of bones in the subdivided stroke +Vertex Group Clump Negate +Negate the effect of the tangent vertex group +Base type for IK solver parameters +Active camera used in this view (when unlocked from the scene's active camera) +Re-render and composite changed layer on 3D edits +ISO 2 +Active Layer Index +Esc +Show Frame Number Indicator +End Offset +Use active Viewer Node output as backdrop for compositing nodes +Blender command line animation playback - path to Blender 2.4 +Frequency +Pivot around the median point of selected objects +Blend vertex colors across face when vertices are shared +Game engine logic brick to detect events +Causes the image to repeat horizontally and vertically +Bone location is set in local space +User Preferences +Show Operator +Max Logic Steps +Damping of the harmonic force +Vertex of a simulated fluid mesh +Graph Editor Generic +18 - Theme Color Set +Average Speed +Console +Total number points for the surface on the V direction +Use the manipulator for scale transformations +Disable +5 +13 - Theme Color Set +Vertex group to control field +12 +Shared Location +Transparent pixels are filled with sky color +Atmosphere Turbidity +Widget Style +RNA function definition +NLA Strip is not evaluated +Recast Data +4096 +Right Handle Selected +Cyclic +Color Ramp +Self Collision Quality +Index of active pose marker +Vertex Group Density Negate +Dome Mode +Image and settings for display in the 3d View background +Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist +FPS +Normals +SIMD SVBVH +Minimum distance between collision objects before collision response takes in +Color balance gamma (midtones) +Minimum distance for the field's fall-off +Limit fluid objects to this group +Load UI +Factor Stiff Viscosity +Draw preview using full resolution or different proxy resolutions +Paint Lock +Sets the number of samples used by the audio mixing buffer +Source List +Around Current Frame +Scroll Handle +Add light coming from the environment +Color of the F-Curve in the Graph Editor +Exclude indirect pass from combined +Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC +Bias +Text Input +Pitch +2D +Braid +Modifier name +Use extra textures like normal or specular maps for GLSL rendering +Stamp Marker +ZXY Euler +Function does not pass its self as an argument (becomes a class method in python) +Sun Intensity +Fit +AO Exclude +Integer Property +Tube +ZYX Rotation Order. Prone to Gimbal Lock +Default paths for external files +Solid +Lock the same rotation/scaling pivot in all 3D Views +Groups of F-Curves +Display the object solid, with face-assigned textures +Quadratic +ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only) +Inaccurate, but faster and without noise +Unique ID for this region +Lock Y Axis +Logic Nor +Gaussian +Euler +Settings for filtering the channels shown in Animation Editors +Invoke Region Channels +Crop the rendered frame to the defined border size +Limit Location +Radius of the brush in pixels +Automatically select also UVs sharing the same vertex as the ones being selected +Title +Histogram +Display raw datablocks +Bone deformation distance (for Envelope deform only) +Forcefield based on the Lennard-Jones potential +Action Group is locked +XYZ Euler +Outline Width +Upper First +Subdivide stroke in fixed number of bones +Action Clip +Use 16 bit floats instead of 32 bit floats per channel +Stamp Camera +Texture Nodes +Falloff power (real gravitational falloff = 2) +3D View near clipping distance +Color Randomization +Snap Peel Object +Determine the amount of render threads used +Amount +F-Curve +Zmask scene layers for solid faces +Bone Group this pose channel belongs to (0=no group) +Constraint's panel is expanded in UI +Collection of Color Ramp Elements +Grease Pencil +Show controllers of active object +Instead of per brush strength, the strength is shared across brushes +Allow boids to move on land +Negate the effect of the clump vertex group +` +Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis +Highlight the current line +Simplify Child Particles +Lattice +Timeline Markers +Draw actual particles +XYZ +Collection of spaces +Bake Mode +Sub +Enable Stereo environment +F-Curve defining values of a period of time +Rules are gone through top to bottom. Only the first rule that effect above fuzziness threshold is evaluated +Constraint to stay within the image bounds while editing +Only Selected Curve Keyframes +Scroll Bar +Theme settings for Font +Allow Climbing +Syntax Highlight +ASCII +Properties space data +Lamp datablocks +Pivot around bounding box center of selected object(s) +Max Res +Mouse Previous X Position +Simplify the final stroke +Frame is selected for editing in the DopeSheet +OS Key +Function is optionally registered as callback part of type registration +Ease +Renders halo as a star +NLA Channels +Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC) +nl_NL +Alt key pressed +Limit movement around the Y axis +Z Scale +Actuator +Motion Path for this element +Slider Widget Colors +Name of Vertex color layer +Xnor +Bone Group this pose channel belongs to +Quad View Region +Edge Split +Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges +Max Air Angular Velocity +Use Bone Sketching +Automatic keyframe insertion using active Keying Set only +Colors +Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method) +Show script files +Cloth simulation settings for self collision and collision with other objects +Object to use as the environment map's viewpoint location +The interpolation type for this curve element +Vertically Open +Show the expanded in the user interface +Emit Object Location +Toggle Widget Colors +Rotation +Current Transformation orientation +Total number points for the curve or surface in the U direction +Active Particle System Index +Material Physics +Pull +List Item Colors +Show a small rotating 3D axis in the bottom left corner of the 3D View +Add-Ons +Render face with texture +Tilt Interpolation +K +Collection of particle systems +Text editor space data +Zoom +Goal minimum, vertex weights are scaled to match this range +When deforming bone, multiply effects of Vertex Group weights with Envelope influence +F-Curve Sample +Radius of eraser 'brush' +Finnish (Suomi) +Turbulent noise driven by the global current frame +Raytraced reflection settings for a Material datablock +Convert effector force into air flow velocity +True when the Shift key is held +Audio Sample Format +Bold +Vertex colors for a face in a Mesh +Cursor +Mouse/Trackpad Pan +Display Paths of poses within specified range +Info space data +Duplicate Armature +Settings for Bullet soft body simulation +Name of the theme +Collection of scene objects +B-Bone Display Z Width +Zoom using up/down on the device (otherwise forward/backward) +Enter Edit Mode automatically after adding a new object +Apply gravitation to point movement +Info on current cache status +Cone +Lock Z Rotation Axis +GLSL Extra Textures +Starts player in a new fullscreen display +Named Group +Samplerate +Children expanded in the user interface +Border +Armatures active bone +Active Path Index +Texture Type +Amount of clumping +Style +Collection of render layers +Show Restriction Columns +Soft Body +Drag effector weight +Layers visible in this 3D View +Top +Quality of the simulation in steps per frame. (higher is better quality but slower) +The constraint is applied in Pose Space, the object transformation is ignored +View Rotation +Gravitation +Cardinal +Dolly +8 bit greyscale binary data +Chroma Vectorscope +Active bone group for this pose +Repulsion Factor +Object Constraints +Filter Text +Vertex group to control tangent +Default builtin key configuration +Show folders +Page Down +Elements +View3D Zoom Modal +Show Actuators +Deletes smoke from simulation +Filter File Extensions +Control point selection status +Left Handle Selected +Draw Stretch +Align rotation with the snapping target +Cloth +Show the name of the view's direction in each 3D View +Display Filter +Object does not restitute collisions, like a ghost +Particle Velocity +Relative time of key over hair length +6 +Threshold for drawing outlines on geometry edges +Lighting +MPEG-4 +Delete +MPEG-2 +Curve Edit +Distance of the physics area +Boid Settings +Pixel resolution of the rendered environment map +Goal maximum, vertex group weights are scaled to match this range +Vertex Group Roughness 2 Negate +Manipulator Rotate +Limits +Current Frame +Project to Self +Sticky texture coordinate location +Transition +Duplicate Texture +Mask +Description of the Function's purpose +Generate voxels from a sequence of image slices +Theme settings for the Node Editor +Automatic time snapping settings for transformations +Banking +Texture Plugin Directory +Mass +Mist settings for a World data-block +Show column +Tool Widget Colors +Clip Alpha +Retarget +Drag component proportional to velocity +Blocking +Mirror Colors +Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method) +Bars Selected +Use a minimum radial distance for the field's fall-off +Edit Object +Cineon +Height +Texture Factor +Draw Wire +Manipulate object centers only +Custom color set to use +Negate the effect of the density vertex group +SL +Enable Self Collision +Correction +Self Minimum Distance +Keying set paths +Invoke Region Preview +Causes material data to be duplicated with the object +Sample Distance +Vertex Group Field +Multiplier to make out-scattered light brighter or darker (non-physically correct) +Object Selected +Keyframe Selected +Pose Bone +Set sensor expanded in the user interface +Theme Audio Window +Strip Time +Number of frames from start frame for influence to fade out +Codec +Speaker +Image Generic +3D Region +Copy Scale +Duplicate Surface +Particle key for hair particle system +Particle Edit +Number of cone samples averaged for blurry refractions +Keep from going through other boids +Output image in DDS format +Orig Height +In Air +Constraint was added in this proxy instance (i.e. did not belong to source Armature) +OpenGL shading language shaders +Render the stamp info text in the rendered image +read only area of the face +Exec Region Channels +Smoke collides with every side +Enable Collision +The mouse button used for selection +How strong a force must be to start effecting a boid on land +Imperial +Vertex Group Length +SDL device - simple direct media layer, recommended for sequencer usage +Pixel Aspect Y +Shadow +Show the active object's softbody point cache +ZIP (lossless) +Collection of Compositor Nodes +Viewport Shading +Mean red/green/blue scattering path length +Ball inflating pressure +Snap to nearest marker +Vertical aspect ratio - for anamorphic or non-square pixel output +Window Sliders +Color ramp mapping a scalar value to a color +Make hairs less puffy +Active UV texture index +Location of head end of the bone relative to its parent +Display Texture +Group Node +Collection of meshes +Continue +Grease Pencil Smooth Stroke +Set audio mixing buffer size to 4096 samples +Transparent RGB and alpha pixels are unmodified +Nearest Neighbor +Gives a constant force along the force objects local Z axis +Emit +Bake the normals in tangent space +Active Base +Active UV texture +Falloff Curve +Sun intensity +Collection of related sketches on a particular frame +Vector Fonts +Mesh Edit +String Property +Variables +3D View Space +Show the active object's particle point cache +Cinema 24fps 2048x1080 +The default directory for rendering output, for new scenes +Audio bitrate(kb/s) +Font Size +File +Automatically converts all new tabs into spaces for new and loaded text files +Search again from the start of the file when reaching the end +Driver variable type +Search term for filtering in the UI +Show UV editing related properties +Subdivision Surface +Mipmaps +Simplified Chinese (ç®ä½ä¸æ) +Edge Length Text +View2D +Step Size +All effector's weight +GOP Size +Bottom +Color balance lift (shadows) +True when this value can't be set to None +The color of the lights specular highlight +Free Run (Rec Date) +How much the spring rest length can change after the elastic limit is crossed +Nand +Background Images +Vertex Group Roughness 1 Negate +Follow a boid or assigned object +Collection of Shader Nodes +Show Brush +Save Preview Images +Use Influence +Add/Replace +Enable direct editing of modifier control cage +Overwrite characters when typing rather than inserting them +Multitexture +Full +Modifier affecting the geometry data of an object +Text to replace selected text with using the replace tool +Particle Age +Unique name used in the code and scripting +Movie Strip +Python Scripts Directory +Global user preferences +Proportional Size +Location of the hair key in object space +Window Manager +Selectable +Diffuse subsurface scattering settings for a Material datablock +Air Personal Space +Which axis to use for offset +Sound +Include Animation Data blocks with no NLA data. (NLA Editor only) +Tree Type +The index of particle system on the target object +Noise algorithm - Voronoi F1-F2 +Autosplit Output +Type of transition used to fade mist +Logic Nand +Enable this OpenGL light in solid draw mode +Explode +Tilt CW +ID-Block +Diffusion factor, the strength of the blurring effect +Rate control: min rate(kb/s) +Alter spring length to shrink/blow up (unit %) 0 to disable +Object is made a particle system to display particles generated by a fluidsim domain object +Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart) +channels +Head Select +Nearest Frame +WPaint Auto-Normalize +View3D Gesture Circle +Active index in render layer array +True when the Cmd key is held +When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used +Poly +Name of the key map +Roll bones to face the view +Cycle the animated time within the action start & end +Metaball Edit +Use anti-aliasing for the 3D view (may impact redraw performance) +Key Configuration +NLA editor space data +Sounds +Noise formula used for turbulence +Show Thumbnails +Output video in AVI Raw format +Shape Keys +Cloth simulation settings for an object +Transparency along the width of the strand +Name of UV layer to override +Custom animation player executable path +Spring Vertex Group +Luma Waveform +Goal Damping +French (Française) +tool_settings +3D Cursor +Collection of lattices +Display +Center of mass +The type of radius interpolation for Bezier curves +Global approximate AA and SSS quality factor +Type of data to take texture from +Build +Logic Xor +Backdrop zoom factor +Collection of worlds +Python addons to be loaded automatically +Proxy size 50% +Intensity of the mist effect +UV Editor +Opacity +JPEG 2000 +ID Type +Wires +Texture Face +The default directory to search for sequence plugins +Physics settings for a Material datablock +Size of the turbulence +Plastic +Viscoelastic Springs +Keyframe Insert Needed +Threads Mode +Exclude environment pass from combined +Display an additional 'summary' line. (DopeSheet Editors only) +Blend factor with sky +BMP +Obstacle simulation +Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled +7 +Enable naive vertex ball self collision +Text Character Format +Particle System +Active section of the user preferences shown in the user interface +Outliner +Don't use any brush +Pulldown Widget Colors +Duplicate Lamp +Spring rest length (factor of particle radius) +Softens the edges of halos at intersections with other geometry +None +ko_KR +Only Matching F-Curves +Active Particle Target +TIFF +Keyboard +Strand settings for a Material datablock +" +Material Index +Targa Raw +Name that will be used in exported files when format supports such feature +F-Curve is not evaluated +Texture Collection Rate +Blend +Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy +rect +08 - Theme Color Set +Sharp falloff +Proxy Local +Repulsion Distance +Method used for combining strip's result with accumulated result +Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity +Syntax Numbers +Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF) +Global Space +Save the z-depth per pixel (32 bit unsigned int z-buffer) +Curving of the noodle +View Type +Children Expanded +Shape +Background Image +Dash +Pass +Snap to Pixels +Engine +Vertex Select +Specular Exclude +Color 2 +Brush strength +Control point weight values +Maximum memory usage in megabytes (0 means unlimited) +Pivot around each object's own origin +Island +Softbody goal weight +Exclude shadow pass from combined +Method for driving added turbulent noise +Sampled colors along line +Offsets the number of the frame to use in the animation +Maximum angular velocity on land (relative to 180 degrees) +Start Frame +Middle Mouse Paste +Edge Seam +Display UV coordinates from 0.0 to 1.0 rather than in pixels +Find Text +Inverse Gamma +Smooth hairs +Graphics driver and operating system settings +How much density effects smoke motion, higher value results in faster rising smoke +passes +Boid rule name +Maximum number of recently opened files to remember +Path to property setting +Level of detail in the added turbulent noise +Screen +Billboard Normal UV +Selects the type of physical representation +Clip End +Creates a force along a curve object +Time delay in 1/10 seconds before automatically opening top level menus +Autosplit output at 2GB boundary +Resolution Y +Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid +Gamma +Light Cache +Offset +Voronoi F2-F1 +Hair keys are in global coordinate space +Structs +Particle system name +Don't adjust roll +Bevel +UI Layout +Movie Format +Fast but not so effective compression +Use linear workflow - gamma corrected imaging pipeline +Delta +Gravity +Mist uses linear progression +BSpline +Type of element to snap to +Set audio mixing buffer size to 32768 samples +Show the Y axis line in perspective view +Action End Frame +Settings for input devices +Joystick +Window manager datablocks +Left Handle Type +Points U +bl_description +Collection of mesh edges +Clip objects based on what's visible in other side views +Object Grouped +Backscattered Light +Active grease pencil layer +Animated Influence +Atmosphere Inscatter +Color of emitted light +Lock Location +Active Vertex Color Layer +Spaces +Properties of particle editing mode +Area height +Material nodes +Collection of armature bones +Resolution U +Click +Filter Files +Display general information +Bone Groups +Overlay +Muted +Movie +Auto Clamped +Individual Origins +Overlap +Custom +Particles +Use Max +Window +File browser space data +AVI JPEG +Friction Coefficients +Object base selection state +Bone Pose +Sequence strip in the sequence editor +Display Background Images +Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit) +User defined layer of floating pointer number values +96 kHz +Occlude +Images are rendered in Image Editor +States +Saturation +Location of this character in the text data (only for text curves) +Users +Scene Objects +Goal Stiffness +Audio Codec +Collection of objects +Type of NLA Strip +Minimum distance to the camera for stars +Main Scenes +Clips to image size and sets exterior pixels as transparent +Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe +Radius from the shaded sample to look for points within +Layer of texture faces in a Mesh datablock +Tangent +Stamp Time +Comb hairs +24-bit Signed +Show Handles +Alpha +Difference +The frequency of the offset (1/total length) +Layer Membership +Render layer +ro_RO +Vector Coordinates +Spring force +Flare Boost +Scopes +Description of the item's purpose +Camera Parent Lock +Invert the axis of mouse movement for zooming +Socket name +M +Enable diffuse subsurface scatting effects in a material +Color Factor +Noise algorithm - Cell Noise: Square cell tessallation +For PoseBone paths, use the bone head location when calculating this path +Max Land Speed +Show linked objects to sensor/actuator +Edit drivers +F-Curve Modifier is the one being edited +Channel Matrix +Has Ghost Curves +Threshold for adaptive sampling (if a sample contributes less than this amount [as a percentage], sampling is stopped) +Selects which domain border will be treated as collision object +Object that defines custom draw type for this bone +Still Frame Only +Invert tilt axis +The name of the active key configuration +Apply sun effect on atmosphere +Spacebar +Limit effectors to this group +Keep paths from intersecting the emitter +Input or output socket of a node +Transform Channel +Storage of a macro operator being executed, or registered after execution +Sets the number of points on the star shaped halo +Display the object's local bounding boxes only +Goal (vertex target position) spring stiffness +Boolean +Cyclic U +Cinema 24fps 4096x2160 +Images are saved with RGB and Alpha data (if supported) +Cyclic V +Indirect +Show Points +Speed +Copy Location +GLSL Lights +resolution_x +All available keying sets +Specular Color +Convert to logarithmic color space +Show keyframes for active Object and/or its selected bones only +Use Visual keying automatically for constrained objects +Game Property +Merged Region Size +Material Halo +Flare Seed +No Gimbal Lock (default) +Bending Const +Null device - there will be no audio output +Main Fonts +Sensor +Output image in Cineon format +Set audio sample format to 64 bit float +Whether to use maximum clipping value +Display units in pairs +Form factor scales the inertia tensor +Filter Images +Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard +Draw UV edges anti-aliased +Search string is sensitive to uppercase and lowercase letters +Region Text Titles +Flow Settings +Texture Slot +Enable debug visualization for obstacle simulation +Wrinkle coefficient. (higher = less smaller but more big wrinkles) +Action to take for gaps past the Active Action's range (when evaluating with NLA) +Spring rest length is a factor of 2 * particle size +Mist uses quadratic progression +Base +Enter Edit Mode +Widget Label Style +For Zmask, only render what is behind solid z values instead of in front +Face Angle Text +8 +Face Dot Size +Grow +Strips +Vertex group to control roughness end +Texture Slots +Snap UVs to pixel locations while editing +Border Minimum X +Value +Button5 Mouse +Roll CCW +Deprecation Warnings +Source List Title +Collection of fonts +Effector weights for physics simulation +2 +Input line for the interactive console +; +Soft body +Display Lamp +Tail Select +Rotation in Quaternions +Main MetaBall +Right Alt +Waveform Mode +Audio samplerate(samples/s) +Random +Harmonic +hr_HR +Themes +Texture scatting blend factor +Selected File +Cache AO results in pixels and interpolate over neighbouring pixels for speedup +double +Negate +Mute this shape key +Fgon +RVO (rays) +External file packed into the .blend file +Causes text data to be duplicated with the object +Include visualization of Speaker related Animation data +Zoom factor +Tweak Select +Shape Match +Spherical forcefield based on the charge of particles, only influences other charge force fields +Active Boid Rule +Active index in bone groups array +IK stiffness around the X axis +Go to assigned object or loudest assigned signal source +Wait Timer (ms) +The region relative vertical location of the mouse +Mouse/Trackpad Rotate +02 - Theme Color Set +Show Control Curves +Time taken in frames between shutter open and close +Textured Solid +Tail +Lift Force +The type of event, only applies to some +Targets +Main Texts +Draw Axes +Space data type +Subsurface Scattering +Mesh Vertex +Max Slope +Specular Intensity +Smoke collision settings +Cubic +Set all state bits +Action to take for gaps past the strip extents +Neutral +UV mapping, texturing and game engine data for a face +Minimum value for clipping +zh_CN +Wheel Scroll Lines +Shadow color in grey value +The constraint is applied relative to the world coordinate system +Icon File +Theme Console +Step Calculation +Amount the strip contributes to the current result +Shape Key Bezier Point +Smoke doesn't collide with top and bottom sides +Fastest and gives the most noise +Source of input values for driver variables +Show Keyframe Numbers +Image opacity to blend the image against the background color +Outline +window_manager +DDS +Show key map event and property details in the user interface +Bake ambient occlusion +Long List +Manual +Kink +Display Metaball +View Location +Radio Widget Colors +Weights +Cache of the worldspace positions of an element over a frame range +Theme settings for the Text Editor +Number of frames for Blending In/Out is automatically determined from overlapping strips +Collection of Driver F-Curves +Use SIMD QBVH +UV/Image Editor +Use degrees for measuring rotation +Resolution of the voxel grid +Physics Gravity +bl_idname +Name of the key configuration +Agent Radius +Keyed particles target is valid +Use force fields when growing hair +Point in the lattice grid +The amplitude of the offset +End Frame +Lets halo receive light and shadows from external objects +Pivot +Maximum walkable slope angle in degrees +Permeability +User defined floating point number value in a float properties layer +Render Result +Objects nearer than this are not visible to map +Pivot around active object +Operator Node +Local With Parent +Blender RNA structure definitions +Radius of bounding sphere and material physics +Bezier +Blend Type +Original Perlin +Active UV Texture +Active Object constraint +Armature-Relative Head +F-Curve's settings cannot be edited +7.1 Surround +Fluid Mesh Vertex +Long Key +Do not show any ghosts +Frame for absolute keys +Wav +Preview +[ +ObData +Emulate Numpad +Theme settings for the Timeline +Cell Size +Clamp velocity to this minimum speed (except when totally still) +Specify old mapping value in frames +Type of texture data to display and edit +Show ghosts for the specified frame range +Radius for bevelling +Maximal # solver steps/frame +Copy Rotation +07 - Theme Color Set +Use object/global coordinates for texture +If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label) +Sequence Element +Use rule when boid is flying +Simplify Shadow Samples +Deliver indirect lighting pass +Particle Key +Time since last step in seconds +Properties +Y Scale +Minimum Radial Distance +Sampled Points +Theme Logic Editor +Use Stars +Manipulator Translate +Brush steps +Active Pose Marker +F-Modifier +N +True when the Alt/Option key is held +Decimate +Use multi-sampled 3D scene motion blur +Type of active data to display and edit +Permanent deform +Onion Skinning Settings +Mode of automatic keyframe insertion for Objects and Bones +Theme settings for bone color sets +Scopes for statistical view of an image +Push +Show Seconds +Logic Or +Buffer Resolution +Create a toon outline around the edges of geometry +Regions +Damped Track +Active Bone Group Index +Automatically select acceleration structure +Specify a collision bounds type other than the default +Auto-Clamped handle color +Vertex Group Roughness End +Sets the maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics +Control Point +Particle count +Turntable +Use Weight Color Range +Octree +Environment Exclude +Fuzziness while on collision, high values make collision handling faster but less stable +Tweak +Marker +Shadeless +Align handle color +Mist +Scene Render Layer +Sequence editing data for a Scene datablock +Structural Stiffness Vertex Group +Meta Stack +Duplicate F-Curve +Show sound files +Render layer name +Index of active particle system slot +Roll bone to original joint plane offset +Filter Fonts +Material Subsurface Scattering +Tip +Invalid +Show Cache +Delay +Blend factor for SSS colors +Fluid Group +Causes F-curve data to be duplicated with the object +Stationary object +el_GR +Compression method to be used +Speaker datablocks +B-Bone Ease In +Relative Paths +Mesh Int Property Layer +Enable smoke to disappear over time +Double Click Timeout +Cell Noise +Particle system has multiple point caches +Human readable name +The object that has the target particle system (empty if same object) +Maximum acceleration on land (relative to maximum speed) +Legacy +Clip alpha below this threshold in the 3D textured view +Display a preset button with the operators settings +Force gets absorbed by collision objects +9 +Noise method which is used for creating the high resolution +Manipulator +Select UVs that are at the same location and share a mesh vertex +Shadow offset in pixels +Bake directly from multires object +Insert +Wind effector weight +DopeSheet Editor +Entire Array +Use smoke heat as texture data. Values from -2.0 to 2.0 are used +Sequence Color Balance +Disallow movement around the X axis +Scenes +Active KeyConfig +Distance between two bones or objects +Rate control: max rate(kb/s) +Active file in the file browser +Limit collisions to this group +Nurbs weight +Outline Selected +Extrapolate the curve or extend it horizontally +Right Handle +Collection of mesh vertices +Smooth the final stroke +Current Transform Orientation +F-Curve live filtering string +Softness of the 'soft' falloff option +Selection Mode +Proportional Editing +Collection of keying set paths +Build 25% proxy resolution +DBVT culling +Armature Edit +Show Datablock Filters +A valid edit mode exists +World Mist +Default Value +Full Screen +Text in the line +Quality +A container referencing an existing Action +Layer name +Auto Start +Visualization +Show text files +Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion) +Snap Align Rotation +Angle of Rotation for Axis-Angle rotation representation +192 kHz +From socket +Nurb active U-lines +Constraints that act on this PoseChannel +Cyclic Strip Time +Space Outliner +Constraint has valid settings and can be evaluated +Debug +Pose Bones +Show image files +Goal maximum, vertex weights are scaled to match this range +Puff +Right Handle Type +Include the name of the active cameras lens in image metadata +Sky Color Space +Include visualization of Armature related Animation data +Character Index +Pin (vertex target position) spring stiffness +Open source frame player: http://djv.sourceforge.net +Grab Pointer +Bone is not able to be transformed when in Edit Mode +Show linked objects to the controller +Blend Distance +Edited +The mode used to apply the texture +Locked Track +File Browser +Vertex weight group, to blend with basis shape +The type of keyframe (for visual purposes only +Obstacle Radius +Drawing method used by the window manager +Active Particle Target Index +Front +Enable starfield generation +Particle datablocks +Show an outline highlight around selected objects in non-wireframe views +Zooms in and out based on vertical mouse movement +Calculate sub-surface scattering in materials rendering +Parent this node is attached to +ar_EG +Include the render frame as HH:MM:SS.FF in image metadata +Line of text in a Text datablock +Detail mesh sample spacing +Active Theme Area +Theme Widget Color Set +Boid height relative to particle size +Using 1/x +Scene keying sets +Show Sliders +All Z +Environment Color +Position +Buffersize +Adapt To Speed +Or +World datablocks +Effect Strip +Group of ID properties +Proxy size 75% +Vertex Paint +Hair Dynamics +Stroke Points +NLA Track is locked +Which mesh elements selection works on +Weight of rotation constraint for IK +Always refresh image on frame changes +Use horizon and zenith color for diffuse energy +Extra margin around object for collision detection, small amount required for stability +Collection of vertex groups +Coordinates of the first handle +Sky Blend Mode +Mesh Edge +Adjust simulation speed +Bounding box of this object represents the computational domain of the fluid simulation +Color balance gain (highlights) +Normal Space +Layers +Spin CW +Mesh Float Property Layer +Buffer Resolution - decrease it to increase speed +12 bit color channels +Space Graph Editor +Directory Path +False when this property is an optional argument in an RNA function +Framing Types +Display Paths of poses within a fixed number of frames around the current frame +Last selected point +Cropping parameters for a sequence strip +Min Air Speed +Wavelet +Color used for the surface of bones +Window Managers +Occlude objects with the environment color as they are further away +Attenuation falloff strength, the higher, the less influence distant objects have +Driven Selected +Surface Edit +Causes metaball data to be duplicated with the object +Main Curves +Japanese (æ¥æ¬èª) +Vertex Group Field Negate +Collection of uv textures +Enable simplification of scene for quicker preview renders +String +Randomized +Retarget template bone chain to stroke +Use the manipulator for movement transformations +Command line prompt language +How the rules in the list are evaluated +Color of texture overlay +Text Box +Modifier for values of F-Curve +Specify the number of cluster iterations +Mass of the object +React to force field physics settings in materials +The window relative vertical location of the mouse +YCbCr (ITU 709) +Linear viscosity +8x +Nothing +IK Z Limit +Sensors +Child Seed +Tweak Middle +Object represents a volume of fluid in the simulation +Property is editable through RNA +Theme settings for the Console +Datablock from which the edited datablock is linked +Particle +Solo +Mark controller for execution before all non-marked controllers (good for startup scripts) +FFMpeg audio codec to use +ZTransp +Location (Object Space) +IK Z Lock +Display size for normals in the 3D view +Use a tent filter for anti-aliasing +Original IK solver +Use velocities for automagic step sizes +Multiplier +Constraint Target +Draw Repeated +For RGB curves, the color that white is mapped to +Noise algorithm - Voronoi F1: Returns distance to the closest feature point +IK Y Minimum +Pin Stiffness +Cache Info +No Ghosts +Duplicate Material +Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area +Spanish (Español) +Sets the dimension of the halo +Vertex in a Mesh datablock +Line Numbers Background +Shadow Size +Depth +Rest Density +Frame Server +alert +Meta Element +Show actuators of all selected objects +Calculate environment maps while rendering +Motion Path Settings +Interlaced +Space type +Display the operator log +Show background image in front view +Simple +Storage of a sub operator in a macro after it has been added +Collision Bounds +Maximum value for clipping +Transparency +Armature-Relative Tail +Display in the info window and support the redo toolbar panel +FFMpeg codec to use +Show frame numbers on Motion Paths +Maximum allowed number of light inter-refractions +Use a third buffer for minimal redraws at the cost of more memory +Game engine logic brick to process events, connecting sensors to actuators +Layer in multilayer image +Depth Cutoff +Mesh Edges +Max Edge Length +The number of lines scrolled at a time with the mouse wheel +Root Texture Coordinates +Tag Seam +Visibility status +Birth Time +Mini Axis Brightness +Environment +Accuracy +Driven +Air Damping +Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering +Normal +Keys +The axis icon's size +Spring Force +Brushes +Drag +Emulate 3 Button Mouse +Sculpt/Paint Overlay Color +Collection of keymap items +Shadow Y Offset +Fuzzy +Comb +Theme settings for the 3D View +End frame of the stored range +Grid Subdivisions +Layers bone exists in +Base type for datablocks, defining a unique name, linking from other libraries and garbage collection +Numpad 5 +face area +Clip Start +Numpad 2 +Tweak Action +Numpad 0 +Use this files path when library linked into another file +GL Texture Limit +Only keyframes of selected F-Curves are visible and editable +Numpad 9 +Crease +Filter +Minimum angles for IK Limit +Scatter contribution factor +Bones which are children of this bone +Main Particle Settings +Collection of particle settings +Use modifier during rendering +Numpad / +Numpad . +05 - Theme Color Set +Read Only +Include visualization of Particle related Animation data +Numpad * +Bone is not visible when in Edit Mode +Width Fade +Amount of rotation around velocity vector on turns +Czech (Äeský) +Display datablocks in all scenes +Turbulent noise driven by the particle's age between birth and death +Aerodynamics Type +Best quality +Use effector/global coordinates for turbulence +Target particle systems +Min Rate +Distance to keep particles away from the emitter +Type of information to display +Limit movement around the Z axis +NLA stack is evaluated when evaluating this block +Apply puff to unselected end-points, (helps maintain hair volume when puffing root) +Fgon edge +Perspective +Bone rotation around head-tail axis +Pan/Zoom +Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking +No Auto-Snap +Active Texture Face +Node Backdrop +Count +Amount of influence F-Curve Modifier will have when not fading in/out +Collection of points that make up this poly or nurbs spline +Enable All Codecs +Auto Blend In/Out +Show Python Tooltips +Show menus in the header +Action datablocks +Edit texture nodes from World +Cross +Particle target name +Frame Map Old +Collection of channel driver Variables +Lower First +Stamp Render Time +Groups of the bones +Vertex Group Velocity +Cine-Flat 48fps 1998x1080 +Snap +Extreme Alpha +2x +Group datablocks +Overall sensitivity of the 3D Mouse +Images are rendered in full Screen +Activity culling is enabled +2D cursor location for this view +Metaball types +F +Show Linked to Actuator +Square (HS + V) +Node Groups +Name Property +Dither Intensity +Reconstruction filter used for combining anti-aliasing samples +Minimal +Active Face +Scripts +Scale factor along the X for items in this (sub)layout +Image Axis +Orig Width +Pose Head Position +Cursor Y-Value +Property is optionally registered as part of type registration +IK stiffness around the Z axis +NLA Tracks +Constrain to Image Bounds +Arrangement of the panels +Length of second Bezier Handle (for B-Bones only) +Median +Indirect Exclude +AO +Node in a node tree +Cast +Save cache files to disk (.blend file must be saved first) +Simplify AO and SSS +Use key times +de_DE +Property has been dynamically created at runtime +Ball Size +Display sequence datablocks +Read-only matrix calculated from the roll (armature space) +Noise algorithm - Improved Perlin: Smooth interpolated noise +Automatically start game at load time +Generate point density from a particle system +How much of effector force gets lost during collision with this object (in percent) +Deliver AO pass +Group that included Object should be a member of +Cell Height +Shear Stiffness +Material Volume +Maximum number of lines to store for the console buffer +Include visualization of Mesh related Animation data +Object Non-modal +Maximum acceleration in air (relative to maximum speed) +Pin ID +Radar +Render color of textured face as color +Parts Y +Parts X +Collection of F-Curve Modifiers +Verts Per Poly +Lock to Cursor +Theme Image Editor +Graph Editor 2D-Value cursor - Y-Value component +Automatically merge vertices moved to the same location +Stencil +Lock strip so that it can't be transformed +Vertex Group Rotation +Djv +Use a quadratic filter for anti-aliasing +Calculates environment map only once +Node Links +The number of subdivisions between grid lines +Filter Folder +use images in the order as they are recorded +Collection of libraries +Use selection as the pivot point +Auto Snap +The original matrix of this object before it was duplicated +The unit system to use for button display +Limit selection to visible (clipped with depth buffer) +Type of field +float_array +Root falloff +The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering) +Dodge +Active Vertex Group Index +Method used for determining what ghosts get drawn +Proportional Editing Objects +Parent +Particle dupliobject name +Theme Widget State Color +Tilt CCW +Mirror Intensity +Object +Include visualization of Lamp related Animation data +Object Location +select_end +FrameCycler +Joint +Backdrop X +Backdrop Y +Use Instances +Y Rotation +Nor +Addon +Anti-Aliasing Samples +frames_skipped +Stamp Lens +Make hairs more puffy +Offsets image horizontally from the view center +Negate the effect of the roughness 2 vertex group +Invoke Screen +A square showing Hue/Saturation, with Value slider +NLA Track +Outer Thickness +Format of Time Codes displayed when not displaying timing in terms of frames +Display Node +Boid will fight this times stronger enemy +Custom Color +P +Negate the effect of the rotation vertex group +Select Tail +Settings for boid physics +Options for this operator type +Mouse Y Position +Input properties of an Operator +Fixed +Current windowmanager and data context +Collection of actions +Tab Width +Theme 3D View +Render +Auto Keyframe Insert Available +Grid Scale +Number of undo steps available (smaller values conserve memory) +Show background image in bottom view +Theme Graph Editor +Surface +Flash +Collision +Grid Lines +Pre Roll +Strand +The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added +Disables non-planer quads being triangulated +Particle Brush +Smoke doesn't collide with any border +Ghost frames on either side of frame +Frame +Select +ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) +Index +Functions +03 - Theme Color Set +Built-In Function +Display objects name and frame number in 3D view +Custom text to appear in the stamp note +Cameras +Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point +Estimated scale matrix +Overall stiffness of structure +State +Camera +Distance between key frames +Image Painting +Object is made a fluid control mesh, which influences the fluid +Draw image with RGB colors +Build 100% proxy resolution +Space Type +Transformation +Method of calculating the steps through the volume +Material slot name +Number of frames between cached frames +Repulsion is a factor of stiffness +Edge spring friction +Face Area Text +Frame Map New +Media Play/Pause +Mux Rate +Show background image in all views +Slider Max +Every Point +Stub RNA type used for pointers to unknown or internal data +Number of indirect diffuse light bounces +Clip Min X +Clip Min Y +Link +Record animation to fcurves +Object removes fluid from the simulation +The number of times this object is repeated with respect to other objects +Line +Method used to define which Group-name to use +Use Material Force Field +Multi constraint, stateful IK solver +Texture nodes +Locked +Filebrowser Parameter +Path to an image editor +Weights for the vertex groups this point is member of +Insert keyframes based on 'visual transforms' +Armatures +Nabla +Mesh String Property +Collection of action groups +Keep path lengths constant +The type of tilt interpolation for 3D, Bezier curves +Creates a force that dampens motion +Disable simulation of linear motion along the Y axis +Green +Layer is selected for editing in the DopeSheet +Voronoi F2 +Voronoi F3 +Active F-Curve Modifier +Cycles +Margin +Voronoi F4 +Theme settings for the Image Editor +Face Dot Selected +Damping of cloth velocity. (higher = more smooth, less jiggling) +GLSL Color Management +Prompt +Length of first Bezier Handle (for B-Bones only) +Theme settings for style sets +Ctrl +Show intermediate values for the driver calculations to allow debugging of drivers +Apply this and all preceding deformation modifiers on splines' points rather than on filled curve/surface +Vertex indices +Lens angle (mm) in perspective view +Back +German (Deutsch) +Color of light scattered out of the volume (does not affect transmission) +Build free run time code index +Extrapolation +Theme settings for Info +Collection of metaball elements +Use face normal to rotate object, so that it points away from the surface +Lens +Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction +Particle Dupliobject Weight +Use textures for drawing international fonts +Use light for face +The edge flag to tag when selecting the shortest path +Vinterlace +Cycle the images in the movie +Display Z Axis +Reflectivity +Window Draw Method +Set audio sampling rate to 44100 samples per second +Causes particle systems to be duplicated with the object +Scripts Window +The space where the panel is going to be used in +SMPTE (Compact) +Automatically merge nearby keyframes +Fast in high-contrast areas +YCC +Deliver object index pass +Bake shadows +Continuous Grab +Alive State +Input +Adaptive +Single texture face materials +Color Ramp Element +Hue +Error tolerance (low values are slower and higher quality) +Transforms include effects of constraints but not parenting/restpose +Collision Settings +Collection of cameras +Command line prompt +Cache file path +Object Space +Driver +End size of strands in pixels or Blender units +Weighted result of strip is added to the accumulated results +NLA Track is selected +Quaternion +DOC BROKEN +19 - Theme Color Set +Debug State +Active Keying Set used to insert/delete keyframes +Lock Rotations (4D) +Sets the audio output device +Channels to display when drawing the histogram +Displays bit depth of full screen display +Sky Blend +Reflection +Vertex group to control roughness 1 +Bake Emit values (glow) +Language use for translation +Atmosphere Distance Factor +Emit Object Space +Motion Path Points +IK Solver +F-Curves +Semantic interpretation of the property +Partial overlay on top of the sequencer +Unborn +Effect in full or only positive/negative Z direction +Format of the source data set to render +Space UV Editor +Solid Lights +F1 +F2 +F3 +F4 +F5 +F6 +F7 +Fonts Directory +Single ASCII character for this event +Invert x Axis +Allow boids to move in air +Zoom Style +Library +Sky related settings for a sun lamp +Inherit Rotation +Disable Stereo and Dome environments +KeyConfigs +IK Stretch +Voronoi F1 +Rigid Body +operator_context +Rotation Units +Defines the structure of the menu in the UI +idp_array +XYZ velocity mapped to RGB colors +Editmode +Particle Location +Tabs as Spaces +Region Background +Render Layers +Stiff viscosity +Scale Matrix +Pinned +Sequence Editor +Vertex Normal +Display current image regardless of object selection +Display Lattices +Density +Exclude raytraced refraction pass from combined +Charge effector weight +Limit colliders to this Group +Square (SV + H) +Space currently being displayed in this area +Show frame number beside the current frame indicator line +Face +Normalized quaternion rotation +Proportional Editing enabled +Vector handle selected color +Scope region background color +Show font files +Wave +Stickness +Vertex Groups +The time to animate the view in milliseconds, zero to disable +Number of times this datablock is referenced +Source Path +Forcefield based on a texture +Lattices +Object used as the smoke simulation domain +Parameters defining which layer, pass and frame of the image is displayed +Vertex Size +Italian (Italiano) +Physics Type +Ghost +Audio Device +Display Scene +Limit Scale +Enable Dome environment +Vertex Group Kink Negate +Radial Falloff Power +Value Sliders +collection +Meta Elements +Q +Display Transforms +Texture Time Out +Output image in TIFF format +Key Map +Navigation mesh +Fade effect using the built-in default (usually make transition as long as effect strip) +Include visualization of ShapeKey related Animation data +Manual adjust +Space User Preferences +NLA Track is not evaluated +Use rule when boid is on land +Anisotropic Filter +Red Green Blue +Radiance HDR +Active object base in the scene +User defined layer of integer number values +Object Mode +Maximum height between grid cells the agent can climb +Texts +Sort the file list by extension +Settings for filtering animation data +Number of horizontal pixels in the screen +Path to the .blend file +Converts texture RGB values to intensity (gray) values +Different styles of displaying the color picker widget +Initial state when the game starts +Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area +Show sliders beside F-Curve channels +Fisheye +Show View Name +Sequencer and Image Preview +Fake User +Video Sequence Editor +Struct Definition +The directory for storing temporary save files +Record Animation +F-Curve Modifier will not be evaluated +Full Render +Only one side is rendered, with Z axis pointing in direction of image +Show ghosts from around the current frame +Display Channel +Automatically switch between orthographic and perspective when changing from top/front/side views +Print debug information for this property +Update simulation with cache steps +Relationship Lines +RNA Path to property affected by F-Curve +Median Point +Mesh datablocks +Sets angular index of refraction for raytraced refraction +Node Socket type +Outliner space data +Shadow X Offset +Amount of residual error in Blender space unit for constraints that work on position +Make diffuse shading more similar to shading the surface +Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading) +Draw white edges with black outline +UV selection and display mode +No +Show linked objects to the actuator +Key Config +Pressure +Render Data +Quaternion Rotation +Multiply +Control point for envelope F-Modifier +Proportion of original image source pixel lines to sample +Avoid Collision +Snap to volume +Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method) +Automatically determine the number of threads, based on CPUs +Curve mapping to map color, vector and scalar values to other values using a user defined curve +Run python while editing +Selects the collision type +Active Vert/Edge/Face +Tessellation level - check the generated mesh in wireframe mode +Register +Transform Markers +Include visualization of Scene related Animation data +Index number of cache files +Text Highlight +Halo particle effect settings for a Material datablock +MPlayer +Previous Particle Location +Recent Files +Legacy tracking constraint prone to twisting artifacts +Edges receive a lift force when passing through surrounding media +Optional region type keymap is associated with +Output image in JPEG 2000 format +Self Collision +Enable bending constraints +Theme DopeSheet +Layer +Drag Threshold +Factor Rest Length +Which style to use for viewport scaling +Data to derive color results from +3D cursor location for this view (dependent on local view setting) +Nested +MultiLayer +Display Curve +Disk Cache +Transform markers as well as strips +mode +Target object for multi-target constraints +Multiplier for the material's density +FPS Base +Grease Pencil Simplify Stroke +Edit all markers of the same group as one +Harmonic effector weight +Location of head end of the bone relative to armature +Texture coordinates from root particle locations +Stereo Options +Disallow movement around the Z axis +Number of vertical tiles to use while rendering +Random Friction +Specifies an offset in the flare seed table +Horizon brightness +Language +Sound Clip +Light used for OpenGL lighting in solid draw mode +Screen datablocks +NLA Editor +Vertex group to control velocity +input_count +Only hold last frame +Elasticity of collisions +Sky Texture +Use SIMD SVBVH +Sort alphabetically +New Handles Type +Display only objects which will be rendered +Noise +The time (in ms) for a double click +matrix +channel_id +Only render the active layer +Material +Standard Modal Map +No TC in use +Output image in multilayer OpenEXR format +Empty +Always +Enable filtering of files +Template +When the camera is locked to the view and in fly mode, transform the parent rather than the camera +Show Sensors +Auto handle color +Custom Warp Mesh data file +Audio Channels +Available as GameObject attributes in the game engine's python API +Offset Y +Min Region Size +Pre-calculate the raytrace accelerator and render raytracing effects +For multires, show low resolution while navigating the view +Active curve spline +Strength of sky shading exponential exposure correction +Print Performance to Console +Power of Fresnel for mirror reflection +Default binary voxel file format +Copy Transforms +Draw alpha transparency channel +4x4 bone matrix relative to armature +Edge spring stiffness when longer than rest length +When true the format is a movie +Read cache from an external location +Object Index +Print warnings when using deprecated features in the python API +Option Widget Colors +Auto Depth +Goal Minimum +Display size for proportional editing circle +Point +NLA Strip +Strokes +Lock editing of scale in the interface +Sensor name +Point in a shape key +Dutch (Nederlandse taal) +Only Objects in Group +The shininess of the reflection (values < 1.0 give diffuse, blurry reflections) +Default relative path option for the file selector +Proportional editing object mode +Sampled animation data +Output image in PNG format +Owner Space +Align the transformation axes to the selected objects' local space +If this is set, the panel gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_PT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_PT_hello" +Lock Rotation (4D Angle) +Overdraw Sketching +Pause +Maximum speed in air +Backdrop Y offset +Ellipsoid +Separate Units +Object is a fixed obstacle +scene +Load user interface setup when loading .blend files +'Viscosity' inside collision target +Bake everything +Lamp +Negate the effect of the length vertex group +Invert z axis +Armature datablocks +Shadow size in pixels (0, 3 and 5 supported) +Rasterized cell size +Collection of timeline markers +Local +Old style zoom, continues while moving mouse up or down +Tooltips +Edge Collision +Fluid rest density +Blender Voxel +Bezier curve point with two handles +Runtime +Regular key pressed as a modifier +UV Layer +Initial Velocity +Sources of input data for evaluating this variable +Timeline +Game engine related settings for the object +Hide Recent Locations +Include the name of the active camera in image metadata +Colored Constraints +Particle Hair Key +Y Location +Exec Region Window +Stereographic techniques +UV editor settings +General movement damping +Estimate matrix +Global Pivot +IK X Lock +Keep UV and edit mode mesh selection in sync +Vector Handle +Number of frames from start frame for influence to take effect +int_array +Key velocity +Negate the effect of the roughness 1 vertex group +Output Path +Image User +AutoMerge Editing +Flare Subsize +Handle 2 Location +Edge UV Face Select +Clamp To +NDOF +The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored +Particle systems emitted from the object +Wheel Up +Linear falloff +Show the status of cached frames in the timeline +R +Keyframe +Blender Render +Noise Basis +How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead) +Display Grid Floor +Transmission Color +Parameters defining how an Image datablock is used by another datablock +Spline point without handles +8 bit color channels +Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only) +Draw Z-buffer associated with image (mapped from camera clip start to end) +Filter Size +Density is constant within lookup radius +Clear Images before baking +Animation Channels +Snap closest point onto target +Cloth Collision Settings +Sequence Plugin Directory +Size of widget handles as percentage of widget radius +Friction +Main Speakers +Offset in the random number table, to get a different randomized result +Keep Lengths +Vertex Group Element +Snap to faces +Case Sensitive Matches Only +Time delay in 1/10 seconds before automatically opening sub level menus +RNA structure definition +F-Curve Modifier is only applied for the specified frame range to help mask off effects in order to chain them +Collection of pose bone constraints +Angle +Gives a spiraling force that twists the force objects local Z axis +AAC +The constraint is applied relative to the local coordinate sytem of the object +Separate color channels in preview +Absolute Density +Target Particle System +When transforming keyframes, changes to the animation data are flushed to other views +Markers +Amount of pixels you have to drag before dragging UI items happens +Manipulator Hotspot +Nurb U-lines +Output video in Ogg format +double_array +Shape matching threshold +Drag component proportional to the square of velocity +Inner Selected +Show Playback FPS +Interpolation +Space File Browser +Hold LMB Open Toolbox Delay +Vertex Group Weight +Timeline editor space data +Main Screens +Improved Perlin +The value this event translates to in a modal keymap +Theme settings for widget state colors +Reversed +Mesh Float Property +Sky Exposure +Align each axis to the Euler rotation axis as used for input +Show Frame Numbers +Action Editor +17 - Theme Color Set +Soft body simulation settings for an object +Mesh Vertices +32-bit Float +Invisible +Number of horizontal pixels in the rendered image += +Handle types +Stricky texture coordinate +Max Land Angular Velocity +Struct definition used for properties assigned to this item +RGB to Intensity +Mapping settings +Name of Shape Key +Shadow Alpha +Radius Interpolation +Pulse True Level +Bounces +Exec Region Preview +Edge Draw Type +Color Management +Raytrace +Forcefield depends on the speed of the particles +Mode +Stiffness +Radial +Noise Method +Number of seconds between each run of the GL texture garbage collector +Gravitational constant used for physics simulation in the game engine +Logic Editor +Text Selected +Point Caches +No compression +Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed +Edge Crease +Invert rotation Axis +Use Ambient Occlusion to add shadowing based on distance between objects +Frame that modifier's influence starts (if Restrict Frame Range is in use) +active_strip +Lock +Collection of window managers +Cine-Flat 24fps 1998x1080 +Sort by extension +All Views +Enum Item Definition +Button 4 +Button 5 +Button 6 +Button 7 +Button 1 +Button 2 +Maximum angles for IK Limit +Render Pass +Selected Text +Whether to draw the sound's waveform +Data Path +Enum Flag +Soft Light +Define forces for vertices to stick to animated position +Sample every pixel of the image +Invert roll axis +Goal +Dissolve Speed +Textbox X Offset +Sky turbidity +A random rule is selected for each boid +OpenAL device - supports 3D audio, recommended for game engine usage +Console Input +Invert the level(output) of this sensor +Memory Cache Limit +Point Cache List +Motion Path settings for visualisation +Endpoint V +The rotation step for numerical pad keys (2 4 6 8) +Linear and angular physics +NLA Strip is selected +The channel number shown in the image preview. 0 is the result of all strips combined +Shrink +Limit movement around the X axis +Draw Action +Display debug reporting info +Collection of action fcurves +Bone inherits scaling from parent bone +Lock current frame displayed by layer +Type of stretch to draw +Friction/damping with self contact +Undo +ZYX Euler +Scaling factor for the background image +vBVH +Axis-Angle Rotation +Bone deformation weight (for Envelope deform only) +Interaction radius is a factor of 4 * particle size +Shape key to use the rest spring lengths from +Use this texture as a blending value on the next texture +Deliver environment lighting pass +Show Python references in tooltips +Theme NLA Editor +Above-Below +Transition Strip +NLA Strips on this NLA-track +Draw black edges +Removes the operator from search results +Light Override +Only include channels from Objects in the specified Group +Compositing +128 +Random Damping +Effector Weights +Location of tail of the channel's bone +Frame Number +Image displayed and edited in this space +Vertex group to control roughness 2 +Show background image in camera view +How incompressible the fluid is +Point select mode +Panel containing UI elements +Stamp Date +Inverts the values of the texture to reverse its effect +Smoke flow settings +Active Particle System +Channels +Type of this region +Intensity +Audio Strip +Blending +Enable this objects as a collider for physics systems +Tracking along a single axis +Weight used by the Subsurf modifier for creasing +Duplicate Mesh +Keying Set Info +Map Type +Use BLI K-Dop BVH.c +Amount of turbulence/rotation in fluid +Add light and shadow +Random falloff +Script +Edge selection mode +Auto Handle +Collection of bone groups +Vertex Group Roughness 1 +Sets minimum X value to for the render border +Coordinates of the left handle (before the control point) +Source +Output Node +Groups of Pose Channels (Bones) +Hide recent locations in the file selector +Particle editing brush +Show the ground plane grid in perspective view +Snap Target +Scripted Expression +Shadow Brightness +Noise algorithm - Blender original: Smooth interpolated noise +Rot error +Amount of damping during particle collision +Save Versions +Anti-aliasing +Endpoint U +Sub-Target +Settings +Use international fonts +Show Mini Axis +Previous Particle Velocity +Edge in a Mesh datablock +Function Definition +Physics engine used for physics simulation in the game engine +Softbody +Theme settings for the DopeSheet +Vertex Group Size +Add the file format extensions to the rendered file name (eg: filename + .jpg) +Collection of KeyConfigs +Active Element +Wipe +Deliver raytraced reflection pass +Fade paths and keys further away from current frame +Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped +Control point spring strength values +Extends by repeating edge pixels of the image +File is Saved +Region Type +OpenEXR +Auto Keying +S +Vector +Texture Mapping +Cache name +Smoke +Boid State +Space Node Editor +Multiresolution +No Preset +Maximum allowed number of light inter-reflections +Final key configuration that combines keymaps from the active and addon configurations, and can be edited by the user +Allow Negative Frames +Bending +Group to override all other lights in this render layer +Position solver iterations +Exists +Lock editing of 'angle' component of four-component rotations in the interface +Deliver shade-less color pass +Rear-Truncated +RNA +Has Minimum +Strip has no influence past its extents +Lennard-Jones effector weight +Screens +Window Background +current_character +Meta +Theme settings for the Logic Editor +Floating-Point Property +Structural Stiffness +Particle system settings +Codec settings for OpenEXR +Axis +Forces the current Scene to be displayed in all Screens +Indicates that a keymap is used for translate modal events for an operator +Environment map created by the renderer and cached for subsequent renders +Rotational Difference +Goal Vertex Group +Use shaders for GLSL rendering +Multiple Springs +Emitter Distance +Edit Bone +Indicates that a keyconfig was defined by the user +Include channels from objects/bone that aren't visible +Align dynamic game objects along the surface normal, when inside the physics distance area +Frames Per Second +Set the distance between the eyes - the camera focal length/30 should be fine +Draw Other Objects +Mouse Previous Y Position +Flare Size +Align the transformation axes to average normal of selected elements (bone Y axis for pose mode) +Maintain Volume +Display mode for the file list +Max Step +Activate FALSE level triggering (pulse mode) +Active Render +Size Y +Size X +Display splash screen on startup +Size Z +Grease Pencil Layer +X/Y coordinates of the curve point +Use a minimum distance for the field's fall-off +Show 2D cursor +Frame Locked +Active +Horizontal +Editing +Factor for how much surrounding objects contribute to light +Blend In +Sets the global starting frame of the movie/sequence, assuming first picture has a #1 +bg_BG +The size of the occlusion buffer in pixel, use higher value for better precision (slower) +Horizontal aspect ratio - for anamorphic or non-square pixel output +4x4 matrix, before constraints +Minimum Distance +End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method) +Particles generated by the particle system +Region Text Highlight +Align +zh_TW +Overwrite existing files while rendering +Cylinder +How many frames to fade +Driver type +World +Theme settings for user interface elements +Bending Stiffness +Draw other selected objects that share the same image +Show dashed lines indicating parent or constraint relationships +And +Bevel Radius +Extrapolated +Force +Active Brush +Distance will be used to attenuate shadows +Method used to adjust the roll of bones when retargeting +Form Factor +Scopes to visualize image statistics +Number +Shade Top +Number of frames to render ahead during playback +High quality interpolation, but slower +Current view matrix of the 3D region +Handle 1 Location +Vertex Group Density +Active Frame +IK Y Limit +Blending to inelastic collision +Enable high resolution (using amplification) +Simulation starts on this frame +Properties to set when the operator is called +Result of rendering, including all layers and passes +iTaSC +Mesh String Property Layer +Tweak Left +True if this map is ready for use, False if it needs rendering +X Scale +Bone in an Armature datablock +Output image in Targa format +Stamp Sequence Strip +F-Curve Modifier's panel is expanded in UI +Build 50% proxy resolution +An object duplicate +Start Offset +Items +Fluid simulation settings for an object taking part in the simulation +Set audio mixing buffer size to 8192 samples +Material Strand +Inflow +Sort +Relative Key +Motion Paths +Return +Stiffness defines how much of the element to fill +Detail mesh simplification max sample error +Meta Strip +Bake Alpha values (transparency) +Memory cache limit in sequencer (megabytes) +Input configuration, including keymaps +Select the type of Framing you want +Animation data for this datablock +Raytracing +Key Map Item +Split quads to give the least distortion while baking +Show overexposed areas with zebra stripes +1024 +Bias towards faces further away from the object (in blender units) +Strip time is controlled by an F-Curve rather than automatically determined +Bake Location +sr_RS +Panel +Main Libraries +Edit Edit +Get away from assigned object or loudest assigned signal source +Darken +Active index in vertex group array +Average Separation +F-Curve Modifiers +RNA type used for pointers to any possible data +Space Image Editor +UV Selected +Handle 1 Type +Choke +Use Simplify +Maximum +YZX Euler +No Self +Helicopter Mode +Rotation in Eulers +On Cage +Bone that defines the display transform of this custom shape +Main Node Trees +Undo Steps +Cube Map +Point cache for physics simulations +Interactive python console +Use environment map with six cube sides +Show .blend files +Kill Particles +Sets maximum X value for the render border +Only Seconds +NLA Tracks (i.e. Animation Layers) +Timer Property +Z Rotation +Ensure all bone-deforming vertex groups add up to 1.0 while weight painting +Rigid to Soft Body +Lock to Object +Threshold +Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible) +Occlude Geometry +Causes surface data to be duplicated with the object +Use the images alpha values clipped with no blending (binary alpha) +Hold Forward +Set Controller state index (1 to 30) +Amount of light that gets scattered out by the volume - the more out-scattering, the shallower the light will penetrate +Lock Horizon +Ignore Layers +Object Matrix +Pixel Aspect X +Filename +Use Ambient Occlusion +The transformation of the target is evaluated relative to its local coordinate system +The region where the panel is going to be used in +BW +Bake Specular values +Tool +Margin Column +Maximum distance from active object to other object (in blender units +Final transformation value of object or bone +Group Name +Proxy parameters for a sequence strip +fr_FR +Kill collided particles +Disable simulation of angular motion along the Y axis +Collision Margin +SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default +bl_use_preview +Draw Faces +Vertex Group Rotation Negate +\ +New Window +Turbulent noise driven by particle velocity +Lock Rotation +Color Source +Print state debug info in the game engine +Location of head of the channel's bone +Timer +Output video in Xvid format +Enable raytraced reflections +Image Preview +Optional space type keymap is associated with +Use ramps for GLSL rendering +Motion Samples +Vectorscope Opacity +Element defining a color at a position in the color ramp +All Action Keyframes +Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes) +Align Object To +Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates) +Limit +T +Diffuse Color +Release +User defined string text value in a string properties layer +Histogram for viewing image statistics +Scroll Widget Colors +General media friction for point movements +Lock Y Rotation Axis +Set audio mixing buffer size to 1024 samples +Draw the image repeated outside of the main view +Mesh Int Property +Noodle curving +Unknown Type +Add & Replace +Border Collisions +Add children to form a compound collision object +Influence +Show high resolution (using amplification) +Collection of sounds +Use Bone Heads +Actuator to apply actions in the game engine +Mp3 +Go to closest enemy and attack when in range +Type of range to show for Motion Paths +Use trackball style rotation in the viewport +32768 +Overwrite +Duplicate Particle +32-bit Signed +Scale +Expression to use for Scripted Expression +Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy +Parameters +Material Mode +Avoid +Cache is outdated +File Browser Buttons +Actor +Bone Group Index +Toolbox Column Layout +Show the frames per second screen refresh rate, while animation is played back +Image Editor +Mesh Vertex Sticky Texture Coordinate +Vertex Weight Proximity +Average Spring length * Ball Size +Renders rings over halo +Offset in the random number table for child particles, to get a different randomized result +Auto Keying Mode +B-Bone Segments +Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox +Visible Layers +File format to save the rendered images as +Enable view navigation within the camera view +Show background image in top view +Sun brightness +Closest +Make this curve or surface a closed loop in the U direction +Command history +XYZ Rotation Order. Prone to Gimbal Lock +Draw Stretch Type +Percentage scale for render resolution +F-Curve and its keyframes are hidden in the Graph Editor graphs +F-Curve Editor +Area distortion between UV and 3D faces +YXZ Rotation Order. Prone to Gimbal Lock +Effective but slow compression +Fields +For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower) +Process the render result through the compositing pipeline, if compositing nodes are enabled +Co-ordinate system to cache particles in +Error Limit +Curve guide effector weight +Default +Black Level +ISO 1 +Fine tunes texture mapping X, Y and Z locations +Single Property +Korean (íêµ ì¸ì´) +DopeSheet Sub-Channel +Max Air Speed +Vertex Group Length Negate +Key location for a particle over time +Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample +Range +Materials +Show hidden dot files +Numpad Enter +Polish (Polski) +Automatic saving of temporary files in temp directory, uses process ID +Cubic B-Spline +Logic editor space data +Open menu buttons and pulldowns automatically when the mouse is hovering +Use to check if an operator is a macro +Display zoom level +Stamp Filename +Weight +Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered) +Auto XYZ to RGB +UV +Audio volume +Restrict the number of animation updates to the animation FPS. This is better for performance, but can cause issues with smooth playback +Replace +Show paint related properties +Target Space +Gloss Samples +UI +Keep horizon level while flying with 3D Mouse +Texture Mode +Shaded + Multiple Scattering +Lifetime +Settings for particle fluids physics +Type of units for this property +Pointer +Field Settings +PoseBone Constraints +Right Ctrl +User Key Configuration +Color 3 +Speakers +Color 1 +Spline Points +Color 4 +Gradient +Rule Fuzziness +YZX Rotation Order. Prone to Gimbal Lock +Amount of residual error in radiant for constraints that work on orientation +GLSL Shadows +Radius of object representation in obstacle simulation +Show the entire viewport in the display window, using bar horizontally or vertically +Dissolve Smoke +Internal +Library file the datablock is linked from +Outer face thickness +Any modifier keys pressed +Screen aligned billboard +Allow moving the mouse outside the view on some manipulations (transform, ui control drag) +NLA Strips that this strip acts as a container for (if it is of type Meta) +Pixel Cache +Texture slot name +Render Stamp +bl_label +Settings for interacting with Blender data +Ball +Active Clone +Editbone Matrix +ja_JP +Curve in a curve mapping +Auto Rainbow +Maximum angular velocity in air (relative to 180 degrees) +Operator Properties +Material Raytrace Transparency +Child +Modal Keymap +Color to use behind stamp text +Theme settings for the graph editor +Aligned +Border Maximum X +Border Maximum Y +Type of event +Set color of the bars +Collapse Summary +How many collision iterations should be done. (higher is better quality but slower) +Consant falloff +Fields Still +Main Sounds +Definition of a choice in an RNA enum property +Translate Tooltips +Sync Markers +Object being duplicated +Face in a Mesh datablock +Calculate bone paths from tails +Display World +UV Pinned +No Collision +Active Channel Group +Make face invisible +Number of subdivisions of bone (for B-Bones only) +Renders halo as a lens flare +Only Selected Channels +Minimum height where the agent can still walk +Stroke data points +Multiply Vertex Group with Envelope +Inner face thickness +Set actuator expanded in the user interface +Low values are slower and higher quality +Vertices Cache +Lattice datablocks +Current frame number can be manually set to a negative value +Set controller expanded in the user interface +Simulation used for obstacle avoidance in the game engine +Duplicate Curve +List of background images +Manipulator Handle Size +Alive +Lock Z Axis +Tex +A square showing Saturation/Value, with Hue slider +Deliver material index pass +XXX todo +Collection of spline points +Flock +Linear Light +Live Unwrap +Radiosity +Turbulence Influence +Object datablocks +Left Shift +The source of this force field is the zero point of a harmonic oscillator +Driver Target +CIE +Show High Resolution +Pin Cloth +Soft Body Settings +Threads +Negate the effect of the roughness end vertex group +Gloss Threshold +World Space +Game data for a Scene datablock +Blender 2.4 +Coordinates of the right handle (after the control point) +View2D Buttons List +F-Curves in this group +Point cache list +3D View Region +Show the X axis line in perspective view +Matroska +Node Generic +Extinction scattering contribution factor +Callback function defines for builtin Keying Sets +Generate point density from an object's vertices +Coulomb friction coefficient, when inside the physics distance area +Temporary +Vertex group to control size +Time in milliseconds between each frame recorded for screencast +Low Resolution Mesh +Maximum structural stiffness value +Maximum radial distance for the field to work +Collection of point caches +Volume +Asymmetry +Mux rate (bits/s(!)) +Weight value of a vertex in a vertex group +Log conversion reference blackpoint +Point density settings +Show Mouse +Name of Action Group to assign setting(s) for this path to +Rotate +Multiplier for multiple scattered light energy +09 - Theme Color Set +(Min+Max)/2 * Ball Size +Flow +Output image in Radiance HDR format +Show Expanded +11 - Theme Color Set +Front scattering weight +Maximum speed for jumping +Compositor Nodes +Particle in a particle system +Vertex Group +U +Bending Stiffness Vertex Group +Context +Vertex selection mode +Use scaled but un-grid-fitted kerning distances +Gloss Amount +3D region that defines the quad view settings +Display groups and their datablocks +Include visualization of Curve related Animation data +User Modified +Statistical view of the levels of color in an image +Anisotropic Friction +4x +Inverse Gain +Fade Time +Visual Keying +Agent Height +Underline +Translate Interface +Property Definition +Bake Mirror colors +Animated Strip Time +Friction Factor +Space data for a screen area +Maximum speed on land +Theme User Interface +Deflect Emitter +Use Edges +The base density of the volume diff --git a/po/update_mo.py b/po/update_mo.py new file mode 100755 index 00000000000..eb4c2840e28 --- /dev/null +++ b/po/update_mo.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# $Id: +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +# update all mo files in the LANGS + +import subprocess +import os + +CURRENT_DIR = os.path.dirname(__file__) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) +LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "bin", ".blender", "locale") + +DOMAIN = "blender" + + +def main(): + for po in os.listdir(CURRENT_DIR): + if po.endswith(".po"): + lang = po[:-3] + # show stats + cmd = ("msgfmt", + "--statistics", + os.path.join(CURRENT_DIR, "%s.po" % lang), + "-o", + os.path.join(LOCALE_DIR, lang, "LC_MESSAGES", "%s.mo" % DOMAIN), + ) + + print(" ".join(cmd)) + process = subprocess.Popen(cmd) + process.wait() + +if __name__ == "__main__": + print("\n\n *** Running %r *** \n" % __file__) + main() diff --git a/po/update_msg.py b/po/update_msg.py new file mode 100644 index 00000000000..7bd372cf3ce --- /dev/null +++ b/po/update_msg.py @@ -0,0 +1,117 @@ +# $Id: +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +# Write out messages.txt from blender + +# Execite: +# blender --background --python po/update_msg.py + +import os + +CURRENT_DIR = os.path.dirname(__file__) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) + +FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt") + + +def dump_messages(): + import bpy + + # ------------------------------------------------------------------------- + # Function definitions + + def _putMessage(messages, msg): + if len(msg): + messages[msg] = True + + def _walkProperties(properties, messages): + import bpy + for prop in properties: + _putMessage(messages, prop.name) + _putMessage(messages, prop.description) + + if isinstance(prop, bpy.types.EnumProperty): + for item in prop.enum_items: + _putMessage(messages, item.name) + _putMessage(messages, item.description) + + def _walkRNA(bl_rna, messages): + if bl_rna.name and bl_rna.name != bl_rna.identifier: + _putMessage(messages, bl_rna.name) + + if bl_rna.description: + _putMessage(messages, bl_rna.description) + + _walkProperties(bl_rna.properties, messages) + + def _walkClass(cls, messages): + _walkRNA(cls.bl_rna, messages) + + def _walk_keymap_hierarchy(hier, messages): + for lvl in hier: + _putMessage(messages, lvl[0]) + + if lvl[3]: + _walk_keymap_hierarchy(lvl[3], messages) + + # ------------------------------------------------------------------------- + # Dump Messages + + messages = {} + + for cls in type(bpy.context).__base__.__subclasses__(): + _walkClass(cls, messages) + + for cls in bpy.types.Space.__subclasses__(): + _walkClass(cls, messages) + + for cls in bpy.types.Operator.__subclasses__(): + _walkClass(cls, messages) + + from bl_ui.space_userpref_keymap import KM_HIERARCHY + + _walk_keymap_hierarchy(KM_HIERARCHY, messages) + + message_file = open(FILE_NAME_MESSAGES, 'w') + message_file.writelines("\n".join(messages)) + message_file.close() + print("Written %d messages to: %r" % (len(messages), FILE_NAME_MESSAGES)) + + # XXX. what is this supposed to do, we wrote the file already??? + _walkClass(bpy.types.SpaceDopeSheetEditor, messages) + + return {'FINISHED'} + + +def main(): + + try: + import bpy + except ImportError: + print("This script must run from inside blender") + return + + dump_messages() + + +if __name__ == "__main__": + print("\n\n *** Running %r *** \n" % __file__) + main() diff --git a/po/update_po.py b/po/update_po.py new file mode 100755 index 00000000000..d01d6a31613 --- /dev/null +++ b/po/update_po.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# $Id: +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +# update all po files in the LANGS + +import subprocess +import os + +CURRENT_DIR = os.path.dirname(__file__) +DOMAIN = "blender" + + +def main(): + for po in os.listdir(CURRENT_DIR): + if po.endswith(".po"): + lang = po[:-3] + + # update po file + cmd = ("msgmerge", + "--update", + "--lang=%s" % lang, + os.path.join(CURRENT_DIR, "%s.po" % lang), + os.path.join(CURRENT_DIR, "%s.pot" % DOMAIN), + ) + + print(" ".join(cmd)) + process = subprocess.Popen(cmd) + process.wait() + + +if __name__ == "__main__": + print("\n\n *** Running %r *** \n" % __file__) + main() diff --git a/po/update_pot.py b/po/update_pot.py new file mode 100755 index 00000000000..b34b75f9740 --- /dev/null +++ b/po/update_pot.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python + +# $Id: +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +# update the pot file according the POTFILES.in + +import subprocess +import os + +GETTEXT_XGETTEXT_EXECUTABLE = "xgettext" +CURRENT_DIR = os.path.dirname(__file__) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) +DOMAIN = "blender" + +FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot") +FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt") + + +def main(): + cmd = (GETTEXT_XGETTEXT_EXECUTABLE, + "--files-from=%s" % os.path.join(SOURCE_DIR, "po", "POTFILES.in"), + "--keyword=_", + "--keyword=N_", + "--directory=%s" % SOURCE_DIR, + "--output=%s" % os.path.join(SOURCE_DIR, "po", "%s.pot" % DOMAIN), + "--from-code=utf-8", + ) + + print(" ".join(cmd)) + process = subprocess.Popen(cmd) + process.wait() + + def stripeol(s): + return s.rstrip("\n\r") + + pot_messages = {} + reading_message = False + message = "" + with open(FILE_NAME_POT, 'r') as handle: + while True: + line = handle.readline() + + if not line: + break + + line = stripeol(line) + if line.startswith("msgid"): + reading_message = True + message = line[7:-1] + elif line.startswith("msgstr"): + reading_message = False + pot_messages[message] = True + elif reading_message: + message += line[1:-1] + + # add messages collected automatically from RNA + with open(FILE_NAME_POT, "a") as pot_handle: + with open(FILE_NAME_MESSAGES, 'r') as handle: + while True: + line = handle.readline() + + if not line: + break + + line = stripeol(line) + line = line.replace("\\", "\\\\") + line = line.replace("\"", "\\\"") + + if not pot_messages.get(line): + pot_handle.write("\n#: Automatically collected from RNA\n") + pot_handle.write("msgid \"%s\"\n" % (line)) + pot_handle.write("msgstr \"\"\n") + + +if __name__ == "__main__": + print("\n\n *** Running %r *** \n" % __file__) + main() diff --git a/release/bin/.blender/.Blanguages b/release/bin/.blender/.Blanguages index 9f3b3ef80dc..1a83c46039a 100644 --- a/release/bin/.blender/.Blanguages +++ b/release/bin/.blender/.Blanguages @@ -11,13 +11,14 @@ Catalan:ca_ES Czech:cs_CZ Brazilian Portuguese:pt_BR Simplified Chinese:zh_CN +Traditional Chinese:zh_TW Russian:ru_RU Croatian:hr_HR -Serbian:sr +Serbian:sr_RS Ukrainian:uk_UA Polish:pl_PL -Romanian:ro -Arabic:ar -Bulgarian:bg -Greek:el -Korean:ko +Romanian:ro_RO +Arabic:ar_SA +Bulgarian:bg_BG +Greek:el_GR +Korean:ko_KR diff --git a/release/bin/.blender/fonts/droidsans.ttf.gz b/release/bin/.blender/fonts/droidsans.ttf.gz Binary files differnew file mode 100644 index 00000000000..e83aff4e899 --- /dev/null +++ b/release/bin/.blender/fonts/droidsans.ttf.gz diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index a6304378cc4..fdd22f403a4 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -63,7 +63,7 @@ def _test_import(module_name, loaded_modules): return None if "." in module_name: print("Ignoring '%s', can't import files containing " - "multiple periods." % module_name) + "multiple periods" % module_name) return None if use_time: @@ -159,7 +159,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): traceback.print_exc() else: print("\nWarning! '%s' has no register function, " - "this is now a requirement for registerable scripts." % + "this is now a requirement for registerable scripts" % mod.__file__) def unregister_module_call(mod): diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 3f6a3682e7c..91546e02829 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -233,8 +233,8 @@ def axis_conversion(from_forward='Y', from_up='Z', to_forward='Y', to_up='Z'): return Matrix().to_3x3() if from_forward[-1] == from_up[-1] or to_forward[-1] == to_up[-1]: - raise Exception("invalid axis arguments passed, " - "can't use up/forward on the same axis.") + raise Exception("Invalid axis arguments passed, " + "can't use up/forward on the same axis") value = reduce(int.__or__, (_axis_convert_num[a] << (i * 3) for i, a in enumerate((from_forward, diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index b3127733c1e..6b65f720a5c 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -206,7 +206,7 @@ class _GenericBone: @property def children_recursive(self): - """a list of all children from this bone.""" + """A list of all children from this bone.""" bones_children = [] for bone in self._other_bones: index = bone.parent_index(self) diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 425ea210104..94d0c8c8614 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -299,7 +299,7 @@ def banner(context): add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils", 'OUTPUT') add_scrollback("Convenience Imports: from mathutils import *; from math import *", 'OUTPUT') add_scrollback("", 'OUTPUT') - # add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR') + # add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info", 'ERROR') # add_scrollback("", 'OUTPUT') sc.prompt = PROMPT diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py index 9226cbed51b..2b190e1aee1 100644 --- a/release/scripts/startup/bl_operators/image.py +++ b/release/scripts/startup/bl_operators/image.py @@ -74,7 +74,7 @@ class EditExternally(Operator): if not os.path.exists(filepath): self.report({'ERROR'}, "Image path %r not found, image may be packed or " - "unsaved." % filepath) + "unsaved" % filepath) return {'CANCELLED'} cmd = self._editor_guess(context) + [filepath] diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 6c9f27afaa5..d7c6cfc0565 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -283,11 +283,11 @@ class ShapeTransfer(Operator): ), ('RELATIVE_FACE', "Relative Face", - "Calculate relative position (using faces).", + "Calculate relative position (using faces)", ), ('RELATIVE_EDGE', "Relative Edge", - "Calculate relative position (using edges).", + "Calculate relative position (using edges)", ), ), name="Transformation Mode", @@ -297,7 +297,7 @@ class ShapeTransfer(Operator): use_clamp = BoolProperty( name="Clamp Offset", description=("Clamp the transformation to the distance each " - "vertex moves in the original shape."), + "vertex moves in the original shape"), default=False, ) @@ -503,7 +503,7 @@ class ShapeTransfer(Operator): ob_act, objects = objects[0], [ob_act] if ob_act.type != 'MESH': - self.report({'ERROR'}, "Other object is not a mesh.") + self.report({'ERROR'}, "Other object is not a mesh") return {'CANCELLED'} if ob_act.active_shape_key is None: diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 48b547980d4..c13a04eb87a 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -77,7 +77,7 @@ class QuickFur(Operator): if obj.type == 'MESH'] if not mesh_objects: - self.report({'ERROR'}, "Select at least one mesh object.") + self.report({'ERROR'}, "Select at least one mesh object") return {'CANCELLED'} mat = bpy.data.materials.new("Fur Material") @@ -157,7 +157,7 @@ class QuickExplode(Operator): fade = BoolProperty( name="Fade", - description="Fade the pieces over time.", + description="Fade the pieces over time", default=True, ) @@ -307,7 +307,7 @@ class QuickSmoke(Operator): show_flows = BoolProperty( name="Render Smoke Objects", - description="Keep the smoke objects visible during rendering.", + description="Keep the smoke objects visible during rendering", default=False, ) @@ -319,7 +319,7 @@ class QuickSmoke(Operator): max_co = -min_co if not mesh_objects: - self.report({'ERROR'}, "Select at least one mesh object.") + self.report({'ERROR'}, "Select at least one mesh object") return {'CANCELLED'} for obj in mesh_objects: @@ -428,7 +428,7 @@ class QuickFluid(Operator): ) show_flows = BoolProperty( name="Render Fluid Objects", - description="Keep the fluid objects visible during rendering.", + description="Keep the fluid objects visible during rendering", default=False, ) start_baking = BoolProperty( @@ -446,7 +446,7 @@ class QuickFluid(Operator): max_co = Vector((-100000, -100000, -100000)) if not mesh_objects: - self.report({'ERROR'}, "Select at least one mesh object.") + self.report({'ERROR'}, "Select at least one mesh object") return {'CANCELLED'} for obj in mesh_objects: diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index 856e182279a..53654ffbc6f 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -51,7 +51,7 @@ class SequencerCrossfadeSounds(Operator): seq2 = None break if seq2 is None: - self.report({'ERROR'}, "Select 2 sound strips.") + self.report({'ERROR'}, "Select 2 sound strips") return {'CANCELLED'} if seq1.frame_final_start > seq2.frame_final_start: s = seq1 @@ -71,7 +71,7 @@ class SequencerCrossfadeSounds(Operator): context.scene.frame_current = tempcfra return {'FINISHED'} else: - self.report({'ERROR'}, "The selected strips don't overlap.") + self.report({'ERROR'}, "The selected strips don't overlap") return {'CANCELLED'} diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py index 6c258d094e8..05656f5397d 100644 --- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py +++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py @@ -140,7 +140,7 @@ def extend(obj, operator, EXTEND_MODE): face_act = me.faces.active if face_act == -1: - operator.report({'ERROR'}, "No active face.") + operator.report({'ERROR'}, "No active face") return face_sel = [f for f in me.faces if len(f.vertices) == 4 and f.select] @@ -152,7 +152,7 @@ def extend(obj, operator, EXTEND_MODE): break if face_act_local_index == -1: - operator.report({'ERROR'}, "Active face not selected.") + operator.report({'ERROR'}, "Active face not selected") return # Modes diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py index 060fe400045..d9cdb1794c2 100644 --- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py +++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py @@ -531,7 +531,7 @@ def unwrap(operator, context, **kwargs): meshes = list({me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if me.faces and me.library is None}) if not meshes: - operator.report({'ERROR'}, "No mesh object.") + operator.report({'ERROR'}, "No mesh object") return {'CANCELLED'} lightmap_uvpack(meshes, **kwargs) diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 23838588f43..c4466e6453f 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -1070,11 +1070,11 @@ def main(context, # We want to pack all in 1 go, so pack now if USER_SHARE_SPACE: -#XXX Window.DrawProgressBar(0.9, "Box Packing for all objects...") +#XXX Window.DrawProgressBar(0.9, "Box Packing for all objects...") packIslands(collected_islandList) print("Smart Projection time: %.2f" % (time.time() - time1)) - # Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec." % (time.time() - time1)) + # Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec" % (time.time() - time1)) if is_editmode: bpy.ops.object.mode_set(mode='EDIT') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index aa09a088c4f..861255f167f 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -218,7 +218,7 @@ class WM_OT_context_scale_int(Operator): ) always_step = BoolProperty( name="Always Step", - description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.", + description="Always adjust the value by a minimum of 1 when 'value' is not 1.0", default=True, ) @@ -567,7 +567,7 @@ doc_new = StringProperty( ) data_path_iter = StringProperty( - description="The data path relative to the context, must point to an iterable.") + description="The data path relative to the context, must point to an iterable") data_path_item = StringProperty( description="The data path from each iterable to the value (int or float)") @@ -1175,7 +1175,7 @@ class WM_OT_copy_prev_settings(Operator): if bpy.data.is_saved is bpy.data.is_dirty is False: bpy.ops.wm.read_homefile() else: - self.report({'INFO'}, "Reload Start-Up file to restore settings.") + self.report({'INFO'}, "Reload Start-Up file to restore settings") return {'FINISHED'} return {'CANCELLED'} diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py index 3b33a7ccc61..d75541feca0 100644 --- a/release/scripts/startup/bl_ui/properties_animviz.py +++ b/release/scripts/startup/bl_ui/properties_animviz.py @@ -23,6 +23,7 @@ # NOTE: # The specialised panel types are derived in their respective UI modules # dont register these classes since they are only helpers. +from blf import gettext as _ class MotionPathButtonsPanel(): @@ -43,23 +44,23 @@ class MotionPathButtonsPanel(): col = split.column() sub = col.column(align=True) if (mps.type == 'CURRENT_FRAME'): - sub.prop(mps, "frame_before", text="Before") - sub.prop(mps, "frame_after", text="After") + sub.prop(mps, "frame_before", text=_("Before")) + sub.prop(mps, "frame_after", text=_("After")) elif (mps.type == 'RANGE'): - sub.prop(mps, "frame_start", text="Start") - sub.prop(mps, "frame_end", text="End") + sub.prop(mps, "frame_start", text=_("Start")) + sub.prop(mps, "frame_end", text=_("End")) - sub.prop(mps, "frame_step", text="Step") + sub.prop(mps, "frame_step", text=_("Step")) if bones: col.row().prop(mps, "bake_location", expand=True) col = split.column() - col.label(text="Display:") - col.prop(mps, "show_frame_numbers", text="Frame Numbers") - col.prop(mps, "show_keyframe_highlight", text="Keyframes") + col.label(text=_("Display:")) + col.prop(mps, "show_frame_numbers", text=_("Frame Numbers")) + col.prop(mps, "show_keyframe_highlight", text=_("Keyframes")) if bones: - col.prop(mps, "show_keyframe_action_all", text="+ Non-Grouped Keyframes") - col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers") + col.prop(mps, "show_keyframe_action_all", text=_("+ Non-Grouped Keyframes")) + col.prop(mps, "show_keyframe_numbers", text=_("Keyframe Numbers")) # FIXME: this panel still needs to be ported so that it will work correctly with animviz @@ -82,16 +83,16 @@ class OnionSkinButtonsPanel(): sub = col.column(align=True) if arm.ghost_type == 'RANGE': - sub.prop(arm, "ghost_frame_start", text="Start") - sub.prop(arm, "ghost_frame_end", text="End") - sub.prop(arm, "ghost_size", text="Step") + sub.prop(arm, "ghost_frame_start", text=_("Start")) + sub.prop(arm, "ghost_frame_end", text=_("End")) + sub.prop(arm, "ghost_size", text=_("Step")) elif arm.ghost_type == 'CURRENT_FRAME': - sub.prop(arm, "ghost_step", text="Range") - sub.prop(arm, "ghost_size", text="Step") + sub.prop(arm, "ghost_step", text=_("Range")) + sub.prop(arm, "ghost_size", text=_("Step")) col = split.column() - col.label(text="Display:") - col.prop(arm, "show_only_ghost_selected", text="Selected Only") + col.label(text=_("Display:")) + col.prop(arm, "show_only_ghost_selected", text=_("Selected Only")) if __name__ == "__main__": # only for live edit. import bpy diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 61093abe814..97783c09d4b 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel, Menu from rna_prop_ui import PropertyPanel +from blf import gettext as _ class ArmatureButtonsPanel(): @@ -60,16 +61,16 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel): layout.prop(arm, "pose_position", expand=True) col = layout.column() - col.label(text="Layers:") + col.label(text=_("Layers:")) col.prop(arm, "layers", text="") - col.label(text="Protected Layers:") + col.label(text=_("Protected Layers:")) col.prop(arm, "layers_protected", text="") layout.label(text="Deform:") flow = layout.column_flow() - flow.prop(arm, "use_deform_vertex_groups", text="Vertex Groups") - flow.prop(arm, "use_deform_envelopes", text="Envelopes") - flow.prop(arm, "use_deform_preserve_volume", text="Quaternion") + flow.prop(arm, "use_deform_vertex_groups", text=_("Vertex Groups")) + flow.prop(arm, "use_deform_envelopes", text=_("Envelopes")) + flow.prop(arm, "use_deform_preserve_volume", text=_("Quaternion")) if context.scene.render.engine == "BLENDER_GAME": layout.row().prop(arm, "vert_deformer", expand=True) @@ -89,15 +90,15 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(arm, "show_names", text="Names") - col.prop(arm, "show_axes", text="Axes") - col.prop(arm, "show_bone_custom_shapes", text="Shapes") + col.prop(arm, "show_names", text=_("Names")) + col.prop(arm, "show_axes", text=_("Axes")) + col.prop(arm, "show_bone_custom_shapes", text=_("Shapes")) col = split.column() - col.prop(arm, "show_group_colors", text="Colors") + col.prop(arm, "show_group_colors", text=_("Colors")) if ob: - col.prop(ob, "show_x_ray", text="X-Ray") - col.prop(arm, "use_deform_delay", text="Delay Refresh") + col.prop(ob, "show_x_ray", text=_("X-Ray")) + col.prop(arm, "use_deform_delay", text=_("Delay Refresh")) class DATA_PT_bone_group_specials(Menu): @@ -161,12 +162,12 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel): row.active = (ob.proxy is None) sub = row.row(align=True) - sub.operator("pose.group_assign", text="Assign") - sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove") + sub.operator("pose.group_assign", text=_("Assign")) + sub.operator("pose.group_unassign", text=_("Remove")) # row.operator("pose.bone_group_remove_from", text=_("Remove")) sub = row.row(align=True) - sub.operator("pose.group_select", text="Select") - sub.operator("pose.group_deselect", text="Deselect") + sub.operator("pose.group_select", text=_("Select")) + sub.operator("pose.group_deselect", text=_("Deselect")) class DATA_PT_pose_library(ArmatureButtonsPanel, Panel): @@ -230,16 +231,16 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel): col = split.column(align=True) if arm.ghost_type == 'RANGE': - col.prop(arm, "ghost_frame_start", text="Start") - col.prop(arm, "ghost_frame_end", text="End") - col.prop(arm, "ghost_size", text="Step") + col.prop(arm, "ghost_frame_start", text=_("Start")) + col.prop(arm, "ghost_frame_end", text=_("End")) + col.prop(arm, "ghost_size", text=_("Step")) elif arm.ghost_type == 'CURRENT_FRAME': - col.prop(arm, "ghost_step", text="Range") - col.prop(arm, "ghost_size", text="Step") + col.prop(arm, "ghost_step", text=_("Range")) + col.prop(arm, "ghost_size", text=_("Step")) col = split.column() - col.label(text="Display:") - col.prop(arm, "show_only_ghost_selected", text="Selected Only") + col.label(text=_("Display:")) + col.prop(arm, "show_only_ghost_selected", text=_("Selected Only")) class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): @@ -263,7 +264,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): layout.prop(itasc, "mode", expand=True) simulation = (itasc.mode == 'SIMULATION') if simulation: - layout.label(text="Reiteration:") + layout.label(text=_("Reiteration:")) layout.prop(itasc, "reiteration_method", expand=True) row = layout.row() @@ -275,8 +276,8 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): layout.prop(itasc, "use_auto_step") row = layout.row() if itasc.use_auto_step: - row.prop(itasc, "step_min", text="Min") - row.prop(itasc, "step_max", text="Max") + row.prop(itasc, "step_min", text=_("Min")) + row.prop(itasc, "step_max", text=_("Max")) else: row.prop(itasc, "step_count") @@ -286,7 +287,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): layout.prop(itasc, "velocity_max") if itasc.solver == 'DLS': row = layout.row() - row.prop(itasc, "damping_max", text="Damp", slider=True) + row.prop(itasc, "damping_max", text=_("Damp"), slider=True) row.prop(itasc, "damping_epsilon", text="Eps", slider=True) from bl_ui.properties_animviz import ( @@ -314,8 +315,8 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel): layout.separator() split = layout.split() - split.operator("pose.paths_calculate", text="Calculate Paths") - split.operator("pose.paths_clear", text="Clear Paths") + split.operator("pose.paths_calculate", text=_("Calculate Paths")) + split.operator("pose.paths_clear", text=_("Clear Paths")) class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from panel when ready diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index b3eaf88d5bf..54045cd7d6e 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -21,6 +21,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class BoneButtonsPanel(): @@ -76,14 +77,14 @@ class BONE_PT_transform(BoneButtonsPanel, Panel): col = row.column() if pchan.rotation_mode == 'QUATERNION': - col.prop(pchan, "rotation_quaternion", text="Rotation") + col.prop(pchan, "rotation_quaternion", text=_("Rotation")) elif pchan.rotation_mode == 'AXIS_ANGLE': - #col.label(text="Rotation") - #col.prop(pchan, "rotation_angle", text="Angle") - #col.prop(pchan, "rotation_axis", text="Axis") - col.prop(pchan, "rotation_axis_angle", text="Rotation") + #col.label(text=_("Rotation")) + #col.prop(pchan, "rotation_angle", text=_("Angle")) + #col.prop(pchan, "rotation_axis", text=_("Axis")) + col.prop(pchan, "rotation_axis_angle", text=_("Rotation")) else: - col.prop(pchan, "rotation_euler", text="Rotation") + col.prop(pchan, "rotation_euler", text=_("Rotation")) row.column().prop(pchan, "scale") @@ -97,7 +98,7 @@ class BONE_PT_transform(BoneButtonsPanel, Panel): col = row.column() sub = col.column(align=True) - sub.label(text="Roll:") + sub.label(text=_("Roll:")) sub.prop(bone, "roll", text="") sub.label() sub.prop(bone, "lock") @@ -126,12 +127,12 @@ class BONE_PT_transform_locks(BoneButtonsPanel, Panel): col = row.column() if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}: - col.prop(pchan, "lock_rotations_4d", text="Lock Rotation") + col.prop(pchan, "lock_rotations_4d", text=_("Lock Rotation")) if pchan.lock_rotations_4d: col.prop(pchan, "lock_rotation_w", text="W") col.prop(pchan, "lock_rotation", text="") else: - col.prop(pchan, "lock_rotation", text="Rotation") + col.prop(pchan, "lock_rotation", text=_("Rotation")) row.column().prop(pchan, "lock_scale") @@ -155,17 +156,17 @@ class BONE_PT_relations(BoneButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Layers:") + col.label(text=_("Layers:")) col.prop(bone, "layers", text="") col.separator() if ob and pchan: - col.label(text="Bone Group:") + col.label(text=_("Bone Group:")) col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="") col = split.column() - col.label(text="Parent:") + col.label(text=_("Parent:")) if context.bone: col.prop(bone, "parent", text="") else: @@ -174,11 +175,11 @@ class BONE_PT_relations(BoneButtonsPanel, Panel): sub = col.column() sub.active = (bone.parent is not None) sub.prop(bone, "use_connect") - sub.prop(bone, "use_inherit_rotation", text="Inherit Rotation") - sub.prop(bone, "use_inherit_scale", text="Inherit Scale") + sub.prop(bone, "use_inherit_rotation", text=_("Inherit Rotation")) + sub.prop(bone, "use_inherit_scale", text=_("Inherit Scale")) sub = col.column() sub.active = (not bone.parent or not bone.use_connect) - sub.prop(bone, "use_local_location", text="Local Location") + sub.prop(bone, "use_local_location", text=_("Local Location")) class BONE_PT_display(BoneButtonsPanel, Panel): @@ -206,16 +207,16 @@ class BONE_PT_display(BoneButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(bone, "show_wire", text="Wireframe") - col.prop(bone, "hide", text="Hide") + col.prop(bone, "show_wire", text=_("Wireframe")) + col.prop(bone, "hide", text=_("Hide")) if pchan: col = split.column() - col.label(text="Custom Shape:") + col.label(text=_("Custom Shape:")) col.prop(pchan, "custom_shape", text="") if pchan.custom_shape: - col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At") + col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text=_("At")) class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): @@ -241,13 +242,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X") split.active = pchan.is_in_ik_chain row = split.row() - row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True) + row.prop(pchan, "ik_stiffness_x", text=_("Stiffness"), slider=True) row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain split = layout.split(percentage=0.25) sub = split.row() - sub.prop(pchan, "use_ik_limit_x", text="Limit") + sub.prop(pchan, "use_ik_limit_x", text=_("Limit")) sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain sub = split.row(align=True) sub.prop(pchan, "ik_min_x", text="") @@ -258,13 +259,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y") split.active = pchan.is_in_ik_chain row = split.row() - row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True) + row.prop(pchan, "ik_stiffness_y", text=_("Stiffness"), slider=True) row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain split = layout.split(percentage=0.25) sub = split.row() - sub.prop(pchan, "use_ik_limit_y", text="Limit") + sub.prop(pchan, "use_ik_limit_y", text=_("Limit")) sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain sub = split.row(align=True) @@ -276,13 +277,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z") split.active = pchan.is_in_ik_chain sub = split.row() - sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True) + sub.prop(pchan, "ik_stiffness_z", text=_("Stiffness"), slider=True) sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain split = layout.split(percentage=0.25) sub = split.row() - sub.prop(pchan, "use_ik_limit_z", text="Limit") + sub.prop(pchan, "use_ik_limit_z", text=_("Limit")) sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain sub = split.row(align=True) sub.prop(pchan, "ik_min_z", text="") @@ -290,7 +291,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain split = layout.split(percentage=0.25) - split.label(text="Stretch:") + split.label(text=_("Stretch:")) sub = split.row() sub.prop(pchan, "ik_stretch", text="", slider=True) sub.active = pchan.is_in_ik_chain @@ -298,15 +299,15 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): if ob.pose.ik_solver == 'ITASC': split = layout.split() col = split.column() - col.prop(pchan, "use_ik_rotation_control", text="Control Rotation") + col.prop(pchan, "use_ik_rotation_control", text=_("Control Rotation")) col.active = pchan.is_in_ik_chain col = split.column() - col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True) + col.prop(pchan, "ik_rotation_weight", text=_("Weight"), slider=True) col.active = pchan.is_in_ik_chain # not supported yet #row = layout.row() - #row.prop(pchan, "use_ik_linear_control", text="Joint Size") - #row.prop(pchan, "ik_linear_weight", text="Weight", slider=True) + #row.prop(pchan, "use_ik_linear_control", text=_("Joint Size")) + #row.prop(pchan, "ik_linear_weight", text=_("Weight"), slider=True) class BONE_PT_deform(BoneButtonsPanel, Panel): @@ -334,27 +335,27 @@ class BONE_PT_deform(BoneButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Envelope:") + col.label(text=_("Envelope:")) sub = col.column(align=True) - sub.prop(bone, "envelope_distance", text="Distance") - sub.prop(bone, "envelope_weight", text="Weight") - col.prop(bone, "use_envelope_multiply", text="Multiply") + sub.prop(bone, "envelope_distance", text=_("Distance")) + sub.prop(bone, "envelope_weight", text=_("Weight")) + col.prop(bone, "use_envelope_multiply", text=_("Multiply")) sub = col.column(align=True) - sub.label(text="Radius:") - sub.prop(bone, "head_radius", text="Head") - sub.prop(bone, "tail_radius", text="Tail") + sub.label(text=_("Radius:")) + sub.prop(bone, "head_radius", text=_("Head")) + sub.prop(bone, "tail_radius", text=_("Tail")) col = split.column() - col.label(text="Curved Bones:") + col.label(text=_("Curved Bones:")) sub = col.column(align=True) - sub.prop(bone, "bbone_segments", text="Segments") - sub.prop(bone, "bbone_in", text="Ease In") - sub.prop(bone, "bbone_out", text="Ease Out") + sub.prop(bone, "bbone_segments", text=_("Segments")) + sub.prop(bone, "bbone_in", text=_("Ease In")) + sub.prop(bone, "bbone_out", text=_("Ease Out")) - col.label(text="Offset:") + col.label(text=_("Offset:")) col.prop(bone, "use_cyclic_offset") diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 5255af40951..6d6f4c27ddf 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class CameraButtonsPanel(): @@ -91,16 +92,16 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): split = layout.split() col = split.column(align=True) - col.label(text="Shift:") + col.label(text=_("Shift:")) col.prop(cam, "shift_x", text="X") col.prop(cam, "shift_y", text="Y") col = split.column(align=True) - col.label(text="Clipping:") - col.prop(cam, "clip_start", text="Start") - col.prop(cam, "clip_end", text="End") + col.label(text=_("Clipping:")) + col.prop(cam, "clip_start", text=_("Start")) + col.prop(cam, "clip_end", text=_("End")) - layout.label(text="Depth of Field:") + layout.label(text=_("Depth of Field:")) split = layout.split() split.prop(cam, "dof_object", text="") @@ -109,7 +110,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): if cam.dof_object is not None: col.enabled = False - col.prop(cam, "dof_distance", text="Distance") + col.prop(cam, "dof_distance", text=_("Distance")) class DATA_PT_camera_display(CameraButtonsPanel, Panel): @@ -124,19 +125,19 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(cam, "show_limits", text="Limits") - col.prop(cam, "show_mist", text="Mist") - col.prop(cam, "show_title_safe", text="Title Safe") - col.prop(cam, "show_name", text="Name") + col.prop(cam, "show_limits", text=_("Limits")) + col.prop(cam, "show_mist", text=_("Mist")) + col.prop(cam, "show_title_safe", text=_("Title Safe")) + col.prop(cam, "show_name", text=_("Name")) col.prop_menu_enum(cam, "show_guide") col = split.column() - col.prop(cam, "draw_size", text="Size") + col.prop(cam, "draw_size", text=_("Size")) col.separator() - col.prop(cam, "show_passepartout", text="Passepartout") + col.prop(cam, "show_passepartout", text=_("Passepartout")) sub = col.column() sub.active = cam.show_passepartout - sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True) + sub.prop(cam, "passepartout_alpha", text=_("Alpha"), slider=True) class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 6448b9a5229..47051194fc0 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class CurveButtonsPanel(): @@ -67,7 +68,7 @@ class DATA_PT_context_curve(CurveButtonsPanel, Panel): class DATA_PT_shape_curve(CurveButtonsPanel, Panel): - bl_label = "Shape" + bl_label = _("Shape") def draw(self, context): layout = self.layout @@ -85,17 +86,17 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Resolution:") + col.label(text=_("Resolution:")) sub = col.column(align=True) - sub.prop(curve, "resolution_u", text="Preview U") - sub.prop(curve, "render_resolution_u", text="Render U") + sub.prop(curve, "resolution_u", text=_("Preview U")) + sub.prop(curve, "render_resolution_u", text=_("Render U")) if is_curve: - col.label(text="Twisting:") + col.label(text=_("Twisting:")) col.prop(curve, "twist_mode", text="") - col.prop(curve, "twist_smooth", text="Smooth") + col.prop(curve, "twist_smooth", text=_("Smooth")) if is_text: - col.label(text="Display:") - col.prop(curve, "use_fast_edit", text="Fast Editing") + col.label(text=_("Display:")) + col.prop(curve, "use_fast_edit", text=_("Fast Editing")) col = split.column() @@ -103,16 +104,15 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel): sub = col.column() sub.label(text="") sub = col.column(align=True) - sub.prop(curve, "resolution_v", text="Preview V") - sub.prop(curve, "render_resolution_v", text="Render V") + sub.prop(curve, "resolution_v", text=_("Preview V")) + sub.prop(curve, "render_resolution_v", text=_("Render V")) if (is_curve or is_text): - col.label(text="Fill:") + col.label(text=_("Fill:")) sub = col.column() sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D')) - sub.prop(curve, "use_fill_front") - sub.prop(curve, "use_fill_back") - col.prop(curve, "use_fill_deform", text="Fill Deformed") + sub.prop(curve, "fill_mode", text="") + col.prop(curve, "use_fill_deform", text=_("Fill Deformed")) class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel): @@ -130,8 +130,8 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel): row.prop(curve, "use_uv_as_generated") row = layout.row() - row.column().prop(curve, "texspace_location", text="Location") - row.column().prop(curve, "texspace_size", text="Size") + row.column().prop(curve, "texspace_location", text=_("Location")) + row.column().prop(curve, "texspace_size", text=_("Size")) class DATA_PT_geometry_curve(CurveButtonsPanel, Panel): @@ -153,17 +153,17 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Modification:") + col.label(text=_("Modification:")) col.prop(curve, "offset") col.prop(curve, "extrude") - col.label(text="Taper Object:") + col.label(text=_("Taper Object:")) col.prop(curve, "taper_object", text="") col = split.column() - col.label(text="Bevel:") - col.prop(curve, "bevel_depth", text="Depth") - col.prop(curve, "bevel_resolution", text="Resolution") - col.label(text="Bevel Object:") + col.label(text=_("Bevel:")) + col.prop(curve, "bevel_depth", text=_("Depth")) + col.prop(curve, "bevel_resolution", text=_("Resolution")) + col.label(text=_("Bevel Object:")) col.prop(curve, "bevel_object", text="") @@ -183,7 +183,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): layout.active = curve.use_path col = layout.column() - layout.prop(curve, "path_duration", text="Frames") + layout.prop(curve, "path_duration", text=_("Frames")) layout.prop(curve, "eval_time") split = layout.split() @@ -195,7 +195,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): col = split.column() col.prop(curve, "use_radius") - col.prop(curve, "use_time_offset", text="Offset Children") + col.prop(curve, "use_time_offset", text=_("Offset Children")) class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): @@ -216,20 +216,20 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): # These settings are below but its easier to have # poly's set aside since they use so few settings col = split.column() - col.label(text="Cyclic:") + col.label(text=_("Cyclic:")) col.prop(act_spline, "use_smooth") col = split.column() col.prop(act_spline, "use_cyclic_u", text="U") else: col = split.column() - col.label(text="Cyclic:") + col.label(text=_("Cyclic:")) if act_spline.type == 'NURBS': - col.label(text="Bezier:") - col.label(text="Endpoint:") - col.label(text="Order:") + col.label(text=_("Bezier:")) + col.label(text=_("Endpoint:")) + col.label(text=_("Order:")) - col.label(text="Resolution:") + col.label(text=_("Resolution:")) col = split.column() col.prop(act_spline, "use_cyclic_u", text="U") @@ -262,9 +262,9 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): col = split.column() col.active = (curve.dimensions == '3D') - col.label(text="Interpolation:") - col.prop(act_spline, "tilt_interpolation", text="Tilt") - col.prop(act_spline, "radius_interpolation", text="Radius") + col.label(text=_("Interpolation:")) + col.prop(act_spline, "tilt_interpolation", text=_("Tilt")) + col.prop(act_spline, "radius_interpolation", text=_("Radius")) layout.prop(act_spline, "use_smooth") @@ -283,16 +283,16 @@ class DATA_PT_font(CurveButtonsPanel, Panel): char = context.curve.edit_format row = layout.split(percentage=0.25) - row.label(text="Regular") + row.label(text=_("Regular")) row.template_ID(text, "font", open="font.open", unlink="font.unlink") row = layout.split(percentage=0.25) - row.label(text="Bold") + row.label(text=_("Bold")) row.template_ID(text, "font_bold", open="font.open", unlink="font.unlink") row = layout.split(percentage=0.25) - row.label(text="Italic") + row.label(text=_("Italic")) row.template_ID(text, "font_italic", open="font.open", unlink="font.unlink") row = layout.split(percentage=0.25) - row.label(text="Bold & Italic") + row.label(text=_("Bold & Italic")) row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink") #layout.prop(text, "font") @@ -300,36 +300,36 @@ class DATA_PT_font(CurveButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(text, "size", text="Size") + col.prop(text, "size", text=_("Size")) col = split.column() col.prop(text, "shear") split = layout.split() col = split.column() - col.label(text="Object Font:") + col.label(text=_("Object Font:")) col.prop(text, "family", text="") col = split.column() - col.label(text="Text on Curve:") + col.label(text=_("Text on Curve:")) col.prop(text, "follow_curve", text="") split = layout.split() col = split.column() colsub = col.column(align=True) - colsub.label(text="Underline:") - colsub.prop(text, "underline_position", text="Position") - colsub.prop(text, "underline_height", text="Thickness") + colsub.label(text=_("Underline:")) + colsub.prop(text, "underline_position", text=_("Position")) + colsub.prop(text, "underline_height", text=_("Thickness")) col = split.column() - col.label(text="Character:") + col.label(text=_("Character:")) col.prop(char, "use_bold") col.prop(char, "use_italic") col.prop(char, "use_underline") row = layout.row() - row.prop(text, "small_caps_scale", text="Small Caps") + row.prop(text, "small_caps_scale", text=_("Small Caps")) row.prop(char, "use_small_caps") @@ -345,19 +345,19 @@ class DATA_PT_paragraph(CurveButtonsPanel, Panel): text = context.curve - layout.label(text="Align:") + layout.label(text=_("Align:")) layout.prop(text, "align", expand=True) split = layout.split() col = split.column(align=True) - col.label(text="Spacing:") - col.prop(text, "space_character", text="Character") - col.prop(text, "space_word", text="Word") - col.prop(text, "space_line", text="Line") + col.label(text=_("Spacing:")) + col.prop(text, "space_character", text=_("Character")) + col.prop(text, "space_word", text=_("Word")) + col.prop(text, "space_line", text=_("Line")) col = split.column(align=True) - col.label(text="Offset:") + col.label(text=_("Offset:")) col.prop(text, "offset_x", text="X") col.prop(text, "offset_y", text="Y") @@ -389,13 +389,13 @@ class DATA_PT_text_boxes(CurveButtonsPanel, Panel): col = split.column(align=True) - col.label(text="Dimensions:") - col.prop(box, "width", text="Width") - col.prop(box, "height", text="Height") + col.label(text=_("Dimensions:")) + col.prop(box, "width", text=_("Width")) + col.prop(box, "height", text=_("Height")) col = split.column(align=True) - col.label(text="Offset:") + col.label(text=_("Offset:")) col.prop(box, "x", text="X") col.prop(box, "y", text="Y") diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py index c781873e16c..fac6d8fcfb1 100644 --- a/release/scripts/startup/bl_ui/properties_data_empty.py +++ b/release/scripts/startup/bl_ui/properties_data_empty.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel +from blf import gettext as _ class DataButtonsPanel(): @@ -39,17 +40,17 @@ class DATA_PT_empty(DataButtonsPanel, Panel): ob = context.object - layout.prop(ob, "empty_draw_type", text="Display") + layout.prop(ob, "empty_draw_type", text=_("Display")) if ob.empty_draw_type == 'IMAGE': layout.template_ID(ob, "data", open="image.open", unlink="image.unlink") - layout.prop(ob, "color", text="Transparency", index=3, slider=True) + layout.prop(ob, "color", text=_("Transparency"), index=3, slider=True) row = layout.row(align=True) - row.prop(ob, "empty_image_offset", text="Offset X", index=0) - row.prop(ob, "empty_image_offset", text="Offset Y", index=1) + row.prop(ob, "empty_image_offset", text=_("Offset X"), index=0) + row.prop(ob, "empty_image_offset", text=_("Offset Y"), index=1) - layout.prop(ob, "empty_draw_size", text="Size") + layout.prop(ob, "empty_draw_size", text=_("Size")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 4ff180f74fb..f488669b424 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -20,10 +20,11 @@ import bpy from bpy.types import Menu, Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class LAMP_MT_sunsky_presets(Menu): - bl_label = "Sun & Sky Presets" + bl_label = _("Sun & Sky Presets") preset_subdir = "sunsky" preset_operator = "script.execute_preset" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -93,15 +94,15 @@ class DATA_PT_lamp(DataButtonsPanel, Panel): sub.prop(lamp, "energy") if lamp.type in {'POINT', 'SPOT'}: - sub.label(text="Falloff:") + sub.label(text=_("Falloff:")) sub.prop(lamp, "falloff_type", text="") sub.prop(lamp, "distance") if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED': - col.label(text="Attenuation Factors:") + col.label(text=_("Attenuation Factors:")) sub = col.column(align=True) - sub.prop(lamp, "linear_attenuation", slider=True, text="Linear") - sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic") + sub.prop(lamp, "linear_attenuation", slider=True, text=_("Linear")) + sub.prop(lamp, "quadratic_attenuation", slider=True, text=_("Quadratic")) col.prop(lamp, "use_sphere") @@ -111,7 +112,7 @@ class DATA_PT_lamp(DataButtonsPanel, Panel): col = split.column() col.prop(lamp, "use_negative") - col.prop(lamp, "use_own_layer", text="This Layer Only") + col.prop(lamp, "use_own_layer", text=_("This Layer Only")) col.prop(lamp, "use_specular") col.prop(lamp, "use_diffuse") @@ -139,34 +140,34 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel): row = layout.row() row.active = lamp.use_sky or lamp.use_atmosphere - row.prop(lamp, "atmosphere_turbidity", text="Turbidity") + row.prop(lamp, "atmosphere_turbidity", text=_("Turbidity")) split = layout.split() col = split.column() col.active = lamp.use_sky - col.label(text="Blending:") + col.label(text=_("Blending:")) sub = col.column() sub.prop(lamp, "sky_blend_type", text="") - sub.prop(lamp, "sky_blend", text="Factor") + sub.prop(lamp, "sky_blend", text=_("Factor")) - col.label(text="Color Space:") + col.label(text=_("Color Space:")) sub = col.column() sub.row().prop(lamp, "sky_color_space", expand=True) - sub.prop(lamp, "sky_exposure", text="Exposure") + sub.prop(lamp, "sky_exposure", text=_("Exposure")) col = split.column() col.active = lamp.use_sky - col.label(text="Horizon:") + col.label(text=_("Horizon:")) sub = col.column() - sub.prop(lamp, "horizon_brightness", text="Brightness") - sub.prop(lamp, "spread", text="Spread") + sub.prop(lamp, "horizon_brightness", text=_("Brightness")) + sub.prop(lamp, "spread", text=_("Spread")) - col.label(text="Sun:") + col.label(text=_("Sun:")) sub = col.column() - sub.prop(lamp, "sun_brightness", text="Brightness") - sub.prop(lamp, "sun_size", text="Size") - sub.prop(lamp, "backscattered_light", slider=True, text="Back Light") + sub.prop(lamp, "sun_brightness", text=_("Brightness")) + sub.prop(lamp, "sun_size", text=_("Size")) + sub.prop(lamp, "backscattered_light", slider=True, text=_("Back Light")) layout.separator() @@ -176,16 +177,16 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel): col = split.column() col.active = lamp.use_atmosphere - col.label(text="Intensity:") - col.prop(lamp, "sun_intensity", text="Sun") - col.prop(lamp, "atmosphere_distance_factor", text="Distance") + col.label(text=_("Intensity:")) + col.prop(lamp, "sun_intensity", text=_("Sun")) + col.prop(lamp, "atmosphere_distance_factor", text=_("Distance")) col = split.column() col.active = lamp.use_atmosphere - col.label(text="Scattering:") + col.label(text=_("Scattering:")) sub = col.column(align=True) - sub.prop(lamp, "atmosphere_inscattering", slider=True, text="Inscattering") - sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction") + sub.prop(lamp, "atmosphere_inscattering", slider=True, text=_("Inscattering")) + sub.prop(lamp, "atmosphere_extinction", slider=True, text=_("Extinction")) class DATA_PT_shadow(DataButtonsPanel, Panel): @@ -209,15 +210,15 @@ class DATA_PT_shadow(DataButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Form factor sampling:") + col.label(text=_("Form factor sampling:")) sub = col.row(align=True) if lamp.shape == 'SQUARE': - sub.prop(lamp, "shadow_ray_samples_x", text="Samples") + sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples")) elif lamp.shape == 'RECTANGLE': - sub.prop(lamp, "shadow_ray_samples_x", text="Samples X") - sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y") + sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples X")) + sub.prop(lamp, "shadow_ray_samples_y", text=_("Samples Y")) if lamp.shadow_method != 'NOSHADOW': split = layout.split() @@ -226,34 +227,34 @@ class DATA_PT_shadow(DataButtonsPanel, Panel): col.prop(lamp, "shadow_color", text="") col = split.column() - col.prop(lamp, "use_shadow_layer", text="This Layer Only") + col.prop(lamp, "use_shadow_layer", text=_("This Layer Only")) col.prop(lamp, "use_only_shadow") if lamp.shadow_method == 'RAY_SHADOW': split = layout.split() col = split.column() - col.label(text="Sampling:") + col.label(text=_("Sampling:")) if lamp.type in {'POINT', 'SUN', 'SPOT'}: sub = col.row() - sub.prop(lamp, "shadow_ray_samples", text="Samples") - sub.prop(lamp, "shadow_soft_size", text="Soft Size") + sub.prop(lamp, "shadow_ray_samples", text=_("Samples")) + sub.prop(lamp, "shadow_soft_size", text=_("Soft Size")) elif lamp.type == 'AREA': sub = col.row(align=True) if lamp.shape == 'SQUARE': - sub.prop(lamp, "shadow_ray_samples_x", text="Samples") + sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples")) elif lamp.shape == 'RECTANGLE': - sub.prop(lamp, "shadow_ray_samples_x", text="Samples X") - sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y") + sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples X")) + sub.prop(lamp, "shadow_ray_samples_y", text=_("Samples Y")) col.row().prop(lamp, "shadow_ray_sample_method", expand=True) if lamp.shadow_ray_sample_method == 'ADAPTIVE_QMC': - layout.prop(lamp, "shadow_adaptive_threshold", text="Threshold") + layout.prop(lamp, "shadow_adaptive_threshold", text=_("Threshold")) if lamp.type == 'AREA' and lamp.shadow_ray_sample_method == 'CONSTANT_JITTERED': row = layout.row() @@ -263,44 +264,44 @@ class DATA_PT_shadow(DataButtonsPanel, Panel): elif lamp.shadow_method == 'BUFFER_SHADOW': col = layout.column() - col.label(text="Buffer Type:") + col.label(text=_("Buffer Type:")) col.row().prop(lamp, "shadow_buffer_type", expand=True) if lamp.shadow_buffer_type in {'REGULAR', 'HALFWAY', 'DEEP'}: split = layout.split() col = split.column() - col.label(text="Filter Type:") + col.label(text=_("Filter Type:")) col.prop(lamp, "shadow_filter_type", text="") sub = col.column(align=True) - sub.prop(lamp, "shadow_buffer_soft", text="Soft") - sub.prop(lamp, "shadow_buffer_bias", text="Bias") + sub.prop(lamp, "shadow_buffer_soft", text=_("Soft")) + sub.prop(lamp, "shadow_buffer_bias", text=_("Bias")) col = split.column() - col.label(text="Sample Buffers:") + col.label(text=_("Sample Buffers:")) col.prop(lamp, "shadow_sample_buffers", text="") sub = col.column(align=True) - sub.prop(lamp, "shadow_buffer_size", text="Size") - sub.prop(lamp, "shadow_buffer_samples", text="Samples") + sub.prop(lamp, "shadow_buffer_size", text=_("Size")) + sub.prop(lamp, "shadow_buffer_samples", text=_("Samples")) if lamp.shadow_buffer_type == 'DEEP': col.prop(lamp, "compression_threshold") elif lamp.shadow_buffer_type == 'IRREGULAR': - layout.prop(lamp, "shadow_buffer_bias", text="Bias") + layout.prop(lamp, "shadow_buffer_bias", text=_("Bias")) split = layout.split() col = split.column() - col.prop(lamp, "use_auto_clip_start", text="Autoclip Start") + col.prop(lamp, "use_auto_clip_start", text=_("Autoclip Start")) sub = col.column() sub.active = not lamp.use_auto_clip_start - sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start") + sub.prop(lamp, "shadow_buffer_clip_start", text=_("Clip Start")) col = split.column() - col.prop(lamp, "use_auto_clip_end", text="Autoclip End") + col.prop(lamp, "use_auto_clip_end", text=_("Autoclip End")) sub = col.column() sub.active = not lamp.use_auto_clip_end - sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End") + sub.prop(lamp, "shadow_buffer_clip_end", text=_(" Clip End")) class DATA_PT_area(DataButtonsPanel, Panel): @@ -325,8 +326,8 @@ class DATA_PT_area(DataButtonsPanel, Panel): if (lamp.shape == 'SQUARE'): sub.prop(lamp, "size") elif (lamp.shape == 'RECTANGLE'): - sub.prop(lamp, "size", text="Size X") - sub.prop(lamp, "size_y", text="Size Y") + sub.prop(lamp, "size", text=_("Size X")) + sub.prop(lamp, "size_y", text=_("Size Y")) class DATA_PT_spot(DataButtonsPanel, Panel): @@ -348,8 +349,8 @@ class DATA_PT_spot(DataButtonsPanel, Panel): col = split.column() sub = col.column() - sub.prop(lamp, "spot_size", text="Size") - sub.prop(lamp, "spot_blend", text="Blend", slider=True) + sub.prop(lamp, "spot_size", text=_("Size")) + sub.prop(lamp, "spot_blend", text=_("Blend"), slider=True) col.prop(lamp, "use_square") col.prop(lamp, "show_cone") @@ -358,9 +359,9 @@ class DATA_PT_spot(DataButtonsPanel, Panel): col.prop(lamp, "use_halo") sub = col.column(align=True) sub.active = lamp.use_halo - sub.prop(lamp, "halo_intensity", text="Intensity") + sub.prop(lamp, "halo_intensity", text=_("Intensity")) if lamp.shadow_method == 'BUFFER_SHADOW': - sub.prop(lamp, "halo_step", text="Step") + sub.prop(lamp, "halo_step", text=_("Step")) class DATA_PT_falloff_curve(DataButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 75df7dad5f2..82185b0b1b0 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -20,10 +20,11 @@ import bpy from bpy.types import Menu, Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class MESH_MT_vertex_group_specials(Menu): - bl_label = "Vertex Group Specials" + bl_label = _("Vertex Group Specials") COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): @@ -34,7 +35,11 @@ class MESH_MT_vertex_group_specials(Menu): layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA') layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA') layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT') - layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True + layout.operator("object.vertex_group_remove", icon='X', text=_("Delete All")).all = True + layout.separator() + layout.operator("object.vertex_group_lock", icon='LOCK', text="Lock All").action = 'SELECT' + layout.operator("object.vertex_group_lock", icon='UNLOCK', text="UnLock All").action = 'DESELECT' + layout.operator("object.vertex_group_lock", icon='LOCK', text="Lock Invert All").action = 'INVERT' class MESH_MT_shape_key_specials(Menu): @@ -47,7 +52,7 @@ class MESH_MT_shape_key_specials(Menu): layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT') - op = layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix") + op = layout.operator("object.shape_key_add", icon='ZOOMIN', text=_("New Shape From Mix")) op.from_mix = True @@ -95,7 +100,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel): col.prop(mesh, "use_auto_smooth") sub = col.column() sub.active = mesh.use_auto_smooth - sub.prop(mesh, "auto_smooth_angle", text="Angle") + sub.prop(mesh, "auto_smooth_angle", text=_("Angle")) split.prop(mesh, "show_double_sided") @@ -116,8 +121,8 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel): layout.prop(mesh, "use_auto_texspace") row = layout.row() - row.column().prop(mesh, "texspace_location", text="Location") - row.column().prop(mesh, "texspace_size", text="Size") + row.column().prop(mesh, "texspace_location", text=_("Location")) + row.column().prop(mesh, "texspace_size", text=_("Size")) class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): @@ -159,14 +164,14 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): row = layout.row() sub = row.row(align=True) - sub.operator("object.vertex_group_assign", text="Assign") - sub.operator("object.vertex_group_remove_from", text="Remove") + sub.operator("object.vertex_group_assign", text=_("Assign")) + sub.operator("object.vertex_group_remove_from", text=_("Remove")) sub = row.row(align=True) - sub.operator("object.vertex_group_select", text="Select") - sub.operator("object.vertex_group_deselect", text="Deselect") + sub.operator("object.vertex_group_select", text=_("Select")) + sub.operator("object.vertex_group_deselect", text=_("Deselect")) - layout.prop(context.tool_settings, "vertex_group_weight", text="Weight") + layout.prop(context.tool_settings, "vertex_group_weight", text=_("Weight")) class DATA_PT_shape_keys(MeshButtonsPanel, Panel): @@ -246,13 +251,13 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): col = split.column(align=True) col.active = enable_edit_value - col.label(text="Range:") - col.prop(kb, "slider_min", text="Min") - col.prop(kb, "slider_max", text="Max") + col.label(text=_("Range:")) + col.prop(kb, "slider_min", text=_("Min")) + col.prop(kb, "slider_max", text=_("Max")) col = split.column(align=True) col.active = enable_edit_value - col.label(text="Blend:") + col.label(text=_("Blend:")) col.prop_search(kb, "vertex_group", ob, "vertex_groups", text="") col.prop_search(kb, "relative_key", key, "key_blocks", text="") @@ -285,53 +290,6 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel): layout.prop(lay, "name") -class DATA_PT_texface(MeshButtonsPanel, Panel): - bl_label = "Texture Face" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} - - @classmethod - def poll(cls, context): - obj = context.object - return (context.mode == 'EDIT_MESH') and obj and obj.type == 'MESH' - - def draw(self, context): - layout = self.layout - col = layout.column() - - me = context.mesh - - tf = me.faces.active_tface - - if tf: - if context.scene.render.engine != 'BLENDER_GAME': - col.label(text="Options only supported in Game Engine") - - split = layout.split() - col = split.column() - - col.prop(tf, "use_image") - col.prop(tf, "use_light") - col.prop(tf, "hide") - col.prop(tf, "use_collision") - - col.prop(tf, "use_blend_shared") - col.prop(tf, "use_twoside") - col.prop(tf, "use_object_color") - - col = split.column() - - col.prop(tf, "use_halo") - col.prop(tf, "use_billboard") - col.prop(tf, "use_shadow_cast") - col.prop(tf, "use_bitmap_text") - col.prop(tf, "use_alpha_sort") - - col = layout.column() - col.prop(tf, "blend_type") - else: - col.label(text="No UV Texture") - - class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): bl_label = "Vertex Colors" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} diff --git a/release/scripts/startup/bl_ui/properties_data_metaball.py b/release/scripts/startup/bl_ui/properties_data_metaball.py index cd894e60dbb..dbb947e416c 100644 --- a/release/scripts/startup/bl_ui/properties_data_metaball.py +++ b/release/scripts/startup/bl_ui/properties_data_metaball.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class DataButtonsPanel(): @@ -60,16 +61,16 @@ class DATA_PT_metaball(DataButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Resolution:") + col.label(text=_("Resolution:")) sub = col.column(align=True) - sub.prop(mball, "resolution", text="View") - sub.prop(mball, "render_resolution", text="Render") + sub.prop(mball, "resolution", text=_("View")) + sub.prop(mball, "render_resolution", text=_("Render")) col = split.column() - col.label(text="Settings:") - col.prop(mball, "threshold", text="Threshold") + col.label(text=_("Settings:")) + col.prop(mball, "threshold", text=_("Threshold")) - layout.label(text="Update:") + layout.label(text=_("Update:")) layout.prop(mball, "update_method", expand=True) @@ -86,8 +87,8 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel): layout.prop(mball, "use_auto_texspace") row = layout.row() - row.column().prop(mball, "texspace_location", text="Location") - row.column().prop(mball, "texspace_size", text="Size") + row.column().prop(mball, "texspace_location", text=_("Location")) + row.column().prop(mball, "texspace_size", text=_("Size")) class DATA_PT_metaball_element(DataButtonsPanel, Panel): @@ -107,25 +108,25 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel): split = layout.split() col = split.column(align=True) - col.label(text="Settings:") - col.prop(metaelem, "stiffness", text="Stiffness") - col.prop(metaelem, "use_negative", text="Negative") - col.prop(metaelem, "hide", text="Hide") + col.label(text=_("Settings:")) + col.prop(metaelem, "stiffness", text=_("Stiffness")) + col.prop(metaelem, "use_negative", text=_("Negative")) + col.prop(metaelem, "hide", text=_("Hide")) col = split.column(align=True) if metaelem.type in {'CUBE', 'ELLIPSOID'}: - col.label(text="Size:") + col.label(text=_("Size:")) col.prop(metaelem, "size_x", text="X") col.prop(metaelem, "size_y", text="Y") col.prop(metaelem, "size_z", text="Z") elif metaelem.type == 'TUBE': - col.label(text="Size:") + col.label(text=_("Size:")) col.prop(metaelem, "size_x", text="X") elif metaelem.type == 'PLANE': - col.label(text="Size:") + col.label(text=_("Size:")) col.prop(metaelem, "size_x", text="X") col.prop(metaelem, "size_y", text="Y") diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index f0904ca8976..4719ae450f7 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel +from blf import gettext as _ class ModifierButtonsPanel(): @@ -51,14 +52,14 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(md, "object", text="") col.prop(md, "use_deform_preserve_volume") col = split.column() - col.label(text="Bind To:") - col.prop(md, "use_vertex_groups", text="Vertex Groups") - col.prop(md, "use_bone_envelopes", text="Bone Envelopes") + col.label(text=_("Bind To:")) + col.prop(md, "use_vertex_groups", text=_("Vertex Groups")) + col.prop(md, "use_bone_envelopes", text=_("Bone Envelopes")) layout.separator() @@ -92,11 +93,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.separator() - col.prop(md, "use_merge_vertices", text="Merge") + col.prop(md, "use_merge_vertices", text=_("Merge")) sub = col.column() sub.active = md.use_merge_vertices - sub.prop(md, "use_merge_vertices_cap", text="First Last") - sub.prop(md, "merge_threshold", text="Distance") + sub.prop(md, "use_merge_vertices_cap", text=_("First Last")) + sub.prop(md, "merge_threshold", text=_("Distance")) col = split.column() col.prop(md, "use_relative_offset") @@ -122,7 +123,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split.prop(md, "width") split.prop(md, "use_only_vertices") - layout.label(text="Limit Method:") + layout.label(text=_("Limit Method:")) layout.row().prop(md, "limit_method", expand=True) if md.limit_method == 'ANGLE': layout.prop(md, "angle_limit") @@ -133,11 +134,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Operation:") + col.label(text=_("Operation:")) col.prop(md, "operation", text="") col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(md, "object", text="") def BUILD(self, layout, ob, md): @@ -156,7 +157,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def CAST(self, layout, ob, md): split = layout.split(percentage=0.25) - split.label(text="Cast Type:") + split.label(text=_("Cast Type:")) split.prop(md, "cast_type", text="") split = layout.split(percentage=0.25) @@ -175,52 +176,52 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") col = split.column() - col.label(text="Control Object:") + col.label(text=_("Control Object:")) col.prop(md, "object", text="") if md.object: col.prop(md, "use_transform") def CLOTH(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def COLLISION(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def CURVE(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(md, "object", text="") col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - layout.label(text="Deformation Axis:") + layout.label(text=_("Deformation Axis:")) layout.row().prop(md, "deform_axis", expand=True) def DECIMATE(self, layout, ob, md): layout.prop(md, "ratio") - layout.label(text="Face Count: %s" % str(md.face_count)) + layout.label(text=_("Face Count") + ": %d" % md.face_count) def DISPLACE(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Texture:") + col.label(text=_("Texture:")) col.template_ID(md, "texture", new="texture.new") - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") col = split.column() - col.label(text="Direction:") + col.label(text=_("Direction:")) col.prop(md, "direction", text="") - col.label(text="Texture Coordinates:") + col.label(text=_("Texture Coordinates:")) col.prop(md, "texture_coords", text="") if md.texture_coords == 'OBJECT': - layout.prop(md, "texture_coords_object", text="Object") + layout.prop(md, "texture_coords_object", text=_("Object")) elif md.texture_coords == 'UV' and ob.type == 'MESH': layout.prop_search(md, "uv_layer", ob.data, "uv_textures") @@ -234,23 +235,23 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(md, "use_edge_angle", text="Edge Angle") + col.prop(md, "use_edge_angle", text=_("Edge Angle")) sub = col.column() sub.active = md.use_edge_angle sub.prop(md, "split_angle") - split.prop(md, "use_edge_sharp", text="Sharp Edges") + split.prop(md, "use_edge_sharp", text=_("Sharp Edges")) def EXPLODE(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Vertex group:") + col.label(text=_("Vertex group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") sub = col.column() sub.active = bool(md.vertex_group) sub.prop(md, "protect") - col.label(text="Particle UV") + col.label(text=_("Particle UV")) col.prop_search(md, "particle_uv", ob.data, "uv_textures", text="") col = split.column() @@ -260,22 +261,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "show_dead") col.prop(md, "use_size") - layout.operator("object.explode_refresh", text="Refresh") + layout.operator("object.explode_refresh", text=_("Refresh")) def FLUID_SIMULATION(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def HOOK(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(md, "object", text="") if md.object and md.object.type == 'ARMATURE': - col.label(text="Bone:") + col.label(text=_("Bone:")) col.prop_search(md, "subtarget", md.object.data, "bones", text="") col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") layout.separator() @@ -287,38 +288,38 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "force", slider=True) col = split.column() - col.operator("object.hook_reset", text="Reset") - col.operator("object.hook_recenter", text="Recenter") + col.operator("object.hook_reset", text=_("Reset")) + col.operator("object.hook_recenter", text=_("Recenter")) if ob.mode == 'EDIT': layout.separator() row = layout.row() - row.operator("object.hook_select", text="Select") - row.operator("object.hook_assign", text="Assign") + row.operator("object.hook_select", text=_("Select")) + row.operator("object.hook_assign", text=_("Assign")) def LATTICE(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(md, "object", text="") col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") def MASK(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Mode:") + col.label(text=_("Mode:")) col.prop(md, "mode", text="") col = split.column() if md.mode == 'ARMATURE': - col.label(text="Armature:") + col.label(text=_("Armature:")) col.prop(md, "armature", text="") elif md.mode == 'VERTEX_GROUP': - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") sub = col.column() @@ -330,11 +331,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() sub = col.column() - sub.label(text="Object:") + sub.label(text=_("Object:")) sub.prop(md, "object", text="") sub.active = not md.is_bound col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") sub = col.column() @@ -344,9 +345,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.separator() if md.is_bound: - layout.operator("object.meshdeform_bind", text="Unbind") + layout.operator("object.meshdeform_bind", text=_("Unbind")) else: - layout.operator("object.meshdeform_bind", text="Bind") + layout.operator("object.meshdeform_bind", text=_("Bind")) row = layout.row() row.prop(md, "precision") @@ -356,19 +357,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split(percentage=0.25) col = split.column() - col.label(text="Axis:") + col.label(text=_("Axis:")) col.prop(md, "use_x") col.prop(md, "use_y") col.prop(md, "use_z") col = split.column() - col.label(text="Options:") - col.prop(md, "use_mirror_merge", text="Merge") - col.prop(md, "use_clip", text="Clipping") - col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups") + col.label(text=_("Options:")) + col.prop(md, "use_mirror_merge", text=_("Merge")) + col.prop(md, "use_clip", text=_("Clipping")) + col.prop(md, "use_mirror_vertex_groups", text=_("Vertex Groups")) col = split.column() - col.label(text="Textures:") + col.label(text=_("Textures:")) col.prop(md, "use_mirror_u", text="U") col.prop(md, "use_mirror_v", text="V") @@ -376,7 +377,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): if md.use_mirror_merge == True: col.prop(md, "merge_threshold") - col.label(text="Mirror Object:") + col.label(text=_("Mirror Object:")) col.prop(md, "mirror_object", text="") def NAVMESH(self, layout, ob, md): @@ -388,17 +389,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(md, "levels", text="Preview") - col.prop(md, "sculpt_levels", text="Sculpt") - col.prop(md, "render_levels", text="Render") + col.prop(md, "levels", text=_("Preview")) + col.prop(md, "sculpt_levels", text=_("Sculpt")) + col.prop(md, "render_levels", text=_("Render")) col = split.column() col.enabled = ob.mode != 'EDIT' - col.operator("object.multires_subdivide", text="Subdivide") - col.operator("object.multires_higher_levels_delete", text="Delete Higher") - col.operator("object.multires_reshape", text="Reshape") - col.operator("object.multires_base_apply", text="Apply Base") + col.operator("object.multires_subdivide", text=_("Subdivide")) + col.operator("object.multires_higher_levels_delete", text=_("Delete Higher")) + col.operator("object.multires_reshape", text=_("Reshape")) + col.operator("object.multires_base_apply", text=_("Apply Base")) col.prop(md, "use_subsurf_uv") col.prop(md, "show_only_control_edges") @@ -407,34 +408,34 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = layout.column() row = col.row() if md.is_external: - row.operator("object.multires_external_pack", text="Pack External") + row.operator("object.multires_external_pack", text=_("Pack External")) row.label() row = col.row() row.prop(md, "filepath", text="") else: - row.operator("object.multires_external_save", text="Save External...") + row.operator("object.multires_external_save", text=_("Save External...")) row.label() def PARTICLE_INSTANCE(self, layout, ob, md): layout.prop(md, "object") - layout.prop(md, "particle_system_index", text="Particle System") + layout.prop(md, "particle_system_index", text=_("Particle System")) split = layout.split() col = split.column() - col.label(text="Create From:") + col.label(text=_("Create From:")) col.prop(md, "use_normal") col.prop(md, "use_children") col.prop(md, "use_size") col = split.column() - col.label(text="Show Particles When:") + col.label(text=_("Show Particles When:")) col.prop(md, "show_alive") col.prop(md, "show_unborn") col.prop(md, "show_dead") layout.separator() - layout.prop(md, "use_path", text="Create Along Paths") + layout.prop(md, "use_path", text=_("Create Along Paths")) split = layout.split() split.active = md.use_path @@ -444,17 +445,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.prop(md, "position", slider=True) - col.prop(md, "random_position", text="Random", slider=True) + col.prop(md, "random_position", text=_("Random"), slider=True) def PARTICLE_SYSTEM(self, layout, ob, md): - layout.label(text="Settings can be found inside the Particle context") + layout.label(text=_("Settings can be found inside the Particle context")) def SCREW(self, layout, ob, md): split = layout.split() col = split.column() col.prop(md, "axis") - col.prop(md, "object", text="AxisOb") + col.prop(md, "object", text=_("AxisOb")) col.prop(md, "angle") col.prop(md, "steps") col.prop(md, "render_steps") @@ -473,10 +474,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def SHRINKWRAP(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Target:") + col.label(text=_("Target:")) col.prop(md, "target", text="") col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") split = layout.split() @@ -486,28 +487,28 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "subsurf_levels") col = split.column() - col.label(text="Mode:") + col.label(text=_("Mode:")) col.prop(md, "wrap_method", text="") if md.wrap_method == 'PROJECT': split = layout.split(percentage=0.25) col = split.column() - col.label(text="Axis:") + col.label(text=_("Axis:")) col.prop(md, "use_project_x") col.prop(md, "use_project_y") col.prop(md, "use_project_z") col = split.column() - col.label(text="Direction:") + col.label(text=_("Direction:")) col.prop(md, "use_negative_direction") col.prop(md, "use_positive_direction") col = split.column() - col.label(text="Cull Faces:") + col.label(text=_("Cull Faces:")) col.prop(md, "cull_face", expand=True) - layout.label(text="Auxiliary Target:") + layout.label(text=_("Auxiliary Target:")) layout.prop(md, "auxiliary_target", text="") elif md.wrap_method == 'NEAREST_SURFACEPOINT': @@ -517,24 +518,24 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Mode:") + col.label(text=_("Mode:")) col.prop(md, "deform_method", text="") col = split.column() - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") split = layout.split() col = split.column() - col.label(text="Origin:") + col.label(text=_("Origin:")) col.prop(md, "origin", text="") sub = col.column() sub.active = (md.origin is not None) sub.prop(md, "use_relative") col = split.column() - col.label(text="Deform:") + col.label(text=_("Deform:")) col.prop(md, "factor") col.prop(md, "limits", slider=True) if md.deform_method in {'TAPER', 'STRETCH'}: @@ -542,13 +543,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "lock_y") def SMOKE(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def SMOOTH(self, layout, ob, md): split = layout.split(percentage=0.25) col = split.column() - col.label(text="Axis:") + col.label(text=_("Axis:")) col.prop(md, "use_x") col.prop(md, "use_y") col.prop(md, "use_z") @@ -556,11 +557,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.prop(md, "factor") col.prop(md, "iterations") - col.label(text="Vertex Group:") + col.label(text=_("Vertex Group:")) col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") def SOFT_BODY(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def SOLIDIFY(self, layout, ob, md): split = layout.split() @@ -569,19 +570,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "thickness") col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") - col.label(text="Crease:") - col.prop(md, "edge_crease_inner", text="Inner") - col.prop(md, "edge_crease_outer", text="Outer") - col.prop(md, "edge_crease_rim", text="Rim") - col.label(text="Material Index Offset:") + col.label(text=_("Crease:")) + col.prop(md, "edge_crease_inner", text=_("Inner")) + col.prop(md, "edge_crease_outer", text=_("Outer")) + col.prop(md, "edge_crease_rim", text=_("Rim")) + col.label(text=_("Material Index Offset:")) col = split.column() col.prop(md, "offset") sub = col.column() sub.active = bool(md.vertex_group) - sub.prop(md, "invert_vertex_group", text="Invert") - sub.prop(md, "thickness_vertex_group", text="Factor") + sub.prop(md, "invert_vertex_group", text=_("Invert")) + sub.prop(md, "thickness_vertex_group", text=_("Factor")) col.prop(md, "use_even_offset") col.prop(md, "use_quality_normals") @@ -592,64 +593,64 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): row.prop(md, "material_offset", text="") row = row.row() row.active = md.use_rim - row.prop(md, "material_offset_rim", text="Rim") + row.prop(md, "material_offset_rim", text=_("Rim")) def SUBSURF(self, layout, ob, md): layout.row().prop(md, "subdivision_type", expand=True) split = layout.split() col = split.column() - col.label(text="Subdivisions:") - col.prop(md, "levels", text="View") - col.prop(md, "render_levels", text="Render") + col.label(text=_("Subdivisions:")) + col.prop(md, "levels", text=_("View")) + col.prop(md, "render_levels", text=_("Render")) col = split.column() - col.label(text="Options:") + col.label(text=_("Options:")) col.prop(md, "use_subsurf_uv") col.prop(md, "show_only_control_edges") def SURFACE(self, layout, ob, md): - layout.label(text="Settings can be found inside the Physics context") + layout.label(text=_("Settings can be found inside the Physics context")) def UV_PROJECT(self, layout, ob, md): split = layout.split() col = split.column() - col.label(text="Image:") + col.label(text=_("Image:")) col.prop(md, "image", text="") col = split.column() - col.label(text="UV Layer:") + col.label(text=_("UV Layer:")) col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="") split = layout.split() col = split.column() col.prop(md, "use_image_override") - col.prop(md, "projector_count", text="Projectors") + col.prop(md, "projector_count", text=_("Projectors")) for proj in md.projectors: col.prop(proj, "object", text="") col = split.column() sub = col.column(align=True) - sub.prop(md, "aspect_x", text="Aspect X") - sub.prop(md, "aspect_y", text="Aspect Y") + sub.prop(md, "aspect_x", text=_("Aspect X")) + sub.prop(md, "aspect_y", text=_("Aspect Y")) sub = col.column(align=True) - sub.prop(md, "scale_x", text="Scale X") - sub.prop(md, "scale_y", text="Scale Y") + sub.prop(md, "scale_x", text=_("Scale X")) + sub.prop(md, "scale_y", text=_("Scale Y")) def WARP(self, layout, ob, md): use_falloff = (md.falloff_type != 'NONE') split = layout.split() col = split.column() - col.label(text="From:") + col.label(text=_("From:")) col.prop(md, "object_from", text="") col.prop(md, "use_volume_preserve") col = split.column() - col.label(text="To:") + col.label(text=_("To:")) col.prop(md, "object_to", text="") col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") @@ -668,15 +669,15 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): # 2 new columns split = layout.split() col = split.column() - col.label(text="Texture:") + col.label(text=_("Texture:")) col.prop(md, "texture", text="") col = split.column() - col.label(text="Texture Coordinates:") + col.label(text=_("Texture Coordinates:")) col.prop(md, "texture_coords", text="") if md.texture_coords == 'OBJECT': - layout.prop(md, "texture_coords_object", text="Object") + layout.prop(md, "texture_coords_object", text=_("Object")) elif md.texture_coords == 'UV' and ob.type == 'MESH': layout.prop_search(md, "uv_layer", ob.data, "uv_textures") @@ -684,7 +685,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Motion:") + col.label(text=_("Motion:")) col.prop(md, "use_x") col.prop(md, "use_y") col.prop(md, "use_cyclic") @@ -700,18 +701,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Time:") + col.label(text=_("Time:")) sub = col.column(align=True) - sub.prop(md, "time_offset", text="Offset") - sub.prop(md, "lifetime", text="Life") - col.prop(md, "damping_time", text="Damping") + sub.prop(md, "time_offset", text=_("Offset")) + sub.prop(md, "lifetime", text=_("Life")) + col.prop(md, "damping_time", text=_("Damping")) col = split.column() - col.label(text="Position:") + col.label(text=_("Position:")) sub = col.column(align=True) sub.prop(md, "start_position_x", text="X") sub.prop(md, "start_position_y", text="Y") - col.prop(md, "falloff_radius", text="Falloff") + col.prop(md, "falloff_radius", text=_("Falloff")) layout.separator() @@ -719,7 +720,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop_search(md, "vertex_group", ob, "vertex_groups") split = layout.split(percentage=0.33) col = split.column() - col.label(text="Texture") + col.label(text=_("Texture")) col = split.column() col.template_ID(md, "texture", new="texture.new") layout.prop(md, "texture_coords") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 26b95484b28..efe50b6fe2b 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel +from blf import gettext as _ class PhysicsButtonsPanel(): @@ -54,7 +55,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col = split.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") # out of place but useful + col.prop(ob, "hide_render", text=_("Invisible")) # out of place but useful col = split.column() col.prop(game, "use_material_physics_fh") @@ -66,7 +67,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "mass") col.prop(game, "radius") col.prop(game, "form_factor") @@ -81,29 +82,29 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Velocity:") + col.label(text=_("Velocity:")) sub = col.column(align=True) - sub.prop(game, "velocity_min", text="Minimum") - sub.prop(game, "velocity_max", text="Maximum") + sub.prop(game, "velocity_min", text=_("Minimum")) + sub.prop(game, "velocity_max", text=_("Maximum")) col = split.column() - col.label(text="Damping:") + col.label(text=_("Damping:")) sub = col.column(align=True) - sub.prop(game, "damping", text="Translation", slider=True) - sub.prop(game, "rotation_damping", text="Rotation", slider=True) + sub.prop(game, "damping", text=_("Translation"), slider=True) + sub.prop(game, "rotation_damping", text=_("Rotation"), slider=True) layout.separator() split = layout.split() col = split.column() - col.label(text="Lock Translation:") + col.label(text=_("Lock Translation:")) col.prop(game, "lock_location_x", text="X") col.prop(game, "lock_location_y", text="Y") col.prop(game, "lock_location_z", text="Z") col = split.column() - col.label(text="Lock Rotation:") + col.label(text=_("Lock Rotation:")) col.prop(game, "lock_rotation_x", text="X") col.prop(game, "lock_rotation_y", text="Y") col.prop(game, "lock_rotation_z", text="Z") @@ -112,21 +113,21 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col = layout.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") + col.prop(ob, "hide_render", text=_("Invisible")) layout.separator() split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "mass") col.prop(soft, "weld_threshold") col.prop(soft, "location_iterations") col.prop(soft, "linear_stiffness", slider=True) col.prop(soft, "dynamic_friction", slider=True) col.prop(soft, "collision_margin", slider=True) - col.prop(soft, "use_bending_constraints", text="Bending Constraints") + col.prop(soft, "use_bending_constraints", text=_("Bending Constraints")) col = split.column() col.prop(soft, "use_shape_match") @@ -136,25 +137,25 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col.separator() - col.label(text="Cluster Collision:") + col.label(text=_("Cluster Collision:")) col.prop(soft, "use_cluster_rigid_to_softbody") col.prop(soft, "use_cluster_soft_to_softbody") sub = col.column() sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody) - sub.prop(soft, "cluster_iterations", text="Iterations") + sub.prop(soft, "cluster_iterations", text=_("Iterations")) elif game.physics_type == 'STATIC': col = layout.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") + col.prop(ob, "hide_render", text=_("Invisible")) layout.separator() split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "radius") col = split.column() @@ -165,7 +166,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): subsub.prop(game, "friction_coefficients", text="", slider=True) elif game.physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}: - layout.prop(ob, "hide_render", text="Invisible") + layout.prop(ob, "hide_render", text=_("Invisible")) class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): @@ -189,11 +190,11 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): game = context.active_object.game layout.active = game.use_collision_bounds - layout.prop(game, "collision_bounds_type", text="Bounds") + layout.prop(game, "collision_bounds_type", text=_("Bounds")) row = layout.row() - row.prop(game, "collision_margin", text="Margin", slider=True) - row.prop(game, "use_collision_compound", text="Compound") + row.prop(game, "collision_margin", text=_("Margin"), slider=True) + row.prop(game, "use_collision_compound", text=_("Compound")) class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel): @@ -242,7 +243,7 @@ class RENDER_PT_game(RenderButtonsPanel, Panel): layout = self.layout row = layout.row() - row.operator("view3d.game_start", text="Start") + row.operator("view3d.game_start", text=_("Start")) row.label() @@ -260,20 +261,20 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Resolution:") + col.label(text=_("Resolution:")) sub = col.column(align=True) sub.prop(gs, "resolution_x", slider=False, text="X") sub.prop(gs, "resolution_y", slider=False, text="Y") col = split.column() - col.label(text="Quality:") + col.label(text=_("Quality:")) sub = col.column(align=True) - sub.prop(gs, "depth", text="Bit Depth", slider=False) - sub.prop(gs, "frequency", text="FPS", slider=False) + sub.prop(gs, "depth", text=_("Bit Depth"), slider=False) + sub.prop(gs, "frequency", text=_("FPS"), slider=False) # framing: col = layout.column() - col.label(text="Framing:") + col.label(text=_("Framing:")) col.row().prop(gs, "frame_type", expand=True) if gs.frame_type == 'LETTERBOX': col.prop(gs, "frame_color", text="") @@ -299,7 +300,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): # dome: elif stereo_mode == 'DOME': - layout.prop(gs, "dome_mode", text="Dome Type") + layout.prop(gs, "dome_mode", text=_("Dome Type")) dome_type = gs.dome_mode @@ -310,23 +311,23 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): dome_type == 'TRUNCATED_FRONT': col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col.prop(gs, "dome_angle", slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tesselation", text=_("Tesselation")) col.prop(gs, "dome_tilt") elif dome_type == 'PANORAM_SPH': col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tesselation", text=_("Tesselation")) else: # cube map col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col = split.column() @@ -348,15 +349,15 @@ class RENDER_PT_game_shading(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(gs, "use_glsl_lights", text="Lights") - col.prop(gs, "use_glsl_shaders", text="Shaders") - col.prop(gs, "use_glsl_shadows", text="Shadows") - col.prop(gs, "use_glsl_color_management", text="Color Management") + col.prop(gs, "use_glsl_lights", text=_("Lights")) + col.prop(gs, "use_glsl_shaders", text=_("Shaders")) + col.prop(gs, "use_glsl_shadows", text=_("Shadows")) + col.prop(gs, "use_glsl_color_management", text=_("Color Management")) col = split.column() - col.prop(gs, "use_glsl_ramps", text="Ramps") - col.prop(gs, "use_glsl_nodes", text="Nodes") - col.prop(gs, "use_glsl_extra_textures", text="Extra Textures") + col.prop(gs, "use_glsl_ramps", text=_("Ramps")) + col.prop(gs, "use_glsl_nodes", text=_("Nodes")) + col.prop(gs, "use_glsl_extra_textures", text=_("Extra Textures")) class RENDER_PT_game_performance(RenderButtonsPanel, Panel): @@ -384,11 +385,11 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): gs = context.scene.game_settings flow = layout.column_flow() - flow.prop(gs, "show_debug_properties", text="Debug Properties") - flow.prop(gs, "show_framerate_profile", text="Framerate and Profile") - flow.prop(gs, "show_physics_visualization", text="Physics Visualization") + flow.prop(gs, "show_debug_properties", text=_("Debug Properties")) + flow.prop(gs, "show_framerate_profile", text=_("Framerate and Profile")) + flow.prop(gs, "show_physics_visualization", text=_("Physics Visualization")) flow.prop(gs, "use_deprecation_warnings") - flow.prop(gs, "show_mouse", text="Mouse Cursor") + flow.prop(gs, "show_mouse", text=_("Mouse Cursor")) class SceneButtonsPanel(): @@ -546,37 +547,37 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel): layout.prop(gs, "physics_engine") if gs.physics_engine != 'NONE': - layout.prop(gs, "physics_gravity", text="Gravity") + layout.prop(gs, "physics_gravity", text=_("Gravity")) split = layout.split() col = split.column() - col.label(text="Physics Steps:") + col.label(text=_("Physics Steps:")) sub = col.column(align=True) - sub.prop(gs, "physics_step_max", text="Max") - sub.prop(gs, "physics_step_sub", text="Substeps") - col.prop(gs, "fps", text="FPS") + sub.prop(gs, "physics_step_max", text=_("Max")) + sub.prop(gs, "physics_step_sub", text=_("Substeps")) + col.prop(gs, "fps", text=_("FPS")) col = split.column() - col.label(text="Logic Steps:") - col.prop(gs, "logic_step_max", text="Max") + col.label(text=_("Logic Steps:")) + col.prop(gs, "logic_step_max", text=_("Max")) col = layout.column() - col.prop(gs, "use_occlusion_culling", text="Occlusion Culling") + col.prop(gs, "use_occlusion_culling", text=_("Occlusion Culling")) sub = col.column() sub.active = gs.use_occlusion_culling - sub.prop(gs, "occlusion_culling_resolution", text="Resolution") + sub.prop(gs, "occlusion_culling_resolution", text=_("Resolution")) else: split = layout.split() col = split.column() - col.label(text="Physics Steps:") - col.prop(gs, "fps", text="FPS") + col.label(text=_("Physics Steps:")) + col.prop(gs, "fps", text=_("FPS")) col = split.column() - col.label(text="Logic Steps:") - col.prop(gs, "logic_step_max", text="Max") + col.label(text=_("Logic Steps:")) + col.prop(gs, "logic_step_max", text=_("Max")) class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 13ce92f084c..3a1a4358979 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Menu, Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ def active_node_mat(mat): @@ -114,9 +115,9 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): if ob.mode == 'EDIT': row = layout.row(align=True) - row.operator("object.material_slot_assign", text="Assign") - row.operator("object.material_slot_select", text="Select") - row.operator("object.material_slot_deselect", text="Deselect") + row.operator("object.material_slot_assign", text=_("Assign")) + row.operator("object.material_slot_select", text=_("Select")) + row.operator("object.material_slot_deselect", text=_("Deselect")) split = layout.split(percentage=0.65) @@ -142,7 +143,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): if mat.active_node_material: row.prop(mat.active_node_material, "name", text="") else: - row.label(text="No material node selected") + row.label(text=_("No material node selected")) class MATERIAL_PT_preview(MaterialButtonsPanel, Panel): @@ -197,8 +198,8 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel): col = split.column() col.active = mat_type - col.prop(mat, "use_cast_shadows_only", text="Cast Only") - col.prop(mat, "shadow_cast_alpha", text="Casting Alpha") + col.prop(mat, "use_cast_shadows_only", text=_("Cast Only")) + col.prop(mat, "shadow_cast_alpha", text=_("Casting Alpha")) col.prop(mat, "use_cast_buffer_shadows") col.prop(mat, "use_cast_approximate") col.prop(mat, "pass_index") @@ -225,12 +226,12 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): col.prop(mat, "diffuse_color", text="") sub = col.column() sub.active = (not mat.use_shadeless) - sub.prop(mat, "diffuse_intensity", text="Intensity") + sub.prop(mat, "diffuse_intensity", text=_("Intensity")) col = split.column() col.active = (not mat.use_shadeless) col.prop(mat, "diffuse_shader", text="") - col.prop(mat, "use_diffuse_ramp", text="Ramp") + col.prop(mat, "use_diffuse_ramp", text=_("Ramp")) col = layout.column() col.active = (not mat.use_shadeless) @@ -240,12 +241,12 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): col.prop(mat, "darkness") elif mat.diffuse_shader == 'TOON': row = col.row() - row.prop(mat, "diffuse_toon_size", text="Size") - row.prop(mat, "diffuse_toon_smooth", text="Smooth") + row.prop(mat, "diffuse_toon_size", text=_("Size")) + row.prop(mat, "diffuse_toon_smooth", text=_("Smooth")) elif mat.diffuse_shader == 'FRESNEL': row = col.row() - row.prop(mat, "diffuse_fresnel", text="Fresnel") - row.prop(mat, "diffuse_fresnel_factor", text="Factor") + row.prop(mat, "diffuse_fresnel", text=_("Fresnel")) + row.prop(mat, "diffuse_fresnel_factor", text=_("Factor")) if mat.use_diffuse_ramp: col = layout.column() @@ -255,10 +256,10 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): col.separator() row = col.row() - row.prop(mat, "diffuse_ramp_input", text="Input") - row.prop(mat, "diffuse_ramp_blend", text="Blend") + row.prop(mat, "diffuse_ramp_input", text=_("Input")) + row.prop(mat, "diffuse_ramp_blend", text=_("Blend")) - col.prop(mat, "diffuse_ramp_factor", text="Factor") + col.prop(mat, "diffuse_ramp_factor", text=_("Factor")) class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): @@ -282,25 +283,25 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): col = split.column() col.prop(mat, "specular_color", text="") - col.prop(mat, "specular_intensity", text="Intensity") + col.prop(mat, "specular_intensity", text=_("Intensity")) col = split.column() col.prop(mat, "specular_shader", text="") - col.prop(mat, "use_specular_ramp", text="Ramp") + col.prop(mat, "use_specular_ramp", text=_("Ramp")) col = layout.column() if mat.specular_shader in {'COOKTORR', 'PHONG'}: - col.prop(mat, "specular_hardness", text="Hardness") + col.prop(mat, "specular_hardness", text=_("Hardness")) elif mat.specular_shader == 'BLINN': row = col.row() - row.prop(mat, "specular_hardness", text="Hardness") - row.prop(mat, "specular_ior", text="IOR") + row.prop(mat, "specular_hardness", text=_("Hardness")) + row.prop(mat, "specular_ior", text=_("IOR")) elif mat.specular_shader == 'WARDISO': - col.prop(mat, "specular_slope", text="Slope") + col.prop(mat, "specular_slope", text=_("Slope")) elif mat.specular_shader == 'TOON': row = col.row() - row.prop(mat, "specular_toon_size", text="Size") - row.prop(mat, "specular_toon_smooth", text="Smooth") + row.prop(mat, "specular_toon_size", text=_("Size")) + row.prop(mat, "specular_toon_smooth", text=_("Smooth")) if mat.use_specular_ramp: layout.separator() @@ -308,10 +309,10 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): layout.separator() row = layout.row() - row.prop(mat, "specular_ramp_input", text="Input") - row.prop(mat, "specular_ramp_blend", text="Blend") + row.prop(mat, "specular_ramp_input", text=_("Input")) + row.prop(mat, "specular_ramp_blend", text=_("Blend")) - layout.prop(mat, "specular_ramp_factor", text="Factor") + layout.prop(mat, "specular_ramp_factor", text=_("Factor")) class MATERIAL_PT_shading(MaterialButtonsPanel, Panel): @@ -384,14 +385,14 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): col.prop(mat, "alpha") row = col.row() row.active = (base_mat.transparency_method != 'MASK') and (not mat.use_shadeless) - row.prop(mat, "specular_alpha", text="Specular") + row.prop(mat, "specular_alpha", text=_("Specular")) col = split.column() col.active = (not mat.use_shadeless) col.prop(rayt, "fresnel") sub = col.column() sub.active = rayt.fresnel > 0 - sub.prop(rayt, "fresnel_factor", text="Blend") + sub.prop(rayt, "fresnel_factor", text=_("Blend")) if base_mat.transparency_method == 'RAYTRACE': layout.separator() @@ -406,12 +407,12 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): col.prop(rayt, "depth") col = split.column() - col.label(text="Gloss:") - col.prop(rayt, "gloss_factor", text="Amount") + col.label(text=_("Gloss:")) + col.prop(rayt, "gloss_factor", text=_("Amount")) sub = col.column() sub.active = rayt.gloss_factor < 1.0 - sub.prop(rayt, "gloss_threshold", text="Threshold") - sub.prop(rayt, "gloss_samples", text="Samples") + sub.prop(rayt, "gloss_threshold", text=_("Threshold")) + sub.prop(rayt, "gloss_samples", text=_("Samples")) class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel): @@ -448,28 +449,28 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel): col.prop(raym, "fresnel") sub = col.column() sub.active = raym.fresnel > 0 - sub.prop(raym, "fresnel_factor", text="Blend") + sub.prop(raym, "fresnel_factor", text=_("Blend")) split = layout.split() col = split.column() col.separator() col.prop(raym, "depth") - col.prop(raym, "distance", text="Max Dist") + col.prop(raym, "distance", text=_("Max Dist")) col.separator() sub = col.split(percentage=0.4) sub.active = raym.distance > 0.0 - sub.label(text="Fade To:") + sub.label(text=_("Fade To:")) sub.prop(raym, "fade_to", text="") col = split.column() - col.label(text="Gloss:") - col.prop(raym, "gloss_factor", text="Amount") + col.label(text=_("Gloss:")) + col.prop(raym, "gloss_factor", text=_("Amount")) sub = col.column() sub.active = raym.gloss_factor < 1.0 - sub.prop(raym, "gloss_threshold", text="Threshold") - sub.prop(raym, "gloss_samples", text="Samples") - sub.prop(raym, "gloss_anisotropic", text="Anisotropic") + sub.prop(raym, "gloss_threshold", text=_("Threshold")) + sub.prop(raym, "gloss_samples", text=_("Samples")) + sub.prop(raym, "gloss_anisotropic", text=_("Anisotropic")) class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): @@ -510,18 +511,18 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): col.prop(sss, "ior") col.prop(sss, "scale") col.prop(sss, "color", text="") - col.prop(sss, "radius", text="RGB Radius", expand=True) + col.prop(sss, "radius", text=_("RGB Radius"), expand=True) col = split.column() sub = col.column(align=True) - sub.label(text="Blend:") - sub.prop(sss, "color_factor", text="Color") - sub.prop(sss, "texture_factor", text="Texture") - sub.label(text="Scattering Weight:") + sub.label(text=_("Blend:")) + sub.prop(sss, "color_factor", text=_("Color")) + sub.prop(sss, "texture_factor", text=_("Texture")) + sub.label(text=_("Scattering Weight:")) sub.prop(sss, "front") sub.prop(sss, "back") col.separator() - col.prop(sss, "error_threshold", text="Error") + col.prop(sss, "error_threshold", text=_("Error")) class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): @@ -561,7 +562,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): col.prop(halo, "hardness") col.prop(halo, "add") - layout.label(text="Options:") + layout.label(text=_("Options:")) split = layout.split() col = split.column() @@ -603,25 +604,55 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(halo, "flare_size", text="Size") - col.prop(halo, "flare_boost", text="Boost") - col.prop(halo, "flare_seed", text="Seed") + col.prop(halo, "flare_size", text=_("Size")) + col.prop(halo, "flare_boost", text=_("Boost")) + col.prop(halo, "flare_seed", text=_("Seed")) col = split.column() - col.prop(halo, "flare_subflare_count", text="Subflares") - col.prop(halo, "flare_subflare_size", text="Subsize") + col.prop(halo, "flare_subflare_count", text=_("Subflares")) + col.prop(halo, "flare_subflare_size", text=_("Subsize")) -class MATERIAL_PT_physics(MaterialButtonsPanel, Panel): +class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel): + bl_label = "Game Settings" + COMPAT_ENGINES = {'BLENDER_GAME'} + + @classmethod + def poll(cls, context): + return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + game = context.material.game_settings # dont use node material + + row = layout.row() + row.prop(game, "back_culling") + row.prop(game, "invisible") + row.prop(game, "text") + + row = layout.row() + row.label(text="Alpha Blend:") + row.label(text="Face Orientation:") + row = layout.row() + row.prop(game, "alpha_blend", text="") + row.prop(game, "face_orientation", text="") + + +class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Physics" COMPAT_ENGINES = {'BLENDER_GAME'} + def draw_header(self, context): + game = context.material.game_settings + self.layout.prop(game, "physics", text="") + @classmethod def poll(cls, context): return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout + layout.active = context.material.game_settings.physics phys = context.material.physics # dont use node material @@ -631,7 +662,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, Panel): row.prop(phys, "elasticity", slider=True) row = layout.row() - row.label(text="Force Field:") + row.label(text=_("Force Field:")) row = layout.row() row.prop(phys, "fh_force") @@ -663,10 +694,10 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): col = split.column() sub = col.column(align=True) - sub.label(text="Size:") - sub.prop(tan, "root_size", text="Root") - sub.prop(tan, "tip_size", text="Tip") - sub.prop(tan, "size_min", text="Minimum") + sub.label(text=_("Size:")) + sub.prop(tan, "root_size", text=_("Root")) + sub.prop(tan, "tip_size", text=_("Tip")) + sub.prop(tan, "size_min", text=_("Minimum")) sub.prop(tan, "use_blender_units") sub = col.column() sub.active = (not mat.use_shadeless) @@ -674,7 +705,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): col.prop(tan, "shape") col = split.column() - col.label(text="Shading:") + col.label(text=_("Shading:")) col.prop(tan, "width_fade") ob = context.object if ob and ob.type == 'MESH': @@ -684,9 +715,9 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): col.separator() sub = col.column() sub.active = (not mat.use_shadeless) - sub.label("Surface diffuse:") + sub.label(_("Surface diffuse:")) sub = col.column() - sub.prop(tan, "blend_distance", text="Distance") + sub.prop(tan, "blend_distance", text=_("Distance")) class MATERIAL_PT_options(MaterialButtonsPanel, Panel): @@ -719,11 +750,11 @@ class MATERIAL_PT_options(MaterialButtonsPanel, Panel): sub.prop(mat, "offset_z") sub.active = mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY' sub = col.column(align=True) - sub.label(text="Light Group:") + sub.label(text=_("Light Group:")) sub.prop(mat, "light_group", text="") row = sub.row() row.active = bool(mat.light_group) - row.prop(mat, "use_light_group_exclusive", text="Exclusive") + row.prop(mat, "use_light_group_exclusive", text=_("Exclusive")) col = split.column() col.prop(mat, "use_face_texture") @@ -758,12 +789,12 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(mat, "use_shadows", text="Receive") - col.prop(mat, "use_transparent_shadows", text="Receive Transparent") + col.prop(mat, "use_shadows", text=_("Receive")) + col.prop(mat, "use_transparent_shadows", text=_("Receive Transparent")) if simple_material(base_mat): - col.prop(mat, "use_cast_shadows_only", text="Cast Only") - col.prop(mat, "shadow_cast_alpha", text="Casting Alpha") - col.prop(mat, "use_only_shadow", text="Shadows Only") + col.prop(mat, "use_cast_shadows_only", text=_("Cast Only")) + col.prop(mat, "shadow_cast_alpha", text=_("Casting Alpha")) + col.prop(mat, "use_only_shadow", text=_("Shadows Only")) sub = col.column() sub.active = mat.use_only_shadow sub.prop(mat, "shadow_only_type", text="") @@ -773,11 +804,11 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel): col.prop(mat, "use_cast_buffer_shadows") sub = col.column() sub.active = mat.use_cast_buffer_shadows - sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias") - col.prop(mat, "use_ray_shadow_bias", text="Auto Ray Bias") + sub.prop(mat, "shadow_buffer_bias", text=_("Buffer Bias")) + col.prop(mat, "use_ray_shadow_bias", text=_("Auto Ray Bias")) sub = col.column() sub.active = (not mat.use_ray_shadow_bias) - sub.prop(mat, "shadow_ray_bias", text="Ray Bias") + sub.prop(mat, "shadow_ray_bias", text=_("Ray Bias")) if simple_material(base_mat): col.prop(mat, "use_cast_approximate") @@ -890,7 +921,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, Panel): sub = col.column() sub.enabled = True sub.active = False - sub.label("Light Cache Enabled") + sub.label(_("Light Cache Enabled")) col.prop(vol, "cache_resolution") sub = col.column(align=True) @@ -929,7 +960,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Step Calculation:") + col.label(text=_("Step Calculation:")) col.prop(vol, "step_method", text="") col = col.column(align=True) col.prop(vol, "step_size") @@ -964,11 +995,11 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel): col.prop(mat, "use_mist") col = split.column() - col.label(text="Light Group:") + col.label(text=_("Light Group:")) col.prop(mat, "light_group", text="") row = col.row() row.active = bool(mat.light_group) - row.prop(mat, "use_light_group_exclusive", text="Exclusive") + row.prop(mat, "use_light_group_exclusive", text=_("Exclusive")) class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 0779debb102..89ffd4d3ed1 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class ObjectButtonsPanel(): @@ -55,14 +56,14 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel): row.column().prop(ob, "location") if ob.rotation_mode == 'QUATERNION': - row.column().prop(ob, "rotation_quaternion", text="Rotation") + row.column().prop(ob, "rotation_quaternion", text=_("Rotation")) elif ob.rotation_mode == 'AXIS_ANGLE': - #row.column().label(text="Rotation") - #row.column().prop(pchan, "rotation_angle", text="Angle") - #row.column().prop(pchan, "rotation_axis", text="Axis") - row.column().prop(ob, "rotation_axis_angle", text="Rotation") + #row.column().label(text=_("Rotation")) + #row.column().prop(pchan, "rotation_angle", text=_("Angle")) + #row.column().prop(pchan, "rotation_axis", text=_("Axis")) + row.column().prop(ob, "rotation_axis_angle", text=_("Rotation")) else: - row.column().prop(ob, "rotation_euler", text="Rotation") + row.column().prop(ob, "rotation_euler", text=_("Rotation")) row.column().prop(ob, "scale") @@ -82,15 +83,15 @@ class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel): row.column().prop(ob, "delta_location") if ob.rotation_mode == 'QUATERNION': - row.column().prop(ob, "delta_rotation_quaternion", text="Rotation") + row.column().prop(ob, "delta_rotation_quaternion", text=_("Rotation")) elif ob.rotation_mode == 'AXIS_ANGLE': - #row.column().label(text="Rotation") - #row.column().prop(pchan, "delta_rotation_angle", text="Angle") - #row.column().prop(pchan, "delta_rotation_axis", text="Axis") - #row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation") - row.column().label(text="Not for Axis-Angle") + #row.column().label(text=_("Rotation")) + #row.column().prop(pchan, "delta_rotation_angle", text=_("Angle")) + #row.column().prop(pchan, "delta_rotation_axis", text=_("Axis")) + #row.column().prop(ob, "delta_rotation_axis_angle", text=_("Rotation")) + row.column().label(text=_("Not for Axis-Angle")) else: - row.column().prop(ob, "delta_rotation_euler", text="Rotation") + row.column().prop(ob, "delta_rotation_euler", text=_("Rotation")) row.column().prop(ob, "delta_scale") @@ -107,18 +108,18 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel): row = layout.row() col = row.column() - col.prop(ob, "lock_location", text="Location") + col.prop(ob, "lock_location", text=_("Location")) col = row.column() if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}: - col.prop(ob, "lock_rotations_4d", text="Rotation") + col.prop(ob, "lock_rotations_4d", text=_("Rotation")) if ob.lock_rotations_4d: col.prop(ob, "lock_rotation_w", text="W") col.prop(ob, "lock_rotation", text="") else: - col.prop(ob, "lock_rotation", text="Rotation") + col.prop(ob, "lock_rotation", text=_("Rotation")) - row.column().prop(ob, "lock_scale", text="Scale") + row.column().prop(ob, "lock_scale", text=_("Scale")) class OBJECT_PT_relations(ObjectButtonsPanel, Panel): @@ -137,7 +138,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel): col.prop(ob, "pass_index") col = split.column() - col.label(text="Parent:") + col.label(text=_("Parent:")) col.prop(ob, "parent", text="") sub = col.column() @@ -157,7 +158,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): ob = context.object row = layout.row(align=True) - row.operator("object.group_link", text="Add to Group") + row.operator("object.group_link", text=_("Add to Group")) row.operator("object.group_add", text="", icon='ZOOMIN') # XXX, this is bad practice, yes, I wrote it :( - campbell @@ -176,12 +177,12 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): split = col.box().split() col = split.column() - col.prop(group, "layers", text="Dupli") + col.prop(group, "layers", text=_("Dupli")) col = split.column() col.prop(group, "dupli_offset", text="") - prop = col.operator("wm.context_set_value", text="From Cursor") + prop = col.operator("wm.context_set_value", text=_("From Cursor")) prop.data_path = "object.users_group[%d].dupli_offset" % index prop.value = value index += 1 @@ -197,11 +198,11 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(ob, "draw_type", text="Type") + col.prop(ob, "draw_type", text=_("Type")) col = split.column() row = col.row() - row.prop(ob, "show_bounds", text="Bounds") + row.prop(ob, "show_bounds", text=_("Bounds")) sub = row.row() sub.active = ob.show_bounds sub.prop(ob, "draw_bounds_type", text="") @@ -209,16 +210,16 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(ob, "show_name", text="Name") - col.prop(ob, "show_axis", text="Axis") - col.prop(ob, "show_wire", text="Wire") - col.prop(ob, "color", text="Object Color") + col.prop(ob, "show_name", text=_("Name")) + col.prop(ob, "show_axis", text=_("Axis")) + col.prop(ob, "show_wire", text=_("Wire")) + col.prop(ob, "color", text=_("Object Color")) col = split.column() - col.prop(ob, "show_texture_space", text="Texture Space") - col.prop(ob, "show_x_ray", text="X-Ray") + col.prop(ob, "show_texture_space", text=_("Texture Space")) + col.prop(ob, "show_x_ray", text=_("X-Ray")) if ob.type == 'MESH': - col.prop(ob, "show_transparent", text="Transparency") + col.prop(ob, "show_transparent", text=_("Transparency")) class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): @@ -235,26 +236,26 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): split = layout.split() col = split.column(align=True) - col.prop(ob, "dupli_frames_start", text="Start") - col.prop(ob, "dupli_frames_end", text="End") + col.prop(ob, "dupli_frames_start", text=_("Start")) + col.prop(ob, "dupli_frames_end", text=_("End")) col = split.column(align=True) - col.prop(ob, "dupli_frames_on", text="On") - col.prop(ob, "dupli_frames_off", text="Off") + col.prop(ob, "dupli_frames_on", text=_("On")) + col.prop(ob, "dupli_frames_off", text=_("Off")) - layout.prop(ob, "use_dupli_frames_speed", text="Speed") + layout.prop(ob, "use_dupli_frames_speed", text=_("Speed")) elif ob.dupli_type == 'VERTS': - layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation") + layout.prop(ob, "use_dupli_vertices_rotation", text=_("Rotation")) elif ob.dupli_type == 'FACES': row = layout.row() - row.prop(ob, "use_dupli_faces_scale", text="Scale") - row.prop(ob, "dupli_faces_scale", text="Inherit Scale") + row.prop(ob, "use_dupli_faces_scale", text=_("Scale")) + row.prop(ob, "dupli_faces_scale", text=_("Inherit Scale")) elif ob.dupli_type == 'GROUP': - layout.prop(ob, "dupli_group", text="Group") + layout.prop(ob, "dupli_group", text=_("Group")) # XXX: the following options are all quite buggy, ancient hacks that should be dropped @@ -271,21 +272,21 @@ class OBJECT_PT_animation(ObjectButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Time Offset:") - col.prop(ob, "use_time_offset_edit", text="Edit") + col.label(text=_("Time Offset:")) + col.prop(ob, "use_time_offset_edit", text=_("Edit")) row = col.row() - row.prop(ob, "use_time_offset_parent", text="Parent") + row.prop(ob, "use_time_offset_parent", text=_("Parent")) row.active = (ob.parent is not None) row = col.row() row.prop(ob, "use_slow_parent") row.active = (ob.parent is not None) - col.prop(ob, "time_offset", text="Offset") + col.prop(ob, "time_offset", text=_("Offset")) # XXX: these are still used for a few curve-related tracking features col = split.column() - col.label(text="Tracking Axes:") - col.prop(ob, "track_axis", text="Axis") - col.prop(ob, "up_axis", text="Up Axis") + col.label(text=_("Tracking Axes:")) + col.prop(ob, "track_axis", text=_("Axis")) + col.prop(ob, "up_axis", text=_("Up Axis")) from bl_ui.properties_animviz import ( @@ -312,8 +313,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel): layout.separator() row = layout.row() - row.operator("object.paths_calculate", text="Calculate Paths") - row.operator("object.paths_clear", text="Clear Paths") + row.operator("object.paths_calculate", text=_("Calculate Paths")) + row.operator("object.paths_clear", text=_("Clear Paths")) class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from panel when ready diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 05fac2026a0..7b48834eb79 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel +from blf import gettext as _ class ConstraintButtonsPanel(): @@ -43,7 +44,7 @@ class ConstraintButtonsPanel(): split = layout.split(percentage=0.2) - split.label(text="Space:") + split.label(text=_("Space:")) row = split.row() if target: @@ -60,21 +61,21 @@ class ConstraintButtonsPanel(): if con.target and subtargets: if con.target.type == 'ARMATURE': - layout.prop_search(con, "subtarget", con.target.data, "bones", text="Bone") + layout.prop_search(con, "subtarget", con.target.data, "bones", text=_("Bone")) if hasattr(con, "head_tail"): row = layout.row() - row.label(text="Head/Tail:") + row.label(text=_("Head/Tail:")) row.prop(con, "head_tail", text="") elif con.target.type in {'MESH', 'LATTICE'}: - layout.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group") + layout.prop_search(con, "subtarget", con.target, "vertex_groups", text=_("Vertex Group")) def ik_template(self, layout, con): # only used for iTaSC layout.prop(con, "pole_target") if con.pole_target and con.pole_target.type == 'ARMATURE': - layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") + layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text=_("Bone")) if con.pole_target: row = layout.row() @@ -96,19 +97,19 @@ class ConstraintButtonsPanel(): split = layout.split() col = split.column() - col.label(text="Location:") + col.label(text=_("Location:")) col.prop(con, "use_location_x", text="X") col.prop(con, "use_location_y", text="Y") col.prop(con, "use_location_z", text="Z") col = split.column() - col.label(text="Rotation:") + col.label(text=_("Rotation:")) col.prop(con, "use_rotation_x", text="X") col.prop(con, "use_rotation_y", text="Y") col.prop(con, "use_rotation_z", text="Z") col = split.column() - col.label(text="Scale:") + col.label(text=_("Scale:")) col.prop(con, "use_scale_x", text="X") col.prop(con, "use_scale_y", text="Y") col.prop(con, "use_scale_z", text="Z") @@ -121,11 +122,11 @@ class ConstraintButtonsPanel(): self.target_template(layout, con) row = layout.row() - row.label(text="To:") + row.label(text=_("To:")) row.prop(con, "track_axis", expand=True) row = layout.row() - row.prop(con, "up_axis", text="Up") + row.prop(con, "up_axis", text=_("Up")) row.prop(con, "use_target_z") self.space_template(layout, con) @@ -140,7 +141,7 @@ class ConstraintButtonsPanel(): layout.prop(con, "pole_target") if con.pole_target and con.pole_target.type == 'ARMATURE': - layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") + layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text=_("Bone")) if con.pole_target: row = layout.row() @@ -152,11 +153,11 @@ class ConstraintButtonsPanel(): col.prop(con, "iterations") col.prop(con, "chain_count") - col.label(text="Weight:") - col.prop(con, "weight", text="Position", slider=True) + col.label(text=_("Weight:")) + col.prop(con, "weight", text=_("Position"), slider=True) sub = col.column() sub.active = con.use_rotation - sub.prop(con, "orient_weight", text="Rotation", slider=True) + sub.prop(con, "orient_weight", text=_("Rotation"), slider=True) col = split.column() col.prop(con, "use_tail") @@ -170,16 +171,16 @@ class ConstraintButtonsPanel(): self.ik_template(layout, con) row = layout.row() - row.label(text="Axis Ref:") + row.label(text=_("Axis Ref:")) row.prop(con, "reference_axis", expand=True) split = layout.split(percentage=0.33) split.row().prop(con, "use_location") row = split.row() - row.prop(con, "weight", text="Weight", slider=True) + row.prop(con, "weight", text=_("Weight"), slider=True) row.active = con.use_location split = layout.split(percentage=0.33) row = split.row() - row.label(text="Lock:") + row.label(text=_("Lock:")) row = split.row() row.prop(con, "lock_location_x", text="X") row.prop(con, "lock_location_y", text="Y") @@ -189,11 +190,11 @@ class ConstraintButtonsPanel(): split = layout.split(percentage=0.33) split.row().prop(con, "use_rotation") row = split.row() - row.prop(con, "orient_weight", text="Weight", slider=True) + row.prop(con, "orient_weight", text=_("Weight"), slider=True) row.active = con.use_rotation split = layout.split(percentage=0.33) row = split.row() - row.label(text="Lock:") + row.label(text=_("Lock:")) row = split.row() row.prop(con, "lock_rotation_x", text="X") row.prop(con, "lock_rotation_y", text="Y") @@ -207,8 +208,8 @@ class ConstraintButtonsPanel(): layout.prop(con, "limit_mode") row = layout.row() - row.prop(con, "weight", text="Weight", slider=True) - row.prop(con, "distance", text="Distance", slider=True) + row.prop(con, "weight", text=_("Weight"), slider=True) + row.prop(con, "distance", text=_("Distance"), slider=True) def FOLLOW_PATH(self, context, layout, con): self.target_template(layout, con) @@ -222,16 +223,16 @@ class ConstraintButtonsPanel(): col = split.column() col.prop(con, "use_fixed_location") if con.use_fixed_location: - col.prop(con, "offset_factor", text="Offset") + col.prop(con, "offset_factor", text=_("Offset")) else: col.prop(con, "offset") row = layout.row() - row.label(text="Forward:") + row.label(text=_("Forward:")) row.prop(con, "forward_axis", expand=True) row = layout.row() - row.prop(con, "up_axis", text="Up") + row.prop(con, "up_axis", text=_("Up")) row.label() def LIMIT_ROTATION(self, context, layout, con): @@ -241,27 +242,27 @@ class ConstraintButtonsPanel(): col.prop(con, "use_limit_x") sub = col.column() sub.active = con.use_limit_x - sub.prop(con, "min_x", text="Min") - sub.prop(con, "max_x", text="Max") + sub.prop(con, "min_x", text=_("Min")) + sub.prop(con, "max_x", text=_("Max")) col = split.column(align=True) col.prop(con, "use_limit_y") sub = col.column() sub.active = con.use_limit_y - sub.prop(con, "min_y", text="Min") - sub.prop(con, "max_y", text="Max") + sub.prop(con, "min_y", text=_("Min")) + sub.prop(con, "max_y", text=_("Max")) col = split.column(align=True) col.prop(con, "use_limit_z") sub = col.column() sub.active = con.use_limit_z - sub.prop(con, "min_z", text="Min") - sub.prop(con, "max_z", text="Max") + sub.prop(con, "min_z", text=_("Min")) + sub.prop(con, "max_z", text=_("Max")) layout.prop(con, "use_transform_limit") row = layout.row() - row.label(text="Convert:") + row.label(text=_("Convert:")) row.prop(con, "owner_space", text="") def LIMIT_LOCATION(self, context, layout, con): @@ -302,7 +303,7 @@ class ConstraintButtonsPanel(): row.label() row = layout.row() - row.label(text="Convert:") + row.label(text=_("Convert:")) row.prop(con, "owner_space", text="") def LIMIT_SCALE(self, context, layout, con): @@ -343,7 +344,7 @@ class ConstraintButtonsPanel(): row.label() row = layout.row() - row.label(text="Convert:") + row.label(text=_("Convert:")) row.prop(con, "owner_space", text="") def COPY_ROTATION(self, context, layout, con): @@ -355,19 +356,19 @@ class ConstraintButtonsPanel(): col.prop(con, "use_x", text="X") sub = col.column() sub.active = con.use_x - sub.prop(con, "invert_x", text="Invert") + sub.prop(con, "invert_x", text=_("Invert")) col = split.column() col.prop(con, "use_y", text="Y") sub = col.column() sub.active = con.use_y - sub.prop(con, "invert_y", text="Invert") + sub.prop(con, "invert_y", text=_("Invert")) col = split.column() col.prop(con, "use_z", text="Z") sub = col.column() sub.active = con.use_z - sub.prop(con, "invert_z", text="Invert") + sub.prop(con, "invert_z", text=_("Invert")) layout.prop(con, "use_offset") @@ -382,19 +383,19 @@ class ConstraintButtonsPanel(): col.prop(con, "use_x", text="X") sub = col.column() sub.active = con.use_x - sub.prop(con, "invert_x", text="Invert") + sub.prop(con, "invert_x", text=_("Invert")) col = split.column() col.prop(con, "use_y", text="Y") sub = col.column() sub.active = con.use_y - sub.prop(con, "invert_y", text="Invert") + sub.prop(con, "invert_y", text=_("Invert")) col = split.column() col.prop(con, "use_z", text="Z") sub = col.column() sub.active = con.use_z - sub.prop(con, "invert_z", text="Invert") + sub.prop(con, "invert_z", text=_("Invert")) layout.prop(con, "use_offset") @@ -415,7 +416,7 @@ class ConstraintButtonsPanel(): def MAINTAIN_VOLUME(self, context, layout, con): row = layout.row() - row.label(text="Free:") + row.label(text=_("Free:")) row.prop(con, "free_axis", expand=True) layout.prop(con, "volume") @@ -439,28 +440,28 @@ class ConstraintButtonsPanel(): split = layout.split() col = split.column(align=True) - col.label(text="Action Length:") - col.prop(con, "frame_start", text="Start") - col.prop(con, "frame_end", text="End") + col.label(text=_("Action Length:")) + col.prop(con, "frame_start", text=_("Start")) + col.prop(con, "frame_end", text=_("End")) col = split.column(align=True) - col.label(text="Target Range:") - col.prop(con, "min", text="Min") - col.prop(con, "max", text="Max") + col.label(text=_("Target Range:")) + col.prop(con, "min", text=_("Min")) + col.prop(con, "max", text=_("Max")) row = layout.row() - row.label(text="Convert:") + row.label(text=_("Convert:")) row.prop(con, "target_space", text="") def LOCKED_TRACK(self, context, layout, con): self.target_template(layout, con) row = layout.row() - row.label(text="To:") + row.label(text=_("To:")) row.prop(con, "track_axis", expand=True) row = layout.row() - row.label(text="Lock:") + row.label(text=_("Lock:")) row.prop(con, "lock_axis", expand=True) def LIMIT_DISTANCE(self, context, layout, con): @@ -471,7 +472,7 @@ class ConstraintButtonsPanel(): col.operator("constraint.limitdistance_reset") row = layout.row() - row.label(text="Clamp Region:") + row.label(text=_("Clamp Region:")) row.prop(con, "limit_mode", text="") row = layout.row() @@ -482,16 +483,16 @@ class ConstraintButtonsPanel(): self.target_template(layout, con) row = layout.row() - row.prop(con, "rest_length", text="Rest Length") - row.operator("constraint.stretchto_reset", text="Reset") + row.prop(con, "rest_length", text=_("Rest Length")) + row.operator("constraint.stretchto_reset", text=_("Reset")) - layout.prop(con, "bulge", text="Volume Variation") + layout.prop(con, "bulge", text=_("Volume Variation")) row = layout.row() - row.label(text="Volume:") + row.label(text=_("Volume:")) row.prop(con, "volume", expand=True) - row.label(text="Plane:") + row.label(text=_("Plane:")) row.prop(con, "keep_axis", expand=True) def FLOOR(self, context, layout, con): @@ -504,7 +505,7 @@ class ConstraintButtonsPanel(): layout.prop(con, "offset") row = layout.row() - row.label(text="Min/Max:") + row.label(text=_("Min/Max:")) row.prop(con, "floor_location", expand=True) self.space_template(layout, con) @@ -516,113 +517,113 @@ class ConstraintButtonsPanel(): layout.prop(con, "child") row = layout.row() - row.prop(con, "use_linked_collision", text="Linked Collision") - row.prop(con, "show_pivot", text="Display Pivot") + row.prop(con, "use_linked_collision", text=_("Linked Collision")) + row.prop(con, "show_pivot", text=_("Display Pivot")) split = layout.split() col = split.column(align=True) - col.label(text="Pivot:") + col.label(text=_("Pivot:")) col.prop(con, "pivot_x", text="X") col.prop(con, "pivot_y", text="Y") col.prop(con, "pivot_z", text="Z") col = split.column(align=True) - col.label(text="Axis:") + col.label(text=_("Axis:")) col.prop(con, "axis_x", text="X") col.prop(con, "axis_y", text="Y") col.prop(con, "axis_z", text="Z") if con.pivot_type == 'CONE_TWIST': - layout.label(text="Limits:") + layout.label(text=_("Limits:")) split = layout.split() col = split.column() - col.prop(con, "use_angular_limit_x", text="Angle X") + col.prop(con, "use_angular_limit_x", text=_("Angle X")) sub = col.column() sub.active = con.use_angular_limit_x sub.prop(con, "limit_angle_max_x", text="") col = split.column() - col.prop(con, "use_angular_limit_y", text="Angle Y") + col.prop(con, "use_angular_limit_y", text=_("Angle Y")) sub = col.column() sub.active = con.use_angular_limit_y sub.prop(con, "limit_angle_max_y", text="") col = split.column() - col.prop(con, "use_angular_limit_z", text="Angle Z") + col.prop(con, "use_angular_limit_z", text=_("Angle Z")) sub = col.column() sub.active = con.use_angular_limit_z sub.prop(con, "limit_angle_max_z", text="") elif con.pivot_type == 'GENERIC_6_DOF': - layout.label(text="Limits:") + layout.label(text=_("Limits:")) split = layout.split() col = split.column(align=True) col.prop(con, "use_limit_x", text="X") sub = col.column() sub.active = con.use_limit_x - sub.prop(con, "limit_min_x", text="Min") - sub.prop(con, "limit_max_x", text="Max") + sub.prop(con, "limit_min_x", text=_("Min")) + sub.prop(con, "limit_max_x", text=_("Max")) col = split.column(align=True) col.prop(con, "use_limit_y", text="Y") sub = col.column() sub.active = con.use_limit_y - sub.prop(con, "limit_min_y", text="Min") - sub.prop(con, "limit_max_y", text="Max") + sub.prop(con, "limit_min_y", text=_("Min")) + sub.prop(con, "limit_max_y", text=_("Max")) col = split.column(align=True) col.prop(con, "use_limit_z", text="Z") sub = col.column() sub.active = con.use_limit_z - sub.prop(con, "limit_min_z", text="Min") - sub.prop(con, "limit_max_z", text="Max") + sub.prop(con, "limit_min_z", text=_("Min")) + sub.prop(con, "limit_max_z", text=_("Max")) split = layout.split() col = split.column(align=True) - col.prop(con, "use_angular_limit_x", text="Angle X") + col.prop(con, "use_angular_limit_x", text=_("Angle X")) sub = col.column() sub.active = con.use_angular_limit_x - sub.prop(con, "limit_angle_min_x", text="Min") - sub.prop(con, "limit_angle_max_x", text="Max") + sub.prop(con, "limit_angle_min_x", text=_("Min")) + sub.prop(con, "limit_angle_max_x", text=_("Max")) col = split.column(align=True) - col.prop(con, "use_angular_limit_y", text="Angle Y") + col.prop(con, "use_angular_limit_y", text=_("Angle Y")) sub = col.column() sub.active = con.use_angular_limit_y - sub.prop(con, "limit_angle_min_y", text="Min") - sub.prop(con, "limit_angle_max_y", text="Max") + sub.prop(con, "limit_angle_min_y", text=_("Min")) + sub.prop(con, "limit_angle_max_y", text=_("Max")) col = split.column(align=True) - col.prop(con, "use_angular_limit_z", text="Angle Z") + col.prop(con, "use_angular_limit_z", text=_("Angle Z")) sub = col.column() sub.active = con.use_angular_limit_z - sub.prop(con, "limit_angle_min_z", text="Min") - sub.prop(con, "limit_angle_max_z", text="Max") + sub.prop(con, "limit_angle_min_z", text=_("Min")) + sub.prop(con, "limit_angle_max_z", text=_("Max")) elif con.pivot_type == 'HINGE': - layout.label(text="Limits:") + layout.label(text=_("Limits:")) split = layout.split() row = split.row(align=True) col = row.column() - col.prop(con, "use_angular_limit_x", text="Angle X") + col.prop(con, "use_angular_limit_x", text=_("Angle X")) col = row.column() col.active = con.use_angular_limit_x - col.prop(con, "limit_angle_min_x", text="Min") + col.prop(con, "limit_angle_min_x", text=_("Min")) col = row.column() col.active = con.use_angular_limit_x - col.prop(con, "limit_angle_max_x", text="Max") + col.prop(con, "limit_angle_max_x", text=_("Max")) def CLAMP_TO(self, context, layout, con): self.target_template(layout, con) row = layout.row() - row.label(text="Main Axis:") + row.label(text=_("Main Axis:")) row.prop(con, "main_axis", expand=True) layout.prop(con, "use_cyclic") @@ -630,32 +631,32 @@ class ConstraintButtonsPanel(): def TRANSFORM(self, context, layout, con): self.target_template(layout, con) - layout.prop(con, "use_motion_extrapolate", text="Extrapolate") + layout.prop(con, "use_motion_extrapolate", text=_("Extrapolate")) col = layout.column() - col.row().label(text="Source:") + col.row().label(text=_("Source:")) col.row().prop(con, "map_from", expand=True) split = layout.split() sub = split.column(align=True) sub.label(text="X:") - sub.prop(con, "from_min_x", text="Min") - sub.prop(con, "from_max_x", text="Max") + sub.prop(con, "from_min_x", text=_("Min")) + sub.prop(con, "from_max_x", text=_("Max")) sub = split.column(align=True) sub.label(text="Y:") - sub.prop(con, "from_min_y", text="Min") - sub.prop(con, "from_max_y", text="Max") + sub.prop(con, "from_min_y", text=_("Min")) + sub.prop(con, "from_max_y", text=_("Max")) sub = split.column(align=True) sub.label(text="Z:") - sub.prop(con, "from_min_z", text="Min") - sub.prop(con, "from_max_z", text="Max") + sub.prop(con, "from_min_z", text=_("Min")) + sub.prop(con, "from_max_z", text=_("Max")) col = layout.column() row = col.row() - row.label(text="Source to Destination Mapping:") + row.label(text=_("Source to Destination Mapping:")) # note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't # open it. Thus we are using the hardcoded value instead. @@ -674,7 +675,7 @@ class ConstraintButtonsPanel(): split = layout.split() col = split.column() - col.label(text="Destination:") + col.label(text=_("Destination:")) col.row().prop(con, "map_to", expand=True) split = layout.split() @@ -683,22 +684,22 @@ class ConstraintButtonsPanel(): col.label(text="X:") sub = col.column(align=True) - sub.prop(con, "to_min_x", text="Min") - sub.prop(con, "to_max_x", text="Max") + sub.prop(con, "to_min_x", text=_("Min")) + sub.prop(con, "to_max_x", text=_("Max")) col = split.column() col.label(text="Y:") sub = col.column(align=True) - sub.prop(con, "to_min_y", text="Min") - sub.prop(con, "to_max_y", text="Max") + sub.prop(con, "to_min_y", text=_("Min")) + sub.prop(con, "to_max_y", text=_("Max")) col = split.column() col.label(text="Z:") sub = col.column(align=True) - sub.prop(con, "to_min_z", text="Min") - sub.prop(con, "to_max_z", text="Max") + sub.prop(con, "to_min_z", text=_("Min")) + sub.prop(con, "to_max_z", text=_("Max")) self.space_template(layout, con) @@ -718,20 +719,20 @@ class ConstraintButtonsPanel(): self.target_template(layout, con) row = layout.row() - row.label(text="To:") + row.label(text=_("To:")) row.prop(con, "track_axis", expand=True) def SPLINE_IK(self, context, layout, con): self.target_template(layout, con) col = layout.column() - col.label(text="Spline Fitting:") + col.label(text=_("Spline Fitting:")) col.prop(con, "chain_count") col.prop(con, "use_even_divisions") col.prop(con, "use_chain_offset") col = layout.column() - col.label(text="Chain Scaling:") + col.label(text=_("Chain Scaling:")) col.prop(con, "use_y_stretch") col.prop(con, "xz_scale_mode") col.prop(con, "use_curve_radius") @@ -741,20 +742,20 @@ class ConstraintButtonsPanel(): if con.target: col = layout.column() - col.prop(con, "offset", text="Pivot Offset") + col.prop(con, "offset", text=_("Pivot Offset")) else: col = layout.column() col.prop(con, "use_relative_location") if con.use_relative_location: - col.prop(con, "offset", text="Relative Pivot Point") + col.prop(con, "offset", text=_("Relative Pivot Point")) else: - col.prop(con, "offset", text="Absolute Pivot Point") + col.prop(con, "offset", text=_("Absolute Pivot Point")) col = layout.column() - col.prop(con, "rotation_range", text="Pivot When") + col.prop(con, "rotation_range", text=_("Pivot When")) def SCRIPT(self, context, layout, con): - layout.label("Blender 2.5 has no py-constraints") + layout.label(_("Blender 2.5 has no py-constraints")) class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel): @@ -773,7 +774,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel): if ob.mode == 'POSE': box = layout.box() box.alert = True - box.label(icon='INFO', text="See Bone Constraints tab to Add Constraints to active bone") + box.label(icon='INFO', text=_("See Bone Constraints tab to Add Constraints to active bone")) else: layout.operator_menu_enum("object.constraint_add", "type") diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 6f58f060504..6424f6dca44 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ from bl_ui.properties_physics_common import ( point_cache_ui, @@ -108,17 +109,17 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): layout.template_ID(context.space_data, "pin_id") if part.is_fluid: - layout.label(text="Settings used for fluid.") + layout.label(text=_("Settings used for fluid")) return - layout.prop(part, "type", text="Type") + layout.prop(part, "type", text=_("Type")) elif not psys.settings: split = layout.split(percentage=0.32) col = split.column() - col.label(text="Name:") - col.label(text="Settings:") + col.label(text=_("Name:")) + col.label(text=_("Settings:")) col = split.column() col.prop(psys, "name", text="") @@ -128,10 +129,10 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): split = layout.split(percentage=0.32) col = split.column() - col.label(text="Name:") + col.label(text=_("Name:")) if part.is_fluid == False: - col.label(text="Settings:") - col.label(text="Type:") + col.label(text=_("Settings:")) + col.label(text=_("Type:")) col = split.column() col.prop(psys, "name", text="") @@ -141,11 +142,11 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): row.template_ID(psys, "settings", new="particle.new") #row = layout.row() - #row.label(text="Viewport") - #row.label(text="Render") + #row.label(text=_("Viewport")) + #row.label(text=_("Render")) if part.is_fluid: - layout.label(text=str(part.count) + " fluid particles for this frame.") + layout.label(text=str(part.count) + " fluid particles for this frame") return row = col.row() @@ -157,7 +158,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): split = layout.split(percentage=0.65) if part.type == 'HAIR': if psys is not None and psys.is_edited: - split.operator("particle.edited_clear", text="Free Edit") + split.operator("particle.edited_clear", text=_("Free Edit")) else: row = split.row() row.enabled = particle_panel_enabled(context, psys) @@ -174,7 +175,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): elif psys is not None and part.type == 'REACTOR': split.enabled = particle_panel_enabled(context, psys) split.prop(psys, "reactor_target_object") - split.prop(psys, "reactor_target_particle_system", text="Particle System") + split.prop(psys, "reactor_target_particle_system", text=_("Particle System")) class PARTICLE_PT_emission(ParticleButtonsPanel, Panel): @@ -221,7 +222,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel): col.prop(part, "lifetime") col.prop(part, "lifetime_random", slider=True) - layout.label(text="Emit From:") + layout.label(text=_("Emit From:")) layout.prop(part, "emit_from", expand=True) row = layout.row() @@ -239,11 +240,11 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel): row = layout.row() if part.distribution == 'JIT': - row.prop(part, "userjit", text="Particles/Face") - row.prop(part, "jitter_factor", text="Jittering Amount", slider=True) + row.prop(part, "userjit", text=_("Particles/Face")) + row.prop(part, "jitter_factor", text=_("Jittering Amount"), slider=True) elif part.distribution == 'GRID': row.prop(part, "grid_resolution") - row.prop(part, "grid_random", text="Random", slider=True) + row.prop(part, "grid_random", text=_("Random"), slider=True) class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): @@ -284,22 +285,22 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Material:") + col.label(text=_("Material:")) sub = col.column(align=True) - sub.prop(cloth, "pin_stiffness", text="Stiffness") + sub.prop(cloth, "pin_stiffness", text=_("Stiffness")) sub.prop(cloth, "mass") - sub.prop(cloth, "bending_stiffness", text="Bending") + sub.prop(cloth, "bending_stiffness", text=_("Bending")) sub.prop(cloth, "internal_friction", slider=True) sub.prop(cloth, "collider_friction", slider=True) col = split.column() - col.label(text="Damping:") + col.label(text=_("Damping:")) sub = col.column(align=True) - sub.prop(cloth, "spring_damping", text="Spring") - sub.prop(cloth, "air_damping", text="Air") + sub.prop(cloth, "spring_damping", text=_("Spring")) + sub.prop(cloth, "air_damping", text=_("Air")) - col.label(text="Quality:") - col.prop(cloth, "quality", text="Steps", slider=True) + col.label(text=_("Quality:")) + col.prop(cloth, "quality", text=_("Steps"), slider=True) class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): @@ -355,17 +356,17 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Emitter Geometry:") + col.label(text=_("Emitter Geometry:")) col.prop(part, "normal_factor") sub = col.column(align=True) sub.prop(part, "tangent_factor") sub.prop(part, "tangent_phase", slider=True) col = split.column() - col.label(text="Emitter Object:") + col.label(text=_("Emitter Object:")) col.prop(part, "object_align_factor", text="") - layout.label(text="Other:") + layout.label(text=_("Other:")) row = layout.row() if part.emit_from == 'PARTICLE': row.prop(part, "particle_factor") @@ -406,21 +407,21 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel): layout.enabled = particle_panel_enabled(context, psys) row = layout.row() - row.label(text="Initial Rotation:") + row.label(text=_("Initial Rotation:")) row.prop(part, "use_dynamic_rotation") split = layout.split() col = split.column(align=True) col.prop(part, "rotation_mode", text="") - col.prop(part, "rotation_factor_random", slider=True, text="Random") + col.prop(part, "rotation_factor_random", slider=True, text=_("Random")) col = split.column(align=True) col.prop(part, "phase_factor", slider=True) - col.prop(part, "phase_factor_random", text="Random", slider=True) + col.prop(part, "phase_factor_random", text=_("Random"), slider=True) col = layout.column() - col.label(text="Angular Velocity:") + col.label(text=_("Angular Velocity:")) col.row().prop(part, "angular_velocity_mode", expand=True) if part.angular_velocity_mode != 'NONE': @@ -461,19 +462,19 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): if part.physics_type != 'NO': col = row.column(align=True) col.prop(part, "mass") - col.prop(part, "use_multiply_size_mass", text="Multiply mass with size") + col.prop(part, "use_multiply_size_mass", text=_("Multiply mass with size")) if part.physics_type in {'NEWTON', 'FLUID'}: split = layout.split() col = split.column() - col.label(text="Forces:") + col.label(text=_("Forces:")) col.prop(part, "brownian_factor") col.prop(part, "drag_factor", slider=True) col.prop(part, "damping", slider=True) col = split.column() - col.label(text="Integration:") + col.label(text=_("Integration:")) col.prop(part, "integrator", text="") col.prop(part, "timestep") col.prop(part, "subframes") @@ -488,13 +489,13 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Fluid properties:") - col.prop(fluid, "stiffness", text="Stiffness") - col.prop(fluid, "linear_viscosity", text="Viscosity") - col.prop(fluid, "buoyancy", text="Buoancy", slider=True) + col.label(text=_("Fluid properties:")) + col.prop(fluid, "stiffness", text=_("Stiffness")) + col.prop(fluid, "linear_viscosity", text=_("Viscosity")) + col.prop(fluid, "buoyancy", text=_("Buoancy"), slider=True) col = split.column() - col.label(text="Advanced:") + col.label(text=_("Advanced:")) sub = col.row() sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) @@ -515,8 +516,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Springs:") - col.prop(fluid, "spring_force", text="Force") + col.label(text=_("Springs:")) + col.prop(fluid, "spring_force", text=_("Force")) col.prop(fluid, "use_viscoelastic_springs") sub = col.column(align=True) sub.active = fluid.use_viscoelastic_springs @@ -524,7 +525,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): sub.prop(fluid, "plasticity", slider=True) col = split.column() - col.label(text="Advanced:") + col.label(text=_("Advanced:")) sub = col.row() sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length) sub.prop(fluid, "factor_rest_length", text="") @@ -532,7 +533,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): sub = col.column() sub.active = fluid.use_viscoelastic_springs sub.prop(fluid, "use_initial_rest_length") - sub.prop(fluid, "spring_frames", text="Frames") + sub.prop(fluid, "spring_frames", text=_("Frames")) elif part.physics_type == 'KEYED': split = layout.split() @@ -541,11 +542,11 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): row = layout.row() col = row.column() col.active = not psys.use_keyed_timing - col.prop(part, "keyed_loops", text="Loops") + col.prop(part, "keyed_loops", text=_("Loops")) if psys: - row.prop(psys, "use_keyed_timing", text="Use Timing") + row.prop(psys, "use_keyed_timing", text=_("Use Timing")) - layout.label(text="Keys:") + layout.label(text=_("Keys:")) elif part.physics_type == 'BOIDS': boids = part.boids @@ -581,7 +582,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): row = layout.row() col = row.column(align=True) - col.label(text="Battle:") + col.label(text=_("Battle:")) col.prop(boids, "health") col.prop(boids, "strength") col.prop(boids, "aggression") @@ -589,16 +590,16 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): col.prop(boids, "range") col = row.column() - col.label(text="Misc:") + col.label(text=_("Misc:")) col.prop(boids, "bank", slider=True) col.prop(boids, "pitch", slider=True) col.prop(boids, "height", slider=True) if psys and part.physics_type in {'KEYED', 'BOIDS', 'FLUID'}: if part.physics_type == 'BOIDS': - layout.label(text="Relations:") + layout.label(text=_("Relations:")) elif part.physics_type == 'FLUID': - layout.label(text="Fluid interaction:") + layout.label(text=_("Fluid interaction:")) row = layout.row() row.template_list(psys, "targets", psys, "active_particle_target_index") @@ -621,7 +622,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): #doesn't work yet #col.alert = key.valid col.prop(key, "object", text="") - col.prop(key, "system", text="System") + col.prop(key, "system", text=_("System")) col = row.column() col.active = psys.use_keyed_timing col.prop(key, "time") @@ -631,7 +632,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): #doesn't work yet #sub.alert = key.valid sub.prop(key, "object", text="") - sub.prop(key, "system", text="System") + sub.prop(key, "system", text=_("System")) layout.prop(key, "alliance", expand=True) elif part.physics_type == 'FLUID': @@ -639,7 +640,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): #doesn't work yet #sub.alert = key.valid sub.prop(key, "object", text="") - sub.prop(key, "system", text="System") + sub.prop(key, "system", text=_("System")) class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): @@ -678,7 +679,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): state = boids.active_boid_state - #layout.prop(state, "name", text="State name") + #layout.prop(state, "name", text=_("State name")) row = layout.row() row.prop(state, "ruleset_type") @@ -721,7 +722,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): row.prop(rule, "use_predict") row.prop(rule, "fear_factor") elif rule.type == 'FOLLOW_PATH': - row.label(text="Not yet functional.") + row.label(text=_("Not yet functional")) elif rule.type == 'AVOID_COLLISION': row.prop(rule, "use_avoid") row.prop(rule, "use_avoid_collision") @@ -800,14 +801,14 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False) sub.prop(part, "adaptive_pixel") col.prop(part, "use_hair_bspline") - col.prop(part, "render_step", text="Steps") + col.prop(part, "render_step", text=_("Steps")) col = split.column() - col.label(text="Timing:") + col.label(text=_("Timing:")) col.prop(part, "use_absolute_path_time") - col.prop(part, "path_start", text="Start", slider=not part.use_absolute_path_time) - col.prop(part, "path_end", text="End", slider=not part.use_absolute_path_time) - col.prop(part, "length_random", text="Random", slider=True) + col.prop(part, "path_start", text=_("Start"), slider=not part.use_absolute_path_time) + col.prop(part, "path_end", text=_("End"), slider=not part.use_absolute_path_time) + col.prop(part, "length_random", text=_("Random"), slider=True) row = layout.row() col = row.column() @@ -864,30 +865,30 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): elif part.render_type == 'BILLBOARD': ob = context.object - col.label(text="Align:") + col.label(text=_("Align:")) row = layout.row() row.prop(part, "billboard_align", expand=True) - row.prop(part, "lock_billboard", text="Lock") + row.prop(part, "lock_billboard", text=_("Lock")) row = layout.row() row.prop(part, "billboard_object") row = layout.row() col = row.column(align=True) - col.label(text="Tilt:") - col.prop(part, "billboard_tilt", text="Angle", slider=True) - col.prop(part, "billboard_tilt_random", text="Random", slider=True) + col.label(text=_("Tilt:")) + col.prop(part, "billboard_tilt", text=_("Angle"), slider=True) + col.prop(part, "billboard_tilt_random", text=_("Random"), slider=True) col = row.column() col.prop(part, "billboard_offset") row = layout.row() col = row.column() - col.prop(part, "billboard_size", text="Scale") + col.prop(part, "billboard_size", text=_("Scale")) if part.billboard_align == 'VEL': col = row.column(align=True) - col.label("Velocity Scale:") - col.prop(part, "billboard_velocity_head", text="Head") - col.prop(part, "billboard_velocity_tail", text="Tail") + col.label(_("Velocity Scale:")) + col.prop(part, "billboard_velocity_head", text=_("Head")) + col.prop(part, "billboard_velocity_tail", text=_("Tail")) if psys: col = layout.column() @@ -895,8 +896,8 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures") split = layout.split(percentage=0.33) - split.label(text="Split uv's:") - split.prop(part, "billboard_uv_split", text="Number of splits") + split.label(text=_("Split uv's:")) + split.prop(part, "billboard_uv_split", text=_("Number of splits")) if psys: col = layout.column() @@ -904,9 +905,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures") row = col.row() - row.label(text="Animate:") + row.label(text=_("Animate:")) row.prop(part, "billboard_animation", text="") - row.label(text="Offset:") + row.label(text=_("Offset:")) row.prop(part, "billboard_offset_split", text="") if part.render_type == 'HALO' or part.render_type == 'LINE' or part.render_type == 'BILLBOARD': @@ -914,10 +915,10 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): col = row.column() col.prop(part, "trail_count") if part.trail_count > 1: - col.prop(part, "use_absolute_path_time", text="Length in frames") + col.prop(part, "use_absolute_path_time", text=_("Length in frames")) col = row.column() - col.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time) - col.prop(part, "length_random", text="Random", slider=True) + col.prop(part, "path_end", text=_("Length"), slider=not part.use_absolute_path_time) + col.prop(part, "length_random", text=_("Random"), slider=True) else: col = row.column() col.label(text="") @@ -965,11 +966,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): if part.draw_percentage != 100 and psys is not None: if part.type == 'HAIR': if psys.use_hair_dynamics and psys.point_cache.is_baked == False: - layout.row().label(text="Display percentage makes dynamics inaccurate without baking!") + layout.row().label(text=_("Display percentage makes dynamics inaccurate without baking!")) else: phystype = part.physics_type if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked == False: - layout.row().label(text="Display percentage makes dynamics inaccurate without baking!") + layout.row().label(text=_("Display percentage makes dynamics inaccurate without baking!")) row = layout.row() col = row.column() @@ -980,11 +981,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): col.prop(part, "show_health") col = row.column(align=True) - col.label(text="Color:") + col.label(text=_("Color:")) col.prop(part, "draw_color", text="") sub = col.row() sub.active = part.draw_color in ('VELOCITY', 'ACCELERATION') - sub.prop(part, "color_maximum", text="Max") + sub.prop(part, "color_maximum", text=_("Max")) if (path): col.prop(part, "draw_step") @@ -1013,24 +1014,24 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel): row = layout.row() col = row.column(align=True) - col.prop(part, "child_nbr", text="Display") - col.prop(part, "rendered_child_count", text="Render") + col.prop(part, "child_nbr", text=_("Display")) + col.prop(part, "rendered_child_count", text=_("Render")) if part.child_type == 'INTERPOLATED': col = row.column() if psys: - col.prop(psys, "child_seed", text="Seed") + col.prop(psys, "child_seed", text=_("Seed")) col.prop(part, "virtual_parents", slider=True) col.prop(part, "create_long_hair_children") else: col = row.column(align=True) - col.prop(part, "child_size", text="Size") - col.prop(part, "child_size_random", text="Random") + col.prop(part, "child_size", text=_("Size")) + col.prop(part, "child_size_random", text=_("Random")) split = layout.split() col = split.column() - col.label(text="Effects:") + col.label(text=_("Effects:")) sub = col.column(align=True) sub.prop(part, "clump_factor", slider=True) @@ -1042,38 +1043,38 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel): if part.child_type == 'SIMPLE': sub = col.column(align=True) - sub.prop(part, "child_radius", text="Radius") - sub.prop(part, "child_roundness", text="Roundness", slider=True) + sub.prop(part, "child_radius", text=_("Radius")) + sub.prop(part, "child_roundness", text=_("Roundness"), slider=True) if psys: - sub.prop(psys, "child_seed", text="Seed") + sub.prop(psys, "child_seed", text=_("Seed")) elif part.virtual_parents > 0.0: sub = col.column(align=True) - sub.label(text="Parting not") - sub.label(text="available with") - sub.label(text="virtual parents.") + sub.label(text=_("Parting not")) + sub.label(text=_("available with")) + sub.label(text=_("virtual parents")) else: sub = col.column(align=True) - sub.prop(part, "child_parting_factor", text="Parting", slider=True) - sub.prop(part, "child_parting_min", text="Min") - sub.prop(part, "child_parting_max", text="Max") + sub.prop(part, "child_parting_factor", text=_("Parting"), slider=True) + sub.prop(part, "child_parting_min", text=_("Min")) + sub.prop(part, "child_parting_max", text=_("Max")) col = split.column() - col.label(text="Roughness:") + col.label(text=_("Roughness:")) sub = col.column(align=True) - sub.prop(part, "roughness_1", text="Uniform") - sub.prop(part, "roughness_1_size", text="Size") + sub.prop(part, "roughness_1", text=_("Uniform")) + sub.prop(part, "roughness_1_size", text=_("Size")) sub = col.column(align=True) sub.prop(part, "roughness_endpoint", "Endpoint") sub.prop(part, "roughness_end_shape") sub = col.column(align=True) - sub.prop(part, "roughness_2", text="Random") - sub.prop(part, "roughness_2_size", text="Size") + sub.prop(part, "roughness_2", text=_("Random")) + sub.prop(part, "roughness_2_size", text=_("Size")) sub.prop(part, "roughness_2_threshold", slider=True) - layout.row().label(text="Kink:") + layout.row().label(text=_("Kink:")) layout.row().prop(part, "kink", expand=True) split = layout.split() @@ -1082,7 +1083,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel): col = split.column() sub = col.column(align=True) sub.prop(part, "kink_amplitude") - sub.prop(part, "kink_amplitude_clump", text="Clump", slider=True) + sub.prop(part, "kink_amplitude_clump", text=_("Clump"), slider=True) col.prop(part, "kink_flat", slider=True) col = split.column() sub = col.column(align=True) @@ -1123,25 +1124,25 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel): row = layout.row() row.prop(part, "use_self_effect") - row.prop(part, "effector_amount", text="Amount") + row.prop(part, "effector_amount", text=_("Amount")) split = layout.split(percentage=0.2) - split.label(text="Type 1:") + split.label(text=_("Type 1:")) split.prop(part.force_field_1, "type", text="") basic_force_field_settings_ui(self, context, part.force_field_1) if part.force_field_1.type != 'NONE': - layout.label(text="Falloff:") + layout.label(text=_("Falloff:")) basic_force_field_falloff_ui(self, context, part.force_field_1) if part.force_field_1.type != 'NONE': layout.label(text="") split = layout.split(percentage=0.2) - split.label(text="Type 2:") + split.label(text=_("Type 2:")) split.prop(part.force_field_2, "type", text="") basic_force_field_settings_ui(self, context, part.force_field_2) if part.force_field_2.type != 'NONE': - layout.label(text="Falloff:") + layout.label(text=_("Falloff:")) basic_force_field_falloff_ui(self, context, part.force_field_2) @@ -1163,56 +1164,56 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel): psys = context.particle_system row = layout.row() - row.label(text="Vertex Group") - row.label(text="Negate") + row.label(text=_("Vertex Group")) + row.label(text=_("Negate")) row = layout.row() - row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density") + row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text=_("Density")) row.prop(psys, "invert_vertex_group_density", text="") # Commented out vertex groups don't work and are still waiting for better implementation # row = layout.row() - # row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity") + # row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text=_("Velocity")) # row.prop(psys, "invert_vertex_group_velocity", text="") row = layout.row() - row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length") + row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text=_("Length")) row.prop(psys, "invert_vertex_group_length", text="") row = layout.row() - row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump") + row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text=_("Clump")) row.prop(psys, "invert_vertex_group_clump", text="") row = layout.row() - row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink") + row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text=_("Kink")) row.prop(psys, "invert_vertex_group_kink", text="") row = layout.row() - row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1") + row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text=_("Roughness 1")) row.prop(psys, "invert_vertex_group_roughness_1", text="") row = layout.row() - row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2") + row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text=_("Roughness 2")) row.prop(psys, "invert_vertex_group_roughness_2", text="") row = layout.row() - row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End") + row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text=_("Roughness End")) row.prop(psys, "invert_vertex_group_roughness_end", text="") # row = layout.row() - # row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text="Size") + # row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text=_("Size")) # row.prop(psys, "invert_vertex_group_size", text="") # row = layout.row() - # row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent") + # row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text=_("Tangent")) # row.prop(psys, "invert_vertex_group_tangent", text="") # row = layout.row() - # row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation") + # row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text=_("Rotation")) # row.prop(psys, "invert_vertex_group_rotation", text="") # row = layout.row() - # row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text="Field") + # row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text=_("Field")) # row.prop(psys, "invert_vertex_group_field", text="") diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index d5427d8bae8..de74d1473c8 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel - +from blf import gettext as _ from bl_ui.properties_physics_common import ( point_cache_ui, @@ -71,50 +71,50 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col = split.column() - col.label(text="Presets:") + col.label(text=_("Presets:")) sub = col.row(align=True) sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label) sub.operator("cloth.preset_add", text="", icon="ZOOMIN") sub.operator("cloth.preset_add", text="", icon="ZOOMOUT").remove_active = True - col.label(text="Quality:") - col.prop(cloth, "quality", text="Steps", slider=True) + col.label(text=_("Quality:")) + col.prop(cloth, "quality", text=_("Steps"), slider=True) - col.label(text="Material:") + col.label(text=_("Material:")) col.prop(cloth, "mass") - col.prop(cloth, "structural_stiffness", text="Structural") - col.prop(cloth, "bending_stiffness", text="Bending") + col.prop(cloth, "structural_stiffness", text=_("Structural")) + col.prop(cloth, "bending_stiffness", text=_("Bending")) col = split.column() - col.label(text="Damping:") - col.prop(cloth, "spring_damping", text="Spring") - col.prop(cloth, "air_damping", text="Air") + col.label(text=_("Damping:")) + col.prop(cloth, "spring_damping", text=_("Spring")) + col.prop(cloth, "air_damping", text=_("Air")) - col.prop(cloth, "use_pin_cloth", text="Pinning") + col.prop(cloth, "use_pin_cloth", text=_("Pinning")) sub = col.column() sub.active = cloth.use_pin_cloth sub.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="") - sub.prop(cloth, "pin_stiffness", text="Stiffness") + sub.prop(cloth, "pin_stiffness", text=_("Stiffness")) - col.label(text="Pre roll:") - col.prop(cloth, "pre_roll", text="Frame") + col.label(text=_("Pre roll:")) + col.prop(cloth, "pre_roll", text=_("Frame")) # Disabled for now """ if cloth.vertex_group_mass: - layout.label(text="Goal:") + layout.label(text=_("Goal:")) col = layout.column_flow() - col.prop(cloth, "goal_default", text="Default") - col.prop(cloth, "goal_spring", text="Stiffness") - col.prop(cloth, "goal_friction", text="Friction") + col.prop(cloth, "goal_default", text=_("Default")) + col.prop(cloth, "goal_spring", text=_("Stiffness")) + col.prop(cloth, "goal_friction", text=_("Friction")) """ key = ob.data.shape_keys if key: - col.label(text="Rest Shape Key:") + col.label(text=_("Rest Shape Key:")) col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="") @@ -156,18 +156,18 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(cloth, "collision_quality", slider=True, text="Quality") - col.prop(cloth, "distance_min", slider=True, text="Distance") - col.prop(cloth, "repel_force", slider=True, text="Repel") - col.prop(cloth, "distance_repel", slider=True, text="Repel Distance") + col.prop(cloth, "collision_quality", slider=True, text=_("Quality")) + col.prop(cloth, "distance_min", slider=True, text=_("Distance")) + col.prop(cloth, "repel_force", slider=True, text=_("Repel")) + col.prop(cloth, "distance_repel", slider=True, text=_("Repel Distance")) col.prop(cloth, "friction") col = split.column() - col.prop(cloth, "use_self_collision", text="Self Collision") + col.prop(cloth, "use_self_collision", text=_("Self Collision")) sub = col.column() sub.active = cloth.use_self_collision - sub.prop(cloth, "self_collision_quality", slider=True, text="Quality") - sub.prop(cloth, "self_distance_min", slider=True, text="Distance") + sub.prop(cloth, "self_collision_quality", slider=True, text=_("Quality")) + sub.prop(cloth, "self_distance_min", slider=True, text=_("Distance")) layout.prop(cloth, "group") @@ -198,14 +198,14 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Structural Stiffness:") + col.label(text=_("Structural Stiffness:")) col.prop_search(cloth, "vertex_group_structural_stiffness", ob, "vertex_groups", text="") - col.prop(cloth, "structural_stiffness_max", text="Max") + col.prop(cloth, "structural_stiffness_max", text=_("Max")) col = split.column() - col.label(text="Bending Stiffness:") + col.label(text=_("Bending Stiffness:")) col.prop_search(cloth, "vertex_group_bending", ob, "vertex_groups", text="") - col.prop(cloth, "bending_stiffness_max", text="Max") + col.prop(cloth, "bending_stiffness_max", text=_("Max")) class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 204e25d9f01..7ca97c20422 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel +from blf import gettext as _ class PhysicButtonsPanel(): @@ -53,27 +54,27 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel): ob = context.object layout = self.layout - layout.label("Enable physics for:") + layout.label(_("Enable physics for:")) split = layout.split() col = split.column() if(context.object.field.type == 'NONE'): - col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE') + col.operator("object.forcefield_toggle", text=_("Force Field"), icon='FORCE_FORCE') else: - col.operator("object.forcefield_toggle", text="Force Field", icon='X') + col.operator("object.forcefield_toggle", text=_("Force Field"), icon='X') if(ob.type == 'MESH'): - physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) - physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) + physics_add(self, col, context.collision, _("Collision"), 'COLLISION', 'MOD_PHYSICS', False) + physics_add(self, col, context.cloth, _("Cloth"), 'CLOTH', 'MOD_CLOTH', True) col = split.column() if(ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE'): - physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True) + physics_add(self, col, context.soft_body, _("Soft Body"), 'SOFT_BODY', 'MOD_SOFT', True) if(ob.type == 'MESH'): - physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True) - physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True) + physics_add(self, col, context.fluid, _("Fluid"), 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True) + physics_add(self, col, context.smoke, _("Smoke"), 'SMOKE', 'MOD_SMOKE', True) #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc @@ -95,11 +96,11 @@ def point_cache_ui(self, context, cache, enabled, cachetype): if cache.use_external: split = layout.split(percentage=0.80) - split.prop(cache, "name", text="File Name") + split.prop(cache, "name", text=_("File Name")) split.prop(cache, "index", text="") row = layout.row() - row.label(text="File Path:") + row.label(text=_("File Path:")) row.prop(cache, "use_library_path", "Use Lib Path") layout.prop(cache, "filepath", text="") @@ -108,13 +109,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype): else: if cachetype == 'SMOKE': if not bpy.data.is_saved: - layout.label(text="Cache is disabled until the file is saved") + layout.label(text=_("Cache is disabled until the file is saved")) layout.enabled = False if cache.use_disk_cache: - layout.prop(cache, "name", text="File Name") + layout.prop(cache, "name", text=_("File Name")) else: - layout.prop(cache, "name", text="Cache Name") + layout.prop(cache, "name", text=_("Cache Name")) row = layout.row(align=True) @@ -142,7 +143,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): row = layout.row() row.enabled = enabled and bpy.data.is_saved row.active = cache.use_disk_cache - row.label(text="Compression:") + row.label(text=_("Compression:")) row.prop(cache, "compression", expand=True) layout.separator() @@ -152,22 +153,22 @@ def point_cache_ui(self, context, cache, enabled, cachetype): col = split.column() if cache.is_baked == True: - col.operator("ptcache.free_bake", text="Free Bake") + col.operator("ptcache.free_bake", text=_("Free Bake")) else: - col.operator("ptcache.bake", text="Bake").bake = True + col.operator("ptcache.bake", text=_("Bake")).bake = True sub = col.row() sub.enabled = (cache.frames_skipped or cache.is_outdated) and enabled - sub.operator("ptcache.bake", text="Calculate To Frame").bake = False + sub.operator("ptcache.bake", text=_("Calculate To Frame")).bake = False sub = col.column() sub.enabled = enabled - sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake") + sub.operator("ptcache.bake_from_cache", text=_("Current Cache to Bake")) col = split.column() - col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True - col.operator("ptcache.free_bake_all", text="Free All Bakes") - col.operator("ptcache.bake_all", text="Update All To Frame").bake = False + col.operator("ptcache.bake_all", text=_("Bake All Dynamics")).bake = True + col.operator("ptcache.free_bake_all", text=_("Free All Bakes")) + col.operator("ptcache.bake_all", text=_("Update All To Frame")).bake = False def effector_weights_ui(self, context, weights): @@ -215,7 +216,7 @@ def basic_force_field_settings_ui(self, context, field): col = split.column() if field.type == 'DRAG': - col.prop(field, "linear_drag", text="Linear") + col.prop(field, "linear_drag", text=_("Linear")) else: col.prop(field, "strength") @@ -223,12 +224,12 @@ def basic_force_field_settings_ui(self, context, field): col.prop(field, "size") col.prop(field, "flow") elif field.type == 'HARMONIC': - col.prop(field, "harmonic_damping", text="Damping") + col.prop(field, "harmonic_damping", text=_("Damping")) col.prop(field, "rest_length") elif field.type == 'VORTEX' and field.shape != 'POINT': col.prop(field, "inflow") elif field.type == 'DRAG': - col.prop(field, "quadratic_drag", text="Quadratic") + col.prop(field, "quadratic_drag", text=_("Quadratic")) else: col.prop(field, "flow") @@ -237,19 +238,19 @@ def basic_force_field_settings_ui(self, context, field): sub.prop(field, "noise") sub.prop(field, "seed") if field.type == 'TURBULENCE': - col.prop(field, "use_global_coords", text="Global") + col.prop(field, "use_global_coords", text=_("Global")) elif field.type == 'HARMONIC': col.prop(field, "use_multiple_springs") split = layout.split() col = split.column() - col.label(text="Effect point:") + col.label(text=_("Effect point:")) col.prop(field, "apply_to_location") col.prop(field, "apply_to_rotation") col = split.column() - col.label(text="Collision:") + col.label(text=_("Collision:")) col.prop(field, "use_absorption") @@ -265,7 +266,7 @@ def basic_force_field_falloff_ui(self, context, field): col.prop(field, "z_direction", text="") col = split.column() - col.prop(field, "falloff_power", text="Power") + col.prop(field, "falloff_power", text=_("Power")) split = layout.split() col = split.column() @@ -273,14 +274,14 @@ def basic_force_field_falloff_ui(self, context, field): row.prop(field, "use_min_distance", text="") sub = row.row() sub.active = field.use_min_distance - sub.prop(field, "distance_min", text="Minimum") + sub.prop(field, "distance_min", text=_("Minimum")) col = split.column() row = col.row(align=True) row.prop(field, "use_max_distance", text="") sub = row.row() sub.active = field.use_max_distance - sub.prop(field, "distance_max", text="Maximum") + sub.prop(field, "distance_max", text=_("Maximum")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index e1dc4d04378..937df5c0ad9 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel - +from blf import gettext as _ from bl_ui.properties_physics_common import ( basic_force_field_settings_ui, @@ -54,13 +54,13 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): field = ob.field split = layout.split(percentage=0.2) - split.label(text="Type:") + split.label(text=_("Type:")) split.prop(field, "type", text="") if field.type not in {'NONE', 'GUIDE', 'TEXTURE'}: split = layout.split(percentage=0.2) - split.label(text="Shape:") + split.label(text=_("Shape:")) split.prop(field, "shape", text="") split = layout.split() @@ -76,7 +76,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): col.prop(field, "use_guide_path_weight") col = split.column() - col.label(text="Clumping:") + col.label(text=_("Clumping:")) col.prop(field, "guide_clump_amount") col.prop(field, "guide_clump_shape") @@ -117,7 +117,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): if field.type not in {'NONE', 'GUIDE'}: - layout.label(text="Falloff:") + layout.label(text=_("Falloff:")) layout.prop(field, "falloff_type", expand=True) basic_force_field_falloff_ui(self, context, field) @@ -128,20 +128,20 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): split = layout.split(percentage=0.35) col = split.column() - col.label(text="Angular:") - col.prop(field, "use_radial_min", text="Use Minimum") - col.prop(field, "use_radial_max", text="Use Maximum") + col.label(text=_("Angular:")) + col.prop(field, "use_radial_min", text=_("Use Minimum")) + col.prop(field, "use_radial_max", text=_("Use Maximum")) col = split.column() - col.prop(field, "radial_falloff", text="Power") + col.prop(field, "radial_falloff", text=_("Power")) sub = col.column() sub.active = field.use_radial_min - sub.prop(field, "radial_min", text="Angle") + sub.prop(field, "radial_min", text=_("Angle")) sub = col.column() sub.active = field.use_radial_max - sub.prop(field, "radial_max", text="Angle") + sub.prop(field, "radial_max", text=_("Angle")) elif field.falloff_type == 'TUBE': layout.separator() @@ -149,20 +149,20 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): split = layout.split(percentage=0.35) col = split.column() - col.label(text="Radial:") - col.prop(field, "use_radial_min", text="Use Minimum") - col.prop(field, "use_radial_max", text="Use Maximum") + col.label(text=_("Radial:")) + col.prop(field, "use_radial_min", text=_("Use Minimum")) + col.prop(field, "use_radial_max", text=_("Use Maximum")) col = split.column() - col.prop(field, "radial_falloff", text="Power") + col.prop(field, "radial_falloff", text=_("Power")) sub = col.column() sub.active = field.use_radial_min - sub.prop(field, "radial_min", text="Distance") + sub.prop(field, "radial_min", text=_("Distance")) sub = col.column() sub.active = field.use_radial_max - sub.prop(field, "radial_max", text="Distance") + sub.prop(field, "radial_max", text=_("Distance")) class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): @@ -192,31 +192,31 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Particle:") + col.label(text=_("Particle:")) col.prop(settings, "permeability", slider=True) col.prop(settings, "stickness") col.prop(settings, "use_particle_kill") - col.label(text="Particle Damping:") + col.label(text=_("Particle Damping:")) sub = col.column(align=True) - sub.prop(settings, "damping_factor", text="Factor", slider=True) - sub.prop(settings, "damping_random", text="Random", slider=True) + sub.prop(settings, "damping_factor", text=_("Factor"), slider=True) + sub.prop(settings, "damping_random", text=_("Random"), slider=True) - col.label(text="Particle Friction:") + col.label(text=_("Particle Friction:")) sub = col.column(align=True) - sub.prop(settings, "friction_factor", text="Factor", slider=True) - sub.prop(settings, "friction_random", text="Random", slider=True) + sub.prop(settings, "friction_factor", text=_("Factor"), slider=True) + sub.prop(settings, "friction_random", text=_("Random"), slider=True) col = split.column() - col.label(text="Soft Body and Cloth:") + col.label(text=_("Soft Body and Cloth:")) sub = col.column(align=True) - sub.prop(settings, "thickness_outer", text="Outer", slider=True) - sub.prop(settings, "thickness_inner", text="Inner", slider=True) + sub.prop(settings, "thickness_outer", text=_("Outer"), slider=True) + sub.prop(settings, "thickness_inner", text=_("Inner"), slider=True) - col.label(text="Soft Body Damping:") - col.prop(settings, "damping", text="Factor", slider=True) + col.label(text=_("Soft Body Damping:")) + col.prop(settings, "damping", text=_("Factor"), slider=True) - col.label(text="Force Fields:") - col.prop(settings, "absorption", text="Absorption") + col.label(text=_("Force Fields:")) + col.prop(settings, "absorption", text=_("Absorption")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 55629e6c6b9..35c8466e685 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel +from blf import gettext as _ class PhysicButtonsPanel(): @@ -46,7 +47,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): row = layout.row() if fluid is None: - row.label("Built without fluids") + row.label(_("Built without fluids")) return row.prop(fluid, "type") @@ -58,28 +59,28 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): layout.active = fluid.use if fluid.type == 'DOMAIN': - layout.operator("fluid.bake", text="Bake (Req. Memory: %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM') + layout.operator("fluid.bake", text=_("Bake (Req. Memory:") + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM') split = layout.split() col = split.column() - col.label(text="Resolution:") - col.prop(fluid, "resolution", text="Final") - col.label(text="Render Display:") + col.label(text=_("Resolution:")) + col.prop(fluid, "resolution", text=_("Final")) + col.label(text=_("Render Display:")) col.prop(fluid, "render_display_mode", text="") col = split.column() col.label() - col.prop(fluid, "preview_resolution", text="Preview") - col.label(text="Viewport Display:") + col.prop(fluid, "preview_resolution", text=_("Preview")) + col.label(text=_("Viewport Display:")) col.prop(fluid, "viewport_display_mode", text="") split = layout.split() col = split.column() - col.label(text="Time:") + col.label(text=_("Time:")) sub = col.column(align=True) - sub.prop(fluid, "start_time", text="Start") - sub.prop(fluid, "end_time", text="End") + sub.prop(fluid, "start_time", text=_("Start")) + sub.prop(fluid, "end_time", text=_("End")) col = split.column() col.label() @@ -92,36 +93,36 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Volume Initialization:") + col.label(text=_("Volume Initialization:")) col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "use_animated_mesh") col = split.column() - col.label(text="Initial Velocity:") + col.label(text=_("Initial Velocity:")) col.prop(fluid, "initial_velocity", text="") elif fluid.type == 'OBSTACLE': split = layout.split() col = split.column() - col.label(text="Volume Initialization:") + col.label(text=_("Volume Initialization:")) col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "use_animated_mesh") col = split.column() - col.label(text="Slip Type:") + col.label(text=_("Slip Type:")) col.prop(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") + col.prop(fluid, "partial_slip_factor", slider=True, text=_("Amount")) - col.label(text="Impact:") - col.prop(fluid, "impact_factor", text="Factor") + col.label(text=_("Impact:")) + col.prop(fluid, "impact_factor", text=_("Factor")) elif fluid.type == 'INFLOW': split = layout.split() col = split.column() - col.label(text="Volume Initialization:") + col.label(text=_("Volume Initialization:")) col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "use_animated_mesh") row = col.row() @@ -129,14 +130,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): row.prop(fluid, "use_local_coords") col = split.column() - col.label(text="Inflow Velocity:") + col.label(text=_("Inflow Velocity:")) col.prop(fluid, "inflow_velocity", text="") elif fluid.type == 'OUTFLOW': split = layout.split() col = split.column() - col.label(text="Volume Initialization:") + col.label(text=_("Volume Initialization:")) col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "use_animated_mesh") @@ -146,12 +147,12 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Influence:") - col.prop(fluid, "particle_influence", text="Size") - col.prop(fluid, "alpha_influence", text="Alpha") + col.label(text=_("Influence:")) + col.prop(fluid, "particle_influence", text=_("Size")) + col.prop(fluid, "alpha_influence", text=_("Alpha")) col = split.column() - col.label(text="Type:") + col.label(text=_("Type:")) col.prop(fluid, "use_drops") col.prop(fluid, "use_floats") col.prop(fluid, "show_tracer") @@ -167,24 +168,24 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): col.prop(fluid, "use_reverse_frames") col = split.column() - col.label(text="Time:") + col.label(text=_("Time:")) sub = col.column(align=True) - sub.prop(fluid, "start_time", text="Start") - sub.prop(fluid, "end_time", text="End") + sub.prop(fluid, "start_time", text=_("Start")) + sub.prop(fluid, "end_time", text=_("End")) split = layout.split() col = split.column() - col.label(text="Attraction Force:") + col.label(text=_("Attraction Force:")) sub = col.column(align=True) - sub.prop(fluid, "attraction_strength", text="Strength") - sub.prop(fluid, "attraction_radius", text="Radius") + sub.prop(fluid, "attraction_strength", text=_("Strength")) + sub.prop(fluid, "attraction_radius", text=_("Radius")) col = split.column() - col.label(text="Velocity Force:") + col.label(text=_("Velocity Force:")) sub = col.column(align=True) - sub.prop(fluid, "velocity_strength", text="Strength") - sub.prop(fluid, "velocity_radius", text="Radius") + sub.prop(fluid, "velocity_strength", text=_("Strength")) + sub.prop(fluid, "velocity_radius", text=_("Radius")) class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): @@ -206,33 +207,33 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): col = split.column() if scene.use_gravity: - col.label(text="Using Scene Gravity", icon="SCENE_DATA") + col.label(text=_("Using Scene Gravity"), icon="SCENE_DATA") sub = col.column() sub.enabled = False sub.prop(fluid, "gravity", text="") else: - col.label(text="Gravity:") + col.label(text=_("Gravity:")) col.prop(fluid, "gravity", text="") if scene.unit_settings.system != 'NONE': - col.label(text="Using Scene Size Units", icon="SCENE_DATA") + col.label(text=_("Using Scene Size Units"), icon="SCENE_DATA") sub = col.column() sub.enabled = False - sub.prop(fluid, "simulation_scale", text="Metres") + sub.prop(fluid, "simulation_scale", text=_("Metres")) else: - col.label(text="Real World Size:") - col.prop(fluid, "simulation_scale", text="Metres") + col.label(text=_("Real World Size:")) + col.prop(fluid, "simulation_scale", text=_("Metres")) col = split.column() - col.label(text="Viscosity Presets:") + col.label(text=_("Viscosity Presets:")) sub = col.column(align=True) sub.prop(fluid, "viscosity_preset", text="") if fluid.viscosity_preset == 'MANUAL': - sub.prop(fluid, "viscosity_base", text="Base") - sub.prop(fluid, "viscosity_exponent", text="Exponent", slider=True) + sub.prop(fluid, "viscosity_base", text=_("Base")) + sub.prop(fluid, "viscosity_exponent", text=_("Exponent"), slider=True) - col.label(text="Optimization:") + col.label(text=_("Optimization:")) col.prop(fluid, "grid_levels", slider=True) col.prop(fluid, "compressibility", slider=True) @@ -254,16 +255,16 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Slip Type:") + col.label(text=_("Slip Type:")) col.prop(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") + col.prop(fluid, "partial_slip_factor", slider=True, text=_("Amount")) col.prop(fluid, "surface_noobs") col = split.column() - col.label(text="Surface:") - col.prop(fluid, "surface_smooth", text="Smoothing") - col.prop(fluid, "surface_subdivisions", text="Subdivisions") + col.label(text=_("Surface:")) + col.prop(fluid, "surface_smooth", text=_("Smoothing")) + col.prop(fluid, "surface_subdivisions", text=_("Subdivisions")) class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 771a778380d..61c477b6d49 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel - +from blf import gettext as _ from bl_ui.properties_physics_common import ( point_cache_ui, @@ -59,23 +59,23 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): split.enabled = not domain.point_cache.is_baked col = split.column() - col.label(text="Resolution:") - col.prop(domain, "resolution_max", text="Divisions") - col.label(text="Time:") - col.prop(domain, "time_scale", text="Scale") - col.label(text="Border Collisions:") + col.label(text=_("Resolution:")) + col.prop(domain, "resolution_max", text=_("Divisions")) + col.label(text=_("Time:")) + col.prop(domain, "time_scale", text=_("Scale")) + col.label(text=_("Border Collisions:")) col.prop(domain, "collision_extents", text="") col = split.column() - col.label(text="Behavior:") + col.label(text=_("Behavior:")) col.prop(domain, "alpha") - col.prop(domain, "beta", text="Temp. Diff.") + col.prop(domain, "beta", text=_("Temp. Diff.")) col.prop(domain, "vorticity") - col.prop(domain, "use_dissolve_smoke", text="Dissolve") + col.prop(domain, "use_dissolve_smoke", text=_("Dissolve")) sub = col.column() sub.active = domain.use_dissolve_smoke - sub.prop(domain, "dissolve_speed", text="Time") - sub.prop(domain, "use_dissolve_smoke_log", text="Slow") + sub.prop(domain, "dissolve_speed", text=_("Time")) + sub.prop(domain, "use_dissolve_smoke_log", text_("Slow")) elif md.smoke_type == 'FLOW': @@ -85,20 +85,20 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): col = split.column() col.prop(flow, "use_outflow") - col.label(text="Particle System:") + col.label(text=_("Particle System:")) col.prop_search(flow, "particle_system", ob, "particle_systems", text="") sub = col.column() sub.active = not md.flow_settings.use_outflow - sub.prop(flow, "initial_velocity", text="Initial Velocity") + sub.prop(flow, "initial_velocity", text=_("Initial Velocity")) sub = sub.column() sub.active = flow.initial_velocity - sub.prop(flow, "velocity_factor", text="Multiplier") + sub.prop(flow, "velocity_factor", text=_("Multiplier")) sub = split.column() sub.active = not md.flow_settings.use_outflow - sub.label(text="Initial Values:") + sub.label(text=_("Initial Values:")) sub.prop(flow, "use_absolute") sub.prop(flow, "density") sub.prop(flow, "temperature") @@ -121,14 +121,14 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Flow Group:") + col.label(text=_("Flow Group:")) col.prop(group, "fluid_group", text="") - #col.label(text="Effector Group:") + #col.label(text=_("Effector Group:")) #col.prop(group, "effector_group", text="") col = split.column() - col.label(text="Collision Group:") + col.label(text=_("Collision Group:")) col.prop(group, "collision_group", text="") @@ -157,12 +157,12 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): split.enabled = not md.point_cache.is_baked col = split.column() - col.label(text="Resolution:") - col.prop(md, "amplify", text="Divisions") + col.label(text=_("Resolution:")) + col.prop(md, "amplify", text=_("Divisions")) col.prop(md, "smooth_emitter") col = split.column() - col.label(text="Noise Method:") + col.label(text=_("Noise Method:")) col.row().prop(md, "noise_type", text="") col.prop(md, "strength") @@ -184,7 +184,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): md = context.smoke.domain_settings cache = md.point_cache - layout.label(text="Compression:") + layout.label(text=_("Compression:")) layout.prop(md, "point_cache_compress_type", expand=True) point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE') diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index 0b55ccf9516..5449e54c6e6 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel - +from blf import gettext as _ from bl_ui.properties_physics_common import ( point_cache_ui, @@ -62,13 +62,13 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel): split.enabled = softbody_panel_enabled(md) col = split.column() - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(softbody, "friction") col.prop(softbody, "mass") - col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text="Mass:") + col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text=_("Mass:")) col = split.column() - col.label(text="Simulation:") + col.label(text=_("Simulation:")) col.prop(softbody, "speed") @@ -114,18 +114,18 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Goal Strengths:") - col.prop(softbody, "goal_default", text="Default") + col.label(text=_("Goal Strengths:")) + col.prop(softbody, "goal_default", text=_("Default")) sub = col.column(align=True) - sub.prop(softbody, "goal_min", text="Minimum") - sub.prop(softbody, "goal_max", text="Maximum") + sub.prop(softbody, "goal_min", text=_("Minimum")) + sub.prop(softbody, "goal_max", text=_("Maximum")) col = split.column() - col.label(text="Goal Settings:") - col.prop(softbody, "goal_spring", text="Stiffness") - col.prop(softbody, "goal_friction", text="Damping") + col.label(text=_("Goal Settings:")) + col.prop(softbody, "goal_spring", text=_("Stiffness")) + col.prop(softbody, "goal_friction", text=_("Damping")) - layout.prop_search(softbody, "vertex_group_goal", ob, "vertex_groups", text="Vertex Group") + layout.prop_search(softbody, "vertex_group_goal", ob, "vertex_groups", text=_("Vertex Group")) class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): @@ -154,14 +154,14 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Springs:") + col.label(text=_("Springs:")) col.prop(softbody, "pull") col.prop(softbody, "push") col.prop(softbody, "damping") col.prop(softbody, "plastic") col.prop(softbody, "bend") - col.prop(softbody, "spring_length", text="Length") - col.prop_search(softbody, "vertex_group_spring", ob, "vertex_groups", text="Springs:") + col.prop(softbody, "spring_length", text=_("Length")) + col.prop_search(softbody, "vertex_group_spring", ob, "vertex_groups", text=_("Springs:")) col = split.column() col.prop(softbody, "use_stiff_quads") @@ -169,16 +169,16 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): sub.active = softbody.use_stiff_quads sub.prop(softbody, "shear") - col.label(text="Aerodynamics:") + col.label(text=_("Aerodynamics:")) col.row().prop(softbody, "aerodynamics_type", expand=True) - col.prop(softbody, "aero", text="Factor") + col.prop(softbody, "aero", text=_("Factor")) #sub = col.column() #sub.enabled = softbody.aero > 0 - col.label(text="Collision:") - col.prop(softbody, "use_edge_collision", text="Edge") - col.prop(softbody, "use_face_collision", text="Face") + col.label(text=_("Collision:")) + col.prop(softbody, "use_edge_collision", text=_("Edge")) + col.prop(softbody, "use_face_collision", text=_("Face")) class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel): @@ -203,14 +203,14 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel): layout.active = softbody.use_self_collision and softbody_panel_enabled(md) - layout.label(text="Collision Ball Size Calculation:") + layout.label(text=_("Collision Ball Size Calculation:")) layout.prop(softbody, "collision_type", expand=True) col = layout.column(align=True) - col.label(text="Ball:") - col.prop(softbody, "ball_size", text="Size") - col.prop(softbody, "ball_stiff", text="Stiffness") - col.prop(softbody, "ball_damp", text="Dampening") + col.label(text=_("Ball:")) + col.prop(softbody, "ball_size", text=_("Size")) + col.prop(softbody, "ball_stiff", text=_("Stiffness")) + col.prop(softbody, "ball_damp", text=_("Dampening")) class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel): @@ -233,18 +233,18 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel): split = layout.split() col = split.column(align=True) - col.label(text="Step Size:") + col.label(text=_("Step Size:")) col.prop(softbody, "step_min") col.prop(softbody, "step_max") - col.prop(softbody, "use_auto_step", text="Auto-Step") + col.prop(softbody, "use_auto_step", text=_("Auto-Step")) col = split.column() col.prop(softbody, "error_threshold") - col.label(text="Helpers:") + col.label(text=_("Helpers:")) col.prop(softbody, "choke") col.prop(softbody, "fuzzy") - layout.label(text="Diagnostics:") + layout.label(text=_("Diagnostics:")) layout.prop(softbody, "use_diagnose") layout.prop(softbody, "use_estimate_matrix") diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index b2b30e87090..f6586d105a5 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel +from blf import gettext as _ class RENDER_MT_presets(Menu): @@ -64,10 +65,10 @@ class RENDER_PT_render(RenderButtonsPanel, Panel): rd = context.scene.render row = layout.row() - row.operator("render.render", text="Image", icon='RENDER_STILL') - row.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True + row.operator("render.render", text=_("Image"), icon='RENDER_STILL') + row.operator("render.render", text=_("Animation"), icon='RENDER_ANIMATION').animation = True - layout.prop(rd, "display_mode", text="Display") + layout.prop(rd, "display_mode", text=_("Display")) class RENDER_PT_layers(RenderButtonsPanel, Panel): @@ -97,25 +98,25 @@ class RENDER_PT_layers(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(scene, "layers", text="Scene") + col.prop(scene, "layers", text=_("Scene")) col.label(text="") - col.prop(rl, "light_override", text="Light") - col.prop(rl, "material_override", text="Material") + col.prop(rl, "light_override", text=_("Light")) + col.prop(rl, "material_override", text=_("Material")) col = split.column() - col.prop(rl, "layers", text="Layer") - col.label(text="Mask Layers:") + col.prop(rl, "layers", text=_("Layer")) + col.label(text=_("Mask Layers:")) col.prop(rl, "layers_zmask", text="") layout.separator() - layout.label(text="Include:") + layout.label(text=_("Include:")) split = layout.split() col = split.column() col.prop(rl, "use_zmask") row = col.row() - row.prop(rl, "invert_zmask", text="Negate") + row.prop(rl, "invert_zmask", text=_("Negate")) row.active = rl.use_zmask col.prop(rl, "use_all_z") @@ -135,7 +136,7 @@ class RENDER_PT_layers(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Passes:") + col.label(text=_("Passes:")) col.prop(rl, "use_pass_combined") col.prop(rl, "use_pass_z") col.prop(rl, "use_pass_vector") @@ -623,29 +624,29 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): col = split.column() sub = col.column(align=True) - sub.label(text="Resolution:") + sub.label(text=_("Resolution:")) sub.prop(rd, "resolution_x", text="X") sub.prop(rd, "resolution_y", text="Y") sub.prop(rd, "resolution_percentage", text="") - sub.label(text="Aspect Ratio:") + sub.label(text=_("Aspect Ratio:")) sub.prop(rd, "pixel_aspect_x", text="X") sub.prop(rd, "pixel_aspect_y", text="Y") row = col.row() - row.prop(rd, "use_border", text="Border") + row.prop(rd, "use_border", text=_("Border")) sub = row.row() sub.active = rd.use_border - sub.prop(rd, "use_crop_to_border", text="Crop") + sub.prop(rd, "use_crop_to_border", text=_("Crop")) col = split.column() sub = col.column(align=True) - sub.label(text="Frame Range:") - sub.prop(scene, "frame_start", text="Start") - sub.prop(scene, "frame_end", text="End") - sub.prop(scene, "frame_step", text="Step") + sub.label(text=_("Frame Range:")) + sub.prop(scene, "frame_start") + sub.prop(scene, "frame_end") + sub.prop(scene, "frame_step") - sub.label(text="Frame Rate:") + sub.label(text=_("Frame Rate:")) if rd.fps_base == 1: fps_rate = round(rd.fps / rd.fps_base) else: @@ -655,7 +656,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60}) if custom_framerate == True: - fps_label_text = "Custom (" + str(fps_rate) + " fps)" + fps_label_text = _("Custom (") + str(fps_rate) + " fps)" else: fps_label_text = str(fps_rate) + " fps" @@ -665,10 +666,10 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): sub.prop(rd, "fps") sub.prop(rd, "fps_base", text="/") subrow = sub.row(align=True) - subrow.label(text="Time Remapping:") + subrow.label(text=_("Time Remapping:")) subrow = sub.row(align=True) - subrow.prop(rd, "frame_map_old", text="Old") - subrow.prop(rd, "frame_map_new", text="New") + subrow.prop(rd, "frame_map_old", text=_("Old")) + subrow.prop(rd, "frame_map_new", text=_("New")) class RENDER_PT_antialiasing(RenderButtonsPanel, Panel): @@ -696,7 +697,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, Panel): col = split.column() col.prop(rd, "pixel_filter_type", text="") - col.prop(rd, "filter_size", text="Size") + col.prop(rd, "filter_size", text=_("Size")) class RENDER_PT_motion_blur(RenderButtonsPanel, Panel): @@ -738,15 +739,15 @@ class RENDER_PT_shading(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(rd, "use_textures", text="Textures") - col.prop(rd, "use_shadows", text="Shadows") - col.prop(rd, "use_sss", text="Subsurface Scattering") - col.prop(rd, "use_envmaps", text="Environment Map") + col.prop(rd, "use_textures", text=_("Textures")) + col.prop(rd, "use_shadows", text=_("Shadows")) + col.prop(rd, "use_sss", text=_("Subsurface Scattering")) + col.prop(rd, "use_envmaps", text=_("Environment Map")) col = split.column() - col.prop(rd, "use_raytrace", text="Ray Tracing") + col.prop(rd, "use_raytrace", text=_("Ray Tracing")) col.prop(rd, "use_color_management") - col.prop(rd, "alpha_mode", text="Alpha") + col.prop(rd, "alpha_mode", text=_("Alpha")) class RENDER_PT_performance(RenderButtonsPanel, Panel): @@ -762,18 +763,18 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Threads:") + col.label(text=_("Threads:")) col.row().prop(rd, "threads_mode", expand=True) sub = col.column() sub.enabled = rd.threads_mode == 'FIXED' sub.prop(rd, "threads") sub = col.column(align=True) - sub.label(text="Tiles:") + sub.label(text=_("Tiles:")) sub.prop(rd, "parts_x", text="X") sub.prop(rd, "parts_y", text="Y") col = split.column() - col.label(text="Memory:") + col.label(text=_("Memory:")) sub = col.column() sub.enabled = not (rd.use_border or rd.use_full_sample) sub.prop(rd, "use_save_buffers") @@ -783,13 +784,13 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel): sub.prop(rd, "use_free_unused_nodes") sub = col.column() sub.active = rd.use_raytrace - sub.label(text="Acceleration structure:") + sub.label(text=_("Acceleration structure:")) sub.prop(rd, "raytrace_method", text="") if rd.raytrace_method == 'OCTREE': - sub.prop(rd, "octree_resolution", text="Resolution") + sub.prop(rd, "octree_resolution", text=_("Resolution")) else: - sub.prop(rd, "use_instances", text="Instances") - sub.prop(rd, "use_local_coords", text="Local Coordinates") + sub.prop(rd, "use_instances", text=_("Instances")) + sub.prop(rd, "use_local_coords", text=_("Local Coordinates")) class RENDER_PT_post_processing(RenderButtonsPanel, Panel): @@ -808,24 +809,24 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel): col.prop(rd, "use_compositing") col.prop(rd, "use_sequencer") - split.prop(rd, "dither_intensity", text="Dither", slider=True) + split.prop(rd, "dither_intensity", text=_("Dither"), slider=True) layout.separator() split = layout.split() col = split.column() - col.prop(rd, "use_fields", text="Fields") + col.prop(rd, "use_fields", text=_("Fields")) sub = col.column() sub.active = rd.use_fields sub.row().prop(rd, "field_order", expand=True) - sub.prop(rd, "use_fields_still", text="Still") + sub.prop(rd, "use_fields_still", text=_("Still")) col = split.column() col.prop(rd, "use_edge_enhance") sub = col.column() sub.active = rd.use_edge_enhance - sub.prop(rd, "edge_threshold", text="Threshold", slider=True) + sub.prop(rd, "edge_threshold", text=_("Threshold"), slider=True) sub.prop(rd, "edge_color", text="") layout.separator() @@ -854,26 +855,26 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(rd, "use_stamp_time", text="Time") - col.prop(rd, "use_stamp_date", text="Date") - col.prop(rd, "use_stamp_render_time", text="RenderTime") - col.prop(rd, "use_stamp_frame", text="Frame") - col.prop(rd, "use_stamp_scene", text="Scene") - col.prop(rd, "use_stamp_camera", text="Camera") - col.prop(rd, "use_stamp_lens", text="Lens") - col.prop(rd, "use_stamp_filename", text="Filename") - col.prop(rd, "use_stamp_marker", text="Marker") - col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip") + col.prop(rd, "use_stamp_time", text=_("Time")) + col.prop(rd, "use_stamp_date", text=_("Date")) + col.prop(rd, "use_stamp_render_time", text=_("RenderTime")) + col.prop(rd, "use_stamp_frame", text=_("Frame")) + col.prop(rd, "use_stamp_scene", text=_("Scene")) + col.prop(rd, "use_stamp_camera", text=_("Camera")) + col.prop(rd, "use_stamp_lens", text=_("Lens")) + col.prop(rd, "use_stamp_filename", text=_("Filename")) + col.prop(rd, "use_stamp_marker", text=_("Marker")) + col.prop(rd, "use_stamp_sequencer_strip", text=_("Seq. Strip")) col = split.column() col.active = rd.use_stamp col.prop(rd, "stamp_foreground", slider=True) col.prop(rd, "stamp_background", slider=True) col.separator() - col.prop(rd, "stamp_font_size", text="Font Size") + col.prop(rd, "stamp_font_size", text=_("Font Size")) row = layout.split(percentage=0.2) - row.prop(rd, "use_stamp_note", text="Note") + row.prop(rd, "use_stamp_note", text=_("Note")) sub = row.row() sub.active = rd.use_stamp_note sub.prop(rd, "stamp_note_text", text="") @@ -895,7 +896,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): col = split.column() col.prop(rd, "file_format", text="") - col.row().prop(rd, "color_mode", text="Color", expand=True) + col.row().prop(rd, "color_mode", text=_("Color"), expand=True) col = split.column() col.prop(rd, "use_file_extension") @@ -906,11 +907,11 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): layout.prop(rd, "file_quality", slider=True) if file_format == 'PNG': - layout.prop(rd, "file_quality", slider=True, text="Compression") + layout.prop(rd, "file_quality", slider=True, text=_("Compression")) if file_format in {'OPEN_EXR', 'MULTILAYER'}: row = layout.row() - row.prop(rd, "exr_codec", text="Codec") + row.prop(rd, "exr_codec", text=_("Codec")) if file_format == 'OPEN_EXR': row = layout.row() @@ -921,7 +922,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): elif file_format == 'JPEG2000': split = layout.split() col = split.column() - col.label(text="Depth:") + col.label(text=_("Depth:")) col.row().prop(rd, "jpeg2k_depth", expand=True) col = split.column() @@ -934,13 +935,13 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): split.label("FIXME: hard coded Non-Linear, Gamma:1.0") ''' col = split.column() - col.prop(rd, "use_cineon_log", text="Convert to Log") + col.prop(rd, "use_cineon_log", text=_("Convert to Log")) col = split.column(align=True) col.active = rd.use_cineon_log - col.prop(rd, "cineon_black", text="Black") - col.prop(rd, "cineon_white", text="White") - col.prop(rd, "cineon_gamma", text="Gamma") + col.prop(rd, "cineon_black", text=_("Black")) + col.prop(rd, "cineon_white", text=_("White")) + col.prop(rd, "cineon_gamma", text=_("Gamma")) ''' elif file_format == 'TIFF': @@ -952,11 +953,11 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): elif file_format == 'QUICKTIME_QTKIT': split = layout.split() col = split.column() - col.prop(rd, "quicktime_codec_type", text="Video Codec") - col.prop(rd, "quicktime_codec_spatial_quality", text="Quality") + col.prop(rd, "quicktime_codec_type", text=_("Video Codec")) + col.prop(rd, "quicktime_codec_spatial_quality", text=_("Quality")) # Audio - col.prop(rd, "quicktime_audiocodec_type", text="Audio Codec") + col.prop(rd, "quicktime_audiocodec_type", text=_("Audio Codec")) if rd.quicktime_audiocodec_type != 'No audio': split = layout.split() if rd.quicktime_audiocodec_type == 'LPCM': @@ -994,7 +995,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): rd = context.scene.render - layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") + layout.menu("RENDER_MT_ffmpeg_presets", text=_("Presets")) split = layout.split() split.prop(rd, "ffmpeg_format") @@ -1010,22 +1011,22 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Rate:") - col.prop(rd, "ffmpeg_minrate", text="Minimum") - col.prop(rd, "ffmpeg_maxrate", text="Maximum") - col.prop(rd, "ffmpeg_buffersize", text="Buffer") + col.label(text=_("Rate:")) + col.prop(rd, "ffmpeg_minrate", text=_("Minimum")) + col.prop(rd, "ffmpeg_maxrate", text=_("Maximum")) + col.prop(rd, "ffmpeg_buffersize", text=_("Buffer")) col = split.column() col.prop(rd, "ffmpeg_autosplit") - col.label(text="Mux:") - col.prop(rd, "ffmpeg_muxrate", text="Rate") - col.prop(rd, "ffmpeg_packetsize", text="Packet Size") + col.label(text=_("Mux:")) + col.prop(rd, "ffmpeg_muxrate", text=_("Rate")) + col.prop(rd, "ffmpeg_packetsize", text=_("Packet Size")) layout.separator() # Audio: if rd.ffmpeg_format not in {'MP3'}: - layout.prop(rd, "ffmpeg_audio_codec", text="Audio Codec") + layout.prop(rd, "ffmpeg_audio_codec", text=_("Audio Codec")) row = layout.row() row.prop(rd, "ffmpeg_audio_bitrate") @@ -1067,7 +1068,7 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel): col = split.column() col.prop(rd, "use_bake_clear") col.prop(rd, "bake_margin") - col.prop(rd, "bake_quad_split", text="Split") + col.prop(rd, "bake_quad_split", text=_("Split")) col = split.column() col.prop(rd, "use_bake_selected_to_active") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 66f967bb6e1..7efb9cb6dc3 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Operator, Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class SceneButtonsPanel(): @@ -41,7 +42,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): scene = context.scene layout.prop(scene, "camera") - layout.prop(scene, "background_set", text="Background") + layout.prop(scene, "background_set", text=_("Background")) class SCENE_PT_audio(SceneButtonsPanel, Panel): @@ -59,15 +60,15 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): split = layout.split() col = split.column() - col.label("Listener:") + col.label(_("Listener:")) col.prop(scene, "audio_distance_model", text="") - col.prop(scene, "audio_doppler_speed", text="Speed") - col.prop(scene, "audio_doppler_factor", text="Doppler") + col.prop(scene, "audio_doppler_speed", text=_("Speed")) + col.prop(scene, "audio_doppler_factor", text=_("Doppler")) col = split.column() - col.label("Format:") + col.label(_("Format:")) col.prop(rd, "ffmpeg_audio_channels", text="") - col.prop(rd, "ffmpeg_audio_mixrate", text="Rate") + col.prop(rd, "ffmpeg_audio_mixrate", text=_("Rate")) layout.operator("sound.mixdown") @@ -86,7 +87,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): row = layout.row() row.active = (unit.system != 'NONE') - row.prop(unit, "scale_length", text="Scale") + row.prop(unit, "scale_length", text=_("Scale")) row.prop(unit, "use_separate") @@ -115,11 +116,11 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel): subcol = col.column() subcol.operator_context = 'INVOKE_DEFAULT' - op = subcol.operator("anim.keying_set_export", text="Export to File") + op = subcol.operator("anim.keying_set_export", text=_("Export to File")) op.filepath = "keyingset.py" col = row.column() - col.label(text="Keyframing Settings:") + col.label(text=_("Keyframing Settings:")) col.prop(ks, "bl_options") @@ -138,7 +139,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel): ks = scene.keying_sets.active row = layout.row() - row.label(text="Paths:") + row.label(text=_("Paths:")) row = layout.row() @@ -152,20 +153,20 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel): ksp = ks.paths.active if ksp: col = layout.column() - col.label(text="Target:") + col.label(text=_("Target:")) col.template_any_ID(ksp, "id", "id_type") col.template_path_builder(ksp, "data_path", ksp.id) row = layout.row() col = row.column() - col.label(text="Array Target:") + col.label(text=_("Array Target:")) col.prop(ksp, "use_entire_array") if ksp.use_entire_array is False: col.prop(ksp, "array_index") col = row.column() - col.label(text="F-Curve Grouping:") + col.label(text=_("F-Curve Grouping:")) col.prop(ksp, "group_method") if ksp.group_method == 'NAMED': col.prop(ksp, "group") @@ -209,14 +210,14 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(rd, "simplify_subdivision", text="Subdivision") - col.prop(rd, "simplify_child_particles", text="Child Particles") + col.prop(rd, "simplify_subdivision", text=_("Subdivision")) + col.prop(rd, "simplify_child_particles", text=_("Child Particles")) col.prop(rd, "use_simplify_triangulate") col = split.column() - col.prop(rd, "simplify_shadow_samples", text="Shadow Samples") - col.prop(rd, "simplify_ao_sss", text="AO and SSS") + col.prop(rd, "simplify_shadow_samples", text=_("Shadow Samples")) + col.prop(rd, "simplify_ao_sss", text=_("AO and SSS")) class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): @@ -228,22 +229,22 @@ class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): class ANIM_OT_keying_set_export(Operator): - "Export Keying Set to a python script." + "Export Keying Set to a python script" bl_idname = "anim.keying_set_export" bl_label = "Export Keying Set..." - filepath = bpy.props.StringProperty(name="File Path", description="Filepath to write file to.") + filepath = bpy.props.StringProperty(name="File Path", description="Filepath to write file to") filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) filter_text = bpy.props.BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'}) filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) def execute(self, context): if not self.filepath: - raise Exception("Filepath not set.") + raise Exception("Filepath not set") f = open(self.filepath, "w") if not f: - raise Exception("Could not open file.") + raise Exception("Could not open file") scene = context.scene ks = scene.keying_sets.active diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 34f5a948ee7..c5f8708040f 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Menu, Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class TEXTURE_MT_specials(Menu): @@ -143,11 +144,11 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): if tex.use_nodes: if slot: - split.label(text="Output:") + split.label(text=_("Output:")) split.prop(slot, "output_node", text="") else: - split.label(text="Type:") + split.label(text=_("Type:")) split.prop(tex, "type", text="") @@ -178,21 +179,21 @@ class TEXTURE_PT_colors(TextureButtonsPanel, Panel): tex = context.texture - layout.prop(tex, "use_color_ramp", text="Ramp") + layout.prop(tex, "use_color_ramp", text=_("Ramp")) if tex.use_color_ramp: layout.template_color_ramp(tex, "color_ramp", expand=True) split = layout.split() col = split.column() - col.label(text="RGB Multiply:") + col.label(text=_("RGB Multiply:")) sub = col.column(align=True) sub.prop(tex, "factor_red", text="R") sub.prop(tex, "factor_green", text="G") sub.prop(tex, "factor_blue", text="B") col = split.column() - col.label(text="Adjust:") + col.label(text=_("Adjust:")) col.prop(tex, "intensity") col.prop(tex, "contrast") col.prop(tex, "saturation") @@ -235,17 +236,17 @@ class TEXTURE_PT_clouds(TextureTypePanel, Panel): tex = context.texture layout.prop(tex, "cloud_type", expand=True) - layout.label(text="Noise:") - layout.prop(tex, "noise_type", text="Type", expand=True) - layout.prop(tex, "noise_basis", text="Basis") + layout.label(text=_("Noise:")) + layout.prop(tex, "noise_type", text=_("Type"), expand=True) + layout.prop(tex, "noise_basis", text=_("Basis")) split = layout.split() col = split.column() - col.prop(tex, "noise_scale", text="Size") - col.prop(tex, "noise_depth", text="Depth") + col.prop(tex, "noise_scale", text=_("Size")) + col.prop(tex, "noise_depth", text=_("Depth")) - split.prop(tex, "nabla", text="Nabla") + split.prop(tex, "nabla", text=_("Nabla")) class TEXTURE_PT_wood(TextureTypePanel, Panel): @@ -263,15 +264,15 @@ class TEXTURE_PT_wood(TextureTypePanel, Panel): col = layout.column() col.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'} - col.label(text="Noise:") - col.row().prop(tex, "noise_type", text="Type", expand=True) - layout.prop(tex, "noise_basis", text="Basis") + col.label(text=_("Noise:")) + col.row().prop(tex, "noise_type", text=_("Type"), expand=True) + layout.prop(tex, "noise_basis", text=_("Basis")) split = layout.split() split.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'} col = split.column() - col.prop(tex, "noise_scale", text="Size") + col.prop(tex, "noise_scale", text=_("Size")) col.prop(tex, "turbulence") split.prop(tex, "nabla") @@ -289,15 +290,15 @@ class TEXTURE_PT_marble(TextureTypePanel, Panel): layout.prop(tex, "marble_type", expand=True) layout.prop(tex, "noise_basis_2", expand=True) - layout.label(text="Noise:") - layout.prop(tex, "noise_type", text="Type", expand=True) - layout.prop(tex, "noise_basis", text="Basis") + layout.label(text=_("Noise:")) + layout.prop(tex, "noise_type", text=_("Type"), expand=True) + layout.prop(tex, "noise_basis", text=_("Basis")) split = layout.split() col = split.column() - col.prop(tex, "noise_scale", text="Size") - col.prop(tex, "noise_depth", text="Depth") + col.prop(tex, "noise_scale", text=_("Size")) + col.prop(tex, "noise_depth", text=_("Depth")) col = split.column() col.prop(tex, "turbulence") @@ -315,7 +316,7 @@ class TEXTURE_PT_magic(TextureTypePanel, Panel): tex = context.texture row = layout.row() - row.prop(tex, "noise_depth", text="Depth") + row.prop(tex, "noise_depth", text=_("Depth")) row.prop(tex, "turbulence") @@ -348,12 +349,12 @@ class TEXTURE_PT_stucci(TextureTypePanel, Panel): tex = context.texture layout.prop(tex, "stucci_type", expand=True) - layout.label(text="Noise:") - layout.prop(tex, "noise_type", text="Type", expand=True) - layout.prop(tex, "noise_basis", text="Basis") + layout.label(text=_("Noise:")) + layout.prop(tex, "noise_type", text=_("Type"), expand=True) + layout.prop(tex, "noise_basis", text=_("Basis")) row = layout.row() - row.prop(tex, "noise_scale", text="Size") + row.prop(tex, "noise_scale", text=_("Size")) row.prop(tex, "turbulence") @@ -371,13 +372,13 @@ class TEXTURE_PT_image(TextureTypePanel, Panel): def texture_filter_common(tex, layout): - layout.label(text="Filter:") + layout.label(text=_("Filter:")) layout.prop(tex, "filter_type", text="") if tex.use_mipmap and tex.filter_type in {'AREA', 'EWA', 'FELINE'}: if tex.filter_type == 'FELINE': - layout.prop(tex, "filter_probes", text="Probes") + layout.prop(tex, "filter_probes", text=_("Probes")) else: - layout.prop(tex, "filter_eccentricity", text="Eccentricity") + layout.prop(tex, "filter_eccentricity", text=_("Eccentricity")) layout.prop(tex, "filter_size") layout.prop(tex, "use_filter_size_min") @@ -399,12 +400,12 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): split = layout.split() col = split.column() - col.label(text="Alpha:") - col.prop(tex, "use_alpha", text="Use") - col.prop(tex, "use_calculate_alpha", text="Calculate") - col.prop(tex, "invert_alpha", text="Invert") + col.label(text=_("Alpha:")) + col.prop(tex, "use_alpha", text=_("Use")) + col.prop(tex, "use_calculate_alpha", text=_("Calculate")) + col.prop(tex, "invert_alpha", text=_("Invert")) col.separator() - col.prop(tex, "use_flip_axis", text="Flip X/Y Axis") + col.prop(tex, "use_flip_axis", text=_("Flip X/Y Axis")) col = split.column() @@ -445,12 +446,12 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel): if tex.extension == 'REPEAT': col = split.column(align=True) - col.label(text="Repeat:") + col.label(text=_("Repeat:")) col.prop(tex, "repeat_x", text="X") col.prop(tex, "repeat_y", text="Y") col = split.column(align=True) - col.label(text="Mirror:") + col.label(text=_("Mirror:")) row = col.row() row.prop(tex, "use_mirror_x", text="X") row.active = (tex.repeat_x > 1) @@ -462,11 +463,11 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel): elif tex.extension == 'CHECKER': col = split.column(align=True) row = col.row() - row.prop(tex, "use_checker_even", text="Even") - row.prop(tex, "use_checker_odd", text="Odd") + row.prop(tex, "use_checker_even", text=_("Even")) + row.prop(tex, "use_checker_odd", text=_("Odd")) col = split.column() - col.prop(tex, "checker_distance", text="Distance") + col.prop(tex, "checker_distance", text=_("Distance")) layout.separator() @@ -474,12 +475,12 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel): col = split.column(align=True) #col.prop(tex, "crop_rectangle") - col.label(text="Crop Minimum:") + col.label(text=_("Crop Minimum:")) col.prop(tex, "crop_min_x", text="X") col.prop(tex, "crop_min_y", text="Y") col = split.column(align=True) - col.label(text="Crop Maximum:") + col.label(text=_("Crop Maximum:")) col.prop(tex, "crop_max_x", text="X") col.prop(tex, "crop_max_y", text="Y") @@ -517,9 +518,9 @@ class TEXTURE_PT_envmap(TextureTypePanel, Panel): col = split.column(align=True) - col.label(text="Clipping:") - col.prop(env, "clip_start", text="Start") - col.prop(env, "clip_end", text="End") + col.label(text=_("Clipping:")) + col.prop(env, "clip_start", text=_("Start")) + col.prop(env, "clip_end", text=_("End")) class TEXTURE_PT_envmap_sampling(TextureTypePanel, Panel): @@ -551,7 +552,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, Panel): split = layout.split() col = split.column() - col.prop(tex, "dimension_max", text="Dimension") + col.prop(tex, "dimension_max", text=_("Dimension")) col.prop(tex, "lacunarity") col.prop(tex, "octaves") @@ -560,16 +561,16 @@ class TEXTURE_PT_musgrave(TextureTypePanel, Panel): if musgrave_type in {'HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}: col.prop(tex, "offset") if musgrave_type in {'MULTIFRACTAL', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}: - col.prop(tex, "noise_intensity", text="Intensity") + col.prop(tex, "noise_intensity", text=_("Intensity")) if musgrave_type in {'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}: col.prop(tex, "gain") - layout.label(text="Noise:") + layout.label(text=_("Noise:")) - layout.prop(tex, "noise_basis", text="Basis") + layout.prop(tex, "noise_basis", text=_("Basis")) row = layout.row() - row.prop(tex, "noise_scale", text="Size") + row.prop(tex, "noise_scale", text=_("Size")) row.prop(tex, "nabla") @@ -586,26 +587,26 @@ class TEXTURE_PT_voronoi(TextureTypePanel, Panel): split = layout.split() col = split.column() - col.label(text="Distance Metric:") + col.label(text=_("Distance Metric:")) col.prop(tex, "distance_metric", text="") sub = col.column() sub.active = tex.distance_metric == 'MINKOVSKY' - sub.prop(tex, "minkovsky_exponent", text="Exponent") - col.label(text="Coloring:") + sub.prop(tex, "minkovsky_exponent", text=_("Exponent")) + col.label(text=_("Coloring:")) col.prop(tex, "color_mode", text="") - col.prop(tex, "noise_intensity", text="Intensity") + col.prop(tex, "noise_intensity", text=_("Intensity")) col = split.column() sub = col.column(align=True) - sub.label(text="Feature Weights:") + sub.label(text=_("Feature Weights:")) sub.prop(tex, "weight_1", text="1", slider=True) sub.prop(tex, "weight_2", text="2", slider=True) sub.prop(tex, "weight_3", text="3", slider=True) sub.prop(tex, "weight_4", text="4", slider=True) - layout.label(text="Noise:") + layout.label(text=_("Noise:")) row = layout.row() - row.prop(tex, "noise_scale", text="Size") + row.prop(tex, "noise_scale", text=_("Size")) row.prop(tex, "nabla") @@ -620,13 +621,13 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, Panel): tex = context.texture layout.prop(tex, "noise_distortion") - layout.prop(tex, "noise_basis", text="Basis") + layout.prop(tex, "noise_basis", text=_("Basis")) split = layout.split() col = split.column() - col.prop(tex, "distortion", text="Distortion") - col.prop(tex, "noise_scale", text="Size") + col.prop(tex, "distortion", text=_("Distortion")) + col.prop(tex, "noise_scale", text=_("Size")) split.prop(tex, "nabla") @@ -693,26 +694,26 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): col = split.column() if pd.point_source == 'PARTICLE_SYSTEM': - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(pd, "object", text="") sub = col.column() sub.enabled = bool(pd.object) if pd.object: - sub.label(text="System:") + sub.label(text=_("System:")) sub.prop_search(pd, "particle_system", pd.object, "particle_systems", text="") - sub.label(text="Cache:") + sub.label(text=_("Cache:")) sub.prop(pd, "particle_cache_space", text="") else: - col.label(text="Object:") + col.label(text=_("Object:")) col.prop(pd, "object", text="") - col.label(text="Cache:") + col.label(text=_("Cache:")) col.prop(pd, "vertex_cache_space", text="") col.separator() if pd.point_source == 'PARTICLE_SYSTEM': - col.label(text="Color Source:") + col.label(text=_("Color Source:")) col.prop(pd, "color_source", text="") if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}: col.prop(pd, "speed_scale") @@ -722,7 +723,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): col = split.column() col.label() col.prop(pd, "radius") - col.label(text="Falloff:") + col.label(text=_("Falloff:")) col.prop(pd, "falloff", text="") if pd.falloff == 'SOFT': col.prop(pd, "falloff_soft") @@ -733,7 +734,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): if pd.use_falloff_curve: col = layout.column() - col.label(text="Falloff Curve") + col.label(text=_("Falloff Curve")) col.template_curve_mapping(pd, "falloff_curve", brush=False) @@ -762,9 +763,9 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Influence:") + col.label(text=_("Influence:")) col.prop(pd, "turbulence_influence", text="") - col.label(text="Noise Basis:") + col.label(text=_("Noise Basis:")) col.prop(pd, "noise_basis", text="") col = split.column() @@ -801,7 +802,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): if not isinstance(idblock, bpy.types.Brush): split = layout.split(percentage=0.3) col = split.column() - col.label(text="Coordinates:") + col.label(text=_("Coordinates:")) col = split.column() col.prop(tex, "texture_coords", text="") @@ -810,12 +811,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): ob = context.object if ob and ob.type == 'MESH': split = layout.split(percentage=0.3) - split.label(text="Mesh:") + split.label(text=_("Mesh:")) split.prop(ob.data, "texco_mesh", text="") """ elif tex.texture_coords == 'UV': split = layout.split(percentage=0.3) - split.label(text="Layer:") + split.label(text=_("Layer:")) ob = context.object if ob and ob.type == 'MESH': split.prop_search(tex, "uv_layer", ob.data, "uv_textures", text="") @@ -824,12 +825,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): elif tex.texture_coords == 'OBJECT': split = layout.split(percentage=0.3) - split.label(text="Object:") + split.label(text=_("Object:")) split.prop(tex, "object", text="") if isinstance(idblock, bpy.types.Brush): if context.sculpt_object: - layout.label(text="Brush Mapping:") + layout.label(text=_("Brush Mapping:")) layout.prop(tex, "map_mode", expand=True) row = layout.row() @@ -838,7 +839,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): else: if isinstance(idblock, bpy.types.Material): split = layout.split(percentage=0.3) - split.label(text="Projection:") + split.label(text=_("Projection:")) split.prop(tex, "mapping", text="") split = layout.split() @@ -900,111 +901,111 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): split = layout.split() col = split.column() - col.label(text="Diffuse:") - factor_but(col, "use_map_diffuse", "diffuse_factor", "Intensity") - factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color") - factor_but(col, "use_map_alpha", "alpha_factor", "Alpha") - factor_but(col, "use_map_translucency", "translucency_factor", "Translucency") + col.label(text=_("Diffuse:")) + factor_but(col, "use_map_diffuse", "diffuse_factor", _("Intensity")) + factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", _("Color")) + factor_but(col, "use_map_alpha", "alpha_factor", _("Alpha")) + factor_but(col, "use_map_translucency", "translucency_factor", _("Translucency")) - col.label(text="Specular:") - factor_but(col, "use_map_specular", "specular_factor", "Intensity") - factor_but(col, "use_map_color_spec", "specular_color_factor", "Color") - factor_but(col, "use_map_hardness", "hardness_factor", "Hardness") + col.label(text=_("Specular:")) + factor_but(col, "use_map_specular", "specular_factor", _("Intensity")) + factor_but(col, "use_map_color_spec", "specular_color_factor", _("Color")) + factor_but(col, "use_map_hardness", "hardness_factor", _("Hardness")) col = split.column() - col.label(text="Shading:") - factor_but(col, "use_map_ambient", "ambient_factor", "Ambient") - factor_but(col, "use_map_emit", "emit_factor", "Emit") - factor_but(col, "use_map_mirror", "mirror_factor", "Mirror") - factor_but(col, "use_map_raymir", "raymir_factor", "Ray Mirror") + col.label(text=_("Shading:")) + factor_but(col, "use_map_ambient", "ambient_factor", _("Ambient")) + factor_but(col, "use_map_emit", "emit_factor", _("Emit")) + factor_but(col, "use_map_mirror", "mirror_factor", _("Mirror")) + factor_but(col, "use_map_raymir", "raymir_factor", _("Ray Mirror")) - col.label(text="Geometry:") + col.label(text=_("Geometry:")) # XXX replace 'or' when displacement is fixed to not rely on normal influence value. - sub_tmp = factor_but(col, "use_map_normal", "normal_factor", "Normal") + sub_tmp = factor_but(col, "use_map_normal", "normal_factor", _("Normal")) sub_tmp.active = (tex.use_map_normal or tex.use_map_displacement) # END XXX - factor_but(col, "use_map_warp", "warp_factor", "Warp") - factor_but(col, "use_map_displacement", "displacement_factor", "Displace") + factor_but(col, "use_map_warp", "warp_factor", _("Warp")) + factor_but(col, "use_map_displacement", "displacement_factor", _("Displace")) #sub = col.column() #sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror - #sub.prop(tex, "default_value", text="Amount", slider=True) + #sub.prop(tex, "default_value", text=_("Amount"), slider=True) elif idblock.type == 'HALO': - layout.label(text="Halo:") + layout.label(text=_("Halo:")) split = layout.split() col = split.column() - factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color") - factor_but(col, "use_map_alpha", "alpha_factor", "Alpha") + factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", _("Color")) + factor_but(col, "use_map_alpha", "alpha_factor", _("Alpha")) col = split.column() - factor_but(col, "use_map_raymir", "raymir_factor", "Size") - factor_but(col, "use_map_hardness", "hardness_factor", "Hardness") - factor_but(col, "use_map_translucency", "translucency_factor", "Add") + factor_but(col, "use_map_raymir", "raymir_factor", _("Size")) + factor_but(col, "use_map_hardness", "hardness_factor", _("Hardness")) + factor_but(col, "use_map_translucency", "translucency_factor", _("Add")) elif idblock.type == 'VOLUME': split = layout.split() col = split.column() - factor_but(col, "use_map_density", "density_factor", "Density") - factor_but(col, "use_map_emission", "emission_factor", "Emission") - factor_but(col, "use_map_scatter", "scattering_factor", "Scattering") - factor_but(col, "use_map_reflect", "reflection_factor", "Reflection") + factor_but(col, "use_map_density", "density_factor", _("Density")) + factor_but(col, "use_map_emission", "emission_factor", _("Emission")) + factor_but(col, "use_map_scatter", "scattering_factor", _("Scattering")) + factor_but(col, "use_map_reflect", "reflection_factor", _("Reflection")) col = split.column() col.label(text=" ") - factor_but(col, "use_map_color_emission", "emission_color_factor", "Emission Color") - factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color") - factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color") + factor_but(col, "use_map_color_emission", "emission_color_factor", _("Emission Color")) + factor_but(col, "use_map_color_transmission", "transmission_color_factor", _("Transmission Color")) + factor_but(col, "use_map_color_reflection", "reflection_color_factor", _("Reflection Color")) elif isinstance(idblock, bpy.types.Lamp): split = layout.split() col = split.column() - factor_but(col, "use_map_color", "color_factor", "Color") + factor_but(col, "use_map_color", "color_factor", _("Color")) col = split.column() - factor_but(col, "use_map_shadow", "shadow_factor", "Shadow") + factor_but(col, "use_map_shadow", "shadow_factor", _("Shadow")) elif isinstance(idblock, bpy.types.World): split = layout.split() col = split.column() - factor_but(col, "use_map_blend", "blend_factor", "Blend") - factor_but(col, "use_map_horizon", "horizon_factor", "Horizon") + factor_but(col, "use_map_blend", "blend_factor", _("Blend")) + factor_but(col, "use_map_horizon", "horizon_factor", _("Horizon")) col = split.column() - factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up") - factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down") + factor_but(col, "use_map_zenith_up", "zenith_up_factor", _("Zenith Up")) + factor_but(col, "use_map_zenith_down", "zenith_down_factor", _("Zenith Down")) elif isinstance(idblock, bpy.types.ParticleSettings): split = layout.split() col = split.column() - col.label(text="General:") - factor_but(col, "use_map_time", "time_factor", "Time") - factor_but(col, "use_map_life", "life_factor", "Lifetime") - factor_but(col, "use_map_density", "density_factor", "Density") - factor_but(col, "use_map_size", "size_factor", "Size") + col.label(text=_("General:")) + factor_but(col, "use_map_time", "time_factor", _("Time")) + factor_but(col, "use_map_life", "life_factor", _("Lifetime")) + factor_but(col, "use_map_density", "density_factor", _("Density")) + factor_but(col, "use_map_size", "size_factor", _("Size")) col = split.column() - col.label(text="Physics:") - factor_but(col, "use_map_velocity", "velocity_factor", "Velocity") - factor_but(col, "use_map_damp", "damp_factor", "Damp") - factor_but(col, "use_map_gravity", "gravity_factor", "Gravity") - factor_but(col, "use_map_field", "field_factor", "Force Fields") + col.label(text=_("Physics:")) + factor_but(col, "use_map_velocity", "velocity_factor", _("Velocity")) + factor_but(col, "use_map_damp", "damp_factor", _("Damp")) + factor_but(col, "use_map_gravity", "gravity_factor", _("Gravity")) + factor_but(col, "use_map_field", "field_factor", _("Force Fields")) - layout.label(text="Hair:") + layout.label(text=_("Hair:")) split = layout.split() col = split.column() - factor_but(col, "use_map_length", "length_factor", "Length") - factor_but(col, "use_map_clump", "clump_factor", "Clump") + factor_but(col, "use_map_length", "length_factor", _("Length")) + factor_but(col, "use_map_clump", "clump_factor", _("Clump")) col = split.column() - factor_but(col, "use_map_kink", "kink_factor", "Kink") - factor_but(col, "use_map_rough", "rough_factor", "Rough") + factor_but(col, "use_map_kink", "kink_factor", _("Kink")) + factor_but(col, "use_map_rough", "rough_factor", _("Rough")) layout.separator() @@ -1012,32 +1013,32 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): split = layout.split() col = split.column() - col.prop(tex, "blend_type", text="Blend") + col.prop(tex, "blend_type", text=_("Blend")) col.prop(tex, "use_rgb_to_intensity") # color is used on grayscale textures even when use_rgb_to_intensity is disabled. col.prop(tex, "color", text="") col = split.column() - col.prop(tex, "invert", text="Negative") + col.prop(tex, "invert", text=_("Negative")) col.prop(tex, "use_stencil") if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World): - col.prop(tex, "default_value", text="DVar", slider=True) + col.prop(tex, "default_value", text=_("DVar"), slider=True) if isinstance(idblock, bpy.types.Material): - layout.label(text="Bump Mapping:") + layout.label(text=_("Bump Mapping:")) # only show bump settings if activated but not for normalmap images row = layout.row() sub = row.row() sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map)) - sub.prop(tex, "bump_method", text="Method") + sub.prop(tex, "bump_method", text=_("Method")) # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps sub = row.row() sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) - sub.prop(tex, "bump_objectspace", text="Space") + sub.prop(tex, "bump_objectspace", text=_("Space")) class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 71ee03296a0..916667ea400 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel +from blf import gettext as _ class WorldButtonsPanel(): @@ -115,12 +116,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, Panel): layout.active = light.use_ambient_occlusion split = layout.split() - split.prop(light, "ao_factor", text="Factor") + split.prop(light, "ao_factor", text=_("Factor")) split.prop(light, "ao_blend_type", text="") class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel): - bl_label = "Environment Lighting" + bl_label = _("Environment Lighting") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw_header(self, context): @@ -134,7 +135,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel): layout.active = light.use_environment_light split = layout.split() - split.prop(light, "environment_energy", text="Energy") + split.prop(light, "environment_energy", text=_("Energy")) split.prop(light, "environment_color", text="") @@ -153,11 +154,11 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, Panel): layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE' split = layout.split() - split.prop(light, "indirect_factor", text="Factor") - split.prop(light, "indirect_bounces", text="Bounces") + split.prop(light, "indirect_factor", text=_("Factor")) + split.prop(light, "indirect_bounces", text=_("Bounces")) if light.gather_method == 'RAYTRACE': - layout.label(text="Only works with Approximate gather method") + layout.label(text=_("Only works with Approximate gather method")) class WORLD_PT_gather(WorldButtonsPanel, Panel): @@ -175,18 +176,18 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Attenuation:") + col.label(text=_("Attenuation:")) if light.gather_method == 'RAYTRACE': col.prop(light, "distance") col.prop(light, "use_falloff") sub = col.row() sub.active = light.use_falloff - sub.prop(light, "falloff_strength", text="Strength") + sub.prop(light, "falloff_strength", text=_("Strength")) if light.gather_method == 'RAYTRACE': col = split.column() - col.label(text="Sampling:") + col.label(text=_("Sampling:")) col.prop(light, "sample_method", text="") sub = col.column() @@ -201,9 +202,9 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel): if light.gather_method == 'APPROXIMATE': col = split.column() - col.label(text="Sampling:") + col.label(text=_("Sampling:")) col.prop(light, "passes") - col.prop(light, "error_threshold", text="Error") + col.prop(light, "error_threshold", text=_("Error")) col.prop(light, "use_cache") col.prop(light, "correction") @@ -257,11 +258,11 @@ class WORLD_PT_stars(WorldButtonsPanel, Panel): col = split.column() col.prop(world.star_settings, "size") - col.prop(world.star_settings, "color_random", text="Colors") + col.prop(world.star_settings, "color_random", text=_("Colors")) col = split.column() - col.prop(world.star_settings, "distance_min", text="Min. Dist") - col.prop(world.star_settings, "average_separation", text="Separation") + col.prop(world.star_settings, "distance_min", text=_("Min. Dist")) + col.prop(world.star_settings, "average_separation", text=_("Separation")) class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py index cbbefa01a3c..bb0cf6eda2c 100644 --- a/release/scripts/startup/bl_ui/space_console.py +++ b/release/scripts/startup/bl_ui/space_console.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Header, Menu, Operator from bpy.props import StringProperty +from blf import gettext as _ class CONSOLE_HT_header(Header): @@ -33,7 +34,7 @@ class CONSOLE_HT_header(Header): if context.area.show_menus: layout.menu("CONSOLE_MT_console") - layout.operator("console.autocomplete", text="Autocomplete") + layout.operator("console.autocomplete", text=_("Autocomplete")) class CONSOLE_MT_console(Menu): diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 90dcc99e6d7..580a4e7f1b6 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Header, Menu +from blf import gettext as _ ####################################### @@ -117,7 +118,7 @@ class DOPESHEET_HT_header(Header): row.menu("DOPESHEET_MT_gpencil_frame") layout.prop(st, "mode", text="") - layout.prop(st.dopesheet, "show_summary", text="Summary") + layout.prop(st.dopesheet, "show_summary", text=_("Summary")) if st.mode == 'DOPESHEET': dopesheet_filter(layout, context) @@ -153,9 +154,9 @@ class DOPESHEET_MT_view(Menu): layout.prop(st, "use_marker_sync") if st.show_seconds: - layout.operator("anim.time_toggle", text="Show Frames") + layout.operator("anim.time_toggle", text=_("Show Frames")) else: - layout.operator("anim.time_toggle", text="Show Seconds") + layout.operator("anim.time_toggle", text=_("Show Seconds")) layout.separator() layout.operator("anim.previewrange_set") @@ -180,22 +181,22 @@ class DOPESHEET_MT_select(Menu): # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None layout.operator("action.select_all_toggle") - layout.operator("action.select_all_toggle", text="Invert Selection").invert = True + layout.operator("action.select_all_toggle", text=_("Invert Selection")).invert = True layout.separator() layout.operator("action.select_border") - layout.operator("action.select_border", text="Border Axis Range").axis_range = True + layout.operator("action.select_border", text=_("Border Axis Range")).axis_range = True layout.separator() - layout.operator("action.select_column", text="Columns on Selected Keys").mode = 'KEYS' - layout.operator("action.select_column", text="Column on Current Frame").mode = 'CFRA' + layout.operator("action.select_column", text=_("Columns on Selected Keys")).mode = 'KEYS' + layout.operator("action.select_column", text=_("Column on Current Frame")).mode = 'CFRA' - layout.operator("action.select_column", text="Columns on Selected Markers").mode = 'MARKERS_COLUMN' - layout.operator("action.select_column", text="Between Selected Markers").mode = 'MARKERS_BETWEEN' + layout.operator("action.select_column", text=_("Columns on Selected Markers")).mode = 'MARKERS_COLUMN' + layout.operator("action.select_column", text=_("Between Selected Markers")).mode = 'MARKERS_BETWEEN' layout.separator() - layout.operator("action.select_leftright", text="Before Current Frame").mode = 'LEFT' - layout.operator("action.select_leftright", text="After Current Frame").mode = 'RIGHT' + layout.operator("action.select_leftright", text=_("Before Current Frame")).mode = 'LEFT' + layout.operator("action.select_leftright", text=_("After Current Frame")).mode = 'RIGHT' # FIXME: grease pencil mode isn't supported for these yet, so skip for that mode only if context.space_data.mode != 'GPENCIL': @@ -217,14 +218,14 @@ class DOPESHEET_MT_marker(Menu): #layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + layout.operator("marker.add", _("Add Marker")) + layout.operator("marker.duplicate", text=_("Duplicate Marker")) + layout.operator("marker.delete", text=_("Delete Marker")) layout.separator() - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + layout.operator("marker.rename", text=_("Rename Marker")) + layout.operator("marker.move", text=_("Grab/Move Marker")) if st.mode in {'ACTION', 'SHAPEKEY'} and st.action: layout.separator() @@ -254,14 +255,14 @@ class DOPESHEET_MT_channel(Menu): layout.separator() layout.operator("anim.channels_editable_toggle") - layout.operator_menu_enum("action.extrapolation_type", "type", text="Extrapolation Mode") + layout.operator_menu_enum("action.extrapolation_type", "type", text=_("Extrapolation Mode")) layout.separator() layout.operator("anim.channels_expand") layout.operator("anim.channels_collapse") layout.separator() - layout.operator_menu_enum("anim.channels_move", "direction", text="Move...") + layout.operator_menu_enum("anim.channels_move", "direction", text=_("Move...")) layout.separator() layout.operator("anim.channels_fcurves_enable") @@ -273,10 +274,10 @@ class DOPESHEET_MT_key(Menu): def draw(self, context): layout = self.layout - layout.menu("DOPESHEET_MT_key_transform", text="Transform") + layout.menu("DOPESHEET_MT_key_transform", text=_("Transform")) - layout.operator_menu_enum("action.snap", "type", text="Snap") - layout.operator_menu_enum("action.mirror", "type", text="Mirror") + layout.operator_menu_enum("action.snap", "type", text=_("Snap")) + layout.operator_menu_enum("action.mirror", "type", text=_("Mirror")) layout.separator() layout.operator("action.keyframe_insert") @@ -286,9 +287,9 @@ class DOPESHEET_MT_key(Menu): layout.operator("action.delete") layout.separator() - layout.operator_menu_enum("action.keyframe_type", "type", text="Keyframe Type") - layout.operator_menu_enum("action.handle_type", "type", text="Handle Type") - layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode") + layout.operator_menu_enum("action.keyframe_type", "type", text=_("Keyframe Type")) + layout.operator_menu_enum("action.handle_type", "type", text=_("Handle Type")) + layout.operator_menu_enum("action.interpolation_type", "type", text=_("Interpolation Mode")) layout.separator() layout.operator("action.clean") @@ -305,10 +306,10 @@ class DOPESHEET_MT_key_transform(Menu): def draw(self, context): layout = self.layout - layout.operator("transform.transform", text="Grab/Move").mode = 'TIME_TRANSLATE' - layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND' - layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE' - layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' + layout.operator("transform.transform", text=_("Grab/Move")).mode = 'TIME_TRANSLATE' + layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND' + layout.operator("transform.transform", text=_("Slide")).mode = 'TIME_SLIDE' + layout.operator("transform.transform", text=_("Scale")).mode = 'TIME_SCALE' ####################################### @@ -347,7 +348,7 @@ class DOPESHEET_MT_gpencil_frame(Menu): def draw(self, context): layout = self.layout - layout.menu("DOPESHEET_MT_key_transform", text="Transform") + layout.menu("DOPESHEET_MT_key_transform", text=_("Transform")) #layout.operator_menu_enum("action.snap", "type", text="Snap") #layout.operator_menu_enum("action.mirror", "type", text="Mirror") diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index d4b8c415a7f..fd50d60bd45 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Header, Menu +from blf import gettext as _ class GRAPH_HT_header(Header): @@ -82,9 +83,9 @@ class GRAPH_MT_view(Menu): layout.separator() if st.show_handles: - layout.operator("graph.handles_view_toggle", icon='CHECKBOX_HLT', text="Show All Handles") + layout.operator("graph.handles_view_toggle", icon='CHECKBOX_HLT', text=_("Show All Handles")) else: - layout.operator("graph.handles_view_toggle", icon='CHECKBOX_DEHLT', text="Show All Handles") + layout.operator("graph.handles_view_toggle", icon='CHECKBOX_DEHLT', text=_("Show All Handles")) layout.prop(st, "use_only_selected_curves_handles") layout.prop(st, "use_only_selected_keyframe_handles") layout.operator("anim.time_toggle") @@ -112,23 +113,23 @@ class GRAPH_MT_select(Menu): # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None layout.operator("graph.select_all_toggle") - layout.operator("graph.select_all_toggle", text="Invert Selection").invert = True + layout.operator("graph.select_all_toggle", text=_("Invert Selection")).invert = True layout.separator() layout.operator("graph.select_border") - layout.operator("graph.select_border", text="Border Axis Range").axis_range = True - layout.operator("graph.select_border", text="Border (Include Handles)").include_handles = True + layout.operator("graph.select_border", text=_("Border Axis Range")).axis_range = True + layout.operator("graph.select_border", text=_("Border (Include Handles)")).include_handles = True layout.separator() - layout.operator("graph.select_column", text="Columns on Selected Keys").mode = 'KEYS' - layout.operator("graph.select_column", text="Column on Current Frame").mode = 'CFRA' + layout.operator("graph.select_column", text=_("Columns on Selected Keys")).mode = 'KEYS' + layout.operator("graph.select_column", text=_("Column on Current Frame")).mode = 'CFRA' - layout.operator("graph.select_column", text="Columns on Selected Markers").mode = 'MARKERS_COLUMN' - layout.operator("graph.select_column", text="Between Selected Markers").mode = 'MARKERS_BETWEEN' + layout.operator("graph.select_column", text=_("Columns on Selected Markers")).mode = 'MARKERS_COLUMN' + layout.operator("graph.select_column", text=_("Between Selected Markers")).mode = 'MARKERS_BETWEEN' layout.separator() - layout.operator("graph.select_leftright", text="Before Current Frame").mode = 'LEFT' - layout.operator("graph.select_leftright", text="After Current Frame").mode = 'RIGHT' + layout.operator("graph.select_leftright", text=_("Before Current Frame")).mode = 'LEFT' + layout.operator("graph.select_leftright", text=_("After Current Frame")).mode = 'RIGHT' layout.separator() layout.operator("graph.select_more") @@ -146,14 +147,14 @@ class GRAPH_MT_marker(Menu): #layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + layout.operator("marker.add", _("Add Marker")) + layout.operator("marker.duplicate", text=_("Duplicate Marker")) + layout.operator("marker.delete", text=_("Delete Marker")) layout.separator() - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + layout.operator("marker.rename", text=_("Rename Marker")) + layout.operator("marker.move", text=_("Grab/Move Marker")) # TODO: pose markers for action edit mode only? @@ -176,14 +177,14 @@ class GRAPH_MT_channel(Menu): layout.separator() layout.operator("anim.channels_editable_toggle") layout.operator("anim.channels_visibility_set") - layout.operator_menu_enum("graph.extrapolation_type", "type", text="Extrapolation Mode") + layout.operator_menu_enum("graph.extrapolation_type", "type", text=_("Extrapolation Mode")) layout.separator() layout.operator("anim.channels_expand") layout.operator("anim.channels_collapse") layout.separator() - layout.operator_menu_enum("anim.channels_move", "direction", text="Move...") + layout.operator_menu_enum("anim.channels_move", "direction", text=_("Move...")) layout.separator() layout.operator("anim.channels_fcurves_enable") @@ -195,10 +196,10 @@ class GRAPH_MT_key(Menu): def draw(self, context): layout = self.layout - layout.menu("GRAPH_MT_key_transform", text="Transform") + layout.menu("GRAPH_MT_key_transform", text=_("Transform")) - layout.operator_menu_enum("graph.snap", "type", text="Snap") - layout.operator_menu_enum("graph.mirror", "type", text="Mirror") + layout.operator_menu_enum("graph.snap", "type", text=_("Snap")) + layout.operator_menu_enum("graph.mirror", "type", text=_("Mirror")) layout.separator() layout.operator("graph.keyframe_insert") @@ -210,8 +211,8 @@ class GRAPH_MT_key(Menu): layout.operator("graph.delete") layout.separator() - layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type") - layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode") + layout.operator_menu_enum("graph.handle_type", "type", text=_("Handle Type")) + layout.operator_menu_enum("graph.interpolation_type", "type", text=_("Interpolation Mode")) layout.separator() layout.operator("graph.clean") @@ -224,7 +225,7 @@ class GRAPH_MT_key(Menu): layout.operator("graph.paste") layout.separator() - layout.operator("graph.euler_filter", text="Discontinuity (Euler) Filter") + layout.operator("graph.euler_filter", text=_("Discontinuity (Euler) Filter")) class GRAPH_MT_key_transform(Menu): @@ -233,10 +234,10 @@ class GRAPH_MT_key_transform(Menu): def draw(self, context): layout = self.layout - layout.operator("transform.translate", text="Grab/Move") - layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND' - layout.operator("transform.rotate", text="Rotate") - layout.operator("transform.resize", text="Scale") + layout.operator("transform.translate", text=_("Grab/Move")) + layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND' + layout.operator("transform.rotate", text=_("Rotate")) + layout.operator("transform.resize", text=_("Scale")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 97b5d8457e0..f5be25d14f6 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from blf import gettext as _ class BrushButtonsPanel(): @@ -64,7 +65,7 @@ class IMAGE_MT_view(Menu): ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]] for a, b in ratios: - text = "Zoom %d:%d" % (a, b) + text = _("Zoom") + " %d:%d" % (a, b) layout.operator("image.view_zoom_ratio", text=text).ratio = a / b layout.separator() @@ -92,7 +93,7 @@ class IMAGE_MT_select(Menu): layout.separator() layout.operator("uv.select_all") - layout.operator("uv.select_all", text="Inverse").action = 'INVERT' + layout.operator("uv.select_all", text=_("Inverse")).action = 'INVERT' layout.operator("uv.unlink_selected") layout.separator() @@ -122,12 +123,12 @@ class IMAGE_MT_image(Menu): layout.operator("image.save") layout.operator("image.save_as") - layout.operator("image.save_as", text="Save a Copy").copy = True + layout.operator("image.save_as", text=_("Save a Copy")).copy = True if ima.source == 'SEQUENCE': layout.operator("image.save_sequence") - layout.operator("image.external_edit", "Edit Externally") + layout.operator("image.external_edit", _("Edit Externally")) layout.separator() @@ -145,7 +146,7 @@ class IMAGE_MT_image(Menu): # this could be done in operator poll too if ima.is_dirty: if ima.source in {'FILE', 'GENERATED'} and ima.type != 'MULTILAYER': - layout.operator("image.pack", text="Pack As PNG").as_png = True + layout.operator("image.pack", text=_("Pack As PNG")).as_png = True layout.separator() @@ -158,23 +159,23 @@ class IMAGE_MT_image_invert(Menu): def draw(self, context): layout = self.layout - op = layout.operator("image.invert", text="Invert Image Colors") + op = layout.operator("image.invert", text=_("Invert Image Colors")) op.invert_r = True op.invert_g = True op.invert_b = True layout.separator() - op = layout.operator("image.invert", text="Invert Red Channel") + op = layout.operator("image.invert", text=_("Invert Red Channel")) op.invert_r = True - op = layout.operator("image.invert", text="Invert Green Channel") + op = layout.operator("image.invert", text=_("Invert Green Channel")) op.invert_g = True - op = layout.operator("image.invert", text="Invert Blue Channel") + op = layout.operator("image.invert", text=_("Invert Blue Channel")) op.invert_b = True - op = layout.operator("image.invert", text="Invert Alpha Channel") + op = layout.operator("image.invert", text=_("Invert Alpha Channel")) op.invert_a = True @@ -185,8 +186,8 @@ class IMAGE_MT_uvs_showhide(Menu): layout = self.layout layout.operator("uv.reveal") - layout.operator("uv.hide", text="Hide Selected") - layout.operator("uv.hide", text="Hide Unselected").unselected = True + layout.operator("uv.hide", text=_("Hide Selected")) + layout.operator("uv.hide", text=_("Hide Unselected")).unselected = True class IMAGE_MT_uvs_transform(Menu): @@ -211,14 +212,14 @@ class IMAGE_MT_uvs_snap(Menu): layout = self.layout layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS' - layout.operator("uv.snap_selected", text="Selected to Cursor").target = 'CURSOR' - layout.operator("uv.snap_selected", text="Selected to Adjacent Unselected").target = 'ADJACENT_UNSELECTED' + layout.operator("uv.snap_selected", text=_("Selected to Pixels")).target = 'PIXELS' + layout.operator("uv.snap_selected", text=_("Selected to Cursor")).target = 'CURSOR' + layout.operator("uv.snap_selected", text=_("Selected to Adjacent Unselected")).target = 'ADJACENT_UNSELECTED' layout.separator() - layout.operator("uv.snap_cursor", text="Cursor to Pixels").target = 'PIXELS' - layout.operator("uv.snap_cursor", text="Cursor to Selected").target = 'SELECTED' + layout.operator("uv.snap_cursor", text=_("Cursor to Pixels")).target = 'PIXELS' + layout.operator("uv.snap_cursor", text=_("Cursor to Selected")).target = 'SELECTED' class IMAGE_MT_uvs_mirror(Menu): @@ -228,8 +229,8 @@ class IMAGE_MT_uvs_mirror(Menu): layout = self.layout layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True - layout.operator("transform.mirror", text="Y Axis").constraint_axis[1] = True + layout.operator("transform.mirror", text=_("X Axis")).constraint_axis[0] = True + layout.operator("transform.mirror", text=_("Y Axis")).constraint_axis[1] = True class IMAGE_MT_uvs_weldalign(Menu): @@ -259,7 +260,7 @@ class IMAGE_MT_uvs(Menu): layout.prop(uv, "use_live_unwrap") layout.operator("uv.unwrap") - layout.operator("uv.pin", text="Unpin").clear = True + layout.operator("uv.pin", text=_("Unpin")).clear = True layout.operator("uv.pin") layout.separator() @@ -299,32 +300,32 @@ class IMAGE_MT_uvs_select_mode(Menu): # do smart things depending on whether uv_select_sync is on if toolsettings.use_uv_select_sync: - prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') + prop = layout.operator("wm.context_set_value", text=_("Vertex"), icon='VERTEXSEL') prop.value = "(True, False, False)" prop.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') + prop = layout.operator("wm.context_set_value", text=_("Edge"), icon='EDGESEL') prop.value = "(False, True, False)" prop.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') + prop = layout.operator("wm.context_set_value", text=_("Face"), icon='FACESEL') prop.value = "(False, False, True)" prop.data_path = "tool_settings.mesh_select_mode" else: - prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL') + prop = layout.operator("wm.context_set_string", text=_("Vertex"), icon='UV_VERTEXSEL') prop.value = "VERTEX" prop.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL') + prop = layout.operator("wm.context_set_string", text=_("Edge"), icon='UV_EDGESEL') prop.value = "EDGE" prop.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL') + prop = layout.operator("wm.context_set_string", text=_("Face"), icon='UV_FACESEL') prop.value = "FACE" prop.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL') + prop = layout.operator("wm.context_set_string", text=_("Island"), icon='UV_ISLANDSEL') prop.value = "ISLAND" prop.data_path = "tool_settings.uv_select_mode" @@ -356,9 +357,9 @@ class IMAGE_HT_header(Header): sub.menu("IMAGE_MT_select") if ima and ima.is_dirty: - sub.menu("IMAGE_MT_image", text="Image*") + sub.menu("IMAGE_MT_image", text=_("Image*")) else: - sub.menu("IMAGE_MT_image", text="Image") + sub.menu("IMAGE_MT_image", text=_("Image")) if show_uvedit: sub.menu("IMAGE_MT_uvs") @@ -596,22 +597,22 @@ class IMAGE_PT_view_properties(Panel): col = split.column() if ima: - col.prop(ima, "display_aspect", text="Aspect Ratio") + col.prop(ima, "display_aspect", text=_("Aspect Ratio")) col = split.column() - col.label(text="Coordinates:") - col.prop(sima, "show_repeat", text="Repeat") + col.label(text=_("Coordinates:")) + col.prop(sima, "show_repeat", text=_("Repeat")) if show_uvedit: - col.prop(uvedit, "show_normalized_coords", text="Normalized") + col.prop(uvedit, "show_normalized_coords", text=_("Normalized")) elif show_uvedit: - col.label(text="Coordinates:") - col.prop(uvedit, "show_normalized_coords", text="Normalized") + col.label(text=_("Coordinates:")) + col.prop(uvedit, "show_normalized_coords", text=_("Normalized")) if show_uvedit: col = layout.column() - col.label("Cursor Location:") + col.label(_("Cursor Location:")) col.row().prop(uvedit, "cursor_location", text="") col.separator() @@ -623,11 +624,11 @@ class IMAGE_PT_view_properties(Panel): col = split.column() col.prop(uvedit, "show_faces") - col.prop(uvedit, "show_smooth_edges", text="Smooth") - col.prop(uvedit, "show_modified_edges", text="Modified") + col.prop(uvedit, "show_smooth_edges", text=_("Smooth")) + col.prop(uvedit, "show_modified_edges", text=_("Modified")) col = split.column() - col.prop(uvedit, "show_stretch", text="Stretch") + col.prop(uvedit, "show_stretch", text=_("Stretch")) sub = col.column() sub.active = uvedit.show_stretch sub.row().prop(uvedit, "draw_stretch_type", expand=True) @@ -669,12 +670,12 @@ class IMAGE_PT_paint(Panel): row.prop(brush, "jitter", slider=True) row.prop(brush, "use_pressure_jitter", toggle=True, text="") - col.prop(brush, "blend", text="Blend") + col.prop(brush, "blend", text=_("Blend")) if brush.image_tool == 'CLONE': col.separator() - col.prop(brush, "clone_image", text="Image") - col.prop(brush, "clone_alpha", text="Alpha") + col.prop(brush, "clone_image", text=_("Image")) + col.prop(brush, "clone_alpha", text=_("Alpha")) class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): @@ -728,7 +729,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): layout.prop(brush, "use_space") row = layout.row(align=True) row.active = brush.use_space - row.prop(brush, "spacing", text="Distance", slider=True) + row.prop(brush, "spacing", text=_("Distance"), slider=True) row.prop(brush, "use_pressure_spacing", toggle=True, text="") layout.prop(brush, "use_wrap") diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 7f5a5f231cf..3e6abaa8ea3 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Operator +from blf import gettext as _ class INFO_HT_header(Header): @@ -45,7 +46,7 @@ class INFO_HT_header(Header): sub.menu("INFO_MT_help") if window.screen.show_fullscreen: - layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous") + layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text=_("Back to Previous")) layout.separator() else: layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete") @@ -73,11 +74,11 @@ class INFO_HT_header(Header): """ sinfo = context.space_data row = layout.row(align=True) - row.prop(sinfo, "show_report_debug", text="Debug") - row.prop(sinfo, "show_report_info", text="Info") - row.prop(sinfo, "show_report_operator", text="Operators") - row.prop(sinfo, "show_report_warning", text="Warnings") - row.prop(sinfo, "show_report_error", text="Errors") + row.prop(sinfo, "show_report_debug", text=_("Debug")) + row.prop(sinfo, "show_report_info", text=_("Info")) + row.prop(sinfo, "show_report_operator", text=_("Operators")) + row.prop(sinfo, "show_report_warning", text=_("Warnings")) + row.prop(sinfo, "show_report_error", text=_("Errors")) row = layout.row() row.enabled = sinfo.show_report_operator @@ -106,25 +107,25 @@ class INFO_MT_file(Menu): layout = self.layout layout.operator_context = 'EXEC_AREA' - layout.operator("wm.read_homefile", text="New", icon='NEW') + layout.operator("wm.read_homefile", text=_("New"), icon='NEW') layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') + layout.operator("wm.open_mainfile", text=_("Open..."), icon='FILE_FOLDER') layout.menu("INFO_MT_file_open_recent") layout.operator("wm.recover_last_session", icon='RECOVER_LAST') - layout.operator("wm.recover_auto_save", text="Recover Auto Save...") + layout.operator("wm.recover_auto_save", text=_("Recover Auto Save...")) layout.separator() layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False + layout.operator("wm.save_mainfile", text=_("Save"), icon='FILE_TICK').check_existing = False layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.save_as_mainfile", text="Save As...") + layout.operator("wm.save_as_mainfile", text=_("Save As...")) layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True + layout.operator("wm.save_as_mainfile", text=_("Save Copy...")).copy = True layout.separator() - layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES') + layout.operator("screen.userpref_show", text=_("User Preferences..."), icon='PREFERENCES') layout.operator_context = 'EXEC_AREA' layout.operator("wm.save_homefile") @@ -133,8 +134,8 @@ class INFO_MT_file(Menu): layout.separator() layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.link_append", text="Link") - props = layout.operator("wm.link_append", text="Append") + layout.operator("wm.link_append", text=_("Link")) + props = layout.operator("wm.link_append", text=_("Append")) props.link = False props.instance_groups = False @@ -150,7 +151,7 @@ class INFO_MT_file(Menu): layout.separator() layout.operator_context = 'EXEC_AREA' - layout.operator("wm.quit_blender", text="Quit", icon='QUIT') + layout.operator("wm.quit_blender", text=_("Quit"), icon='QUIT') class INFO_MT_file_import(Menu): @@ -177,8 +178,8 @@ class INFO_MT_file_external_data(Menu): def draw(self, context): layout = self.layout - layout.operator("file.pack_all", text="Pack into .blend file") - layout.operator("file.unpack_all", text="Unpack into Files") + layout.operator("file.pack_all", text=_("Pack into .blend file")) + layout.operator("file.unpack_all", text=_("Unpack into Files")) layout.separator() @@ -196,17 +197,17 @@ class INFO_MT_mesh_add(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane") - layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube") - layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text="Circle") - layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text="UV Sphere") - layout.operator("mesh.primitive_ico_sphere_add", icon='MESH_ICOSPHERE', text="Icosphere") - layout.operator("mesh.primitive_cylinder_add", icon='MESH_CYLINDER', text="Cylinder") - layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text="Cone") + layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text=_("Plane")) + layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text=_("Cube")) + layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text=_("Circle")) + layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text=_("UV Sphere")) + layout.operator("mesh.primitive_ico_sphere_add", icon='MESH_ICOSPHERE', text=_("Icosphere")) + layout.operator("mesh.primitive_cylinder_add", icon='MESH_CYLINDER', text=_("Cylinder")) + layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text=_("Cone")) layout.separator() - layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid") - layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey") - layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS') + layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text=_("Grid")) + layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text=_("Monkey")) + layout.operator("mesh.primitive_torus_add", text=_("Torus"), icon='MESH_TORUS') class INFO_MT_curve_add(Menu): @@ -217,11 +218,11 @@ class INFO_MT_curve_add(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier") - layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle") - layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text="Nurbs Curve") - layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle") - layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path") + layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text=_("Bezier")) + layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text=_("Circle")) + layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text=_("Nurbs Curve")) + layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text=_("Nurbs Circle")) + layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text=_("Path")) class INFO_MT_edit_curve_add(Menu): @@ -248,12 +249,12 @@ class INFO_MT_surface_add(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve") - layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle") - layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface") - layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text="NURBS Cylinder") - layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere") - layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus") + layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text=_("NURBS Curve")) + layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text=_("NURBS Circle")) + layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text=_("NURBS Surface")) + layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text=_("NURBS Cylinder")) + layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text=_("NURBS Sphere")) + layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text=_("NURBS Torus")) class INFO_MT_armature_add(Menu): @@ -264,7 +265,7 @@ class INFO_MT_armature_add(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA') + layout.operator("object.armature_add", text=_("Single Bone"), icon='BONE_DATA') class INFO_MT_add(Menu): @@ -275,39 +276,39 @@ class INFO_MT_add(Menu): layout.operator_context = 'EXEC_SCREEN' - #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH') + #layout.operator_menu_enum("object.mesh_add", "type", text=_("Mesh"), icon='OUTLINER_OB_MESH') layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH') - #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE') + #layout.operator_menu_enum("object.curve_add", "type", text=_("Curve"), icon='OUTLINER_OB_CURVE') layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE') - #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE') + #layout.operator_menu_enum("object.surface_add", "type", text=_("Surface"), icon='OUTLINER_OB_SURFACE') layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE') - layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META') + layout.operator_menu_enum("object.metaball_add", "type", text=_("Metaball"), icon='OUTLINER_OB_META') layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT') + layout.operator("object.text_add", text=_("Text"), icon='OUTLINER_OB_FONT') layout.separator() layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE') - layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE' - layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY' + layout.operator("object.add", text=_("Lattice"), icon='OUTLINER_OB_LATTICE').type = 'LATTICE' + layout.operator("object.add", text=_("Empty"), icon='OUTLINER_OB_EMPTY').type = 'EMPTY' layout.separator() - layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER') + layout.operator("object.speaker_add", text=_("Speaker"), icon='OUTLINER_OB_SPEAKER') layout.separator() - layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA') + layout.operator("object.camera_add", text=_("Camera"), icon='OUTLINER_OB_CAMERA') layout.operator_context = 'EXEC_SCREEN' - layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP') + layout.operator_menu_enum("object.lamp_add", "type", text=_("Lamp"), icon='OUTLINER_OB_LAMP') layout.separator() - layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY') + layout.operator_menu_enum("object.effector_add", "type", text=_("Force Field"), icon='OUTLINER_OB_EMPTY') layout.separator() if(len(bpy.data.groups) > 10): layout.operator_context = 'INVOKE_DEFAULT' - layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY') + layout.operator("object.group_instance_add", text=_("Group Instance..."), icon='OUTLINER_OB_EMPTY') else: - layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY') + layout.operator_menu_enum("object.group_instance_add", "group", text=_("Group Instance"), icon='OUTLINER_OB_EMPTY') class INFO_MT_game(Menu): @@ -337,13 +338,13 @@ class INFO_MT_render(Menu): def draw(self, context): layout = self.layout - layout.operator("render.render", text="Render Image", icon='RENDER_STILL') - layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True + layout.operator("render.render", text=_("Render Image"), icon='RENDER_STILL') + layout.operator("render.render", text=_("Render Animation"), icon='RENDER_ANIMATION').animation = True layout.separator() - layout.operator("render.opengl", text="OpenGL Render Image") - layout.operator("render.opengl", text="OpenGL Render Animation").animation = True + layout.operator("render.opengl", text=_("OpenGL Render Image")) + layout.operator("render.opengl", text=_("OpenGL Render Animation")).animation = True layout.separator() @@ -359,27 +360,28 @@ 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-259/' + 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-259/' layout.separator() - layout.operator("wm.url_open", text="Blender Website", icon='URL').url = 'http://www.blender.org/' - layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = 'http://www.blender.org/e-shop' - layout.operator("wm.url_open", text="Developer Community", icon='URL').url = 'http://www.blender.org/community/get-involved/' - layout.operator("wm.url_open", text="User Community", icon='URL').url = 'http://www.blender.org/community/user-community/' + layout.operator("wm.url_open", text=_("Blender Website"), icon='URL').url = 'http://www.blender.org/' + layout.operator("wm.url_open", text=_("Blender e-Shop"), icon='URL').url = 'http://www.blender.org/e-shop' + layout.operator("wm.url_open", text=_("Developer Community"), icon='URL').url = 'http://www.blender.org/community/get-involved/' + layout.operator("wm.url_open", text=_("User Community"), icon='URL').url = 'http://www.blender.org/community/user-community/' layout.separator() - layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse' + layout.operator("wm.url_open", text=_("Report a Bug"), icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse' layout.separator() - layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = bpy.types.WM_OT_doc_view._prefix + layout.operator("wm.url_open", text=_("Python API Reference"), icon='URL').url = bpy.types.WM_OT_doc_view._prefix layout.operator("help.operator_cheat_sheet", icon='TEXT') layout.operator("wm.sysinfo", icon='TEXT') layout.separator() if sys.platform[:3] == "win": layout.operator("wm.console_toggle", icon='CONSOLE') layout.separator() - layout.operator("anim.update_data_paths", text="FCurve/Driver Version fix", icon='HELP') + layout.operator("anim.update_data_paths", text=_("FCurve/Driver Version fix"), icon='HELP') + layout.operator("logic.texface_convert", text="TexFace to Material Convert", icon='GAME') layout.separator() layout.operator("wm.splash", icon='BLENDER') diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 869a91124d3..b1149913d17 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from blf import gettext as _ class LOGIC_PT_properties(Panel): @@ -37,7 +38,7 @@ class LOGIC_PT_properties(Panel): ob = context.active_object game = ob.game - layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN') + layout.operator("object.game_property_new", text=_("Add Game Property"), icon='ZOOMIN') for i, prop in enumerate(game.properties): @@ -56,9 +57,9 @@ class LOGIC_MT_logicbricks_add(Menu): def draw(self, context): layout = self.layout - layout.operator_menu_enum("logic.sensor_add", "type", text="Sensor") - layout.operator_menu_enum("logic.controller_add", "type", text="Controller") - layout.operator_menu_enum("logic.actuator_add", "type", text="Actuator") + layout.operator_menu_enum("logic.sensor_add", "type", text=_("Sensor")) + layout.operator_menu_enum("logic.controller_add", "type", text=_("Controller")) + layout.operator_menu_enum("logic.actuator_add", "type", text=_("Actuator")) class LOGIC_HT_header(Header): diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index ffead81c507..8a4b0a61291 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Header, Menu +from blf import gettext as _ class NLA_HT_header(Header): @@ -62,7 +63,7 @@ class NLA_MT_view(Menu): layout.prop(st, "use_realtime_update") layout.prop(st, "show_frame_indicator") - layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds") + layout.operator("anim.time_toggle", text=_("Show Frames") if st.show_seconds else _("Show Seconds")) layout.prop(st, "show_strip_curves") @@ -87,33 +88,33 @@ class NLA_MT_select(Menu): # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None layout.operator("nla.select_all_toggle") - layout.operator("nla.select_all_toggle", text="Invert Selection").invert = True + layout.operator("nla.select_all_toggle", text=_("Invert Selection")).invert = True layout.separator() layout.operator("nla.select_border") - layout.operator("nla.select_border", text="Border Axis Range").axis_range = True + layout.operator("nla.select_border", text=_("Border Axis Range")).axis_range = True layout.separator() - layout.operator("nla.select_leftright", text="Before Current Frame").mode = 'LEFT' - layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT' + layout.operator("nla.select_leftright", text=_("Before Current Frame")).mode = 'LEFT' + layout.operator("nla.select_leftright", text=_("After Current Frame")).mode = 'RIGHT' class NLA_MT_marker(Menu): - bl_label = "Marker" + bl_label = _("Marker") def draw(self, context): layout = self.layout #layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + layout.operator("marker.add", _("Add Marker")) + layout.operator("marker.duplicate", text=_("Duplicate Marker")) + layout.operator("marker.delete", text=_("Delete Marker")) layout.separator() - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + layout.operator("marker.rename", text=_("Rename Marker")) + layout.operator("marker.move", text=_("Grab/Move Marker")) class NLA_MT_edit(Menu): @@ -124,9 +125,9 @@ class NLA_MT_edit(Menu): scene = context.scene - layout.menu("NLA_MT_edit_transform", text="Transform") + layout.menu("NLA_MT_edit_transform", text=_("Transform")) - layout.operator_menu_enum("nla.snap", "type", text="Snap") + layout.operator_menu_enum("nla.snap", "type", text=_("Snap")) layout.separator() layout.operator("nla.duplicate") @@ -148,14 +149,14 @@ class NLA_MT_edit(Menu): # TODO: this really belongs more in a "channel" (or better, "track") menu layout.separator() - layout.operator_menu_enum("anim.channels_move", "direction", text="Track Ordering...") + layout.operator_menu_enum("anim.channels_move", "direction", text=_("Track Ordering...")) layout.separator() # TODO: names of these tools for 'tweakmode' need changing? if scene.is_nla_tweakmode: - layout.operator("nla.tweakmode_exit", text="Stop Tweaking Strip Actions") + layout.operator("nla.tweakmode_exit", text=_("Stop Tweaking Strip Actions")) else: - layout.operator("nla.tweakmode_enter", text="Start Tweaking Strip Actions") + layout.operator("nla.tweakmode_enter", text=_("Start Tweaking Strip Actions")) class NLA_MT_add(Menu): @@ -174,7 +175,7 @@ class NLA_MT_add(Menu): layout.separator() layout.operator("nla.tracks_add") - layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True + layout.operator("nla.tracks_add", text=_("Add Tracks Above Selected")).above_selected = True class NLA_MT_edit_transform(Menu): @@ -183,9 +184,9 @@ class NLA_MT_edit_transform(Menu): def draw(self, context): layout = self.layout - layout.operator("transform.translate", text="Grab/Move") - layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND' - layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' + layout.operator("transform.translate", text=_("Grab/Move")) + layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND' + layout.operator("transform.transform", text=_("Scale")).mode = 'TIME_SCALE' if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 708017ba749..0808ddf769a 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from blf import gettext as _ class NODE_HT_header(Header): @@ -61,7 +62,7 @@ class NODE_HT_header(Header): elif snode.tree_type == 'COMPOSITING': layout.prop(snode_id, "use_nodes") - layout.prop(snode_id.render, "use_free_unused_nodes", text="Free Unused") + layout.prop(snode_id.render, "use_free_unused_nodes", text=_("Free Unused")) layout.prop(snode, "show_backdrop") if snode.show_backdrop: row = layout.row(align=True) @@ -92,9 +93,9 @@ class NODE_MT_view(Menu): if context.space_data.show_backdrop: layout.separator() - layout.operator("node.backimage_move", text="Backdrop move") - layout.operator("node.backimage_zoom", text="Backdrop zoom in").factor = 1.2 - layout.operator("node.backimage_zoom", text="Backdrop zoom out").factor = 0.833 + layout.operator("node.backimage_move", text=_("Backdrop move")) + layout.operator("node.backimage_zoom", text=_("Backdrop zoom in")).factor = 1.2 + layout.operator("node.backimage_zoom", text=_("Backdrop zoom out")).factor = 0.833 layout.separator() @@ -137,7 +138,7 @@ class NODE_MT_node(Menu): layout.separator() layout.operator("node.link_make") - layout.operator("node.link_make", text="Make and Replace Links").replace = True + layout.operator("node.link_make", text=_("Make and Replace Links")).replace = True layout.operator("node.links_cut") layout.separator() @@ -180,13 +181,13 @@ class NODE_PT_properties(Panel): snode = context.space_data layout.active = snode.show_backdrop layout.prop(snode, "backdrop_channels", text="") - layout.prop(snode, "backdrop_zoom", text="Zoom") + layout.prop(snode, "backdrop_zoom", text=_("Zoom")) col = layout.column(align=True) - col.label(text="Offset:") + col.label(text=_("Offset:")) col.prop(snode, "backdrop_x", text="X") col.prop(snode, "backdrop_y", text="Y") - col.operator("node.backimage_move", text="Move") + col.operator("node.backimage_move", text=_("Move")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 36f606da635..65aac4ae62f 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from blf import gettext as _ def act_strip(context): @@ -64,9 +65,9 @@ class SEQUENCER_HT_header(Header): elif st.view_type == 'SEQUENCER_PREVIEW': layout.separator() layout.operator("sequencer.refresh_all") - layout.prop(st, "display_channel", text="Channel") + layout.prop(st, "display_channel", text=_("Channel")) else: - layout.prop(st, "display_channel", text="Channel") + layout.prop(st, "display_channel", text=_("Channel")) ed = context.scene.sequence_editor if ed: @@ -101,11 +102,11 @@ class SEQUENCER_MT_view(Menu): layout.separator() if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: - layout.operator("sequencer.view_all", text='View all Sequences') + layout.operator("sequencer.view_all", text=_('View all Sequences')) if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: layout.operator_context = 'INVOKE_REGION_PREVIEW' - layout.operator("sequencer.view_all_preview", text='Fit preview in window') - layout.operator("sequencer.view_zoom_ratio", text='Show preview 1:1').ratio = 1.0 + layout.operator("sequencer.view_all_preview", text=_('Fit preview in window')) + layout.operator("sequencer.view_zoom_ratio", text=_('Show preview 1:1')).ratio = 1.0 layout.operator_context = 'INVOKE_DEFAULT' # # XXX, invokes in the header view @@ -114,9 +115,9 @@ class SEQUENCER_MT_view(Menu): layout.operator("sequencer.view_selected") if st.show_frames: - layout.operator("anim.time_toggle", text="Show Seconds") + layout.operator("anim.time_toggle", text=_("Show Seconds")) else: - layout.operator("anim.time_toggle", text="Show Frames") + layout.operator("anim.time_toggle", text=_("Show Frames")) layout.prop(st, "show_frame_indicator") if st.display_mode == 'IMAGE': @@ -138,12 +139,12 @@ class SEQUENCER_MT_select(Menu): def draw(self, context): layout = self.layout - layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT' - layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT' + layout.operator("sequencer.select_active_side", text=_("Strips to the Left")).side = 'LEFT' + layout.operator("sequencer.select_active_side", text=_("Strips to the Right")).side = 'RIGHT' layout.separator() - layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH' - layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT' - layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT' + layout.operator("sequencer.select_handles", text=_("Surrounding Handles")).side = 'BOTH' + layout.operator("sequencer.select_handles", text=_("Left Handle")).side = 'LEFT' + layout.operator("sequencer.select_handles", text=_("Right Handle")).side = 'RIGHT' layout.separator() layout.operator("sequencer.select_linked") layout.operator("sequencer.select_all_toggle") @@ -158,14 +159,14 @@ class SEQUENCER_MT_marker(Menu): #layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + layout.operator("marker.add", _("Add Marker")) + layout.operator("marker.duplicate", text=_("Duplicate Marker")) + layout.operator("marker.delete", text=_("Delete Marker")) layout.separator() - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + layout.operator("marker.rename", text=_("Rename Marker")) + layout.operator("marker.move", text=_("Grab/Move Marker")) #layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS) @@ -180,7 +181,7 @@ class SEQUENCER_MT_change(Menu): layout.operator_menu_enum("sequencer.change_effect_input", "swap") layout.operator_menu_enum("sequencer.change_effect_type", "type") - layout.operator("sequencer.change_path", text="Path/Files") + layout.operator("sequencer.change_path", text=_("Path/Files")) class SEQUENCER_MT_add(Menu): @@ -192,13 +193,13 @@ class SEQUENCER_MT_add(Menu): if len(bpy.data.scenes) > 10: layout.operator_context = 'INVOKE_DEFAULT' - layout.operator("sequencer.scene_strip_add", text="Scene...") + layout.operator("sequencer.scene_strip_add", text=_("Scene...")) else: - layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...") + layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text=_("Scene...")) - layout.operator("sequencer.movie_strip_add", text="Movie") - layout.operator("sequencer.image_strip_add", text="Image") - layout.operator("sequencer.sound_strip_add", text="Sound") + layout.operator("sequencer.movie_strip_add", text=_("Movie")) + layout.operator("sequencer.image_strip_add", text=_("Image")) + layout.operator("sequencer.sound_strip_add", text=_("Sound")) layout.menu("SEQUENCER_MT_add_effect") @@ -210,22 +211,22 @@ class SEQUENCER_MT_add_effect(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD' - layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT' - layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER' - layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER' - layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS' - layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS' - layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY' - layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP' - layout.operator("sequencer.effect_strip_add", text="Plugin").type = 'PLUGIN' - layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE' - layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW' - layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM' - layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR' - layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED' - layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM' - layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT' + layout.operator("sequencer.effect_strip_add", text=_("Add")).type = 'ADD' + layout.operator("sequencer.effect_strip_add", text=_("Subtract")).type = 'SUBTRACT' + layout.operator("sequencer.effect_strip_add", text=_("Alpha Over")).type = 'ALPHA_OVER' + layout.operator("sequencer.effect_strip_add", text=_("Alpha Under")).type = 'ALPHA_UNDER' + layout.operator("sequencer.effect_strip_add", text=_("Cross")).type = 'CROSS' + layout.operator("sequencer.effect_strip_add", text=_("Gamma Cross")).type = 'GAMMA_CROSS' + layout.operator("sequencer.effect_strip_add", text=_("Multiply")).type = 'MULTIPLY' + layout.operator("sequencer.effect_strip_add", text=_("Over Drop")).type = 'OVER_DROP' + layout.operator("sequencer.effect_strip_add", text=_("Plugin")).type = 'PLUGIN' + layout.operator("sequencer.effect_strip_add", text=_("Wipe")).type = 'WIPE' + layout.operator("sequencer.effect_strip_add", text=_("Glow")).type = 'GLOW' + layout.operator("sequencer.effect_strip_add", text=_("Transform")).type = 'TRANSFORM' + layout.operator("sequencer.effect_strip_add", text=_("Color")).type = 'COLOR' + layout.operator("sequencer.effect_strip_add", text=_("Speed Control")).type = 'SPEED' + layout.operator("sequencer.effect_strip_add", text=_("Multicam Selector")).type = 'MULTICAM' + layout.operator("sequencer.effect_strip_add", text=_("Adjustment Layer")).type = 'ADJUSTMENT' class SEQUENCER_MT_strip(Menu): @@ -236,13 +237,13 @@ class SEQUENCER_MT_strip(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION' - layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND' + layout.operator("transform.transform", text=_("Grab/Move")).mode = 'TRANSLATION' + layout.operator("transform.transform", text=_("Grab/Extend from frame")).mode = 'TIME_EXTEND' # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator layout.separator() - layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD' - layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT' + layout.operator("sequencer.cut", text=_("Cut (hard) at frame")).type = 'HARD' + layout.operator("sequencer.cut", text=_("Cut (soft) at frame")).type = 'SOFT' layout.operator("sequencer.images_separate") layout.operator("sequencer.offset_clear") layout.operator("sequencer.deinterlace_selected_movies") @@ -296,7 +297,7 @@ class SEQUENCER_MT_strip(Menu): layout.operator("sequencer.mute") layout.operator("sequencer.unmute") - layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True + layout.operator("sequencer.mute", text=_("Mute Deselected Strips")).unselected = True layout.operator("sequencer.snap") @@ -344,21 +345,21 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel): strip = act_strip(context) split = layout.split(percentage=0.3) - split.label(text="Name:") + split.label(text=_("Name:")) split.prop(strip, "name", text="") split = layout.split(percentage=0.3) - split.label(text="Type:") + split.label(text=_("Type:")) split.prop(strip, "type", text="") split = layout.split(percentage=0.3) - split.label(text="Blend:") + split.label(text=_("Blend:")) split.prop(strip, "blend_type", text="") row = layout.row(align=True) sub = row.row() sub.active = (not strip.mute) - sub.prop(strip, "blend_alpha", text="Opacity", slider=True) + sub.prop(strip, "blend_alpha", text=_("Opacity"), slider=True) row.prop(strip, "mute", toggle=True, icon='RESTRICT_VIEW_ON' if strip.mute else 'RESTRICT_VIEW_OFF', text="") row.prop(strip, "lock", toggle=True, icon='LOCKED' if strip.lock else 'UNLOCKED', text="") @@ -371,13 +372,13 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel): col = layout.column(align=True) row = col.row() - row.label(text="Final Length: %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration)) + row.label(text=_("Final Length") + ": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration)) row = col.row() row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration) - row.label(text="Playhead: %d" % (frame_current - strip.frame_start)) + row.label(text=_("Playhead") + ": %d" % (frame_current - strip.frame_start)) - col.label(text="Frame Offset %d:%d" % (strip.frame_offset_start, strip.frame_offset_end)) - col.label(text="Frame Still %d:%d" % (strip.frame_still_start, strip.frame_still_end)) + col.label(text=_("Frame Offset") + " %d:%d" % (strip.frame_offset_start, strip.frame_offset_end)) + col.label(text=_("Frame Still") + " %d:%d" % (strip.frame_still_start, strip.frame_still_end)) elem = False @@ -387,9 +388,9 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel): elem = strip.elements[0] if elem and elem.orig_width > 0 and elem.orig_height > 0: - col.label(text="Orig Dim: %dx%d" % (elem.orig_width, elem.orig_height)) + col.label(text=_("Orig Dim") + ": %dx%d" % (elem.orig_width, elem.orig_height)) else: - col.label(text="Orig Dim: None") + col.label(text=_("Orig Dim: None")) class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): @@ -429,7 +430,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): col = layout.column() col.prop(strip, "transition_type") - col.label(text="Direction:") + col.label(text=_("Direction:")) col.row().prop(strip, "direction", expand=True) col = layout.column() @@ -449,13 +450,13 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): row.prop(strip, "use_only_boost") elif strip.type == 'SPEED': - layout.prop(strip, "use_default_fade", "Stretch to input strip length") + layout.prop(strip, "use_default_fade", _("Stretch to input strip length")) if not strip.use_default_fade: layout.prop(strip, "use_as_speed") if strip.use_as_speed: layout.prop(strip, "speed_factor") else: - layout.prop(strip, "speed_factor", text="Frame number") + layout.prop(strip, "speed_factor", text=_("Frame number")) layout.prop(strip, "scale_to_length") #doesn't work currently @@ -473,7 +474,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY') - row.label("Cut To") + row.label(_("Cut To")) for i in range(1, strip.channel): row.operator("sequencer.cut_multicam", text=str(i)).camera = i @@ -481,17 +482,17 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): if strip.type == 'SPEED': col.prop(strip, "multiply_speed") elif strip.type in {'CROSS', 'GAMMA_CROSS', 'PLUGIN', 'WIPE'}: - col.prop(strip, "use_default_fade", "Default fade") + col.prop(strip, "use_default_fade", _("Default fade")) if not strip.use_default_fade: - col.prop(strip, "effect_fader", text="Effect fader") + col.prop(strip, "effect_fader", text=_("Effect fader")) - layout.prop(strip, "use_translation", text="Image Offset:") + layout.prop(strip, "use_translation", text=_("Image Offset:")) if strip.use_translation: col = layout.column(align=True) col.prop(strip.transform, "offset_x", text="X") col.prop(strip.transform, "offset_y", text="Y") - layout.prop(strip, "use_crop", text="Image Crop:") + layout.prop(strip, "use_crop", text=_("Image Crop:")) if strip.use_crop: col = layout.column(align=True) col.prop(strip.crop, "max_y") @@ -506,7 +507,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): col.prop(strip, "interpolation") col.prop(strip, "translation_unit") col = layout.column(align=True) - col.label(text="Position:") + col.label(text=_("Position:")) col.prop(strip, "translate_start_x", text="X") col.prop(strip, "translate_start_y", text="Y") @@ -516,18 +517,18 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): col.prop(strip, "use_uniform_scale") if (strip.use_uniform_scale): col = layout.column(align=True) - col.prop(strip, "scale_start_x", text="Scale") + col.prop(strip, "scale_start_x", text=_("Scale")) else: col = layout.column(align=True) - col.label(text="Scale:") + col.label(text=_("Scale:")) col.prop(strip, "scale_start_x", text="X") col.prop(strip, "scale_start_y", text="Y") layout.separator() col = layout.column(align=True) - col.label(text="Rotation:") - col.prop(strip, "rotation_start", text="Rotation") + col.label(text=_("Rotation:")) + col.prop(strip, "rotation_start", text=_("Rotation")) class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): @@ -560,7 +561,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): if seq_type == 'IMAGE': split = layout.split(percentage=0.2) col = split.column() - col.label(text="Path:") + col.label(text=_("Path:")) col = split.column() col.prop(strip, "directory", text="") @@ -570,7 +571,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): if elem: split = layout.split(percentage=0.2) col = split.column() - col.label(text="File:") + col.label(text=_("File:")) col = split.column() col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback @@ -580,22 +581,22 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): elif seq_type == 'MOVIE': split = layout.split(percentage=0.2) col = split.column() - col.label(text="Path:") + col.label(text=_("Path:")) col = split.column() col.prop(strip, "filepath", text="") - col.prop(strip, "mpeg_preseek", text="MPEG Preseek") - col.prop(strip, "streamindex", text="Stream Index") + col.prop(strip, "mpeg_preseek", text=_("MPEG Preseek")) + col.prop(strip, "streamindex", text=_("Stream Index")) # TODO, sound??? # end drawing filename - layout.prop(strip, "use_translation", text="Image Offset:") + layout.prop(strip, "use_translation", text=_("Image Offset:")) if strip.use_translation: col = layout.column(align=True) col.prop(strip.transform, "offset_x", text="X") col.prop(strip.transform, "offset_y", text="Y") - layout.prop(strip, "use_crop", text="Image Crop:") + layout.prop(strip, "use_crop", text=_("Image Crop:")) if strip.use_crop: col = layout.column(align=True) col.prop(strip.crop, "max_y") @@ -605,14 +606,14 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): if not isinstance(strip, bpy.types.EffectSequence): col = layout.column(align=True) - col.label(text="Trim Duration (hard):") - col.prop(strip, "animation_offset_start", text="Start") - col.prop(strip, "animation_offset_end", text="End") + col.label(text=_("Trim Duration (hard):")) + col.prop(strip, "animation_offset_start", text=_("Start")) + col.prop(strip, "animation_offset_end", text=_("End")) col = layout.column(align=True) - col.label(text="Trim Duration (soft):") - col.prop(strip, "frame_offset_start", text="Start") - col.prop(strip, "frame_offset_end", text="End") + col.label(text=_("Trim Duration (soft):")) + col.prop(strip, "frame_offset_start", text=_("Start")) + col.prop(strip, "frame_offset_end", text=_("End")) class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): @@ -641,9 +642,9 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): row = layout.row() if strip.sound.packed_file: - row.operator("sound.unpack", icon='PACKAGE', text="Unpack") + row.operator("sound.unpack", icon='PACKAGE', text=_("Unpack")) else: - row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack") + row.operator("sound.pack", icon='UGLYPACKAGE', text=_("Pack")) row.prop(strip.sound, "use_memory_cache") @@ -654,8 +655,8 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): col = layout.column(align=True) col.label(text="Trim Duration:") - col.prop(strip, "animation_offset_start", text="Start") - col.prop(strip, "animation_offset_end", text="End") + col.prop(strip, "animation_offset_start", text=_("Start")) + col.prop(strip, "animation_offset_end", text=_("End")) class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel): @@ -683,13 +684,13 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel): if scene: layout.prop(scene.render, "use_sequencer") - layout.label(text="Camera Override") + layout.label(text=_("Camera Override")) layout.template_ID(strip, "scene_camera") if scene: sta = scene.frame_start end = scene.frame_end - layout.label(text="Original frame range: %d-%d (%d)" % (sta, end, end - sta + 1)) + layout.label(text=_("Original frame range") + ": %d-%d (%d)" % (sta, end, end - sta + 1)) class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel): @@ -717,22 +718,22 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel): strip = act_strip(context) col = layout.column() - col.label(text="Video:") + col.label(text=_("Video:")) col.prop(strip, "strobe") row = layout.row() - row.label(text="Flip:") + row.label(text=_("Flip:")) row.prop(strip, "use_flip_x", text="X") row.prop(strip, "use_flip_y", text="Y") col = layout.column() - col.prop(strip, "use_reverse_frames", text="Backwards") + col.prop(strip, "use_reverse_frames", text=_("Backwards")) col.prop(strip, "use_deinterlace") col = layout.column() - col.label(text="Colors:") - col.prop(strip, "color_saturation", text="Saturation") - col.prop(strip, "color_multiply", text="Multiply") + col.label(text=_("Colors:")) + col.prop(strip, "color_saturation", text=_("Saturation")) + col.prop(strip, "color_multiply", text=_("Multiply")) col.prop(strip, "use_premultiply") col.prop(strip, "use_float") @@ -743,15 +744,15 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel): col = row.column() col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True) col.row().prop(strip.color_balance, "lift") - col.prop(strip.color_balance, "invert_lift", text="Inverse") + col.prop(strip.color_balance, "invert_lift", text=_("Inverse")) col = row.column() col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True) col.row().prop(strip.color_balance, "gamma") - col.prop(strip.color_balance, "invert_gamma", text="Inverse") + col.prop(strip.color_balance, "invert_gamma", text=_("Inverse")) col = row.column() col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True) col.row().prop(strip.color_balance, "gain") - col.prop(strip.color_balance, "invert_gain", text="Inverse") + col.prop(strip.color_balance, "invert_gain", text=_("Inverse")) class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel): @@ -794,18 +795,18 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel): row.prop(strip.proxy, "build_100") col = layout.column() - col.label(text="Build JPEG quality") + col.label(text=_("Build JPEG quality")) col.prop(strip.proxy, "quality") if strip.type == "MOVIE": col = layout.column() - col.label(text="Use timecode index:") + col.label(text=_("Use timecode index:")) col.prop(strip.proxy, "timecode") class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): - bl_label = "Scene Preview/Render" + bl_label = _("Scene Preview/Render") bl_space_type = 'SEQUENCE_EDITOR' bl_region_type = 'UI' @@ -815,7 +816,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): col = layout.column() col.active = False # Currently only opengl preview works! - col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview") + col.prop(render, "use_sequencer_gl_preview", text=_("Open GL Preview")) col = layout.column() #col.active = render.use_sequencer_gl_preview col.prop(render, "sequencer_gl_preview", text="") diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 12e07c19ca1..23e68487aae 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -19,6 +19,7 @@ # <pep8-80 compliant> import bpy from bpy.types import Header, Menu, Panel +from blf import gettext as _ class TEXT_HT_header(Header): @@ -66,13 +67,13 @@ class TEXT_HT_header(Header): row = layout.row() if text.filepath: if text.is_dirty: - row.label(text="File: *%r (unsaved)" % text.filepath) + row.label(text=_("File") + ": *%r " % text.filepath + _("(unsaved)")) else: - row.label(text="File: %r" % text.filepath) + row.label(text=_("File") + ": %r" % text.filepath) else: - row.label(text="Text: External" + row.label(text=_("Text: External") if text.library - else "Text: Internal") + else _("Text: Internal")) class TEXT_PT_properties(Panel): @@ -136,8 +137,8 @@ class TEXT_PT_find(Panel): # settings layout.prop(st, "use_match_case") row = layout.row() - row.prop(st, "use_find_wrap", text="Wrap") - row.prop(st, "use_find_all", text="All") + row.prop(st, "use_find_wrap", text=_("Wrap")) + row.prop(st, "use_find_all", text=_("All")) class TEXT_MT_view(Menu): @@ -156,10 +157,10 @@ class TEXT_MT_view(Menu): layout.separator() layout.operator("text.move", - text="Top of File", + text=_("Top of File"), ).type = 'FILE_TOP' layout.operator("text.move", - text="Bottom of File", + text=_("Bottom of File"), ).type = 'FILE_BOTTOM' @@ -248,10 +249,10 @@ class TEXT_MT_edit_to3d(Menu): layout = self.layout layout.operator("text.to_3d_object", - text="One Object", + text=_("One Object"), ).split_lines = False layout.operator("text.to_3d_object", - text="One Object Per Line", + text=_("One Object Per Line"), ).split_lines = True @@ -282,7 +283,7 @@ class TEXT_MT_edit(Menu): layout.separator() layout.operator("text.jump") - layout.operator("text.properties", text="Find...") + layout.operator("text.properties", text=_("Find...")) layout.separator() diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index db009fe43c2..d654c1e4d8b 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu +from blf import gettext as _ class TIME_HT_header(Header): @@ -43,11 +44,11 @@ class TIME_HT_header(Header): row = layout.row(align=True) if not scene.use_preview_range: - row.prop(scene, "frame_start", text="Start") - row.prop(scene, "frame_end", text="End") + row.prop(scene, "frame_start", text=_("Start")) + row.prop(scene, "frame_end", text=_("End")) else: - row.prop(scene, "frame_preview_start", text="Start") - row.prop(scene, "frame_preview_end", text="End") + row.prop(scene, "frame_preview_start", text=_("Start")) + row.prop(scene, "frame_preview_end", text=_("End")) layout.prop(scene, "frame_current", text="") @@ -142,14 +143,14 @@ class TIME_MT_frame(Menu): def draw(self, context): layout = self.layout - layout.operator("marker.add", text="Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + layout.operator("marker.add", text=_("Add Marker")) + layout.operator("marker.duplicate", text=_("Duplicate Marker")) + layout.operator("marker.delete", text=_("Delete Marker")) layout.separator() - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + layout.operator("marker.rename", text=_("Rename Marker")) + layout.operator("marker.move", text=_("Grab/Move Marker")) layout.separator() @@ -181,8 +182,8 @@ class TIME_MT_playback(Menu): layout.separator() - layout.prop(scene, "use_frame_drop", text="Frame Dropping") - layout.prop(scene, "use_audio_sync", text="AV-sync", icon='SPEAKER') + layout.prop(scene, "use_frame_drop", text=_("Frame Dropping")) + layout.prop(scene, "use_audio_sync", text=_("AV-sync"), icon='SPEAKER') layout.prop(scene, "use_audio") layout.prop(scene, "use_audio_scrub") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 67aca5eb4c1..a31d4791e72 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -23,6 +23,7 @@ import os import addon_utils from bpy.props import StringProperty, BoolProperty, EnumProperty +from blf import gettext as _ def ui_items_general(col, context): @@ -65,10 +66,10 @@ def opengl_lamp_buttons(column, lamp): col = split.column() col.active = lamp.use row = col.row() - row.label(text="Diffuse:") + row.label(text=_("Diffuse:")) row.prop(lamp, "diffuse_color", text="") row = col.row() - row.label(text="Specular:") + row.label(text=_("Specular:")) row.prop(lamp, "specular_color", text="") col = split.column() @@ -86,7 +87,7 @@ class USERPREF_HT_header(Header): userpref = context.user_preferences layout.operator_context = 'EXEC_AREA' - layout.operator("wm.save_homefile", text="Save As Default") + layout.operator("wm.save_homefile", text=_("Save As Default")) layout.operator_context = 'INVOKE_DEFAULT' @@ -127,7 +128,7 @@ class USERPREF_MT_appconfigs(Menu): preset_operator = "wm.appconfig_activate" def draw(self, context): - self.layout.operator("wm.appconfig_default", text="Blender (default)") + self.layout.operator("wm.appconfig_default", text=_("Blender (default)")) # now draw the presets Menu.draw_preset(self, context) @@ -142,12 +143,12 @@ class USERPREF_MT_splash(Menu): row = split.row() row.label("") row = split.row() - row.label("Interaction:") + row.label(_("Interaction:")) # XXX, no redraws # text = bpy.path.display_name(context.window_manager.keyconfigs.active.name) # if not text: # text = "Blender (default)" - row.menu("USERPREF_MT_appconfigs", text="Preset") + row.menu("USERPREF_MT_appconfigs", text=_("Preset")) class USERPREF_PT_interface(Panel): @@ -170,13 +171,13 @@ class USERPREF_PT_interface(Panel): row = layout.row() col = row.column() - col.label(text="Display:") + col.label(text=_("Display:")) col.prop(view, "show_tooltips") col.prop(view, "show_tooltips_python") - col.prop(view, "show_object_info", text="Object Info") + col.prop(view, "show_object_info", text=_("Object Info")) col.prop(view, "show_large_cursors") - col.prop(view, "show_view_name", text="View Name") - col.prop(view, "show_playback_fps", text="Playback FPS") + col.prop(view, "show_view_name", text=_("View Name")) + col.prop(view, "show_playback_fps", text=_("Playback FPS")) col.prop(view, "use_global_scene") col.prop(view, "object_origin_size") @@ -184,18 +185,18 @@ class USERPREF_PT_interface(Panel): col.separator() col.separator() - col.prop(view, "show_mini_axis", text="Display Mini Axis") + col.prop(view, "show_mini_axis", text=_("Display Mini Axis")) sub = col.column() sub.active = view.show_mini_axis - sub.prop(view, "mini_axis_size", text="Size") - sub.prop(view, "mini_axis_brightness", text="Brightness") + sub.prop(view, "mini_axis_size", text=_("Size")) + sub.prop(view, "mini_axis_brightness", text=_("Brightness")) col.separator() row.separator() row.separator() col = row.column() - col.label(text="View Manipulation:") + col.label(text=_("View Manipulation:")) col.prop(view, "use_mouse_auto_depth") col.prop(view, "use_zoom_to_mouse") col.prop(view, "use_rotate_around_active") @@ -211,8 +212,8 @@ class USERPREF_PT_interface(Panel): col.separator() col.separator() - col.label(text="2D Viewports:") - col.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing") + col.label(text=_("2D Viewports:")) + col.prop(view, "view2d_grid_spacing_min", text=_("Minimum Grid Spacing")) col.prop(view, "timecode_style") row.separator() @@ -228,19 +229,19 @@ class USERPREF_PT_interface(Panel): col.prop(view, "show_manipulator") sub = col.column() sub.active = view.show_manipulator - sub.prop(view, "manipulator_size", text="Size") - sub.prop(view, "manipulator_handle_size", text="Handle Size") - sub.prop(view, "manipulator_hotspot", text="Hotspot") + sub.prop(view, "manipulator_size", text=_("Size")) + sub.prop(view, "manipulator_handle_size", text=_("Handle Size")) + sub.prop(view, "manipulator_hotspot", text=_("Hotspot")) col.separator() col.separator() col.separator() - col.label(text="Menus:") + col.label(text=_("Menus:")) col.prop(view, "use_mouse_over_open") - col.label(text="Menu Open Delay:") - col.prop(view, "open_toplevel_delay", text="Top Level") - col.prop(view, "open_sublevel_delay", text="Sub Level") + col.label(text=_("Menu Open Delay:")) + col.prop(view, "open_toplevel_delay", text=_("Top Level")) + col.prop(view, "open_sublevel_delay", text=_("Sub Level")) col.separator() @@ -267,97 +268,97 @@ class USERPREF_PT_edit(Panel): row = layout.row() col = row.column() - col.label(text="Link Materials To:") + col.label(text=_("Link Materials To:")) col.prop(edit, "material_link", text="") col.separator() col.separator() col.separator() - col.label(text="New Objects:") + col.label(text=_("New Objects:")) col.prop(edit, "use_enter_edit_mode") - col.label(text="Align To:") + col.label(text=_("Align To:")) col.prop(edit, "object_align", text="") col.separator() col.separator() col.separator() - col.label(text="Undo:") + col.label(text=_("Undo:")) col.prop(edit, "use_global_undo") - col.prop(edit, "undo_steps", text="Steps") - col.prop(edit, "undo_memory_limit", text="Memory Limit") + col.prop(edit, "undo_steps", text=_("Steps")) + col.prop(edit, "undo_memory_limit", text=_("Memory Limit")) row.separator() row.separator() col = row.column() - col.label(text="Grease Pencil:") - col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") - col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") + col.label(text=_("Grease Pencil:")) + col.prop(edit, "grease_pencil_manhattan_distance", text=_("Manhattan Distance")) + col.prop(edit, "grease_pencil_euclidean_distance", text=_("Euclidean Distance")) #col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") - col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") - col.prop(edit, "use_grease_pencil_smooth_stroke", text="Smooth Stroke") + col.prop(edit, "grease_pencil_eraser_radius", text=_("Eraser Radius")) + col.prop(edit, "use_grease_pencil_smooth_stroke", text=_("Smooth Stroke")) col.separator() col.separator() col.separator() - col.label(text="Playback:") + col.label(text=_("Playback:")) col.prop(edit, "use_negative_frames") row.separator() row.separator() col = row.column() - col.label(text="Keyframing:") + col.label(text=_("Keyframing:")) col.prop(edit, "use_visual_keying") - col.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed") + col.prop(edit, "use_keyframe_insert_needed", text=_("Only Insert Needed")) col.separator() - col.prop(edit, "use_auto_keying", text="Auto Keyframing:") + col.prop(edit, "use_auto_keying", text=_("Auto Keyframing:")) sub = col.column() # sub.active = edit.use_keyframe_insert_auto # incorrect, timeline can enable - sub.prop(edit, "use_keyframe_insert_available", text="Only Insert Available") + sub.prop(edit, "use_keyframe_insert_available", text=_("Only Insert Available")) col.separator() - col.label(text="New F-Curve Defaults:") - col.prop(edit, "keyframe_new_interpolation_type", text="Interpolation") - col.prop(edit, "keyframe_new_handle_type", text="Handles") - col.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") + col.label(text=_("New F-Curve Defaults:")) + col.prop(edit, "keyframe_new_interpolation_type", text=_("Interpolation")) + col.prop(edit, "keyframe_new_handle_type", text=_("Handles")) + col.prop(edit, "use_insertkey_xyz_to_rgb", text=_("XYZ to RGB")) col.separator() col.separator() col.separator() - col.label(text="Transform:") + col.label(text=_("Transform:")) col.prop(edit, "use_drag_immediately") row.separator() row.separator() col = row.column() - col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color") + col.prop(edit, "sculpt_paint_overlay_color", text=_("Sculpt Overlay Color")) col.separator() col.separator() col.separator() - col.label(text="Duplicate Data:") - col.prop(edit, "use_duplicate_mesh", text="Mesh") - col.prop(edit, "use_duplicate_surface", text="Surface") - col.prop(edit, "use_duplicate_curve", text="Curve") - col.prop(edit, "use_duplicate_text", text="Text") - col.prop(edit, "use_duplicate_metaball", text="Metaball") - col.prop(edit, "use_duplicate_armature", text="Armature") - col.prop(edit, "use_duplicate_lamp", text="Lamp") - col.prop(edit, "use_duplicate_material", text="Material") - col.prop(edit, "use_duplicate_texture", text="Texture") - #col.prop(edit, "use_duplicate_fcurve", text="F-Curve") - col.prop(edit, "use_duplicate_action", text="Action") - col.prop(edit, "use_duplicate_particle", text="Particle") + col.label(text=_("Duplicate Data:")) + col.prop(edit, "use_duplicate_mesh", text=_("Mesh")) + col.prop(edit, "use_duplicate_surface", text=_("Surface")) + col.prop(edit, "use_duplicate_curve", text=_("Curve")) + col.prop(edit, "use_duplicate_text", text=_("Text")) + col.prop(edit, "use_duplicate_metaball", text=_("Metaball")) + col.prop(edit, "use_duplicate_armature", text=_("Armature")) + col.prop(edit, "use_duplicate_lamp", text=_("Lamp")) + col.prop(edit, "use_duplicate_material", text=_("Material")) + col.prop(edit, "use_duplicate_texture", text=_("Texture")) + #col.prop(edit, "use_duplicate_fcurve", text=_("F-Curve")) + col.prop(edit, "use_duplicate_action", text=_("Action")) + col.prop(edit, "use_duplicate_particle", text=_("Particle")) class USERPREF_PT_system(Panel): @@ -384,11 +385,11 @@ class USERPREF_PT_system(Panel): colsplit = column.split(percentage=0.85) col = colsplit.column() - col.label(text="General:") + col.label(text=_("General:")) col.prop(system, "dpi") col.prop(system, "frame_server_port") - col.prop(system, "scrollback", text="Console Scrollback") - col.prop(system, "author", text="Author") + col.prop(system, "scrollback", text=_("Console Scrollback")) + col.prop(system, "author", text=_("Author")) col.prop(system, "use_scripts_auto_execute") col.prop(system, "use_tabs_as_spaces") @@ -396,80 +397,66 @@ class USERPREF_PT_system(Panel): col.separator() col.separator() - col.label(text="Sound:") + col.label(text=_("Sound:")) col.row().prop(system, "audio_device", expand=True) sub = col.column() sub.active = system.audio_device != 'NONE' #sub.prop(system, "use_preview_images") - sub.prop(system, "audio_channels", text="Channels") - sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer") - sub.prop(system, "audio_sample_rate", text="Sample Rate") - sub.prop(system, "audio_sample_format", text="Sample Format") + sub.prop(system, "audio_channels", text=_("Channels")) + sub.prop(system, "audio_mixing_buffer", text=_("Mixing Buffer")) + sub.prop(system, "audio_sample_rate", text=_("Sample Rate")) + sub.prop(system, "audio_sample_format", text=_("Sample Format")) col.separator() col.separator() col.separator() - col.label(text="Screencast:") + col.label(text=_("Screencast:")) col.prop(system, "screencast_fps") col.prop(system, "screencast_wait_time") col.separator() col.separator() col.separator() - #column = split.column() - #colsplit = column.split(percentage=0.85) - - # No translation in 2.5 yet - #col.prop(system, "language") - #col.label(text="Translate:") - #col.prop(system, "use_translate_tooltips", text="Tooltips") - #col.prop(system, "use_translate_buttons", text="Labels") - #col.prop(system, "use_translate_toolbox", text="Toolbox") - - #col.separator() - - #col.prop(system, "use_textured_fonts") - # 2. Column column = split.column() colsplit = column.split(percentage=0.85) col = colsplit.column() - col.label(text="OpenGL:") + col.label(text=_("OpenGL:")) col.prop(system, "gl_clip_alpha", slider=True) col.prop(system, "use_mipmaps") - col.label(text="Anisotropic Filtering") + col.label(text=_("Anisotropic Filtering")) col.prop(system, "anisotropic_filter", text="") col.prop(system, "use_vertex_buffer_objects") #Anti-aliasing is disabled as it breaks broder/lasso select #col.prop(system, "use_antialiasing") - col.label(text="Window Draw Method:") + col.label(text=_("Window Draw Method:")) col.prop(system, "window_draw_method", text="") - col.label(text="Text Draw Options:") + col.label(text=_("Text Draw Options:")) col.prop(system, "use_text_antialiasing") - col.label(text="Textures:") - col.prop(system, "gl_texture_limit", text="Limit Size") - col.prop(system, "texture_time_out", text="Time Out") - col.prop(system, "texture_collection_rate", text="Collection Rate") + col.label(text=_("Textures:")) + col.prop(system, "gl_texture_limit", text=_("Limit Size")) + col.prop(system, "texture_time_out", text=_("Time Out")) + col.prop(system, "texture_collection_rate", text=_("Collection Rate")) col.separator() col.separator() col.separator() - col.label(text="Sequencer:") + col.label(text=_("Sequencer:")) col.prop(system, "prefetch_frames") col.prop(system, "memory_cache_limit") # 3. Column column = split.column() - column.label(text="Solid OpenGL lights:") + column.label(text=_("Solid OpenGL lights:")) split = column.split(percentage=0.1) split.label() - split.label(text="Colors:") - split.label(text="Direction:") + split.label(text=_("Colors:")) + split.label(text=_("Direction:")) lamp = system.solid_lights[0] opengl_lamp_buttons(column, lamp) @@ -481,21 +468,27 @@ class USERPREF_PT_system(Panel): opengl_lamp_buttons(column, lamp) column.separator() - column.separator() - column.separator() - column.label(text="Color Picker Type:") + column.label(text=_("Color Picker Type:")) column.row().prop(system, "color_picker_type", text="") column.separator() - column.separator() - column.separator() - column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range") + column.prop(system, "use_weight_color_range", text=_("Custom Weight Paint Range")) sub = column.column() sub.active = system.use_weight_color_range sub.template_color_ramp(system, "weight_color_range", expand=True) + column.separator() + + column.prop(system, "use_international_fonts") + if system.use_international_fonts: + column.prop(system, "language") + row = column.row() + row.label(text="Translate:") + row.prop(system, "use_translate_interface", text="Interface") + row.prop(system, "use_translate_tooltips", text="Tooltips") + class USERPREF_PT_theme(Panel): bl_space_type = 'USER_PREFERENCES' @@ -557,71 +550,71 @@ class USERPREF_PT_theme(Panel): col = split.column() ui = theme.user_interface.wcol_regular - col.label(text="Regular:") + col.label(text=_("Regular:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_tool - col.label(text="Tool:") + col.label(text=_("Tool:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_radio - col.label(text="Radio Buttons:") + col.label(text=_("Radio Buttons:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_text - col.label(text="Text:") + col.label(text=_("Text:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_option - col.label(text="Option:") + col.label(text=_("Option:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_toggle - col.label(text="Toggle:") + col.label(text=_("Toggle:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_num - col.label(text="Number Field:") + col.label(text=_("Number Field:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_numslider - col.label(text="Value Slider:") + col.label(text=_("Value Slider:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_box - col.label(text="Box:") + col.label(text=_("Box:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu - col.label(text="Menu:") + col.label(text=_("Menu:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_pulldown - col.label(text="Pulldown:") + col.label(text=_("Pulldown:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu_back - col.label(text="Menu Back:") + col.label(text=_("Menu Back:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu_item - col.label(text="Menu Item:") + col.label(text=_("Menu Item:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_scroll - col.label(text="Scroll Bar:") + col.label(text=_("Scroll Bar:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_progress - col.label(text="Progress Bar:") + col.label(text=_("Progress Bar:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_list_item - col.label(text="List Item:") + col.label(text=_("List Item:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_state - col.label(text="State:") + col.label(text=_("State:")) row = col.row() @@ -657,7 +650,7 @@ class USERPREF_PT_theme(Panel): col = split.column() for i, ui in enumerate(theme.bone_color_sets): - col.label(text="Color Set %d:" % (i + 1)) # i starts from 0 + col.label(text=_("Color Set") + " %d:" % (i + 1)) # i starts from 0 row = col.row() @@ -700,22 +693,22 @@ class USERPREF_PT_file(Panel): split = layout.split(percentage=0.7) col = split.column() - col.label(text="File Paths:") + col.label(text=_("File Paths:")) colsplit = col.split(percentage=0.95) col1 = colsplit.split(percentage=0.3) sub = col1.column() - sub.label(text="Fonts:") - sub.label(text="Textures:") - sub.label(text="Texture Plugins:") - sub.label(text="Sequence Plugins:") - sub.label(text="Render Output:") - sub.label(text="Scripts:") - sub.label(text="Sounds:") - sub.label(text="Temp:") - sub.label(text="Image Editor:") - sub.label(text="Animation Player:") + sub.label(text=_("Fonts:")) + sub.label(text=_("Textures:")) + sub.label(text=_("Texture Plugins:")) + sub.label(text=_("Sequence Plugins:")) + sub.label(text=_("Render Output:")) + sub.label(text=_("Scripts:")) + sub.label(text=_("Sounds:")) + sub.label(text=_("Temp:")) + sub.label(text=_("Image Editor:")) + sub.label(text=_("Animation Player:")) sub = col1.column() sub.prop(paths, "font_directory", text="") @@ -732,7 +725,7 @@ class USERPREF_PT_file(Panel): subsplit.prop(paths, "animation_player", text="") col = split.column() - col.label(text="Save & Load:") + col.label(text=_("Save & Load:")) col.prop(paths, "use_relative_paths") col.prop(paths, "use_file_compression") col.prop(paths, "use_load_ui") @@ -747,11 +740,11 @@ class USERPREF_PT_file(Panel): col.prop(paths, "save_version") col.prop(paths, "recent_files") col.prop(paths, "use_save_preview_images") - col.label(text="Auto Save:") + col.label(text=_("Auto Save:")) col.prop(paths, "use_auto_save_temporary_files") sub = col.column() sub.active = paths.use_auto_save_temporary_files - sub.prop(paths, "auto_save_time", text="Timer (mins)") + sub.prop(paths, "auto_save_time", text=_("Timer (mins)")) from bl_ui.space_userpref_keymap import InputKeyMapPanel @@ -807,7 +800,7 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): col = row.column() sub = col.column() - sub.label(text="Presets:") + sub.label(text=_("Presets:")) subrow = sub.row(align=True) subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label) @@ -815,19 +808,19 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMOUT').remove_active = True sub.separator() - sub.label(text="Mouse:") + sub.label(text=_("Mouse:")) sub1 = sub.column() sub1.active = (inputs.select_mouse == 'RIGHT') sub1.prop(inputs, "use_mouse_emulate_3_button") sub.prop(inputs, "use_mouse_continuous") sub.prop(inputs, "drag_threshold") - sub.label(text="Select With:") + sub.label(text=_("Select With:")) sub.row().prop(inputs, "select_mouse", expand=True) sub = col.column() - sub.label(text="Double Click:") - sub.prop(inputs, "mouse_double_click_time", text="Speed") + sub.label(text=_("Double Click:")) + sub.prop(inputs, "mouse_double_click_time", text=_("Speed")) sub.separator() @@ -835,10 +828,10 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): sub.separator() - sub.label(text="Orbit Style:") + sub.label(text=_("Orbit Style:")) sub.row().prop(inputs, "view_rotate_method", expand=True) - sub.label(text="Zoom Style:") + sub.label(text=_("Zoom Style:")) sub.row().prop(inputs, "view_zoom_method", text="") if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}: sub.row().prop(inputs, "view_zoom_axis", expand=True) @@ -849,8 +842,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): #col.separator() sub = col.column() - sub.label(text="Mouse Wheel:") - sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction") + sub.label(text=_("Mouse Wheel:")) + sub.prop(inputs, "invert_zoom_wheel", text=_("Invert Wheel Zoom Direction")) #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines") col.separator() @@ -888,9 +881,9 @@ class USERPREF_MT_addons_dev_guides(Menu): # menu to open webpages with addons development guides def draw(self, context): layout = self.layout - layout.operator('wm.url_open', text='API Concepts', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro' - layout.operator('wm.url_open', text='Addon Guidelines', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons' - layout.operator('wm.url_open', text='How to share your addon', icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing' + layout.operator('wm.url_open', text=_('API Concepts'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro' + layout.operator('wm.url_open', text=_('Addon Guidelines'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons' + layout.operator('wm.url_open', text=_('How to share your addon'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing' class USERPREF_PT_addons(Panel): @@ -945,10 +938,10 @@ class USERPREF_PT_addons(Panel): split = layout.split(percentage=0.2) col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') - col.label(text="Categories") + col.label(text=_("Categories")) col.prop(context.window_manager, "addon_filter", expand=True) - col.label(text="Supported Level") + col.label(text=_("Supported Level")) col.prop(context.window_manager, "addon_support", expand=True) col = split.column() @@ -1025,23 +1018,23 @@ class USERPREF_PT_addons(Panel): if info["show_expanded"]: if info["description"]: split = colsub.row().split(percentage=0.15) - split.label(text='Description:') + split.label(text=_('Description:')) split.label(text=info["description"]) if info["location"]: split = colsub.row().split(percentage=0.15) - split.label(text='Location:') + split.label(text=_('Location:')) split.label(text=info["location"]) if info["author"]: split = colsub.row().split(percentage=0.15) - split.label(text='Author:') + split.label(text=_('Author:')) split.label(text=info["author"]) if info["version"]: split = colsub.row().split(percentage=0.15) - split.label(text='Version:') + split.label(text=_('Version:')) split.label(text='.'.join(str(x) for x in info["version"])) if info["warning"]: split = colsub.row().split(percentage=0.15) - split.label(text="Warning:") + split.label(text=_("Warning:")) split.label(text=' ' + info["warning"], icon='ERROR') user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths) @@ -1049,13 +1042,13 @@ class USERPREF_PT_addons(Panel): if tot_row: split = colsub.row().split(percentage=0.15) - split.label(text="Internet:") + split.label(text=_("Internet:")) if info["wiki_url"]: - split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"] + split.operator("wm.url_open", text=_("Link to the Wiki"), icon='HELP').url = info["wiki_url"] if info["tracker_url"]: - split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"] + split.operator("wm.url_open", text=_("Report a Bug"), icon='URL').url = info["tracker_url"] if user_addon: - split.operator("wm.addon_remove", text="Remove", icon='CANCEL').module = mod.__name__ + split.operator("wm.addon_remove", text=_("Remove"), icon='CANCEL').module = mod.__name__ for i in range(4 - tot_row): split.separator() @@ -1067,7 +1060,7 @@ class USERPREF_PT_addons(Panel): if missing_modules and filter in {"All", "Enabled"}: col.column().separator() - col.column().label(text="Missing script files") + col.column().label(text=_("Missing script files")) module_names = {mod.__name__ for mod, info in addons} for module_name in sorted(missing_modules): @@ -1104,8 +1097,8 @@ class WM_OT_addon_enable(Operator): if info_ver > bpy.app.version: self.report({'WARNING'}, ("This script was written Blender " "version %d.%d.%d and might not " - "function (correctly).\n" - "The script is enabled though.") % + "function (correctly), " + "though it is enabled") % info_ver) return {'FINISHED'} else: diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 9ed1591cbf3..a0a614e4fb4 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Menu, Operator, OperatorProperties import os +from blf import gettext as _ KM_HIERARCHY = [ @@ -131,7 +132,7 @@ class USERPREF_MT_keyconfigs(Menu): preset_operator = "wm.keyconfig_activate" def draw(self, context): - props = self.layout.operator("wm.context_set_value", text="Blender (default)") + props = self.layout.operator("wm.context_set_value", text=_("Blender (default)")) props.data_path = "window_manager.keyconfigs.active" props.value = "context.window_manager.keyconfigs.default" @@ -182,7 +183,7 @@ class InputKeyMapPanel: row = col.row() row.prop(km, "show_expanded_children", text="", emboss=False) - row.label(text=km.name) + row.label(text=_(km.name)) row.label() row.label() @@ -190,7 +191,7 @@ class InputKeyMapPanel: if km.is_modal: row.label(text="", icon='LINKED') if km.is_user_modified: - row.operator("wm.keymap_restore", text="Restore") + row.operator("wm.keymap_restore", text=_("Restore")) else: row.label() @@ -201,7 +202,7 @@ class InputKeyMapPanel: subcol = self.indented_layout(col, level + 1) subrow = subcol.row() subrow.prop(km, "show_expanded_items", text="", emboss=False) - subrow.label(text="%s (Global)" % km.name) + subrow.label(text="%s " % _(km.name) + _("(Global)")) else: km.show_expanded_items = True @@ -213,7 +214,7 @@ class InputKeyMapPanel: # "Add New" at end of keymap item list col = self.indented_layout(col, level + 1) subcol = col.split(percentage=0.2).column() - subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN') + subcol.operator("wm.keyitem_add", text=_("Add New"), icon='ZOOMIN') col.separator() @@ -261,7 +262,7 @@ class InputKeyMapPanel: if km.is_modal: row.prop(kmi, "propvalue", text="") else: - row.label(text=kmi.name) + row.label(text=_(kmi.name)) row = split.row() row.prop(kmi, "map_type", text="") @@ -350,7 +351,7 @@ class InputKeyMapPanel: row.label() if km.is_user_modified: - row.operator("wm.keymap_restore", text="Restore") + row.operator("wm.keymap_restore", text=_("Restore")) else: row.label() @@ -360,7 +361,7 @@ class InputKeyMapPanel: # "Add New" at end of keymap item list col = self.indented_layout(layout, 1) subcol = col.split(percentage=0.2).column() - subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN') + subcol.operator("wm.keyitem_add", text=_("Add New"), icon='ZOOMIN') def draw_hierarchy(self, display_keymaps, layout): for entry in KM_HIERARCHY: @@ -381,7 +382,7 @@ class InputKeyMapPanel: #row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") text = bpy.path.display_name(context.window_manager.keyconfigs.active.name) if not text: - text = "Blender (default)" + text = _("Blender (default)") row.menu("USERPREF_MT_keyconfigs", text=text) row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN") row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True @@ -423,7 +424,7 @@ def export_properties(prefix, properties, lines=None): class WM_OT_keyconfig_test(Operator): "Test keyconfig for conflicts" bl_idname = "wm.keyconfig_test" - bl_label = "Test Key Configuration for Conflicts" + bl_label = _("Test Key Configuration for Conflicts") def testEntry(self, kc, entry, src=None, parent=None): result = False @@ -597,7 +598,7 @@ class WM_OT_keyconfig_import(Operator): class WM_OT_keyconfig_export(Operator): "Export key configuration to a python script" bl_idname = "wm.keyconfig_export" - bl_label = "Export Key Configuration..." + bl_label = _("Export Key Configuration...") filepath = StringProperty( name="File Path", diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9f96df1eb66..2e86e875bab 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Operator, Panel +from blf import gettext as _ class VIEW3D_HT_header(Header): @@ -124,9 +125,9 @@ class ShowHideMenu(): def draw(self, context): layout = self.layout - layout.operator("%s.reveal" % self._operator_name, text="Show Hidden") - layout.operator("%s.hide" % self._operator_name, text="Hide Selected") - layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True + layout.operator("%s.reveal" % self._operator_name, text=_("Show Hidden")) + layout.operator("%s.hide" % self._operator_name, text=_("Hide Selected")) + layout.operator("%s.hide" % self._operator_name, text=_("Hide Unselected")).unselected = True class VIEW3D_MT_transform(Menu): @@ -145,35 +146,35 @@ class VIEW3D_MT_transform(Menu): layout.separator() - layout.operator("transform.tosphere", text="To Sphere") - layout.operator("transform.shear", text="Shear") - layout.operator("transform.warp", text="Warp") - layout.operator("transform.push_pull", text="Push/Pull") + layout.operator("transform.tosphere", text=_("To Sphere")) + layout.operator("transform.shear", text=_("Shear")) + layout.operator("transform.warp", text=_("Warp")) + layout.operator("transform.push_pull", text=_("Push/Pull")) layout.separator() - layout.operator("transform.translate", text="Move Texture Space").texture_space = True - layout.operator("transform.resize", text="Scale Texture Space").texture_space = True + layout.operator("transform.translate", text=_("Move Texture Space")).texture_space = True + layout.operator("transform.resize", text=_("Scale Texture Space")).texture_space = True layout.separator() obj = context.object if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and obj.data.draw_type in {'BBONE', 'ENVELOPE'}: - layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE' + layout.operator("transform.transform", text=_("Scale Envelope/BBone")).mode = 'BONE_SIZE' if context.edit_object and context.edit_object.type == 'ARMATURE': layout.operator("armature.align") else: layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working + layout.operator("transform.transform", text=_("Align to Transform Orientation")).mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working layout.separator() layout.operator_context = 'EXEC_AREA' - layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN' - layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY' - layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR' + layout.operator("object.origin_set", text=_("Geometry to Origin")).type = 'GEOMETRY_ORIGIN' + layout.operator("object.origin_set", text=_("Origin to Geometry")).type = 'ORIGIN_GEOMETRY' + layout.operator("object.origin_set", text=_("Origin to 3D Cursor")).type = 'ORIGIN_CURSOR' layout.separator() @@ -191,32 +192,32 @@ class VIEW3D_MT_mirror(Menu): def draw(self, context): layout = self.layout - layout.operator("transform.mirror", text="Interactive Mirror") + layout.operator("transform.mirror", text=_("Interactive Mirror")) layout.separator() layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("transform.mirror", text="X Global") + props = layout.operator("transform.mirror", text=_("X Global")) props.constraint_axis = (True, False, False) props.constraint_orientation = 'GLOBAL' - props = layout.operator("transform.mirror", text="Y Global") + props = layout.operator("transform.mirror", text=_("Y Global")) props.constraint_axis = (False, True, False) props.constraint_orientation = 'GLOBAL' - props = layout.operator("transform.mirror", text="Z Global") + props = layout.operator("transform.mirror", text=_("Z Global")) props.constraint_axis = (False, False, True) props.constraint_orientation = 'GLOBAL' if context.edit_object: layout.separator() - props = layout.operator("transform.mirror", text="X Local") + props = layout.operator("transform.mirror", text=_("X Local")) props.constraint_axis = (True, False, False) props.constraint_orientation = 'LOCAL' - props = layout.operator("transform.mirror", text="Y Local") + props = layout.operator("transform.mirror", text=_("Y Local")) props.constraint_axis = (False, True, False) props.constraint_orientation = 'LOCAL' - props = layout.operator("transform.mirror", text="Z Local") + props = layout.operator("transform.mirror", text=_("Z Local")) props.constraint_axis = (False, False, True) props.constraint_orientation = 'LOCAL' @@ -229,15 +230,15 @@ class VIEW3D_MT_snap(Menu): def draw(self, context): layout = self.layout - layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid") - layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor") + layout.operator("view3d.snap_selected_to_grid", text=_("Selection to Grid")) + layout.operator("view3d.snap_selected_to_cursor", text=_("Selection to Cursor")) layout.separator() - layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected") - layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center") - layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid") - layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active") + layout.operator("view3d.snap_cursor_to_selected", text=_("Cursor to Selected")) + layout.operator("view3d.snap_cursor_to_center", text=_("Cursor to Center")) + layout.operator("view3d.snap_cursor_to_grid", text=_("Cursor to Grid")) + layout.operator("view3d.snap_cursor_to_active", text=_("Cursor to Active")) class VIEW3D_MT_uv_map(Menu): @@ -263,7 +264,7 @@ class VIEW3D_MT_uv_map(Menu): layout.separator() layout.operator("uv.project_from_view") - layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True + layout.operator("uv.project_from_view", text=_("Project from View (Bounds)")).scale_to_bounds = True layout.separator() @@ -284,15 +285,15 @@ class VIEW3D_MT_view(Menu): layout.separator() - layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA' - layout.operator("view3d.viewnumpad", text="Top").type = 'TOP' - layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM' - layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT' - layout.operator("view3d.viewnumpad", text="Back").type = 'BACK' - layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT' - layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT' + layout.operator("view3d.viewnumpad", text=_("Camera")).type = 'CAMERA' + layout.operator("view3d.viewnumpad", text=_("Top")).type = 'TOP' + layout.operator("view3d.viewnumpad", text=_("Bottom")).type = 'BOTTOM' + layout.operator("view3d.viewnumpad", text=_("Front")).type = 'FRONT' + layout.operator("view3d.viewnumpad", text=_("Back")).type = 'BACK' + layout.operator("view3d.viewnumpad", text=_("Right")).type = 'RIGHT' + layout.operator("view3d.viewnumpad", text=_("Left")).type = 'LEFT' - layout.menu("VIEW3D_MT_view_cameras", text="Cameras") + layout.menu("VIEW3D_MT_view_cameras", text=_("Cameras")) layout.separator() @@ -307,22 +308,22 @@ class VIEW3D_MT_view(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("view3d.clip_border", text="Clipping Border...") - layout.operator("view3d.zoom_border", text="Zoom Border...") + layout.operator("view3d.clip_border", text=_("Clipping Border...")) + layout.operator("view3d.zoom_border", text=_("Zoom Border...")) layout.separator() - layout.operator("view3d.layers", text="Show All Layers").nr = 0 + layout.operator("view3d.layers", text=_("Show All Layers")).nr = 0 layout.separator() - layout.operator("view3d.localview", text="View Global/Local") + layout.operator("view3d.localview", text=_("View Global/Local")) layout.operator("view3d.view_selected") layout.operator("view3d.view_all") layout.separator() - layout.operator("screen.animation_play", text="Playback Animation") + layout.operator("screen.animation_play", text=_("Playback Animation")) layout.separator() @@ -345,9 +346,9 @@ class VIEW3D_MT_view_navigation(Menu): layout.separator() - layout.operator("view3d.zoom", text="Zoom In").delta = 1 - layout.operator("view3d.zoom", text="Zoom Out").delta = -1 - layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1") + layout.operator("view3d.zoom", text=_("Zoom In")).delta = 1 + layout.operator("view3d.zoom", text=_("Zoom Out")).delta = -1 + layout.operator("view3d.zoom_camera_1_to_1", text=_("Zoom Camera 1:1")) layout.separator() @@ -364,8 +365,8 @@ class VIEW3D_MT_view_align(Menu): layout.separator() - layout.operator("view3d.view_all", text="Center Cursor and View All").center = True - layout.operator("view3d.camera_to_view", text="Align Active Camera to View") + layout.operator("view3d.view_all", text=_("Center Cursor and View All")).center = True + layout.operator("view3d.camera_to_view", text=_("Align Active Camera to View")) layout.operator("view3d.view_selected") layout.operator("view3d.view_center_cursor") @@ -376,22 +377,22 @@ class VIEW3D_MT_view_align_selected(Menu): def draw(self, context): layout = self.layout - props = layout.operator("view3d.viewnumpad", text="Top") + props = layout.operator("view3d.viewnumpad", text=_("Top")) props.align_active = True props.type = 'TOP' - props = layout.operator("view3d.viewnumpad", text="Bottom") + props = layout.operator("view3d.viewnumpad", text=_("Bottom")) props.align_active = True props.type = 'BOTTOM' - props = layout.operator("view3d.viewnumpad", text="Front") + props = layout.operator("view3d.viewnumpad", text=_("Front")) props.align_active = True props.type = 'FRONT' - props = layout.operator("view3d.viewnumpad", text="Back") + props = layout.operator("view3d.viewnumpad", text=_("Back")) props.align_active = True props.type = 'BACK' - props = layout.operator("view3d.viewnumpad", text="Right") + props = layout.operator("view3d.viewnumpad", text=_("Right")) props.align_active = True props.type = 'RIGHT' - props = layout.operator("view3d.viewnumpad", text="Left") + props = layout.operator("view3d.viewnumpad", text=_("Left")) props.align_active = True props.type = 'LEFT' @@ -403,7 +404,7 @@ class VIEW3D_MT_view_cameras(Menu): layout = self.layout layout.operator("view3d.object_as_camera") - layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA' + layout.operator("view3d.viewnumpad", text=_("Active Camera")).type = 'CAMERA' # ********** Select menus, suffix from context.mode ********** @@ -419,19 +420,19 @@ class VIEW3D_MT_select_object(Menu): layout.separator() - layout.operator("object.select_all", text="Select/Deselect All") - layout.operator("object.select_inverse", text="Inverse") - layout.operator("object.select_random", text="Random") - layout.operator("object.select_mirror", text="Mirror") - layout.operator("object.select_by_layer", text="Select All by Layer") - layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...") - layout.operator("object.select_camera", text="Select Camera") + layout.operator("object.select_all", text=_("Select/Deselect All")) + layout.operator("object.select_inverse", text=_("Inverse")) + layout.operator("object.select_random", text=_("Random")) + layout.operator("object.select_mirror", text=_("Mirror")) + layout.operator("object.select_by_layer", text=_("Select All by Layer")) + layout.operator_menu_enum("object.select_by_type", "type", text=_("Select All by Type...")) + layout.operator("object.select_camera", text=_("Select Camera")) layout.separator() - layout.operator_menu_enum("object.select_grouped", "type", text="Grouped") - layout.operator_menu_enum("object.select_linked", "type", text="Linked") - layout.operator("object.select_pattern", text="Select Pattern...") + layout.operator_menu_enum("object.select_grouped", "type", text=_("Grouped")) + layout.operator_menu_enum("object.select_linked", "type", text=_("Linked")) + layout.operator("object.select_pattern", text=_("Select Pattern...")) class VIEW3D_MT_select_pose(Menu): @@ -444,31 +445,31 @@ class VIEW3D_MT_select_pose(Menu): layout.separator() - layout.operator("pose.select_all", text="Select/Deselect All") - layout.operator("pose.select_inverse", text="Inverse") - layout.operator("pose.select_flip_active", text="Flip Active") - layout.operator("pose.select_constraint_target", text="Constraint Target") - layout.operator("pose.select_linked", text="Linked") + layout.operator("pose.select_all", text=_("Select/Deselect All")) + layout.operator("pose.select_inverse", text=_("Inverse")) + layout.operator("pose.select_flip_active", text=_("Flip Active")) + layout.operator("pose.select_constraint_target", text=_("Constraint Target")) + layout.operator("pose.select_linked", text=_("Linked")) layout.separator() - layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT' - layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD' + layout.operator("pose.select_hierarchy", text=_("Parent")).direction = 'PARENT' + layout.operator("pose.select_hierarchy", text=_("Child")).direction = 'CHILD' layout.separator() - props = layout.operator("pose.select_hierarchy", text="Extend Parent") + props = layout.operator("pose.select_hierarchy", text=_("Extend Parent")) props.extend = True props.direction = 'PARENT' - props = layout.operator("pose.select_hierarchy", text="Extend Child") + props = layout.operator("pose.select_hierarchy", text=_("Extend Child")) props.extend = True props.direction = 'CHILD' layout.separator() - layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped") - layout.operator("object.select_pattern", text="Select Pattern...") + layout.operator_menu_enum("pose.select_grouped", "type", text=_("Grouped")) + layout.operator("object.select_pattern", text=_("Select Pattern...")) class VIEW3D_MT_select_particle(Menu): @@ -481,7 +482,7 @@ class VIEW3D_MT_select_particle(Menu): layout.separator() - layout.operator("particle.select_all", text="Select/Deselect All") + layout.operator("particle.select_all", text=_("Select/Deselect All")) layout.operator("particle.select_linked") layout.operator("particle.select_inverse") @@ -492,8 +493,8 @@ class VIEW3D_MT_select_particle(Menu): layout.separator() - layout.operator("particle.select_roots", text="Roots") - layout.operator("particle.select_tips", text="Tips") + layout.operator("particle.select_roots", text=_("Roots")) + layout.operator("particle.select_tips", text=_("Tips")) class VIEW3D_MT_select_edit_mesh(Menu): @@ -507,40 +508,40 @@ class VIEW3D_MT_select_edit_mesh(Menu): layout.separator() - layout.operator("mesh.select_all", text="Select/Deselect All") - layout.operator("mesh.select_inverse", text="Inverse") + layout.operator("mesh.select_all", text=_("Select/Deselect All")) + layout.operator("mesh.select_inverse", text=_("Inverse")) layout.separator() - layout.operator("mesh.select_random", text="Random") - layout.operator("mesh.select_nth", text="Every N Number of Verts") - layout.operator("mesh.edges_select_sharp", text="Sharp Edges") - layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces") - layout.operator("mesh.faces_select_interior", text="Interior Faces") - layout.operator("mesh.select_axis", text="Side of Active") + layout.operator("mesh.select_random", text=_("Random")) + layout.operator("mesh.select_nth", text=_("Every N Number of Verts")) + layout.operator("mesh.edges_select_sharp", text=_("Sharp Edges")) + layout.operator("mesh.faces_select_linked_flat", text=_("Linked Flat Faces")) + layout.operator("mesh.faces_select_interior", text=_("Interior Faces")) + layout.operator("mesh.select_axis", text=_("Side of Active")) layout.separator() - layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES' - layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS' + layout.operator("mesh.select_by_number_vertices", text=_("Triangles")).type = 'TRIANGLES' + layout.operator("mesh.select_by_number_vertices", text=_("Quads")).type = 'QUADS' if context.scene.tool_settings.mesh_select_mode[2] == False: - layout.operator("mesh.select_non_manifold", text="Non Manifold") - layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER' - layout.operator("mesh.select_similar", text="Similar") + layout.operator("mesh.select_non_manifold", text=_("Non Manifold")) + layout.operator("mesh.select_by_number_vertices", text=_("Loose Verts/Edges")).type = 'OTHER' + layout.operator("mesh.select_similar", text=_("Similar")) layout.separator() - layout.operator("mesh.select_less", text="Less") - layout.operator("mesh.select_more", text="More") + layout.operator("mesh.select_less", text=_("Less")) + layout.operator("mesh.select_more", text=_("More")) layout.separator() - layout.operator("mesh.select_mirror", text="Mirror") + layout.operator("mesh.select_mirror", text=_("Mirror")) - layout.operator("mesh.select_linked", text="Linked") - layout.operator("mesh.select_vertex_path", text="Vertex Path") - layout.operator("mesh.loop_multi_select", text="Edge Loop") - layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True + layout.operator("mesh.select_linked", text=_("Linked")) + layout.operator("mesh.select_vertex_path", text=_("Vertex Path")) + layout.operator("mesh.loop_multi_select", text=_("Edge Loop")) + layout.operator("mesh.loop_multi_select", text=_("Edge Ring")).ring = True layout.separator() @@ -559,10 +560,10 @@ class VIEW3D_MT_select_edit_curve(Menu): layout.separator() - layout.operator("curve.select_all", text="Select/Deselect All") + layout.operator("curve.select_all", text=_("Select/Deselect All")) layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_nth", text="Every Nth Number of Points") + layout.operator("curve.select_nth", text=_("Every Nth Number of Points")) layout.separator() @@ -588,10 +589,10 @@ class VIEW3D_MT_select_edit_surface(Menu): layout.separator() - layout.operator("curve.select_all", text="Select/Deselect All") + layout.operator("curve.select_all", text=_("Select/Deselect All")) layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_nth", text="Every Nth Number of Points") + layout.operator("curve.select_nth", text=_("Every Nth Number of Points")) layout.separator() @@ -631,7 +632,7 @@ class VIEW3D_MT_select_edit_lattice(Menu): layout.separator() - layout.operator("lattice.select_all", text="Select/Deselect All") + layout.operator("lattice.select_all", text=_("Select/Deselect All")) class VIEW3D_MT_select_edit_armature(Menu): @@ -644,25 +645,25 @@ class VIEW3D_MT_select_edit_armature(Menu): layout.separator() - layout.operator("armature.select_all", text="Select/Deselect All") - layout.operator("armature.select_inverse", text="Inverse") + layout.operator("armature.select_all", text=_("Select/Deselect All")) + layout.operator("armature.select_inverse", text=_("Inverse")) layout.separator() - layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT' - layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD' + layout.operator("armature.select_hierarchy", text=_("Parent")).direction = 'PARENT' + layout.operator("armature.select_hierarchy", text=_("Child")).direction = 'CHILD' layout.separator() - props = layout.operator("armature.select_hierarchy", text="Extend Parent") + props = layout.operator("armature.select_hierarchy", text=_("Extend Parent")) props.extend = True props.direction = 'PARENT' - props = layout.operator("armature.select_hierarchy", text="Extend Child") + props = layout.operator("armature.select_hierarchy", text=_("Extend Child")) props.extend = True props.direction = 'CHILD' - layout.operator("object.select_pattern", text="Select Pattern...") + layout.operator("object.select_pattern", text=_("Select Pattern...")) class VIEW3D_MT_select_face(Menu): # XXX no matching enum @@ -705,11 +706,11 @@ class VIEW3D_MT_object(Menu): layout.operator("object.duplicate_move") layout.operator("object.duplicate_move_linked") - layout.operator("object.delete", text="Delete...") - layout.operator("object.proxy_make", text="Make Proxy...") - layout.menu("VIEW3D_MT_make_links", text="Make Links...") + layout.operator("object.delete", text=_("Delete...")) + layout.operator("object.proxy_make", text=_("Make Proxy...")) + layout.menu("VIEW3D_MT_make_links", text=_("Make Links...")) layout.operator("object.make_dupli_face") - layout.operator_menu_enum("object.make_local", "type", text="Make Local...") + layout.operator_menu_enum("object.make_local", "type", text=_("Make Local...")) layout.menu("VIEW3D_MT_make_single_user") layout.separator() @@ -730,7 +731,7 @@ class VIEW3D_MT_object(Menu): layout.separator() - layout.operator("object.move_to_layer", text="Move to Layer...") + layout.operator("object.move_to_layer", text=_("Move to Layer...")) layout.menu("VIEW3D_MT_object_showhide") layout.operator_menu_enum("object.convert", "target") @@ -742,9 +743,9 @@ class VIEW3D_MT_object_animation(Menu): def draw(self, context): layout = self.layout - layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...") - layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...") - layout.operator("anim.keying_set_active_set", text="Change Keying Set...") + layout.operator("anim.keyframe_insert_menu", text=_("Insert Keyframe...")) + layout.operator("anim.keyframe_delete_v3d", text=_("Delete Keyframe...")) + layout.operator("anim.keying_set_active_set", text=_("Change Keying Set...")) class VIEW3D_MT_object_clear(Menu): @@ -753,10 +754,10 @@ class VIEW3D_MT_object_clear(Menu): def draw(self, context): layout = self.layout - layout.operator("object.location_clear", text="Location") - layout.operator("object.rotation_clear", text="Rotation") - layout.operator("object.scale_clear", text="Scale") - layout.operator("object.origin_clear", text="Origin") + layout.operator("object.location_clear", text=_("Location")) + layout.operator("object.rotation_clear", text=_("Rotation")) + layout.operator("object.scale_clear", text=_("Scale")) + layout.operator("object.origin_clear", text=_("Origin")) class VIEW3D_MT_object_specials(Menu): @@ -775,19 +776,19 @@ class VIEW3D_MT_object_specials(Menu): layout.operator_context = 'INVOKE_REGION_WIN' if obj.data.type == 'PERSP': - props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle") + props = layout.operator("wm.context_modal_mouse", text=_("Camera Lens Angle")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.lens" props.input_scale = 0.1 else: - props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale") + props = layout.operator("wm.context_modal_mouse", text=_("Camera Lens Scale")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.ortho_scale" props.input_scale = 0.01 if not obj.data.dof_object: #layout.label(text="Test Has DOF obj"); - props = layout.operator("wm.context_modal_mouse", text="DOF Distance") + props = layout.operator("wm.context_modal_mouse", text=_("DOF Distance")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.dof_distance" props.input_scale = 0.02 @@ -795,12 +796,12 @@ class VIEW3D_MT_object_specials(Menu): if obj.type in {'CURVE', 'FONT'}: layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("wm.context_modal_mouse", text="Extrude Size") + props = layout.operator("wm.context_modal_mouse", text=_("Extrude Size")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.extrude" props.input_scale = 0.01 - props = layout.operator("wm.context_modal_mouse", text="Width Size") + props = layout.operator("wm.context_modal_mouse", text=_("Width Size")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.offset" props.input_scale = 0.01 @@ -808,7 +809,7 @@ class VIEW3D_MT_object_specials(Menu): if obj.type == 'EMPTY': layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size") + props = layout.operator("wm.context_modal_mouse", text=_("Empty Draw Size")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "empty_draw_size" props.input_scale = 0.01 @@ -816,34 +817,34 @@ class VIEW3D_MT_object_specials(Menu): if obj.type == 'LAMP': layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("wm.context_modal_mouse", text="Energy") + props = layout.operator("wm.context_modal_mouse", text=_("Energy")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.energy" if obj.data.type in {'SPOT', 'AREA', 'POINT'}: - props = layout.operator("wm.context_modal_mouse", text="Falloff Distance") + props = layout.operator("wm.context_modal_mouse", text=_("Falloff Distance")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.distance" props.input_scale = 0.1 if obj.data.type == 'SPOT': layout.separator() - props = layout.operator("wm.context_modal_mouse", text="Spot Size") + props = layout.operator("wm.context_modal_mouse", text=_("Spot Size")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.spot_size" props.input_scale = 0.01 - props = layout.operator("wm.context_modal_mouse", text="Spot Blend") + props = layout.operator("wm.context_modal_mouse", text=_("Spot Blend")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.spot_blend" props.input_scale = -0.01 - props = layout.operator("wm.context_modal_mouse", text="Clip Start") + props = layout.operator("wm.context_modal_mouse", text=_("Clip Start")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_buffer_clip_start" props.input_scale = 0.05 - props = layout.operator("wm.context_modal_mouse", text="Clip End") + props = layout.operator("wm.context_modal_mouse", text=_("Clip End")) props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_buffer_clip_end" props.input_scale = 0.05 @@ -860,16 +861,16 @@ class VIEW3D_MT_object_apply(Menu): def draw(self, context): layout = self.layout - layout.operator("object.transform_apply", text="Location").location = True - layout.operator("object.transform_apply", text="Rotation").rotation = True - layout.operator("object.transform_apply", text="Scale").scale = True - props = layout.operator("object.transform_apply", text="Rotation & Scale") + layout.operator("object.transform_apply", text=_("Location")).location = True + layout.operator("object.transform_apply", text=_("Rotation")).rotation = True + layout.operator("object.transform_apply", text=_("Scale")).scale = True + props = layout.operator("object.transform_apply", text=_("Rotation & Scale")) props.scale = True props.rotation = True layout.separator() - layout.operator("object.visual_transform_apply", text="Visual Transform") + layout.operator("object.visual_transform_apply", text=_("Visual Transform")) layout.operator("object.duplicates_make_real") @@ -879,8 +880,8 @@ class VIEW3D_MT_object_parent(Menu): def draw(self, context): layout = self.layout - layout.operator("object.parent_set", text="Set") - layout.operator("object.parent_clear", text="Clear") + layout.operator("object.parent_set", text=_("Set")) + layout.operator("object.parent_clear", text=_("Clear")) class VIEW3D_MT_object_track(Menu): @@ -889,8 +890,8 @@ class VIEW3D_MT_object_track(Menu): def draw(self, context): layout = self.layout - layout.operator("object.track_set", text="Set") - layout.operator("object.track_clear", text="Clear") + layout.operator("object.track_set", text=_("Set")) + layout.operator("object.track_clear", text=_("Clear")) class VIEW3D_MT_object_group(Menu): @@ -925,9 +926,9 @@ class VIEW3D_MT_object_showhide(Menu): def draw(self, context): layout = self.layout - layout.operator("object.hide_view_clear", text="Show Hidden") - layout.operator("object.hide_view_set", text="Hide Selected") - layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True + layout.operator("object.hide_view_clear", text=_("Show Hidden")) + layout.operator("object.hide_view_set", text=_("Hide Selected")) + layout.operator("object.hide_view_set", text=_("Hide Unselected")).unselected = True class VIEW3D_MT_make_single_user(Menu): @@ -936,19 +937,19 @@ class VIEW3D_MT_make_single_user(Menu): def draw(self, context): layout = self.layout - props = layout.operator("object.make_single_user", text="Object") + props = layout.operator("object.make_single_user", text=_("Object")) props.object = True - props = layout.operator("object.make_single_user", text="Object & Data") + props = layout.operator("object.make_single_user", text=_("Object & Data")) props.object = props.obdata = True - props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex") + props = layout.operator("object.make_single_user", text=_("Object & Data & Materials+Tex")) props.object = props.obdata = props.material = props.texture = True - props = layout.operator("object.make_single_user", text="Materials+Tex") + props = layout.operator("object.make_single_user", text=_("Materials+Tex")) props.material = props.texture = True - props = layout.operator("object.make_single_user", text="Object Animation") + props = layout.operator("object.make_single_user", text=_("Object Animation")) props.animation = True @@ -960,11 +961,11 @@ class VIEW3D_MT_make_links(Menu): if(len(bpy.data.scenes) > 10): layout.operator_context = 'INVOKE_DEFAULT' - layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY') - layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY') + layout.operator("object.make_links_scene", text=_("Objects to Scene..."), icon='OUTLINER_OB_EMPTY') + layout.operator("object.make_links_scene", text=_("Markers to Scene..."), icon='OUTLINER_OB_EMPTY') else: - layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...") - layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...") + layout.operator_menu_enum("object.make_links_scene", "scene", text=_("Objects to Scene...")) + layout.operator_menu_enum("marker.make_links_scene", "scene", text=_("Markers to Scene...")) layout.operator_enum("object.make_links_data", "type") # inline @@ -975,13 +976,13 @@ class VIEW3D_MT_object_game(Menu): def draw(self, context): layout = self.layout - layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks") + layout.operator("object.logic_bricks_copy", text=_("Copy Logic Bricks")) layout.separator() - layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE' - layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE' - layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...") + layout.operator("object.game_property_copy", text=_("Replace Properties")).operation = 'REPLACE' + layout.operator("object.game_property_copy", text=_("Merge Properties")).operation = 'MERGE' + layout.operator_menu_enum("object.game_property_copy", "property", text=_("Copy Properties...")) layout.separator() @@ -1031,21 +1032,21 @@ class VIEW3D_MT_vertex_group(Menu): def draw(self, context): layout = self.layout layout.operator_context = 'EXEC_AREA' - layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True + layout.operator("object.vertex_group_assign", text=_("Assign to New Group")).new = True ob = context.active_object if ob.mode == 'EDIT': if ob.vertex_groups.active: layout.separator() - layout.operator("object.vertex_group_assign", text="Assign to Active Group") - layout.operator("object.vertex_group_remove_from", text="Remove from Active Group") - layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True + layout.operator("object.vertex_group_assign", text=_("Assign to Active Group")) + layout.operator("object.vertex_group_remove_from", text=_("Remove from Active Group")) + layout.operator("object.vertex_group_remove_from", text=_("Remove from All")).all = True layout.separator() if ob.vertex_groups.active: - layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group") - layout.operator("object.vertex_group_remove", text="Remove Active Group") - layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True + layout.operator_menu_enum("object.vertex_group_set_active", "group", text=_("Set Active Group")) + layout.operator("object.vertex_group_remove", text=_("Remove Active Group")) + layout.operator("object.vertex_group_remove", text=_("Remove All Groups")).all = True # ********** Weight paint menu ********** @@ -1062,16 +1063,17 @@ class VIEW3D_MT_paint_weight(Menu): layout.separator() - layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC' - layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES' + layout.operator("paint.weight_from_bones", text=_("Assign Automatic From Bones")).type = 'AUTOMATIC' + layout.operator("paint.weight_from_bones", text=_("Assign From Bone Envelopes")).type = 'ENVELOPES' layout.separator() - layout.operator("object.vertex_group_normalize_all", text="Normalize All") - layout.operator("object.vertex_group_normalize", text="Normalize") - layout.operator("object.vertex_group_invert", text="Invert") - layout.operator("object.vertex_group_clean", text="Clean") - layout.operator("object.vertex_group_levels", text="Levels") + layout.operator("object.vertex_group_normalize_all", text=_("Normalize All")) + layout.operator("object.vertex_group_normalize", text=_("Normalize")) + layout.operator("object.vertex_group_invert", text=_("Invert")) + layout.operator("object.vertex_group_clean", text=_("Clean")) + layout.operator("object.vertex_group_levels", text=_("Levels")) + layout.operator("object.vertex_group_fix", text="Fix Deforms") layout.separator() @@ -1120,12 +1122,12 @@ class VIEW3D_MT_sculpt(Menu): layout.operator("sculpt.set_persistent_base") layout.separator() - layout.prop(sculpt, "use_threaded", text="Threaded Sculpt") + layout.prop(sculpt, "use_threaded", text=_("Threaded Sculpt")) layout.prop(sculpt, "show_brush") # TODO, make availabel from paint menu! - layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size") - layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength") + layout.prop(tool_settings, "sculpt_paint_use_unified_size", text=_("Unify Size")) + layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text=_("Unify Strength")) # ********** Particle menu ********** @@ -1218,7 +1220,7 @@ class VIEW3D_MT_pose(Menu): layout.operator("pose.copy") layout.operator("pose.paste") - layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True + layout.operator("pose.paste", text=_("Paste X-Flipped Pose")).flipped = True layout.separator() @@ -1235,9 +1237,9 @@ class VIEW3D_MT_pose(Menu): layout.separator() layout.operator_context = 'EXEC_AREA' - layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS' - layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS' - layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS' + layout.operator("pose.autoside_names", text=_("AutoName Left/Right")).axis = 'XAXIS' + layout.operator("pose.autoside_names", text=_("AutoName Front/Back")).axis = 'YAXIS' + layout.operator("pose.autoside_names", text=_("AutoName Top/Bottom")).axis = 'ZAXIS' layout.operator("pose.flip_names") @@ -1246,13 +1248,13 @@ class VIEW3D_MT_pose(Menu): layout.separator() layout.operator_context = 'INVOKE_AREA' - layout.operator("pose.armature_layers", text="Change Armature Layers...") - layout.operator("pose.bone_layers", text="Change Bone Layers...") + layout.operator("pose.armature_layers", text=_("Change Armature Layers...")) + layout.operator("pose.bone_layers", text=_("Change Bone Layers...")) layout.separator() layout.menu("VIEW3D_MT_pose_showhide") - layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings") + layout.menu("VIEW3D_MT_bone_options_toggle", text=_("Bone Settings")) class VIEW3D_MT_pose_transform(Menu): @@ -1261,17 +1263,17 @@ class VIEW3D_MT_pose_transform(Menu): def draw(self, context): layout = self.layout - layout.operator("pose.transforms_clear", text="All") + layout.operator("pose.transforms_clear", text=_("All")) layout.separator() - layout.operator("pose.loc_clear", text="Location") - layout.operator("pose.rot_clear", text="Rotation") - layout.operator("pose.scale_clear", text="Scale") + layout.operator("pose.loc_clear", text=_("Location")) + layout.operator("pose.rot_clear", text=_("Rotation")) + layout.operator("pose.scale_clear", text=_("Scale")) layout.separator() - layout.operator("pose.user_transforms_clear", text="Reset unkeyed") + layout.operator("pose.user_transforms_clear", text=_("Reset unkeyed")) class VIEW3D_MT_pose_slide(Menu): @@ -1295,12 +1297,12 @@ class VIEW3D_MT_pose_propagate(Menu): layout.separator() - layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY' - layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY' + layout.operator("pose.propagate", text=_("To Next Keyframe")).mode = 'NEXT_KEY' + layout.operator("pose.propagate", text=_("To Last Keyframe (Make Cyclic)")).mode = 'LAST_KEY' layout.separator() - layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS' + layout.operator("pose.propagate", text=_("On Selected Markers")).mode = 'SELECTED_MARKERS' class VIEW3D_MT_pose_library(Menu): @@ -1309,13 +1311,13 @@ class VIEW3D_MT_pose_library(Menu): def draw(self, context): layout = self.layout - layout.operator("poselib.browse_interactive", text="Browse Poses...") + layout.operator("poselib.browse_interactive", text=_("Browse Poses...")) layout.separator() - layout.operator("poselib.pose_add", text="Add Pose...") - layout.operator("poselib.pose_rename", text="Rename Pose...") - layout.operator("poselib.pose_remove", text="Remove Pose...") + layout.operator("poselib.pose_add", text=_("Add Pose...")) + layout.operator("poselib.pose_rename", text=_("Rename Pose...")) + layout.operator("poselib.pose_remove", text=_("Remove Pose...")) class VIEW3D_MT_pose_motion(Menu): @@ -1324,8 +1326,8 @@ class VIEW3D_MT_pose_motion(Menu): def draw(self, context): layout = self.layout - layout.operator("pose.paths_calculate", text="Calculate") - layout.operator("pose.paths_clear", text="Clear") + layout.operator("pose.paths_calculate", text=_("Calculate")) + layout.operator("pose.paths_clear", text=_("Clear")) class VIEW3D_MT_pose_group(Menu): @@ -1358,7 +1360,7 @@ class VIEW3D_MT_pose_constraints(Menu): def draw(self, context): layout = self.layout - layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...") + layout.operator("pose.constraint_add_with_targets", text=_("Add (With Targets)...")) layout.operator("pose.constraints_copy") layout.operator("pose.constraints_clear") @@ -1368,7 +1370,7 @@ class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu): class VIEW3D_MT_pose_apply(Menu): - bl_label = "Apply" + bl_label = _("Apply") def draw(self, context): layout = self.layout @@ -1443,14 +1445,14 @@ class VIEW3D_MT_edit_mesh(Menu): layout.separator() - layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...") + layout.menu("VIEW3D_MT_uv_map", text=_("UV Unwrap...")) layout.separator() - layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region") - layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual") + layout.operator("view3d.edit_mesh_extrude_move_normal", text=_("Extrude Region")) + layout.operator("view3d.edit_mesh_extrude_individual_move", text=_("Extrude Individual")) layout.operator("mesh.duplicate_move") - layout.operator("mesh.delete", text="Delete...") + layout.operator("mesh.delete", text=_("Delete...")) layout.separator() @@ -1478,15 +1480,15 @@ class VIEW3D_MT_edit_mesh_specials(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("mesh.subdivide", text="Subdivide") - layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0 - layout.operator("mesh.merge", text="Merge...") + layout.operator("mesh.subdivide", text=_("Subdivide")) + layout.operator("mesh.subdivide", text=_("Subdivide Smooth")).smoothness = 1.0 + layout.operator("mesh.merge", text=_("Merge...")) layout.operator("mesh.remove_doubles") - layout.operator("mesh.hide", text="Hide") - layout.operator("mesh.reveal", text="Reveal") + layout.operator("mesh.hide", text=_("Hide")) + layout.operator("mesh.reveal", text=_("Reveal")) layout.operator("mesh.select_inverse") layout.operator("mesh.flip_normals") - layout.operator("mesh.vertices_smooth", text="Smooth") + layout.operator("mesh.vertices_smooth", text=_("Smooth")) # layout.operator("mesh.bevel", text="Bevel") layout.operator("mesh.faces_shade_smooth") layout.operator("mesh.faces_shade_flat") @@ -1503,15 +1505,15 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') + prop = layout.operator("wm.context_set_value", text=_("Vertex"), icon='VERTEXSEL') prop.value = "(True, False, False)" prop.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') + prop = layout.operator("wm.context_set_value", text=_("Edge"), icon='EDGESEL') prop.value = "(False, True, False)" prop.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') + prop = layout.operator("wm.context_set_value", text=_("Face"), icon='FACESEL') prop.value = "(False, False, True)" prop.data_path = "tool_settings.mesh_select_mode" @@ -1520,10 +1522,10 @@ class VIEW3D_MT_edit_mesh_extrude(Menu): bl_label = "Extrude" _extrude_funcs = { \ - "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"), - "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"), - "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"), - "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"), + "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text=_("Vertices Only")), + "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text=_("Edges Only")), + "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text=_("Individual Faces")), + "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text=_("Region")), } @staticmethod @@ -1650,28 +1652,28 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.separator() layout.operator("mesh.mark_seam") - layout.operator("mesh.mark_seam", text="Clear Seam").clear = True + layout.operator("mesh.mark_seam", text=_("Clear Seam")).clear = True layout.separator() layout.operator("mesh.mark_sharp") - layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True + layout.operator("mesh.mark_sharp", text=_("Clear Sharp")).clear = True layout.separator() - layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW' - layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW' + layout.operator("mesh.edge_rotate", text=_("Rotate Edge CW")).direction = 'CW' + layout.operator("mesh.edge_rotate", text=_("Rotate Edge CCW")).direction = 'CCW' layout.separator() layout.operator("TRANSFORM_OT_edge_slide") layout.operator("TRANSFORM_OT_edge_crease") - layout.operator("mesh.loop_multi_select", text="Edge Loop") + layout.operator("mesh.loop_multi_select", text=_("Edge Loop")) # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1); # uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0); - layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True + layout.operator("mesh.loop_multi_select", text=_("Edge Ring")).ring = True layout.operator("mesh.loop_to_region") layout.operator("mesh.region_to_loop") @@ -1715,7 +1717,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu): # uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1); # uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0); - layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW' + layout.operator("mesh.edge_rotate", text=_("Rotate Edge CW")).direction = 'CW' layout.separator() @@ -1731,8 +1733,8 @@ class VIEW3D_MT_edit_mesh_normals(Menu): def draw(self, context): layout = self.layout - layout.operator("mesh.normals_make_consistent", text="Recalculate Outside") - layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True + layout.operator("mesh.normals_make_consistent", text=_("Recalculate Outside")) + layout.operator("mesh.normals_make_consistent", text=_("Recalculate Inside")).inside = True layout.separator() @@ -1762,7 +1764,7 @@ def draw_curve(self, context): layout.operator("curve.separate") layout.operator("curve.make_segment") layout.operator("curve.cyclic_toggle") - layout.operator("curve.delete", text="Delete...") + layout.operator("curve.delete", text=_("Delete...")) layout.separator() @@ -1794,7 +1796,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(Menu): edit_object = context.edit_object if edit_object.type == 'CURVE': - layout.operator("transform.transform", text="Tilt").mode = 'TILT' + layout.operator("transform.transform", text=_("Tilt")).mode = 'TILT' layout.operator("curve.tilt_clear") layout.operator("curve.separate") @@ -1855,10 +1857,10 @@ class VIEW3D_MT_edit_font(Menu): layout.separator() - layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD' - layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC' - layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE' - layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS' + layout.operator("font.style_toggle", text=_("Toggle Bold")).style = 'BOLD' + layout.operator("font.style_toggle", text=_("Toggle Italic")).style = 'ITALIC' + layout.operator("font.style_toggle", text=_("Toggle Underline")).style = 'UNDERLINE' + layout.operator("font.style_toggle", text=_("Toggle Small Caps")).style = 'SMALL_CAPS' class VIEW3D_MT_edit_text_chars(Menu): @@ -1915,7 +1917,7 @@ class VIEW3D_MT_edit_meta(Menu): layout.separator() - layout.operator("mball.delete_metaelems", text="Delete...") + layout.operator("mball.delete_metaelems", text=_("Delete...")) layout.operator("mball.duplicate_metaelems") layout.separator() @@ -1934,9 +1936,9 @@ class VIEW3D_MT_edit_meta_showhide(Menu): def draw(self, context): layout = self.layout - layout.operator("mball.reveal_metaelems", text="Show Hidden") - layout.operator("mball.hide_metaelems", text="Hide Selected") - layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True + layout.operator("mball.reveal_metaelems", text=_("Show Hidden")) + layout.operator("mball.hide_metaelems", text=_("Hide Selected")) + layout.operator("mball.hide_metaelems", text=_("Hide Unselected")).unselected = True class VIEW3D_MT_edit_lattice(Menu): @@ -1990,15 +1992,15 @@ class VIEW3D_MT_edit_armature(Menu): layout.separator() - layout.operator("armature.subdivide", text="Subdivide") - layout.operator("armature.switch_direction", text="Switch Direction") + layout.operator("armature.subdivide", text=_("Subdivide")) + layout.operator("armature.switch_direction", text=_("Switch Direction")) layout.separator() layout.operator_context = 'EXEC_AREA' - layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS' - layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS' - layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS' + layout.operator("armature.autoside_names", text=_("AutoName Left/Right")).type = 'XAXIS' + layout.operator("armature.autoside_names", text=_("AutoName Front/Back")).type = 'YAXIS' + layout.operator("armature.autoside_names", text=_("AutoName Top/Bottom")).type = 'ZAXIS' layout.operator("armature.flip_names") layout.separator() @@ -2013,7 +2015,7 @@ class VIEW3D_MT_edit_armature(Menu): layout.separator() - layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings") + layout.menu("VIEW3D_MT_bone_options_toggle", text=_("Bone Settings")) class VIEW3D_MT_armature_specials(Menu): @@ -2024,16 +2026,16 @@ class VIEW3D_MT_armature_specials(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("armature.subdivide", text="Subdivide") - layout.operator("armature.switch_direction", text="Switch Direction") + layout.operator("armature.subdivide", text=_("Subdivide")) + layout.operator("armature.switch_direction", text=_("Switch Direction")) layout.separator() layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS' - layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS' - layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS' - layout.operator("armature.flip_names", text="Flip Names") + layout.operator("armature.autoside_names", text=_("AutoName Left/Right")).type = 'XAXIS' + layout.operator("armature.autoside_names", text=_("AutoName Front/Back")).type = 'YAXIS' + layout.operator("armature.autoside_names", text=_("AutoName Top/Bottom")).type = 'ZAXIS' + layout.operator("armature.flip_names", text=_("Flip Names")) class VIEW3D_MT_edit_armature_parent(Menu): @@ -2042,8 +2044,8 @@ class VIEW3D_MT_edit_armature_parent(Menu): def draw(self, context): layout = self.layout - layout.operator("armature.parent_set", text="Make") - layout.operator("armature.parent_clear", text="Clear") + layout.operator("armature.parent_set", text=_("Make")) + layout.operator("armature.parent_clear", text=_("Clear")) class VIEW3D_MT_edit_armature_roll(Menu): @@ -2056,7 +2058,7 @@ class VIEW3D_MT_edit_armature_roll(Menu): layout.separator() - layout.operator("transform.transform", text="Set Roll").mode = 'BONE_ROLL' + layout.operator("transform.transform", text=_("Set Roll")).mode = 'BONE_ROLL' # ********** Panel ********** @@ -2079,26 +2081,26 @@ class VIEW3D_PT_view3d_properties(Panel): col = layout.column() col.active = view.region_3d.view_perspective != 'CAMERA' col.prop(view, "lens") - col.label(text="Lock to Object:") + col.label(text=_("Lock to Object:")) col.prop(view, "lock_object", text="") lock_object = view.lock_object if lock_object: if lock_object.type == 'ARMATURE': col.prop_search(view, "lock_bone", lock_object.data, "edit_bones" if lock_object.mode == 'EDIT' else "bones", text="") else: - col.prop(view, "lock_cursor", text="Lock to Cursor") + col.prop(view, "lock_cursor", text=_("Lock to Cursor")) col = layout.column() col.prop(view, "lock_camera") col = layout.column(align=True) - col.label(text="Clip:") - col.prop(view, "clip_start", text="Start") - col.prop(view, "clip_end", text="End") + col.label(text=_("Clip:")) + col.prop(view, "clip_start", text=_("Start")) + col.prop(view, "clip_end", text=_("End")) subcol = col.column() subcol.enabled = not view.lock_camera_and_layers - subcol.label(text="Local Camera:") + subcol.label(text=_("Local Camera:")) subcol.prop(view, "camera", text="") layout.column().prop(view, "cursor_location") @@ -2164,7 +2166,7 @@ class VIEW3D_PT_view3d_display(Panel): col = layout.column() col.active = display_all split = col.split(percentage=0.55) - split.prop(view, "show_floor", text="Grid Floor") + split.prop(view, "show_floor", text=_("Grid Floor")) row = split.row(align=True) row.prop(view, "show_axis_x", text="X", toggle=True) @@ -2173,14 +2175,14 @@ class VIEW3D_PT_view3d_display(Panel): sub = col.column(align=True) sub.active = (display_all and view.show_floor) - sub.prop(view, "grid_lines", text="Lines") - sub.prop(view, "grid_scale", text="Scale") + sub.prop(view, "grid_lines", text=_("Lines")) + sub.prop(view, "grid_scale", text=_("Scale")) subsub = sub.column(align=True) subsub.active = scene.unit_settings.system == 'NONE' - subsub.prop(view, "grid_subdivisions", text="Subdivisions") + subsub.prop(view, "grid_subdivisions", text=_("Subdivisions")) col = layout.column() - col.label(text="Shading:") + col.label(text=_("Shading:")) col.prop(gs, "material_mode", text="") col.prop(view, "show_textured_solid") @@ -2188,7 +2190,7 @@ class VIEW3D_PT_view3d_display(Panel): region = view.region_quadview - layout.operator("screen.region_quadview", text="Toggle Quad View") + layout.operator("screen.region_quadview", text=_("Toggle Quad View")) if region: col = layout.column() @@ -2217,22 +2219,22 @@ class VIEW3D_PT_view3d_meshdisplay(Panel): mesh = context.active_object.data col = layout.column() - col.label(text="Overlays:") - col.prop(mesh, "show_edges", text="Edges") - col.prop(mesh, "show_faces", text="Faces") - col.prop(mesh, "show_edge_crease", text="Creases") - col.prop(mesh, "show_edge_bevel_weight", text="Bevel Weights") - col.prop(mesh, "show_edge_seams", text="Seams") - col.prop(mesh, "show_edge_sharp", text="Sharp") + col.label(text=_("Overlays:")) + col.prop(mesh, "show_edges", text=_("Edges")) + col.prop(mesh, "show_faces", text=_("Faces")) + col.prop(mesh, "show_edge_crease", text=_("Creases")) + col.prop(mesh, "show_edge_bevel_weight", text=_("Bevel Weights")) + col.prop(mesh, "show_edge_seams", text=_("Seams")) + col.prop(mesh, "show_edge_sharp", text=_("Sharp")) col.separator() - col.label(text="Normals:") - col.prop(mesh, "show_normal_face", text="Face") - col.prop(mesh, "show_normal_vertex", text="Vertex") - col.prop(context.scene.tool_settings, "normal_size", text="Normal Size") + col.label(text=_("Normals:")) + col.prop(mesh, "show_normal_face", text=_("Face")) + col.prop(mesh, "show_normal_vertex", text=_("Vertex")) + col.prop(context.scene.tool_settings, "normal_size", text=_("Normal Size")) col.separator() - col.label(text="Numerics:") + col.label(text=_("Numerics:")) col.prop(mesh, "show_extra_edge_length") col.prop(mesh, "show_extra_face_angle") col.prop(mesh, "show_extra_face_area") @@ -2254,10 +2256,10 @@ class VIEW3D_PT_view3d_curvedisplay(Panel): curve = context.active_object.data col = layout.column() - col.label(text="Overlays:") - col.prop(curve, "show_handles", text="Handles") - col.prop(curve, "show_normal_face", text="Normals") - col.prop(context.scene.tool_settings, "normal_size", text="Normal Size") + col.label(text=_("Overlays:")) + col.prop(curve, "show_handles", text=_("Handles")) + col.prop(curve, "show_normal_face", text=_("Normals")) + col.prop(context.scene.tool_settings, "normal_size", text=_("Normal Size")) class VIEW3D_PT_background_image(Panel): @@ -2284,7 +2286,7 @@ class VIEW3D_PT_background_image(Panel): view = context.space_data col = layout.column() - col.operator("view3d.background_image_add", text="Add Image") + col.operator("view3d.background_image_add", text=_("Add Image")) for i, bg in enumerate(view.background_images): layout.active = view.show_background_images @@ -2294,10 +2296,10 @@ class VIEW3D_PT_background_image(Panel): if bg.image: row.prop(bg.image, "name", text="", emboss=False) else: - row.label(text="Not Set") + row.label(text=_("Not Set")) row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i - box.prop(bg, "view_axis", text="Axis") + box.prop(bg, "view_axis", text=_("Axis")) if bg.show_expanded: row = box.row() @@ -2332,13 +2334,13 @@ class VIEW3D_PT_transform_orientations(Panel): col = layout.column() col.prop(view, "transform_orientation") - col.operator("transform.create_orientation", text="Create") + col.operator("transform.create_orientation", text=_("Create")) orientation = view.current_orientation if orientation: col.prop(orientation, "name") - col.operator("transform.delete_orientation", text="Delete") + col.operator("transform.delete_orientation", text=_("Delete")) class VIEW3D_PT_etch_a_ton(Panel): @@ -2383,7 +2385,7 @@ class VIEW3D_PT_etch_a_ton(Panel): col.prop(toolsettings, "etch_number") col.prop(toolsettings, "etch_side") - col.operator("sketch.convert", text="Convert") + col.operator("sketch.convert", text=_("Convert")) class VIEW3D_PT_context_properties(Panel): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 4b2ee57df68..6bd2168dab9 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel +from blf import gettext as _ class View3DPanel(): @@ -31,33 +32,33 @@ class View3DPanel(): # History/Repeat tools def draw_repeat_tools(context, layout): col = layout.column(align=True) - col.label(text="Repeat:") + col.label(text=_("Repeat:")) col.operator("screen.repeat_last") - col.operator("screen.repeat_history", text="History...") + col.operator("screen.repeat_history", text=_("History...")) # Keyframing tools def draw_keyframing_tools(context, layout): col = layout.column(align=True) - col.label(text="Keyframes:") + col.label(text=_("Keyframes:")) row = col.row() - row.operator("anim.keyframe_insert_menu", text="Insert") - row.operator("anim.keyframe_delete_v3d", text="Remove") + row.operator("anim.keyframe_insert_menu", text=_("Insert")) + row.operator("anim.keyframe_delete_v3d", text=_("Remove")) # Grease Pencil tools def draw_gpencil_tools(context, layout): col = layout.column(align=True) - col.label(text="Grease Pencil:") + col.label(text=_("Grease Pencil:")) row = col.row() - row.operator("gpencil.draw", text="Draw").mode = 'DRAW' - row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' + row.operator("gpencil.draw", text=_("Draw")).mode = 'DRAW' + row.operator("gpencil.draw", text=_("Line")).mode = 'DRAW_STRAIGHT' row = col.row() - row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' - row.operator("gpencil.draw", text="Erase").mode = 'ERASER' + row.operator("gpencil.draw", text=_("Poly")).mode = 'DRAW_POLY' + row.operator("gpencil.draw", text=_("Erase")).mode = 'ERASER' row = col.row() row.prop(context.tool_settings, "use_grease_pencil_sessions") @@ -73,16 +74,16 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): layout = self.layout col = layout.column(align=True) - col.label(text="Transform:") + col.label(text=_("Transform:")) col.operator("transform.translate") col.operator("transform.rotate") - col.operator("transform.resize", text="Scale") + col.operator("transform.resize", text=_("Scale")) col = layout.column(align=True) - col.operator("object.origin_set", text="Origin") + col.operator("object.origin_set", text=_("Origin")) col = layout.column(align=True) - col.label(text="Object:") + col.label(text=_("Object:")) col.operator("object.duplicate_move") col.operator("object.delete") col.operator("object.join") @@ -91,17 +92,17 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): if active_object and active_object.type == 'MESH': col = layout.column(align=True) - col.label(text="Shading:") + col.label(text=_("Shading:")) row = col.row(align=True) - row.operator("object.shade_smooth", text="Smooth") - row.operator("object.shade_flat", text="Flat") + row.operator("object.shade_smooth", text=_("Smooth")) + row.operator("object.shade_flat", text=_("Flat")) draw_keyframing_tools(context, layout) col = layout.column(align=True) - col.label(text="Motion Paths:") - col.operator("object.paths_calculate", text="Calculate Paths") - col.operator("object.paths_clear", text="Clear Paths") + col.label(text=_("Motion Paths:")) + col.operator("object.paths_calculate", text=_("Calculate Paths")) + col.operator("object.paths_clear", text=_("Clear Paths")) draw_repeat_tools(context, layout) @@ -122,8 +123,8 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): col.operator("transform.translate") col.operator("transform.rotate") col.operator("transform.resize", text="Scale") - col.operator("transform.shrink_fatten", text="Shrink/Fatten") - col.operator("transform.push_pull", text="Push/Pull") + col.operator("transform.shrink_fatten", text=_("Shrink/Fatten")) + col.operator("transform.push_pull", text=_("Push/Pull")) col = layout.column(align=True) col.label(text="Deform:") @@ -646,6 +647,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): elif context.weight_paint_object and brush: layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True) layout.prop(context.tool_settings, "use_auto_normalize", text="Auto Normalize") + layout.prop(context.tool_settings, "use_multipaint", text="Multi-Paint") col = layout.column() @@ -1015,7 +1017,7 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel): brush = settings.brush if brush is None: # unlikely but can happen - layout.label(text="Brush Unset") + layout.label(text=_("Brush Unset")) return col = layout.column() @@ -1058,6 +1060,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel): col.operator("object.vertex_group_invert", text="Invert") col.operator("object.vertex_group_clean", text="Clean") col.operator("object.vertex_group_levels", text="Levels") + col.operator("object.vertex_group_fix", text="Fix Deforms") class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): diff --git a/release/scripts/templates/operator_export.py b/release/scripts/templates/operator_export.py index b1d53e6ee0c..3a7040ae2d2 100644 --- a/release/scripts/templates/operator_export.py +++ b/release/scripts/templates/operator_export.py @@ -41,7 +41,7 @@ class ExportSomeData(bpy.types.Operator, ExportHelper): name="Example Enum", description="Choose between two items", items=(('OPT_A', "First Option", "Description one"), - ('OPT_B', "Second Option", "Description two.")), + ('OPT_B', "Second Option", "Description two")), default='OPT_A', ) diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c index b7f6a58b6d7..7050aec9bf6 100644 --- a/source/blender/avi/intern/avirgb.c +++ b/source/blender/avi/intern/avirgb.c @@ -42,11 +42,6 @@ #include "MEM_guardedalloc.h" #include "avirgb.h" -#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -#define WORDS_BIGENDIAN -#endif - - /* implementation */ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) { @@ -63,9 +58,9 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu if (bits==16) { unsigned short *pxl; unsigned char *to; - #ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ unsigned char *pxla; - #endif +#endif buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromavirgbbuf"); @@ -75,19 +70,19 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu while (y--) { pxl= (unsigned short *) (buffer + y * movie->header->Width * 2); - #ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ pxla= (unsigned char *)pxl; - #endif +#endif x= movie->header->Width; while (x--) { - #ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ i= pxla[0]; pxla[0]= pxla[1]; pxla[1]= i; pxla+=2; - #endif +#endif *(to++)= ((*pxl>>10)&0x1f)*8; *(to++)= ((*pxl>>5)&0x1f)*8; diff --git a/source/blender/avi/intern/endian.c b/source/blender/avi/intern/endian.c index a985e8c3d5e..50ec2330beb 100644 --- a/source/blender/avi/intern/endian.c +++ b/source/blender/avi/intern/endian.c @@ -43,11 +43,7 @@ #include "endian.h" #include "avi_intern.h" -#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -#define WORDS_BIGENDIAN -#endif - -#ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ static void invert (int *num) { int new=0,i,j; @@ -79,7 +75,7 @@ static void Ichunk (AviChunk *chunk) { } #endif -#ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ static void Ilist (AviList *list){ invert (&list->fcc); invert (&list->size); @@ -159,10 +155,10 @@ static void Iindexe (AviIndexEntry *indexe) { invert (&indexe->Offset); invert (&indexe->Size); } -#endif /* WORDS_BIGENDIAN */ +#endif /* __BIG_ENDIAN__ */ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int type) { -#ifdef WORDS_BIGENDIAN +#ifdef __BIG_ENDIAN__ void *data; data = MEM_mallocN (size, "avi endian"); @@ -209,9 +205,9 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t } MEM_freeN (data); -#else /* WORDS_BIGENDIAN */ +#else /* __BIG_ENDIAN__ */ (void)movie; /* unused */ (void)type; /* unused */ fwrite (datain, block, size, fp); -#endif /* WORDS_BIGENDIAN */ +#endif /* __BIG_ENDIAN__ */ } diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 57f8c83eda6..1bb61d02b78 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -66,7 +66,7 @@ void BLF_size(int fontid, int size, int dpi); | m[3] m[7] m[11] m[15] | */ -void BLF_matrix(int fontid, double *m); +void BLF_matrix(int fontid, const double m[16]); /* Draw the string using the default font, size and dpi. */ void BLF_draw_default(float x, float y, float z, const char *str, size_t len); @@ -178,20 +178,6 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a); */ void BLF_draw_buffer(int fontid, const char *str); -/* - * Search the path directory to the locale files, this try all - * the case for Linux, Win and Mac. - */ -void BLF_lang_init(void); - -/* Set the current locale. */ -void BLF_lang_set(const char *); - -/* Set the current encoding name. */ -void BLF_lang_encoding_name(const char *str); - -void BLF_lang_encoding(const char *str); - /* Add a path to the font dir paths. */ void BLF_dir_add(const char *path); diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h new file mode 100644 index 00000000000..4377d391354 --- /dev/null +++ b/source/blender/blenfont/BLF_translation.h @@ -0,0 +1,66 @@ +/* + * $Id$ + * + * ***** 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) 2011 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenfont/BLF_translation.h + * \ingroup blf + */ + + +#ifndef BLF_TRANSLATION_H +#define BLF_TRANSLATION_H + +/* blf_translation.c */ + +#ifdef INTERNATIONAL +unsigned char *BLF_get_unifont(int *unifont_size); +void BLF_free_unifont(void); +#endif + +const char* BLF_gettext(const char *msgid); + +/* blf_lang.c */ + +/* + * Search the path directory to the locale files, this try all + * the case for Linux, Win and Mac. + */ +void BLF_lang_init(void); + +/* Set the current locale. */ +void BLF_lang_set(const char *); + +/* Set the current encoding name. */ +void BLF_lang_encoding_name(const char *str); + +void BLF_lang_encoding(const char *str); + +#define _(msgid) BLF_gettext(msgid) +#define N_(msgid) msgid + +#endif /* BLF_TRANSLATION_H */ diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index 82099d4f125..b87a3b88f07 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -42,9 +42,11 @@ set(SRC intern/blf_font.c intern/blf_glyph.c intern/blf_lang.c + intern/blf_translation.c intern/blf_util.c BLF_api.h + BLF_translation.h intern/blf_internal.h intern/blf_internal_types.h ) @@ -56,9 +58,5 @@ if(WITH_INTERNATIONAL) add_definitions(-DINTERNATIONAL) endif() -if(WIN32 AND NOT UNIX) - add_definitions(-DUSE_GETTEXT_DLL) -endif() - blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index 2763bea0da0..45a55793856 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -13,7 +13,6 @@ defs = [] if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross': defs.append('_WIN32') - defs.append('USE_GETTEXT_DLL') if env['WITH_BF_INTERNATIONAL']: defs.append('INTERNATIONAL') diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 577697de594..cccecd00bf7 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -6,7 +6,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. + * 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 @@ -20,7 +20,7 @@ * The Original Code is Copyright (C) 2009 Blender Foundation. * All rights reserved. * - * + * * Contributor(s): Blender Foundation * * ***** END GPL LICENSE BLOCK ***** @@ -78,8 +78,8 @@ int blf_mono_font_render= -1; static FontBLF *BLF_get(int fontid) { if (fontid >= 0 && fontid < BLF_MAX_FONT) - return(global_font[fontid]); - return(NULL); + return global_font[fontid]; + return NULL; } int BLF_init(int points, int dpi) @@ -91,7 +91,7 @@ int BLF_init(int points, int dpi) global_font_points= points; global_font_dpi= dpi; - return(blf_font_init()); + return blf_font_init(); } void BLF_exit(void) @@ -128,9 +128,9 @@ static int blf_search(const char *name) for (i= 0; i < BLF_MAX_FONT; i++) { font= global_font[i]; if (font && (!strcmp(font->name, name))) - return(i); + return i; } - return(-1); + return -1; } int BLF_load(const char *name) @@ -140,24 +140,24 @@ int BLF_load(const char *name) int i; if (!name) - return(-1); + return -1; /* check if we already load this font. */ i= blf_search(name); if (i >= 0) { /*font= global_font[i];*/ /*UNUSED*/ - return(i); + return i; } if (global_font_num+1 >= BLF_MAX_FONT) { printf("Too many fonts!!!\n"); - return(-1); + return -1; } filename= blf_dir_search(name); if (!filename) { printf("Can't find font: %s\n", name); - return(-1); + return -1; } font= blf_font_new(name, filename); @@ -165,13 +165,13 @@ int BLF_load(const char *name) if (!font) { printf("Can't load font: %s\n", name); - return(-1); + return -1; } global_font[global_font_num]= font; i= global_font_num; global_font_num++; - return(i); + return i; } int BLF_load_unique(const char *name) @@ -181,20 +181,20 @@ int BLF_load_unique(const char *name) int i; if (!name) - return(-1); + return -1; /* Don't search in the cache!! make a new * object font, this is for keep fonts threads safe. */ if (global_font_num+1 >= BLF_MAX_FONT) { printf("Too many fonts!!!\n"); - return(-1); + return -1; } filename= blf_dir_search(name); if (!filename) { printf("Can't find font: %s\n", name); - return(-1); + return -1; } font= blf_font_new(name, filename); @@ -202,22 +202,22 @@ int BLF_load_unique(const char *name) if (!font) { printf("Can't load font: %s\n", name); - return(-1); + return -1; } global_font[global_font_num]= font; i= global_font_num; global_font_num++; - return(i); + return i; } void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { blf_font_attach_from_mem(font, mem, mem_size); + } } int BLF_load_mem(const char *name, unsigned char *mem, int mem_size) @@ -226,34 +226,34 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size) int i; if (!name) - return(-1); + return -1; i= blf_search(name); if (i >= 0) { /*font= global_font[i];*/ /*UNUSED*/ - return(i); + return i; } if (global_font_num+1 >= BLF_MAX_FONT) { printf("Too many fonts!!!\n"); - return(-1); + return -1; } if (!mem || !mem_size) { printf("Can't load font: %s from memory!!\n", name); - return(-1); + return -1; } font= blf_font_new_from_mem(name, mem, mem_size); if (!font) { printf("Can't load font: %s from memory!!\n", name); - return(-1); + return -1; } global_font[global_font_num]= font; i= global_font_num; global_font_num++; - return(i); + return i; } int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size) @@ -262,7 +262,7 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size) int i; if (!name) - return(-1); + return -1; /* * Don't search in the cache, make a new object font! @@ -270,67 +270,66 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size) */ if (global_font_num+1 >= BLF_MAX_FONT) { printf("Too many fonts!!!\n"); - return(-1); + return -1; } if (!mem || !mem_size) { printf("Can't load font: %s from memory!!\n", name); - return(-1); + return -1; } font= blf_font_new_from_mem(name, mem, mem_size); if (!font) { printf("Can't load font: %s from memory!!\n", name); - return(-1); + return -1; } global_font[global_font_num]= font; i= global_font_num; global_font_num++; - return(i); + return i; } void BLF_enable(int fontid, int option) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { font->flags |= option; + } } void BLF_disable(int fontid, int option) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { font->flags &= ~option; + } } void BLF_enable_default(int option) { - FontBLF *font; + FontBLF *font= BLF_get(global_font_default); - font= BLF_get(global_font_default); - if (font) + if (font) { font->flags |= option; + } } void BLF_disable_default(int option) { - FontBLF *font; + FontBLF *font= BLF_get(global_font_default); - font= BLF_get(global_font_default); - if (font) + if (font) { font->flags &= ~option; + } } void BLF_aspect(int fontid, float x, float y, float z) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->aspect[0]= x; font->aspect[1]= y; @@ -338,26 +337,23 @@ void BLF_aspect(int fontid, float x, float y, float z) } } -void BLF_matrix(int fontid, double *m) +void BLF_matrix(int fontid, const double m[16]) { - FontBLF *font; - int i; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { - for (i= 0; i < 16; i++) - font->m[i]= m[i]; + memcpy(font->m, m, sizeof(font->m)); } } void BLF_position(int fontid, float x, float y, float z) { - FontBLF *font; - float remainder; - float xa, ya, za; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { + float xa, ya, za; + float remainder; + if (font->flags & BLF_ASPECT) { xa= font->aspect[0]; ya= font->aspect[1]; @@ -401,20 +397,20 @@ void BLF_position(int fontid, float x, float y, float z) void BLF_size(int fontid, int size, int dpi) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { blf_font_size(font, size, dpi); + } } void BLF_blur(int fontid, int size) { - FontBLF *font; - - font= BLF_get(fontid); - if (font) + FontBLF *font= BLF_get(fontid); + + if (font) { font->blur= size; + } } void BLF_draw_default(float x, float y, float z, const char *str, size_t len) @@ -456,11 +452,11 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l void BLF_rotation_default(float angle) { - FontBLF *font; + FontBLF *font= BLF_get(global_font_default); - font= BLF_get(global_font_default); - if (font) + if (font) { font->angle= angle; + } } static void blf_draw__start(FontBLF *font) @@ -505,7 +501,8 @@ static void blf_draw__end(void) void BLF_draw(int fontid, const char *str, size_t len) { FontBLF *font= BLF_get(fontid); - if (font) { + + if (font && font->glyph_cache) { blf_draw__start(font); blf_font_draw(font, str, len); blf_draw__end(); @@ -515,7 +512,8 @@ void BLF_draw(int fontid, const char *str, size_t len) void BLF_draw_ascii(int fontid, const char *str, size_t len) { FontBLF *font= BLF_get(fontid); - if (font) { + + if (font && font->glyph_cache) { blf_draw__start(font); blf_font_draw_ascii(font, str, len); blf_draw__end(); @@ -524,148 +522,141 @@ void BLF_draw_ascii(int fontid, const char *str, size_t len) void BLF_boundbox(int fontid, const char *str, rctf *box) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { blf_font_boundbox(font, str, box); + } } void BLF_width_and_height(int fontid, const char *str, float *width, float *height) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font && font->glyph_cache) { blf_font_width_and_height(font, str, width, height); + } } float BLF_width(int fontid, const char *str) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); + + if (font && font->glyph_cache) { + return blf_font_width(font, str); + } - font= BLF_get(fontid); - if (font) - return(blf_font_width(font, str)); - return(0.0f); + return 0.0f; } float BLF_fixed_width(int fontid) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) - return(blf_font_fixed_width(font)); - return(0.0f); + if (font && font->glyph_cache) { + return blf_font_fixed_width(font); + } + + return 0.0f; } float BLF_width_default(const char *str) { - float width; - if (global_font_default == -1) global_font_default= blf_search("default"); if (global_font_default == -1) { printf("Error: Can't found default font!!\n"); - return(0.0f); + return 0.0f; } BLF_size(global_font_default, global_font_points, global_font_dpi); - width= BLF_width(global_font_default, str); - return(width); + return BLF_width(global_font_default, str); } float BLF_height(int fontid, const char *str) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); + + if (font && font->glyph_cache) { + return blf_font_height(font, str); + } - font= BLF_get(fontid); - if (font) - return(blf_font_height(font, str)); - return(0.0f); + return 0.0f; } float BLF_height_max(int fontid) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) { - if(font->glyph_cache) - return(font->glyph_cache->max_glyph_height); + if (font && font->glyph_cache) { + return font->glyph_cache->max_glyph_height; } - return(0.0f); + + return 0.0f; } float BLF_width_max(int fontid) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) { - if(font->glyph_cache) - return(font->glyph_cache->max_glyph_width); + if (font && font->glyph_cache) { + return font->glyph_cache->max_glyph_width; } - return(0.0f); + + return 0.0f; } float BLF_descender(int fontid) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) { - if(font->glyph_cache) - return(font->glyph_cache->descender); + if (font && font->glyph_cache) { + return font->glyph_cache->descender; } - return(0.0f); + + return 0.0f; } float BLF_ascender(int fontid) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) { - if(font->glyph_cache) - return(font->glyph_cache->ascender); + if (font && font->glyph_cache) { + return font->glyph_cache->ascender; } - return(0.0f); + + return 0.0f; } float BLF_height_default(const char *str) { - float height; - if (global_font_default == -1) global_font_default= blf_search("default"); if (global_font_default == -1) { printf("Error: Can't found default font!!\n"); - return(0.0f); + return 0.0f; } BLF_size(global_font_default, global_font_points, global_font_dpi); - height= BLF_height(global_font_default, str); - return(height); + + return BLF_height(global_font_default, str); } void BLF_rotation(int fontid, float angle) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font) { font->angle= angle; + } } void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->clip_rec.xmin= xmin; font->clip_rec.ymin= ymin; @@ -676,9 +667,8 @@ void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax) void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax) { - FontBLF *font; + FontBLF *font= BLF_get(global_font_default); - font= BLF_get(global_font_default); if (font) { font->clip_rec.xmin= xmin; font->clip_rec.ymin= ymin; @@ -689,9 +679,8 @@ void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax) void BLF_shadow(int fontid, int level, float r, float g, float b, float a) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->shadow= level; font->shadow_col[0]= r; @@ -703,9 +692,8 @@ void BLF_shadow(int fontid, int level, float r, float g, float b, float a) void BLF_shadow_offset(int fontid, int x, int y) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->shadow_x= x; font->shadow_y= y; @@ -714,9 +702,8 @@ void BLF_shadow_offset(int fontid, int x, int y) void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->b_fbuf= fbuf; font->b_cbuf= cbuf; @@ -728,9 +715,8 @@ void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int void BLF_buffer_col(int fontid, float r, float g, float b, float a) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); if (font) { font->b_col[0]= r; font->b_col[1]= g; @@ -741,9 +727,9 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a) void BLF_draw_buffer(int fontid, const char *str) { - FontBLF *font; + FontBLF *font= BLF_get(fontid); - font= BLF_get(fontid); - if (font) + if (font && font->glyph_cache && (font->b_fbuf || font->b_cbuf)) { blf_font_buffer(font, str); + } } diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index fd874d991ea..46be49b37e9 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -62,10 +62,10 @@ static DirBLF *blf_dir_find(const char *path) p= global_font_dir.first; while (p) { if (BLI_path_cmp(p->path, path) == 0) - return(p); + return p; p= p->next; } - return(NULL); + return NULL; } void BLF_dir_add(const char *path) @@ -76,7 +76,7 @@ void BLF_dir_add(const char *path) if (dir) /* already in the list ? just return. */ return; - dir= (DirBLF *)MEM_mallocN(sizeof(DirBLF), "BLF_dir_add"); + dir= (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add"); dir->path= BLI_strdup(path); BLI_addhead(&global_font_dir, dir); } @@ -102,9 +102,9 @@ char **BLF_dir_get(int *ndir) count= BLI_countlist(&global_font_dir); if (!count) - return(NULL); + return NULL; - dirs= (char **)MEM_mallocN(sizeof(char *) * count, "BLF_dir_get"); + dirs= (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get"); p= global_font_dir.first; i= 0; while (p) { @@ -113,7 +113,7 @@ char **BLF_dir_get(int *ndir) p= p->next; } *ndir= i; - return(dirs); + return dirs; } void BLF_dir_free(char **dirs, int count) @@ -147,8 +147,8 @@ char *blf_dir_search(const char *file) if (BLI_exist(file)) s= BLI_strdup(file); } - - return(s); + + return s; } #if 0 // UNUSED @@ -171,9 +171,9 @@ int blf_dir_split(const char *str, char *file, int *size) file[i+4]= '\0'; s++; *size= atoi(s); - return(1); + return 1; } - return(0); + return 0; } #endif @@ -188,9 +188,9 @@ char *blf_dir_metrics_search(const char *filename) mfile= BLI_strdup(filename); s= strrchr(mfile, '.'); if (s) { - if (strlen(s) < 4) { + if (BLI_strnlen(s, 4) < 4) { MEM_freeN(mfile); - return(NULL); + return NULL; } s++; s[0]= 'a'; @@ -199,14 +199,14 @@ char *blf_dir_metrics_search(const char *filename) /* first check .afm */ if (BLI_exist(s)) - return(s); + return s; /* and now check .pfm */ s[0]= 'p'; if (BLI_exist(s)) - return(s); + return s; } MEM_freeN(mfile); - return(NULL); + return NULL; } diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 3bec7dd2626..26af3a3fd4f 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -62,7 +62,7 @@ static FT_Library ft_lib; int blf_font_init(void) { - return(FT_Init_FreeType(&ft_lib)); + return FT_Init_FreeType(&ft_lib); } void blf_font_exit(void) @@ -136,26 +136,33 @@ static void blf_font_ensure_ascii_table(FontBLF *font) } \ +#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \ + const short has_kerning= FT_HAS_KERNING((_font)->face); \ + const FT_UInt kern_mode= (has_kerning == 0) ? 0 : \ + (((_font)->flags & BLF_KERNING_DEFAULT) ? \ + ft_kerning_default : FT_KERNING_UNFITTED) \ + \ + + +#define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x) \ +{ \ + if (g_prev) { \ + delta.x= delta.y= 0; \ + if (FT_Get_Kerning((_font)->face, g_prev->idx, g->idx, kern_mode, &delta) == 0) \ + pen_x += delta.x >> 6; \ + } \ +} \ void blf_font_draw(FontBLF *font, const char *str, unsigned int len) { unsigned int c; - GlyphBLF *g, *g_prev; + GlyphBLF *g, *g_prev= NULL; FT_Vector delta; - int pen_x, pen_y; - int has_kerning, st; - unsigned int i; - GlyphBLF **glyph_ascii_table; - - if (!font->glyph_cache) - return; - glyph_ascii_table= font->glyph_cache->glyph_ascii_table; + int pen_x= 0, pen_y= 0; + unsigned int i= 0; + GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; - i= 0; - pen_x= 0; - pen_y= 0; - has_kerning= FT_HAS_KERNING(font->face); - g_prev= NULL; + BLF_KERNING_VARS(font, has_kerning, kern_mode); blf_font_ensure_ascii_table(font); @@ -163,25 +170,9 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len) BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) - break; - - /* if we don't found a glyph, skip it. */ - if (!g) - continue; - - if (has_kerning && g_prev) { - delta.x= 0; - delta.y= 0; - - if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); - else - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); - - if (st == 0) - pen_x += delta.x >> 6; - } + if (c == 0) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); /* do not return this loop if clipped, we want every character tested */ blf_glyph_render(font, g, (float)pen_x, (float)pen_y); @@ -194,43 +185,19 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len) /* faster version of blf_font_draw, ascii only for view dimensions */ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len) { - char c; - GlyphBLF *g, *g_prev; + unsigned char c; + GlyphBLF *g, *g_prev= NULL; FT_Vector delta; - int pen_x, pen_y; - int has_kerning, st; - GlyphBLF **glyph_ascii_table; - - if (!font->glyph_cache) - return; - glyph_ascii_table= font->glyph_cache->glyph_ascii_table; + int pen_x= 0, pen_y= 0; + GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; - pen_x= 0; - pen_y= 0; - has_kerning= FT_HAS_KERNING(font->face); - g_prev= NULL; + BLF_KERNING_VARS(font, has_kerning, kern_mode); blf_font_ensure_ascii_table(font); while ((c= *(str++)) && len--) { - g= glyph_ascii_table[c]; - - /* if we don't found a glyph, skip it. */ - if (!g) - continue; - - if (has_kerning && g_prev) { - delta.x= 0; - delta.y= 0; - - if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); - else - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); - - if (st == 0) - pen_x += delta.x >> 6; - } + if ((g= glyph_ascii_table[c]) == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); /* do not return this loop if clipped, we want every character tested */ blf_glyph_render(font, g, (float)pen_x, (float)pen_y); @@ -240,59 +207,37 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len) } } +/* Sanity checks are done by BLF_draw_buffer() */ void blf_font_buffer(FontBLF *font, const char *str) { - unsigned char *cbuf; unsigned int c; - unsigned char b_col_char[4]; - GlyphBLF *g, *g_prev; + GlyphBLF *g, *g_prev= NULL; FT_Vector delta; + int pen_x= (int)font->pos[0], pen_y= 0; + unsigned int i= 0; + GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; + + /* buffer spesific vars*/ + const unsigned char b_col_char[4]= {font->b_col[0] * 255, + font->b_col[1] * 255, + font->b_col[2] * 255, + font->b_col[3] * 255}; + unsigned char *cbuf; + int chx, chy; + int y, x; float a, *fbuf; - int pen_x, y, x; - int has_kerning, st, chx, chy; - unsigned int i; - GlyphBLF **glyph_ascii_table; - if (!font->glyph_cache || (!font->b_fbuf && !font->b_cbuf)) - return; - glyph_ascii_table= font->glyph_cache->glyph_ascii_table; - - i= 0; - pen_x= (int)font->pos[0]; - has_kerning= FT_HAS_KERNING(font->face); - g_prev= NULL; - - b_col_char[0]= font->b_col[0] * 255; - b_col_char[1]= font->b_col[1] * 255; - b_col_char[2]= font->b_col[2] * 255; - b_col_char[3]= font->b_col[3] * 255; + BLF_KERNING_VARS(font, has_kerning, kern_mode); blf_font_ensure_ascii_table(font); while (str[i]) { - int pen_y; BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) - break; - - /* if we don't found a glyph, skip it. */ - if (!g) - continue; - - if (has_kerning && g_prev) { - delta.x= 0; - delta.y= 0; - - if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); - else - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); - - if (st == 0) - pen_x += delta.x >> 6; - } + if (c == 0) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); chx= pen_x + ((int)g->pos_x); chy= (int)font->pos[1] + g->height; @@ -392,69 +337,41 @@ void blf_font_buffer(FontBLF *font, const char *str) void blf_font_boundbox(FontBLF *font, const char *str, rctf *box) { unsigned int c; - GlyphBLF *g, *g_prev; + GlyphBLF *g, *g_prev= NULL; FT_Vector delta; + int pen_x= 0, pen_y= 0; + unsigned int i= 0; + GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; + rctf gbox; - int pen_x, pen_y; - int has_kerning, st; - unsigned int i; - GlyphBLF **glyph_ascii_table; - if (!font->glyph_cache) - return; + BLF_KERNING_VARS(font, has_kerning, kern_mode); box->xmin= 32000.0f; box->xmax= -32000.0f; box->ymin= 32000.0f; box->ymax= -32000.0f; - i= 0; - pen_x= 0; - pen_y= 0; - has_kerning= FT_HAS_KERNING(font->face); - g_prev= NULL; - blf_font_ensure_ascii_table(font); - glyph_ascii_table= font->glyph_cache->glyph_ascii_table; while (str[i]) { BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) - break; - - /* if we don't found a glyph, skip it. */ - if (!g) - continue; - - if (has_kerning && g_prev) { - delta.x= 0; - delta.y= 0; - - if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); - else - st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); - - if (st == 0) - pen_x += delta.x >> 6; - } + if (c == 0) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); gbox.xmin= pen_x; gbox.xmax= pen_x + g->advance; gbox.ymin= g->box.ymin + pen_y; gbox.ymax= g->box.ymax + pen_y; - if (gbox.xmin < box->xmin) - box->xmin= gbox.xmin; - if (gbox.ymin < box->ymin) - box->ymin= gbox.ymin; + if (gbox.xmin < box->xmin) box->xmin= gbox.xmin; + if (gbox.ymin < box->ymin) box->ymin= gbox.ymin; - if (gbox.xmax > box->xmax) - box->xmax= gbox.xmax; - if (gbox.ymax > box->ymax) - box->ymax= gbox.ymax; + if (gbox.xmax > box->xmax) box->xmax= gbox.xmax; + if (gbox.ymax > box->ymax) box->ymax= gbox.ymax; pen_x += g->advance; g_prev= g; @@ -473,20 +390,18 @@ void blf_font_width_and_height(FontBLF *font, const char *str, float *width, flo float xa, ya; rctf box; - if (font->glyph_cache) { - if (font->flags & BLF_ASPECT) { - xa= font->aspect[0]; - ya= font->aspect[1]; - } - else { - xa= 1.0f; - ya= 1.0f; - } - - blf_font_boundbox(font, str, &box); - *width= ((box.xmax - box.xmin) * xa); - *height= ((box.ymax - box.ymin) * ya); + if (font->flags & BLF_ASPECT) { + xa= font->aspect[0]; + ya= font->aspect[1]; + } + else { + xa= 1.0f; + ya= 1.0f; } + + blf_font_boundbox(font, str, &box); + *width= ((box.xmax - box.xmin) * xa); + *height= ((box.ymax - box.ymin) * ya); } float blf_font_width(FontBLF *font, const char *str) @@ -494,16 +409,13 @@ float blf_font_width(FontBLF *font, const char *str) float xa; rctf box; - if (!font->glyph_cache) - return(0.0f); - if (font->flags & BLF_ASPECT) xa= font->aspect[0]; else xa= 1.0f; blf_font_boundbox(font, str, &box); - return((box.xmax - box.xmin) * xa); + return (box.xmax - box.xmin) * xa; } float blf_font_height(FontBLF *font, const char *str) @@ -511,36 +423,28 @@ float blf_font_height(FontBLF *font, const char *str) float ya; rctf box; - if (!font->glyph_cache) - return(0.0f); - if (font->flags & BLF_ASPECT) ya= font->aspect[1]; else ya= 1.0f; blf_font_boundbox(font, str, &box); - return((box.ymax - box.ymin) * ya); + return (box.ymax - box.ymin) * ya; } float blf_font_fixed_width(FontBLF *font) { - GlyphBLF *g; - FT_UInt glyph_index; - unsigned int c = ' '; - - if (!font->glyph_cache) - return 0.0f; - - glyph_index= FT_Get_Char_Index(font->face, c); - g= blf_glyph_search(font->glyph_cache, c); - if (!g) - g= blf_glyph_add(font, glyph_index, c); - - /* if we don't find the glyph. */ - if (!g) - return 0.0f; - + const unsigned int c = ' '; + GlyphBLF *g= blf_glyph_search(font->glyph_cache, c); + if (!g) { + g= blf_glyph_add(font, FT_Get_Char_Index(font->face, c), c); + + /* if we don't find the glyph. */ + if (!g) { + return 0.0f; + } + } + return g->advance; } @@ -607,11 +511,11 @@ FontBLF *blf_font_new(const char *name, const char *filename) FT_Error err; char *mfile; - font= (FontBLF *)MEM_mallocN(sizeof(FontBLF), "blf_font_new"); + font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new"); err= FT_New_Face(ft_lib, filename, 0, &font->face); if (err) { MEM_freeN(font); - return(NULL); + return NULL; } err= FT_Select_Charmap(font->face, ft_encoding_unicode); @@ -619,7 +523,7 @@ FontBLF *blf_font_new(const char *name, const char *filename) printf("Can't set the unicode character map!\n"); FT_Done_Face(font->face); MEM_freeN(font); - return(NULL); + return NULL; } mfile= blf_dir_metrics_search(filename); @@ -631,7 +535,7 @@ FontBLF *blf_font_new(const char *name, const char *filename) font->name= BLI_strdup(name); font->filename= BLI_strdup(filename); blf_font_fill(font); - return(font); + return font; } void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size) @@ -649,11 +553,11 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz FontBLF *font; FT_Error err; - font= (FontBLF *)MEM_mallocN(sizeof(FontBLF), "blf_font_new_from_mem"); + font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new_from_mem"); err= FT_New_Memory_Face(ft_lib, mem, mem_size, 0, &font->face); if (err) { MEM_freeN(font); - return(NULL); + return NULL; } err= FT_Select_Charmap(font->face, ft_encoding_unicode); @@ -661,11 +565,11 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz printf("Can't set the unicode character map!\n"); FT_Done_Face(font->face); MEM_freeN(font); - return(NULL); + return NULL; } font->name= BLI_strdup(name); font->filename= NULL; blf_font_fill(font); - return(font); + return font; } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 7a1fa8c80b0..99d41cd7abd 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -64,10 +64,10 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi) p= (GlyphCacheBLF *)font->cache.first; while (p) { if (p->size == size && p->dpi == dpi) - return(p); + return p; p= p->next; } - return(NULL); + return NULL; } /* Create a new glyph cache for the current size and dpi. */ @@ -75,7 +75,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) { GlyphCacheBLF *gc; - gc= (GlyphCacheBLF *)MEM_mallocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new"); + gc= (GlyphCacheBLF *)MEM_callocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new"); gc->next= NULL; gc->prev= NULL; gc->size= font->size; @@ -114,7 +114,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) gc->p2_height= 0; BLI_addhead(&font->cache, gc); - return(gc); + return gc; } void blf_glyph_cache_clear(FontBLF *font) @@ -131,10 +131,8 @@ void blf_glyph_cache_clear(FontBLF *font) blf_glyph_free(g); } } - } - if(font->glyph_cache) { - memset(font->glyph_cache->glyph_ascii_table, 0, sizeof(font->glyph_cache->glyph_ascii_table)); + memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table)); } } @@ -204,10 +202,10 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c) p= gc->bucket[key].first; while (p) { if (p->c == c) - return(p); + return p; p= p->next; } - return(NULL); + return NULL; } GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) @@ -222,14 +220,14 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) g= blf_glyph_search(font->glyph_cache, c); if (g) - return(g); + return g; if (sharp) err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO); else err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */ if (err) - return(NULL); + return NULL; /* get the glyph. */ slot= font->face->glyph; @@ -248,22 +246,13 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) } if (err || slot->format != FT_GLYPH_FORMAT_BITMAP) - return(NULL); + return NULL; - g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add"); - g->next= NULL; - g->prev= NULL; + g= (GlyphBLF *)MEM_callocN(sizeof(GlyphBLF), "blf_glyph_add"); g->c= c; g->idx= (FT_UInt)index; - g->tex= 0; - g->build_tex= 0; - g->bitmap= NULL; g->xoff= -1; g->yoff= -1; - g->uv[0][0]= 0.0f; - g->uv[0][1]= 0.0f; - g->uv[1][0]= 0.0f; - g->uv[1][1]= 0.0f; bitmap= slot->bitmap; g->width= bitmap.width; g->height= bitmap.rows; @@ -294,7 +283,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) key= blf_hash(g->c); BLI_addhead(&(font->glyph_cache->bucket[key]), g); - return(g); + return g; } void blf_glyph_free(GlyphBLF *g) @@ -383,7 +372,7 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) float xo, yo; if ((!g->width) || (!g->height)) - return(1); + return 1; if (g->build_tex == 0) { GlyphCacheBLF *gc= font->glyph_cache; @@ -449,13 +438,13 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) if (font->flags & BLF_CLIPPING) { if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1])) - return(0); + return 0; if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1])) - return(0); + return 0; if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1])) - return(0); + return 0; if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1])) - return(0); + return 0; } if (font->tex_bind_state != g->tex) { @@ -500,5 +489,5 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) break; } - return(1); + return 1; } diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index e7f9d1746ad..8f745180b8b 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -39,8 +39,14 @@ #ifdef INTERNATIONAL #include <locale.h> + +#if defined (_WIN32) +#include <windows.h> +#endif + #include "libintl.h" +#include "DNA_userdef_types.h" #include "DNA_listBase.h" #include "DNA_vec_types.h" @@ -51,11 +57,6 @@ #include "BLI_string.h" #include "BLI_path_util.h" - -#ifdef __APPLE__ - -#endif - #define DOMAIN_NAME "blender" #define SYSTEM_ENCODING_DEFAULT "UTF-8" #define FONT_SIZE_DEFAULT 12 @@ -65,6 +66,35 @@ static char global_messagepath[1024]; static char global_language[32]; static char global_encoding_name[32]; +/* map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */ +static const char *locales[] = { + "", "", + "english", "en_US", + "japanese", "ja_JP", + "dutch", "nl_NL", + "italian", "it_IT", + "german", "de_DE", + "finnish", "fi_FI", + "swedish", "sv_SE", + "french", "fr_FR", + "spanish", "es_ES", + "catalan", "ca_AD", + "czech", "cs_CZ", + "ptb", "pt_BR", + "chs", "zh_CN", + "cht", "zh_TW", + "russian", "ru_RU", + "croatian", "hr_HR", + "serbian", "sr_RS", + "ukrainian", "uk_UA", + "polish", "pl_PL", + "romanian", "ro_RO", + "arabic", "ar_EG", + "bulgarian", "bg_BG", + "greek", "el_GR", + "korean", "ko_KR", + "nepali", "ne_NP", +}; void BLF_lang_init(void) { @@ -82,34 +112,95 @@ void BLF_lang_init(void) /* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */ void BLF_lang_set(const char *str) { - if(str==NULL) { + char *locreturn; + const char *short_locale; + int ok= 1; +#if defined (_WIN32) + char *long_locale = locales[ 2 * U.language]; +#endif + + if((U.transopts&USER_DOTRANSLATE)==0) return; + + if(str) + short_locale = str; + else + short_locale = locales[ 2 * U.language + 1]; + +#if defined (_WIN32) + if(short_locale) { + char *envStr; + + if( U.language==0 )/* use system setting */ + envStr = BLI_sprintfN( "LANG=%s", getenv("LANG") ); + else + envStr = BLI_sprintfN( "LANG=%s", short_locale ); + + gettext_putenv(envStr); + MEM_freeN(envStr); + } + + locreturn= setlocale(LC_ALL, long_locale); + + if (locreturn == NULL) { + printf("Could not change locale to %s\n", long_locale); + ok= 0; } - else { - -#if defined (_WIN32) || defined(__APPLE__) - BLI_setenv("LANG", str); #else - char *locreturn= setlocale(LC_ALL, str); + { + const char *locale; + static char default_locale[64]="\0"; + + if(default_locale[0]==0) { + char *env_language= getenv("LANGUAGE"); + + if(env_language) { + char *s; + + /* store defaul locale */ + strncpy(default_locale, env_language, sizeof(default_locale)); + + /* use first language as default */ + s= strchr(default_locale, ':'); + if(s) s[0]= 0; + } + } + + if(short_locale[0]) + locale= short_locale; + else + locale= default_locale; + + BLI_setenv("LANG", locale); + BLI_setenv("LANGUAGE", locale); + + locreturn= setlocale(LC_ALL, locale); + if (locreturn == NULL) { - char *lang= BLI_sprintfN("%s.UTF-8", str); + char *short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale); + + locreturn= setlocale(LC_ALL, short_locale_utf8); - locreturn= setlocale(LC_ALL, lang); if (locreturn == NULL) { - printf("could not change language to %s nor %s\n", str, lang); + printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8); + ok= 0; } - MEM_freeN(lang); + MEM_freeN(short_locale_utf8); } - - setlocale(LC_NUMERIC, "C"); + } #endif - textdomain(DOMAIN_NAME); - bindtextdomain(DOMAIN_NAME, global_messagepath); - /* bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name); */ - BLI_strncpy(global_language, str, sizeof(global_language)); - + + if(ok) { + //printf("Change locale to %s\n", locreturn ); + BLI_strncpy(global_language, locreturn, sizeof(global_language)); } + + setlocale(LC_NUMERIC, "C"); + + textdomain(DOMAIN_NAME); + bindtextdomain(DOMAIN_NAME, global_messagepath); + bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name); } void BLF_lang_encoding(const char *str) diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c new file mode 100644 index 00000000000..b53f4cf7609 --- /dev/null +++ b/source/blender/blenfont/intern/blf_translation.c @@ -0,0 +1,86 @@ +/* + * $Id$ + * + * ***** 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) 2011 Blender Foundation. + * All rights reserved. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenfont/intern/blf_translation.c + * \ingroup blf + */ + +#include <stdlib.h> + +#ifdef INTERNATIONAL +#include <libintl.h> +#endif + +#include "MEM_guardedalloc.h" + +#include "BLI_path_util.h" +#include "BLI_string.h" +#include "BLI_path_util.h" +#include "BLI_fileops.h" + +#include "BLF_translation.h" + +#ifdef INTERNATIONAL +const char unifont_filename[]="droidsans.ttf.gz"; +static unsigned char *unifont_ttf= NULL; +static int unifont_size= 0; + +unsigned char *BLF_get_unifont(int *unifont_size_r) +{ + if(unifont_ttf==NULL) { + char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); + char unifont_path[1024]; + + BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); + + unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size); + } + + *unifont_size_r= unifont_size; + + return unifont_ttf; +} + +void BLF_free_unifont(void) +{ + if(unifont_ttf) + MEM_freeN(unifont_ttf); +} + +#endif + +const char* BLF_gettext(const char *msgid) +{ +#ifdef INTERNATIONAL + if( msgid[0] ) + return gettext( msgid ); + return ""; +#else + return msgid; +#endif +} diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c index edd23ac1ba6..cfe77887674 100644 --- a/source/blender/blenfont/intern/blf_util.c +++ b/source/blender/blenfont/intern/blf_util.c @@ -46,7 +46,7 @@ unsigned int blf_next_p2(unsigned int x) x |= (x >> 2); x |= (x >> 1); x += 1; - return(x); + return x; } unsigned int blf_hash(unsigned int val) @@ -60,7 +60,7 @@ unsigned int blf_hash(unsigned int val) key ^= (key >> 13); key += ~(key << 9); key ^= (key >> 17); - return(key % 257); + return key % 257; } /* @@ -85,7 +85,7 @@ int blf_utf8_next(unsigned char *buf, unsigned int *iindex) d= buf[index++]; if (!d) - return(0); + return 0; while (buf[index] && ((buf[index] & 0xc0) == 0x80)) index++; @@ -124,5 +124,5 @@ int blf_utf8_next(unsigned char *buf, unsigned int *iindex) r |= (d4 & 0x3f); } *iindex= index; - return(r); + return r; } diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 7d60c00156d..8836999bc9b 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -100,6 +100,8 @@ void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[] void vec_roll_to_mat3(float *vec, float roll, float mat[][3]); void mat3_to_vec_roll(float mat[][3], float *vec, float *roll); +int get_selected_defgroups(struct Object *ob, char *defbase_sel, int defbase_len); + /* Common Conversions Between Co-ordinate Spaces */ void armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]); void armature_loc_world_to_pose(struct Object *ob, float *inloc, float *outloc); diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 742240d53b5..a09e475c9a3 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -44,7 +44,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 259 -#define BLENDER_SUBVERSION 2 +#define BLENDER_SUBVERSION 3 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 @@ -53,7 +53,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE alpha +#define BLENDER_VERSION_CYCLE beta struct ListBase; struct MemFile; diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 0e48673f1b1..a59d43d315d 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -151,9 +151,18 @@ typedef struct Global { /* ENDIAN_ORDER: indicates what endianness the platform where the file was * written had. */ +#if !defined( __BIG_ENDIAN__ ) && !defined( __LITTLE_ENDIAN__ ) +# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined. +#endif + #define L_ENDIAN 1 #define B_ENDIAN 0 -extern short ENDIAN_ORDER; + +#ifdef __BIG_ENDIAN__ +# define ENDIAN_ORDER B_ENDIAN +#else +# define ENDIAN_ORDER L_ENDIAN +#endif /* G.moving, signals drawing in (3d) window to denote transform */ #define G_TRANSFORM_OBJ 1 diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 0c31083a266..8181ad6421c 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -168,6 +168,9 @@ struct Image *copy_image(struct Image *ima); /* merge source into dest, and free source */ void BKE_image_merge(struct Image *dest, struct Image *source); +/* check if texture has alpha (depth=32) */ +int BKE_image_has_alpha(struct Image *image); + /* image_gen.c */ void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, float color[4]); void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width); diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 85b6f8f78fb..cb6a0b9ab37 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -42,6 +42,8 @@ struct Main; struct Material; struct ID; struct Object; +struct Mesh; +struct MTFace; /* materials */ @@ -50,6 +52,7 @@ void free_material(struct Material *sc); void test_object_materials(struct ID *id); void resize_object_material(struct Object *ob, const short totcol); void init_material(struct Material *ma); +struct Material *add_material_main(struct Main *main, const char *name); struct Material *add_material(const char *name); struct Material *copy_material(struct Material *ma); struct Material *localize_material(struct Material *ma); @@ -66,19 +69,19 @@ short *give_totcolp(struct Object *ob); struct Material ***give_matarar_id(struct ID *id); /* same but for ID's */ short *give_totcolp_id(struct ID *id); -struct Material *give_current_material(struct Object *ob, int act); -struct ID *material_from(struct Object *ob, int act); -void assign_material(struct Object *ob, struct Material *ma, int act); -void assign_matarar(struct Object *ob, struct Material ***matar, int totcol); +struct Material *give_current_material(struct Object *ob, short act); +struct ID *material_from(struct Object *ob, short act); +void assign_material(struct Object *ob, struct Material *ma, short act); +void assign_matarar(struct Object *ob, struct Material ***matar, short totcol); -int find_material_index(struct Object *ob, struct Material *ma); +short find_material_index(struct Object *ob, struct Material *ma); int object_add_material_slot(struct Object *ob); int object_remove_material_slot(struct Object *ob); /* rna api */ void material_append_id(struct ID *id, struct Material *ma); -struct Material *material_pop_id(struct ID *id, int index, int remove_material_slot); +struct Material *material_pop_id(struct ID *id, int index, int remove_material_slot); /* index is an int because of RNA */ /* rendering */ @@ -101,6 +104,9 @@ void clear_mat_mtex_copybuf(void); void copy_mat_mtex_copybuf(struct ID *id); void paste_mat_mtex_copybuf(struct ID *id); +/* handle backward compatibility for tface/materials called from doversion (fileload=1) or Help Menu (fileload=0) */ +int do_version_tface(struct Main *main, int fileload); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 08c150e30e3..95490b1aff6 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -84,7 +84,7 @@ void nurbs_to_mesh(struct Object *ob); void mesh_to_curve(struct Scene *scene, struct Object *ob); void free_dverts(struct MDeformVert *dvert, int totvert); void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert); /* __NLA */ -void mesh_delete_material_index(struct Mesh *me, int index); +void mesh_delete_material_index(struct Mesh *me, short index); void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth); struct BoundBox *mesh_get_bb(struct Object *ob); diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h index acb3c2963a9..01d32321c81 100644 --- a/source/blender/blenkernel/BKE_navmesh_conversion.h +++ b/source/blender/blenkernel/BKE_navmesh_conversion.h @@ -32,33 +32,34 @@ struct DerivedMesh; -/* navmesh_conversion.cpp */ -bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly, - int &nverts, float *&verts, - int &ndtris, unsigned short *&dtris, - int& npolys, unsigned short *&dmeshes, - unsigned short*& polys, int *&dtrisToPolysMap, - int *&dtrisToTrisMap, int *&trisToFacesMap); +/* navmesh_conversion.c */ +int buildNavMeshDataByDerivedMesh(struct DerivedMesh *dm, int *vertsPerPoly, + int *nverts, float **verts, + int *ndtris, unsigned short **dtris, + int *npolys, unsigned short **dmeshes, + unsigned short **polys, int **dtrisToPolysMap, + int **dtrisToTrisMap, int **trisToFacesMap); -bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts, - int &ntris, unsigned short *&tris, int *&trisToFacesMap, - int *&recastData); +int buildRawVertIndicesData(struct DerivedMesh* dm, int *nverts, float **verts, + int *ntris, unsigned short **tris, int **trisToFacesMap, + int **recastData); -bool buildNavMeshData(const int nverts, const float* verts, - const int ntris, const unsigned short *tris, +int buildNavMeshData(const int nverts, const float* verts, + const int ntris, const unsigned short *tris, const int* recastData, const int* trisToFacesMap, - int &ndtris, unsigned short *&dtris, - int &npolys, unsigned short *&dmeshes, unsigned short *&polys, - int &vertsPerPoly, int *&dtrisToPolysMap, int *&dtrisToTrisMap); + int *ndtris, unsigned short **dtris, + int *npolys, unsigned short **dmeshes, unsigned short **polys, + int *vertsPerPoly, int **dtrisToPolysMap, int **dtrisToTrisMap); -bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, - unsigned short* polys, const unsigned short* dmeshes, - const float* verts, const unsigned short* dtris, +int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, + unsigned short* polys, const unsigned short* dmeshes, + const float* verts, const unsigned short* dtris, const int* dtrisToPolysMap); int polyNumVerts(const unsigned short* p, const int vertsPerPoly); -bool polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts); +int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts); int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx); float distPointToSegmentSq(const float* point, const float* a, const float* b); + #endif //NAVMESH_CONVERSION_H diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 0400f229083..2578a90808a 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -59,6 +59,7 @@ void paint_brush_set(struct Paint *paint, struct Brush *br); * Texture paint could be removed since selected faces are not used * however hiding faces is useful */ int paint_facesel_test(struct Object *ob); +int paint_vertsel_test(struct Object *ob); /* Session data (mode-specific) */ diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 14e622c972e..87684e4895d 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -47,18 +47,18 @@ /* this weirdo pops up in two places ... */ #if !defined(WIN32) -#ifndef O_BINARY -#define O_BINARY 0 -#endif +# ifndef O_BINARY +# define O_BINARY 0 +# endif #endif /* INTEGER CODES */ -#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) - /* Big Endian */ -#define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) +#ifdef __BIG_ENDIAN__ + /* Big Endian */ +# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) #else - /* Little Endian */ -#define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) + /* Little Endian */ +# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) #endif #define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid @@ -74,11 +74,11 @@ #define ENDB MAKE_ID('E','N','D','B') /* Bit operations */ -#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 ) -#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 ) -#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) ) -#define BSET(a,b) ( (a) | 1<<(b) ) -#define BCLR(a,b) ( (a) & ~(1<<(b)) ) +#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 ) +#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 ) +#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) ) +#define BSET(a,b) ( (a) | 1<<(b) ) +#define BCLR(a,b) ( (a) & ~(1<<(b)) ) /* bit-row */ #define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) ) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 21ffaba8f89..68a47371354 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -181,7 +181,6 @@ set(SRC BKE_depsgraph.h BKE_displist.h BKE_effect.h - BKE_endian.h BKE_fcurve.h BKE_fluidsim.h BKE_font.h @@ -357,10 +356,10 @@ endif() if(WITH_GAMEENGINE) list(APPEND INC_SYS - ../../../extern/recastnavigation/Recast/Include + ../../../extern/recastnavigation ) list(APPEND SRC - intern/navmesh_conversion.cpp + intern/navmesh_conversion.c BKE_navmesh_conversion.h ) endif() diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 4f19b353351..66d51810413 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -2,7 +2,7 @@ Import ('env') import os -sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp') +sources = env.Glob('intern/*.c') incs = '. #/intern/guardedalloc #/intern/memutil' incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager' @@ -92,10 +92,10 @@ if env['WITH_BF_LZMA']: defs.append('WITH_LZMA') if env['WITH_BF_GAMEENGINE']: - incs += ' #/extern/recastnavigation/Recast/Include' + incs += ' #/extern/recastnavigation' defs.append('WITH_GAMEENGINE') else: - sources.remove('intern' + os.sep + 'navmesh_conversion.cpp') + sources.remove('intern' + os.sep + 'navmesh_conversion.c') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 7a02da57350..fddd2809c47 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -40,6 +40,7 @@ #include "DNA_cloth_types.h" #include "DNA_key_types.h" #include "DNA_meshdata_types.h" +#include "DNA_armature_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" // N_T @@ -59,6 +60,7 @@ #include "BKE_paint.h" #include "BKE_texture.h" #include "BKE_multires.h" +#include "BKE_armature.h" #include "BLO_sys_types.h" // for intptr_t support @@ -986,17 +988,14 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, EditFace *efa; DMVertexAttribs attribs= {{{0}}}; GPUVertexAttribs gattribs; - MTFace *tf; - int transp, new_transp, orig_transp, tfoffset; - int i, b, matnr, new_matnr, dodraw, layer; + /* int tfoffset; */ /* UNUSED */ + int i, b, matnr, new_matnr, dodraw /* , layer */ /* UNUSED */; dodraw = 0; matnr = -1; - transp = GPU_get_material_blend_mode(); - orig_transp = transp; - layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE); - tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset; + /* 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); @@ -1038,19 +1037,6 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); } - if(tfoffset != -1) { - tf = (MTFace*)((char*)efa->data)+tfoffset; - new_transp = tf->transp; - - if(new_transp != transp) { - if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID) - GPU_set_material_blend_mode(orig_transp); - else - GPU_set_material_blend_mode(new_transp); - transp = new_transp; - } - } - if(dodraw) { glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); if (!drawSmooth) { @@ -1673,20 +1659,64 @@ void weight_to_rgb(float input, float *fr, float *fg, float *fb) } } -static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, unsigned char *col) +/* draw_flag's for calc_weightpaint_vert_color */ +enum { + CALC_WP_MULTIPAINT= (1<<0), + CALC_WP_AUTO_NORMALIZE= (1<<1), +}; + +static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, unsigned char *col, char *dg_flags, int selected, int UNUSED(unselected), const int draw_flag) { Mesh *me = ob->data; float colf[4], input = 0.0f; int i; + + int make_black= FALSE; + if (me->dvert) { - for (i=0; i<me->dvert[vert].totweight; i++) - if (me->dvert[vert].dw[i].def_nr==ob->actdef-1) - input+=me->dvert[vert].dw[i].weight; - } + if ((selected > 1) && (draw_flag & CALC_WP_MULTIPAINT)) { + + int was_a_nonzero= FALSE; + for (i=0; i<me->dvert[vert].totweight; i++) { + /* in multipaint, get the average if auto normalize is inactive + * get the sum if it is active */ + if(dg_flags[me->dvert[vert].dw[i].def_nr]) { + if(me->dvert[vert].dw[i].weight) { + input+= me->dvert[vert].dw[i].weight; + was_a_nonzero= TRUE; + } + } + } - CLAMP(input, 0.0f, 1.0f); + /* make it black if the selected groups have no weight on a vertex */ + if(was_a_nonzero == FALSE) { + make_black = TRUE; + } + else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == FALSE) { + input /= selected; /* get the average */ + } + } + else { + /* default, non tricky behavior */ + for (i=0; i<me->dvert[vert].totweight; i++) { + if (me->dvert[vert].dw[i].def_nr==ob->actdef-1) { + input+=me->dvert[vert].dw[i].weight; + } + } + } + } + if (make_black) { + col[3] = 0; + col[2] = 0; + col[1] = 0; + col[0] = 255; + return; + } + + CLAMP(input, 0.0f, 1.0f); + if(coba) do_colorband(coba, input, colf); else @@ -1705,7 +1735,7 @@ void vDM_ColorBand_store(ColorBand *coba) stored_cb= coba; } -static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm) +static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag) { Mesh *me = ob->data; MFace *mf = me->mface; @@ -1713,17 +1743,24 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm) unsigned char *wtcol; int i; + int defbase_len = BLI_countlist(&ob->defbase); + char *defbase_sel = MEM_mallocN(defbase_len * sizeof(char), __func__); + int selected = get_selected_defgroups(ob, defbase_sel, defbase_len); + int unselected = defbase_len - selected; + wtcol = MEM_callocN (sizeof (unsigned char) * me->totface*4*4, "weightmap"); memset(wtcol, 0x55, sizeof (unsigned char) * me->totface*4*4); for (i=0; i<me->totface; i++, mf++) { - calc_weightpaint_vert_color(ob, coba, mf->v1, &wtcol[(i*4 + 0)*4]); - calc_weightpaint_vert_color(ob, coba, mf->v2, &wtcol[(i*4 + 1)*4]); - calc_weightpaint_vert_color(ob, coba, mf->v3, &wtcol[(i*4 + 2)*4]); + calc_weightpaint_vert_color(ob, coba, mf->v1, &wtcol[(i*4 + 0)*4], defbase_sel, selected, unselected, draw_flag); + calc_weightpaint_vert_color(ob, coba, mf->v2, &wtcol[(i*4 + 1)*4], defbase_sel, selected, unselected, draw_flag); + calc_weightpaint_vert_color(ob, coba, mf->v3, &wtcol[(i*4 + 2)*4], defbase_sel, selected, unselected, draw_flag); if (mf->v4) - calc_weightpaint_vert_color(ob, coba, mf->v4, &wtcol[(i*4 + 3)*4]); + calc_weightpaint_vert_color(ob, coba, mf->v4, &wtcol[(i*4 + 3)*4], defbase_sel, selected, unselected, draw_flag); } + MEM_freeN(defbase_sel); + CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_ASSIGN, wtcol, dm->numFaceData); } @@ -1751,6 +1788,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos int has_multires = mmd != NULL, multires_applied = 0; int sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt; + int draw_flag= ((scene->toolsettings->multipaint ? CALC_WP_MULTIPAINT : 0) | + (scene->toolsettings->auto_normalize ? CALC_WP_AUTO_NORMALIZE : 0)); + if(mmd && !mmd->sculptlvl) has_multires = 0; @@ -1930,7 +1970,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT)) - add_weight_mcol_dm(ob, dm); + add_weight_mcol_dm(ob, dm, draw_flag); /* Constructive modifiers need to have an origindex * otherwise they wont have anywhere to copy the data from. @@ -2042,7 +2082,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos CDDM_calc_normals(finaldm); if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT)) - add_weight_mcol_dm(ob, finaldm); + add_weight_mcol_dm(ob, finaldm, draw_flag); } else if(dm) { finaldm = dm; } else { @@ -2054,7 +2094,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT)) - add_weight_mcol_dm(ob, finaldm); + add_weight_mcol_dm(ob, finaldm, draw_flag); } /* add an orco layer if needed */ @@ -2327,7 +2367,7 @@ static void clear_mesh_caches(Object *ob) static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask) { Object *obact = scene->basact?scene->basact->object:NULL; - int editing = paint_facesel_test(ob); + int editing = paint_facesel_test(ob) || paint_vertsel_test(ob);/* paint_vertsel_test */ /* weight paint and face select need original indices because of selection buffer drawing */ int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT))); @@ -2895,7 +2935,7 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm) dm->getMinMax(dm, min, max); if(!ob->bb) - ob->bb= MEM_callocN(sizeof(BoundBox), "bb"); + ob->bb= MEM_callocN(sizeof(BoundBox), "DM-BoundBox"); boundbox_set_from_min_max(ob->bb, min, max); } diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index e85c56a44fe..44c61fa6dcf 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1564,7 +1564,7 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, PropertyRNA *prop; PointerRNA new_ptr; char *path = NULL; - short free_path=0; + /* short free_path=0; */ /* sanity checks */ if (channels == NULL) @@ -1572,7 +1572,7 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, /* get RNA pointer+property info from F-Curve for more convenient handling */ /* get path, remapped as appropriate to work in its new environment */ - free_path= animsys_remap_path(strip->remap, fcu->rna_path, &path); + /* free_path= */ /* UNUSED */ animsys_remap_path(strip->remap, fcu->rna_path, &path); /* a valid property must be available, and it must be animateable */ if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) { diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 08a95477c2e..1149d8eee25 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2464,3 +2464,33 @@ void where_is_pose (Scene *scene, Object *ob) } } } + + +/* Returns total selected vgroups, + * wpi.defbase_sel is assumed malloc'd, all values are set */ +int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_len) +{ + bDeformGroup *defgroup; + unsigned int i; + Object *armob= object_pose_armature_get(ob); + int dg_flags_sel_tot= 0; + + if(armob) { + bPose *pose= armob->pose; + for (i= 0, defgroup= ob->defbase.first; i < defbase_len && defgroup; defgroup = defgroup->next, i++) { + bPoseChannel *pchan= get_pose_channel(pose, defgroup->name); + if(pchan && (pchan->bone->flag & BONE_SELECTED)) { + dg_selection[i]= TRUE; + dg_flags_sel_tot++; + } + else { + dg_selection[i]= FALSE; + } + } + } + else { + memset(dg_selection, FALSE, sizeof(char) * defbase_len); + } + + return dg_flags_sel_tot; +} diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2d4354bdd9f..218b83fc52a 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -98,7 +98,6 @@ Global G; UserDef U; /* ListBase = {NULL, NULL}; */ -short ENDIAN_ORDER; char versionstr[48]= ""; @@ -132,9 +131,6 @@ void initglobals(void) strcpy(G.ima, "//"); - ENDIAN_ORDER= 1; - ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN; - if(BLENDER_SUBVERSION) BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION); else @@ -504,7 +500,7 @@ static int read_undosave(bContext *C, UndoElem *uel) void BKE_write_undo(bContext *C, const char *name) { uintptr_t maxmem, totmem, memused; - int nr, success; + int nr /*, success */ /* UNUSED */; UndoElem *uel; if( (U.uiflag & USER_GLOBALUNDO)==0) return; @@ -556,7 +552,7 @@ void BKE_write_undo(bContext *C, const char *name) BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter); BLI_make_file_string("/", filepath, btempdir, numstr); - success= BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL); + /* success= */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL); BLI_strncpy(curundo->str, filepath, sizeof(curundo->str)); } @@ -566,7 +562,7 @@ void BKE_write_undo(bContext *C, const char *name) if(curundo->prev) prevfile= &(curundo->prev->memfile); memused= MEM_get_memory_in_use(); - success= BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags); + /* success= */ /* UNUSED */ BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags); curundo->undosize= MEM_get_memory_in_use() - memused; } diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 44359a142c9..e1939335268 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1060,18 +1060,15 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo DMVertexAttribs attribs; MVert *mvert = cddm->mvert; MFace *mface = cddm->mface; - MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); + /* MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */ float (*nors)[3] = dm->getFaceDataArray(dm, CD_NORMAL); int a, b, dodraw, matnr, new_matnr; - int transp, new_transp, orig_transp; int orig, *index = dm->getFaceDataArray(dm, CD_ORIGINDEX); cdDM_update_normals_from_pbvh(dm); matnr = -1; dodraw = 0; - transp = GPU_get_material_blend_mode(); - orig_transp = transp; glShadeModel(GL_SMOOTH); @@ -1111,22 +1108,6 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo continue; } - if(tf) { - new_transp = tf[a].transp; - - if(new_transp != transp) { - glEnd(); - - if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID) - GPU_set_material_blend_mode(orig_transp); - else - GPU_set_material_blend_mode(new_transp); - transp = new_transp; - - glBegin(GL_QUADS); - } - } - if(!smoothnormal) { if(nors) { glNormal3fv(nors[a]); @@ -1158,7 +1139,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo GPUBuffer *buffer = NULL; char *varray = NULL; int numdata = 0, elementsize = 0, offset; - int start = 0, numfaces = 0, prevdraw = 0, curface = 0; + int start = 0, numfaces = 0 /* , prevdraw = 0 */ /* UNUSED */, curface = 0; int i; MFace *mf = mface; @@ -1202,7 +1183,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo } numdata = 0; start = curface; - prevdraw = dodraw; + /* prevdraw = dodraw; */ /* UNUSED */ dodraw = setMaterial(matnr = new_matnr, &gattribs); if(dodraw) { DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs); @@ -1250,7 +1231,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo else { /* if the buffer was set, dont use it again. * prevdraw was assumed true but didnt run so set to false - [#21036] */ - prevdraw= 0; + /* prevdraw= 0; */ /* UNUSED */ buffer= NULL; } } @@ -1259,33 +1240,6 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo continue; } - if(tf) { - new_transp = tf[a].transp; - - if(new_transp != transp) { - numfaces = curface - start; - if( numfaces > 0 ) { - if( dodraw ) { - if( numdata != 0 ) { - GPU_buffer_unlock(buffer); - GPU_interleaved_attrib_setup(buffer,datatypes,numdata); - } - glDrawArrays(GL_TRIANGLES,start*3,(curface-start)*3); - if( numdata != 0 ) { - varray = GPU_buffer_lock_stream(buffer); - } - } - } - start = curface; - - if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID) - GPU_set_material_blend_mode(orig_transp); - else - GPU_set_material_blend_mode(new_transp); - transp = new_transp; - } - } - if( numdata != 0 ) { offset = 0; if(attribs.totorco) { diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 883f67c3061..30da2e01011 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -326,7 +326,7 @@ static void layerSwap_tface(void *data, const int *corner_indices) static void layerDefault_tface(void *data, int count) { static MTFace default_tf = {{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, NULL, - 0, 0, TF_DYNAMIC, 0, 0}; + 0, 0, TF_DYNAMIC|TF_CONVERTED, 0, 0}; MTFace *tf = (MTFace*)data; int i; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 002cfdbf41a..d764826cd47 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2290,3 +2290,20 @@ void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr) iuser->framenr= framenr; if(iuser->ok==0) iuser->ok= 1; } + +int BKE_image_has_alpha(struct Image *image) +{ + ImBuf *ibuf; + void *lock; + int depth; + + ibuf= BKE_image_acquire_ibuf(image, NULL, &lock); + depth = (ibuf?ibuf->depth:0); + BKE_image_release_ibuf(image, lock); + + if (depth == 32) + return 1; + else + return 0; +} + diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 21e627ae3e2..e2659340a90 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -37,12 +37,16 @@ #include <string.h> #include <math.h> +#include <stddef.h> #include "MEM_guardedalloc.h" #include "DNA_curve_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_customdata_types.h" +#include "DNA_ID.h" #include "DNA_meta_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" @@ -56,6 +60,7 @@ #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_icons.h" +#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" @@ -189,6 +194,10 @@ void init_material(Material *ma) ma->vol.ms_diff = 1.f; ma->vol.ms_intensity = 1.f; + ma->game.flag=0; + ma->game.alpha_blend=0; + ma->game.face_orientation=0; + ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR|MA_ZTRANSP; ma->shade_flag= MA_APPROX_OCCLUSION; ma->preview = NULL; @@ -516,7 +525,7 @@ short *give_totcolp_id(ID *id) return NULL; } -static void data_delete_material_index_id(ID *id, int index) +static void data_delete_material_index_id(ID *id, short index) { switch(GS(id->name)) { case ID_ME: @@ -548,8 +557,9 @@ void material_append_id(ID *id, Material *ma) } } -Material *material_pop_id(ID *id, int index, int remove_material_slot) +Material *material_pop_id(ID *id, int index_i, int remove_material_slot) { + short index= (short)index_i; Material *ret= NULL; Material ***matar; if((matar= give_matarar_id(id))) { @@ -592,7 +602,7 @@ Material *material_pop_id(ID *id, int index, int remove_material_slot) return ret; } -Material *give_current_material(Object *ob, int act) +Material *give_current_material(Object *ob, short act) { Material ***matarar, *ma; short *totcolp; @@ -630,7 +640,7 @@ Material *give_current_material(Object *ob, int act) return ma; } -ID *material_from(Object *ob, int act) +ID *material_from(Object *ob, short act) { if(ob==NULL) return NULL; @@ -714,7 +724,7 @@ void test_object_materials(ID *id) } } -void assign_material(Object *ob, Material *ma, int act) +void assign_material(Object *ob, Material *ma, short act) { Material *mao, **matar, ***matarar; char *matbits; @@ -785,9 +795,10 @@ void assign_material(Object *ob, Material *ma, int act) } /* XXX - this calls many more update calls per object then are needed, could be optimized */ -void assign_matarar(struct Object *ob, struct Material ***matar, int totcol) +void assign_matarar(struct Object *ob, struct Material ***matar, short totcol) { - int i, actcol_orig= ob->actcol; + int actcol_orig= ob->actcol; + short i; while(object_remove_material_slot(ob)) {}; @@ -802,7 +813,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, int totcol) } -int find_material_index(Object *ob, Material *ma) +short find_material_index(Object *ob, Material *ma) { Material ***matarar; short a, *totcolp; @@ -1054,7 +1065,7 @@ int object_remove_material_slot(Object *ob) Material *mao, ***matarar; Object *obt; short *totcolp; - int a, actcol; + short a, actcol; if(ob==NULL || ob->totcol==0) return FALSE; @@ -1469,3 +1480,482 @@ void paste_matcopybuf(Material *ma) ma->nodetree= ntreeCopyTree(matcopybuf.nodetree); } + + +/*********************** texface to material convert functions **********************/ +/* encode all the TF information into a single int */ +static int encode_tfaceflag(MTFace *tf, int convertall) +{ + /* calculate the flag */ + int flag = tf->mode; + + /* options that change the material offline render */ + if (!convertall) { + flag &= ~TF_OBCOL; + } + + /* clean flags that are not being converted */ + flag &= ~TF_TEX; + flag &= ~TF_SHAREDVERT; + flag &= ~TF_SHAREDCOL; + flag &= ~TF_CONVERTED; + + /* light tface flag is ignored in GLSL mode */ + flag &= ~TF_LIGHT; + + /* 15 is how big the flag can be - hardcoded here and in decode_tfaceflag() */ + flag |= tf->transp << 15; + + /* increase 1 so flag 0 is different than no flag yet */ + return flag + 1; +} + +/* set the material options based in the tface flag */ +static void decode_tfaceflag(Material *ma, int flag, int convertall) +{ + int alphablend; + GameSettings *game= &ma->game; + + /* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */ + flag -= 1; + + alphablend = flag >> 15; //encoded in the encode_tfaceflag function + (*game).flag = 0; + + /* General Material Options */ + if ((flag & TF_DYNAMIC)==0) (*game).flag |= GEMAT_NOPHYSICS; + + /* Material Offline Rendering Properties */ + if (convertall) { + if (flag & TF_OBCOL) ma->shade_flag |= MA_OBCOLOR; + } + + /* Special Face Properties */ + if ((flag & TF_TWOSIDE)==0) (*game).flag |= GEMAT_BACKCULL; + if (flag & TF_INVISIBLE)(*game).flag |= GEMAT_INVISIBLE; + if (flag & TF_BMFONT) (*game).flag |= GEMAT_TEXT; + + /* Face Orientation */ + if (flag & TF_BILLBOARD) (*game).face_orientation |= GEMAT_HALO; + else if (flag & TF_BILLBOARD2) (*game).face_orientation |= GEMAT_BILLBOARD; + else if (flag & TF_SHADOW) (*game).face_orientation |= GEMAT_SHADOW; + + /* Alpha Blend */ + if (flag & TF_ALPHASORT && ELEM(alphablend, TF_ALPHA, TF_ADD)) (*game).alpha_blend = GEMAT_ALPHA_SORT; + else if (alphablend & TF_ALPHA) (*game).alpha_blend = GEMAT_ALPHA; + else if (alphablend & TF_ADD) (*game).alpha_blend = GEMAT_ADD; + else if (alphablend & TF_CLIP) (*game).alpha_blend = GEMAT_CLIP; +} + +/* boolean check to see if the mesh needs a material */ +static int check_tfaceneedmaterial(int flag) +{ + // check if the flags we have are not deprecated != than default material options + // also if only flags are visible and collision see if all objects using this mesh have this option in physics + + /* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */ + flag -=1; + + // deprecated flags + flag &= ~TF_OBCOL; + flag &= ~TF_SHAREDVERT; + flag &= ~TF_SHAREDCOL; + + /* light tface flag is ignored in GLSL mode */ + flag &= ~TF_LIGHT; + + // automatic detected if tex image has alpha + flag &= ~(TF_ALPHA << 15); + // automatic detected if using texture + flag &= ~TF_TEX; + + // settings for the default NoMaterial + if (flag == TF_DYNAMIC) + return 0; + + else + return 1; +} + +/* return number of digits of an integer */ +// XXX to be optmized or replaced by an equivalent blender internal function +static int integer_getdigits(int number) +{ + int i=0; + if (number == 0) return 1; + + while (number != 0){ + number = (int)(number/10); + i++; + } + return i; +} + +static void calculate_tface_materialname(char *matname, char *newname, int flag) +{ + // if flag has only light and collision and material matches those values + // you can do strcpy(name, mat_name); + // otherwise do: + int digits = integer_getdigits(flag); + /* clamp the old name, remove the MA prefix and add the .TF.flag suffix + e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */ + sprintf(newname, "%.*s.TF.%0*d", MAX_ID_NAME-(digits+5), matname, digits, flag); +} + +/* returns -1 if no match */ +static short mesh_getmaterialnumber(Mesh *me, Material *ma) +{ + short a; + + for (a=0; a<me->totcol; a++) { + if (me->mat[a] == ma) { + return a; + } + } + + return -1; +} + +/* append material */ +static short mesh_addmaterial(Mesh *me, Material *ma) +{ + material_append_id(&me->id, NULL); + me->mat[me->totcol-1]= ma; + + id_us_plus(&ma->id); + + return me->totcol-1; +} + +static void set_facetexture_flags(Material *ma, Image *image) +{ + if(image) { + ma->mode |= MA_FACETEXTURE; + /* we could check if the texture has alpha, but then more meshes sharing the same + * material may need it. Let's make it simple. */ + if(BKE_image_has_alpha(image)) + ma->mode |= MA_FACETEXTURE_ALPHA; + } +} + +/* returns material number */ +static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag) +{ + Material *ma; + char idname[MAX_ID_NAME]; + short mat_nr= -1; + + /* new material, the name uses the flag*/ + sprintf(idname, "MAMaterial.TF.%0*d", integer_getdigits(flag), flag); + + if ((ma= BLI_findstring(&main->mat, idname+2, offsetof(ID, name)+2))) { + mat_nr= mesh_getmaterialnumber(me, ma); + /* assign the material to the mesh */ + if(mat_nr == -1) mat_nr= mesh_addmaterial(me, ma); + + /* if needed set "Face Textures [Alpha]" Material options */ + set_facetexture_flags(ma, tf->tpage); + } + /* create a new material */ + else { + ma= add_material(idname+2); + + if(ma){ + printf("TexFace Convert: Material \"%s\" created.\n", idname+2); + mat_nr= mesh_addmaterial(me, ma); + + /* if needed set "Face Textures [Alpha]" Material options */ + set_facetexture_flags(ma, tf->tpage); + + decode_tfaceflag(ma, flag, 1); + // the final decoding will happen after, outside the main loop + // for now store the flag into the material and change light/tex/collision + // store the flag as a negative number + ma->game.flag = -flag; + id_us_min((ID *)ma); + } + else printf("Error: Unable to create Material \"%s\" for Mesh \"%s\".", idname+2, me->id.name+2); + } + + /* set as converted, no need to go bad to this face */ + tf->mode |= TF_CONVERTED; + return mat_nr; +} + +/* Function to fully convert materials */ +static void convert_tfacematerial(Main *main, Material *ma) +{ + Mesh *me; + Material *mat_new; + MFace *mf; + MTFace *tf; + int flag, index; + int a; + short mat_nr; + CustomDataLayer *cdl; + char idname[MAX_ID_NAME]; + + for(me=main->mesh.first; me; me=me->id.next){ + /* check if this mesh uses this material */ + for(a=0;a<me->totcol;a++) + if(me->mat[a] == ma) break; + + /* no material found */ + if (a == me->totcol) continue; + + /* get the active tface layer */ + index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + if (!cdl) continue; + + /* loop over all the faces and stop at the ones that use the material*/ + for(a=0, mf=me->mface; a<me->totface; a++, mf++) { + if(me->mat[mf->mat_nr] != ma) continue; + + /* texface data for this face */ + tf = ((MTFace*)cdl->data) + a; + flag = encode_tfaceflag(tf, 1); + + /* the name of the new material */ + calculate_tface_materialname(ma->id.name, (char *)&idname, flag); + + if ((mat_new= BLI_findstring(&main->mat, idname+2, offsetof(ID, name)+2))) { + /* material already existent, see if the mesh has it */ + mat_nr = mesh_getmaterialnumber(me, mat_new); + /* material is not in the mesh, add it */ + if(mat_nr == -1) mat_nr= mesh_addmaterial(me, mat_new); + } + /* create a new material */ + else { + mat_new=copy_material(ma); + if(mat_new){ + /* rename the material*/ + strcpy(mat_new->id.name, idname); + id_us_min((ID *)mat_new); + + mat_nr= mesh_addmaterial(me, mat_new); + decode_tfaceflag(mat_new, flag, 1); + } + else { + printf("Error: Unable to create Material \"%s\" for Mesh \"%s.", idname+2, me->id.name+2); + mat_nr = mf->mat_nr; + continue; + } + } + + /* if the material has a texture but no texture channel + * set "Face Textures [Alpha]" Material options + * actually we need to run it always, because of old behavior + * of using face texture if any texture channel was present (multitex) */ + //if((!mat_new->mtex[0]) && (!mat_new->mtex[0]->tex)) + set_facetexture_flags(mat_new, tf->tpage); + + /* set the material number to the face*/ + mf->mat_nr = mat_nr; + } + /* remove material from mesh */ + for(a=0;a<me->totcol;) + if(me->mat[a] == ma) material_pop_id(&me->id, a, 1);else a++; + } +} + + +#define MAT_BGE_DISPUTED -99999 + +int do_version_tface(Main *main, int fileload) +{ + Mesh *me; + Material *ma; + MFace *mf; + MTFace *tf; + CustomDataLayer *cdl; + int a; + int flag; + int index; + + /* sometimes mesh has no materials but will need a new one. In those + * cases we need to ignore the mf->mat_nr and only look at the face + * mode because it can be zero as uninitialized or the 1st created material + */ + int nomaterialslots; + + /* alert to user to check the console */ + int nowarning = 1; + + /* mark all the materials to conversion with a flag + * if there is tface create a complete flag for that storing in flag + * if there is tface and flag > 0: creates a new flag based on this face + * if flags are different set flag to -1 + */ + + /* 1st part: marking mesh materials to update */ + for(me=main->mesh.first; me; me=me->id.next){ + if (me->id.lib) continue; + + /* get the active tface layer */ + index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + if (!cdl) continue; + + nomaterialslots = (me->totcol==0?1:0); + + /* loop over all the faces*/ + for(a=0, mf=me->mface; a<me->totface; a++, mf++) { + /* texface data for this face */ + tf = ((MTFace*)cdl->data) + a; + + /* conversion should happen only once */ + if (fileload) + tf->mode &= ~TF_CONVERTED; + else { + if((tf->mode & TF_CONVERTED)) continue; + else tf->mode |= TF_CONVERTED; + } + + /* no material slots */ + if(nomaterialslots) { + flag = encode_tfaceflag(tf, 1); + + /* create/find a new material and assign to the face */ + if (check_tfaceneedmaterial(flag)) { + mf->mat_nr= convert_tfacenomaterial(main, me, tf, flag); + } + /* else mark them as no-material to be reverted to 0 later */ + else { + mf->mat_nr = -1; + } + } + else if(mf->mat_nr < me->totcol) { + ma= me->mat[mf->mat_nr]; + + /* no material create one if necessary */ + if(!ma) { + /* find a new material and assign to the face */ + flag = encode_tfaceflag(tf, 1); + + /* create/find a new material and assign to the face */ + if (check_tfaceneedmaterial(flag)) + mf->mat_nr= convert_tfacenomaterial(main, me, tf, flag); + + continue; + } + + /* we can't read from this if it comes from a library, + * at doversion time: direct_link might not have happened on it, + * so ma->mtex is not pointing to valid memory yet. + * later we could, but it's better not */ + else if(ma->id.lib) + continue; + + /* material already marked as disputed */ + else if(ma->game.flag == MAT_BGE_DISPUTED) + continue; + + /* found a material */ + else { + flag = encode_tfaceflag(tf, ((fileload)?0:1)); + + /* first time changing this material */ + if (ma->game.flag == 0) + ma->game.flag= -flag; + + /* mark material as disputed */ + else if (ma->game.flag != -flag) { + ma->game.flag = MAT_BGE_DISPUTED; + continue; + } + + /* material ok so far */ + else { + ma->game.flag = -flag; + + /* some people uses multitexture with TexFace by creating a texture + * channel which not neccessarly the tf->tpage image. But the game engine + * was enabling it. Now it's required to set "Face Texture [Alpha] in the + * material settings. */ + if(!fileload) + set_facetexture_flags(ma, tf->tpage); + } + } + } + else + continue; + } + + /* if we didn't have material slot and now we do, we need to + * make sure the materials are correct */ + if(nomaterialslots) { + if (me->totcol>0) { + for(a=0, mf=me->mface; a<me->totface; a++, mf++) { + if (mf->mat_nr == -1) { + /* texface data for this face */ + tf = ((MTFace*)cdl->data) + a; + mf->mat_nr= convert_tfacenomaterial(main, me, tf, encode_tfaceflag(tf, 1)); + } + } + } + else { + for(a=0, mf=me->mface; a<me->totface; a++, mf++) { + mf->mat_nr=0; + } + } + } + + } + + /* 2nd part - conversion */ + /* skip library files */ + + /* we shouldn't loop through the materials created in the loop. make the loop stop at its original length) */ + for (ma= main->mat.first, a=0; ma; ma= ma->id.next, a++) { + if (ma->id.lib) continue; + + /* disputed material */ + if (ma->game.flag == MAT_BGE_DISPUTED) { + ma->game.flag = 0; + if (fileload) { + printf("Warning: material \"%s\" skipped - to convert old game texface to material go to the Help menu.\n", ma->id.name+2); + nowarning = 0; + } + else + convert_tfacematerial(main, ma); + continue; + } + + /* no conflicts in this material - 90% of cases + * convert from tface system to material */ + else if (ma->game.flag < 0) { + decode_tfaceflag(ma, -(ma->game.flag), 1); + + /* material is good make sure all faces using + * this material are set to converted */ + if (fileload) { + for(me=main->mesh.first; me; me=me->id.next){ + /* check if this mesh uses this material */ + for(a=0;a<me->totcol;a++) + if(me->mat[a] == ma) break; + + /* no material found */ + if (a == me->totcol) continue; + + /* get the active tface layer */ + index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + if (!cdl) continue; + + /* loop over all the faces and stop at the ones that use the material*/ + for (a=0, mf=me->mface; a<me->totface; a++, mf++) { + if (me->mat[mf->mat_nr] == ma) { + /* texface data for this face */ + tf = ((MTFace*)cdl->data) + a; + tf->mode |= TF_CONVERTED; + } + } + } + } + } + } + + return nowarning; +} + diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 32819226361..810e7c285e8 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -917,7 +917,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int mface->v2= startvert+index[2]; mface->v3= startvert+index[1]; mface->v4= 0; - mface->mat_nr= (unsigned char)dl->col; + mface->mat_nr= dl->col; test_index_face(mface, NULL, 0, 3); if(smooth) mface->flag |= ME_SMOOTH; @@ -966,7 +966,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int mface->v2= p3; mface->v3= p4; mface->v4= p2; - mface->mat_nr= (unsigned char)dl->col; + mface->mat_nr= dl->col; test_index_face(mface, NULL, 0, 4); if(smooth) mface->flag |= ME_SMOOTH; @@ -1252,7 +1252,7 @@ void mesh_to_curve(Scene *scene, Object *ob) } } -void mesh_delete_material_index(Mesh *me, int index) +void mesh_delete_material_index(Mesh *me, short index) { MFace *mf; int i; diff --git a/source/blender/blenkernel/intern/navmesh_conversion.cpp b/source/blender/blenkernel/intern/navmesh_conversion.c index fbc4775cf34..8a2ec1e5169 100644 --- a/source/blender/blenkernel/intern/navmesh_conversion.cpp +++ b/source/blender/blenkernel/intern/navmesh_conversion.c @@ -29,30 +29,33 @@ #include <math.h> #include <stdlib.h> -#include "Recast.h" -extern "C"{ -#include "BKE_navmesh_conversion.h" +#include "MEM_guardedalloc.h" #include "DNA_meshdata_types.h" + +#include "BKE_navmesh_conversion.h" #include "BKE_cdderivedmesh.h" + +#include "BLI_utildefines.h" #include "BLI_math.h" -} -inline float area2(const float* a, const float* b, const float* c) +#include "recast-capi.h" + +BM_INLINE float area2(const float* a, const float* b, const float* c) { return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]); } -inline bool left(const float* a, const float* b, const float* c) +BM_INLINE int left(const float* a, const float* b, const float* c) { return area2(a, b, c) < 0; } int polyNumVerts(const unsigned short* p, const int vertsPerPoly) { - int nv = 0; - for (int i=0; i<vertsPerPoly; i++) + int i, nv = 0; + for (i=0; i<vertsPerPoly; i++) { if (p[i]==0xffff) break; @@ -61,30 +64,34 @@ int polyNumVerts(const unsigned short* p, const int vertsPerPoly) return nv; } -bool polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts) +int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts) { - int nv = polyNumVerts(p, vertsPerPoly); + int j, nv = polyNumVerts(p, vertsPerPoly); if (nv<3) - return false; - for (int j=0; j<nv; j++) + return 0; + for (j=0; j<nv; j++) { const float* v = &verts[3*p[j]]; const float* v_next = &verts[3*p[(j+1)%nv]]; const float* v_prev = &verts[3*p[(nv+j-1)%nv]]; if (!left(v_prev, v, v_next)) - return false; + return 0; } - return true; + return 1; } float distPointToSegmentSq(const float* point, const float* a, const float* b) { float abx[3], dx[3]; - vsub(abx, b,a); - vsub(dx, point,a); - float d = abx[0]*abx[0]+abx[2]*abx[2]; - float t = abx[0]*dx[0]+abx[2]*dx[2]; + float d, t; + + sub_v3_v3v3(abx, b,a); + sub_v3_v3v3(dx, point,a); + + d = abx[0]*abx[0]+abx[2]*abx[2]; + t = abx[0]*dx[0]+abx[2]*dx[2]; + if (d > 0) t /= d; if (t < 0) @@ -93,33 +100,42 @@ float distPointToSegmentSq(const float* point, const float* a, const float* b) t = 1; dx[0] = a[0] + t*abx[0] - point[0]; dx[2] = a[2] + t*abx[2] - point[2]; + return dx[0]*dx[0] + dx[2]*dx[2]; } -bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts, - int &ntris, unsigned short *&tris, int *&trisToFacesMap, - int *&recastData) +int buildRawVertIndicesData(DerivedMesh* dm, int *nverts_r, float **verts_r, + int *ntris_r, unsigned short **tris_r, int **trisToFacesMap_r, + int **recastData) { + int vi, fi, triIdx; + int nverts, ntris; + int *trisToFacesMap; + float *verts; + unsigned short *tris, *tri; + int nfaces; + MFace *faces; + nverts = dm->getNumVerts(dm); if (nverts>=0xffff) { printf("Converting navmesh: Error! Too many vertices. Max number of vertices %d\n", 0xffff); - return false; + return 0; } - verts = new float[3*nverts]; + verts = MEM_callocN(sizeof(float)*3*nverts, "buildRawVertIndicesData verts"); dm->getVertCos(dm, (float(*)[3])verts); //flip coordinates - for (int vi=0; vi<nverts; vi++) + for (vi=0; vi<nverts; vi++) { SWAP(float, verts[3*vi+1], verts[3*vi+2]); } //calculate number of tris - int nfaces = dm->getNumFaces(dm); - MFace *faces = dm->getFaceArray(dm); + nfaces = dm->getNumFaces(dm); + faces = dm->getFaceArray(dm); ntris = nfaces; - for (int fi=0; fi<nfaces; fi++) + for (fi=0; fi<nfaces; fi++) { MFace* face = &faces[fi]; if (face->v4) @@ -127,11 +143,11 @@ bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts, } //copy and transform to triangles (reorder on the run) - trisToFacesMap = new int[ntris]; - tris = new unsigned short[3*ntris]; - unsigned short* tri = tris; - int triIdx = 0; - for (int fi=0; fi<nfaces; fi++) + trisToFacesMap = MEM_callocN(sizeof(int)*ntris, "buildRawVertIndicesData trisToFacesMap"); + tris = MEM_callocN(sizeof(unsigned short)*3*ntris, "buildRawVertIndicesData tris"); + tri = tris; + triIdx = 0; + for (fi=0; fi<nfaces; fi++) { MFace* face = &faces[fi]; tri[3*triIdx+0] = (unsigned short) face->v1; @@ -148,32 +164,46 @@ bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts, } //carefully, recast data is just reference to data in derived mesh - recastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); - return true; + *recastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); + + *nverts_r = nverts; + *verts_r = verts; + *ntris_r = ntris; + *tris_r = tris; + *trisToFacesMap_r = trisToFacesMap; + + return 1; } -bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, +int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, unsigned short* polys, const unsigned short* dmeshes, const float* verts, const unsigned short* dtris, const int* dtrisToPolysMap) { + int polyidx; int capacity = vertsPerPoly; - unsigned short* newPoly = new unsigned short[capacity]; + unsigned short* newPoly = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPoly"); memset(newPoly, 0xff, sizeof(unsigned short)*capacity); - for (int polyidx=0; polyidx<npolys; polyidx++) + + for (polyidx=0; polyidx<npolys; polyidx++) { + size_t i; + int j, k; int nv = 0; //search border - int btri = -1; - int bedge = -1; + int tri, btri = -1; + int edge, bedge = -1; int dtrisNum = dmeshes[polyidx*4+3]; int dtrisBase = dmeshes[polyidx*4+2]; - unsigned char *traversedTris = new unsigned char[dtrisNum]; - memset(traversedTris, 0, dtrisNum*sizeof(unsigned char)); - for (int j=0; j<dtrisNum && btri==-1;j++) + unsigned char *traversedTris = MEM_callocN(sizeof(unsigned char)*dtrisNum, "buildPolygonsByDetailedMeshes traversedTris"); + unsigned short* adjustedPoly; + int adjustedNv; + int allBorderTraversed; + + for (j=0; j<dtrisNum && btri==-1;j++) { int curpolytri = dtrisBase+j; - for (int k=0; k<3; k++) + for (k=0; k<3; k++) { unsigned short neighbortri = dtris[curpolytri*3*2+3+k]; if ( neighbortri==0xffff || dtrisToPolysMap[neighbortri]!=polyidx+1) @@ -187,12 +217,15 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, if (btri==-1 || bedge==-1) { //can't find triangle with border edge - return false; + MEM_freeN(traversedTris); + MEM_freeN(newPoly); + + return 0; } newPoly[nv++] = dtris[btri*3*2+bedge]; - int tri = btri; - int edge = (bedge+1)%3; + tri = btri; + edge = (bedge+1)%3; traversedTris[tri-dtrisBase] = 1; while (tri!=btri || edge!=bedge) { @@ -201,11 +234,12 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, { if (nv==capacity) { + unsigned short* newPolyBig; capacity += vertsPerPoly; - unsigned short* newPolyBig = new unsigned short[capacity]; + newPolyBig = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPolyBig"); memset(newPolyBig, 0xff, sizeof(unsigned short)*capacity); memcpy(newPolyBig, newPoly, sizeof(unsigned short)*nv); - delete newPoly; + MEM_freeN(newPoly); newPoly = newPolyBig; } newPoly[nv++] = dtris[tri*3*2+edge]; @@ -216,7 +250,7 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, { //move to next tri int twinedge = -1; - for (int k=0; k<3; k++) + for (k=0; k<3; k++) { if (dtris[neighbortri*3*2+3+k] == tri) { @@ -227,7 +261,8 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, if (twinedge==-1) { printf("Converting navmesh: Error! Can't find neighbor edge - invalid adjacency info\n"); - goto returnLabel; + MEM_freeN(traversedTris); + goto returnLabel; } tri = neighbortri; edge = (twinedge+1)%3; @@ -235,9 +270,9 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, } } - unsigned short* adjustedPoly = new unsigned short[nv]; - int adjustedNv = 0; - for (size_t i=0; i<(size_t)nv; i++) + adjustedPoly = MEM_callocN(sizeof(unsigned short)*nv, "buildPolygonsByDetailedMeshes adjustedPoly"); + adjustedNv = 0; + for (i=0; i<nv; i++) { unsigned short prev = newPoly[(nv+i-1)%nv]; unsigned short cur = newPoly[i]; @@ -248,22 +283,22 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, adjustedPoly[adjustedNv++] = cur; } memcpy(newPoly, adjustedPoly, adjustedNv*sizeof(unsigned short)); - delete adjustedPoly; + MEM_freeN(adjustedPoly); nv = adjustedNv; - bool allBorderTraversed = true; - for (size_t i=0; i<(size_t)dtrisNum; i++) + allBorderTraversed = 1; + for (i=0; i<dtrisNum; i++) { if (traversedTris[i]==0) { //check whether it has border edges int curpolytri = dtrisBase+i; - for (int k=0; k<3; k++) + for (k=0; k<3; k++) { unsigned short neighbortri = dtris[curpolytri*3*2+3+k]; if ( neighbortri==0xffff || dtrisToPolysMap[neighbortri]!=polyidx+1) { - allBorderTraversed = false; + allBorderTraversed = 0; break; } } @@ -272,16 +307,19 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, if (nv<=vertsPerPoly && allBorderTraversed) { - for (int i=0; i<nv; i++) + for (i=0; i<nv; i++) { polys[polyidx*vertsPerPoly*2+i] = newPoly[i]; } } + + MEM_freeN(traversedTris); } returnLabel: - delete newPoly; - return true; + MEM_freeN(newPoly); + + return 1; } struct SortContext @@ -292,7 +330,7 @@ struct SortContext /* XXX: not thread-safe, but it's called only from modifiers stack which isn't threaded. Anyway, better to avoid this in the future */ -static SortContext *_qsort_context; +static struct SortContext *_qsort_context; static int compareByData(const void * a, const void * b) { @@ -300,32 +338,41 @@ static int compareByData(const void * a, const void * b) _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)b]] ); } -bool buildNavMeshData(const int nverts, const float* verts, +int buildNavMeshData(const int nverts, const float* verts, const int ntris, const unsigned short *tris, const int* recastData, const int* trisToFacesMap, - int &ndtris, unsigned short *&dtris, - int &npolys, unsigned short *&dmeshes, unsigned short *&polys, - int &vertsPerPoly, int *&dtrisToPolysMap, int *&dtrisToTrisMap) + int *ndtris_r, unsigned short **dtris_r, + int *npolys_r, unsigned short **dmeshes_r, unsigned short **polys_r, + int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r) { + int *trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping"); + int i; + struct SortContext context; + int validTriStart, prevPolyIdx, curPolyIdx, newPolyIdx, prevpolyidx; + unsigned short *dmesh; + + int ndtris, npolys, vertsPerPoly; + unsigned short *dtris, *dmeshes, *polys; + int *dtrisToPolysMap, *dtrisToTrisMap; + if (!recastData) { printf("Converting navmesh: Error! Can't find recast custom data\n"); - return false; + return 0; } //sort the triangles by polygon idx - int* trisMapping = new int[ntris]; - for (int i=0; i<ntris; i++) + for (i=0; i<ntris; i++) trisMapping[i]=i; - SortContext context; context.recastData = recastData; context.trisToFacesMap = trisToFacesMap; _qsort_context = &context; qsort(trisMapping, ntris, sizeof(int), compareByData); + //search first valid triangle - triangle of convex polygon - int validTriStart = -1; - for (int i=0; i< ntris; i++) + validTriStart = -1; + for (i=0; i< ntris; i++) { if (recastData[trisToFacesMap[trisMapping[i]]]>0) { @@ -337,28 +384,30 @@ bool buildNavMeshData(const int nverts, const float* verts, if (validTriStart<0) { printf("Converting navmesh: Error! No valid polygons in mesh\n"); - delete trisMapping; - return false; + MEM_freeN(trisMapping); + return 0; } ndtris = ntris-validTriStart; //fill dtris to faces mapping - dtrisToTrisMap = new int[ndtris]; + dtrisToTrisMap = MEM_callocN(sizeof(int)*ndtris, "buildNavMeshData dtrisToTrisMap"); memcpy(dtrisToTrisMap, &trisMapping[validTriStart], ndtris*sizeof(int)); - delete trisMapping; trisMapping=NULL; + MEM_freeN(trisMapping); //create detailed mesh triangles - copy only valid triangles //and reserve memory for adjacency info - dtris = new unsigned short[3*2*ndtris]; + dtris = MEM_callocN(sizeof(unsigned short)*3*2*ndtris, "buildNavMeshData dtris"); memset(dtris, 0xffff, sizeof(unsigned short)*3*2*ndtris); - for (int i=0; i<ndtris; i++) + for (i=0; i<ndtris; i++) { memcpy(dtris+3*2*i, tris+3*dtrisToTrisMap[i], sizeof(unsigned short)*3); } + //create new recast data corresponded to dtris and renumber for continuous indices - int prevPolyIdx=-1, curPolyIdx, newPolyIdx=0; - dtrisToPolysMap = new int[ndtris]; - for (int i=0; i<ndtris; i++) + prevPolyIdx = -1; + newPolyIdx = 0; + dtrisToPolysMap = MEM_callocN(sizeof(int)*ndtris, "buildNavMeshData dtrisToPolysMap"); + for (i=0; i<ndtris; i++) { curPolyIdx = recastData[trisToFacesMap[dtrisToTrisMap[i]]]; if (curPolyIdx!=prevPolyIdx) @@ -371,15 +420,15 @@ bool buildNavMeshData(const int nverts, const float* verts, //build adjacency info for detailed mesh triangles - buildMeshAdjacency(dtris, ndtris, nverts, 3); + recast_buildMeshAdjacency(dtris, ndtris, nverts, 3); //create detailed mesh description for each navigation polygon npolys = dtrisToPolysMap[ndtris-1]; - dmeshes = new unsigned short[npolys*4]; + dmeshes = MEM_callocN(sizeof(unsigned short)*npolys*4, "buildNavMeshData dmeshes"); memset(dmeshes, 0, npolys*4*sizeof(unsigned short)); - unsigned short *dmesh = NULL; - int prevpolyidx = 0; - for (int i=0; i<ndtris; i++) + dmesh = NULL; + prevpolyidx = 0; + for (i=0; i<ndtris; i++) { int curpolyidx = dtrisToPolysMap[i]; if (curpolyidx!=prevpolyidx) @@ -387,7 +436,7 @@ bool buildNavMeshData(const int nverts, const float* verts, if (curpolyidx!=prevpolyidx+1) { printf("Converting navmesh: Error! Wrong order of detailed mesh faces\n"); - return false; + return 0; } dmesh = dmesh==NULL ? dmeshes : dmesh+4; dmesh[2] = (unsigned short)i; //tbase @@ -399,33 +448,43 @@ bool buildNavMeshData(const int nverts, const float* verts, //create navigation polygons vertsPerPoly = 6; - polys = new unsigned short[npolys*vertsPerPoly*2]; + polys = MEM_callocN(sizeof(unsigned short)*npolys*vertsPerPoly*2, "buildNavMeshData polys"); memset(polys, 0xff, sizeof(unsigned short)*vertsPerPoly*2*npolys); buildPolygonsByDetailedMeshes(vertsPerPoly, npolys, polys, dmeshes, verts, dtris, dtrisToPolysMap); - return true; + *ndtris_r = ndtris; + *npolys_r = npolys; + *vertsPerPoly_r = vertsPerPoly; + *dtris_r = dtris; + *dmeshes_r = dmeshes; + *polys_r = polys; + *dtrisToPolysMap_r = dtrisToPolysMap; + *dtrisToTrisMap_r = dtrisToTrisMap; + + return 1; } -bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly, - int &nverts, float *&verts, - int &ndtris, unsigned short *&dtris, - int& npolys, unsigned short *&dmeshes, - unsigned short*& polys, int *&dtrisToPolysMap, - int *&dtrisToTrisMap, int *&trisToFacesMap) +int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly, + int *nverts, float **verts, + int *ndtris, unsigned short **dtris, + int *npolys, unsigned short **dmeshes, + unsigned short **polys, int **dtrisToPolysMap, + int **dtrisToTrisMap, int **trisToFacesMap) { - bool res = true; - int ntris =0, *recastData=NULL; + int res = 1; + int ntris = 0, *recastData=NULL; unsigned short *tris=NULL; - res = buildRawVertIndicesData(dm, nverts, verts, ntris, tris, trisToFacesMap, recastData); + + res = buildRawVertIndicesData(dm, nverts, verts, &ntris, &tris, trisToFacesMap, &recastData); if (!res) { printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n"); goto exit; } - res = buildNavMeshData(nverts, verts, ntris, tris, recastData, trisToFacesMap, + res = buildNavMeshData(*nverts, *verts, ntris, tris, recastData, *trisToFacesMap, ndtris, dtris, npolys, dmeshes,polys, vertsPerPoly, dtrisToPolysMap, dtrisToTrisMap); if (!res) @@ -436,15 +495,15 @@ bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly, exit: if (tris) - delete tris; + MEM_freeN(tris); return res; } int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx) { - int res = -1; - for(int i=0; i<vertsPerPoly; i++) + int i, res = -1; + for(i=0; i<vertsPerPoly; i++) { if (p[i]==0xffff) break; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 89fd3ff9c13..524a63a8a95 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -295,12 +295,12 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType *ntype) { bNodeSocketTemplate *sockdef; - bNodeSocket *sock; + /* bNodeSocket *sock; */ /* UNUSED */ if(ntype->inputs) { sockdef= ntype->inputs; while(sockdef->type != -1) { - sock = node_add_input_from_template(ntree, node, sockdef); + /* sock = */ node_add_input_from_template(ntree, node, sockdef); sockdef++; } @@ -308,7 +308,7 @@ static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType if(ntype->outputs) { sockdef= ntype->outputs; while(sockdef->type != -1) { - sock = node_add_output_from_template(ntree, node, sockdef); + /* sock = */ node_add_output_from_template(ntree, node, sockdef); sockdef++; } @@ -620,7 +620,7 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype) bNodeTree *ntreeCopyTree(bNodeTree *ntree) { bNodeTree *newtree; - bNode *node, *nnode, *last; + bNode *node /*, *nnode */ /* UNUSED */, *last; bNodeLink *link; bNodeSocket *gsock, *oldgsock; @@ -647,7 +647,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree) last = ntree->nodes.last; for(node= ntree->nodes.first; node; node= node->next) { node->new_node= NULL; - nnode= nodeCopyNode(newtree, node); /* sets node->new */ + /* nnode= */ nodeCopyNode(newtree, node); /* sets node->new */ /* make sure we don't copy new nodes again! */ if (node==last) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index c6047bd94e9..f8669c30809 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2360,7 +2360,7 @@ BoundBox *unit_boundbox(void) BoundBox *bb; float min[3] = {-1.0f,-1.0f,-1.0f}, max[3] = {-1.0f,-1.0f,-1.0f}; - bb= MEM_callocN(sizeof(BoundBox), "bb"); + bb= MEM_callocN(sizeof(BoundBox), "OB-BoundBox"); boundbox_set_from_min_max(bb, min, max); return bb; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index d00eb6192da..ddeb42d608e 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -97,6 +97,10 @@ 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))); } +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)); +} void paint_init(Paint *p, const char col[3]) { Brush *brush; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index ff518d69e21..73d0d70778f 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -1,11 +1,35 @@ +/* + * $Id$ + * + * ***** 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 ***** + */ + /** \file blender/blenkernel/intern/sound.c * \ingroup bke */ -/** - * sound.c (mar-2001 nzc) - * - * $Id$ - */ #include <string.h> #include <stdlib.h> diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 2ff555b5b22..36263746228 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -968,8 +968,9 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface) for(index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); - int flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH; - int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0; + /* keep types in sync with MFace, avoid many conversions */ + char flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH; + short mat_nr = (faceFlags)? faceFlags[index*2+1]: 0; for(S = 0; S < numVerts; S++) { for(y = 0; y < gridSize - 1; y++) { @@ -1374,11 +1375,10 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss); GPUVertexAttribs gattribs; DMVertexAttribs attribs= {{{NULL}}}; - MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); + /* MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */ int gridSize = ccgSubSurf_getGridSize(ss); int gridFaces = gridSize - 1; int edgeSize = ccgSubSurf_getEdgeSize(ss); - int transp, orig_transp, new_transp; char *faceFlags = ccgdm->faceFlags; int a, b, i, doDraw, numVerts, matnr, new_matnr, totface; @@ -1386,8 +1386,6 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v doDraw = 0; matnr = -1; - transp = GPU_get_material_blend_mode(); - orig_transp = transp; #define PASSATTRIB(dx, dy, vert) { \ if(attribs.totorco) { \ @@ -1439,18 +1437,6 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v continue; } - if(tf) { - new_transp = tf[i].transp; - - if(new_transp != transp) { - if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID) - GPU_set_material_blend_mode(orig_transp); - else - GPU_set_material_blend_mode(new_transp); - transp = new_transp; - } - } - glShadeModel(drawSmooth? GL_SMOOTH: GL_FLAT); for (S=0; S<numVerts; S++) { DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S); diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 59c01348c07..21d28ca3185 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -53,6 +53,7 @@ int BLI_exists(const char *file); int BLI_copy_fileops(const char *file, const char *to); int BLI_rename(const char *from, const char *to); int BLI_gzip(const char *from, const char *to); +char *BLI_ungzip_to_mem(const char *from_file, int *size_r); int BLI_delete(const char *file, int dir, int recursive); int BLI_move(const char *file, const char *to); int BLI_touch(const char *file); diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h index ef20408a37e..d7ca03243df 100644 --- a/source/blender/blenlib/BLI_math_rotation.h +++ b/source/blender/blenlib/BLI_math_rotation.h @@ -102,6 +102,8 @@ void quat_to_axis_angle(float axis[3], float *angle, const float q[4]); void mat3_to_axis_angle(float axis[3], float *angle, float M[3][3]); void mat4_to_axis_angle(float axis[3], float *angle, float M[4][4]); +void single_axis_angle_to_mat3(float R[3][3], const char axis, const float angle); + /****************************** Vector/Rotation ******************************/ /* old axis angle code */ /* TODO: the following calls should probably be depreceated sometime */ diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 9a3b81e5776..456ee72c4e0 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -35,11 +35,11 @@ */ #ifndef FALSE -#define FALSE 0 +# define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +# define TRUE 1 #endif @@ -94,7 +94,7 @@ /* some math and copy defines */ #ifndef SWAP -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } +# define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } #endif #define ABS(a) ( (a)<0 ? (-(a)) : (a) ) diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 3299752646b..9ccd7fbe121 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -52,6 +52,8 @@ #include <sys/param.h> #endif +#include "MEM_guardedalloc.h" + #include "BLI_blenlib.h" #include "BKE_utildefines.h" @@ -104,6 +106,49 @@ int BLI_gzip(const char *from, const char *to) { return rval; } +/* gzip the file in from_file and write it to memery to_mem, at most size bytes. + return the unziped size + */ +char *BLI_ungzip_to_mem(const char *from_file, int *size_r) +{ + gzFile gzfile; + int readsize, size, alloc_size=0; + char *mem= NULL; + const int chunk_size= 512*1024; + + size= 0; + + gzfile = gzopen( from_file, "rb" ); + + for(;;) { + if(mem==NULL) { + mem= MEM_callocN(chunk_size, "BLI_ungzip_to_mem"); + alloc_size= chunk_size; + } else { + mem= MEM_reallocN(mem, size+chunk_size); + alloc_size+= chunk_size; + } + + readsize= gzread(gzfile, mem+size, chunk_size); + if(readsize>0) { + size+= readsize; + } + else break; + } + + if(size==0) { + MEM_freeN(mem); + mem= NULL; + } + else if(alloc_size!=size) + mem= MEM_reallocN(mem, size); + + *size_r= size; + + return mem; +} + + /* return 1 when file can be written */ int BLI_is_writable(const char *filename) { diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 6800b59c2c7..ef286e1d102 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -771,6 +771,52 @@ void mat4_to_axis_angle(float axis[3], float *angle,float mat[4][4]) quat_to_axis_angle(axis, angle,q); } + + +void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float angle) +{ + const float angle_cos= cosf(angle); + const float angle_sin= sinf(angle); + + switch(axis) { + case 'X': /* rotation around X */ + mat[0][0] = 1.0f; + mat[0][1] = 0.0f; + mat[0][2] = 0.0f; + mat[1][0] = 0.0f; + mat[1][1] = angle_cos; + mat[1][2] = angle_sin; + mat[2][0] = 0.0f; + mat[2][1] = -angle_sin; + mat[2][2] = angle_cos; + break; + case 'Y': /* rotation around Y */ + mat[0][0] = angle_cos; + mat[0][1] = 0.0f; + mat[0][2] = -angle_sin; + mat[1][0] = 0.0f; + mat[1][1] = 1.0f; + mat[1][2] = 0.0f; + mat[2][0] = angle_sin; + mat[2][1] = 0.0f; + mat[2][2] = angle_cos; + break; + case 'Z': /* rotation around Z */ + mat[0][0] = angle_cos; + mat[0][1] = angle_sin; + mat[0][2] = 0.0f; + mat[1][0] = -angle_sin; + mat[1][1] = angle_cos; + mat[1][2] = 0.0f; + mat[2][0] = 0.0f; + mat[2][1] = 0.0f; + mat[2][2] = 1.0f; + break; + default: + assert("invalid axis"); + } +} + /****************************** Vector/Rotation ******************************/ /* TODO: the following calls should probably be depreceated sometime */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 132db3c3577..1134eb17f9d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -239,6 +239,7 @@ typedef struct OldNewMap { /* local prototypes */ static void *read_struct(FileData *fd, BHead *bh, const char *blockname); static void direct_link_modifiers(FileData *fd, ListBase *lb); +static void convert_tface_mt(FileData *fd, Main *main); static OldNewMap *oldnewmap_new(void) { @@ -3479,6 +3480,9 @@ static void lib_link_mesh(FileData *fd, Main *main) } me= me->id.next; } + + /* convert texface options to material */ + convert_tface_mt(fd, main); } static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts) @@ -4029,8 +4033,10 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) FluidsimModifierData *fluidmd = (FluidsimModifierData*) md; fluidmd->fss= newdataadr(fd, fluidmd->fss); - fluidmd->fss->fmd= fluidmd; - fluidmd->fss->meshVelocities = NULL; + if(fluidmd->fss) { + fluidmd->fss->fmd= fluidmd; + fluidmd->fss->meshVelocities = NULL; + } } else if (md->type==eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData*) md; @@ -6545,7 +6551,7 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me) /* if we do, set alpha sort if the game engine did it before */ for(a=0, mf=me->mface; a<me->totface; a++, mf++) { if(mf->mat_nr < me->totcol) { - ma= newlibadr(fd, lib, me->mat[(int)mf->mat_nr]); + ma= newlibadr(fd, lib, me->mat[mf->mat_nr]); texalpha = 0; /* we can't read from this if it comes from a library, @@ -7225,6 +7231,27 @@ static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree) sock->flag |= SOCK_DYNAMIC; } +void convert_tface_mt(FileData *fd, Main *main) +{ + Main *gmain; + + /* this is a delayed do_version (so it can create new materials) */ + if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 3)) { + + //XXX hack, material.c uses G.main all over the place, instead of main + // temporarily set G.main to the current main + gmain = G.main; + G.main = main; + + if(!(do_version_tface(main, 1))) { + BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console"); + } + + //XXX hack, material.c uses G.main allover the place, instead of main + G.main = gmain; + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -12409,7 +12436,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) BlendFileData *bfd; bfd= MEM_callocN(sizeof(BlendFileData), "blendfiledata"); - bfd->main= MEM_callocN(sizeof(Main), "main"); + bfd->main= MEM_callocN(sizeof(Main), "readfile_Main"); BLI_addtail(&fd->mainlist, bfd->main); bfd->main->versionfile= fd->fileversion; diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index 4da0a4c6e1f..4892955fd3c 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -129,7 +129,7 @@ void GeometryExporter::operator()(Object *ob) } // powerful because it handles both cases when there is material and when there's not -void GeometryExporter::createPolylist(int material_index, +void GeometryExporter::createPolylist(short material_index, bool has_uvs, bool has_color, Object *ob, diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h index 64c51b6324e..532a439eba7 100644 --- a/source/blender/collada/GeometryExporter.h +++ b/source/blender/collada/GeometryExporter.h @@ -67,7 +67,7 @@ public: void operator()(Object *ob); // powerful because it handles both cases when there is material and when there's not - void createPolylist(int material_index, + void createPolylist(short material_index, bool has_uvs, bool has_color, Object *ob, diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 15bd9c48f12..2f5d9e54e50 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -778,7 +778,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri std::map<COLLADAFW::UniqueId, Material*>& uid_material_map, Object *ob, const COLLADAFW::UniqueId *geom_uid, MTex **color_texture, char *layername, MTFace *texture_face, - std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, int mat_index) + std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index) { Mesh *me = (Mesh*)ob->data; const COLLADAFW::UniqueId& ma_uid = cmaterial.getReferencedMaterial(); diff --git a/source/blender/collada/MeshImporter.h b/source/blender/collada/MeshImporter.h index 88ee0e46c33..208ba4d65c0 100644 --- a/source/blender/collada/MeshImporter.h +++ b/source/blender/collada/MeshImporter.h @@ -141,7 +141,7 @@ public: std::map<COLLADAFW::UniqueId, Material*>& uid_material_map, Object *ob, const COLLADAFW::UniqueId *geom_uid, MTex **color_texture, char *layername, MTFace *texture_face, - std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, int mat_index); + std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index); Object *create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom, diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 6137d7a4d70..92af51326a8 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3148,21 +3148,21 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan icon= ICON_VISIBLE_IPO_OFF; if (ale->type == ANIMTYPE_FCURVE) - tooltip= "Channel is visible in Graph Editor for editing."; + tooltip= "Channel is visible in Graph Editor for editing"; else - tooltip= "Channel(s) are visible in Graph Editor for editing."; + tooltip= "Channel(s) are visible in Graph Editor for editing"; break; case ACHANNEL_SETTING_EXPAND: /* expanded triangle */ //icon= ((enabled)? ICON_TRIA_DOWN : ICON_TRIA_RIGHT); icon= ICON_TRIA_RIGHT; - tooltip= "Make channels grouped under this channel visible."; + tooltip= "Make channels grouped under this channel visible"; break; case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */ //icon= ((enabled)? ICON_LAYER_ACTIVE : ICON_LAYER_USED); icon= ICON_LAYER_USED; - tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to."; + tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to"; break; /* --- */ @@ -3171,7 +3171,7 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan // TODO: what about when there's no protect needed? //icon= ((enabled)? ICON_LOCKED : ICON_UNLOCKED); icon= ICON_UNLOCKED; - tooltip= "Editability of keyframes for this channel."; + tooltip= "Editability of keyframes for this channel"; break; case ACHANNEL_SETTING_MUTE: /* muted speaker */ @@ -3179,9 +3179,9 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan icon= ICON_MUTE_IPO_OFF; if (ale->type == ALE_FCURVE) - tooltip= "Does F-Curve contribute to result."; + tooltip= "Does F-Curve contribute to result"; else - tooltip= "Do channels contribute to result."; + tooltip= "Do channels contribute to result"; break; default: diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 6ebe488d2c8..e8f3fc28d74 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -364,7 +364,7 @@ short ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int /* if the buffer is empty, cannot paste... */ if (channeldriver_copypaste_buf == NULL) { - BKE_report(reports, RPT_ERROR, "Paste Driver: No Driver to paste."); + BKE_report(reports, RPT_ERROR, "Paste Driver: No Driver to paste"); return 0; } @@ -527,7 +527,7 @@ void ANIM_OT_driver_button_add (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array"); } /* Remove Driver Button Operator ------------------------ */ @@ -579,7 +579,7 @@ void ANIM_OT_driver_button_remove (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array"); } /* Copy Driver Button Operator ------------------------ */ diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 928584966d9..77c67fc4af0 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -648,7 +648,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie uiBlockSetEmboss(block, UI_EMBOSSN); /* delete button */ - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier"); uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm); uiBlockSetEmboss(block, UI_EMBOSS); diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 3d3311b35eb..0f4546968ba 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -753,7 +753,7 @@ EnumPropertyItem keyframe_paste_merge_items[] = { {KEYFRAME_PASTE_MERGE_MIX, "MIX", 0, "Mix", "Overlay existing with new keys"}, {KEYFRAME_PASTE_MERGE_OVER, "OVER_ALL", 0, "Overwrite All", "Replace all keys"}, {KEYFRAME_PASTE_MERGE_OVER_RANGE, "OVER_RANGE", 0, "Overwrite Range", "Overwrite keys in pasted range"}, - {KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL, "OVER_RANGE_ALL", 0, "Overwrite Entire Range", "Overwrite keys in pasted range, using the range of all copied keys."}, + {KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL, "OVER_RANGE_ALL", 0, "Overwrite Entire Range", "Overwrite keys in pasted range, using the range of all copied keys"}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 1e7c18dc6ac..58e1549c0ed 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -763,7 +763,7 @@ short insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA * /* F-Curve not editable? */ if (fcurve_is_keyframable(fcu) == 0) { BKE_reportf(reports, RPT_ERROR, - "F-Curve with path = '%s' [%d] cannot be keyframed. Ensure that it is not locked or sampled. Also, try removing F-Modifiers.", + "F-Curve with path = '%s' [%d] cannot be keyframed. Ensure that it is not locked or sampled. Also, try removing F-Modifiers", fcu->rna_path, fcu->array_index); return 0; } @@ -1460,7 +1460,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) else { if (G.f & G_DEBUG) printf("Button Insert-Key: no path to property \n"); - BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead."); + BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead"); } } else if (G.f & G_DEBUG) { @@ -1498,7 +1498,7 @@ void ANIM_OT_keyframe_insert_button (wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array"); } /* Delete Key Button Operator ------------------------ */ @@ -1570,7 +1570,7 @@ void ANIM_OT_keyframe_delete_button (wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array"); } /* ******************************************* */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index dcd1c3abbde..7c2f969e187 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -382,7 +382,7 @@ void ANIM_OT_keyingset_button_add (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set"); } /* Remove from KeyingSet Button Operator ------------------------ */ diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt index 9a44525611a..7ecbdc9ebe5 100644 --- a/source/blender/editors/armature/CMakeLists.txt +++ b/source/blender/editors/armature/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/armature/SConscript b/source/blender/editors/armature/SConscript index b7f9a263bc1..ded82b3dfb7 100644 --- a/source/blender/editors/armature/SConscript +++ b/source/blender/editors/armature/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../../blenloader' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../../blenloader' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../gpu ../../makesrna #/intern/opennl/extern' diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index eafe65b4492..566ff09c366 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -653,7 +653,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op) if (ob->type!=OB_ARMATURE) return OPERATOR_CANCELLED; if (object_data_is_libdata(ob)) { - BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature."); //error_libdata(); + BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); //error_libdata(); return OPERATOR_CANCELLED; } @@ -782,7 +782,7 @@ void POSE_OT_visual_transform_apply (wmOperatorType *ot) /* identifiers */ ot->name= "Apply Visual Transform to Pose"; ot->idname= "POSE_OT_visual_transform_apply"; - ot->description= "Apply final constrained position of pose bones to their transform."; + ot->description= "Apply final constrained position of pose bones to their transform"; /* callbacks */ ot->exec= pose_visual_transform_apply_exec; @@ -1480,7 +1480,7 @@ void POSE_OT_select_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); } /* **************** END Posemode stuff ********************** */ @@ -1574,7 +1574,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties s*/ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); } /* does bones and points */ @@ -2115,8 +2115,8 @@ void ARMATURE_OT_calculate_roll(wmOperatorType *ot) /* properties */ ot->prop= RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", ""); - RNA_def_boolean(ot->srna, "axis_flip", 0, "Flip Axis", "Negate the alignment axis."); - RNA_def_boolean(ot->srna, "axis_only", 0, "Shortest Rotation", "Ignore the axis direction, use the shortest rotation to align."); + RNA_def_boolean(ot->srna, "axis_flip", 0, "Flip Axis", "Negate the alignment axis"); + RNA_def_boolean(ot->srna, "axis_only", 0, "Shortest Rotation", "Ignore the axis direction, use the shortest rotation to align"); } /* **************** undo for armatures ************** */ @@ -3196,7 +3196,7 @@ void ARMATURE_OT_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op)) @@ -4290,10 +4290,15 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor /* if the bone cannot be affected, don't do anything */ if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) { + Object *ob_act= OBACT; bArmature *arm= ob->data; - /* since we do unified select, we don't shift+select a bone if the armature object was not active yet */ - if (!(extend) || (base != scene->basact)) { + /* since we do unified select, we don't shift+select a bone if the + * armature object was not active yet. + * note, special exception for armature mode so we can do multi-select + * we could check for multi-select explicitly but think its fine to + * always give pradictable behavior in weight paint mode - campbell */ + if (!(extend) || ((ob_act && ob_act->mode & OB_MODE_WEIGHT_PAINT) == 0)) { ED_pose_deselectall(ob, 0); nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); arm->act_bone= nearBone; @@ -4324,7 +4329,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor } /* in weightpaint we select the associated vertex group too */ - if (OBACT && OBACT->mode & OB_MODE_WEIGHT_PAINT) { + if (ob_act && ob_act->mode & OB_MODE_WEIGHT_PAINT) { if (nearBone == arm->act_bone) { ED_vgroup_select_by_name(OBACT, nearBone->name); DAG_id_tag_update(&OBACT->id, OB_RECALC_DATA); @@ -5061,6 +5066,10 @@ void POSE_OT_select_inverse(wmOperatorType *ot) static int pose_de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); + + Object *ob = NULL; + Scene *scene= CTX_data_scene(C); + int multipaint = scene->toolsettings->multipaint; if (action == SEL_TOGGLE) { action= CTX_DATA_COUNT(C, selected_pose_bones) ? SEL_DESELECT : SEL_SELECT; @@ -5091,6 +5100,11 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL); + if(multipaint) { + ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + } + return OPERATOR_FINISHED; } @@ -5534,7 +5548,7 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* settings */ - ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with."); + ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with"); } diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 48ca6d6fd72..6c721660e9c 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -657,22 +657,41 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, int *vertsflipped = NULL, *mask= NULL; int a, totface, j, bbone, firstsegment, lastsegment; + MVert *mvert = me->mvert; + int use_vert_sel= FALSE; + int use_face_sel= FALSE; + *err_str= NULL; /* count triangles and create mask */ - if(me->editflag & ME_EDIT_PAINT_MASK) + if( (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) || + (use_vert_sel= ((me->editflag & ME_EDIT_VERT_SEL) != 0))) + { mask= MEM_callocN(sizeof(int)*me->totvert, "heat_bone_weighting mask"); + } for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) { totface++; if(mface->v4) totface++; - if(mask && (mface->flag & ME_FACE_SEL)) { - mask[mface->v1]= 1; - mask[mface->v2]= 1; - mask[mface->v3]= 1; - if(mface->v4) - mask[mface->v4]= 1; + /* (added selectedVerts content for vertex mask, they used to just equal 1) */ + if(use_vert_sel) { + mask[mface->v1]= (mvert[mface->v1].flag & SELECT) != 0; + mask[mface->v2]= (mvert[mface->v2].flag & SELECT) != 0; + mask[mface->v3]= (mvert[mface->v3].flag & SELECT) != 0; + if(mface->v4) { + mask[mface->v4]= (mvert[mface->v4].flag & SELECT) != 0; + } + } + else { + if(use_face_sel) { + mask[mface->v1]= 1; + mask[mface->v2]= 1; + mask[mface->v3]= 1; + if(mface->v4) { + mask[mface->v4]= 1; + } + } } } @@ -936,7 +955,7 @@ void rigid_deform_iteration() } else { if(!sys->rigid.thrownerror) { - error("RigidDeform: failed to find solution."); + error("RigidDeform: failed to find solution"); sys->rigid.thrownerror= 1; } break; @@ -1693,7 +1712,7 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb) } } else { - error("Mesh Deform: failed to find solution."); + error("Mesh Deform: failed to find solution"); break; } diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 16888908bab..0497c0507dc 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -600,7 +600,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp * } } else { - BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between."); + BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between"); pose_slide_exit(op); return OPERATOR_CANCELLED; } @@ -718,8 +718,8 @@ static int pose_slide_exec_common (bContext *C, wmOperator *op, tPoseSlideOp *ps /* common code for defining RNA properties */ static void pose_slide_opdef_properties (wmOperatorType *ot) { - RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame.", 0, 50); - RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame.", 0, 50); + RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame", 0, 50); + RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame", 0, 50); RNA_def_float_percentage(ot->srna, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Weighting factor for the sliding operation", 0.3, 0.7); } diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 67c93c4c906..8a7d837d2a8 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -43,6 +43,8 @@ #include "BLI_dlrbTree.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_object_types.h" @@ -407,15 +409,15 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); /* add new (adds to the first unoccupied frame) */ - uiItemIntO(layout, "Add New", ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib)); + uiItemIntO(layout, UI_translate_do_iface(N_("Add New")), ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib)); /* check if we have any choices to add a new pose in any other way */ if ((ob->poselib) && (ob->poselib->markers.first)) { /* add new (on current frame) */ - uiItemIntO(layout, "Add New (Current Frame)", ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA); + uiItemIntO(layout, UI_translate_do_iface(N_("Add New (Current Frame)")), ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA); /* replace existing - submenu */ - uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu, NULL); + uiItemMenuF(layout, UI_translate_do_iface(N_("Replace Existing...")), 0, poselib_add_menu_invoke__replacemenu, NULL); } uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 83285d3634a..4405f395843 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -673,7 +673,7 @@ void POSE_OT_select_grouped (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); } @@ -722,7 +722,7 @@ void POSE_OT_select_flip_active(wmOperatorType *ot) /* identifiers */ ot->name= "Flip Selected Active Bone"; ot->idname= "POSE_OT_select_flip_active"; - ot->description= "Activate the bone with a flipped name."; + ot->description= "Activate the bone with a flipped name"; /* api callbacks */ ot->exec= pose_bone_flip_active_exec; @@ -1844,7 +1844,7 @@ void POSE_OT_autoside_names (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* settings */ - ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with."); + ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with"); } /* ********************************************** */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index b35085ff64d..84df77bb120 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1354,7 +1354,7 @@ static int separate_exec(bContext *C, wmOperator *op) oldedit= oldcu->editnurb; if(oldcu->key) { - BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys."); + BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys"); return OPERATOR_CANCELLED; } @@ -2693,7 +2693,7 @@ void CURVE_OT_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } /********************** reveal operator *********************/ @@ -3912,7 +3912,7 @@ static int merge_nurb(bContext *C, wmOperator *op) if(nsortbase.first == nsortbase.last) { BLI_freelistN(&nsortbase); - BKE_report(op->reports, RPT_ERROR, "Too few selections to merge."); + BKE_report(op->reports, RPT_ERROR, "Too few selections to merge"); return OPERATOR_CANCELLED; } @@ -4692,7 +4692,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at.", -1e4, 1e4); + RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at", -1e4, 1e4); } /***************** extrude operator **********************/ @@ -4882,7 +4882,7 @@ void CURVE_OT_cyclic_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to make surface cyclic in."); + RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to make surface cyclic in"); } /***************** select linked operator ******************/ @@ -5017,7 +5017,7 @@ void CURVE_OT_select_linked_pick(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked control points rather than selecting them."); + RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked control points rather than selecting them"); } /***************** select row operator **********************/ @@ -5460,8 +5460,8 @@ void CURVE_OT_select_random(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly.", 0.f, 100.0f); - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first."); + RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first"); } /********************* every nth number of point *******************/ @@ -5992,7 +5992,7 @@ void CURVE_OT_delete(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Which elements to delete."); + RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Which elements to delete"); } /********************** shade smooth/flat operator *********************/ diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 6c95df53d39..fcac070f84e 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -346,7 +346,7 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename) if(!fp) { if(reports) - BKE_reportf(reports, RPT_ERROR, "Failed to open file %s.", filename); + BKE_reportf(reports, RPT_ERROR, "Failed to open file %s", filename); return OPERATOR_CANCELLED; } @@ -662,8 +662,8 @@ void FONT_OT_style_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to."); - RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear style rather than setting it."); + RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to"); + RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear style rather than setting it"); } /******************* toggle style operator ********************/ @@ -700,7 +700,7 @@ void FONT_OT_style_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to."); + RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to"); } /******************* copy text operator ********************/ @@ -799,7 +799,7 @@ static int paste_selection(Object *obedit, ReportList *reports) } } else - BKE_report(reports, RPT_WARNING, "Text too long."); + BKE_report(reports, RPT_WARNING, "Text too long"); return 0; } @@ -968,7 +968,7 @@ void FONT_OT_move(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to."); + RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to"); } /******************* move select operator ********************/ @@ -995,7 +995,7 @@ void FONT_OT_move_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection."); + RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection"); } /************************* change spacing **********************/ @@ -1037,7 +1037,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with.", -20, 20); + RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with", -20, 20); } /************************* change character **********************/ @@ -1082,7 +1082,7 @@ void FONT_OT_change_character(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_int(ot->srna, "delta", 1, -255, 255, "Delta", "Number to increase or decrease character code with.", -255, 255); + RNA_def_int(ot->srna, "delta", 1, -255, 255, "Delta", "Number to increase or decrease character code with", -255, 255); } /******************* line break operator ********************/ @@ -1215,7 +1215,7 @@ void FONT_OT_delete(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", delete_type_items, DEL_ALL, "Type", "Which part of the text to delete."); + RNA_def_enum(ot->srna, "type", delete_type_items, DEL_ALL, "Type", "Which part of the text to delete"); } /*********************** insert text operator *************************/ @@ -1365,8 +1365,8 @@ void FONT_OT_text_insert(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); - RNA_def_boolean(ot->srna, "accent", 0, "Accent mode", "Next typed character will strike through previous, for special character input."); + RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position"); + RNA_def_boolean(ot->srna, "accent", 0, "Accent mode", "Next typed character will strike through previous, for special character input"); } @@ -1445,9 +1445,7 @@ void FONT_OT_textbox_remove(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "The current text box.", 0, INT_MAX); - - + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "The current text box", 0, INT_MAX); } @@ -1584,7 +1582,7 @@ void FONT_OT_case_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "case", case_items, CASE_LOWER, "Case", "Lower or upper case."); + RNA_def_enum(ot->srna, "case", case_items, CASE_LOWER, "Case", "Lower or upper case"); } /********************** toggle case operator *********************/ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 1cd8b1f05db..c915bc9ea37 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -595,7 +595,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op) /* check if there's data to work with */ if (gpd == NULL) { - BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on."); + BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on"); return OPERATOR_CANCELLED; } @@ -607,7 +607,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op) break; default: /* unsupoorted */ - BKE_report(op->reports, RPT_ERROR, "Unknown conversion option."); + BKE_report(op->reports, RPT_ERROR, "Unknown conversion option"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index da3310ae883..842ab92ae31 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1901,7 +1901,7 @@ void GPENCIL_OT_draw (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* settings for drawing */ - RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements."); + RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements"); RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 8bb77ad43a0..9709979ff6a 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -123,6 +123,8 @@ int EM_vertColorCheck(struct EditMesh *em); void undo_push_mesh(struct bContext *C, const char *name); +void paintvert_flush_flags(struct Object *ob); +void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags); /* editmesh_lib.c */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index f8682d3935b..d574ddd3030 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -53,6 +53,7 @@ struct Scene; struct View3D; struct ViewContext; struct wmWindow; +struct MVert; /* for derivedmesh drawing callbacks, for view3d_select, .... */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 637940f59a6..06b44e36b69 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -799,9 +799,15 @@ void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const cha int UI_GetStringWidth(const char *str); // XXX temp void UI_DrawString(float x, float y, const char *str); // XXX temp void UI_DrawTriIcon(float x, float y, char dir); - +uiStyle* UI_GetStyle(void); /* linker workaround ack! */ void UI_template_fix_linking(void); +/* translation */ +int UI_translate_iface(void); +int UI_translate_tooltips(void); +const char *UI_translate_do_iface(const char *msgid); +const char *UI_translate_do_tooltip(const char *msgid); + #endif /* UI_INTERFACE_H */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 0dee7a3813a..2ff77d255c6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -55,9 +55,11 @@ #include "BIF_gl.h" #include "BLF_api.h" +#include "BLF_translation.h" #include "UI_interface.h" +#include "IMB_imbuf.h" #include "WM_api.h" #include "WM_types.h" @@ -92,19 +94,46 @@ static void ui_free_but(const bContext *C, uiBut *but); /* ************* translation ************** */ -int ui_translate_buttons(void) +int UI_translate_iface(void) { - return (U.transopts & USER_TR_BUTTONS); +#ifdef INTERNATIONAL + return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE); +#else + return 0; +#endif +} + +int UI_translate_tooltips(void) +{ +#ifdef INTERNATIONAL + return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS); +#else + return 0; +#endif } -int ui_translate_menus(void) +const char *UI_translate_do_iface(const char *msgid) { - return (U.transopts & USER_TR_MENUS); +#ifdef INTERNATIONAL + if(UI_translate_iface()) + return BLF_gettext(msgid); + else + return msgid; +#else + return msgid; +#endif } -int ui_translate_tooltips(void) +const char *UI_translate_do_tooltip(const char *msgid) { - return (U.transopts & USER_TR_TOOLTIPS); +#ifdef INTERNATIONAL + if(UI_translate_tooltips()) + return BLF_gettext(msgid); + else + return msgid; +#else + return msgid; +#endif } /* ************* window matrix ************** */ @@ -228,7 +257,7 @@ void ui_block_translate(uiBlock *block, int x, int y) static void ui_text_bounds_block(uiBlock *block, float offset) { - uiStyle *style= U.uistyles.first; // XXX pass on as arg + uiStyle *style=UI_GetStyle(); uiBut *bt; int i = 0, j, x1addval= offset, nextcol; int lastcol= 0, col= 0; @@ -237,9 +266,6 @@ static void ui_text_bounds_block(uiBlock *block, float offset) for(bt= block->buttons.first; bt; bt= bt->next) { if(bt->type!=SEPR) { - //int transopts= ui_translate_buttons(); - //if(bt->type==TEX || bt->type==IDPOIN) transopts= 0; - j= BLF_width(style->widget.uifont_id, bt->drawstr); if(j > i) i = j; @@ -929,7 +955,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u /* uses local copy of style, to scale things down, and allow widgets to change stuff */ void uiDrawBlock(const bContext *C, uiBlock *block) { - uiStyle style= *((uiStyle *)U.uistyles.first); // XXX pass on as arg + uiStyle style= *UI_GetStyle(); // XXX pass on as arg ARegion *ar; uiBut *but; rcti rect; @@ -1894,6 +1920,8 @@ static void ui_free_but(const bContext *C, uiBut *but) if(but->str && but->str != but->strdata) MEM_freeN(but->str); ui_free_link(but->link); + if((but->type == BUT_IMAGE) && but->poin) IMB_freeImBuf((struct ImBuf *)but->poin); + MEM_freeN(but); } @@ -2030,12 +2058,9 @@ void ui_check_but(uiBut *but) /* if something changed in the button */ double value= UI_BUT_VALUE_UNSET; // float okwidth; // UNUSED -// int transopts= ui_translate_buttons(); ui_is_but_sel(but, &value); -// if(but->type==TEX || but->type==IDPOIN) transopts= 0; - /* only update soft range while not editing */ if(but->rnaprop && !(but->editval || but->editstr || but->editvec)) { UI_GET_BUT_VALUE_INIT(but, value) @@ -2544,7 +2569,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s DynStr *dynstr; int i, totitem, value, free; - RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); value= RNA_property_enum_get(ptr, prop); dynstr= BLI_dynstr_new(); @@ -2579,7 +2604,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s EnumPropertyItem *item; int i, totitem, free; - RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); for(i=0; i<totitem; i++) { if(item[i].identifier[0] && item[i].value == (int)max) { str= item[i].name; @@ -2707,6 +2732,11 @@ static uiBut *ui_def_but_operator(uiBlock *block, int type, const char *opname, if ((!tip || tip[0]=='\0') && ot && ot->description) { tip= ot->description; + +#ifdef INTERNATIONAL + if(UI_translate_tooltips()) + tip= BLF_gettext(tip); +#endif } but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 8889c419c35..a1275e237c1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -461,19 +461,14 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel) /* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */ -void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect) +void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect) { #ifdef WITH_HEADLESS (void)rect; #else - extern char datatoc_splash_png[]; - extern int datatoc_splash_png_size; - ImBuf *ibuf; + ImBuf *ibuf= (ImBuf *)but->poin; //GLint scissor[4]; //int w, h; - - /* hardcoded to splash, loading and freeing every draw, eek! */ - ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect); if (!ibuf) return; @@ -501,7 +496,6 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors * glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); */ - IMB_freeImBuf(ibuf); #endif } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7661fa5994b..125928c136b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1269,7 +1269,7 @@ static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data) /* note, but->block->aspect is used here, when drawing button style is getting scaled too */ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x) { - uiStyle *style= U.uistyles.first; // XXX pass on as arg + uiStyle *style= UI_GetStyle(); // XXX pass on as arg uiFontStyle *fstyle = &style->widget; int startx= but->x1; char *origstr; @@ -4101,7 +4101,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg) wmKeyMapItem *kmi; PointerRNA ptr; uiLayout *layout; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); IDProperty *prop= (but->opptr)? but->opptr->data: NULL; int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km); @@ -4133,7 +4133,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) wmKeyMapItem *kmi; PointerRNA ptr; uiLayout *layout; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); IDProperty *prop= (but->opptr)? but->opptr->data: NULL; int kmi_id; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index ebc8725ad5d..72eb869dea0 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -347,10 +347,6 @@ typedef struct uiSafetyRct { extern void ui_delete_linkline(uiLinkLine *line, uiBut *but); -extern int ui_translate_buttons(void); -extern int ui_translate_menus(void); -extern int ui_translate_tooltips(void); - void ui_fontscale(short *points, float aspect); extern void ui_block_to_window_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 59bbe67a8e2..3c02f7d4bd2 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -43,6 +43,8 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_idprop.h" @@ -475,7 +477,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt const char *name; int a, totitem, itemw, icon, value, free; - RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); for(a=0; a<totitem; a++) { @@ -634,8 +636,14 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i return PointerRNA_NULL; } - if(!name) + if(!name) { name= ot->name; + +#ifdef INTERNATIONAL + name= UI_translate_do_iface(name); +#endif + } + if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; @@ -701,7 +709,7 @@ static const char *ui_menu_enumpropname(uiLayout *layout, const char *opname, co int totitem, free; const char *name; - RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free); if(RNA_enum_name(item, retval, &name)) { if(free) MEM_freeN(item); return name; @@ -753,7 +761,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname uiLayout *split= uiLayoutSplit(layout, 0, 0); uiLayout *column= uiLayoutColumn(split, 0); - RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item, &totitem, &free); for(i=0; i<totitem; i++) { if(item[i].identifier[0]) { @@ -815,7 +823,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char /* pass */ } else { - RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname); + RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname); return; } @@ -841,10 +849,10 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char /* enum lookup */ if((prop= RNA_struct_find_property(&ptr, propname))) { - RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free); + RNA_property_enum_items_gettexted(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free); if(item==NULL || RNA_enum_value_from_id(item, value_str, &value)==0) { if(free) MEM_freeN(item); - RNA_warning("%s.%s, enum %s not found.", RNA_struct_identifier(ptr.type), propname, value_str); + RNA_warning("%s.%s, enum %s not found", RNA_struct_identifier(ptr.type), propname, value_str); return; } @@ -852,7 +860,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char MEM_freeN(item); } else { - RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname); + RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname); return; } @@ -1091,7 +1099,7 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr return; } - RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free); + RNA_property_enum_items_gettexted(layout->root->block->evil_C, ptr, prop, &item, NULL, &free); if(!RNA_enum_value_from_id(item, value, &ivalue)) { if(free) MEM_freeN(item); @@ -1135,7 +1143,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname uiLayout *split= uiLayoutSplit(layout, 0, 0); uiLayout *column= uiLayoutColumn(split, 0); - RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); for(i=0; i<totitem; i++) { if(item[i].identifier[0]) { @@ -1320,7 +1328,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna type= RNA_property_type(prop); if(!ELEM(type, PROP_POINTER, PROP_STRING)) { - RNA_warning("property %s must be a pointer or string.", propname); + RNA_warning("Property %s must be a pointer or string", propname); return; } @@ -1421,8 +1429,14 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const return; } - if(!name) + if(!name) { name= mt->label; + +#ifdef INTERNATIONAL + name= UI_translate_do_iface(name); +#endif + } + if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; @@ -2794,7 +2808,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in empty= uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0; if(empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) { - uiItemL(layout, "No Properties.", ICON_NONE); + uiItemL(layout, UI_translate_do_iface(N_("No Properties")), ICON_NONE); } } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index e9fad382beb..fd9386dc5ab 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -317,7 +317,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array"); } /* Copy To Selected Operator ------------------------ */ @@ -409,7 +409,7 @@ static void UI_OT_copy_to_selected_button(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array"); } /* Reports to Textblock Operator ------------------------ */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index cd1d250d6a4..ec7456eebdc 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -173,7 +173,7 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar) Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); Panel *pa, *patab, *palast, *panext; char *drawname= pt->label; char *idname= pt->idname; @@ -292,7 +292,7 @@ void uiEndPanel(uiBlock *block, int width, int height) static void ui_offset_panel_block(uiBlock *block) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiBut *but; int ofsy; @@ -442,8 +442,12 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r Panel *panel= block->panel; rcti hrect; int pnl_icons; - char *activename= panel->drawname[0]?panel->drawname:panel->panelname; - + const char *activename= panel->drawname[0]?panel->drawname:panel->panelname; + +#ifdef INTERNATIONAL + activename= UI_translate_do_iface(activename); +#endif + /* + 0.001f to avoid flirting with float inaccuracy */ if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f; else pnl_icons= (panel->labelofs+PNL_ICON+5)/block->aspect + 0.001f; @@ -667,7 +671,7 @@ static int compare_panel(const void *a1, const void *a2) /* returns 1 when it did something */ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); Panel *pa; PanelSort *ps, *panelsort, *psnext; int a, tot=0, done; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index f31c16cd020..4221f7c30ff 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -62,6 +62,7 @@ #include "UI_view2d.h" #include "BLF_api.h" +#include "BLF_translation.h" #include "ED_screen.h" @@ -318,7 +319,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) rcti bbox= data->bbox; int a; - ui_draw_menu_back(U.uistyles.first, NULL, &data->bbox); + ui_draw_menu_back(UI_GetStyle(), NULL, &data->bbox); /* draw text */ uiStyleFontSet(&data->fstyle); @@ -343,9 +344,10 @@ static void ui_tooltip_region_free_cb(ARegion *ar) ar->regiondata= NULL; } +#define TIP_(msgid) UI_translate_do_tooltip(msgid) ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) { - uiStyle *style= U.uistyles.first; // XXX pass on as arg + uiStyle *style= UI_GetStyle(); static ARegionType type; ARegion *ar; uiTooltipData *data; @@ -374,7 +376,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) EnumPropertyItem *item; int i, totitem, free; - RNA_property_enum_items(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free); + RNA_property_enum_items_gettexted(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free); for(i=0; i<totitem; i++) { if(item[i].identifier[0] && item[i].value == (int)but->hardmax) { @@ -403,7 +405,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) prop= (but->opptr)? but->opptr->data: NULL; if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Shortcut: %s", buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Shortcut: %s")), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -413,7 +415,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* full string */ ui_get_but_string(but, buf, sizeof(buf)); if(buf[0]) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Value: %s", buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Value: %s")), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -425,7 +427,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if (unit_type == PROP_UNIT_ROTATION) { if (RNA_property_type(but->rnaprop) == PROP_FLOAT) { float value= RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop); - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Radians: %f", value); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Radians: %f")), value); data->color[data->totline]= 0x888888; data->totline++; } @@ -434,7 +436,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if(but->flag & UI_BUT_DRIVEN) { if(ui_but_anim_expression_get(but, buf, sizeof(buf))) { /* expression */ - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Expression: %s", buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Expression: %s")), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -442,7 +444,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* rna info */ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s.%s")), RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); data->color[data->totline]= 0x888888; data->totline++; } @@ -450,7 +452,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if(but->rnapoin.id.data) { ID *id= but->rnapoin.id.data; if(id->lib && id->lib->name) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Library: %s", id->lib->name); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Library: %s")), id->lib->name); data->color[data->totline]= 0x888888; data->totline++; } @@ -465,7 +467,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* operator info */ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), str); data->color[data->totline]= 0x888888; data->totline++; } @@ -479,7 +481,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) WM_operator_poll_context(C, but->optype, but->opcontext); poll_msg= CTX_wm_operator_poll_msg_get(C); if(poll_msg) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Disabled: %s", poll_msg); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Disabled: %s")), poll_msg); data->color[data->totline]= 0x6666ff; /* alert */ data->totline++; } @@ -489,7 +491,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { if(but->menu_create_func && WM_menutype_contains((MenuType *)but->poin)) { MenuType *mt= (MenuType *)but->poin; - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", mt->idname); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), mt->idname); data->color[data->totline]= 0x888888; data->totline++; } @@ -608,6 +610,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) return ar; } +#undef TIP_ void ui_tooltip_free(bContext *C, ARegion *ar) { @@ -985,7 +988,7 @@ static void ui_searchbox_region_free_cb(ARegion *ar) ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) { - uiStyle *style= U.uistyles.first; // XXX pass on as arg + uiStyle *style= UI_GetStyle(); static ARegionType type; ARegion *ar; uiSearchboxData *data; @@ -2299,7 +2302,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str) { wmWindow *window= CTX_wm_window(C); - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; @@ -2348,7 +2351,7 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut /* only return handler, and set optional title */ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu"); uiBut *but; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 8d4b4209120..5ea20b33b3a 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -47,6 +47,7 @@ #include "BLF_api.h" +#include "BLF_translation.h" #include "UI_interface.h" @@ -76,7 +77,7 @@ /* ********************************************** */ -static uiStyle *ui_style_new(ListBase *styles, const char *name) +static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id) { uiStyle *style= MEM_callocN(sizeof(uiStyle), "new style"); @@ -85,7 +86,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->panelzoom= 1.0; /* unused */ - style->paneltitle.uifont_id= UIFONT_DEFAULT; + style->paneltitle.uifont_id= uifont_id; style->paneltitle.points= 12; style->paneltitle.kerning= 1; style->paneltitle.shadow= 1; @@ -94,7 +95,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.shadowalpha= 0.15f; style->paneltitle.shadowcolor= 1.0f; - style->grouplabel.uifont_id= UIFONT_DEFAULT; + style->grouplabel.uifont_id= uifont_id; style->grouplabel.points= 12; style->grouplabel.kerning= 1; style->grouplabel.shadow= 3; @@ -102,7 +103,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.shady= -1; style->grouplabel.shadowalpha= 0.25f; - style->widgetlabel.uifont_id= UIFONT_DEFAULT; + style->widgetlabel.uifont_id= uifont_id; style->widgetlabel.points= 11; style->widgetlabel.kerning= 1; style->widgetlabel.shadow= 3; @@ -111,7 +112,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.shadowalpha= 0.15f; style->widgetlabel.shadowcolor= 1.0f; - style->widget.uifont_id= UIFONT_DEFAULT; + style->widget.uifont_id= uifont_id; style->widget.points= 11; style->widget.kerning= 1; style->widget.shadowalpha= 0.25f; @@ -251,11 +252,19 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) } /* ************** helpers ************************ */ +/* XXX: read a style configure */ +uiStyle* UI_GetStyle(void) +{ + uiStyle *style = NULL; + /* offset is two struct uiStyle pointers */ + /* style = BLI_findstring( &U.uistyles, "Unifont Style", sizeof(style)*2 ) */; + return (style != NULL) ? style : U.uistyles.first; +} /* temporarily, does widget font */ int UI_GetStringWidth(const char *str) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiFontStyle *fstyle= &style->widget; int width; @@ -274,7 +283,7 @@ int UI_GetStringWidth(const char *str) /* temporarily, does widget font */ void UI_DrawString(float x, float y, const char *str) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); if (style->widget.kerning == 1) BLF_enable(style->widget.uifont_id, BLF_KERNING_DEFAULT); @@ -313,7 +322,17 @@ void uiStyleInit(void) for(font= U.uifonts.first; font; font= font->next) { if(font->uifont_id==UIFONT_DEFAULT) { +#ifdef INTERNATIONAL + int unifont_size; + unsigned char *unifont_ttf= BLF_get_unifont(&unifont_size); + + if(unifont_ttf) + font->blf_id= BLF_load_mem_unique("default", unifont_ttf, unifont_size); + else + font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); +#else font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); +#endif } else { font->blf_id= BLF_load(font->filename); @@ -337,7 +356,7 @@ void uiStyleInit(void) } if(style==NULL) { - ui_style_new(&U.uistyles, "Default Style"); + ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT ); } // XXX, this should be moved into a style, but for now best only load the monospaced font once. diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index bfe6a2f2602..1b1b788d046 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -68,6 +68,7 @@ #include "interface_intern.h" #include "BLF_api.h" +#include "BLF_translation.h" void UI_template_fix_linking(void) { @@ -306,31 +307,31 @@ static const char *template_id_browse_tip(StructRNA *type) { if(type) { switch(RNA_type_to_ID_code(type)) { - case ID_SCE: return "Browse Scene to be linked"; - case ID_OB: return "Browse Object to be linked"; - case ID_ME: return "Browse Mesh Data to be linked"; - case ID_CU: return "Browse Curve Data to be linked"; - case ID_MB: return "Browse MetaBall Data to be linked"; - case ID_MA: return "Browse Material to be linked"; - case ID_TE: return "Browse Texture to be linked"; - case ID_IM: return "Browse Image to be linked"; - case ID_LT: return "Browse Lattice Data to be linked"; - case ID_LA: return "Browse Lamp Data to be linked"; - case ID_CA: return "Browse Camera Data to be linked"; - case ID_WO: return "Browse World Settings to be linked"; - case ID_SCR: return "Choose Screen lay-out"; - case ID_TXT: return "Browse Text to be linked"; - case ID_SPK: return "Browse Speaker Data to be linked"; - case ID_SO: return "Browse Sound to be linked"; - case ID_AR: return "Browse Armature data to be linked"; - case ID_AC: return "Browse Action to be linked"; - case ID_NT: return "Browse Node Tree to be linked"; - case ID_BR: return "Browse Brush to be linked"; - case ID_PA: return "Browse Particle System to be linked"; - case ID_GD: return "Browse Grease Pencil Data to be linked"; + case ID_SCE: return N_("Browse Scene to be linked"); + case ID_OB: return N_("Browse Object to be linked"); + case ID_ME: return N_("Browse Mesh Data to be linked"); + case ID_CU: return N_("Browse Curve Data to be linked"); + case ID_MB: return N_("Browse MetaBall Data to be linked"); + case ID_MA: return N_("Browse Material to be linked"); + case ID_TE: return N_("Browse Texture to be linked"); + case ID_IM: return N_("Browse Image to be linked"); + case ID_LT: return N_("Browse Lattice Data to be linked"); + case ID_LA: return N_("Browse Lamp Data to be linked"); + case ID_CA: return N_("Browse Camera Data to be linked"); + case ID_WO: return N_("Browse World Settings to be linked"); + case ID_SCR: return N_("Choose Screen lay-out"); + case ID_TXT: return N_("Browse Text to be linked"); + case ID_SPK: return N_("Browse Speaker Data to be linked"); + case ID_SO: return N_("Browse Sound to be linked"); + case ID_AR: return N_("Browse Armature data to be linked"); + case ID_AC: return N_("Browse Action to be linked"); + case ID_NT: return N_("Browse Node Tree to be linked"); + case ID_BR: return N_("Browse Brush to be linked"); + case ID_PA: return N_("Browse Particle System to be linked"); + case ID_GD: return N_("Browse Grease Pencil Data to be linked"); } } - return "Browse ID data to be linked"; + return N_("Browse ID data to be linked"); } static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop) @@ -355,7 +356,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(flag & UI_ID_PREVIEWS) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, template_id_browse_tip(type)); + but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, + UI_translate_do_tooltip(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); if (id) but->icon = ui_id_icon_get(C, id, 1); @@ -367,7 +369,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str uiLayoutRow(layout, 1); } else if(flag & UI_ID_BROWSE) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, template_id_browse_tip(type)); + but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, + UI_translate_do_tooltip(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); /* default dragging of icon for id browse buttons */ @@ -393,12 +396,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(id->lib) { if(id->flag & LIB_INDIRECT) { but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, - "Indirect library datablock, cannot change."); + UI_translate_do_tooltip(N_("Indirect library datablock, cannot change"))); uiButSetFlag(but, UI_BUT_DISABLED); } else { but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, - "Direct linked library datablock, click to make local."); + UI_translate_do_tooltip(N_("Direct linked library datablock, click to make local"))); if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) uiButSetFlag(but, UI_BUT_DISABLED); } @@ -411,7 +414,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str sprintf(str, "%d", id->us); - but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); + but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(_("Displays number of users of this data. Click to make a single-user copy"))); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable) @@ -429,11 +433,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": UI_translate_do_iface(N_("New")), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": _("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } @@ -445,11 +449,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6; if(openop) { - but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } @@ -465,7 +469,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL); } else { - but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data will then not be saved"); + but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(N_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved"))); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); if(RNA_property_flag(template->prop) & PROP_NEVER_NULL) @@ -722,7 +727,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif sprintf(str, "%s parent deform", md->name); uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); - but = uiDefBut(block, BUT, 0, "Make Real", 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier"); + but = uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Make Real")), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, + UI_translate_do_tooltip(N_("Convert virtual modifier to a real modifier"))); uiButSetFunc(but, modifiers_convertToReal, ob, md); } else { @@ -756,7 +762,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) { /* -- convert to rna ? */ - but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode"); + but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, + UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode"))); if (index < cageIndex) uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); @@ -768,7 +775,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { /* add disabled pre-tesselated button, so users could have message for this modifiers */ - but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only"); + but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, + UI_translate_do_tooltip(N_("This modifier could be applied on splines' points only"))); uiButSetFlag(but, UI_BUT_DISABLED); } else if (mti->type != eModifierTypeType_Constructive) { /* constructive modifiers tesselates curve before applying */ @@ -818,17 +826,17 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif } else { uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); - uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply", 0, "apply_as", MODIFIER_APPLY_DATA); + uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply")), 0, "apply_as", MODIFIER_APPLY_DATA); if (modifier_sameTopology(md)) - uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply as Shape", 0, "apply_as", MODIFIER_APPLY_SHAPE); + uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply as Shape")), 0, "apply_as", MODIFIER_APPLY_SHAPE); } uiBlockClearButLock(block); uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE); if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth, eModifierType_Smoke)) - uiItemO(row, "Copy", ICON_NONE, "OBJECT_OT_modifier_copy"); + uiItemO(row, UI_translate_do_tooltip(N_("Copy")), ICON_NONE, "OBJECT_OT_modifier_copy"); } /* result is the layout block inside the box, that we return so that modifier settings can be drawn */ @@ -855,7 +863,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) /* verify we have valid data */ if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) { - RNA_warning("Expected modifier on object."); + RNA_warning("Expected modifier on object"); return NULL; } @@ -863,7 +871,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) md= ptr->data; if(!ob || !(GS(ob->id.name) == ID_OB)) { - RNA_warning("expected modifier on object."); + RNA_warning("Expected modifier on object"); return NULL; } @@ -1005,8 +1013,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiBlockSetEmboss(block, UI_EMBOSSN); /* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */ - uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected"); - uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected"); + uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected"))); + uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected"))); uiBlockSetEmboss(block, UI_EMBOSS); } @@ -1084,7 +1092,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) /* verify we have valid data */ if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) { - RNA_warning("Expected constraint on object."); + RNA_warning("Expected constraint on object"); return NULL; } @@ -1092,7 +1100,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) con= ptr->data; if(!ob || !(GS(ob->id.name) == ID_OB)) { - RNA_warning("Expected constraint on object."); + RNA_warning("Expected constraint on object"); return NULL; } @@ -1138,7 +1146,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M PointerRNA texture_ptr; if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) { - RNA_warning("expected ID of type material, texture, lamp or world."); + RNA_warning("Expected ID of type material, texture, lamp or world"); return; } @@ -1192,14 +1200,14 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr); uiLayoutRow(layout, 1); - uiDefButS(block, ROW, B_MATPRV, "Texture", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Texture")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, ""); if(GS(parent->name) == ID_MA) - uiDefButS(block, ROW, B_MATPRV, "Material", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Material")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); else if(GS(parent->name) == ID_LA) - uiDefButS(block, ROW, B_MATPRV, "Lamp", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Lamp")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); else if(GS(parent->name) == ID_WO) - uiDefButS(block, ROW, B_MATPRV, "World", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); - uiDefButS(block, ROW, B_MATPRV, "Both", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("World")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Both")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); /* Alpha buton for texture preview */ if(*pr_texture!=TEX_PR_OTHER) { @@ -1290,21 +1298,23 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand if(coba==NULL) return; - bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband"); + bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(N_("Add a new color stop to the colorband"))); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position"); + bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(N_("Delete the active position"))); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); /* XXX, todo for later - convert to operator - campbell */ - bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip colorband"); + bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip colorband"))); uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); - uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop"); + uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, UI_translate_do_tooltip(N_("Choose active color stop"))); - bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4", - 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops"); + bt= uiDefButS(block, MENU, 0, UI_translate_do_iface(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")), + 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, UI_translate_do_tooltip(N_("Set interpolation between color stops"))); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); uiBlockEndAlign(block); @@ -1333,11 +1343,13 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand float xs= butr->xmin; uiBlockBeginAlign(block); - bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband"); + bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(N_("Add a new color stop to the colorband"))); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position"); + bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, + UI_translate_do_tooltip(N_("Delete the active position"))); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip the color ramp"); + bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip the color ramp"))); uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); uiBlockEndAlign(block); @@ -1348,8 +1360,9 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand uiItemR(layout, &ptr, "color", 0, "", ICON_NONE); } - bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4", - xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops"); + bt= uiDefButS(block, MENU, 0, UI_translate_do_tooltip(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")), + xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, + UI_translate_do_tooltip(N_("Set interpolation between color stops"))); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, ""); @@ -1600,10 +1613,10 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL); uiBlockBeginAlign(block); - uiDefButF(block, NUM, 0, "Min X ", 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, ""); - uiDefButF(block, NUM, 0, "Min Y ", 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, ""); - uiDefButF(block, NUM, 0, "Max X ", 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "Max Y ", 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, ""); + uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min X ")), 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, ""); + uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min Y ")), 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, ""); + uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max X ")), 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, ""); + uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max Y ")), 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, ""); uiBlockSetDirection(block, UI_RIGHT); @@ -1652,12 +1665,12 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Horizontal")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Extrapolated")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1674,10 +1687,10 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1794,24 +1807,24 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe uiBlockSetEmboss(block, UI_EMBOSSN); - bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in"); + bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom in"))); uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL); - bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out"); + bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom out"))); uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL); if(brush) - bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools"); + bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools"))); else - bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools"); + bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools"))); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT; - bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, "Clipping Options"); + bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Clipping Options"))); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); - bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points"); + bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Delete points"))); uiButSetNFunc(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap); uiBlockSetEmboss(block, UI_EMBOSS); @@ -1830,7 +1843,8 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutRow(layout, 0); - bt=uiDefBut(block, BUT, 0, "Reset", 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves"); + bt=uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Reset")), 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + UI_translate_do_tooltip(N_("Reset Black/White point and curves"))); uiButSetNFunc(bt, curvemap_buttons_reset, MEM_dupallocN(cb), cumap); } @@ -2124,6 +2138,18 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF); uiBlockSetEmboss(block, UI_EMBOSS); } + else if(itemptr->type == &RNA_VertexGroup) { + bDeformGroup *dg= (bDeformGroup *)itemptr->data; + uiItemL(sub, name, icon); + /* RNA does not allow nice lock icons, use lower level buttons */ +#if 0 + uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "lock_weight", 0, 0, 0, 0, 0, NULL); +#else + uiBlockSetEmboss(block, UI_EMBOSSN); + uiDefIconButBitC(block, TOG, DG_LOCK_WEIGHT, 0, (dg->flag & DG_LOCK_WEIGHT) ? ICON_LOCKED : ICON_UNLOCKED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &dg->flag, 0, 0, 0, 0, "Maintain relative weights while painting"); + uiBlockSetEmboss(block, UI_EMBOSS); +#endif + } else if(itemptr->type == &RNA_KeyingSetPath) { KS_Path *ksp = (KS_Path*)itemptr->data; @@ -2159,7 +2185,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * pa= block->panel; if(!pa) { - RNA_warning("only works inside a panel."); + RNA_warning("Only works inside a panel"); return; } @@ -2169,28 +2195,28 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * if(ptr->data) { prop= RNA_struct_find_property(ptr, propname); if(!prop) { - RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); + RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); return; } } activeprop= RNA_struct_find_property(activeptr, activepropname); if(!activeprop) { - RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), activepropname); + RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), activepropname); return; } if(prop) { type= RNA_property_type(prop); if(type != PROP_COLLECTION) { - RNA_warning("uiExpected collection property."); + RNA_warning("uiExpected collection property"); return; } } activetype= RNA_property_type(activeprop); if(activetype != PROP_INT) { - RNA_warning("expected integer property."); + RNA_warning("Expected integer property"); return; } @@ -2437,16 +2463,18 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) (void)ui_abs; // UNUSED uiDefIconBut(block, BUT, handle_event, ICON_PANEL_CLOSE, - 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, "Stop this job"); + 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, UI_translate_do_tooltip(N_("Stop this job"))); uiDefBut(block, PROGRESSBAR, 0, WM_jobs_name(wm, owner), - UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, "Progress"); + UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, UI_translate_do_tooltip(N_("Progress"))); uiLayoutRow(layout, 0); } if(WM_jobs_test(wm, screen)) - uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, "Capture", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast"); + uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, UI_translate_do_iface(N_("Capture")), 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + UI_translate_do_tooltip(N_("Stop screencast"))); if(screen->animtimer) - uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, "Anim Player", 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback"); + uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, UI_translate_do_tooltip(N_("Anim Player")), 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + UI_translate_do_tooltip(N_("Stop animation playback"))); } /************************* Reports for Last Operator Template **************************/ @@ -2508,7 +2536,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiBlockSetEmboss(block, UI_EMBOSSN); if (reports->list.first != reports->list.last) - uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, "Click to see rest of reports in textblock: 'Recent Reports'"); + uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, UI_translate_do_tooltip(N_("Click to see rest of reports in textblock: 'Recent Reports'"))); else uiDefIconBut(block, LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index a3f56192cb5..a49060eaca2 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -37,6 +37,8 @@ #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" @@ -114,7 +116,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind } case PROP_COLLECTION: { char text[256]; - sprintf(text, "%d items", RNA_property_collection_length(ptr, prop)); + sprintf(text, UI_translate_do_iface(N_("%d items")), RNA_property_collection_length(ptr, prop)); but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); break; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 43bf2f59e04..18db1c8c894 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -168,7 +168,7 @@ static void view2d_masks(View2D *v2d) void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) { short tot_changed= 0, init= 0; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); /* initialise data if there is a need for such */ if ((v2d->flag & V2D_IS_INITIALISED) == 0) { @@ -420,8 +420,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* check if we should restore aspect ratio (if view size changed) */ if (v2d->keepzoom & V2D_KEEPASPECT) { - short do_x=0, do_y=0, do_cur, do_win; - float curRatio, winRatio; + short do_x=0, do_y=0, do_cur /* , do_win */ /* UNUSED */; + float /* curRatio, */ /* UNUSED */ winRatio; /* when a window edge changes, the aspect ratio can't be used to * find which is the best new 'cur' rect. thats why it stores 'old' @@ -429,7 +429,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) if (winx != v2d->oldwinx) do_x= 1; if (winy != v2d->oldwiny) do_y= 1; - curRatio= height / width; + /* curRatio= height / width; */ /* UNUSED */ winRatio= winy / winx; /* both sizes change (area/region maximised) */ @@ -443,7 +443,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) else do_x= 1; } do_cur= do_x; - do_win= do_y; + /* do_win= do_y; */ /* UNUSED */ if (do_cur) { if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) { diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 434334258af..0aaf6fe3bc6 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -51,6 +51,7 @@ #include "ED_screen.h" #include "UI_view2d.h" +#include "UI_interface.h" #include "PIL_time.h" /* USER_ZOOM_CONT */ @@ -444,7 +445,7 @@ static void VIEW2D_OT_scroll_down(wmOperatorType *ot) /* rna - must keep these in sync with the other operators */ RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX); - RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll down one page."); + RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll down one page"); } @@ -494,7 +495,7 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot) /* rna - must keep these in sync with the other operators */ RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX); - RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll up one page."); + RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll up one page"); } /* ********************************************************* */ @@ -1587,7 +1588,7 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot) static int reset_exec(bContext *C, wmOperator *UNUSED(op)) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; int winx, winy; diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 9bf863faae3..6a263fca915 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1335,7 +1335,7 @@ static int mesh_separate_selected(wmOperator *op, Main *bmain, Scene *scene, Bas me= obedit->data; em= BKE_mesh_get_editmesh(me); if(me->key) { - BKE_report(op->reports, RPT_WARNING, "Can't separate mesh with shape keys."); + BKE_report(op->reports, RPT_WARNING, "Can't separate mesh with shape keys"); BKE_mesh_end_editmesh(me, em); return 0; } @@ -1958,3 +1958,101 @@ void em_setup_viewcontext(bContext *C, ViewContext *vc) vc->em= me->edit_mesh; } } + + +/* (similar to void paintface_flush_flags(Object *ob)) + * copy the vertex flags, most importantly selection from the mesh to the final derived mesh, + * use in object mode when selecting vertices (while painting) */ +void paintvert_flush_flags(Object *ob) +{ + Mesh *me= get_mesh(ob); + DerivedMesh *dm= ob->derivedFinal; + MVert *dm_mvert, *dm_mv; + int *index_array = NULL; + int totvert; + int i; + + if(me==NULL || dm==NULL) + return; + + index_array = dm->getVertDataArray(dm, CD_ORIGINDEX); + + dm_mvert = dm->getVertArray(dm); + totvert = dm->getNumVerts(dm); + + dm_mv= dm_mvert; + + if(index_array) { + int orig_index; + for (i= 0; i<totvert; i++, dm_mv++) { + orig_index= index_array[i]; + if(orig_index != ORIGINDEX_NONE) { + dm_mv->flag= me->mvert[index_array[i]].flag; + } + } + } + else { + for (i= 0; i<totvert; i++, dm_mv++) { + dm_mv->flag= me->mvert[i].flag; + } + } +} +/* note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */ +void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags) +{ + Mesh *me; + MVert *mvert; + int a; + + me= get_mesh(ob); + if(me==NULL) return; + + if(action == SEL_INVERT) { + mvert= me->mvert; + a= me->totvert; + while(a--) { + if((mvert->flag & ME_HIDE) == 0) { + mvert->flag ^= SELECT; + } + mvert++; + } + } + else { + if (action == SEL_TOGGLE) { + action = SEL_SELECT; + + mvert= me->mvert; + a= me->totvert; + while(a--) { + if((mvert->flag & ME_HIDE) == 0 && mvert->flag & SELECT) { + action = SEL_DESELECT; + break; + } + mvert++; + } + } + + mvert= me->mvert; + a= me->totvert; + while(a--) { + if((mvert->flag & ME_HIDE) == 0) { + switch (action) { + case SEL_SELECT: + mvert->flag |= SELECT; + break; + case SEL_DESELECT: + mvert->flag &= ~SELECT; + break; + case SEL_INVERT: + mvert->flag ^= SELECT; + break; + } + } + mvert++; + } + } + + if(flush_flags) { + paintvert_flush_flags(ob); + } +} diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 7af4ebee3bc..8c035ca46fd 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -266,6 +266,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, sho /* method in use for face selecting too */ if(vc->obedit==NULL) { if(paint_facesel_test(vc->obact)); + else if(paint_vertsel_test(vc->obact)); else return 0; } else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0; @@ -328,6 +329,7 @@ int EM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads) /* method in use for face selecting too */ if(vc->obedit==NULL) { if(paint_facesel_test(vc->obact)); + else if (paint_vertsel_test(vc->obact)); else return 0; } else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0; @@ -1463,7 +1465,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 2: /* copy image */ if (!tf_act) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1471,10 +1473,8 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if (tf_act->tpage) { tf->tpage = tf_act->tpage; - tf->mode |= TF_TEX; } else { tf->tpage = NULL; - tf->mode &= ~TF_TEX; } tf->tile= tf_act->tile; change = 1; @@ -1484,7 +1484,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) case 3: /* copy UV's */ if (!tf_act) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1497,7 +1497,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 4: /* mode's */ if (!tf_act) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1510,7 +1510,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 5: /* copy transp's */ if (!tf_act) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1524,7 +1524,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) case 6: /* copy vcols's */ if (!mcol_act) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers"); return; } else { /* guess the 4th color if needs be */ @@ -1654,10 +1654,8 @@ void EM_mesh_copy_face_layer(EditMesh *em, wmOperator *op, short type) tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if (tf_from->tpage) { tf->tpage = tf_from->tpage; - tf->mode |= TF_TEX; } else { tf->tpage = NULL; - tf->mode &= ~TF_TEX; } tf->tile= tf_from->tile; change = 1; @@ -2807,7 +2805,7 @@ void MESH_OT_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } void EM_reveal_mesh(EditMesh *em) @@ -2932,7 +2930,7 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - ot->prop= RNA_def_enum(ot->srna, "type", type_items, 3, "Type", "Type of elements to select."); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, 3, "Type", "Type of elements to select"); } @@ -3714,8 +3712,8 @@ void MESH_OT_select_random(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly.", 0.f, 100.0f); - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first."); + RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first"); } void EM_select_by_material(EditMesh *em, int index) @@ -4283,9 +4281,9 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX); - RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis."); - RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis."); - RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis."); + RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis"); + RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis"); + RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis"); } static int mesh_noise_exec(bContext *C, wmOperator *op) @@ -4301,7 +4299,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op) ma= give_current_material(obedit, obedit->actcol); if(ma==0 || ma->mtex[0]==0 || ma->mtex[0]->tex==0) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned"); return OPERATOR_FINISHED; } tex= give_current_material_texture(ma); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 2dc82ae89fb..c8e3075ac60 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -494,7 +494,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); } - BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices"); + BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices"); BKE_mesh_end_editmesh(obedit->data, em); @@ -3887,7 +3887,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate the edge around."); + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate the edge around"); } @@ -5313,10 +5313,10 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending."); + prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending"); RNA_def_enum_funcs(prop, shape_itemf); - RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f); - RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather than blend between shapes."); + RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor", -2.0f, 2.0f); + RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather than blend between shapes"); } /************************ Merge Operator *************************/ @@ -5957,7 +5957,7 @@ static int merge_exec(bContext *C, wmOperator *op) recalc_editnormals(em); - BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices"); + BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices"); BKE_mesh_end_editmesh(obedit->data, em); @@ -6029,10 +6029,10 @@ void MESH_OT_merge(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use."); + prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use"); RNA_def_enum_funcs(prop, merge_type_itemf); ot->prop= prop; - RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge."); + RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge"); } /************************ Vertex Path Operator *************************/ @@ -6236,7 +6236,7 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance."); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance"); } /********************** Region/Loop Operators *************************/ @@ -6491,7 +6491,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) int dir= RNA_enum_get(op->ptr, "direction"); if (!EM_texFaceCheck(em)) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -6565,7 +6565,7 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) int axis= RNA_enum_get(op->ptr, "axis"); if (!EM_texFaceCheck(em)) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -6653,7 +6653,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) int dir= RNA_enum_get(op->ptr, "direction"); if (!EM_vertColorCheck(em)) { - BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers."); + BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -6769,7 +6769,7 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around."); + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around"); } void MESH_OT_uvs_mirror(wmOperatorType *ot) @@ -6787,7 +6787,7 @@ void MESH_OT_uvs_mirror(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror UVs around."); + RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror UVs around"); } void MESH_OT_colors_rotate(wmOperatorType *ot) @@ -6805,7 +6805,7 @@ void MESH_OT_colors_rotate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around."); + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around"); } void MESH_OT_colors_mirror(wmOperatorType *ot) @@ -6823,7 +6823,7 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror colors around."); + RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror colors around"); } /********************** Subdivide Operator *************************/ @@ -6868,8 +6868,8 @@ void MESH_OT_subdivide(wmOperatorType *ot) /* properties */ RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10); - RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor.", 0.0f, 1.0f); - RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f); + RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor", 0.0f, 1.0f); + RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor", 0.0f, 1000.0f); RNA_def_enum(ot->srna, "corner_cut_pattern", corner_type_items, SUBDIV_CORNER_INNERVERT, "Corner Cut Pattern", "Topology pattern to use to fill a face after cutting across its corner"); } @@ -7343,7 +7343,7 @@ void MESH_OT_sort_faces(wmOperatorType *ot) /* identifiers */ ot->name= "Sort Faces"; // XXX (Ctrl to reverse)%t| - ot->description= "The faces of the active Mesh Object are sorted, based on the current view."; + ot->description= "The faces of the active Mesh Object are sorted, based on the current view"; ot->idname= "MESH_OT_sort_faces"; /* api callbacks */ diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index c4a302d4d18..ef52d9be0c3 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -238,7 +238,6 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me) int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *me, const char *name, int active_set) { EditMesh *em; - MCol *mcol; int layernum; if(me->edit_mesh) { @@ -261,8 +260,6 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes if(layernum >= MAX_MCOL) return 0; - mcol= me->mcol; - if(me->mcol) CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface, name); else @@ -364,7 +361,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) } if(!ima) { - BKE_report(op->reports, RPT_ERROR, "Not an Image."); + BKE_report(op->reports, RPT_ERROR, "Not an Image"); return OPERATOR_CANCELLED; } @@ -413,7 +410,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign."); + RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign"); RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); } @@ -683,7 +680,7 @@ static void mesh_add_faces(Mesh *mesh, int len) void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces) { if(mesh->edit_mesh) { - BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode."); + BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode"); return; } @@ -699,7 +696,7 @@ void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count) { if(mesh->edit_mesh) { - BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode."); + BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode"); return; } @@ -709,7 +706,7 @@ void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count) { if(mesh->edit_mesh) { - BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode."); + BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode"); return; } @@ -719,7 +716,7 @@ void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count) { if(mesh->edit_mesh) { - BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode."); + BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode"); return; } diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 763e82b8b53..526bf177ab7 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -217,7 +217,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) if(me->totvert) { /* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */ - if(totcol < MAXMAT-1) { + if(totcol < MAXMAT) { for(a=1; a<=base->object->totcol; a++) { ma= give_current_material(base->object, a); @@ -231,7 +231,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) } totcol++; } - if(totcol>=MAXMAT-1) + if(totcol >= MAXMAT) break; } } @@ -574,9 +574,9 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op) if (!ok) { if (nonequal_verts) - BKE_report(op->reports, RPT_WARNING, "Selected meshes must have equal numbers of vertices."); + BKE_report(op->reports, RPT_WARNING, "Selected meshes must have equal numbers of vertices"); else - BKE_report(op->reports, RPT_WARNING, "No additional selected meshes with equal vertex count to join."); + BKE_report(op->reports, RPT_WARNING, "No additional selected meshes with equal vertex count to join"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index b007e30422d..a58d74d250c 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -268,7 +268,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of metaelems to select randomly.", 0.0001f, 1.0f); + RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of metaelems to select randomly", 0.0001f, 1.0f); } /***************************** Duplicate operator *****************************/ @@ -412,7 +412,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } /***************************** Unhide operator *****************************/ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 66db7db5171..6c553289052 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -764,7 +764,7 @@ static int childof_clear_inverse_exec (bContext *C, wmOperator *op) bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : NULL; if(data==NULL) { - BKE_report(op->reports, RPT_ERROR, "Childof constraint not found."); + BKE_report(op->reports, RPT_ERROR, "Childof constraint not found"); return OPERATOR_CANCELLED; } @@ -1095,7 +1095,7 @@ void POSE_OT_constraints_copy(wmOperatorType *ot) /* identifiers */ ot->name= "Copy Constraints to Selected"; ot->idname= "POSE_OT_constraints_copy"; - ot->description = "Copy constraints to other selected bones."; + ot->description = "Copy constraints to other selected bones"; /* api callbacks */ ot->exec= pose_constraint_copy_exec; @@ -1136,7 +1136,7 @@ void OBJECT_OT_constraints_copy(wmOperatorType *ot) /* identifiers */ ot->name= "Copy Constraints to Selected"; ot->idname= "OBJECT_OT_constraints_copy"; - ot->description = "Copy constraints to other selected objects."; + ot->description = "Copy constraints to other selected objects"; /* api callbacks */ ot->exec= object_constraint_copy_exec; @@ -1302,7 +1302,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase /* ensure not to confuse object/pose adding */ if (pchan == NULL) { - BKE_report(op->reports, RPT_ERROR, "No active pose bone to add a constraint to."); + BKE_report(op->reports, RPT_ERROR, "No active pose bone to add a constraint to"); return OPERATOR_CANCELLED; } } @@ -1311,15 +1311,15 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase return OPERATOR_CANCELLED; } if ( (type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints) ) { - BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects."); + BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects"); return OPERATOR_CANCELLED; } if ( (type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints)) ) { - BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones."); + BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones"); return OPERATOR_CANCELLED; } if ( (type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints)) ) { - BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones."); + BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones"); return OPERATOR_CANCELLED; } @@ -1407,7 +1407,7 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op) short with_targets= 0; if (!ob) { - BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to."); + BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to"); return OPERATOR_CANCELLED; } @@ -1428,7 +1428,7 @@ static int pose_constraint_add_exec(bContext *C, wmOperator *op) short with_targets= 0; if (!ob) { - BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to."); + BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to"); return OPERATOR_CANCELLED; } @@ -1537,7 +1537,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) /* must have active bone */ if (ELEM(NULL, ob, pchan)) { - BKE_report(op->reports, RPT_ERROR, "Must have active bone to add IK Constraint to."); + BKE_report(op->reports, RPT_ERROR, "Must have active bone to add IK Constraint to"); return OPERATOR_CANCELLED; } @@ -1546,7 +1546,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) if (con->type==CONSTRAINT_TYPE_KINEMATIC) break; } if (con) { - BKE_report(op->reports, RPT_ERROR, "Bone already has IK Constraint."); + BKE_report(op->reports, RPT_ERROR, "Bone already has IK Constraint"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 79cbfb6574b..ec1405f74b8 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -222,7 +222,7 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); } @@ -297,7 +297,7 @@ void OBJECT_OT_hide_render_set(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); } /* ******************* toggle editmode operator ***************** */ @@ -2177,7 +2177,7 @@ void OBJECT_OT_logic_bricks_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy Logic Bricks to Selected"; - ot->description = "Copy logic bricks to other selected objects."; + ot->description = "Copy logic bricks to other selected objects"; ot->idname= "OBJECT_OT_logic_bricks_copy"; /* api callbacks */ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index fd4581af194..ce01bef34f6 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -292,7 +292,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo return totvert; } -static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r) +static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r) { *indexar= NULL; *tot= 0; @@ -302,7 +302,12 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char case OB_MESH: { Mesh *me= obedit->data; - EditMesh *em = BKE_mesh_get_editmesh(me); + EditMesh *em; + + load_editMesh(scene, obedit); + make_editMesh(scene, obedit); + + em = BKE_mesh_get_editmesh(me); /* check selected vertices first */ if( return_editmesh_indexar(em, tot, indexar, cent_r)) { @@ -427,7 +432,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o int tot, ok, *indexar; char name[32]; - ok = object_hook_index_array(obedit, &tot, &indexar, name, cent); + ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent); if (!ok) return; // XXX error("Requires selected vertices or active Vertex Group"); @@ -485,7 +490,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op) CTX_DATA_END; if (!obsel) { - BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects."); + BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects"); return OPERATOR_CANCELLED; } @@ -608,7 +613,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); ot->prop= prop; } @@ -675,7 +680,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -731,7 +736,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -760,7 +765,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op) /* assign functionality */ - if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) { + if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) { BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group"); return OPERATOR_CANCELLED; } @@ -794,7 +799,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -843,7 +848,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); } diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 3da0723ec18..434111c1227 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -200,6 +200,8 @@ void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_normalize_all(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_fix(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_invert(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_blend(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_clean(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 17f174a5069..ebbc4137628 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -97,7 +97,7 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc if(mti->flags&eModifierTypeFlag_Single) { if(modifiers_findByType(ob, type)) { - BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed."); + BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed"); return NULL; } } @@ -169,7 +169,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob break; if(!obmd) { - BKE_reportf(reports, RPT_ERROR, "Modifier '%s' not in object '%s'.", ob->id.name, md->name); + BKE_reportf(reports, RPT_ERROR, "Modifier '%s' not in object '%s'", ob->id.name, md->name); return 0; } @@ -255,7 +255,7 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type); if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) { - BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data."); + BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data"); return 0; } } @@ -276,7 +276,7 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData * ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type); if(nmti->type!=eModifierTypeType_OnlyDeform) { - BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier."); + BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier"); return 0; } } @@ -552,7 +552,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi } if (md!=ob->modifiers.first) - BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected."); + BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected"); /* allow apply of a not-realtime modifier, by first re-enabling realtime. */ prev_mode= md->mode; @@ -1068,7 +1068,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(mmd->lvl==0) { - BKE_report(op->reports, RPT_ERROR, "Reshape can work only with higher levels of subdivisions."); + BKE_report(op->reports, RPT_ERROR, "Reshape can work only with higher levels of subdivisions"); return OPERATOR_CANCELLED; } @@ -1081,12 +1081,12 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) CTX_DATA_END; if(!secondob) { - BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from."); + BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from"); return OPERATOR_CANCELLED; } if(!multiresModifier_reshape(scene, mmd, ob, secondob)) { - BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices."); + BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 5eb17268d19..452d1aded51 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -174,6 +174,8 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_vertex_group_copy); WM_operatortype_append(OBJECT_OT_vertex_group_normalize); WM_operatortype_append(OBJECT_OT_vertex_group_normalize_all); + WM_operatortype_append(OBJECT_OT_vertex_group_lock); + WM_operatortype_append(OBJECT_OT_vertex_group_fix); WM_operatortype_append(OBJECT_OT_vertex_group_invert); WM_operatortype_append(OBJECT_OT_vertex_group_levels); WM_operatortype_append(OBJECT_OT_vertex_group_blend); @@ -245,7 +247,7 @@ void ED_operatormacros_object(void) /* XXX */ ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { - RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add."); + RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add"); WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d"); WM_operatortype_macro_define(ot, "OBJECT_OT_add_named"); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 4d7f6fa9e7a..ec5aa19d3c0 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -95,6 +95,7 @@ #include "ED_object.h" #include "ED_screen.h" #include "ED_view3d.h" +#include "ED_mesh.h" #include "object_intern.h" @@ -122,7 +123,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) if(obedit->type==OB_MESH) { Mesh *me= obedit->data; - EditMesh *em = BKE_mesh_get_editmesh(me); + EditMesh *em; + + load_editMesh(scene, obedit); + make_editMesh(scene, obedit); + + em = BKE_mesh_get_editmesh(me); eve= em->verts.first; while(eve) { @@ -404,7 +410,7 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "object", "", MAX_ID_NAME-2, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for."); + RNA_def_string(ot->srna, "object", "", MAX_ID_NAME-2, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for"); prop= RNA_def_enum(ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Type", "Group object"); /* XXX, relies on hard coded ID at the moment */ RNA_def_enum_funcs(prop, proxy_group_object_itemf); ot->prop= prop; @@ -1921,5 +1927,5 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign."); + RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign"); } diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 8fdd7a53e91..a4c45e033b3 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -179,7 +179,7 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); ot->prop= RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", ""); } @@ -361,7 +361,7 @@ void OBJECT_OT_select_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); ot->prop= RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", ""); } @@ -687,7 +687,7 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); } @@ -736,7 +736,7 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first"); RNA_def_int(ot->srna, "layers", 1, 1, 20, "Layer", "", 1, 20); } @@ -883,7 +883,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select."); + RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select"); } /**************************** Select Mirror ****************************/ @@ -936,7 +936,7 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); } @@ -993,8 +993,8 @@ void OBJECT_OT_select_name(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "name", "", 0, "Name", "Object name to select."); - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_string(ot->srna, "name", "", 0, "Name", "Object name to select"); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); } /**************************** Select Random ****************************/ @@ -1043,7 +1043,7 @@ void OBJECT_OT_select_random(wmOperatorType *ot) /* properties */ RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of objects to select randomly", 0.f, 100.0f); - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first"); } diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index fd2e7fd7c99..962aac06474 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -309,7 +309,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys."); + RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys"); } static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op)) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 78f3537bea9..4c29490b0f0 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -399,13 +399,13 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo if(ob->type==OB_MESH) { if(ID_REAL_USERS(ob->data) > 1) { - BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing."); + BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing"); return OPERATOR_CANCELLED; } } else if(ob->type==OB_ARMATURE) { if(ID_REAL_USERS(ob->data) > 1) { - BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing."); + BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing"); return OPERATOR_CANCELLED; } } @@ -413,18 +413,18 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo Curve *cu; if(ID_REAL_USERS(ob->data) > 1) { - BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing."); + BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing"); return OPERATOR_CANCELLED; } cu= ob->data; if(!(cu->flag & CU_3D) && (apply_rot || apply_loc)) { - BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing."); + BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing"); return OPERATOR_CANCELLED; } if(cu->key) { - BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing."); + BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing"); return OPERATOR_CANCELLED; } } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 52ba9460818..797cf428969 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -49,6 +49,7 @@ #include "DNA_scene_types.h" #include "DNA_particle_types.h" +#include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_editVert.h" #include "BLI_utildefines.h" @@ -60,6 +61,7 @@ #include "BKE_global.h" #include "BKE_mesh.h" #include "BKE_report.h" +#include "BKE_DerivedMesh.h" #include "RNA_access.h" #include "RNA_define.h" @@ -701,6 +703,10 @@ static void vgroup_normalize(Object *ob) MDeformWeight *dw; MDeformVert *dvert, **dvert_array=NULL; int i, def_nr, dvert_tot=0; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); @@ -712,6 +718,11 @@ static void vgroup_normalize(Object *ob) def_nr= ob->actdef-1; for(i = 0; i < dvert_tot; i++) { + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } + dvert = dvert_array[i]; dw = defvert_find_index(dvert, def_nr); if(dw) { @@ -721,6 +732,11 @@ static void vgroup_normalize(Object *ob) if(weight_max > 0.0f) { for(i = 0; i < dvert_tot; i++) { + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } + dvert = dvert_array[i]; dw = defvert_find_index(dvert, def_nr); if(dw) { @@ -736,6 +752,401 @@ static void vgroup_normalize(Object *ob) if (dvert_array) MEM_freeN(dvert_array); } +/* This adds the indices of vertices to a list if they are not already present +It returns the number that it added (0-2) +It relies on verts having -1 for unassigned indices +*/ +static int tryToAddVerts(int *verts, int length, int a, int b) { + char containsA = FALSE; + char containsB = FALSE; + int added = 0; + int i; + for(i = 0; i < length && (!containsA || !containsB); i++) { + if(verts[i] == a) { + containsA = TRUE; + } else if(verts[i] == b) { + containsB = TRUE; + } else if(verts[i] == -1) { + if(!containsA) { + verts[i] = a; + containsA = TRUE; + added++; + } else if(!containsB){ + verts[i] = b; + containsB = TRUE; + added++; + } + } + } + return added; +} + +/* This finds all of the vertices connected to vert by an edge +and returns an array of indices of size count + +count is an int passed by reference so it can be assigned the value of the length here. +*/ +static int* getSurroundingVerts(Mesh *me, int vert, int *count) { + int length = 0; + int *tverts; + int *verts = NULL; + MFace *mf = me->mface; + int totface = me->totface; + int found = 0; + int i; + for(i = 0; i < totface; i++, mf++) { + if(vert == mf->v1 || vert == mf->v2 || vert == mf->v3 || (mf->v4 &&vert == mf->v4)) { + length+=2; + } + } + if(!length) { + return 0; + } + tverts = MEM_mallocN(sizeof(int)*length, "tempSurroundingVerts"); + mf = me->mface; + for(i = 0; i < length; i++) { + tverts[i] = -1; + } + for(i = 0; i < totface; i++, mf++) { + int a=-1, b=-1; + if(mf->v1 == vert) { + a = mf->v2; + if(mf->v4) { + b = mf->v4; + } else { + b = mf->v3; + } + } else if(mf->v2 == vert) { + a = mf->v1; + b = mf->v3; + } else if(mf->v3 == vert) { + a = mf->v2; + if(mf->v4) { + b = mf->v4; + } else { + b = mf->v1; + } + } else if (mf->v4 && mf->v4 == vert){ + a = mf->v1; + b = mf->v3; + } else { + continue; + } + found += tryToAddVerts(tverts, length, a, b); + } + if(found) { + verts = MEM_mallocN(sizeof(int)* found, "surroundingVerts"); + for(i = 0; i < found; i++) { + verts[i] = tverts[i]; + } + *count = found; + } + MEM_freeN(tverts); + return verts; +} + +/* get a single point in space by averaging a point cloud (vectors of size 3) +coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud +*/ +static void getSingleCoordinate(MVert *points, int count, float coord[3]) { + int i; + zero_v3(coord); + for(i = 0; i < count; i++) { + add_v3_v3(coord, points[i].co); + } + mul_v3_fl(coord, 1.0f/count); +} + +/* find the closest point on a plane to another point and store it in dst */ +/* coord is a point on the plane */ +/* point is the point that you want the nearest of */ +/* norm is the plane's normal, and d is the last number in the plane equation 0 = ax + by + cz + d */ +static void getNearestPointOnPlane(const float norm[3], const float coord[3], const float point[3], float dst_r[3]) +{ + float temp[3]; + float dotprod; + + sub_v3_v3v3(temp, point, coord); + dotprod= dot_v3v3(temp, norm); + + dst_r[0] = point[0] - (norm[0] * dotprod); + dst_r[1] = point[1] - (norm[1] * dotprod); + dst_r[2] = point[2] - (norm[2] * dotprod); +} + +/* distance of two vectors a and b of size length */ +static float distance(float* a, float *b, int length) { + int i; + float sum = 0; + for(i = 0; i < length; i++) { + sum += (b[i]-a[i])*(b[i]-a[i]); + } + return sqrt(sum); +} + +/* given a plane and a start and end position, +compute the amount of vertical distance relative to the plane and store it in dists, +then get the horizontal and vertical change and store them in changes +*/ +static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, float *end, float (*changes)[2], float *dists, int index) { + // A=Q-((Q-P).N)N + // D = (a*x0 + b*y0 +c*z0 +d) + float projA[3] = {0}, projB[3] = {0}; + + getNearestPointOnPlane(norm, coord, start, projA); + getNearestPointOnPlane(norm, coord, end, projB); + // (vertical and horizontal refer to the plane's y and xz respectively) + // vertical distance + dists[index] = norm[0]*end[0] + norm[1]*end[1] + norm[2]*end[2] + d; + // vertical change + changes[index][0] = dists[index] - distToStart; + //printf("vc %f %f\n", distance(end, projB, 3)-distance(start, projA, 3), changes[index][0]); + // horizontal change + changes[index][1] = distance(projA, projB, 3); +} + +// I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc) +static void dm_deform_clear(DerivedMesh *dm, Object *ob) { + if(ob->derivedDeform && (ob->derivedDeform)==dm) { + ob->derivedDeform->needsFree = 1; + ob->derivedDeform->release(ob->derivedDeform); + ob->derivedDeform = NULL; + } + else if(dm) { + dm->needsFree = 1; + dm->release(dm); + } +} + +// recalculate the deformation +static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob) { + return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); +} + +/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to distToBe distance away from the provided plane +strength can change distToBe so that it moves towards distToBe by that percentage +cp changes how much the weights are adjusted to check the distance + +index is the index of the vertex being moved +norm and d are the plane's properties for the equation: ax + by + cz + d = 0 +coord is a point on the plane +*/ +static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], float coord[3], float d, float distToBe, float strength, float cp) { + DerivedMesh *dm; + MDeformWeight *dw; + MVert m; + MDeformVert *dvert = me->dvert+index; + int totweight = dvert->totweight; + float oldw = 0; + float oldPos[3] = {0}; + float vc, hc, dist; + int i, k; + float (*changes)[2] = MEM_mallocN(sizeof(float *)*totweight*2, "vertHorzChange"); + float *dists = MEM_mallocN(sizeof(float)*totweight, "distance"); + int *upDown = MEM_callocN(sizeof(int)*totweight, "upDownTracker");// track if up or down moved it closer for each bone + int *dwIndices = MEM_callocN(sizeof(int)*totweight, "dwIndexTracker"); + float distToStart; + int bestIndex = 0; + char wasChange; + char wasUp; + int lastIndex = -1; + float originalDistToBe = distToBe; + do { + wasChange = FALSE; + dm = dm_deform_recalc(scene, ob); + dm->getVert(dm, index, &m); + oldPos[0] = m.co[0]; + oldPos[1] = m.co[1]; + oldPos[2] = m.co[2]; + distToStart = norm[0]*oldPos[0] + norm[1]*oldPos[1] + norm[2]*oldPos[2] + d; + + if(distToBe == originalDistToBe) { + distToBe += distToStart - distToStart*strength; + } + for(i = 0; i < totweight; i++) { + dwIndices[i] = i; + dw = (dvert->dw+i); + vc = hc = 0; + if(!dw->weight) { + changes[i][0] = 0; + changes[i][1] = 0; + dists[i] = distToStart; + continue; + } + for(k = 0; k < 2; k++) { + if(dm) { + dm_deform_clear(dm, ob); dm = NULL; + } + oldw = dw->weight; + if(k) { + dw->weight *= 1+cp; + } else { + dw->weight /= 1+cp; + } + if(dw->weight == oldw) { + changes[i][0] = 0; + changes[i][1] = 0; + dists[i] = distToStart; + break; + } + if(dw->weight > 1) { + dw->weight = 1; + } + dm = dm_deform_recalc(scene, ob); + dm->getVert(dm, index, &m); + getVerticalAndHorizontalChange(norm, d, coord, oldPos, distToStart, m.co, changes, dists, i); + dw->weight = oldw; + if(!k) { + vc = changes[i][0]; + hc = changes[i][1]; + dist = dists[i]; + } else { + if(fabs(dist - distToBe) < fabs(dists[i] - distToBe)) { + upDown[i] = 0; + changes[i][0] = vc; + changes[i][1] = hc; + dists[i] = dist; + } else { + upDown[i] = 1; + } + if(fabs(dists[i] - distToBe) > fabs(distToStart - distToBe)) { + changes[i][0] = 0; + changes[i][1] = 0; + dists[i] = distToStart; + } + } + } + } + // sort the changes by the vertical change + for(k = 0; k < totweight; k++) { + float tf; + int ti; + bestIndex = k; + for(i = k+1; i < totweight; i++) { + dist = dists[i]; + + if(fabs(dist) > fabs(dists[i])) { + bestIndex = i; + } + } + // switch with k + if(bestIndex != k) { + ti = upDown[k]; + upDown[k] = upDown[bestIndex]; + upDown[bestIndex] = ti; + + ti = dwIndices[k]; + dwIndices[k] = dwIndices[bestIndex]; + dwIndices[bestIndex] = ti; + + tf = changes[k][0]; + changes[k][0] = changes[bestIndex][0]; + changes[bestIndex][0] = tf; + + tf = changes[k][1]; + changes[k][1] = changes[bestIndex][1]; + changes[bestIndex][1] = tf; + + tf = dists[k]; + dists[k] = dists[bestIndex]; + dists[bestIndex] = tf; + } + } + bestIndex = -1; + // find the best change with an acceptable horizontal change + for(i = 0; i < totweight; i++) { + if(fabs(changes[i][0]) > fabs(changes[i][1]*2.0f)) { + bestIndex = i; + break; + } + } + if(bestIndex != -1) { + wasChange = TRUE; + // it is a good place to stop if it tries to move the opposite direction + // (relative to the plane) of last time + if(lastIndex != -1) { + if(wasUp != upDown[bestIndex]) { + wasChange = FALSE; + } + } + lastIndex = bestIndex; + wasUp = upDown[bestIndex]; + dw = (dvert->dw+dwIndices[bestIndex]); + oldw = dw->weight; + if(upDown[bestIndex]) { + dw->weight *= 1+cp; + } else { + dw->weight /= 1+cp; + } + if(dw->weight > 1) { + dw->weight = 1; + } + if(oldw == dw->weight) { + wasChange = FALSE; + } + if(dm) { + dm_deform_clear(dm, ob); dm = NULL; + } + } + }while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) == (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe)); + MEM_freeN(upDown); + MEM_freeN(changes); + MEM_freeN(dists); + MEM_freeN(dwIndices); +} + +/* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex +but it could be used to raise or lower an existing 'bump.' */ +static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength, float cp) +{ + int i; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; + int *verts = NULL; + for(i = 0; i < me->totvert && mvert; i++, mvert++) { + + if(use_vert_sel && (mvert->flag & SELECT)) { + + int count=0; + if((verts = getSurroundingVerts(me, i, &count))) { + MVert m; + MVert *p = MEM_callocN(sizeof(MVert)*(count), "deformedPoints"); + int k; + + DerivedMesh *dm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); + for(k = 0; k < count; k++) { + dm->getVert(dm, verts[k], &m); + p[k] = m; + } + + if(count >= 3) { + float d /*, dist */ /* UNUSED */, mag; + float coord[3] = {0}; + float norm[3] = {0}; + getSingleCoordinate(p, count, coord); + dm->getVert(dm, i, &m); + norm[0] = m.co[0]-coord[0]; + norm[1] = m.co[1]-coord[1]; + norm[2] = m.co[2]-coord[2]; + mag = sqrt(norm[0]*norm[0] + norm[1]*norm[1] + norm[2]*norm[2]); + if(mag) {// zeros fix + mul_v3_fl(norm, 1.0f/mag); + + d = -norm[0]*coord[0] -norm[1]*coord[1] -norm[2]*coord[2]; + /* dist = (norm[0]*m.co[0] + norm[1]*m.co[1] + norm[2]*m.co[2] + d); */ /* UNUSED */ + moveCloserToDistanceFromPlane(scene, ob, me, i, norm, coord, d, distToBe, strength, cp); + } + } + + MEM_freeN(verts); + MEM_freeN(p); + } + } + } +} + static void vgroup_levels(Object *ob, float offset, float gain) { bDeformGroup *dg; @@ -743,6 +1154,10 @@ static void vgroup_levels(Object *ob, float offset, float gain) MDeformVert *dvert, **dvert_array=NULL; int i, def_nr, dvert_tot=0; + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; + ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); dg = BLI_findlink(&ob->defbase, (ob->actdef-1)); @@ -751,6 +1166,11 @@ static void vgroup_levels(Object *ob, float offset, float gain) def_nr= ob->actdef-1; for(i = 0; i < dvert_tot; i++) { + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } + dvert = dvert_array[i]; dw = defvert_find_index(dvert, def_nr); if(dw) { @@ -772,6 +1192,11 @@ static void vgroup_normalize_all(Object *ob, int lock_active) int i, dvert_tot=0; float tot_weight; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; + ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); if(dvert_array) { @@ -781,6 +1206,10 @@ static void vgroup_normalize_all(Object *ob, int lock_active) for(i = 0; i < dvert_tot; i++) { float lock_iweight= 1.0f; int j; + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } tot_weight= 0.0f; dw_act= NULL; @@ -821,6 +1250,11 @@ static void vgroup_normalize_all(Object *ob, int lock_active) else { for(i = 0; i < dvert_tot; i++) { int j; + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } + tot_weight= 0.0f; dvert = dvert_array[i]; @@ -848,12 +1282,45 @@ static void vgroup_normalize_all(Object *ob, int lock_active) } +static void vgroup_lock_all(Object *ob, int action) +{ + bDeformGroup *dg; + + if(action == SEL_TOGGLE) { + action= SEL_SELECT; + for(dg= ob->defbase.first; dg; dg= dg->next) { + if(dg->flag & DG_LOCK_WEIGHT) { + action= SEL_DESELECT; + break; + } + } + } + + for(dg= ob->defbase.first; dg; dg= dg->next) { + switch(action) { + case SEL_SELECT: + dg->flag |= DG_LOCK_WEIGHT; + break; + case SEL_DESELECT: + dg->flag &= ~DG_LOCK_WEIGHT; + break; + case SEL_INVERT: + dg->flag ^= DG_LOCK_WEIGHT; + break; + } + } +} + static void vgroup_invert(Object *ob, int auto_assign, int auto_remove) { bDeformGroup *dg; MDeformWeight *dw; MDeformVert *dvert, **dvert_array=NULL; int i, def_nr, dvert_tot=0; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); @@ -864,6 +1331,10 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove) for(i = 0; i < dvert_tot; i++) { + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } dvert = dvert_array[i]; if(auto_assign) { @@ -976,6 +1447,10 @@ static void vgroup_clean(Object *ob, float eul, int keep_single) MDeformWeight *dw; MDeformVert *dvert, **dvert_array=NULL; int i, def_nr, dvert_tot=0; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); @@ -985,6 +1460,10 @@ static void vgroup_clean(Object *ob, float eul, int keep_single) def_nr= ob->actdef-1; for(i = 0; i < dvert_tot; i++) { + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } dvert = dvert_array[i]; dw= defvert_find_index(dvert, def_nr); @@ -1006,12 +1485,21 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single) MDeformWeight *dw; MDeformVert *dvert, **dvert_array=NULL; int i, dvert_tot=0; + + Mesh *me = ob->data; + MVert *mvert = me->mvert; + const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot); if(dvert_array) { for(i = 0; i < dvert_tot; i++) { int j; + + if(use_vert_sel && !(mvert[i].flag & SELECT)) { + continue; + } + dvert = dvert_array[i]; j= dvert->totweight; @@ -1591,7 +2079,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups."); + RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups"); } static int vertex_group_assign_exec(bContext *C, wmOperator *op) @@ -1623,7 +2111,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group."); + RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group"); } static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) @@ -1662,7 +2150,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups."); + RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups"); } static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1771,8 +2259,8 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights.", -1.0f, 1.f); - RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f); + RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.f); + RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.f); } static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1829,7 +2317,83 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others."); + RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others"); +} + +static int vertex_group_fix_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + Scene *scene= CTX_data_scene(C); + + float distToBe= RNA_float_get(op->ptr, "dist"); + float strength= RNA_float_get(op->ptr, "strength"); + float cp= RNA_float_get(op->ptr, "accuracy"); + ModifierData *md= ob->modifiers.first; + + while(md) { + if(md->type == eModifierType_Mirror && (md->mode&eModifierMode_Realtime)) { + break; + } + md = md->next; + } + + if(md && md->type == eModifierType_Mirror) { + BKE_report(op->reports, RPT_ERROR_INVALID_CONTEXT, "This operator does not support an active mirror modifier"); + return OPERATOR_CANCELLED; + } + vgroup_fix(scene, ob, distToBe, strength, cp); + + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Fix Vertex Group Deform"; + ot->idname= "OBJECT_OT_vertex_group_fix"; + ot->description= "Modify the position of selected vertices by changing only their respective groups' weights (this tool may be slow for many vertices)."; + + /* api callbacks */ + ot->poll= vertex_group_poll; + ot->exec= vertex_group_fix_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to.", -10.0f, 10.0f); + RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength", "The distance moved can be changed by this multiplier.", -2.0f, 2.0f); + RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", "Changes the amount weights are altered with each iteration: lower values are slower.", 0.05f, 1.f); +} + + +static int vertex_group_lock_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + + int action = RNA_enum_get(op->ptr, "action"); + + vgroup_lock_all(ob, action); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_lock(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Change the Lock On Vertex Groups"; + ot->idname= "OBJECT_OT_vertex_group_lock"; + + /* api callbacks */ + ot->poll= vertex_group_poll; + ot->exec= vertex_group_lock_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + WM_operator_properties_select_all(ot); } static int vertex_group_invert_exec(bContext *C, wmOperator *op) @@ -1859,8 +2423,8 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", "Add verts from groups that have zero weight before inverting."); - RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", "Remove verts from groups that have zero weight after inverting."); + RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", "Add verts from groups that have zero weight before inverting"); + RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", "Remove verts from groups that have zero weight after inverting"); } @@ -1925,9 +2489,9 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f); - RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups."); - RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning."); + RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit", 0.001f, 0.99f); + RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups"); + RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning"); } @@ -1959,8 +2523,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights."); - RNA_def_boolean(ot->srna, "flip_group_names", TRUE, "Flip Groups", "Flip vertex group names."); + RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights"); + RNA_def_boolean(ot->srna, "flip_group_names", TRUE, "Flip Groups", "Flip vertex group names"); } @@ -2102,7 +2666,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active."); + prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active"); RNA_def_enum_funcs(prop, vgroup_itemf); ot->prop= prop; } @@ -2154,7 +2718,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op) } } else { - BKE_report(op->reports, RPT_ERROR, "Editmode lattice isnt supported yet."); + BKE_report(op->reports, RPT_ERROR, "Editmode lattice isnt supported yet"); MEM_freeN(sort_map_update); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 4b0c1cb1222..74e91cf32ea 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1526,7 +1526,7 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked keys rather than selecting them."); + RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked keys rather than selecting them"); RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "", 0, 16384); } @@ -1713,7 +1713,7 @@ void PARTICLE_OT_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } /*************************** reveal operator **************************/ @@ -2403,7 +2403,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) if(totremoved == 0) return OPERATOR_CANCELLED; - BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved); + BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles", totremoved); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); @@ -2579,7 +2579,7 @@ void PARTICLE_OT_delete(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys."); + ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys"); } /*************************** mirror operator **************************/ diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index bd53de20871..11796d01620 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -594,7 +594,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom } /* if there's more than one domain, cancel */ else if (fsDomain && ob != fsDomain) { - BKE_report(reports, RPT_ERROR, "There should be only one domain object."); + BKE_report(reports, RPT_ERROR, "There should be only one domain object"); return 0; } } @@ -612,17 +612,17 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom fsDomain = newdomain; if (!fsDomain) { - BKE_report(reports, RPT_ERROR, "No domain object found."); + BKE_report(reports, RPT_ERROR, "No domain object found"); return 0; } if (channelObjCount>=255) { - BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects."); + BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects"); return 0; } if (fluidInputCount == 0) { - BKE_report(reports, RPT_ERROR, "No fluid input objects in the scene."); + BKE_report(reports, RPT_ERROR, "No fluid input objects in the scene"); return 0; } @@ -889,7 +889,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) /* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */; noFrames = scene->r.efra - 0; if(noFrames<=0) { - BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings."); + BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings"); fluidbake_free_data(channels, fobjects, fsset, fb); return 0; } @@ -993,7 +993,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) if(!invert_m4_m4(invDomMat, domainMat)) { BLI_snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); - BKE_report(reports, RPT_ERROR, "Invalid object matrix."); + BKE_report(reports, RPT_ERROR, "Invalid object matrix"); fluidbake_free_data(channels, fobjects, fsset, fb); return 0; diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 42a163d3da5..0b350e3afd0 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -203,7 +203,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL; if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) { - BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected."); + BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); return OPERATOR_CANCELLED; } @@ -477,7 +477,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) } if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) { - BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected."); + BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 3256112426b..5a8e930e1a4 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -260,12 +260,12 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) return 0; if(!is_view_context && scene->camera==NULL) { - BKE_report(op->reports, RPT_ERROR, "Scene has no camera."); + BKE_report(op->reports, RPT_ERROR, "Scene has no camera"); return 0; } if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) { - BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected."); + BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); return 0; } @@ -611,7 +611,7 @@ void RENDER_OT_opengl(wmOperatorType *ot) RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene"); RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)"); - RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings."); + RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings"); } /* function for getting an opengl buffer from a View3D, used by sequencer */ diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 3aa9bef9ef8..4da1ecd8fdf 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -134,7 +134,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op) /* Removing material slots in edit mode screws things up, see bug #21822.*/ if(ob == CTX_data_edit_object(C)) { - BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode."); + BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode"); return OPERATOR_CANCELLED; } @@ -1266,7 +1266,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */ /* properties */ - prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face. Order is [+Z -Z +Y -X -Y +X]. Use -1 to skip a face.", 0.0f, 0.0f); + prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f); RNA_def_property_flag(prop, PROP_HIDDEN); WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index d41d3245623..8951df9221e 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -43,6 +43,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_screen.h" @@ -1347,7 +1349,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa) static const char *editortype_pup(void) { - return( + const char *types= N_( "Editor type:%t" "|3D View %x1" @@ -1382,6 +1384,8 @@ static const char *editortype_pup(void) "|Python Console %x18" ); + + return UI_translate_do_iface(types); } static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) @@ -1403,8 +1407,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, editortype_pup(), xco, yco, UI_UNIT_X+10, UI_UNIT_Y, &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays current editor type. " - "Click for menu of available types"); + UI_translate_do_tooltip(N_("Displays current editor type. Click for menu of available types"))); uiButSetFunc(but, spacefunc, NULL, NULL); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ @@ -1449,7 +1452,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco) void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr) { ScrArea *sa= CTX_wm_area(C); - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiBlock *block; PanelType *pt; Panel *panel; @@ -1637,7 +1640,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar) void ED_region_header(const bContext *C, ARegion *ar) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiBlock *block; uiLayout *layout; HeaderType *ht; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5cc42e2b6cf..a2be1e8fa6f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1811,7 +1811,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* rna */ - RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range."); + RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range"); } @@ -3023,7 +3023,7 @@ static void SCREEN_OT_animation_cancel(wmOperatorType *ot) ot->poll= ED_operator_screenactive; - RNA_def_boolean(ot->srna, "restore_frame", TRUE, "Restore Frame", "Restore the frame when animation was initialized."); + RNA_def_boolean(ot->srna, "restore_frame", TRUE, "Restore Frame", "Restore the frame when animation was initialized"); } /* ************** border select operator (template) ***************************** */ @@ -3098,7 +3098,7 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op) if (sa->full) break; } if (!sa) { - BKE_report(op->reports, RPT_ERROR, "No fullscreen areas were found."); + BKE_report(op->reports, RPT_ERROR, "No fullscreen areas were found"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 784c35ca523..eb919261127 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5178,7 +5178,7 @@ void PAINT_OT_grab_clone(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ - RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates.", -1.0f, 1.0f); + RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates", -1.0f, 1.0f); } /******************** sample color operator ********************/ @@ -5259,7 +5259,7 @@ void PAINT_OT_sample_color(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "Cursor location in region coordinates.", 0, 16384); + RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "Cursor location in region coordinates", 0, 16384); } /******************** set clone cursor operator ********************/ @@ -5309,7 +5309,7 @@ void PAINT_OT_clone_cursor_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in world space coordinates.", -10000.0f, 10000.0f); + RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in world space coordinates", -10000.0f, 10000.0f); } /******************** texture paint toggle operator ********************/ @@ -5334,14 +5334,14 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if (object_data_is_libdata(ob)) { - BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata."); + BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); return OPERATOR_CANCELLED; } me= get_mesh(ob); if(!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) { - BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects."); + BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects"); return OPERATOR_CANCELLED; } @@ -5409,6 +5409,15 @@ int facemask_paint_poll(bContext *C) return paint_facesel_test(CTX_data_active_object(C)); } +int vert_paint_poll(bContext *C) +{ + return paint_vertsel_test(CTX_data_active_object(C)); +} + +int mask_paint_poll(bContext *C) +{ + return paint_facesel_test(CTX_data_active_object(C)) || paint_vertsel_test(CTX_data_active_object(C)); +} /* use project paint to re-apply an image */ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) { @@ -5422,12 +5431,12 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) project_state_init(C, OBACT, &ps); if(ps.ob==NULL || ps.ob->type != OB_MESH) { - BKE_report(op->reports, RPT_ERROR, "No active mesh object."); + BKE_report(op->reports, RPT_ERROR, "No active mesh object"); return OPERATOR_CANCELLED; } if(image==NULL) { - BKE_report(op->reports, RPT_ERROR, "Image could not be found."); + BKE_report(op->reports, RPT_ERROR, "Image could not be found"); return OPERATOR_CANCELLED; } @@ -5435,7 +5444,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) ps.reproject_ibuf= BKE_image_get_ibuf(image, NULL); if(ps.reproject_ibuf==NULL || ps.reproject_ibuf->rect==NULL) { - BKE_report(op->reports, RPT_ERROR, "Image data could not be found."); + BKE_report(op->reports, RPT_ERROR, "Image data could not be found"); return OPERATOR_CANCELLED; } @@ -5446,7 +5455,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) /* type check to make sure its ok */ if(view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT) { - BKE_report(op->reports, RPT_ERROR, "Image project data invalid."); + BKE_report(op->reports, RPT_ERROR, "Image project data invalid"); return OPERATOR_CANCELLED; } } @@ -5459,7 +5468,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) ps.source= PROJ_SRC_IMAGE_CAM; if(scene->camera==NULL) { - BKE_report(op->reports, RPT_ERROR, "No active camera set."); + BKE_report(op->reports, RPT_ERROR, "No active camera set"); return OPERATOR_CANCELLED; } } diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 5a0ee19d6c9..f671b7b1713 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -122,6 +122,11 @@ void PAINT_OT_face_select_inverse(struct wmOperatorType *ot); void PAINT_OT_face_select_hide(struct wmOperatorType *ot); void PAINT_OT_face_select_reveal(struct wmOperatorType *ot); +void PAINT_OT_vert_select_all(struct wmOperatorType *ot); +void PAINT_OT_vert_select_inverse(struct wmOperatorType *ot); +int vert_paint_poll(struct bContext *C); +int mask_paint_poll(struct bContext *C); + int facemask_paint_poll(struct bContext *C); /* stroke operator */ diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 69af50415cc..287d204115c 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -373,6 +373,10 @@ void ED_operatortypes_paint(void) WM_operatortype_append(PAINT_OT_weight_sample); WM_operatortype_append(PAINT_OT_weight_sample_group); + /* vertex selection */ + WM_operatortype_append(PAINT_OT_vert_select_all); + WM_operatortype_append(PAINT_OT_vert_select_inverse); + /* vertex */ WM_operatortype_append(PAINT_OT_vertex_paint_toggle); WM_operatortype_append(PAINT_OT_vertex_paint); @@ -607,6 +611,17 @@ void ED_keymap_paint(wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0); + + /*Weight paint's Vertex Selection Mode */ + keymap= WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0); + keymap->poll= vert_paint_poll; + WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "PAINT_OT_vert_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "deselect", 1); + WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); + /* Image/Texture Paint mode */ keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0); keymap->poll= image_texture_paint_poll; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 09f5c32bea0..d332dc6ec0d 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -1,3 +1,32 @@ +/* + * $Id$ + * + * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 ***** + */ + /** \file blender/editors/sculpt_paint/paint_utils.c * \ingroup edsculpt */ @@ -358,6 +387,49 @@ void PAINT_OT_face_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } + +static int vert_select_all_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE); + ED_region_tag_redraw(CTX_wm_region(C)); + return OPERATOR_FINISHED; +} + + +void PAINT_OT_vert_select_all(wmOperatorType *ot) +{ + ot->name= "Vertex Selection"; + ot->description= "Change selection for all vertices"; + ot->idname= "PAINT_OT_vert_select_all"; + + ot->exec= vert_select_all_exec; + ot->poll= vert_paint_poll; + + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + WM_operator_properties_select_all(ot); +} + +static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob= CTX_data_active_object(C); + paintvert_deselect_all_visible(ob, SEL_INVERT, TRUE); + ED_region_tag_redraw(CTX_wm_region(C)); + return OPERATOR_FINISHED; +} + +void PAINT_OT_vert_select_inverse(wmOperatorType *ot) +{ + ot->name= "Vertex Select Invert"; + ot->description= "Invert selection of vertices"; + ot->idname= "PAINT_OT_vert_select_inverse"; + + ot->exec= vert_select_inverse_exec; + ot->poll= vert_paint_poll; + + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_active_object(C); @@ -399,7 +471,7 @@ void PAINT_OT_face_select_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); } static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op)) @@ -421,5 +493,5 @@ void PAINT_OT_face_select_reveal(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 3da19ba7346..11a46bb373b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -64,6 +64,7 @@ #include "RNA_enum_types.h" #include "BKE_DerivedMesh.h" +#include "BKE_armature.h" #include "BKE_action.h" #include "BKE_brush.h" #include "BKE_context.h" @@ -390,25 +391,27 @@ void vpaint_fill(Object *ob, unsigned int paintcol) void wpaint_fill(VPaint *wp, Object *ob, float paintweight) { Mesh *me; - MFace *mface; MDeformWeight *dw, *uw; int *indexar; - int index, vgroup; - unsigned int faceverts[5]={0,0,0,0,0}; - unsigned char i; - int vgroup_mirror= -1; + unsigned int index; + int vgroup, vgroup_mirror= -1; int selected; + int use_vert_sel; + me= ob->data; if(me==NULL || me->totface==0 || me->dvert==NULL || !me->mface) return; selected= (me->editflag & ME_EDIT_PAINT_MASK); + + use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; indexar= get_indexarray(me); if(selected) { - for(index=0, mface=me->mface; index<me->totface; index++, mface++) { - if((mface->flag & ME_FACE_SEL)==0) + MFace *mf; + for(index=0, mf= me->mface; index<me->totface; index++, mf++) { + if((mf->flag & ME_FACE_SEL)==0) indexar[index]= 0; else indexar[index]= index+1; @@ -430,22 +433,25 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) for(index=0; index<me->totface; index++) { if(indexar[index] && indexar[index]<=me->totface) { - mface= me->mface + (indexar[index]-1); - /* just so we can loop through the verts */ - faceverts[0]= mface->v1; - faceverts[1]= mface->v2; - faceverts[2]= mface->v3; - faceverts[3]= mface->v4; - for (i=0; i<3 || faceverts[i]; i++) { - if(!((me->dvert+faceverts[i])->flag)) { - dw= defvert_verify_index(me->dvert+faceverts[i], vgroup); + MFace *mf= &me->mface[indexar[index]-1]; + unsigned int fidx= mf->v4 ? 3:2; + + do { + unsigned int vidx= *(&mf->v1 + fidx); + + if(!me->dvert[vidx].flag) { + if(use_vert_sel && !(me->mvert[vidx].flag & SELECT)) { + continue; + } + + dw= defvert_verify_index(&me->dvert[vidx], vgroup); if(dw) { - uw= defvert_verify_index(wp->wpaint_prev+faceverts[i], vgroup); + uw= defvert_verify_index(wp->wpaint_prev+vidx, vgroup); uw->weight= dw->weight; /* set the undo weight */ dw->weight= paintweight; - + if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, faceverts[i]); + int j= mesh_get_x_mirror_vert(ob, vidx); if(j>=0) { /* copy, not paint again */ if(vgroup_mirror != -1) { @@ -460,16 +466,19 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) } } } - (me->dvert+faceverts[i])->flag= 1; + me->dvert[vidx].flag= 1; } - } + + + } while (fidx--); } } - - index=0; - while (index<me->totvert) { - (me->dvert+index)->flag= 0; - index++; + + { + MDeformVert *dv= me->dvert; + for(index= me->totvert; index != 0; index--, dv++) { + dv->flag= 0; + } } MEM_freeN(indexar); @@ -792,7 +801,7 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], fl return alpha; } -static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip) +static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip, int multipaint) { Brush *brush = paint_brush(&wp->paint); int tool = brush->vertexpaint_tool; @@ -830,7 +839,10 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float if (dw->weight > paintval) dw->weight = paintval*alpha + dw->weight*(1.0f-alpha); } - CLAMP(dw->weight, 0.0f, 1.0f); + /* delay clamping until the end so multi-paint can function when the active group is at the limits */ + if(multipaint == FALSE) { + CLAMP(dw->weight, 0.0f, 1.0f); + } /* if no spray, clip result with orig weight & orig alpha */ if((wp->flag & VP_SPRAY)==0) { @@ -857,15 +869,17 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float else testw = uw->weight; } - CLAMP(testw, 0.0f, 1.0f); - - if( testw<uw->weight ) { - if(dw->weight < testw) dw->weight= testw; - else if(dw->weight > uw->weight) dw->weight= uw->weight; - } - else { - if(dw->weight > testw) dw->weight= testw; - else if(dw->weight < uw->weight) dw->weight= uw->weight; + + if(multipaint == FALSE) { + CLAMP(testw, 0.0f, 1.0f); + if( testw<uw->weight ) { + if(dw->weight < testw) dw->weight= testw; + else if(dw->weight > uw->weight) dw->weight= uw->weight; + } + else { + if(dw->weight > testw) dw->weight= testw; + else if(dw->weight < uw->weight) dw->weight= uw->weight; + } } } @@ -980,7 +994,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA const int totgroup= BLI_countlist(&vc.obact->defbase); if(totgroup) { MFace *mf= ((MFace *)me->mface) + index-1; - int fidx= mf->v4 ? 3:2; + unsigned int fidx= mf->v4 ? 3:2; int *groups= MEM_callocN(totgroup*sizeof(int), "groups"); int found= FALSE; @@ -1062,6 +1076,7 @@ void PAINT_OT_weight_sample_group(wmOperatorType *ot) } +#if 0 /* UNUSED */ static void do_weight_paint_auto_normalize(MDeformVert *dvert, int paint_nr, char *map) { @@ -1096,41 +1111,600 @@ static void do_weight_paint_auto_normalize(MDeformVert *dvert, } } } +#endif + +/* the active group should be involved in auto normalize */ +static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *map, char do_auto_normalize) +{ +// MDeformWeight *dw = dvert->dw; + float sum=0.0f, fac=0.0f; + int i, tot=0; + + if (do_auto_normalize == FALSE) + return; + + for (i=0; i<dvert->totweight; i++) { + if (map[dvert->dw[i].def_nr]) { + tot += 1; + sum += dvert->dw[i].weight; + } + } + + if (!tot || sum == 1.0f) + return; + + fac = sum; + fac = fac==0.0f ? 1.0f : 1.0f / fac; + + for (i=0; i<dvert->totweight; i++) { + if (map[dvert->dw[i].def_nr]) { + dvert->dw[i].weight *= fac; + } + } +} + +/* +See if the current deform vertex has a locked group +*/ +static char has_locked_group(MDeformVert *dvert, const char *lock_flags) +{ + int i; + for(i = 0; i < dvert->totweight; i++) { + if(lock_flags[dvert->dw[i].def_nr] && dvert->dw[i].weight > 0.0f) { + return TRUE; + } + } + return FALSE; +} +/* + * gen_lck_flags gets the status of "flag" for each bDeformGroup + *in ob->defbase and returns an array containing them + */ +static char *gen_lock_flags(Object* ob, int defbase_tot) +{ + char is_locked = FALSE; + int i; + //int defbase_tot = BLI_countlist(&ob->defbase); + char *lock_flags = MEM_mallocN(defbase_tot*sizeof(char), "defflags"); + bDeformGroup *defgroup; + + for(i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) { + lock_flags[i] = ((defgroup->flag & DG_LOCK_WEIGHT) != 0); + is_locked |= lock_flags[i]; + } + if(is_locked){ + return lock_flags; + } + + MEM_freeN(lock_flags); + return NULL; +} + +static int has_locked_group_selected(int defbase_tot, char *defbase_sel, char *lock_flags) +{ + int i; + for(i = 0; i < defbase_tot; i++) { + if(defbase_sel[i] && lock_flags[i]) { + return TRUE; + } + } + return FALSE; +} + + +#if 0 /* UNUSED */ +static int has_unselected_unlocked_bone_group(int defbase_tot, char *defbase_sel, int selected, char *lock_flags, char *vgroup_validmap) +{ + int i; + if(defbase_tot == selected) { + return FALSE; + } + for(i = 0; i < defbase_tot; i++) { + if(vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) { + return TRUE; + } + } + return FALSE; +} +#endif + + +static void multipaint_selection(MDeformVert *dvert, float change, char *defbase_sel, int defbase_tot) +{ + int i; + MDeformWeight *dw; + float val; + /* make sure they are all at most 1 after the change */ + for(i = 0; i < defbase_tot; i++) { + if(defbase_sel[i]) { + dw = defvert_find_index(dvert, i); + if(dw && dw->weight) { + val = dw->weight * change; + if(val > 1) { + /* TODO: when the change is reduced, you need to recheck + * the earlier values to make sure they are not 0 + * (precision error) */ + change = 1.0f/dw->weight; + } + /* the value should never reach zero while multi-painting if it + * was nonzero beforehand */ + if(val <= 0) { + return; + } + } + } + } + /* apply the valid change */ + for(i = 0; i < defbase_tot; i++) { + if(defbase_sel[i]) { + dw = defvert_find_index(dvert, i); + if(dw && dw->weight) { + dw->weight = dw->weight * change; + } + } + } +} + +/* move all change onto valid, unchanged groups. If there is change left over, + * then return it. + * assumes there are valid groups to shift weight onto */ +static float redistribute_change(MDeformVert *ndv, char *change_status, int changeme, int changeto, float totchange, float total_valid, char do_auto_normalize) +{ + float was_change; + float change; + float oldval; + MDeformWeight *ndw; + int i; + do { + /* assume there is no change until you see one */ + was_change = FALSE; + /* change each group by the same amount each time */ + change = totchange/total_valid; + for(i = 0; i < ndv->totweight && total_valid && totchange; i++) { + ndw = (ndv->dw+i); + /* change only the groups with a valid status */ + if(change_status[ndw->def_nr] == changeme) { + oldval = ndw->weight; + /* if auto normalize is active, don't worry about upper bounds */ + if(do_auto_normalize == FALSE && ndw->weight + change > 1) { + totchange -= 1-ndw->weight; + ndw->weight = 1; + /* stop the changes to this group */ + change_status[ndw->def_nr] = changeto; + total_valid--; + } + else if(ndw->weight + change < 0) { /* check the lower bound */ + totchange -= ndw->weight; + ndw->weight = 0; + change_status[ndw->def_nr] = changeto; + total_valid--; + } + else {/* a perfectly valid change occurred to ndw->weight */ + totchange -= change; + ndw->weight += change; + } + /* see if there was a change */ + if(oldval != ndw->weight) { + was_change = TRUE; + } + } + } + /* don't go again if there was no change, if there is no valid group, + * or there is no change left */ + } while(was_change && total_valid && totchange); + /* left overs */ + return totchange; +} + +/* 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) +{ + float totchange = 0.0f; + float totchange_allowed = 0.0f; + float left_over; + + int total_valid = 0; + int total_changed = 0; + unsigned int i; + MDeformWeight *ndw; + MDeformWeight *odw; + MDeformWeight *ndw2; + MDeformWeight *odw2; + int designatedw = -1; + int designatedw_changed = FALSE; + float storedw; + char *change_status; + char new_weight_has_zero = FALSE; + + if(!lock_flags || !has_locked_group(ndv, lock_flags)) { + return; + } + /* record if a group was changed, unlocked and not changed, or locked */ + change_status = MEM_callocN(sizeof(char)*defbase_tot, "unlocked_unchanged"); + + for(i = 0; i < defbase_tot; i++) { + ndw = defvert_find_index(ndv, i); + 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]){ + defvert_verify_index(odv, i); + defvert_verify_index(ndv, i); + total_valid++; + change_status[i] = 1; /* can be altered while redistributing */ + } + continue; + } + /* locked groups should not be changed */ + if(lock_flags[i]) { + ndw->weight = odw->weight; + } + else if(ndw->weight != odw->weight) { /* changed groups are handled here */ + totchange += ndw->weight - odw->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]){ + totchange_allowed += ndw->weight; + total_valid++; + change_status[i] = 1; /* can be altered while redistributing */ + } + } + /* if there was any change, redistribute it */ + if(total_changed) { + /* auto normalize will allow weights to temporarily go above 1 in redistribution */ + if(vgroup_validmap && total_changed < 0 && total_valid) { + totchange_allowed = total_valid; + } + /* there needs to be change allowed, or you should not bother */ + if(totchange_allowed) { + /* the way you modify the unlocked+unchanged groups is different depending + * on whether or not you are painting the weight(s) up or down */ + if(totchange < 0) { + totchange_allowed = total_valid - totchange_allowed; + } + else { + totchange_allowed *= -1; + } + left_over = 0; + if(fabsf(totchange_allowed) < fabsf(totchange)) { + /* this amount goes back onto the changed, unlocked weights */ + left_over = fabsf(fabsf(totchange) - fabsf(totchange_allowed)); + if(totchange > 0) { + left_over *= -1; + } + } + else { + /* all of the change will be permitted */ + totchange_allowed = -totchange; + } + /* move the weight evenly between the allowed groups, move excess back onto the used groups based on the change */ + 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(change_status[ndw->def_nr] == 2) { + odw2 = &odv->dw[i]; + ndw2 = &ndv->dw[i]; + if(!designatedw_changed) { + ndw->weight = (totchange_allowed + 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 */ + else { + redistribute_change(ndv, change_status, 2, -2, left_over, total_changed, do_auto_normalize); + } + } + } + else { + /* reset the weights */ + unsigned int i; + MDeformWeight *dw_old= odv->dw; + MDeformWeight *dw_new= ndv->dw; + + for (i= odv->totweight; i != 0; i--, dw_old++, dw_new++) { + dw_new->weight= dw_old->weight; + } + } + } + + MEM_freeN(change_status); +} -static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index, - float alpha, float paintweight, int flip, - int vgroup_mirror, char *validmap) +/* multi-paint's initial, potential change is computed here based on the user's stroke */ +static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_change) +{ + float selwsum = 0.0f; + unsigned int i; + MDeformWeight *dw= odv->dw; + + for (i= odv->totweight; i != 0; i--, dw++) { + if(defbase_sel[dw->def_nr]) { + selwsum += dw->weight; + } + } + if(selwsum && selwsum+brush_change > 0) { + return (selwsum+brush_change)/selwsum; + } + return 0.0f; +} + +/* change the weights back to the wv's weights + * it assumes you already have the correct pointer index */ +static void reset_to_prev(MDeformVert *wv, MDeformVert *dvert) +{ + MDeformWeight *dw= dvert->dw; + MDeformWeight *w; + unsigned int i; + for (i= dvert->totweight; i != 0; i--, dw++) { + w= defvert_find_index(wv, dw->def_nr); + /* if there was no w when there is a d, then the old weight was 0 */ + dw->weight = w ? w->weight : 0.0f; + } +} + +static void clamp_weights(MDeformVert *dvert) +{ + MDeformWeight *dw= dvert->dw; + unsigned int i; + for (i= dvert->totweight; i != 0; i--, dw++) { + CLAMP(dw->weight, 0.0f, 1.0f); + } +} + +/* struct to avoid passing many args each call to do_weight_paint_vertex() + * this _could_ be made a part of the operators 'WPaintData' struct, or at + * least a member, but for now keep its own struct, initialized on every + * paint stroke update - campbell */ +typedef struct WeightPaintInfo { + + int defbase_tot; + + /* both must add up to 'defbase_tot' */ + int defbase_tot_sel; + int defbase_tot_unsel; + + int vgroup_mirror; /* mirror group or -1 */ + + char *lock_flags; /* boolean array for locked bones, + * length of defbase_tot */ + char *defbase_sel; /* boolean array for selected bones, + * length of defbase_tot */ + + char *vgroup_validmap; /* same as WeightPaintData.vgroup_validmap, + * only added here for convenience */ + + char do_flip; + char do_multipaint; + char do_auto_normalize; +} WeightPaintInfo; + +/* fresh start to make multi-paint and locking modular */ +/* returns TRUE if it thinks you need to reset the weights due to + * normalizing while multi-painting */ +static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, + const unsigned int index, + MDeformWeight *dw, MDeformWeight *tdw, + float change, float oldChange, + float oldw, float neww) +{ + MDeformVert *dv= &me->dvert[index]; + MDeformVert dv_test= {NULL}; + + dv_test.dw= MEM_dupallocN(dv->dw); + dv_test.flag = dv->flag; + dv_test.totweight = dv->totweight; + /* do not multi-paint if a locked group is selected or the active group is locked + * !lock_flags[dw->def_nr] helps if nothing is selected, but active group is locked */ + if( (wpi->lock_flags == NULL) || + ((wpi->lock_flags[dw->def_nr] == FALSE) && + has_locked_group_selected(wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags) == FALSE)) + { + if(wpi->do_multipaint && wpi->defbase_tot_sel > 1) { + if(change && change!=1) { + multipaint_selection(dv, change, wpi->defbase_sel, wpi->defbase_tot); + } + } + else { /* this lets users paint normally, but don't let them paint locked groups */ + dw->weight = neww; + } + } + clamp_weights(dv); + + enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize); + + do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); + + if(oldChange && wpi->do_multipaint && wpi->defbase_tot_sel > 1) { + if(tdw->weight != oldw) { + if(neww > oldw) { + if(tdw->weight <= oldw) { + MEM_freeN(dv_test.dw); + return TRUE; + } + } + else { + if(tdw->weight >= oldw) { + MEM_freeN(dv_test.dw); + return TRUE; + } + } + } + } + MEM_freeN(dv_test.dw); + return FALSE; +} + +/* within the current dvert index, get the dw that is selected and has a weight + * above 0, this helps multi-paint */ +static int get_first_selected_nonzero_weight(MDeformVert *dvert, char *defbase_sel) +{ + int i; + MDeformWeight *dw= dvert->dw; + for(i=0; i< dvert->totweight; i++, dw++) { + if(defbase_sel[dw->def_nr] && dw->weight > 0.0f) { + return i; + } + } + return -1; +} + + +static char *wpaint_make_validmap(Object *ob); + + +static void do_weight_paint_vertex( /* vars which remain the same for every vert */ + VPaint *wp, Object *ob, const WeightPaintInfo *wpi, + /* vars which change on each stroke */ + const unsigned int index, float alpha, float paintweight + ) { Mesh *me= ob->data; + MDeformWeight *dw, *uw; int vgroup= ob->actdef-1; - + if(wp->flag & VP_ONLYVGROUP) { - dw= defvert_find_index(me->dvert+index, vgroup); + dw= defvert_find_index(&me->dvert[index], vgroup); uw= defvert_find_index(wp->wpaint_prev+index, vgroup); } else { - dw= defvert_verify_index(me->dvert+index, vgroup); + dw= defvert_verify_index(&me->dvert[index], vgroup); uw= defvert_verify_index(wp->wpaint_prev+index, vgroup); } if(dw==NULL || uw==NULL) return; - - wpaint_blend(wp, dw, uw, alpha, paintweight, flip); - do_weight_paint_auto_normalize(me->dvert+index, vgroup, validmap); - if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, index); - if(j>=0) { - /* copy, not paint again */ - if(vgroup_mirror != -1) - uw= defvert_verify_index(me->dvert+j, vgroup_mirror); - else - uw= defvert_verify_index(me->dvert+j, vgroup); - - uw->weight= dw->weight; + /* TODO: De-duplicate the simple weight paint - jason */ + /* ... or not, since its <10 SLOC - campbell */ + + /* If there are no locks or multipaint, + * then there is no need to run the more complicated checks */ + if( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) && + (wpi->lock_flags == NULL || has_locked_group(&me->dvert[index], wpi->lock_flags) == FALSE)) + { + wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE); + do_weight_paint_auto_normalize_all_groups(&me->dvert[index], wpi->vgroup_validmap, wpi->do_auto_normalize); + + if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ + int j= mesh_get_x_mirror_vert(ob, index); + if(j>=0) { + /* copy, not paint again */ + uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); + + uw->weight= dw->weight; - do_weight_paint_auto_normalize(me->dvert+j, vgroup, validmap); + do_weight_paint_auto_normalize_all_groups(me->dvert+j, wpi->vgroup_validmap, wpi->do_auto_normalize); + } + } + } + else { + /* use locks and/or multipaint */ + float oldw; + float neww; + float testw=0; + float change = 0; + float oldChange = 0; + int i; + MDeformWeight *tdw = NULL, *tuw; + MDeformVert dv= {NULL}; + + oldw = dw->weight; + wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, wpi->do_multipaint && wpi->defbase_tot_sel >1); + neww = dw->weight; + dw->weight = oldw; + + /* setup multi-paint */ + if(wpi->defbase_tot_sel > 1 && wpi->do_multipaint) { + dv.dw= MEM_dupallocN(me->dvert[index].dw); + dv.flag = me->dvert[index].flag; + dv.totweight = me->dvert[index].totweight; + tdw = dw; + tuw = uw; + change = get_mp_change(wp->wpaint_prev+index, wpi->defbase_sel, neww - oldw); + if(change) { + if(!tdw->weight) { + i = get_first_selected_nonzero_weight(&me->dvert[index], wpi->defbase_sel); + if(i>=0) { + tdw = &(me->dvert[index].dw[i]); + tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr); + } + else { + change = 0; + } + } + if(change && tuw->weight && tuw->weight * change) { + if(tdw->weight != tuw->weight) { + oldChange = tdw->weight/tuw->weight; + testw = tuw->weight*change; + if( testw > tuw->weight ) { + if(change > oldChange) { + /* reset the weights and use the new change */ + reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]); + } + else { + /* the old change was more significant, so set + * the change to 0 so that it will not do another multi-paint */ + change = 0; + } + } + else { + if(change < oldChange) { + reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]); + } + else { + change = 0; + } + } + } + } + else { + change = 0; + } + } + } + + if(apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) { + reset_to_prev(&dv, &me->dvert[index]); + change = 0; + oldChange = 0; + } + if(dv.dw) { + MEM_freeN(dv.dw); + } + /* dvert may have been altered greatly */ + dw = defvert_find_index(&me->dvert[index], vgroup); + + if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ + int j= mesh_get_x_mirror_vert(ob, index); + if(j>=0) { + /* copy, not paint again */ + uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); + + //uw->weight= dw->weight; + + apply_mp_locks_normalize(me, wpi, j, uw, tdw, change, oldChange, oldw, neww); + } } } } @@ -1227,16 +1801,15 @@ struct WPaintData { /*variables for auto normalize*/ int auto_normalize; char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/ + char *lock_flags; + int defbase_tot; }; static char *wpaint_make_validmap(Object *ob) { bDeformGroup *dg; ModifierData *md; - char *validmap; - bPose *pose; - bPoseChannel *chan; - ArmatureModifierData *amd; + char *vgroup_validmap; GHash *gh = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh"); int i = 0, step1=1; @@ -1248,7 +1821,7 @@ static char *wpaint_make_validmap(Object *ob) if (!i) return NULL; - validmap = MEM_callocN(i, "wpaint valid map"); + vgroup_validmap= MEM_callocN(i, "wpaint valid map"); /*now loop through the armature modifiers and identify deform bones*/ for (md = ob->modifiers.first; md; md= !md->next && step1 ? (step1=0), modifiers_getVirtualModifierList(ob) : md->next) { @@ -1257,10 +1830,11 @@ static char *wpaint_make_validmap(Object *ob) if (md->type == eModifierType_Armature) { - amd = (ArmatureModifierData*) md; + ArmatureModifierData *amd= (ArmatureModifierData*) md; if(amd->object && amd->object->pose) { - pose = amd->object->pose; + bPose *pose= amd->object->pose; + bPoseChannel *chan; for (chan=pose->chanbase.first; chan; chan=chan->next) { if (chan->bone->flag & BONE_NO_DEFORM) @@ -1278,13 +1852,13 @@ static char *wpaint_make_validmap(Object *ob) /*add all names to a hash table*/ for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) { if (BLI_ghash_lookup(gh, dg->name) != NULL) { - validmap[i] = 1; + vgroup_validmap[i] = TRUE; } } BLI_ghash_free(gh, NULL, NULL); - return validmap; + return vgroup_validmap; } static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) @@ -1318,7 +1892,9 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED /*set up auto-normalize, and generate map for detecting which vgroups affect deform bones*/ wpd->auto_normalize = ts->auto_normalize; - if (wpd->auto_normalize) + wpd->defbase_tot = BLI_countlist(&ob->defbase); + wpd->lock_flags = gen_lock_flags(ob, wpd->defbase_tot); + if (wpd->auto_normalize || ts->multipaint || wpd->lock_flags) wpd->vgroup_validmap = wpaint_make_validmap(ob); // if(qual & LR_CTRLKEY) { @@ -1385,14 +1961,19 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P float mat[4][4]; float paintweight; int *indexar; - int totindex, index, totw, flip; + int totw; + unsigned int index, totindex; float alpha; float mval[2], pressure; - + int use_vert_sel; + + /* intentionally dont initialize as NULL, make sure we initialize all members below */ + WeightPaintInfo wpi; + /* cannot paint if there is no stroke data */ if (wpd == NULL) { - // XXX: force a redraw here, since even though we can't paint, - // at least view won't freeze until stroke ends + /* XXX: force a redraw here, since even though we can't paint, + * at least view won't freeze until stroke ends */ ED_region_tag_redraw(CTX_wm_region(C)); return; } @@ -1407,17 +1988,39 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P /* load projection matrix */ mul_m4_m4m4(mat, ob->obmat, vc->rv3d->persmat); - flip = RNA_boolean_get(itemptr, "pen_flip"); pressure = RNA_float_get(itemptr, "pressure"); RNA_float_get_array(itemptr, "mouse", mval); mval[0]-= vc->ar->winrct.xmin; mval[1]-= vc->ar->winrct.ymin; - + + + + /* *** setup WeightPaintInfo - pass onto do_weight_paint_vertex *** */ + wpi.defbase_tot= wpd->defbase_tot; + wpi.defbase_sel= MEM_mallocN(wpi.defbase_tot*sizeof(char), "wpi.defbase_sel"); + wpi.defbase_tot_sel= get_selected_defgroups(ob, wpi.defbase_sel, wpi.defbase_tot); + if(wpi.defbase_tot_sel == 0 && ob->actdef) wpi.defbase_tot_sel = 1; + wpi.defbase_tot_unsel= wpi.defbase_tot - wpi.defbase_tot_sel; + wpi.vgroup_mirror= wpd->vgroup_mirror; + wpi.lock_flags= wpd->lock_flags; + wpi.vgroup_validmap= wpd->vgroup_validmap; + wpi.do_flip= RNA_boolean_get(itemptr, "pen_flip"); + wpi.do_multipaint= (ts->multipaint != 0); + wpi.do_auto_normalize= (ts->auto_normalize != 0); + /* *** done setting up WeightPaintInfo *** */ + + + swap_m4m4(wpd->vc.rv3d->persmat, mat); - + + use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0; + /* which faces are involved */ if(wp->flag & VP_AREA) { + /* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */ + me->editflag &= ~ME_EDIT_VERT_SEL; totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size(brush)); + me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0; } else { indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); @@ -1460,30 +2063,40 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P for(index=0; index<totindex; index++) { if(indexar[index] && indexar[index]<=me->totface) { MFace *mface= me->mface + (indexar[index]-1); - - (me->dvert+mface->v1)->flag= 1; - (me->dvert+mface->v2)->flag= 1; - (me->dvert+mface->v3)->flag= 1; - if(mface->v4) (me->dvert+mface->v4)->flag= 1; + + if(use_vert_sel) { + me->dvert[mface->v1].flag = (me->mvert[mface->v1].flag & SELECT); + me->dvert[mface->v2].flag = (me->mvert[mface->v2].flag & SELECT); + me->dvert[mface->v3].flag = (me->mvert[mface->v3].flag & SELECT); + if(mface->v4) me->dvert[mface->v4].flag = (me->mvert[mface->v4].flag & SELECT); + } + else { + me->dvert[mface->v1].flag= 1; + me->dvert[mface->v2].flag= 1; + me->dvert[mface->v3].flag= 1; + if(mface->v4) me->dvert[mface->v4].flag= 1; + } if(brush->vertexpaint_tool==VP_BLUR) { MDeformWeight *dw, *(*dw_func)(MDeformVert *, const int); + unsigned int fidx= mface->v4 ? 3:2; if(wp->flag & VP_ONLYVGROUP) dw_func= (MDeformWeight *(*)(MDeformVert *, const int))defvert_find_index; else dw_func= defvert_verify_index; - - dw= dw_func(me->dvert+mface->v1, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v2, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v3, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - if(mface->v4) { - dw= dw_func(me->dvert+mface->v4, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - } + + do { + unsigned int vidx= *(&mface->v1 + fidx); + + dw= dw_func(me->dvert+vidx, ob->actdef-1); + if(dw) { + paintweight+= dw->weight; + totw++; + } + + } while (fidx--); + } } } @@ -1494,52 +2107,28 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P for(index=0; index<totindex; index++) { if(indexar[index] && indexar[index]<=me->totface) { - MFace *mface= me->mface + (indexar[index]-1); - - if((me->dvert+mface->v1)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval, pressure); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v1, - alpha, paintweight, flip, wpd->vgroup_mirror, - wpd->vgroup_validmap); - } - (me->dvert+mface->v1)->flag= 0; - } - - if((me->dvert+mface->v2)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval, pressure); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v2, - alpha, paintweight, flip, wpd->vgroup_mirror, - wpd->vgroup_validmap); - } - (me->dvert+mface->v2)->flag= 0; - } - - if((me->dvert+mface->v3)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval, pressure); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v3, - alpha, paintweight, flip, wpd->vgroup_mirror, - wpd->vgroup_validmap); - } - (me->dvert+mface->v3)->flag= 0; - } - - if((me->dvert+mface->v4)->flag) { - if(mface->v4) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval, pressure); + MFace *mf= me->mface + (indexar[index]-1); + unsigned int fidx= mf->v4 ? 3:2;; + do { + unsigned int vidx= *(&mf->v1 + fidx); + + if(me->dvert[vidx].flag) { + alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*vidx, mval, pressure); if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v4, - alpha, paintweight, flip, wpd->vgroup_mirror, - wpd->vgroup_validmap); + do_weight_paint_vertex(wp, ob, &wpi, vidx, alpha, paintweight); } - (me->dvert+mface->v4)->flag= 0; + me->dvert[vidx].flag= 0; } - } + } while (fidx--); } } - + + + /* *** free wpi members */ + MEM_freeN(wpi.defbase_sel); + /* *** dont freeing wpi members */ + + swap_m4m4(vc->rv3d->persmat, mat); DAG_id_tag_update(ob->data, 0); @@ -1559,7 +2148,9 @@ static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke) if (wpd->vgroup_validmap) MEM_freeN(wpd->vgroup_validmap); - + if(wpd->lock_flags) + MEM_freeN(wpd->lock_flags); + MEM_freeN(wpd); } @@ -1633,7 +2224,7 @@ static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op)) Object *obact = CTX_data_active_object(C); wpaint_fill(scene->toolsettings->wpaint, obact, scene->toolsettings->vgroup_weight); - ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views + ED_region_tag_redraw(CTX_wm_region(C)); /* XXX - should redraw all 3D views */ return OPERATOR_FINISHED; } @@ -1645,7 +2236,7 @@ void PAINT_OT_weight_set(wmOperatorType *ot) /* api callbacks */ ot->exec= weight_paint_set_exec; - ot->poll= facemask_paint_poll; + ot->poll= mask_paint_poll; /* it was facemask_paint_poll */ /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1781,12 +2372,12 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent return 1; } -static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, const float mval[2], float pressure, int UNUSED(flip)) +static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, const unsigned int index, const float mval[2], float pressure, int UNUSED(flip)) { ViewContext *vc = &vpd->vc; Brush *brush = paint_brush(&vp->paint); Mesh *me = get_mesh(ob); - MFace *mface= ((MFace*)me->mface) + index; + MFace *mface= &me->mface[index]; unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index; unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index; float alpha; @@ -1971,6 +2562,6 @@ void PAINT_OT_weight_from_bones(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights."); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights"); } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 60d665de94c..5b72e87f95a 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -192,8 +192,8 @@ static void SOUND_OT_open(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH); - RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); - RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono."); + RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory"); + RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono"); } static void SOUND_OT_open_mono(wmOperatorType *ot) @@ -213,8 +213,8 @@ static void SOUND_OT_open_mono(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH); - RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); - RNA_def_boolean(ot->srna, "mono", TRUE, "Mono", "Mixdown the sound to mono."); + RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory"); + RNA_def_boolean(ot->srna, "mono", TRUE, "Mono", "Mixdown the sound to mono"); } /******************** mixdown operator ********************/ @@ -436,7 +436,7 @@ static void mixdown_draw(bContext *C, wmOperator *op) } #endif // WITH_AUDASPACE -void SOUND_OT_mixdown(wmOperatorType *ot) +static void SOUND_OT_mixdown(wmOperatorType *ot) { #ifdef WITH_AUDASPACE static EnumPropertyItem format_items[] = { @@ -496,7 +496,7 @@ void SOUND_OT_mixdown(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH); #ifdef WITH_AUDASPACE - RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy. Important for animation data. The lower the value, the more accurate.", 1, 16777216); + RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy, important for animation data (the lower the value, the more accurate)", 1, 16777216); RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format"); RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec"); RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format"); @@ -569,7 +569,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(G.fileflags & G_AUTOPACK) - BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save"); unpackSound(CTX_data_main(C), op->reports, sound, method); @@ -593,7 +593,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even return OPERATOR_CANCELLED; if(G.fileflags & G_AUTOPACK) - BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save"); unpack_menu(C, "SOUND_OT_unpack", sound->id.name+2, sound->name, "sounds", sound->packedfile); @@ -616,8 +616,8 @@ static void SOUND_OT_unpack(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); - RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Sound Name", "Sound datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack"); + RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Sound Name", "Sound datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */ } /* ******************************************************* */ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 32594e710a4..dc81fb1e8bc 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -1139,7 +1139,7 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) { bAnimContext ac; - ARegion *ar; + /* ARegion *ar; */ /* UNUSED */ short selectmode, column; /* get editor data */ @@ -1147,7 +1147,7 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_CANCELLED; /* get useful pointers from animation context data */ - ar= ac.ar; + /* ar= ac.ar; */ /* UNUSED */ /* select mode is either replace (deselect all, then add) or add/extend */ if (RNA_boolean_get(op->ptr, "extend")) diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt index 631e2adea34..a9aaf6a6d58 100644 --- a/source/blender/editors/space_buttons/CMakeLists.txt +++ b/source/blender/editors/space_buttons/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript index a4270f1f59a..740353bc1f0 100644 --- a/source/blender/editors/space_buttons/SConscript +++ b/source/blender/editors/space_buttons/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna ../../render/extern/include ../../blenloader' diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index e631718b0cb..b18b5373240 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -37,6 +37,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" #include "BKE_context.h" @@ -124,24 +125,23 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) #define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \ if(sbuts->pathflag & (1<<_ctx)) { \ - but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, _tip); \ + but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, UI_translate_do_tooltip(_tip)); \ uiButClearFlag(but, UI_BUT_UNDO); \ } \ - - BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, "Render") - BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, "Scene"); - BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, "World"); - BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, "Object"); - BUTTON_HEADER_CTX(BCONTEXT_CONSTRAINT, ICON_CONSTRAINT, "Object Constraints"); - BUTTON_HEADER_CTX(BCONTEXT_MODIFIER, ICON_MODIFIER, "Object Modifiers"); - BUTTON_HEADER_CTX(BCONTEXT_DATA, sbuts->dataicon, "Object Data"); - BUTTON_HEADER_CTX(BCONTEXT_BONE, ICON_BONE_DATA, "Bone"); - BUTTON_HEADER_CTX(BCONTEXT_BONE_CONSTRAINT, ICON_CONSTRAINT_BONE, "Bone Constraints"); - BUTTON_HEADER_CTX(BCONTEXT_MATERIAL, ICON_MATERIAL, "Material"); - BUTTON_HEADER_CTX(BCONTEXT_TEXTURE, ICON_TEXTURE, "Textures"); - BUTTON_HEADER_CTX(BCONTEXT_PARTICLE, ICON_PARTICLES, "Particles"); - BUTTON_HEADER_CTX(BCONTEXT_PHYSICS, ICON_PHYSICS, "Physics"); + BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, N_("Render")) + BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, N_("Scene")); + BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, N_("World")); + BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, N_("Object")); + BUTTON_HEADER_CTX(BCONTEXT_CONSTRAINT, ICON_CONSTRAINT, N_("Object Constraints")); + BUTTON_HEADER_CTX(BCONTEXT_MODIFIER, ICON_MODIFIER, N_("Object Modifiers")); + BUTTON_HEADER_CTX(BCONTEXT_DATA, sbuts->dataicon, N_("Object Data")); + BUTTON_HEADER_CTX(BCONTEXT_BONE, ICON_BONE_DATA, N_("Bone")); + BUTTON_HEADER_CTX(BCONTEXT_BONE_CONSTRAINT, ICON_CONSTRAINT_BONE, N_("Bone Constraints")); + BUTTON_HEADER_CTX(BCONTEXT_MATERIAL, ICON_MATERIAL, N_("Material")); + BUTTON_HEADER_CTX(BCONTEXT_TEXTURE, ICON_TEXTURE, N_("Textures")); + BUTTON_HEADER_CTX(BCONTEXT_PARTICLE, ICON_PARTICLES, N_("Particles")); + BUTTON_HEADER_CTX(BCONTEXT_PHYSICS, ICON_PHYSICS, N_("Physics")); #undef BUTTON_HEADER_CTX diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 85cf30dfeba..cb2b5c47ff3 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -54,6 +54,14 @@ #include "console_intern.h" +/* so when we type - the view scrolls to the bottom */ +static void console_scroll_bottom(ARegion *ar) +{ + View2D *v2d= &ar->v2d; + v2d->cur.ymin = 0.0; + v2d->cur.ymax =(float)v2d->winy; +} + static void console_textview_update_rect(SpaceConsole *sc, ARegion *ar) { View2D *v2d= &ar->v2d; @@ -339,9 +347,14 @@ static int move_exec(bContext *C, wmOperator *op) } if(done) { - ED_area_tag_redraw(CTX_wm_area(C)); + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + + ED_area_tag_redraw(sa); + console_scroll_bottom(ar); } - + + return OPERATOR_FINISHED; } @@ -357,7 +370,7 @@ void CONSOLE_OT_move(wmOperatorType *ot) ot->poll= ED_operator_console_active; /* properties */ - RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to."); + RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to"); } #define TAB_LENGTH 4 @@ -391,7 +404,9 @@ static int insert_exec(bContext *C, wmOperator *op) console_textview_update_rect(sc, ar); ED_area_tag_redraw(CTX_wm_area(C)); - + + console_scroll_bottom(ar); + return OPERATOR_FINISHED; } @@ -427,7 +442,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot) ot->poll= ED_operator_console_active; /* properties */ - RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); + RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position"); } @@ -478,6 +493,8 @@ static int delete_exec(bContext *C, wmOperator *op) console_textview_update_rect(sc, ar); ED_area_tag_redraw(CTX_wm_area(C)); + + console_scroll_bottom(ar); return OPERATOR_FINISHED; } @@ -495,7 +512,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot) ot->poll= ED_operator_console_active; /* properties */ - RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete."); + RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete"); } @@ -589,6 +606,8 @@ static int history_cycle_exec(bContext *C, wmOperator *op) console_textview_update_rect(sc, ar); ED_area_tag_redraw(CTX_wm_area(C)); + console_scroll_bottom(ar); + return OPERATOR_FINISHED; } @@ -612,6 +631,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot) static int history_append_exec(bContext *C, wmOperator *op) { SpaceConsole *sc= CTX_wm_space_console(C); + ARegion *ar= CTX_wm_region(C); ScrArea *sa= CTX_wm_area(C); ConsoleLine *ci= console_history_verify(C); char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */ @@ -637,6 +657,8 @@ static int history_append_exec(bContext *C, wmOperator *op) ED_area_tag_redraw(sa); + console_scroll_bottom(ar); + return OPERATOR_FINISHED; } @@ -652,8 +674,8 @@ void CONSOLE_OT_history_append(wmOperatorType *ot) ot->poll= ED_operator_console_active; /* properties */ - RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); - RNA_def_int(ot->srna, "current_character", 0, 0, INT_MAX, "Cursor", "The index of the cursor.", 0, 10000); + RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position"); + RNA_def_int(ot->srna, "current_character", 0, 0, INT_MAX, "Cursor", "The index of the cursor", 0, 10000); RNA_def_boolean(ot->srna, "remove_duplicates", 0, "Remove Duplicates", "Remove duplicate items in the history"); } @@ -706,8 +728,8 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot) ot->poll= ED_operator_console_active; /* properties */ - RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); - RNA_def_enum(ot->srna, "type", console_line_type_items, CONSOLE_LINE_OUTPUT, "Type", "Console output type."); + RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position"); + RNA_def_enum(ot->srna, "type", console_line_type_items, CONSOLE_LINE_OUTPUT, "Type", "Console output type"); } @@ -825,6 +847,8 @@ static int paste_exec(bContext *C, wmOperator *UNUSED(op)) console_textview_update_rect(sc, ar); ED_area_tag_redraw(CTX_wm_area(C)); + console_scroll_bottom(ar); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index c8fa049f5eb..5a965fc076b 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -138,8 +138,17 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar) wmKeyMap *keymap; ListBase *lb; + const int prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */ + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); + /* always keep the bottom part of the view aligned, less annoying */ + if(prev_y_min != ar->v2d.cur.ymin) { + const float cur_y_range= ar->v2d.cur.ymax - ar->v2d.cur.ymin; + ar->v2d.cur.ymin= prev_y_min; + ar->v2d.cur.ymax= prev_y_min + cur_y_range; + } + /* own keymap */ keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 0080317aece..b2b734159ff 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -50,6 +50,7 @@ #include "BKE_main.h" #include "BLF_api.h" +#include "BLF_translation.h" #include "IMB_imbuf_types.h" @@ -181,7 +182,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "", min_x, line1_y, line1_w-chan_offs, btn_h, params->dir, 0.0, (float)FILE_MAX-1, 0, 0, - "File path."); + UI_translate_do_tooltip(N_("File path"))); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -189,7 +190,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefBut(block, TEX, B_FS_FILENAME, "", min_x, line2_y, line2_w-chan_offs, btn_h, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, - overwrite_alert ?"File name, overwrite existing." : "File name."); + UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); uiButSetCompleteFunc(but, autocomplete_file, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -209,13 +210,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT, min_x + line2_w + separator - chan_offs, line2_y, btn_fn_w, btn_h, - "Decrement the filename number"); + UI_translate_do_tooltip(N_("Decrement the filename number"))); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, btn_fn_w, btn_h, - "Increment the filename number"); + UI_translate_do_tooltip(N_("Increment the filename number"))); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); uiBlockEndAlign(block); } @@ -226,9 +227,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar) uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title, max_x - loadbutton, line1_y, loadbutton, btn_h, params->title); - uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, "Cancel", + uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, UI_translate_do_iface(N_("Cancel")), max_x - loadbutton, line2_y, loadbutton, btn_h, - "Cancel"); + UI_translate_do_tooltip(N_("Cancel"))); } uiEndBlock(C, block); @@ -295,7 +296,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, static void file_draw_string(int sx, int sy, const char* string, float width, int height, short align) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiFontStyle fs = style->widgetlabel; rcti rect; char fname[FILE_MAXFILE]; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 43d5a5c9b4b..e61d7693d19 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -357,8 +357,8 @@ void FILE_OT_select(wmOperatorType *ot) ot->poll= ED_operator_file_active; /* rna */ - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection."); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); + RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection"); } static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op)) @@ -770,7 +770,7 @@ void FILE_OT_execute(struct wmOperatorType *ot) ot->exec= file_exec; ot->poll= file_operator_poll; - RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list."); + RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list"); } @@ -980,7 +980,7 @@ void FILE_OT_smoothscroll(wmOperatorType *ot) /* identifiers */ ot->name= "Smooth Scroll"; ot->idname= "FILE_OT_smoothscroll"; - ot->description="Smooth scroll to make editable file visible."; + ot->description="Smooth scroll to make editable file visible"; /* api callbacks */ ot->invoke= file_smoothscroll_invoke; @@ -1020,7 +1020,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) SpaceFile *sfile= CTX_wm_space_file(C); if(!sfile->params) { - BKE_report(op->reports,RPT_WARNING, "No parent directory given."); + BKE_report(op->reports,RPT_WARNING, "No parent directory given"); return OPERATOR_CANCELLED; } @@ -1034,7 +1034,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) if (generate_name) { /* create a new, non-existing folder name */ if (!new_folder_path(sfile->params->dir, path, name)) { - BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name."); + BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name"); return OPERATOR_CANCELLED; } } @@ -1043,7 +1043,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) BLI_recurdir_fileops(path); if (!BLI_exists(path)) { - BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder."); + BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 959b1ddf1b5..37dce293d77 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -37,6 +37,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_userdef_types.h" @@ -144,7 +146,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa) if(sfile) { row= uiLayoutRow(pa->layout, 0); - uiItemO(row, "Add", ICON_ZOOMIN, "file.bookmark_add"); + uiItemO(row, UI_translate_do_iface(N_("Add")), ICON_ZOOMIN, "file.bookmark_add"); uiItemL(row, NULL, ICON_NONE); file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 6773dfb6b2d..1e113abfcd2 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -376,7 +376,7 @@ float file_shorten_string(char* string, float w, int front) shortened = 1; } if (shortened) { - int slen = strlen(s); + int slen = strlen(s); BLI_strncpy(temp+3, s, slen+1); temp[slen+4] = '\0'; BLI_strncpy(string, temp, slen+4); @@ -393,7 +393,7 @@ float file_shorten_string(char* string, float w, int front) if (shortened) { int slen = strlen(string); if (slen > 3) { - BLI_strncpy(string+slen-3, "...", 4); + BLI_strncpy(string+slen-3, "...", 4); } } } @@ -403,7 +403,7 @@ float file_shorten_string(char* string, float w, int front) float file_string_width(const char* str) { - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiStyleFontSet(&style->widget); return BLF_width(style->widget.uifont_id, str); } @@ -413,12 +413,12 @@ float file_font_pointsize(void) #if 0 float s; char tmp[2] = "X"; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiStyleFontSet(&style->widget); s = BLF_height(style->widget.uifont_id, tmp); return style->widget.points; #else - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); uiStyleFontSet(&style->widget); return style->widget.points * UI_DPI_FAC; #endif diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt index 80205ad5564..28383b29b36 100644 --- a/source/blender/editors/space_graph/CMakeLists.txt +++ b/source/blender/editors/space_graph/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/space_graph/SConscript b/source/blender/editors/space_graph/SConscript index 75d0927192b..fe8846d2c30 100644 --- a/source/blender/editors/space_graph/SConscript +++ b/source/blender/editors/space_graph/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' #/intern/audaspace/intern ../../blenloader' diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f3a70c496ef..28fd1cd3304 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -46,6 +46,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_fcurve.h" @@ -673,7 +675,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* remove button */ uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable."); + but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable"); uiButSetFunc(but, driver_delete_var_cb, driver, dvar); uiBlockSetEmboss(block, UI_EMBOSS); @@ -750,7 +752,8 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) block= uiLayoutGetBlock(row); // XXX for now, this will be a operator button which calls a 'add modifier' operator - uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); + uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20, + UI_translate_do_tooltip(N_("Adds a new F-Curve Modifier for the active F-Curve"))); /* copy/paste (as sub-row)*/ row= uiLayoutRow(row, 1); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index f115fd93c2e..90bfadd0b5a 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1677,13 +1677,13 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op) /* updates + finishing warnings */ if (failed == groups) { BKE_report(op->reports, RPT_ERROR, - "No Euler Rotations could be corrected. Ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected."); + "No Euler Rotations could be corrected, ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected"); return OPERATOR_CANCELLED; } else { if (failed) { BKE_report(op->reports, RPT_ERROR, - "Some Euler Rotations couldn't be corrected due to missing/unselected/out-of-order F-Curves. Ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected."); + "Some Euler Rotations couldn't be corrected due to missing/unselected/out-of-order F-Curves, ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected"); } /* validate keyframes after editing */ @@ -2134,7 +2134,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) if (fcm) set_active_fmodifier(&fcu->modifiers, fcm); else { - BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added. See console for details."); + BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added, see console for details"); break; } } @@ -2167,7 +2167,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) /* id-props */ ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", ""); - RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve."); + RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve"); } /* ******************** Copy F-Modifiers Operator *********************** */ @@ -2213,7 +2213,7 @@ void GRAPH_OT_fmodifier_copy (wmOperatorType *ot) /* identifiers */ ot->name= "Copy F-Modifiers"; ot->idname= "GRAPH_OT_fmodifier_copy"; - ot->description= "Copy the F-Modifier(s) of the active F-Curve."; + ot->description= "Copy the F-Modifier(s) of the active F-Curve"; /* api callbacks */ ot->exec= graph_fmodifier_copy_exec; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 4011f038be8..71d9dd3adcb 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -510,7 +510,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) else { ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v); if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { - // XXX error("Can't pack painted image. Save image or use Repack as PNG."); + // XXX error("Can't pack painted image. Save image or use Repack as PNG"); } else { ima->packedfile = newPackedFile(NULL, ima->name); /* XXX report errors */ ED_undo_push(C, "Pack image"); @@ -587,7 +587,7 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, if(rr==NULL || iuser==NULL) return; if(rr->layers.first==NULL) { - uiItemL(row, "No Layers in Render Result.", ICON_NONE); + uiItemL(row, "No Layers in Render Result", ICON_NONE); return; } @@ -784,7 +784,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); if(ima->anim) { block= uiLayoutGetBlock(col); - but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence."); + but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence"); uiButSetFunc(but, set_frames_cb, ima, iuser); } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 68f9e4d033e..45bd1d58a53 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -303,7 +303,7 @@ void IMAGE_OT_view_pan(wmOperatorType *ot) /* properties */ RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, - "Offset", "Offset in floating point units, 1.0 is the width and height of the image.", -FLT_MAX, FLT_MAX); + "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX); } /********************** view zoom operator *********************/ @@ -434,7 +434,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, - "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", -FLT_MAX, FLT_MAX); + "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX); } /********************** NDOF operator *********************/ @@ -696,7 +696,7 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX, - "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX); + "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX); } /**************** load/replace/save callbacks ******************/ @@ -777,7 +777,7 @@ static int open_exec(bContext *C, wmOperator *op) if(!ima) { if(op->customdata) MEM_freeN(op->customdata); - BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported image format"); + BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", str, errno ? strerror(errno) : "Unsupported image format"); return OPERATOR_CANCELLED; } @@ -1208,7 +1208,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot) /* properties */ /* format options */ - RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, "File Type", "File type to save image as."); + RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, "File Type", "File type to save image as"); RNA_def_enum(ot->srna, "color_mode", image_color_mode_items, R_PLANES24, "Channels", "Image channels to save"); prop= RNA_def_int(ot->srna, "file_quality", 90, 0, 100, "Quality", "", 0, 100); RNA_def_property_subtype(prop, PROP_PERCENTAGE); @@ -1234,7 +1234,7 @@ static int save_exec(bContext *C, wmOperator *op) save_image_doit(C, sima, op, &simopts, FALSE); } else { - BKE_reportf(op->reports, RPT_ERROR, "Can not save image, path '%s' is not writable.", simopts.filepath); + BKE_reportf(op->reports, RPT_ERROR, "Can not save image, path '%s' is not writable", simopts.filepath); return OPERATOR_CANCELLED; } @@ -1269,12 +1269,12 @@ static int save_sequence_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(sima->image->source!=IMA_SRC_SEQUENCE) { - BKE_report(op->reports, RPT_ERROR, "Can only save sequence on image sequences."); + BKE_report(op->reports, RPT_ERROR, "Can only save sequence on image sequences"); return OPERATOR_CANCELLED; } if(sima->image->type==IMA_TYPE_MULTILAYER) { - BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences."); + BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences"); return OPERATOR_CANCELLED; } @@ -1284,7 +1284,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) tot++; if(tot==0) { - BKE_report(op->reports, RPT_WARNING, "No images have been changed."); + BKE_report(op->reports, RPT_WARNING, "No images have been changed"); return OPERATOR_CANCELLED; } @@ -1306,7 +1306,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) BLI_path_abs(name, bmain->name); if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { - BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s.", name); + BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s", name); break; } @@ -1450,14 +1450,14 @@ void IMAGE_OT_new(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME-2, "Name", "Image datablock name."); - RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width.", 1, 16384); - RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height.", 1, 16384); - prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color.", 0.0f, 1.0f); + RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME-2, "Name", "Image datablock name"); + RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384); + RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384); + prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f); RNA_def_property_float_array_default(prop, default_color); - RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel."); - RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing."); - RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth."); + RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel"); + RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing"); + RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth"); } /********************* invert operators *********************/ @@ -1558,7 +1558,7 @@ static int pack_test(bContext *C, wmOperator *op) return 0; if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { - BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not supported."); + BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not supported"); return 0; } @@ -1575,7 +1575,7 @@ static int pack_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) { - BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG."); + BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG"); return OPERATOR_CANCELLED; } @@ -1627,7 +1627,7 @@ void IMAGE_OT_pack(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG."); + RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG"); } /********************* unpack operator *********************/ @@ -1649,12 +1649,12 @@ static int image_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { - BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported."); + BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported"); return OPERATOR_CANCELLED; } if(G.fileflags & G_AUTOPACK) - BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save"); /* XXX unpackImage frees image buffers */ ED_preview_kill_jobs(C); @@ -1677,12 +1677,12 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even return OPERATOR_CANCELLED; if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { - BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported."); + BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported"); return OPERATOR_CANCELLED; } if(G.fileflags & G_AUTOPACK) - BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save"); unpack_menu(C, "IMAGE_OT_unpack", ima->id.name+2, ima->name, "textures", ima->packedfile); @@ -1704,8 +1704,8 @@ void IMAGE_OT_unpack(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); - RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack"); + RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */ } /******************** sample image operator ********************/ @@ -2049,7 +2049,7 @@ void IMAGE_OT_curves_point_set(wmOperatorType *ot) ot->poll= space_image_main_area_poll; /* properties */ - RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves."); + RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves"); } /******************** record composite operator *********************/ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index afab4ede229..e345caf1359 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -595,7 +595,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa)) tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */ - if(tf && (tf->mode & TF_TEX)) { + if(tf) { /* don't need to check for pin here, see above */ sima->image= tf->tpage; diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index e09565d38e9..6c5a6f78e90 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -151,7 +151,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) count = countPackedFiles(bmain); if(!count) { - BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled."); + BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled"); G.fileflags &= ~G_AUTOPACK; return OPERATOR_CANCELLED; } @@ -186,7 +186,7 @@ void FILE_OT_unpack_all(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack."); + RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack"); } /********************* make paths relative operator *********************/ @@ -196,7 +196,7 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); if(!G.relbase_valid) { - BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file."); + BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file"); return OPERATOR_CANCELLED; } @@ -228,7 +228,7 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); if(!G.relbase_valid) { - BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file."); + BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index c8bda434227..d0a80cddf56 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -160,7 +160,7 @@ void INFO_OT_select_pick(wmOperatorType *ot) /* ot->flag= OPTYPE_REGISTER; */ /* properties */ - RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report.", 0, INT_MAX); + RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report", 0, INT_MAX); } diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index bd2e8077eab..75e13b24ede 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -41,6 +41,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_screen.h" @@ -278,7 +280,7 @@ static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); } } else { - uiItemL(layout, "No Recent Files", ICON_NONE); + uiItemL(layout, UI_translate_do_iface(N_("No Recent Files")), ICON_NONE); } } diff --git a/source/blender/editors/space_logic/CMakeLists.txt b/source/blender/editors/space_logic/CMakeLists.txt index 44471902040..c4f9f49c9a1 100644 --- a/source/blender/editors/space_logic/CMakeLists.txt +++ b/source/blender/editors/space_logic/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../interface + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 60e9595b77a..b7f9af09348 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -43,6 +43,7 @@ #include "BKE_context.h" #include "BKE_main.h" #include "BKE_sca.h" +#include "BKE_material.h" //for texface convert #include "ED_logic.h" #include "ED_object.h" @@ -57,6 +58,11 @@ #include "logic_intern.h" +// temporary new includes for texface functions +#include "DNA_mesh_types.h" +#include "DNA_material_types.h" +#include "DNA_meshdata_types.h" + /* ************* Generic Operator Helpers ************* */ static int edit_sensor_poll(bContext *C) { @@ -687,6 +693,36 @@ static void LOGIC_OT_actuator_move(wmOperatorType *ot) RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down"); } +/* ************* TexFace Converter Operator ************* */ +static int texface_convert_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Main *bmain= CTX_data_main(C); + do_version_tface(bmain, 0); + + return OPERATOR_FINISHED; +} + +static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +{ + return texface_convert_exec(C, op); +} + + static void LOGIC_OT_texface_convert(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "TexFace to Material Converter"; + ot->description = "Convert old texface settings into material. It may create new materials if needed"; + ot->idname= "LOGIC_OT_texface_convert"; + + /* api callbacks */ + ot->invoke= texface_convert_invoke; + ot->exec= texface_convert_exec; +// ot->poll= texface_convert_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + void ED_operatortypes_logic(void) { @@ -699,4 +735,5 @@ void ED_operatortypes_logic(void) WM_operatortype_append(LOGIC_OT_actuator_remove); WM_operatortype_append(LOGIC_OT_actuator_add); WM_operatortype_append(LOGIC_OT_actuator_move); + WM_operatortype_append(LOGIC_OT_texface_convert); } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 43a8747e942..3a4371e8bb9 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -2169,31 +2169,55 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo /* reset this value, it is for handling the event */ sa->sndnr = 0; uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, ""); - uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file. Remember to set caching on for small sounds that are played often."); + uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, + "Load a sound file (remember to set caching on for small sounds that are played often)"); if(sa->sound) { - char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; - uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, ""); - uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound"); - uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound"); - uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space."); + char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|" + "Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; + uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, + ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, ""); + uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, + &sa->type, 0.0, 0.0, 0, 0, ""); + uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, + 0.0, 1.0, 0, 0, "Sets the volume of this sound"); + uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, + 12.0, 0, 0, "Sets the pitch of this sound"); + uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, + &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space"); if(sa->flag & ACT_SND_3D_SOUND) { - uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away."); - uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is."); - uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); - uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0, "The maximum distance at which you can hear the sound."); - uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance."); - uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value and the normal gain in the inner cone."); - uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone."); - uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone."); + uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, + &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, + "The minimum gain of the sound, no matter how far it is away"); + uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, + &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, + "The maximum gain of the sound, no matter how near it is"); + uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, + &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0, + "The reference distance is the distance where the sound has a gain of 1.0"); + uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, + &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0, + "The maximum distance at which you can hear the sound"); + uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, + &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, + "The rolloff factor defines the influence factor on volume depending on distance"); + uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, + &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, + "The gain outside the outer cone. The gain in the outer cone will be " + "interpolated between this value and the normal gain in the inner cone"); + uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, + 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, + "The angle of the outer cone"); + uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, + 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, + "The angle of the inner cone"); } } MEM_freeN((void *)str); } else { - uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file."); + uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file"); } yco-= ysize; @@ -4524,7 +4548,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* ****************** Controllers ****************** */ xco= 420; yco= 170; width= 300; - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle()); row = uiLayoutRow(layout, 1); uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */ @@ -4627,7 +4651,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* ****************** Sensors ****************** */ xco= 10; yco= 170; width= 340; - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle()); row = uiLayoutRow(layout, 1); uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */ @@ -4693,7 +4717,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* ****************** Actuators ****************** */ xco= 800; yco= 170; width= 340; - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle()); row = uiLayoutRow(layout, 1); uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */ diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt index b05d157365d..819e80d7b2e 100644 --- a/source/blender/editors/space_nla/CMakeLists.txt +++ b/source/blender/editors/space_nla/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript index 51ce829ed8d..6738f3380b4 100644 --- a/source/blender/editors/space_nla/SConscript +++ b/source/blender/editors/space_nla/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), [], libtype=['core'], priority=[85] ) diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 87c8a6d39a6..d51a6a4c9a9 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -45,6 +45,8 @@ #include "BLI_editVert.h" #include "BLI_rand.h" +#include "BLF_translation.h" + #include "BKE_nla.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -447,7 +449,8 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) - uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Modifier for the active NLA Strip"); + uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20, + UI_translate_do_tooltip(N_("Adds a new F-Modifier for the active NLA Strip"))); /* copy/paste (as sub-row)*/ row= uiLayoutRow(row, 1); diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 80691aceb6a..7cbe5058190 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -431,7 +431,7 @@ void NLA_OT_tracks_add (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one."); + RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one"); } /* ******************** Delete Tracks Operator ***************************** */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 08026e8a1d2..d7dfea0b7e7 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -147,7 +147,7 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL); } else { - BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on."); + BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on"); return OPERATOR_CANCELLED; } @@ -398,7 +398,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) act= BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); if (act == NULL) { - BKE_report(op->reports, RPT_ERROR, "No valid Action to add."); + BKE_report(op->reports, RPT_ERROR, "No valid Action to add"); //printf("Add strip - actname = '%s' \n", actname); return OPERATOR_CANCELLED; } @@ -416,7 +416,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) items= ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); if (items == 0) { - BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to."); + BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to"); return OPERATOR_CANCELLED; } @@ -590,7 +590,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } else { - BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips with a gap between them."); + BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips with a gap between them"); return OPERATOR_CANCELLED; } } @@ -1315,7 +1315,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op) if (strip) { /* too many selected warning */ BKE_reportf(op->reports, RPT_WARNING, - "Too many clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.", + "Too many clusters of strips selected in NLA Track (%s): needs exactly 2 to be selected", nlt->name); } else if (sa == NULL) { @@ -1324,7 +1324,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op) else if (sb == NULL) { /* too few selected warning */ BKE_reportf(op->reports, RPT_WARNING, - "Too few clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.", + "Too few clusters of strips selected in NLA Track (%s): needs exactly 2 to be selected", nlt->name); } else { @@ -1619,7 +1619,7 @@ void NLA_OT_action_sync_length (wmOperatorType *ot) /* identifiers */ ot->name= "Sync Action Length"; ot->idname= "NLA_OT_action_sync_length"; - ot->description= "Synchronise the length of the referenced Action with the lengths used in the strip"; + ot->description= "Synchronise the length of the referenced Action with the length used in the strip"; /* api callbacks */ ot->exec= nlaedit_sync_actlen_exec; @@ -1629,7 +1629,7 @@ void NLA_OT_action_sync_length (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip."); + ot->prop= RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip"); } /* ******************** Apply Scale Operator ***************************** */ @@ -2021,7 +2021,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) set_active_fmodifier(&strip->modifiers, fcm); else { BKE_reportf(op->reports, RPT_ERROR, - "Modifier couldn't be added to (%s : %s). See console for details.", + "Modifier couldn't be added to (%s : %s) (see console for details)", nlt->name, strip->name); } } @@ -2042,7 +2042,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot) /* identifiers */ ot->name= "Add F-Modifier"; ot->idname= "NLA_OT_fmodifier_add"; - ot->description= "Add F-Modifier of the specified type to the selected NLA-Strips"; + ot->description= "Add a F-Modifier of the specified type to the selected NLA-Strips"; /* api callbacks */ ot->invoke= nla_fmodifier_add_invoke; @@ -2054,7 +2054,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot) /* id-props */ ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", ""); - RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip."); + RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add a F-Modifier of the specified type to the active strip"); } /* ******************** Copy F-Modifiers Operator *********************** */ diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index e9b45da6bce..05d38a63109 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -479,7 +479,7 @@ void NLA_OT_select_leftright (wmOperatorType *ot) /* identifiers */ ot->name= "Select Left/Right"; ot->idname= "NLA_OT_select_leftright"; - ot->description= "Select strips to the left or the right of the current frame "; + ot->description= "Select strips to the left or the right of the current frame"; /* api callbacks */ ot->invoke= nlaedit_select_leftright_invoke; @@ -606,8 +606,8 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2], static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) { bAnimContext ac; - Scene *scene; - ARegion *ar; + /* Scene *scene; */ /* UNUSED */ + /* ARegion *ar; */ /* UNUSED */ // View2D *v2d; /*UNUSED*/ short selectmode; @@ -616,8 +616,8 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_CANCELLED; /* get useful pointers from animation context data */ - scene= ac.scene; - ar= ac.ar; + /* scene= ac.scene; */ /* UNUSED */ + /* ar= ac.ar; */ /* UNUSED */ // v2d= &ar->v2d; /* select mode is either replace (deselect all, then add) or add/extend */ diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index cd521f7e8c7..f34cef4d2aa 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -179,6 +179,7 @@ static void node_socket_button_color(const bContext *C, uiBlock *block, /* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */ +#if 0 /* UNUSED */ static void node_draw_socket_new(bNodeSocket *sock, float size) { float x=sock->locx, y=sock->locy; @@ -216,6 +217,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size) glDisable( GL_LINE_SMOOTH ); glDisable(GL_BLEND); } +#endif /* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ @@ -894,14 +896,14 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) Main *bmain= CTX_data_main(C); bNodeTree *ntree= ntree_v; bNode *node= node_v; - ID *oldid; + /* ID *oldid; */ /* UNUSED */ if(node->menunr<1) return; if(node->id) { node->id->us--; } - oldid= node->id; + /* oldid= node->id; */ /* UNUSED */ node->id= BLI_findlink(&bmain->text, node->menunr-1); id_us_plus(node->id); BLI_strncpy(node->name, node->id->name+2, sizeof(node->name)); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index c1b114d5436..e713ed5a678 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -303,7 +303,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); layout= uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, - locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, U.uistyles.first); + locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, UI_GetStyle()); node->typeinfo->uifunc(layout, (bContext *)C, &ptr); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 5f58f540aae..7cb8351cd12 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -757,6 +757,8 @@ void ED_node_update_hierarchy(bContext *UNUSED(C), bNodeTree *ntree) /* ***************** generic operator functions for nodes ***************** */ +#if 0 /* UNUSED */ + static int edit_node_poll(bContext *C) { return ED_operator_node_active(C); @@ -815,6 +817,7 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r if (rin_out) *rin_out = in_out; } +#endif /* ***************** Edit Group operator ************* */ @@ -902,7 +905,7 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op) char name[32]= ""; int type= SOCK_FLOAT; bNodeTree *ngroup= snode->edittree; - bNodeSocket *sock; + /* bNodeSocket *sock; */ /* UNUSED */ ED_preview_kill_jobs(C); @@ -918,7 +921,7 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* using placeholder subtype first */ - sock = node_group_add_socket(ngroup, name, type, in_out); + /* sock = */ /* UNUSED */ node_group_add_socket(ngroup, name, type, in_out); ntreeUpdateTree(ngroup); @@ -983,7 +986,7 @@ void NODE_OT_group_socket_remove(wmOperatorType *ot) { /* identifiers */ ot->name = "Remove Group Socket"; - ot->description = "Removed node group socket"; + ot->description = "Remove a node group socket"; ot->idname = "NODE_OT_group_socket_remove"; /* api callbacks */ @@ -3462,7 +3465,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) ima= BKE_add_image_file(path); if(!ima) { - BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", path, errno ? strerror(errno) : "Unsupported image format"); + BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", path, errno ? strerror(errno) : "Unsupported image format"); return OPERATOR_CANCELLED; } } @@ -3473,7 +3476,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) ima= (Image *)find_id("IM", name); if(!ima) { - BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found.", name); + BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name); return OPERATOR_CANCELLED; } } @@ -3491,7 +3494,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) node = node_add_node(snode, bmain, scene, &ntemp, snode->mx, snode->my); if (!node) { - BKE_report(op->reports, RPT_WARNING, "Could not add an image node."); + BKE_report(op->reports, RPT_WARNING, "Could not add an image node"); return OPERATOR_CANCELLED; } @@ -3534,7 +3537,7 @@ void NODE_OT_add_file(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign."); + RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign"); } /********************** New node tree operator *********************/ diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 7077f4a7497..996e05afdef 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -44,6 +44,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_screen.h" @@ -216,6 +218,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) } } +#define IFACE_(msgid) UI_translate_do_iface(msgid) static void node_menu_add(const bContext *C, Menu *menu) { SpaceNode *snode= CTX_wm_space_node(C); @@ -225,39 +228,40 @@ static void node_menu_add(const bContext *C, Menu *menu) uiLayoutSetActive(layout, 0); if(snode->treetype==NTREE_SHADER) { - uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); - uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, "Dynamic", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC)); - uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_(N_("Dynamic")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC)); + uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } else if(snode->treetype==NTREE_COMPOSIT) { - uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); - uiItemMenuF(layout, "Filter", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER)); - uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, "Matte", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE)); - uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); - uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, IFACE_(N_("Filter")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER)); + uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_(N_("Matte")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE)); + uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } else if(snode->treetype==NTREE_TEXTURE) { - uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, "Patterns", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN)); - uiItemMenuF(layout, "Textures", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE)); - uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); - uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_(N_("Patterns")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN)); + uiItemMenuF(layout, IFACE_(N_("Textures")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE)); + uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } } +#undef IFACE_ void node_menus_register(void) { diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 3d8b1676ea5..e2b0b9c65d0 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -109,7 +109,7 @@ static int node_select_exec(bContext *C, wmOperator *op) ARegion *ar= CTX_wm_region(C); int mval[2]; short extend; - bNode *node= NULL; + /* bNode *node= NULL; */ /* UNUSED */ /* get settings from RNA properties for operator */ mval[0] = RNA_int_get(op->ptr, "mouse_x"); @@ -118,7 +118,7 @@ static int node_select_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); /* perform the select */ - node= node_mouse_select(bmain, snode, ar, mval, extend); + /* node= */ /* UNUSED*/ node_mouse_select(bmain, snode, ar, mval, extend); /* send notifiers */ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL); @@ -141,7 +141,7 @@ void NODE_OT_select(wmOperatorType *ot) /* identifiers */ ot->name= "Select"; ot->idname= "NODE_OT_select"; - ot->description= "Select node under cursor"; + ot->description= "Select the node under the cursor"; /* api callbacks */ ot->invoke= node_select_invoke; @@ -379,7 +379,7 @@ void NODE_OT_select_same_type(wmOperatorType *ot) { /* identifiers */ ot->name = "Select Same Type"; - ot->description = "Select all the same type"; + ot->description = "Select all the nodes of the same type"; ot->idname = "NODE_OT_select_same_type"; /* api callbacks */ @@ -409,7 +409,7 @@ void NODE_OT_select_same_type_next(wmOperatorType *ot) { /* identifiers */ ot->name = "Select Same Type Next"; - ot->description = "Select the next node of the same type."; + ot->description = "Select the next node of the same type"; ot->idname = "NODE_OT_select_same_type_next"; /* api callbacks */ @@ -436,7 +436,7 @@ void NODE_OT_select_same_type_prev(wmOperatorType *ot) { /* identifiers */ ot->name = "Select Same Type Prev"; - ot->description = "Select the prev node of the same type."; + ot->description = "Select the prev node of the same type"; ot->idname = "NODE_OT_select_same_type_prev"; /* api callbacks */ diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index c4567bea648..13a5f3cb3dc 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -214,12 +214,11 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot) static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode) { bNode *node; - rctf *cur, *tot; + rctf *cur; float oldwidth, oldheight, width, height; int first= 1; cur= &ar->v2d.cur; - tot= &ar->v2d.tot; oldwidth= cur->xmax - cur->xmin; oldheight= cur->ymax - cur->ymin; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 6172273f7e1..6bfe370d105 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -213,7 +213,7 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot) ot->poll= ED_operator_outliner_active; - RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items"); } /* Rename --------------------------------------------------- */ @@ -669,7 +669,7 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot) ot->poll= ED_operator_outliner_active; /* properties */ - RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page."); + RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page"); } /* Search ------------------------------------------------------- */ @@ -869,7 +869,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot) /* no undo or registry, UI option */ /* properties */ - RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep."); + RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep"); } /* Show Hierarchy ----------------------------------------------- */ @@ -969,7 +969,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle ListBase hierarchy = {NULL, NULL}; LinkData *ld; TreeElement *tem, *temnext, *temsub; - TreeStoreElem *tse, *tsenext; + TreeStoreElem *tse /* , *tsenext */ /* UNUSED */; PointerRNA *ptr, *nextptr; PropertyRNA *prop; char *newpath=NULL; @@ -1018,7 +1018,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle char buf[128], *name; temnext= (TreeElement*)(ld->next->data); - tsenext= TREESTORE(temnext); + /* tsenext= TREESTORE(temnext); */ /* UNUSED */ nextptr= &temnext->rnaptr; name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf)); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index a88625aad0d..42fe14cd59c 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -867,7 +867,7 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot) ot->poll= ED_operator_outliner_active; - RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation."); + RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation"); } /* ****************************************************** */ diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index efbfbd51fb5..78907fbd1ed 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -899,7 +899,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op) act= BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); if (act == NULL) { - BKE_report(op->reports, RPT_ERROR, "No valid Action to add."); + BKE_report(op->reports, RPT_ERROR, "No valid Action to add"); return OPERATOR_CANCELLED; } else if (act->idroot == 0) { diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 0a1f7a3599d..9fe0ed0543f 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1151,7 +1151,7 @@ static int need_add_seq_dup(Sequence *seq) static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index) { - TreeElement *ch; + /* TreeElement *ch; */ /* UNUSED */ Sequence *p; p= seq; @@ -1162,7 +1162,7 @@ static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *t } if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name)) - ch= outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index); + /* ch= */ /* UNUSED */ outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index); p= p->next; } } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 2fe16b3a85d..b390b7dbdb5 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -464,7 +464,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); - RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); + RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory"); } /* add image operator */ @@ -647,7 +647,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) if(seq->plugin==NULL) { BLI_remlink(ed->seqbasep, seq); seq_free_sequence(scene, seq); - BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load.", path); + BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load", path); return OPERATOR_CANCELLED; } } else if (seq->type == SEQ_COLOR) { diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index c3165adaf49..bd93a1270f6 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1161,7 +1161,7 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips"); } @@ -1208,7 +1208,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips"); } @@ -1386,7 +1386,7 @@ void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot) /* identifiers */ ot->name= "Reassign Inputs"; ot->idname= "SEQUENCER_OT_reassign_inputs"; - ot->description="Reassign the inputs for the effects strip"; + ot->description="Reassign the inputs for the effect strip"; /* api callbacks */ ot->exec= sequencer_reassign_inputs_exec; @@ -1422,7 +1422,7 @@ void SEQUENCER_OT_swap_inputs(struct wmOperatorType *ot) /* identifiers */ ot->name= "Swap Inputs"; ot->idname= "SEQUENCER_OT_swap_inputs"; - ot->description="Swap the first two inputs for the effects strip"; + ot->description="Swap the first two inputs for the effect strip"; /* api callbacks */ ot->exec= sequencer_swap_inputs_exec; @@ -1483,9 +1483,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) sort_seq(scene); } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); - - return OPERATOR_FINISHED; + if(changed) { + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); + return OPERATOR_FINISHED; + } + else { + return OPERATOR_CANCELLED; + } } @@ -1801,7 +1805,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot) /* identifiers */ ot->name= "Separate Images"; ot->idname= "SEQUENCER_OT_images_separate"; - ot->description="On image sequences strips, it return a strip for each image"; + ot->description="On image sequence strips, it returns a strip for each image"; /* api callbacks */ ot->exec= sequencer_separate_images_exec; @@ -2154,7 +2158,7 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "ratio", 1.0f, 0.0f, FLT_MAX, - "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX); + "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX); } @@ -2483,7 +2487,7 @@ void SEQUENCER_OT_swap(wmOperatorType *ot) /* identifiers */ ot->name= "Swap Strip"; ot->idname= "SEQUENCER_OT_swap"; - ot->description="Swap active strip with strip to the left"; + ot->description="Swap active strip with strip to the right or left"; /* api callbacks */ ot->exec= sequencer_swap_exec; diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 86b28f5e89e..a6cc65017bb 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -519,11 +519,11 @@ void SEQUENCER_OT_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection."); - RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip."); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); + RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip"); /* for animation this is an enum but atm having an enum isnt useful for us */ - RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "select based on the frame side the cursor is on."); - RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time."); + RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "Select based on the current frame side the cursor is on"); + RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time"); } @@ -627,7 +627,7 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op)) void SEQUENCER_OT_select_less(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select less"; + ot->name= "Select Less"; ot->idname= "SEQUENCER_OT_select_less"; ot->description="Shrink the current selection of adjacent selected strips"; diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 5a0369ef80b..5c2013ee863 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -223,11 +223,11 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) WM_event_remove_handlers((bContext*)C, &ar_preview->handlers); view_changed= 1; } - if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { ar_main->alignment= RGN_ALIGN_NONE; view_changed= 1; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { ar_preview->alignment= RGN_ALIGN_NONE; view_changed= 1; } @@ -245,11 +245,11 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) ar_preview->v2d.cur = ar_preview->v2d.tot; view_changed= 1; } - if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { ar_main->alignment= RGN_ALIGN_NONE; view_changed= 1; } - if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { ar_preview->alignment= RGN_ALIGN_NONE; view_changed= 1; } @@ -266,7 +266,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa) ar_preview->v2d.cur = ar_preview->v2d.tot; view_changed= 1; } - if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { ar_main->alignment= RGN_ALIGN_NONE; view_changed= 1; } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 3d49bc7ffa0..685b15aed50 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1291,7 +1291,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar) TextLine *tmp; char *docs, buf[DOC_WIDTH+1], *p; int i, br, lines; - int boxw, boxh, l, x, y, top; + int boxw, boxh, l, x, y /* , top */ /* UNUSED */; if(!st || !st->text) return; if(!texttool_text_is_active(st->text)) return; @@ -1314,7 +1314,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar) x += SUGG_LIST_WIDTH*st->cwidth + 50; } - top= y= ar->winy - st->lheight*l - 2; + /* top= */ /* UNUSED */ y= ar->winy - st->lheight*l - 2; boxw= DOC_WIDTH*st->cwidth + 20; boxh= (DOC_HEIGHT+1)*st->lheight; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 617bbf62e92..8d40550961f 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -458,7 +458,7 @@ static void txt_write_file(Text *text, ReportList *reports) fp= fopen(filepath, "w"); if(fp==NULL) { - BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error writing file"); + BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error writing file"); return; } @@ -477,7 +477,7 @@ static void txt_write_file(Text *text, ReportList *reports) } else { text->mtime= 0; - BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error starrng file"); + BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error starrng file"); } if(text->flags & TXT_ISDIRTY) @@ -819,7 +819,7 @@ void TEXT_OT_paste(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_boolean(ot->srna, "selection", 0, "Selection", "Paste text selected elsewhere rather than copied, X11 only."); + RNA_def_boolean(ot->srna, "selection", 0, "Selection", "Paste text selected elsewhere rather than copied (X11 only)"); } /******************* copy operator *********************/ @@ -1214,7 +1214,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_enum(ot->srna, "type", whitespace_type_items, TO_SPACES, "type", "Type of whitespace to convert to."); + RNA_def_enum(ot->srna, "type", whitespace_type_items, TO_SPACES, "Type", "Type of whitespace to convert to"); } /******************* select all operator *********************/ @@ -1907,7 +1907,7 @@ void TEXT_OT_move(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to."); + RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to"); } /******************* move select operator ********************/ @@ -1931,7 +1931,7 @@ void TEXT_OT_move_select(wmOperatorType *ot) ot->poll= text_space_edit_poll; /* properties */ - RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection."); + RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection"); } /******************* jump operator *********************/ @@ -1974,7 +1974,7 @@ void TEXT_OT_jump(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_int(ot->srna, "line", 1, 1, INT_MAX, "Line", "Line number to jump to.", 1, 10000); + RNA_def_int(ot->srna, "line", 1, 1, INT_MAX, "Line", "Line number to jump to", 1, 10000); } /******************* delete operator **********************/ @@ -2026,7 +2026,7 @@ void TEXT_OT_delete(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete."); + RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete"); } /******************* toggle overwrite operator **********************/ @@ -2263,7 +2263,7 @@ void TEXT_OT_scroll(wmOperatorType *ot) ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; /* properties */ - RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); + RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100); } /******************** scroll bar operator *******************/ @@ -2345,7 +2345,7 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) ot->flag= OPTYPE_BLOCKING; /* properties */ - RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); + RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100); } /******************* set selection operator **********************/ @@ -2636,7 +2636,7 @@ void TEXT_OT_selection_set(wmOperatorType *ot) ot->poll= text_region_edit_poll; /* properties */ - RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor."); + RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor"); } /******************* set cursor operator **********************/ @@ -2820,7 +2820,7 @@ void TEXT_OT_insert(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); + RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position"); } /******************* find operator *********************/ @@ -3169,7 +3169,7 @@ void TEXT_OT_resolve_conflict(wmOperatorType *ot) ot->poll= save_poll; /* properties */ - RNA_def_enum(ot->srna, "resolution", resolution_items, RESOLVE_IGNORE, "Resolution", "How to solve conflict due to different in internal and external text."); + RNA_def_enum(ot->srna, "resolution", resolution_items, RESOLVE_IGNORE, "Resolution", "How to solve conflict due to differences in internal and external text"); } /********************** to 3d object operator *****************/ @@ -3199,7 +3199,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "split_lines", 0, "Split Lines", "Create one object per line in the text."); + RNA_def_boolean(ot->srna, "split_lines", 0, "Split Lines", "Create one object per line in the text"); } diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 6e02ecbd5a8..b6e76885719 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -64,6 +64,7 @@ #include "GPU_buffers.h" #include "GPU_extensions.h" #include "GPU_draw.h" +#include "GPU_material.h" #include "ED_mesh.h" @@ -207,44 +208,71 @@ static Material *give_current_material_or_def(Object *ob, int matnr) return ma?ma:&defmaterial; } -static int set_draw_settings_cached(int clearcache, int textured, MTFace *texface, int lit, Object *litob, int litmatnr, int doublesided) +/* Icky globals, fix with userdata parameter */ + +static struct TextureDrawState { + Object *ob; + int islit, istex; + int color_profile; + unsigned char obcol[4]; +} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}}; + +static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *ma, struct TextureDrawState gtexdraw) { + static Material *c_ma; static int c_textured; - static int c_lit; - static int c_doublesided; static MTFace *c_texface; - static Object *c_litob; - static int c_litmatnr; + static int c_backculled; static int c_badtex; + static int c_lit; + Object *litob = NULL; //to get mode to turn off mipmap in painting mode + int backculled = 0; + int alphablend = 0; + int textured = 0; + int lit = 0; + if (clearcache) { - c_textured= c_lit= c_doublesided= -1; + c_textured= c_lit= c_backculled= -1; c_texface= (MTFace*) -1; - c_litob= (Object*) -1; - c_litmatnr= -1; c_badtex= 0; + } else { + textured = gtexdraw.istex; + litob = gtexdraw.ob; + } + + /* convert number of lights into boolean */ + if (gtexdraw.islit) lit = 1; + + if (ma) { + alphablend = ma->game.alpha_blend; + if (ma->mode & MA_SHLESS) lit = 0; + backculled = ma->game.flag & GEMAT_BACKCULL; } if (texface) { - lit = lit && (lit==-1 || texface->mode&TF_LIGHT); - textured = textured && (texface->mode&TF_TEX); - doublesided = texface->mode&TF_TWOSIDE; - } else { - textured = 0; + textured = textured && (texface->tpage); + + /* no material, render alpha if texture has depth=32 */ + if (!ma && BKE_image_has_alpha(texface->tpage)) + alphablend = GPU_BLEND_ALPHA; } - if (doublesided!=c_doublesided) { - if (doublesided) glDisable(GL_CULL_FACE); - else glEnable(GL_CULL_FACE); + else + textured = 0; + + if (backculled!=c_backculled) { + if (backculled) glEnable(GL_CULL_FACE); + else glDisable(GL_CULL_FACE); - c_doublesided= doublesided; + c_backculled= backculled; } if (textured!=c_textured || texface!=c_texface) { if (textured ) { - c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT)); + c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT), alphablend); } else { - GPU_set_tpage(NULL, 0); + GPU_set_tpage(NULL, 0, 0); c_badtex= 0; } c_textured= textured; @@ -252,10 +280,10 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac } if (c_badtex) lit= 0; - if (lit!=c_lit || litob!=c_litob || litmatnr!=c_litmatnr) { + if (lit!=c_lit || ma!=c_ma) { if (lit) { - Material *ma= give_current_material_or_def(litob, litmatnr+1); float spec[4]; + if (!ma)ma= give_current_material_or_def(NULL, 0); //default material spec[0]= ma->spec*ma->specr; spec[1]= ma->spec*ma->specg; @@ -273,22 +301,11 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac glDisable(GL_COLOR_MATERIAL); } c_lit= lit; - c_litob= litob; - c_litmatnr= litmatnr; } return c_badtex; } -/* Icky globals, fix with userdata parameter */ - -static struct TextureDrawState { - Object *ob; - int islit, istex; - int color_profile; - unsigned char obcol[4]; -} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}}; - static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; @@ -318,14 +335,14 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O Gtexdraw.istex = istex; Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); - set_draw_settings_cached(1, 0, NULL, Gtexdraw.islit, NULL, 0, 0); + set_draw_settings_cached(1, NULL, NULL, Gtexdraw); glShadeModel(GL_SMOOTH); } static void draw_textured_end(void) { /* switch off textures */ - GPU_set_tpage(NULL, 0); + GPU_set_tpage(NULL, 0, 0); glShadeModel(GL_FLAT); glDisable(GL_CULL_FACE); @@ -347,18 +364,22 @@ static void draw_textured_end(void) static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr) { - if (tface && (tface->mode&TF_INVISIBLE)) return 0; + Material *ma= give_current_material(Gtexdraw.ob, matnr+1); + int validtexture=0; + + if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0; + + validtexture = set_draw_settings_cached(0, tface, ma, Gtexdraw); - if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) { + if (tface && validtexture) { glColor3ub(0xFF, 0x00, 0xFF); return 2; /* Don't set color */ - } else if (tface && tface->mode&TF_OBCOL) { + } else if (ma && ma->shade_flag&MA_OBCOLOR) { glColor3ubv(Gtexdraw.obcol); return 2; /* Don't set color */ } else if (!mcol) { if (tface) glColor3f(1.0, 1.0, 1.0); else { - Material *ma= give_current_material(Gtexdraw.ob, matnr+1); if(ma) { float col[3]; if(Gtexdraw.color_profile) linearrgb_to_srgb_v3_v3(col, &ma->r); @@ -375,9 +396,11 @@ static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr) } static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr) { - if (tface && (tface->mode&TF_INVISIBLE)) return 0; + Material *ma= give_current_material(Gtexdraw.ob, matnr+1); + + if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0; - if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) { + if (tface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) { return 2; /* Don't set color */ } else if (tface && tface->mode&TF_OBCOL) { return 2; /* Don't set color */ @@ -399,7 +422,9 @@ static void add_tface_color_layer(DerivedMesh *dm) finalCol = MEM_mallocN(sizeof(MCol)*4*dm->getNumFaces(dm),"add_tface_color_layer"); for(i=0;i<dm->getNumFaces(dm);i++) { - if (tface && (tface->mode&TF_INVISIBLE)) { + Material *ma= give_current_material(Gtexdraw.ob, mface[i].mat_nr+1); + + if (ma && (ma->game.flag&GEMAT_INVISIBLE)) { if( mcol ) memcpy(&finalCol[i*4],&mcol[i*4],sizeof(MCol)*4); else @@ -409,7 +434,7 @@ static void add_tface_color_layer(DerivedMesh *dm) finalCol[i*4+j].r = 255; } } - else if (tface && mface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, mface[i].mat_nr, TF_TWOSIDE)) { + else if (tface && mface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) { for(j=0;j<4;j++) { finalCol[i*4+j].b = 255; finalCol[i*4+j].g = 0; @@ -494,10 +519,13 @@ static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmoot { Mesh *me = (Mesh*)userData; - if ( (me->mface && me->mface[index].flag & ME_HIDE) || - (me->mtface && (me->mtface[index].mode & TF_INVISIBLE)) - ) { - return 0; + if (me->mface) { + short matnr= me->mface[index].mat_nr; + Material *ma= me->mat[matnr]; + + if (ma && (ma->game.flag & GEMAT_INVISIBLE)) { + return 0; + } } *drawSmooth_r = 1; @@ -523,17 +551,18 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) if(ob->mode & OB_MODE_EDIT) return; else if(ob==OBACT) - if(paint_facesel_test(ob)) + if(paint_facesel_test(ob) || paint_vertsel_test(ob)) return; ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); for(a=0, mf=mface; a<totface; a++, tface++, mf++) { - int mode= tface->mode; - int matnr= mf->mat_nr; + short matnr= mf->mat_nr; int mf_smooth= mf->flag & ME_SMOOTH; + Material *mat = me->mat[matnr]; + int mode= mat->game.flag; - if (!(mf->flag&ME_HIDE) && !(mode&TF_INVISIBLE) && (mode&TF_BMFONT)) { + if (!(mode&GEMAT_INVISIBLE) && (mode&GEMAT_TEXT)) { float v1[3], v2[3], v3[3], v4[3]; char string[MAX_PROPSTRING]; int characters, i, glattrib= -1, badtex= 0; @@ -549,7 +578,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) } } else { - badtex = set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE); + badtex = set_draw_settings_cached(0, tface, mat, Gtexdraw); if (badtex) { if (mcol) mcol+=4; continue; @@ -578,7 +607,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) glNormal3fv(nor); } - GPU_render_text(tface, tface->mode, string, characters, + GPU_render_text(tface, mode, string, characters, (unsigned int*)mcol, v1, v2, v3, (mf->v4? v4: NULL), glattrib); } if (mcol) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 0e8e6cdfee1..44d68ded679 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -220,16 +220,13 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt) return (scene->gm.matmode == GAME_MAT_GLSL) && (dt > OB_SOLID); } -static int check_material_alpha(Base *base, Mesh *me, int glsl) +static int check_material_alpha(Base *base, int glsl) { if(base->flag & OB_FROMDUPLI) return 0; if(G.f & G_PICKSEL) return 0; - - if(me->edit_mesh) - return 0; return (glsl || (base->object->dtx & OB_DRAWTRANSP)); } @@ -1740,6 +1737,31 @@ void mesh_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, EditVe dm->release(dm); } +/* draw callback */ +static void drawSelectedVertices__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +{ + MVert *mv = &((MVert *)userData)[index]; + + if(!(mv->flag & ME_HIDE)) { + const char sel= mv->flag & SELECT; + + // TODO define selected color + if(sel) { + glColor3f(1.0f, 1.0f, 0.0f); + } + else { + glColor3f(0.0f, 0.0f, 0.0f); + } + + glVertex3fv(co); + } +} + +static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) { + glBegin(GL_POINTS); + dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert); + glEnd(); +} 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; @@ -2924,7 +2946,16 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D bglPolygonOffset(rv3d->dist, 0.0); } } - + + if(paint_vertsel_test(ob)) { + + glColor3f(0.0f, 0.0f, 0.0f); + glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); + + drawSelectedVertices(dm, ob->data); + + glPointSize(1.0f); + } dm->release(dm); } @@ -2964,12 +2995,16 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D scene->customdata_mask); if(dt>OB_WIRE) { - // no transp in editmode, the fancy draw over goes bad then glsl = draw_glsl_material(scene, ob, v3d, dt); - GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL); + check_alpha = check_material_alpha(base, glsl); + + GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, + (check_alpha)? &do_alpha_pass: NULL); } - draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt); + // transp in editmode makes the fancy draw over go bad + if (!do_alpha_pass) + draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt); GPU_end_object_materials(); @@ -2980,7 +3015,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D /* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */ if(me->totface<=4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) { glsl = draw_glsl_material(scene, ob, v3d, dt); - check_alpha = check_material_alpha(base, me, glsl); + check_alpha = check_material_alpha(base, glsl); if(dt==OB_SOLID || glsl) { GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, @@ -4022,7 +4057,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(draw_as==PART_DRAW_PATH){ ParticleCacheKey **cache, *path; - float *cd2=NULL,*cdata2=NULL; + float /* *cd2=NULL, */ /* UNUSED */ *cdata2=NULL; /* setup gl flags */ if (1) { //ob_dt > OB_WIRE) { @@ -4090,7 +4125,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(cdata2) MEM_freeN(cdata2); - cd2=cdata2=NULL; + /* cd2= */ /* UNUSED */ cdata2=NULL; glLineWidth(1.0f); @@ -6516,6 +6551,32 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* ***************** BACKBUF SEL (BBS) ********* */ +static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +{ + struct {void* offset; MVert *mvert;} *data = userData; + MVert *mv = &data->mvert[index]; + int offset = (intptr_t) data->offset; + + if (!(mv->flag & ME_HIDE)) { + WM_set_framebuffer_index_color(offset+index); + bglVertex3fv(co); + } +} + +static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset) +{ + struct {void* offset; struct MVert *mvert;} data; + Mesh *me = ob->data; + MVert *mvert = me->mvert; + data.mvert = mvert; + data.offset = (void*)(intptr_t) offset; + glPointSize( UI_GetThemeValuef(TH_VERTEX_SIZE) ); + bglBegin(GL_POINTS); + dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data); + bglEnd(); + glPointSize(1.0); +} + static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { int offset = (intptr_t) userData; @@ -6614,6 +6675,17 @@ static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUS } } +// must have called WM_set_framebuffer_index_color beforehand +static int bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r)) +{ + Mesh *me = userData; + + if (!(me->mface[index].flag & ME_HIDE)) { + return 1; + } else { + return 0; + } +} static void bbs_mesh_solid(Scene *scene, Object *ob) { DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask); @@ -6672,7 +6744,21 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec EM_free_index_arrays(); } else { - bbs_mesh_solid(scene, ob); + Mesh *me= ob->data; + if(me->editflag & ME_EDIT_VERT_SEL) { + 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); + + + bbs_obmode_mesh_verts(ob, dm, 1); + em_vertoffs = me->totvert+1; + dm->release(dm); + } + else { + bbs_mesh_solid(scene, ob); + } } break; case OB_CURVE: diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 8da6f49e089..e87ace19edb 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -183,7 +183,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 float viewnormal[3]; int i, j, n, good_index; - float d, d0, dd, ds; + float d /*, d0 */ /* UNUSED */, dd, ds; float *points = NULL; int numpoints = 0; float cor[3] = {1.,1.,1.}; @@ -390,7 +390,8 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 // (a,b,c), the plane normal, are given by viewdir // d is the parameter along the view direction. the first d is given by // inserting previously found vertex into the plane equation - d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); + + /* d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); */ /* UNUSED */ ds = (ABS(viewnormal[0])*size[0] + ABS(viewnormal[1])*size[1] + ABS(viewnormal[2])*size[2]); dd = 0.05; // ds/512.0f; n = 0; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 6833dec2e43..c46b6b6d70b 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -371,6 +371,10 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar) keymap= WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); + + keymap= WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); + /* pose is not modal, operator poll checks for this */ keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 761de836cfb..0854f9f3685 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1097,7 +1097,7 @@ void VIEW3D_OT_ndof_orbit(struct wmOperatorType *ot) { /* identifiers */ ot->name = "NDOF Orbit View"; - ot->description = "Explore every angle of an object using the 3D mouse."; + ot->description = "Explore every angle of an object using the 3D mouse"; ot->idname = "VIEW3D_OT_ndof_orbit"; /* api callbacks */ @@ -1196,7 +1196,7 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot) { /* identifiers */ ot->name = "NDOF Pan View"; - ot->description = "Position your viewpoint with the 3D mouse."; + ot->description = "Position your viewpoint with the 3D mouse"; ot->idname = "VIEW3D_OT_ndof_pan"; /* api callbacks */ @@ -2242,7 +2242,7 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot) { /* identifiers */ ot->name= "Center View to Cursor"; - ot->description= "Centers the view so that the cursor is in the middle of the view"; + ot->description= "Center the view so that the cursor is in the middle of the view"; ot->idname= "VIEW3D_OT_view_center_cursor"; /* api callbacks */ @@ -2346,7 +2346,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Set Render Border"; - ot->description = "Set the boundaries of the border render and enables border render "; + ot->description = "Set the boundaries of the border render and enables border render"; ot->idname= "VIEW3D_OT_render_border"; /* api callbacks */ @@ -2573,7 +2573,7 @@ static EnumPropertyItem prop_view_items[] = { {RV3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"}, {RV3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"}, {RV3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"}, - {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active amera"}, + {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active camera"}, {0, NULL, 0, NULL, NULL}}; @@ -2786,7 +2786,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot) ot->flag= 0; RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view"); - RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active objects axis"); + RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis"); } static EnumPropertyItem prop_view_orbit_items[] = { @@ -3013,7 +3013,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot) ot->flag = 0; /* properties */ - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign."); + RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign"); RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 78dcf6c9a5c..0776ca752a9 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -47,6 +47,8 @@ #include "BLI_editVert.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_effect.h" @@ -269,16 +271,29 @@ void VIEW3D_OT_layers(wmOperatorType *ot) RNA_def_boolean(ot->srna, "toggle", 1, "Toggle", "Toggle the layer"); } +static int modeselect_addmode(char *str, const char *title, int id, int icon) +{ + static char formatstr[] = "|%s %%x%d %%i%d"; + + if(UI_translate_iface()) + return sprintf(str, formatstr, BLF_gettext(title), id, icon); + else + return sprintf(str, formatstr, title, id, icon); +} + static char *view3d_modeselect_pup(Scene *scene) { Object *ob= OBACT; static char string[256]; - static char formatstr[] = "|%s %%x%d %%i%d"; + const char *title= N_("Mode: %%t"); char *str = string; - str += sprintf(str, "Mode: %%t"); + if(U.transopts&USER_TR_IFACE) + title= BLF_gettext(title); + + sprintf(str, title); - str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA); + 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; @@ -289,31 +304,31 @@ static char *view3d_modeselect_pup(Scene *scene) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) { - str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT); + str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT); } else if (ob->type == OB_ARMATURE) { if (ob->mode & OB_MODE_POSE) - str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT); + str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT); else - str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT); + str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT); } if (ob->type == OB_MESH) { - str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT); - str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT); - str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT); - str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT); + str += modeselect_addmode(str, N_("Sculpt Mode"), OB_MODE_SCULPT, ICON_SCULPTMODE_HLT); + str += modeselect_addmode(str, N_("Vertex Paint"), OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT); + str += modeselect_addmode(str, N_("Texture Paint"), OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT); + 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 += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT); + str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT); } if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) { - str += sprintf(str, formatstr, "Particle Mode", OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE); + str += modeselect_addmode(str, N_("Particle Mode"), OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE); } (void)str; return (string); @@ -455,6 +470,7 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C) } } +#define TIP_(msgid) UI_translate_do_tooltip(msgid) void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) { bScreen *screen= CTX_wm_screen(C); @@ -488,7 +504,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockBeginAlign(block); uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , - 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, "Mode"); + 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_(N_("Mode"))); uiBlockEndAlign(block); /* Draw type */ @@ -500,7 +516,15 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) PointerRNA meshptr; RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); - uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) { + uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } + else { + + row= uiLayoutRow(layout, 1); + uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } } else { const char *str_menu; @@ -514,11 +538,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) block= uiLayoutGetBlock(row); if(v3d->twflag & V3D_USE_MANIPULATOR) { - but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode"); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Translate manipulator mode"))); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode"); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Rotate manipulator mode"))); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode"); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Scale manipulator mode"))); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ } @@ -526,8 +550,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) v3d->twmode = 0; } - str_menu = BIF_menustringTransformOrientation(C, "Orientation"); - but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation"); + str_menu = BIF_menustringTransformOrientation(C, N_("Orientation")); + but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_(N_("Transform Orientation"))); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ MEM_freeN((void *)str_menu); } @@ -547,4 +571,4 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiTemplateEditModeSelection(layout, C); } - +#undef TIP_ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 65914ead899..1c98397c7f6 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -54,6 +54,11 @@ #include "BLI_linklist.h" #include "BLI_utildefines.h" +/* vertex box select */ +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" +#include "BKE_global.h" + #include "BKE_context.h" #include "BKE_paint.h" #include "BKE_armature.h" @@ -198,6 +203,24 @@ static void EM_backbuf_checkAndSelectFaces(EditMesh *em, int select) } } + +/* object mode, EM_ prefix is confusing here, rename? */ +static void EM_backbuf_checkAndSelectVerts_obmode(Mesh *me, int select) +{ + MVert *mv = me->mvert; + int a; + + if (mv) { + for(a=1; a<=me->totvert; a++, mv++) { + if(EM_check_backbuf(a)) { + if(!(mv->flag & ME_HIDE)) { + mv->flag = select?(mv->flag|SELECT):(mv->flag&~SELECT); + } + } + } + } +} +/* object mode, EM_ prefix is confusing here, rename? */ static void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select) { MFace *mface = me->mface; @@ -231,7 +254,7 @@ static int view3d_selectable_data(bContext *C) if (ob->mode & OB_MODE_SCULPT) { return 0; } - if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob)) { + if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob) && !paint_vertsel_test(ob)) { return 0; } } @@ -727,6 +750,88 @@ static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves, } } +int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend) +{ + Mesh *me; + MVert *mvert; + struct ImBuf *ibuf; + unsigned int *rt; + int a, index; + char *selar; + int sx= rect->xmax-rect->xmin+1; + int sy= rect->ymax-rect->ymin+1; + + me= vc->obact->data; + + if(me==NULL || me->totvert==0 || sx*sy <= 0) + return OPERATOR_CANCELLED; + + selar= MEM_callocN(me->totvert+1, "selar"); + + if (extend == 0 && select) + paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE); + + view3d_validate_backbuf(vc); + + ibuf = IMB_allocImBuf(sx,sy,32,IB_rect); + rt = ibuf->rect; + glReadPixels(rect->xmin+vc->ar->winrct.xmin, rect->ymin+vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); + if(ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); + + a= sx*sy; + while(a--) { + if(*rt) { + index= WM_framebuffer_to_index(*rt); + if(index<=me->totvert) selar[index]= 1; + } + rt++; + } + + mvert= me->mvert; + for(a=1; a<=me->totvert; a++, mvert++) { + if(selar[a]) { + if(mvert->flag & ME_HIDE); + else { + if(select) mvert->flag |= SELECT; + else mvert->flag &= ~SELECT; + } + } + } + + IMB_freeImBuf(ibuf); + MEM_freeN(selar); + +#ifdef __APPLE__ + glReadBuffer(GL_BACK); +#endif + + paintvert_flush_flags(vc->obact); + + return OPERATOR_FINISHED; +} + +static void do_lasso_select_paintvert(ViewContext *vc, int mcords[][2], short moves, short extend, short select) +{ + Object *ob= vc->obact; + Mesh *me= ob?ob->data:NULL; + rcti rect; + + if(me==NULL || me->totvert==0) + return; + + if(extend==0 && select) + paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */ + em_vertoffs= me->totvert+1; /* max index array */ + + lasso_select_boundbox(&rect, mcords, moves); + EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax); + + EM_backbuf_checkAndSelectVerts_obmode(me, select); + + EM_free_backbuf(); + + paintvert_flush_flags(ob); +} static void do_lasso_select_paintface(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { Object *ob= vc->obact; @@ -789,6 +894,8 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], s if(vc->obedit==NULL) { /* Object Mode */ if(paint_facesel_test(ob)) do_lasso_select_paintface(vc, mcords, moves, extend, select); + else if(paint_vertsel_test(ob)) + do_lasso_select_paintvert(vc, mcords, moves, extend, select); else if(ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) ; else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) @@ -876,8 +983,8 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", ""); - RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items."); - RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first."); + RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items"); + RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first"); } @@ -1798,6 +1905,9 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) else if(vc.obact && paint_facesel_test(vc.obact)) { ret= do_paintface_box_select(&vc, &rect, select, extend); } + else if(vc.obact && paint_vertsel_test(vc.obact)) { + ret= do_paintvert_box_select(&vc, &rect, select, extend); + } else if(vc.obact && vc.obact->mode & OB_MODE_PARTICLE_EDIT) { ret= PE_border_select(C, &rect, select, extend); } @@ -1834,6 +1944,58 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) WM_operator_properties_gesture_border(ot, TRUE); } +/* much like facesel_face_pick()*/ +/* returns 0 if not found, otherwise 1 */ +static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect) +{ + ViewContext vc; + view3d_set_viewcontext(C, &vc); + + if (!me || me->totvert==0) + return 0; + + if (rect) { + /* sample rect to increase changes of selecting, so that when clicking + on an face in the backbuf, we can still select a vert */ + + int dist; + *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totvert+1, &dist,0,NULL, NULL); + } + else { + /* sample only on the exact position */ + *index = view3d_sample_backbuf(&vc, mval[0], mval[1]); + } + + if ((*index)<=0 || (*index)>(unsigned int)me->totvert) + return 0; + + (*index)--; + + return 1; +} + +/* mouse selection in weight paint */ +/* gets called via generic mouse select operator */ +static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], short extend, Object *obact) +{ + Mesh* me= obact->data; /* already checked for NULL */ + unsigned int index = 0; + MVert *mv; + if(vertsel_vert_pick(C, me, mval, &index, 1)) { + mv = me->mvert+index; + if(extend) { + mv->flag ^= SELECT; + } else { + paintvert_deselect_all_visible(obact, SEL_DESELECT, FALSE); + mv->flag |= SELECT; + } + paintvert_flush_flags(obact); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data); + return 1; + } + return 0; +} + /* ****** Mouse Select ****** */ @@ -1878,6 +2040,8 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event) return PE_mouse_particles(C, event->mval, extend); else if(obact && paint_facesel_test(obact)) retval = paintface_mouse_select(C, obact, event->mval, extend); + else if (paint_vertsel_test(obact)) + retval = mouse_weight_paint_vertex_select(C, event->mval, extend, obact); else retval = mouse_select(C, event->mval, extend, center, enumerate); @@ -1905,10 +2069,10 @@ void VIEW3D_OT_select(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection."); - RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)."); - RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only)."); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); + RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection"); + RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)"); + RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only)"); } @@ -1992,18 +2156,36 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, const int m { Object *ob= vc->obact; Mesh *me = ob?ob->data:NULL; - int bbsel; + /* int bbsel; */ /* UNUSED */ if (me) { em_vertoffs= me->totface+1; /* max index array */ - bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); + /* bbsel= */ /* UNUSED */ EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); EM_backbuf_checkAndSelectTFaces(me, select==LEFTMOUSE); EM_free_backbuf(); } } +static void paint_vertsel_circle_select(ViewContext *vc, int select, const int mval[2], float rad) +{ + Object *ob= vc->obact; + Mesh *me = ob?ob->data:NULL; + /* int bbsel; */ /* UNUSED */ + /* struct {ViewContext *vc; short select; int mval[2]; float radius; } data = {NULL}; */ /* UNUSED */ + if (me) { + em_vertoffs= me->totvert+1; /* max index array */ + + /* bbsel= */ /* UNUSED */ EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); + EM_backbuf_checkAndSelectVerts_obmode(me, select==LEFTMOUSE); + EM_free_backbuf(); + + paintvert_flush_flags(ob); + } +} + + static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) { struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; @@ -2258,7 +2440,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) select= (gesture_mode==GESTURE_MODAL_SELECT); - if( CTX_data_edit_object(C) || paint_facesel_test(obact) || + if( CTX_data_edit_object(C) || paint_facesel_test(obact) || paint_vertsel_test(obact) || (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) ) { ViewContext vc; @@ -2278,6 +2460,10 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) paint_facesel_circle_select(&vc, select, mval, (float)radius); WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data); } + else if(paint_vertsel_test(obact)) { + paint_vertsel_circle_select(&vc, select, mval, (float)radius); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data); + } else if(obact->mode & OB_MODE_POSE) pose_circle_select(&vc, select, mval, (float)radius); else diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index a2aed67821d..ddea89e1cdb 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -48,6 +48,8 @@ #include "BLI_utildefines.h" #include "BLI_ghash.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_idprop.h" #include "BKE_global.h" @@ -80,7 +82,7 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) wmOperator *op= WM_operator_last_redo(C); if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname)); - else BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname)); + else BLI_strncpy(pa->drawname, N_("Operator"), sizeof(pa->drawname)); } static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index c7feaebcddc..8227ba87021 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1667,7 +1667,7 @@ static void RestoreState(bContext *C, wmWindow *win) win->queue= queue_back; GPU_state_init(); - GPU_set_tpage(NULL, 0); + GPU_set_tpage(NULL, 0, 0); glPopAttrib(); } @@ -1835,7 +1835,7 @@ static int game_engine_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; #else (void)C; /* unused */ - BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build."); + BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build"); return OPERATOR_CANCELLED; #endif } diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt index e44cc1f5df3..c4305ed6a9f 100644 --- a/source/blender/editors/transform/CMakeLists.txt +++ b/source/blender/editors/transform/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenlib ../../blenloader diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript index edc2156a07b..f2d5baecfb3 100644 --- a/source/blender/editors/transform/SConscript +++ b/source/blender/editors/transform/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../render/extern/include' incs += ' ../../gpu ../../makesrna ../../blenloader' diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 12dca202f4f..bfaf9d20092 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4260,7 +4260,6 @@ static int createSlideVerts(TransInfo *t) LinkNode *edgelist = NULL, *vertlist=NULL, *look; GHash *vertgh; TransDataSlideVert *tempsv; - float vertdist; // XXX, projectMat[4][4]; int i, j, numsel, numadded=0, timesthrough = 0, vertsel=0; /* UV correction vars */ GHash **uvarray= NULL; @@ -4525,7 +4524,6 @@ static int createSlideVerts(TransInfo *t) look = vertlist; nearest = NULL; - vertdist = -1; while(look) { tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); @@ -5563,7 +5561,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) const short autosnap= getAnimEdit_SnapMode(t); - float deltax, val, valprev; + float deltax, val /* , valprev */; /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ for (i = 0 ; i < t->total; i++, td++, td2d++) { @@ -5573,7 +5571,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) */ AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; - valprev = *td->val; + /* valprev = *td->val; */ /* UNUSED */ /* check if any need to apply nla-mapping */ if (adt && t->spacetype != SPACE_SEQ) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fc5c80d22c9..77d2e6e7ff0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1000,7 +1000,7 @@ static void createTransPose(TransInfo *t, Object *ob) if (arm->flag & ARM_RESTPOS) { if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) { // XXX use transform operator reports - // BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled."); + // BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled"); return; } } @@ -1038,7 +1038,7 @@ static void createTransPose(TransInfo *t, Object *ob) if(td != (t->data+t->total)) { // XXX use transform operator reports - // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error."); + // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error"); } /* initialise initial auto=ik chainlen's? */ @@ -1983,7 +1983,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) float *mappedcos = NULL, *quats= NULL; float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL; int count=0, countsel=0, a, totleft; - int propmode = t->flag & T_PROP_EDIT; + int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) : 0; int mirror = 0; short selectmode = ts->selectmode; @@ -2053,7 +2053,9 @@ static void createTransEditVerts(bContext *C, TransInfo *t) copy_m3_m4(mtx, t->obedit->obmat); invert_m3_m3(smtx, mtx); - if(propmode) editmesh_set_connectivity_distance(em, mtx); + if(propmode & T_PROP_CONNECTED) { + editmesh_set_connectivity_distance(em, mtx); + } /* detect CrazySpace [tm] */ if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) { @@ -3406,7 +3408,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) const char sel3= use_handle ? bezt->f3 & SELECT : 0; TransDataCurveHandleFlags *hdata = NULL; - short h1=1, h2=1; + /* short h1=1, h2=1; */ /* UNUSED */ /* only include handles if selected, irrespective of the interpolation modes. * also, only treat handles specially if the center point isn't selected. @@ -3416,16 +3418,18 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) hdata = initTransDataCurveHandles(td, bezt); bezt_to_transdata(td++, td2d++, adt, bezt, 0, 1, 1, intvals, mtx, smtx); } - else - h1= 0; + else { + /* h1= 0; */ /* UNUSED */ + } if (sel3) { if (hdata==NULL) hdata = initTransDataCurveHandles(td, bezt); bezt_to_transdata(td++, td2d++, adt, bezt, 2, 1, 1, intvals, mtx, smtx); } - else - h2= 0; + else { + /* h2= 0; */ /* UNUSED */ + } } /* only include main vert if selected */ diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 3b895f5fbd0..36373562956 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -446,13 +446,13 @@ int calc_manipulator_stats(const bContext *C) } else if(obedit->type==OB_MBALL) { MetaBall *mb = (MetaBall*)obedit->data; - MetaElem *ml, *ml_sel=NULL; + MetaElem *ml /* , *ml_sel=NULL */ /* UNUSED */; ml= mb->editelems->first; while(ml) { if(ml->flag & SELECT) { calc_tw_center(scene, &ml->x); - ml_sel = ml; + /* ml_sel = ml; */ /* UNUSED */ totsel++; } ml= ml->next; diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index e35b8adc570..d6e8e4aa695 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -303,7 +303,7 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot) ot->poll = ED_operator_areaactive; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position."); + RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position"); RNA_def_boolean(ot->srna, "use", 0, "Use after creation", "Select orientation after its creation"); RNA_def_boolean(ot->srna, "overwrite", 0, "Overwrite previous", "Overwrite previously created orientation with same name"); } @@ -476,7 +476,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) if (flags & P_PROPORTIONAL) { RNA_def_enum(ot->srna, "proportional", proportional_editing_items, 0, "Proportional Editing", ""); - RNA_def_enum(ot->srna, "proportional_edit_falloff", proportional_falloff_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + RNA_def_enum(ot->srna, "proportional_edit_falloff", proportional_falloff_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode"); RNA_def_float(ot->srna, "proportional_size", 1, 0.00001f, FLT_MAX, "Proportional Size", "", 0.001, 100); } @@ -601,8 +601,8 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot) /* identifiers */ ot->name = "Tilt"; /*optionals - - "Tilt selected vertices." - "Specify an extra axis rotation for selected vertices of 3d curve." */ + "Tilt selected vertices" + "Specify an extra axis rotation for selected vertices of 3d curve" */ ot->description= "Tilt selected control vertices of 3d curve"; ot->idname = OP_TILT; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -795,7 +795,7 @@ void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot) ot->cancel = transform_cancel; ot->poll = ED_operator_sequencer_active; - RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "angle", "", -FLT_MAX, FLT_MAX); + RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX); Transform_Properties(ot, P_SNAP); } diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 96ab0b48091..b60e511dcb7 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -50,6 +50,8 @@ #include "BLI_editVert.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + //#include "BIF_editmesh.h" //#include "BIF_interface.h" //#include "BIF_space.h" @@ -60,6 +62,8 @@ #include "RNA_define.h" +#include "UI_interface.h" + #include "transform.h" /* *********************** TransSpace ************************** */ @@ -406,14 +410,18 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) } const char * BIF_menustringTransformOrientation(const bContext *C, const char *title) { - char menu[] = "%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"; + const char* menu = N_("%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"); ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; TransformOrientation *ts; int i = V3D_MANIP_CUSTOM; char *str_menu, *p; + + if(UI_translate_iface()) { + title= BLF_gettext(title); + menu= BLF_gettext(menu); + } - - str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), "UserTransSpace from matrix"); + str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), UI_translate_do_tooltip(N_("UserTransSpace from matrix"))); p = str_menu; p += sprintf(str_menu, "%s", title); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 05159414975..61b3a9ca1ca 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -125,14 +125,12 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre if(uvedit_face_visible(scene, previma, efa, tf)) { if(ima) { tf->tpage= ima; - tf->mode |= TF_TEX; if(ima->id.us==0) id_us_plus(&ima->id); else id_lib_extern(&ima->id); } else { tf->tpage= NULL; - tf->mode &= ~TF_TEX; } update = 1; @@ -1221,7 +1219,7 @@ static void UV_OT_align(wmOperatorType *ot) ot->poll= ED_operator_image_active; /* requires space image */; /* properties */ - RNA_def_enum(ot->srna, "axis", axis_items, 'a', "Axis", "Axis to align UV locations on."); + RNA_def_enum(ot->srna, "axis", axis_items, 'a', "Axis", "Axis to align UV locations on"); } /* ******************** weld operator **************** */ @@ -1433,8 +1431,8 @@ static void UV_OT_stitch(wmOperatorType *ot) ot->poll= ED_operator_uvedit; /* properties */ - RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance."); - RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates.", -FLT_MAX, FLT_MAX); + RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance"); + RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates", -FLT_MAX, FLT_MAX); } /* ******************** (de)select all operator **************** */ @@ -1868,9 +1866,9 @@ static void UV_OT_select(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", 0, - "Extend", "Extend selection rather than clearing the existing selection."); + "Extend", "Extend selection rather than clearing the existing selection"); RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, - "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f); + "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f); } /* ******************** loop select operator **************** */ @@ -1913,9 +1911,9 @@ static void UV_OT_select_loop(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", 0, - "Extend", "Extend selection rather than clearing the existing selection."); + "Extend", "Extend selection rather than clearing the existing selection"); RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, - "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f); + "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f); } /* ******************** linked select operator **************** */ @@ -1934,7 +1932,7 @@ static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, i NearestHit hit, *hit_p= NULL; if(ts->uv_flag & UV_SYNC_SELECTION) { - BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled."); + BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -1989,7 +1987,7 @@ static void UV_OT_select_linked(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", 0, - "Extend", "Extend selection rather than clearing the existing selection."); + "Extend", "Extend selection rather than clearing the existing selection"); } static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) @@ -2017,10 +2015,10 @@ static void UV_OT_select_linked_pick(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", 0, - "Extend", "Extend selection rather than clearing the existing selection."); + "Extend", "Extend selection rather than clearing the existing selection"); RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, - "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f); + "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f); } /* ******************** unlink selection operator **************** */ @@ -2036,7 +2034,7 @@ static int unlink_selection_exec(bContext *C, wmOperator *op) MTFace *tf; if(ts->uv_flag & UV_SYNC_SELECTION) { - BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled."); + BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -2358,7 +2356,7 @@ static void UV_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only."); + RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only"); WM_operator_properties_gesture_border(ot, FALSE); } @@ -2519,7 +2517,7 @@ static void UV_OT_snap_cursor(wmOperatorType *ot) ot->poll= ED_operator_image_active; /* requires space image */; /* properties */ - RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UV's to."); + RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to"); } /* ******************** snap selection operator **************** */ @@ -2761,7 +2759,7 @@ static void UV_OT_snap_selected(wmOperatorType *ot) ot->poll= ED_operator_image_active; /* requires space image */; /* properties */ - RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UV's to."); + RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to"); } /* ******************** pin operator **************** */ @@ -2816,7 +2814,7 @@ static void UV_OT_pin(wmOperatorType *ot) ot->poll= ED_operator_uvedit; /* properties */ - RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear pinning for the selection instead of setting it."); + RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear pinning for the selection instead of setting it"); } /******************* select pinned operator ***************/ @@ -3001,7 +2999,7 @@ static void UV_OT_hide(wmOperatorType *ot) ot->poll= ED_operator_uvedit; /* props */ - RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } /****************** reveal operator ******************/ @@ -3181,7 +3179,7 @@ static void UV_OT_cursor_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in 0.0-1.0 coordinates.", -10.0f, 10.0f); + RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in 0.0-1.0 coordinates", -10.0f, 10.0f); } /********************** set tile operator **********************/ @@ -3247,7 +3245,7 @@ static void UV_OT_tile_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate.", 0, 10); + RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate", 0, 10); } /* ************************** registration **********************************/ diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index dd7c336c98e..846b05c1287 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -2714,7 +2714,7 @@ static PBool p_chart_abf_solve(PChart *chart) break; if (!p_abf_matrix_invert(&sys, chart)) { - param_warning("ABF failed to invert matrix."); + param_warning("ABF failed to invert matrix"); p_abf_free_system(&sys); return P_FALSE; } @@ -2723,7 +2723,7 @@ static PBool p_chart_abf_solve(PChart *chart) } if (i == ABF_MAX_ITER) { - param_warning("ABF maximum iterations reached."); + param_warning("ABF maximum iterations reached"); p_abf_free_system(&sys); return P_FALSE; } @@ -3831,7 +3831,7 @@ static void p_smooth(PChart *chart) if (hedges) MEM_freeN(hedges); if (vedges) MEM_freeN(vedges); - // printf("Not enough memory for area smoothing grid."); + // printf("Not enough memory for area smoothing grid"); return; } @@ -3981,7 +3981,7 @@ static void p_smooth(PChart *chart) if (triangles) MEM_freeN(triangles); if (tri) MEM_freeN(tri); - // printf("Not enough memory for area smoothing grid."); + // printf("Not enough memory for area smoothing grid"); return; } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index e8a7896abd5..d5666d135aa 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -169,7 +169,8 @@ static int uvedit_have_selection(Scene *scene, EditMesh *em, short implicit) return 0; } -static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit, short fill, short sel, short correct_aspect) +static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit, + short fill, short sel, short correct_aspect) { ParamHandle *handle; EditFace *efa; @@ -333,7 +334,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact param_flush(ms->handle); if(sa) { - sprintf(str, "Minimize Stretch. Blend %.2f.", ms->blend); + sprintf(str, "Minimize Stretch. Blend %.2f", ms->blend); ED_area_headerprint(sa, str); } @@ -474,9 +475,12 @@ void UV_OT_minimize_stretch(wmOperatorType *ot) ot->poll= ED_operator_uvedit; /* properties */ - RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry."); - RNA_def_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend", "Blend factor between stretch minimized and original.", 0.0f, 1.0f); - RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations", "Number of iterations to run, 0 is unlimited when run interactively.", 0, 100); + RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", + "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry"); + RNA_def_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend", + "Blend factor between stretch minimized and original", 0.0f, 1.0f); + RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations", + "Number of iterations to run, 0 is unlimited when run interactively", 0, 100); } /* ******************** Pack Islands operator **************** */ @@ -525,7 +529,8 @@ void UV_OT_pack_islands(wmOperatorType *ot) ot->poll= ED_operator_uvedit; /* properties */ - RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f); + RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin", + "Space between islands", 0.0f, 1.0f); } /* ******************** Average Islands Scale operator **************** */ @@ -656,7 +661,8 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result, Ob } } -static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object *ob, float upangledeg, float sideangledeg, float radius) +static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object *ob, + float upangledeg, float sideangledeg, float radius) { float rotup[4][4], rotside[4][4], viewmatrix[4][4], rotobj[4][4]; float sideangle= 0.0f, upangle= 0.0f; @@ -752,10 +758,13 @@ static void uv_transform_properties(wmOperatorType *ot, int radius) {0, NULL, 0, NULL, NULL} }; - RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", "Direction of the sphere or cylinder."); - RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align", "How to determine rotation around the pole."); + RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", + "Direction of the sphere or cylinder"); + RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align", + "How to determine rotation around the pole"); if(radius) - RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "Radius of the sphere or cylinder.", 0.0001f, 100.0f); + RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", + "Radius of the sphere or cylinder", 0.0001f, 100.0f); } static void correct_uv_aspect(EditMesh *em) @@ -808,9 +817,12 @@ static void correct_uv_aspect(EditMesh *em) static void uv_map_clip_correct_properties(wmOperatorType *ot) { - RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", "Map UV's taking image aspect ratio into account."); - RNA_def_boolean(ot->srna, "clip_to_bounds", 0, "Clip to Bounds", "Clip UV coordinates to bounds after unwrapping."); - RNA_def_boolean(ot->srna, "scale_to_bounds", 0, "Scale to Bounds", "Scale UV coordinates to bounds after unwrapping."); + RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", + "Map UV's taking image aspect ratio into account"); + RNA_def_boolean(ot->srna, "clip_to_bounds", 0, "Clip to Bounds", + "Clip UV coordinates to bounds after unwrapping"); + RNA_def_boolean(ot->srna, "scale_to_bounds", 0, "Scale to Bounds", + "Scale UV coordinates to bounds after unwrapping"); } static void uv_map_clip_correct(EditMesh *em, wmOperator *op) @@ -967,9 +979,12 @@ void UV_OT_unwrap(wmOperatorType *ot) ot->poll= ED_operator_uvmap; /* properties */ - RNA_def_enum(ot->srna, "method", method_items, 0, "Method", "Unwrapping method. Angle Based usually gives better results than Conformal, while being somewhat slower."); - RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry."); - RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", "Map UV's taking image aspect ratio into account."); + RNA_def_enum(ot->srna, "method", method_items, 0, "Method", + "Unwrapping method. Angle Based usually gives better results than Conformal, while being somewhat slower"); + RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", + "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry"); + RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", + "Map UV's taking image aspect ratio into account"); } /**************** Project From View operator **************/ @@ -1078,7 +1093,7 @@ void UV_OT_from_view(wmOperatorType *ot) ot->poll= uv_from_view_poll; /* properties */ - RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection."); + RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection"); uv_map_clip_correct_properties(ot); } @@ -1382,6 +1397,7 @@ void UV_OT_cube_project(wmOperatorType *ot) ot->poll= ED_operator_uvmap; /* properties */ - RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", "Size of the cube to project on.", 0.001f, 100.0f); + RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", + "Size of the cube to project on", 0.001f, 100.0f); uv_map_clip_correct_properties(ot); } diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index d75b8db2c4e..55c4ff85a57 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -80,15 +80,15 @@ void GPU_end_object_materials(void); int GPU_enable_material(int nr, void *attribs); void GPU_disable_material(void); -void GPU_set_material_blend_mode(int blendmode); -int GPU_get_material_blend_mode(void); +void GPU_set_material_alpha_blend(int alphablend); +int GPU_get_material_alpha_blend(void); /* TexFace drawing * - this is mutually exclusive with material drawing, a mesh should * be drawn using one or the other * - passing NULL clears the state again */ -int GPU_set_tpage(struct MTFace *tface, int mipmap); +int GPU_set_tpage(struct MTFace *tface, int mipmap, int transp); /* Lights * - returns how many lights were enabled diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 95a08e6d5b3..29ad9c91374 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -94,7 +94,8 @@ typedef enum GPUBlendMode { GPU_BLEND_SOLID = 0, GPU_BLEND_ADD = 1, GPU_BLEND_ALPHA = 2, - GPU_BLEND_CLIP = 4 + GPU_BLEND_CLIP = 4, + GPU_BLEND_ALPHA_SORT = 8 } GPUBlendMode; typedef struct GPUNodeStack { @@ -121,7 +122,7 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link); void GPU_material_enable_alpha(GPUMaterial *material); -GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4]); +GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]); /* High level functions to create and use GPU materials */ diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 7af5ef6ea14..4f79d577ae5 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -95,7 +95,7 @@ void GPU_render_text(MTFace *tface, int mode, const char *textstr, int textlen, unsigned int *col, float *v1, float *v2, float *v3, float *v4, int glattrib) { - if ((mode & TF_BMFONT) && (textlen>0) && tface->tpage) { + if ((mode & GEMAT_TEXT) && (textlen>0) && tface->tpage) { Image* ima = (Image*)tface->tpage; int index, character; float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance; @@ -245,7 +245,7 @@ static struct GPUTextureState { int domipmap, linearmipmap; - int alphamode; + int alphablend; float anisotropic; MTFace *lasttface; } GTS = {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, 0, -1, 1.f, NULL}; @@ -352,7 +352,7 @@ static void gpu_clear_tpage(void) GTS.curtilemode= 0; GTS.curtileXRep=0; GTS.curtileYRep=0; - GTS.alphamode= -1; + GTS.alphablend= -1; glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); @@ -361,19 +361,19 @@ static void gpu_clear_tpage(void) glDisable(GL_ALPHA_TEST); } -static void gpu_set_blend_mode(GPUBlendMode blendmode) +static void gpu_set_alpha_blend(GPUBlendMode alphablend) { - if(blendmode == GPU_BLEND_SOLID) { + if(alphablend == GPU_BLEND_SOLID) { glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - else if(blendmode==GPU_BLEND_ADD) { + else if(alphablend==GPU_BLEND_ADD) { glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); glDisable(GL_ALPHA_TEST); } - else if(blendmode==GPU_BLEND_ALPHA) { + else if(ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -389,21 +389,21 @@ static void gpu_set_blend_mode(GPUBlendMode blendmode) glAlphaFunc(GL_GREATER, U.glalphaclip); } } - else if(blendmode==GPU_BLEND_CLIP) { + else if(alphablend==GPU_BLEND_CLIP) { glDisable(GL_BLEND); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.5f); } } -static void gpu_verify_alpha_mode(MTFace *tface) +static void gpu_verify_alpha_blend(int alphablend) { /* verify alpha blending modes */ - if(GTS.alphamode == tface->transp) + if(GTS.alphablend == alphablend) return; - gpu_set_blend_mode(tface->transp); - GTS.alphamode= tface->transp; + gpu_set_alpha_blend(alphablend); + GTS.alphablend= alphablend; } static void gpu_verify_reflection(Image *ima) @@ -608,7 +608,7 @@ static void gpu_verify_repeat(Image *ima) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } -int GPU_set_tpage(MTFace *tface, int mipmap) +int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend) { Image *ima; @@ -621,7 +621,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap) ima= tface->tpage; GTS.lasttface= tface; - gpu_verify_alpha_mode(tface); + gpu_verify_alpha_blend(alphablend); gpu_verify_reflection(ima); if(GPU_verify_image(ima, NULL, tface->tile, 1, mipmap)) { @@ -945,12 +945,12 @@ static struct GPUMaterialState { float (*gviewmat)[4]; float (*gviewinv)[4]; - GPUBlendMode *blendmode; - GPUBlendMode blendmode_fixed[FIXEDMAT]; + GPUBlendMode *alphablend; + GPUBlendMode alphablend_fixed[FIXEDMAT]; int alphapass; int lastmatnr, lastretval; - GPUBlendMode lastblendmode; + GPUBlendMode lastalphablend; } GMS = {NULL}; /* fixed function material, alpha handed by caller */ @@ -1000,7 +1000,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O { Material *ma; GPUMaterial *gpumat; - GPUBlendMode blendmode; + GPUBlendMode alphablend; int a; int gamma = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; @@ -1008,7 +1008,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O memset(&GMS, 0, sizeof(GMS)); GMS.lastmatnr = -1; GMS.lastretval = -1; - GMS.lastblendmode = GPU_BLEND_SOLID; + GMS.lastalphablend = GPU_BLEND_SOLID; GMS.gob = ob; GMS.gscene = scene; @@ -1024,12 +1024,12 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O if(GMS.totmat > FIXEDMAT) { GMS.matbuf= MEM_callocN(sizeof(GPUMaterialFixed)*GMS.totmat, "GMS.matbuf"); GMS.gmatbuf= MEM_callocN(sizeof(*GMS.gmatbuf)*GMS.totmat, "GMS.matbuf"); - GMS.blendmode= MEM_callocN(sizeof(*GMS.blendmode)*GMS.totmat, "GMS.matbuf"); + GMS.alphablend= MEM_callocN(sizeof(*GMS.alphablend)*GMS.totmat, "GMS.matbuf"); } else { GMS.matbuf= GMS.matbuf_fixed; GMS.gmatbuf= GMS.gmatbuf_fixed; - GMS.blendmode= GMS.blendmode_fixed; + GMS.alphablend= GMS.alphablend_fixed; } /* no materials assigned? */ @@ -1044,7 +1044,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GPU_material_from_blender(GMS.gscene, &defmaterial); } - GMS.blendmode[0]= GPU_BLEND_SOLID; + GMS.alphablend[0]= GPU_BLEND_SOLID; } /* setup materials */ @@ -1060,13 +1060,13 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O if(gpumat) { /* do glsl only if creating it succeed, else fallback */ GMS.gmatbuf[a]= ma; - blendmode = GPU_material_blend_mode(gpumat, ob->col); + alphablend = GPU_material_alpha_blend(gpumat, ob->col); } else { /* fixed function opengl materials */ gpu_material_to_fixed(&GMS.matbuf[a], ma, gamma, ob); - blendmode = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA; + alphablend = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA; if(do_alpha_pass && GMS.alphapass) GMS.matbuf[a].diff[3]= ma->alpha; else @@ -1076,8 +1076,8 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O /* setting do_alpha_pass = 1 indicates this object needs to be * drawn in a second alpha pass for improved blending */ if(do_alpha_pass) { - GMS.blendmode[a]= blendmode; - if(ELEM(blendmode, GPU_BLEND_ALPHA, GPU_BLEND_ADD) && !GMS.alphapass) + GMS.alphablend[a]= alphablend; + if(ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT) && !GMS.alphapass) *do_alpha_pass= 1; } } @@ -1090,7 +1090,7 @@ int GPU_enable_material(int nr, void *attribs) { GPUVertexAttribs *gattribs = attribs; GPUMaterial *gpumat; - GPUBlendMode blendmode; + GPUBlendMode alphablend; /* no GPU_begin_object_materials, use default material */ if(!GMS.matbuf) { @@ -1131,7 +1131,7 @@ int GPU_enable_material(int nr, void *attribs) /* draw materials with alpha in alpha pass */ GMS.lastmatnr = nr; - GMS.lastretval = ELEM(GMS.blendmode[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP); + GMS.lastretval = ELEM(GMS.alphablend[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP); if(GMS.alphapass) GMS.lastretval = !GMS.lastretval; @@ -1145,6 +1145,7 @@ int GPU_enable_material(int nr, void *attribs) GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT)); GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col); GMS.gboundmat= mat; + alphablend= mat->game.alpha_blend; if(GMS.alphapass) glDepthMask(1); } @@ -1153,28 +1154,29 @@ int GPU_enable_material(int nr, void *attribs) glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr].diff); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr].spec); glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, GMS.matbuf[nr].hard); + alphablend= GPU_BLEND_SOLID; } /* set (alpha) blending mode */ - blendmode = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID; - GPU_set_material_blend_mode(blendmode); + if(!GMS.alphapass) alphablend= GPU_BLEND_SOLID; + GPU_set_material_alpha_blend(alphablend); } return GMS.lastretval; } -void GPU_set_material_blend_mode(int blendmode) +void GPU_set_material_alpha_blend(int alphablend) { - if(GMS.lastblendmode == blendmode) + if(GMS.lastalphablend == alphablend) return; - gpu_set_blend_mode(blendmode); - GMS.lastblendmode = blendmode; + gpu_set_alpha_blend(alphablend); + GMS.lastalphablend = alphablend; } -int GPU_get_material_blend_mode(void) +int GPU_get_material_alpha_blend(void) { - return GMS.lastblendmode; + return GMS.lastalphablend; } void GPU_disable_material(void) @@ -1188,7 +1190,7 @@ void GPU_disable_material(void) GMS.gboundmat= NULL; } - GPU_set_material_blend_mode(GPU_BLEND_SOLID); + GPU_set_material_alpha_blend(GPU_BLEND_SOLID); } void GPU_end_object_materials(void) @@ -1198,12 +1200,12 @@ void GPU_end_object_materials(void) if(GMS.matbuf && GMS.matbuf != GMS.matbuf_fixed) { MEM_freeN(GMS.matbuf); MEM_freeN(GMS.gmatbuf); - MEM_freeN(GMS.blendmode); + MEM_freeN(GMS.alphablend); } GMS.matbuf= NULL; GMS.gmatbuf= NULL; - GMS.blendmode= NULL; + GMS.alphablend= NULL; /* resetting the texture matrix after the glScale needed for tiled textures */ if(GTS.tilemode) diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 9aa453af4d6..40186c5a187 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -358,7 +358,7 @@ void GPU_material_enable_alpha(GPUMaterial *material) material->alpha= 1; } -GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4]) +GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]) { if(material->alpha || (material->obcolalpha && obcol[3] < 1.0f)) return GPU_BLEND_ALPHA; diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 1547d2ee9ce..26be64bc268 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -58,13 +58,11 @@ set(SRC intern/indexer.c intern/indexer_dv.c intern/iris.c - intern/jp2.c intern/jpeg.c intern/md5.c intern/metadata.c intern/module.c intern/png.c - intern/radiance_hdr.c intern/readimage.c intern/rectop.c intern/rotate.c @@ -72,7 +70,6 @@ set(SRC intern/targa.c intern/thumbs.c intern/thumbs_blend.c - intern/tiff.c intern/util.c intern/writeimage.c @@ -119,6 +116,10 @@ if(WITH_IMAGE_TIFF) list(APPEND INC_SYS ${TIFF_INCLUDE_DIR} ) + list(APPEND SRC + intern/tiff.c + ) + add_definitions(-DWITH_TIFF) endif() @@ -126,6 +127,10 @@ if(WITH_IMAGE_OPENJPEG) list(APPEND INC_SYS ${OPENJPEG_INCLUDE_DIRS} ) + list(APPEND SRC + intern/jp2.c + ) + add_definitions(-DWITH_OPENJPEG) endif() @@ -165,6 +170,9 @@ if(WITH_IMAGE_CINEON) endif() if(WITH_IMAGE_HDR) + list(APPEND SRC + intern/radiance_hdr.c + ) add_definitions(-DWITH_HDR) endif() diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index a80f92b4421..eae9665d23b 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -1,4 +1,5 @@ #!/usr/bin/python +import os Import ('env') sources = env.Glob('intern/*.c') @@ -22,6 +23,8 @@ if env['WITH_BF_OPENEXR']: if env['WITH_BF_TIFF']: defs.append('WITH_TIFF') +else: + sources.remove(os.path.join('intern', 'tiff.c')) if env['WITH_BF_DDS']: defs.append('WITH_DDS') @@ -31,6 +34,8 @@ if env['WITH_BF_CINEON']: if env['WITH_BF_HDR']: defs.append('WITH_HDR') +else: + sources.remove(os.path.join('intern', 'radiance_hdr.c')) if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') @@ -39,6 +44,8 @@ if env['WITH_BF_FFMPEG']: if env['WITH_BF_OPENJPEG']: defs.append('WITH_OPENJPEG') incs += ' ' + env['BF_OPENJPEG_INC'] +else: + sources.remove(os.path.join('intern', 'jp2.c')) if env['WITH_BF_REDCODE']: defs.append('WITH_REDCODE') diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index 8436846bf2e..43168b97b88 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -38,21 +38,21 @@ #define IMB_ANIM_H #ifdef _WIN32 -#define INC_OLE2 -#include <windows.h> -#include <windowsx.h> -#include <mmsystem.h> -#include <memory.h> -#include <commdlg.h> - -#ifndef FREE_WINDOWS -#include <vfw.h> -#endif +# define INC_OLE2 +# include <windows.h> +# include <windowsx.h> +# include <mmsystem.h> +# include <memory.h> +# include <commdlg.h> + +# ifndef FREE_WINDOWS +# include <vfw.h> +# endif -#undef AVIIF_KEYFRAME // redefined in AVI_avi.h -#undef AVIIF_LIST // redefined in AVI_avi.h +# undef AVIIF_KEYFRAME // redefined in AVI_avi.h +# undef AVIIF_LIST // redefined in AVI_avi.h -#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ +# define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); #endif @@ -60,10 +60,11 @@ #include <ctype.h> #include <stdlib.h> #include <stdio.h> -#ifndef _WIN32 -#include <dirent.h> + +#ifdef _WIN32 +# include <io.h> #else -#include <io.h> +# include <dirent.h> #endif #include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail @@ -74,23 +75,23 @@ #include "AVI_avi.h" #ifdef WITH_QUICKTIME -#if defined(_WIN32) || defined(__APPLE__) -#include "quicktime_import.h" -#endif /* _WIN32 || __APPLE__ */ +# if defined(_WIN32) || defined(__APPLE__) +# include "quicktime_import.h" +# endif /* _WIN32 || __APPLE__ */ #endif /* WITH_QUICKTIME */ #ifdef WITH_FFMPEG -#include <libavformat/avformat.h> -#include <libavcodec/avcodec.h> -#include <libswscale/swscale.h> +# include <libavformat/avformat.h> +# include <libavcodec/avcodec.h> +# include <libswscale/swscale.h> #endif #ifdef WITH_REDCODE -#ifdef _WIN32 /* on windows we use the one in extern instead */ -#include "libredcode/format.h" -#else -#include "libredcode/format.h" -#endif +# ifdef _WIN32 /* on windows we use the one in extern instead */ +# include "libredcode/format.h" +# else +# include "libredcode/format.h" +# endif #endif #include "IMB_imbuf_types.h" @@ -107,12 +108,12 @@ #define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff)) /* more endianness... should move to a separate file... */ -#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -#define GET_ID GET_BIG_LONG -#define LITTLE_LONG SWAP_LONG +#ifdef __BIG_ENDIAN__ +# define GET_ID GET_BIG_LONG +# define LITTLE_LONG SWAP_LONG #else -#define GET_ID GET_LITTLE_LONG -#define LITTLE_LONG ENDIAN_NOP +# define GET_ID GET_LITTLE_LONG +# define LITTLE_LONG ENDIAN_NOP #endif /* anim.curtype, runtime only */ diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index f55420fd106..bd5a455df98 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -28,7 +28,7 @@ #define IMB_INDEXER_H #ifdef WIN32 -#include <io.h> +# include <io.h> #endif #include <stdlib.h> diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h index cd7d385ed92..22481241812 100644 --- a/source/blender/imbuf/intern/imbuf.h +++ b/source/blender/imbuf/intern/imbuf.h @@ -44,7 +44,7 @@ #include <stdio.h> #ifndef WIN32 -#include <unistd.h> +# include <unistd.h> #endif #include <fcntl.h> @@ -53,11 +53,8 @@ #include <math.h> #ifndef WIN32 -#include <sys/mman.h> -#endif - -#if !defined(WIN32) -#define O_BINARY 0 +# include <sys/mman.h> +# define O_BINARY 0 #endif #define SWAP_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) @@ -65,16 +62,16 @@ #define ENDIAN_NOP(x) (x) -#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__hppa__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__)) -#define LITTLE_SHORT SWAP_SHORT -#define LITTLE_LONG SWAP_LONG -#define BIG_SHORT ENDIAN_NOP -#define BIG_LONG ENDIAN_NOP +#ifdef __BIG_ENDIAN__ +# define LITTLE_SHORT SWAP_SHORT +# define LITTLE_LONG SWAP_LONG +# define BIG_SHORT ENDIAN_NOP +# define BIG_LONG ENDIAN_NOP #else -#define LITTLE_SHORT ENDIAN_NOP -#define LITTLE_LONG ENDIAN_NOP -#define BIG_SHORT SWAP_SHORT -#define BIG_LONG SWAP_LONG +# define LITTLE_SHORT ENDIAN_NOP +# define LITTLE_LONG ENDIAN_NOP +# define BIG_SHORT SWAP_SHORT +# define BIG_LONG SWAP_LONG #endif typedef unsigned char uchar; diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index af7f098585e..4872896bf3a 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -25,9 +25,6 @@ * \ingroup imbuf */ - -#ifdef WITH_OPENJPEG - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" @@ -751,5 +748,3 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) { return 1; } - -#endif /* WITH_OPENJPEG */ diff --git a/source/blender/imbuf/intern/md5.c b/source/blender/imbuf/intern/md5.c index 18148143eb9..2192fa32f19 100644 --- a/source/blender/imbuf/intern/md5.c +++ b/source/blender/imbuf/intern/md5.c @@ -28,11 +28,11 @@ #include "md5.h" -#ifdef WORDS_BIGENDIAN -# define SWAP(n) \ +#ifdef __BIG_ENDIAN__ +# define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else -# define SWAP(n) (n) +# define SWAP(n) (n) #endif diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index ddddec1c09f..9dd330ca88b 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -33,9 +33,6 @@ * \ingroup imbuf */ - -#ifdef WITH_HDR - /* ---------------------------------------------------------------------- Radiance High Dynamic Range image file IO For description and code for reading/writing of radiance hdr files @@ -45,7 +42,7 @@ */ #ifdef WIN32 -#include <io.h> +# include <io.h> #endif #include "MEM_guardedalloc.h" @@ -369,5 +366,3 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags) fclose(file); return 1; } - -#endif /* WITH_HDR */ diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 7beb853fe62..ccb271393a4 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -45,8 +45,6 @@ * used to compress images. */ -#ifdef WITH_TIFF - #include <string.h> #include "imbuf.h" @@ -836,5 +834,3 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags) if(pixels16) _TIFFfree(pixels16); return (1); } - -#endif /* WITH_TIFF */ diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 906704c8406..0fdb84617ad 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -146,16 +146,16 @@ typedef struct PreviewImage { * **/ -#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -/* big endian */ -#define MAKE_ID2(c, d) ( (c)<<8 | (d) ) -#define MOST_SIG_BYTE 0 -#define BBIG_ENDIAN +#ifdef __BIG_ENDIAN__ + /* big endian */ +# define MAKE_ID2(c, d) ( (c)<<8 | (d) ) +# define MOST_SIG_BYTE 0 +# define BBIG_ENDIAN #else -/* little endian */ -#define MAKE_ID2(c, d) ( (d)<<8 | (c) ) -#define MOST_SIG_BYTE 1 -#define BLITTLE_ENDIAN + /* little endian */ +# define MAKE_ID2(c, d) ( (d)<<8 | (c) ) +# define MOST_SIG_BYTE 1 +# define BLITTLE_ENDIAN #endif /* ID from database */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index e94e394d255..35b905a71bf 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -74,6 +74,14 @@ typedef struct VolumeSettings { float ms_spread; } VolumeSettings; +/* Game Engine Options (old Texface mode, transp and flag) */ +typedef struct GameSettings { + int flag; + int alpha_blend; + int face_orientation; + int pad1; +} GameSettings; + typedef struct Material { ID id; struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ @@ -90,6 +98,7 @@ typedef struct Material { /* end synced with render_types.h */ struct VolumeSettings vol; + struct GameSettings game; float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; @@ -169,12 +178,39 @@ typedef struct Material { ListBase gpumaterial; /* runtime */ } Material; + +/* **************** GAME PROPERTIES ********************* */ +// Blend Transparency Options - alpha_blend /* match GPU_material::GPUBlendMode */ +#define GEMAT_SOLID 0 /* GPU_BLEND_SOLID */ +#define GEMAT_ADD 1 /* GPU_BLEND_ADD */ +#define GEMAT_ALPHA 2 /* GPU_BLEND_ALPHA */ +#define GEMAT_CLIP 4 /* GPU_BLEND_CLIP */ +#define GEMAT_ALPHA_SORT 8 /* GPU_BLEND_ALPHA_SORT */ + +// Game Options - flag +#define GEMAT_BACKCULL 16 /* KX_BACKCULL */ +#define GEMAT_SHADED 32 /* KX_LIGHT */ +#define GEMAT_TEXT 64 /* RAS_RENDER_3DPOLYGON_TEXT */ +#define GEMAT_NOPHYSICS 128 +#define GEMAT_INVISIBLE 256 + +// Face Orientation Options - face_orientation +#define GEMAT_NORMAL 0 +#define GEMAT_HALO 512 /* BILLBOARD_SCREENALIGNED */ +#define GEMAT_BILLBOARD 1024 /* BILLBOARD_AXISALIGNED */ +#define GEMAT_SHADOW 2048 /* SHADOW */ + +// Use Textures - not defined directly in the UI +#define GEMAT_TEX 4096 /* KX_TEX */ + + /* **************** MATERIAL ********************* */ /* maximum number of materials per material array. * (on object, mesh, lamp, etc.). limited by - * short mat_nr in verts, faces. */ -#define MAXMAT 32767 + * short mat_nr in verts, faces. + * -1 becayse for active material we store the index + 1 */ +#define MAXMAT (32767-1) /* material_type */ #define MA_TYPE_SURFACE 0 diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 6ad60ac2df9..25bb4958c97 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -125,7 +125,7 @@ typedef struct TFace { #define ME_EDIT_PAINT_MASK (1 << 3) #define ME_EDIT_MIRROR_TOPO (1 << 4) - +#define ME_EDIT_VERT_SEL (1 << 5) /* me->flag */ /* #define ME_ISDONE 1 */ diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 61c4a660992..9d7375b6755 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -247,6 +247,8 @@ typedef struct MRecast{ #define TF_SHAREDVERT 8 #define TF_LIGHT 16 +#define TF_CONVERTED 32 /* tface converted to material */ + #define TF_SHAREDCOL 64 #define TF_TILES 128 /* deprecated */ #define TF_BILLBOARD 256 diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index ed060d58123..e9e78ab25d3 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -75,6 +75,7 @@ typedef enum ModifierType { eModifierType_WeightVGMix, eModifierType_WeightVGProximity, eModifierType_NavMesh, + eModifierType_DynamicPaint, /* reserve slot */ NUM_MODIFIER_TYPES } ModifierType; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 8750ee9e906..f32f8d626de 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -62,9 +62,14 @@ struct bGPdata; typedef struct bDeformGroup { struct bDeformGroup *next, *prev; char name[32]; + /* need this flag for locking weights */ + char flag, pad[7]; } bDeformGroup; #define MAX_VGROUP_NAME 32 +/* bDeformGroup->flag */ +#define DG_LOCK_WEIGHT 1 + /** * The following illustrates the orientation of the * bounding box in local space diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index aa0a41680ec..9bcaf46f0d7 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -764,9 +764,10 @@ typedef struct ToolSettings { short snap_flag, snap_target; short proportional, prop_mode; char proportional_objects; /* proportional edit, object mode */ - char pad[3]; + char pad[5]; - int auto_normalize; /*auto normalizing mode in wpaint*/ + char auto_normalize; /*auto normalizing mode in wpaint*/ + char multipaint; /* paint multiple bones in wpaint */ short sculpt_paint_settings; /* user preferences for sculpt and paint */ short pad1; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index d3ac09dc812..05b16f869a8 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -510,8 +510,8 @@ extern UserDef U; /* from blenkernel blender.c */ /* transopts */ #define USER_TR_TOOLTIPS (1 << 0) -#define USER_TR_BUTTONS (1 << 1) -#define USER_TR_MENUS (1 << 2) +#define USER_TR_IFACE (1 << 1) +/*#define USER_TR_MENUS (1 << 2) deprecated*/ /*#define USER_TR_FILESELECT (1 << 3) deprecated*/ /*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/ #define USER_DOTRANSLATE (1 << 5) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 6bf5d33998d..b56c536c0c3 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -49,7 +49,10 @@ struct Scene; extern BlenderRNA BLENDER_RNA; extern StructRNA RNA_Action; extern StructRNA RNA_ActionConstraint; +extern StructRNA RNA_ActionFCurves; extern StructRNA RNA_ActionGroup; +extern StructRNA RNA_ActionGroups; +extern StructRNA RNA_ActionPoseMarkers; extern StructRNA RNA_Actuator; extern StructRNA RNA_ActuatorSensor; extern StructRNA RNA_Addon; @@ -190,6 +193,7 @@ extern StructRNA RNA_DelaySensor; extern StructRNA RNA_DisplaceModifier; extern StructRNA RNA_DistortedNoiseTexture; extern StructRNA RNA_DomainFluidSettings; +extern StructRNA RNA_DopeSheet; extern StructRNA RNA_Driver; extern StructRNA RNA_DriverTarget; extern StructRNA RNA_DriverVariable; @@ -264,11 +268,13 @@ extern StructRNA RNA_Key; extern StructRNA RNA_KeyConfig; extern StructRNA RNA_KeyMap; extern StructRNA RNA_KeyMapItem; +extern StructRNA RNA_KeyMapItems; extern StructRNA RNA_KeyboardSensor; extern StructRNA RNA_Keyframe; extern StructRNA RNA_KeyingSet; extern StructRNA RNA_KeyingSetInfo; extern StructRNA RNA_KeyingSetPath; +extern StructRNA RNA_KeyingSetsAll; extern StructRNA RNA_KinematicConstraint; extern StructRNA RNA_Lamp; extern StructRNA RNA_LampSkySettings; @@ -582,6 +588,7 @@ extern StructRNA RNA_UnknownType; extern StructRNA RNA_UserPreferences; extern StructRNA RNA_UserPreferencesEdit; extern StructRNA RNA_UserPreferencesFilePaths; +extern StructRNA RNA_UserPreferencesInput; extern StructRNA RNA_UserPreferencesSystem; extern StructRNA RNA_UserPreferencesView; extern StructRNA RNA_UserSolidLight; @@ -603,13 +610,13 @@ extern StructRNA RNA_WipeSequence; extern StructRNA RNA_WoodTexture; extern StructRNA RNA_World; extern StructRNA RNA_WorldAmbientOcclusion; +extern StructRNA RNA_WorldLighting; extern StructRNA RNA_WorldMistSettings; extern StructRNA RNA_WorldStarsSettings; extern StructRNA RNA_WorldTextureSlot; extern StructRNA RNA_XnorController; extern StructRNA RNA_XorController; - /* Pointer * * These functions will fill in RNA pointers, this can be done in three ways: @@ -719,6 +726,7 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name); int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description); void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free); +void RNA_property_enum_items_gettexted(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free); int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); int RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); int RNA_property_enum_name(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name); diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 10006ddca6b..c80150d558b 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -63,4 +63,7 @@ if env['OURPLATFORM'] == 'linux': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] +if env['WITH_BF_INTERNATIONAL']: + defs.append('INTERNATIONAL') + env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 1910baea6f2..79d4dfd72ca 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -220,6 +220,10 @@ if(WITH_OPENCOLLADA) add_definitions(-DWITH_COLLADA) endif() +if(WITH_INTERNATIONAL) + add_definitions(-DINTERNATIONAL) +endif() + # Build makesrna executable blender_include_dirs( . diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 5c2580e4b90..ef05875fe86 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -98,6 +98,9 @@ if env['OURPLATFORM'] == 'linux': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] +if env['WITH_BF_INTERNATIONAL']: + defs.append('INTERNATIONAL') + makesrna_tool.Append(CPPDEFINES=defs) makesrna_tool.Append (CPPPATH = Split(incs)) diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 727ab679df5..d4742375989 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -238,7 +238,7 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports, * owns the string pointer which it could potentually free while blender * is running. */ if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) { - BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME) ".", identifier); + BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier); return NULL; } @@ -417,16 +417,16 @@ static void rna_def_ID_materials(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials"); func= RNA_def_function(srna, "append", "material_append_id"); - RNA_def_function_ui_description(func, "Add a new material to the data block."); - parm= RNA_def_pointer(func, "material", "Material", "", "Material to add."); + RNA_def_function_ui_description(func, "Add a new material to the data block"); + parm= RNA_def_pointer(func, "material", "Material", "", "Material to add"); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "pop", "material_pop_id"); - RNA_def_function_ui_description(func, "Remove a material from the data block."); - parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove.", 0, MAXMAT); + RNA_def_function_ui_description(func, "Remove a material from the data block"); + parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned."); - parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove."); + RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned"); + parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove"); RNA_def_function_return(func, parm); } @@ -478,25 +478,26 @@ static void rna_def_ID(BlenderRNA *brna) /* functions */ func= RNA_def_function(srna, "copy", "rna_ID_copy"); - RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)."); - parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID."); + RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)"); + parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); - RNA_def_function_ui_description(func, "Clears the user count of a datablock so its not saved, on reload the data will be removed."); + RNA_def_function_ui_description(func, "Clears the user count of a datablock so its not saved, " + "on reload the data will be removed"); func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata"); - RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this."); - parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL."); + RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); + parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata"); - RNA_def_function_ui_description(func, "Clear animation on this this ID."); + RNA_def_function_ui_description(func, "Clear animation on this this ID"); func= RNA_def_function(srna, "update_tag", "rna_ID_update_tag"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Tag the id to update its display data."); - RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform."); + RNA_def_function_ui_description(func, "Tag the id to update its display data"); + RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform"); } static void rna_def_library(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 1ccd6d9a1d7..b7709416a75 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -43,6 +43,9 @@ #include "BLI_dynstr.h" #include "BLI_ghash.h" +#include "BLF_api.h" +#include "BLF_translation.h" + #include "BKE_animsys.h" #include "BKE_context.h" #include "BKE_idprop.h" @@ -449,8 +452,10 @@ static const char *rna_ensure_property_identifier(PropertyRNA *prop) static const char *rna_ensure_property_description(PropertyRNA *prop) { + const char *description= NULL; + if(prop->magic == RNA_MAGIC) - return prop->description; + description= prop->description; else { /* attempt to get the local ID values */ IDProperty *idp_ui= rna_idproperty_ui(prop); @@ -458,19 +463,36 @@ static const char *rna_ensure_property_description(PropertyRNA *prop) if(idp_ui) { IDProperty *item= IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING); if(item) - return IDP_String(item); + description= IDP_String(item); } - return ((IDProperty*)prop)->name; /* XXX - not correct */ + if(description == NULL) + description= ((IDProperty*)prop)->name; /* XXX - not correct */ } + +#ifdef INTERNATIONAL + if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_TOOLTIPS)) + description= BLF_gettext(description); +#endif + + return description; } static const char *rna_ensure_property_name(PropertyRNA *prop) { + const char *name; + if(prop->magic == RNA_MAGIC) - return prop->name; + name= prop->name; else - return ((IDProperty*)prop)->name; + name= ((IDProperty*)prop)->name; + +#ifdef INTERNATIONAL + if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) + name= BLF_gettext(name); +#endif + + return name; } /* Structs */ @@ -1125,6 +1147,7 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En *totitem= tot; } + } else { *item= eprop->item; @@ -1133,6 +1156,45 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En } } +void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free) +{ + RNA_property_enum_items(C, ptr, prop, item, totitem, free); + +#ifdef INTERNATIONAL + if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) { + int i; + EnumPropertyItem *nitem; + + if(*free) { + nitem= *item; + } else { + int totitem= 0; + + /* count */ + for(i=0; (*item)[i].identifier; i++) + totitem++; + + nitem= MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted"); + + for(i=0; (*item)[i].identifier; i++) + nitem[i]= (*item)[i]; + + *free= 1; + } + + for(i=0; nitem[i].identifier; i++) { + if( nitem[i].name ) + nitem[i].name = BLF_gettext(nitem[i].name); + if( nitem[i].description ) + nitem[i].description = BLF_gettext(nitem[i].description); + } + + *item= nitem; + } +#endif +} + + int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) { EnumPropertyItem *item, *item_array; @@ -2912,7 +2974,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro itemtype= RNA_property_type(itemprop); if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { - BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported."); + BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported"); return 0; } @@ -2923,7 +2985,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { int arraylen = (itemlen == 0) ? 1 : itemlen; if(in.len != arraylen*out.len) { - BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d).", out.len*arraylen, in.len); + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len*arraylen, in.len); return 0; } @@ -2979,13 +3041,13 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro itemtype= RNA_property_type(iprop); } else { - BKE_reportf(reports, RPT_ERROR, "Property named %s not found.", propname); + BKE_reportf(reports, RPT_ERROR, "Property named %s not found", propname); err= 1; break; } if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { - BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported."); + BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported"); err= 1; break; } @@ -2994,7 +3056,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro /* editable check */ if(!set || RNA_property_editable(&itemptr, iprop)) { if(a+itemlen > in.len) { - BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len); + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more)", in.len); err= 1; break; } diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 69f137c9f20..433db55b1e3 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -495,8 +495,8 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups"); func= RNA_def_function(srna, "new", "rna_Action_groups_new"); - RNA_def_function_ui_description(func, "Add a keyframe to the curve."); - parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group."); + RNA_def_function_ui_description(func, "Add a keyframe to the curve"); + parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group"); @@ -504,9 +504,9 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "rna_Action_groups_remove"); - RNA_def_function_ui_description(func, "Remove action group."); + RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove."); + parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -523,21 +523,21 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Action FCurves", "Collection of action fcurves"); func= RNA_def_function(srna, "new", "rna_Action_fcurve_new"); - RNA_def_function_ui_description(func, "Add a keyframe to the curve."); + RNA_def_function_ui_description(func, "Add a keyframe to the curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "FCurve data path to use."); + parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "FCurve data path to use"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index.", 0, INT_MAX); - RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this fcurve into."); + RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX); + RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this fcurve into"); parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created fcurve"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Action_fcurve_remove"); - RNA_def_function_ui_description(func, "Remove action group."); + RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "FCurve to remove."); + parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "FCurve to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -555,18 +555,18 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers"); func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new"); - RNA_def_function_ui_description(func, "Add a pose marker to the action."); + RNA_def_function_ui_description(func, "Add a pose marker to the action"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)."); + parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove"); - RNA_def_function_ui_description(func, "Remove a timeline marker."); + RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove."); + parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 6aff68a9c09..43cf1fae931 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -861,7 +861,7 @@ static void rna_def_camera_actuator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "CameraActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Camera Actuator", "Actuator to .."); + RNA_def_struct_ui_text(srna, "Camera Actuator", "Actuator to..."); RNA_def_struct_sdna_from(srna, "bCameraActuator", "data"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); @@ -1387,7 +1387,7 @@ static void rna_def_scene_actuator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SceneActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Scene Actuator", "Actuator to .."); + RNA_def_struct_ui_text(srna, "Scene Actuator", "Actuator to..."); RNA_def_struct_sdna_from(srna, "bSceneActuator", "data"); prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); @@ -1445,7 +1445,7 @@ static void rna_def_random_actuator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RandomActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Random Actuator", "Actuator to .."); + RNA_def_struct_ui_text(srna, "Random Actuator", "Actuator to..."); RNA_def_struct_sdna_from(srna, "bRandomActuator", "data"); prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); @@ -1562,7 +1562,7 @@ static void rna_def_message_actuator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MessageActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Message Actuator", "Actuator to .."); + RNA_def_struct_ui_text(srna, "Message Actuator", "Actuator to..."); RNA_def_struct_sdna_from(srna, "bMessageActuator", "data"); prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE); @@ -1877,7 +1877,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator"); - RNA_def_struct_ui_text(srna, "Armature Actuator", "Actuator to .."); + RNA_def_struct_ui_text(srna, "Armature Actuator", "Actuator to..."); RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data"); prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c index 3c1f78c21c3..c3f9ff35279 100644 --- a/source/blender/makesrna/intern/rna_actuator_api.c +++ b/source/blender/makesrna/intern/rna_actuator_api.c @@ -61,14 +61,14 @@ void RNA_api_actuator(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "link", "rna_Actuator_link"); - RNA_def_function_ui_description(func, "Link the actuator to a controller."); - parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to."); + RNA_def_function_ui_description(func, "Link the actuator to a controller"); + parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_update(parm, NC_LOGIC, NULL); func= RNA_def_function(srna, "unlink", "rna_Actuator_unlink"); - RNA_def_function_ui_description(func, "Unlink the actuator from a controller."); - parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from."); + RNA_def_function_ui_description(func, "Unlink the actuator from a controller"); + parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_update(parm, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 2f5f22c52d5..702529fde53 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -188,7 +188,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v return NULL; if (strlen(identifier) >= sizeof(dummyksi.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering keying set info class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyksi.idname)); + BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummyksi.idname)); return NULL; } @@ -353,7 +353,7 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report keyingset->active_path= BLI_countlist(&keyingset->paths); } else { - BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added."); + BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added"); } /* return added path */ @@ -372,7 +372,7 @@ static void rna_KeyingSet_paths_remove(KeyingSet *keyingset, ReportList *reports keyingset->active_path = 0; } else { - BKE_report(reports, RPT_ERROR, "Keying Set Path could not be removed."); + BKE_report(reports, RPT_ERROR, "Keying Set Path could not be removed"); } } @@ -392,7 +392,7 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports) keyingset->active_path = 0; } else { - BKE_report(reports, RPT_ERROR, "Keying Set Paths could not be removed."); + BKE_report(reports, RPT_ERROR, "Keying Set Paths could not be removed"); } } @@ -608,27 +608,31 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) /* Add Path */ func= RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); - RNA_def_function_ui_description(func, "Add a new path for the Keying Set."); + RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* return arg */ parm= RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); RNA_def_function_return(func, parm); /* ID-block for target */ - parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination."); + parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination"); RNA_def_property_flag(parm, PROP_REQUIRED); /* rna-path */ - parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough + parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); // xxx hopefully this is long enough RNA_def_property_flag(parm, PROP_REQUIRED); /* index (defaults to -1 for entire array) */ - RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX); + RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", + "The index of the destination property (i.e. axis of Location/Rotation/etc.), " + "or -1 for the entire array", 0, INT_MAX); /* grouping */ - RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use."); - RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name)."); + RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, + "Grouping Method", "Method used to define which Group-name to use"); + RNA_def_string(func, "group_name", "", 64, "Group Name", + "Name of Action Group to assign destination to (only if grouping mode is to use this name)"); /* Remove Path */ func= RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove"); - RNA_def_function_ui_description(func, "Remove the given path from the Keying Set."); + RNA_def_function_ui_description(func, "Remove the given path from the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* path to remove */ parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); @@ -637,7 +641,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) /* Remove All Paths */ func= RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear"); - RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set."); + RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -713,15 +717,15 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_NlaTrack_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Add a new NLA Track"); - RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after."); + RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after"); /* return type */ - parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track."); + parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Remove a NLA Track."); - parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove."); + RNA_def_function_ui_description(func, "Remove a NLA Track"); + parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -751,7 +755,7 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add a new driver given an existing one"); RNA_def_pointer(func, "src_driver", "FCurve", "", "Existing Driver F-Curve to use as template for a new one"); /* return type */ - parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve."); + parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve"); RNA_def_function_return(func, parm); } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 4ed5d2a125a..ec928415876 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -103,7 +103,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value) EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name) { if(arm->edbo==NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone.", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2); return NULL; } return ED_armature_edit_bone_add(arm, name); @@ -112,12 +112,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone) { if(arm->edbo==NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone.", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2); return; } if(BLI_findindex(arm->edbo, ebone) == -1) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'.", arm->id.name+2, ebone->name); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name); return; } @@ -787,7 +787,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) /* add target */ func= RNA_def_function(srna, "new", "rna_Armature_edit_bone_new"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Add a new bone."); + RNA_def_function_ui_description(func, "Add a new bone"); parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the bone"); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index fd9ae7f11c2..b65122835f1 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -62,7 +62,8 @@ void RNA_api_armature_edit_bone(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll"); - RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis points in the direction of the vector given."); + RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis " + "points in the direction of the vector given"); parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -73,8 +74,9 @@ void RNA_api_bone(StructRNA *srna) FunctionRNA *func; func= RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope"); - RNA_def_function_ui_description(func, "Calculate bone envelope at given point."); - parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); + RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); + parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", + "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* return value */ parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 144509f4743..338c93bb96a 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -487,13 +487,13 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element."); + parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove"); RNA_def_function_ui_description(func, "Delete element from ColorRamp"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove."); + parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c index d9defe3f8aa..4d16633b9cd 100644 --- a/source/blender/makesrna/intern/rna_controller_api.c +++ b/source/blender/makesrna/intern/rna_controller_api.c @@ -68,17 +68,17 @@ void RNA_api_controller(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "link", "rna_Controller_link"); - RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator."); - parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to."); + RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator"); + parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to"); RNA_def_property_update(parm, NC_LOGIC, NULL); - parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to."); + parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to"); RNA_def_property_update(parm, NC_LOGIC, NULL); func= RNA_def_function(srna, "unlink", "rna_Controller_unlink"); - RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator."); - parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from."); + RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator"); + parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from"); RNA_def_property_update(parm, NC_LOGIC, NULL); - parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from."); + parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from"); RNA_def_property_update(parm, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 3cf6feb005c..5d0c1db572d 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -74,6 +74,20 @@ EnumPropertyItem curve_type_items[] = { {CU_NURBS, "NURBS", 0, "Ease", ""}, {0, NULL, 0, NULL, NULL}}; +static const EnumPropertyItem curve3d_fill_mode_items[]= { + {0, "FULL", 0, "Full", ""}, + {CU_BACK, "BACK", 0, "Back", ""}, + {CU_FRONT, "FRONT", 0, "Front", ""}, + {CU_FRONT|CU_BACK, "HALF", 0, "Half", ""}, + {0, NULL, 0, NULL, NULL}}; + +static const EnumPropertyItem curve2d_fill_mode_items[]= { + {0, "NONE", 0, "None", ""}, + {CU_BACK, "BACK", 0, "Back", ""}, + {CU_FRONT, "FRONT", 0, "Front", ""}, + {CU_FRONT|CU_BACK, "BOTH", 0, "Both", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "BLI_math.h" @@ -278,6 +292,13 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value) } } +static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) +{ + Curve *cu= (Curve*)ptr->id.data; + + /* cast to quiet warning it IS a const still */ + return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items); +} static int rna_Nurb_length(PointerRNA *ptr) { @@ -1130,15 +1151,15 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points"); func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add"); - RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_ui_description(func, "Add a number of points to this spline"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX); /* func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ } @@ -1157,15 +1178,15 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points"); func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add"); - RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_ui_description(func, "Add a number of points to this spline"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); /* func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ } @@ -1185,16 +1206,16 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines"); func= RNA_def_function(srna, "new", "rna_Curve_spline_new"); - RNA_def_function_ui_description(func, "Add a new spline to the curve."); - parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); + RNA_def_function_ui_description(func, "Add a new spline to the curve"); + parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -1345,14 +1366,11 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "use_fill_front", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT); - RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves"); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - - prop= RNA_def_property(srna, "use_fill_back", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK); - RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves"); + prop= RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, curve3d_fill_mode_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Curve_fill_mode_itemf"); + RNA_def_property_ui_text(prop, "Fill Mode", "Mode of filling curve"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index c0c8ac6b88a..11eec6a0a47 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -410,7 +410,7 @@ DriverVar *rna_Driver_new_variable(ChannelDriver *driver) void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, DriverVar *dvar) { if(BLI_findindex(&driver->variables, dvar) == -1) { - BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver."); + BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver"); return; } @@ -439,7 +439,7 @@ static FModifier *rna_FCurve_modifiers_new(FCurve *fcu, int type) static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModifier *fcm) { if(BLI_findindex(&fcu->modifiers, fcm) == -1) { - BKE_reportf(reports, RPT_ERROR, "FCurveModifier '%s' not found in fcurve.", fcm->name); + BKE_reportf(reports, RPT_ERROR, "F-Curve modifier '%s' not found in F-Curve", fcm->name); return; } remove_fmodifier(&fcu->modifiers, fcm); @@ -612,7 +612,7 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri { int index= (int)(bezt - fcu->bezt); if (index < 0 || index >= fcu->totvert) { - BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve."); + BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve"); return; } @@ -1212,17 +1212,17 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop /* add variable */ func= RNA_def_function(srna, "new", "rna_Driver_new_variable"); - RNA_def_function_ui_description(func, "Add a new variable for the driver."); + RNA_def_function_ui_description(func, "Add a new variable for the driver"); /* return type */ - parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable."); + parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable"); RNA_def_function_return(func, parm); /* remove variable */ func= RNA_def_function(srna, "remove", "rna_Driver_remove_variable"); - RNA_def_function_ui_description(func, "Remove an existing variable from the driver."); + RNA_def_function_ui_description(func, "Remove an existing variable from the driver"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* target to remove */ - parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver."); + parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -1402,17 +1402,17 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_FCurve_modifiers_new"); RNA_def_function_ui_description(func, "Add a constraint to this object"); /* return type */ - parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier."); + parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier"); RNA_def_function_return(func, parm); /* object to add */ - parm= RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add."); + parm= RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add"); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a modifier from this fcurve."); + RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve"); /* modifier to remove */ - parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier."); + parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -1436,25 +1436,25 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points"); func= RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert"); - RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve."); + RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); parm= RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", "X Value of this keyframe point", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", "Y Value of this keyframe point", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options."); + RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options"); parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "add", "rna_FKeyframe_points_add"); - RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve."); + RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX); func= RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove"); - RNA_def_function_ui_description(func, "Remove keyframe from an fcurve."); + RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove."); + parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* optional */ RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); @@ -1569,15 +1569,15 @@ static void rna_def_fcurve(BlenderRNA *brna) /* Functions */ func= RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */ - RNA_def_function_ui_description(func, "Evaluate fcurve."); - parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate fcurve at given frame", -FLT_MAX, FLT_MAX); + RNA_def_function_ui_description(func, "Evaluate F-Curve"); + parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* return value */ - parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "FCurve position", -FLT_MAX, FLT_MAX); + parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "F-Curve position", -FLT_MAX, FLT_MAX); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "range", "rna_fcurve_range"); - RNA_def_function_ui_description(func, "Get the time extents for F-Curve."); + RNA_def_function_ui_description(func, "Get the time extents for F-Curve"); /* return value */ parm= RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_THICK_WRAP); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 9811d7bd797..810db9f3634 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -280,16 +280,16 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop) #if 0 func= RNA_def_function(srna, "new", "rna_GPencil_layer_new"); - RNA_def_function_ui_description(func, "Add a new spline to the curve."); - parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); + RNA_def_function_ui_description(func, "Add a new spline to the curve"); + parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); #endif diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 5d71d204a72..597f05ed9f6 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -56,7 +56,7 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object) { if(!add_to_group(group, object, CTX_data_scene(C), NULL)) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\".", object->id.name+2, group->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2); return; } @@ -66,7 +66,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object) { if(!rem_from_group(group, object, CTX_data_scene(C), NULL)) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\".", object->id.name+2, group->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2); return; } @@ -94,7 +94,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add this object to a group"); /* object to add */ - parm= RNA_def_pointer(func, "object", "Object", "", "Object to add."); + parm= RNA_def_pointer(func, "object", "Object", "", "Object to add"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* remove object */ @@ -102,7 +102,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove this object to a group"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); /* object to remove */ - parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove."); + parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); } diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 7327c7203b9..b7827989a94 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -37,6 +37,9 @@ #include <time.h> #include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "DNA_packedFile_types.h" #include "BIF_gl.h" @@ -127,6 +130,38 @@ static void rna_Image_save(Image *image, ReportList *reports) } } +static void rna_Image_pack(Image *image, ReportList *reports, int as_png) +{ + ImBuf *ibuf = BKE_image_get_ibuf(image, NULL); + + if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) { + BKE_reportf(reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG"); + } + else { + if(as_png) { + BKE_image_memorypack(image); + } + else { + image->packedfile= newPackedFile(reports, image->name); + } + } +} + +static void rna_Image_unpack(Image *image, ReportList *reports, int method) +{ + if (!image->packedfile) { + BKE_report(reports, RPT_ERROR, "Image not packed"); + } + else if (image->source==IMA_SRC_SEQUENCE || image->source==IMA_SRC_MOVIE) { + BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported"); + return; + } + else { + /* reports its own error on failier */ + unpackImage (reports, image, method); + } +} + static void rna_Image_reload(Image *image) { BKE_image_signal(image, NULL, IMA_SIGNAL_RELOAD); @@ -203,7 +238,7 @@ void RNA_api_image(StructRNA *srna) func= RNA_def_function(srna, "save_render", "rna_Image_save_render"); RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path."); + parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); @@ -211,6 +246,16 @@ void RNA_api_image(StructRNA *srna) RNA_def_function_ui_description(func, "Save image to its source path"); RNA_def_function_flag(func, FUNC_USE_REPORTS); + func= RNA_def_function(srna, "pack", "rna_Image_pack"); + RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)"); + + func= RNA_def_function(srna, "unpack", "rna_Image_unpack"); + RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_enum(func, "method", unpack_method_items, PF_USE_LOCAL, "method", "How to unpack"); + func= RNA_def_function(srna, "reload", "rna_Image_reload"); RNA_def_function_ui_description(func, "Reload the image from its source path"); @@ -221,8 +266,10 @@ void RNA_api_image(StructRNA *srna) func= RNA_def_function(srna, "gl_load", "rna_Image_gl_load"); RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", "The texture minifying function", -INT_MAX, INT_MAX); - RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", "The texture magnification function", -INT_MAX, INT_MAX); + RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", + "The texture minifying function", -INT_MAX, INT_MAX); + RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", + "The texture magnification function", -INT_MAX, INT_MAX); /* return value */ parm= RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index c7ff420b3ad..04ad1fa0eef 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -287,34 +287,34 @@ void RNA_def_main(BlenderRNA *brna) /* plural must match idtypes in readblenentry.c */ MainCollectionDef lists[]= { - {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", RNA_def_main_cameras}, - {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", RNA_def_main_scenes}, - {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", RNA_def_main_objects}, - {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", RNA_def_main_materials}, - {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", RNA_def_main_node_groups}, - {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", RNA_def_main_meshes}, - {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", RNA_def_main_lamps}, - {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", RNA_def_main_libraries}, - {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", RNA_def_main_screens}, - {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", RNA_def_main_window_managers}, - {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks.", RNA_def_main_images}, - {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", RNA_def_main_lattices}, - {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", RNA_def_main_curves} , - {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", RNA_def_main_metaballs}, - {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks.", RNA_def_main_fonts}, - {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", RNA_def_main_textures}, - {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", RNA_def_main_brushes}, - {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", RNA_def_main_worlds}, - {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", RNA_def_main_groups}, - {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks.", NULL}, - {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL}, - {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts}, - {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks.", RNA_def_main_speakers}, - {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds}, - {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures}, - {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions}, - {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", RNA_def_main_particles}, - {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", RNA_def_main_gpencil}, + {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras}, + {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes}, + {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects}, + {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials}, + {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups}, + {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes}, + {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps}, + {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries}, + {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens}, + {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers}, + {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images}, + {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices}, + {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves} , + {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks", RNA_def_main_metaballs}, + {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks", RNA_def_main_fonts}, + {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks", RNA_def_main_textures}, + {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks", RNA_def_main_brushes}, + {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks", RNA_def_main_worlds}, + {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks", RNA_def_main_groups}, + {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks", NULL}, + {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED)", NULL}, + {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts}, + {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers}, + {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds}, + {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures}, + {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions}, + {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles}, + {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil}, {"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style datablocks.", RNA_def_main_linestyles}, {NULL, NULL, NULL, NULL, NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 505ddfaefbf..c0613310b60 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -104,7 +104,8 @@ void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *ca if(ID_REAL_USERS(camera) <= 0) free_libblock(&bmain->camera, camera); else - BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d.", camera->id.name+2, ID_REAL_USERS(camera)); + BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d", + camera->id.name+2, ID_REAL_USERS(camera)); /* XXX python now has invalid pointer? */ } @@ -123,7 +124,7 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc else if(scene->id.next) newscene= scene->id.next; else { - BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed.", scene->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2); return; } @@ -169,7 +170,7 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha if(RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0) idname= "UNKNOWN"; - BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object.", idname); + BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object", idname); return NULL; } } @@ -193,7 +194,8 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob free_libblock(&bmain->object, object); } else { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d.", object->id.name+2, ID_REAL_USERS(object)); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d", + object->id.name+2, ID_REAL_USERS(object)); } } @@ -208,7 +210,8 @@ void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material if(ID_REAL_USERS(material) <= 0) free_libblock(&bmain->mat, material); else - BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d.", material->id.name+2, ID_REAL_USERS(material)); + BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d", + material->id.name+2, ID_REAL_USERS(material)); /* XXX python now has invalid pointer? */ } @@ -225,7 +228,8 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree if(ID_REAL_USERS(tree) <= 0) free_libblock(&bmain->nodetree, tree); else - BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d.", tree->id.name+2, ID_REAL_USERS(tree)); + BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d", + tree->id.name+2, ID_REAL_USERS(tree)); /* XXX python now has invalid pointer? */ } @@ -241,7 +245,8 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh) if(ID_REAL_USERS(mesh) <= 0) free_libblock(&bmain->mesh, mesh); else - BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d.", mesh->id.name+2, ID_REAL_USERS(mesh)); + BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d", + mesh->id.name+2, ID_REAL_USERS(mesh)); /* XXX python now has invalid pointer? */ } @@ -258,7 +263,8 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) if(ID_REAL_USERS(lamp) <= 0) free_libblock(&bmain->lamp, lamp); else - BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d.", lamp->id.name+2, ID_REAL_USERS(lamp)); + BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d", + lamp->id.name+2, ID_REAL_USERS(lamp)); /* XXX python now has invalid pointer? */ } @@ -278,7 +284,8 @@ Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char ima= BKE_add_image_file(filepath); if(!ima) - BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format"); + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, + errno ? strerror(errno) : "Unsupported image format"); return ima; } @@ -287,7 +294,8 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image) if(ID_REAL_USERS(image) <= 0) free_libblock(&bmain->image, image); else - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image)); + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d", + image->id.name+2, ID_REAL_USERS(image)); /* XXX python now has invalid pointer? */ } @@ -303,7 +311,8 @@ void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice * if(ID_REAL_USERS(lt) <= 0) free_libblock(&bmain->latt, lt); else - BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt)); + BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d", + lt->id.name+2, ID_REAL_USERS(lt)); } Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type) @@ -317,7 +326,8 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu) if(ID_REAL_USERS(cu) <= 0) free_libblock(&bmain->curve, cu); else - BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu)); + BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d", + cu->id.name+2, ID_REAL_USERS(cu)); } MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name) @@ -331,7 +341,8 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall if(ID_REAL_USERS(mb) <= 0) free_libblock(&bmain->mball, mb); else - BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb)); + BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d", + mb->id.name+2, ID_REAL_USERS(mb)); } VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) @@ -342,7 +353,8 @@ VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char font= load_vfont(filepath); if(!font) - BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported font format"); + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, + errno ? strerror(errno) : "Unsupported font format"); return font; @@ -352,7 +364,8 @@ void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont) if(ID_REAL_USERS(vfont) <= 0) free_libblock(&bmain->vfont, vfont); else - BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d.", vfont->id.name+2, ID_REAL_USERS(vfont)); + BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d", + vfont->id.name+2, ID_REAL_USERS(vfont)); /* XXX python now has invalid pointer? */ } @@ -369,7 +382,8 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex) if(ID_REAL_USERS(tex) <= 0) free_libblock(&bmain->tex, tex); else - BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex)); + BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d", + tex->id.name+2, ID_REAL_USERS(tex)); } Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name) @@ -383,7 +397,8 @@ void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *bru if(ID_REAL_USERS(brush) <= 0) free_libblock(&bmain->brush, brush); else - BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush)); + BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d", + brush->id.name+2, ID_REAL_USERS(brush)); } World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name) @@ -397,7 +412,8 @@ void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *worl if(ID_REAL_USERS(world) <= 0) free_libblock(&bmain->world, world); else - BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d.", world->id.name+2, ID_REAL_USERS(world)); + BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d", + world->id.name+2, ID_REAL_USERS(world)); } Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name) @@ -422,7 +438,8 @@ void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker if(ID_REAL_USERS(speaker) <= 0) free_libblock(&bmain->speaker, speaker); else - BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d.", speaker->id.name+2, ID_REAL_USERS(speaker)); + BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d", + speaker->id.name+2, ID_REAL_USERS(speaker)); /* XXX python now has invalid pointer? */ } @@ -446,7 +463,8 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath txt= add_text(filepath, bmain->name); if(!txt) - BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load text"); + BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, + errno ? strerror(errno) : "Unable to load text"); return txt; } @@ -462,7 +480,8 @@ void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm) if(ID_REAL_USERS(arm) <= 0) free_libblock(&bmain->armature, arm); else - BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d.", arm->id.name+2, ID_REAL_USERS(arm)); + BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d", + arm->id.name+2, ID_REAL_USERS(arm)); /* XXX python now has invalid pointer? */ } @@ -479,7 +498,8 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act) if(ID_REAL_USERS(act) <= 0) free_libblock(&bmain->action, act); else - BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d.", act->id.name+2, ID_REAL_USERS(act)); + BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d", + act->id.name+2, ID_REAL_USERS(act)); /* XXX python now has invalid pointer? */ } @@ -495,7 +515,8 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting if(ID_REAL_USERS(part) <= 0) free_libblock(&bmain->particle, part); else - BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d.", part->id.name+2, ID_REAL_USERS(part)); + BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d", + part->id.name+2, ID_REAL_USERS(part)); /* XXX python now has invalid pointer? */ } @@ -559,10 +580,10 @@ void RNA_api_main(StructRNA *srna) * for now they are all in collections bpy.data.images.new(...) */ /* func= RNA_def_function(srna, "add_image", "rna_Main_add_image"); - RNA_def_function_ui_description(func, "Add a new image."); - parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from."); + RNA_def_function_ui_description(func, "Add a new image"); + parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "image", "Image", "", "New image."); + parm= RNA_def_pointer(func, "image", "Image", "", "New image"); RNA_def_function_return(func, parm); */ @@ -581,16 +602,16 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_cameras_new"); RNA_def_function_ui_description(func, "Add a new camera to the main database"); - parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock."); + parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_cameras_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a camera from the current blendfile."); - parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove."); + RNA_def_function_ui_description(func, "Remove a camera from the current blendfile"); + parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_cameras_tag"); @@ -611,16 +632,16 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_scenes_new"); RNA_def_function_ui_description(func, "Add a new scene to the main database"); - parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock."); + parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a scene from the current blendfile."); - parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove."); + RNA_def_function_ui_description(func, "Remove a scene from the current blendfile"); + parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -638,19 +659,19 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_objects_new"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new object to the main database"); - parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object."); + parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock."); + parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_objects_remove"); - RNA_def_function_ui_description(func, "Remove a object from the current blendfile."); + RNA_def_function_ui_description(func, "Remove a object from the current blendfile"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove."); + parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_objects_tag"); @@ -671,16 +692,16 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_materials_new"); RNA_def_function_ui_description(func, "Add a new material to the main database"); - parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock."); + parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_materials_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a material from the current blendfile."); - parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove."); + RNA_def_function_ui_description(func, "Remove a material from the current blendfile"); + parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_materials_tag"); @@ -706,18 +727,18 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_nodetree_new"); RNA_def_function_ui_description(func, "Add a new node tree to the main database"); - parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock."); + parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile."); - parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove."); + RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile"); + parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_node_groups_tag"); @@ -737,16 +758,16 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_meshes_new"); RNA_def_function_ui_description(func, "Add a new mesh to the main database"); - parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock."); + parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile."); - parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove."); + RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile"); + parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_meshes_tag"); @@ -766,18 +787,18 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_lamps_new"); RNA_def_function_ui_description(func, "Add a new lamp to the main database"); - parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock."); + parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile."); - parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove."); + RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); + parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); @@ -845,31 +866,31 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_images_new"); RNA_def_function_ui_description(func, "Add a new image to the main database"); - parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX); + parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX); + parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel"); RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color"); /* return type */ - parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock."); + parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "load", "rna_Main_images_load"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Load a new image into the main database"); - parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load."); + parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock."); + parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_images_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove an image from the current blendfile."); - parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove."); + RNA_def_function_ui_description(func, "Remove an image from the current blendfile"); + parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_images_tag"); @@ -890,16 +911,16 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_lattices_new"); RNA_def_function_ui_description(func, "Add a new lattice to the main database"); - parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock."); + parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile."); - parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove."); + RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile"); + parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_lattices_tag"); @@ -919,18 +940,18 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_curves_new"); RNA_def_function_ui_description(func, "Add a new curve to the main database"); - parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock."); + parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_curves_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a curve from the current blendfile."); - parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove."); + RNA_def_function_ui_description(func, "Remove a curve from the current blendfile"); + parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_curves_tag"); @@ -950,16 +971,16 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_metaballs_new"); RNA_def_function_ui_description(func, "Add a new metaball to the main database"); - parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock."); + parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile."); - parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove."); + RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); + parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); @@ -980,16 +1001,16 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "load", "rna_Main_fonts_load"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Load a new font into the main database"); - parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load."); + parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock."); + parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a font from the current blendfile."); - parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove."); + RNA_def_function_ui_description(func, "Remove a font from the current blendfile"); + parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag"); @@ -1009,18 +1030,18 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_textures_new"); RNA_def_function_ui_description(func, "Add a new texture to the main database"); - parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock."); + parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_textures_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a texture from the current blendfile."); - parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove."); + RNA_def_function_ui_description(func, "Remove a texture from the current blendfile"); + parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_textures_tag"); @@ -1040,16 +1061,16 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_brushes_new"); RNA_def_function_ui_description(func, "Add a new brush to the main database"); - parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock."); + parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a brush from the current blendfile."); - parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove."); + RNA_def_function_ui_description(func, "Remove a brush from the current blendfile"); + parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_brushes_tag"); @@ -1070,16 +1091,16 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_worlds_new"); RNA_def_function_ui_description(func, "Add a new world to the main database"); - parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "world", "World", "", "New world datablock."); + parm= RNA_def_pointer(func, "world", "World", "", "New world datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_worlds_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a world from the current blendfile."); - parm= RNA_def_pointer(func, "world", "World", "", "World to remove."); + RNA_def_function_ui_description(func, "Remove a world from the current blendfile"); + parm= RNA_def_pointer(func, "world", "World", "", "World to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_worlds_tag"); @@ -1100,15 +1121,15 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_groups_new"); RNA_def_function_ui_description(func, "Add a new group to the main database"); - parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock."); + parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_groups_remove"); - RNA_def_function_ui_description(func, "Remove a group from the current blendfile."); - parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove."); + RNA_def_function_ui_description(func, "Remove a group from the current blendfile"); + parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_groups_tag"); @@ -1129,16 +1150,16 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_speakers_new"); RNA_def_function_ui_description(func, "Add a new speaker to the main database"); - parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock."); + parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile."); - parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove."); + RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile"); + parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag"); @@ -1159,25 +1180,25 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_texts_new"); RNA_def_function_ui_description(func, "Add a new text to the main database"); - parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock."); + parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_texts_remove"); - RNA_def_function_ui_description(func, "Remove a text from the current blendfile."); - parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove."); + RNA_def_function_ui_description(func, "Remove a text from the current blendfile"); + parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* load func */ func= RNA_def_function(srna, "load", "rna_Main_texts_load"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new text to the main database from a file"); - parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock."); + parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock."); + parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "tag", "rna_Main_texts_tag"); @@ -1216,16 +1237,16 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_armatures_new"); RNA_def_function_ui_description(func, "Add a new armature to the main database"); - parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock."); + parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a armature from the current blendfile."); - parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove."); + RNA_def_function_ui_description(func, "Remove a armature from the current blendfile"); + parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_armatures_tag"); @@ -1245,16 +1266,16 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_actions_new"); RNA_def_function_ui_description(func, "Add a new action to the main database"); - parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock."); + parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_actions_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a action from the current blendfile."); - parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove."); + RNA_def_function_ui_description(func, "Remove a action from the current blendfile"); + parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_actions_tag"); @@ -1274,16 +1295,16 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Main_particles_new"); RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database"); - parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock."); + parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock."); + parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Main_particles_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile."); - parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove."); + RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile"); + parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "tag", "rna_Main_particles_tag"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index f407aba82fb..673e768e71e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -45,7 +45,8 @@ static EnumPropertyItem prop_texture_coordinates_items[] = { {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_STRAND, "STRAND", 0, "Strand / Particle", + "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, {TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates"}, {TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates"}, {TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates"}, @@ -279,7 +280,8 @@ static void rna_Material_use_nodes_set(PointerRNA *ptr, int value) ED_node_shader_default(ma); } -static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) +static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr, + PropertyRNA *UNUSED(prop), int *free) { Material *ma= (Material*)ptr->id.data; EnumPropertyItem *item= NULL; @@ -447,12 +449,14 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_from_dupli", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO); - RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent"); + RNA_def_property_ui_text(prop, "From Dupli", + "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_from_original", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG); - RNA_def_property_ui_text(prop, "From Original", "Dupli's derive their object coordinates from the original objects transformation"); + RNA_def_property_ui_text(prop, "From Original", + "Dupli's derive their object coordinates from the original objects transformation"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE); @@ -651,7 +655,8 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL); - RNA_def_property_ui_text(prop, "Transmission Color", "Causes the texture to affect the result color after other light has been scattered/absorbed"); + RNA_def_property_ui_text(prop, "Transmission Color", + "Causes the texture to affect the result color after other light has been scattered/absorbed"); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE); @@ -689,7 +694,8 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "transmission_color_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coltransfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); - RNA_def_property_ui_text(prop, "Transmission Color Factor", "Amount texture affects result color after light has been scattered/absorbed"); + RNA_def_property_ui_text(prop, "Transmission Color Factor", + "Amount texture affects result color after light has been scattered/absorbed"); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE); @@ -736,6 +742,61 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Material_update"); } +static void rna_def_material_gamesettings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_alpha_blend_items[] = { + {GEMAT_SOLID, "OPAQUE", 0, "Opaque", "Render color of textured face as color"}, + {GEMAT_ADD, "ADD", 0, "Add", "Render face transparent and add color of face"}, + {GEMAT_CLIP, "CLIP", 0, "Alpha Clip", "Use the image alpha values clipped with no blending (binary alpha)"}, + {GEMAT_ALPHA, "ALPHA", 0, "Alpha Blend", "Render polygon transparent, depending on alpha channel of the texture"}, + {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort", "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_face_orientation_items[] = { + {GEMAT_NORMAL,"NORMAL",0,"Normal","No tranformation"}, + {GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"}, + {GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"}, + {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "MaterialGameSettings", NULL); + RNA_def_struct_sdna(srna, "GameSettings"); + RNA_def_struct_nested(brna, srna, "Material"); + RNA_def_struct_ui_text(srna, "Material Game Settings", "Game Engine settings for a Material datablock"); + + prop= RNA_def_property(srna, "back_culling", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_BACKCULL); /* use bitflags */ + RNA_def_property_ui_text(prop, "Back Culling", "Hide Back of the face in Game Engine "); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + + prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_TEXT); /* use bitflags */ + RNA_def_property_ui_text(prop, "Text", "Use material as text in Game Engine "); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + + prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_INVISIBLE); /* use bitflags */ + RNA_def_property_ui_text(prop, "Invisible", "Make face invisible"); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + + prop= RNA_def_property(srna, "alpha_blend", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "alpha_blend"); + RNA_def_property_enum_items(prop, prop_alpha_blend_items); + RNA_def_property_ui_text(prop, "Blend Mode", "Blend Mode for Transparent Faces"); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + + prop= RNA_def_property(srna, "face_orientation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_face_orientation_items); + RNA_def_property_ui_text(prop, "Face Orientations", "Especial face orientation options"); + + prop= RNA_def_property(srna, "physics", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GEMAT_NOPHYSICS); /* use bitflags */ + RNA_def_property_ui_text(prop, "Physics", "Use physics properties of materials "); +} + static void rna_def_material_colors(StructRNA *srna) { PropertyRNA *prop; @@ -938,13 +999,15 @@ static void rna_def_material_raymirror(BlenderRNA *brna) prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections"); + RNA_def_property_ui_text(prop, "Gloss Amount", + "The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent"); + RNA_def_property_ui_text(prop, "Gloss Anisotropy", + "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); @@ -956,7 +1019,9 @@ static void rna_def_material_raymirror(BlenderRNA *brna) prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped"); + RNA_def_property_ui_text(prop, "Gloss Threshold", + "Threshold for adaptive sampling (if a sample contributes less than " + "this amount [as a percentage], sampling is stopped)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); @@ -968,13 +1033,17 @@ static void rna_def_material_raymirror(BlenderRNA *brna) prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist_mir"); RNA_def_property_range(prop, 0.0f, 10000.0f); - RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color"); + RNA_def_property_ui_text(prop, "Maximum Distance", + "Maximum distance of reflected rays (reflections further than this " + "range fade to sky color or material color)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir"); RNA_def_property_enum_items(prop, prop_fadeto_mir_items); - RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor"); + RNA_def_property_ui_text(prop, "Fade-out Color", + "The color that rays with no intersection within the Max Distance take " + "(material color can be best for indoor scenes, sky color for outdoor)"); RNA_def_property_update(prop, 0, "rna_Material_update"); } @@ -1009,7 +1078,8 @@ static void rna_def_material_raytra(BlenderRNA *brna) prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions"); + RNA_def_property_ui_text(prop, "Gloss Amount", + "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); @@ -1021,7 +1091,9 @@ static void rna_def_material_raytra(BlenderRNA *brna) prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped"); + RNA_def_property_ui_text(prop, "Gloss Threshold", + "Threshold for adaptive sampling. If a sample contributes less than " + "this amount (as a percentage), sampling is stopped"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); @@ -1033,13 +1105,17 @@ static void rna_def_material_raytra(BlenderRNA *brna) prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "filter"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)"); + RNA_def_property_ui_text(prop, "Filter", + "Amount to blend in the material's diffuse color in raytraced " + "transparency (simulating absorption)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth_max", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "tx_limit"); RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)"); + RNA_def_property_ui_text(prop, "Limit", + "Maximum depth for light to travel through the transparent material " + "before becoming fully filtered (0.0 is disabled)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); @@ -1099,13 +1175,16 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "use_light_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */ - RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy"); + RNA_def_property_ui_text(prop, "Light Cache", + "Pre-calculate the shading information into a voxel grid, " + "speeds up shading at slightly less accuracy"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "precache_resolution"); RNA_def_property_range(prop, 1, 1024); - RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory"); + RNA_def_property_ui_text(prop, "Resolution", + "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE); @@ -1130,7 +1209,9 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "depth_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "depth_cutoff"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy"); + RNA_def_property_ui_text(prop, "Depth Cutoff", + "Stop ray marching early if transmission drops below this luminance - " + "higher values give speedups in dense volumes at the expense of accuracy"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR); @@ -1150,26 +1231,31 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "scattering"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3); - RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered out by the volume - the more out-scattering, the shallower the light will penetrate "); + RNA_def_property_ui_text(prop, "Scattering", + "Amount of light that gets scattered out by the volume - " + "the more out-scattering, the shallower the light will penetrate "); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "transmission_col"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Transmission Color", "Result color of the volume, after other light has been scattered/absorbed"); + RNA_def_property_ui_text(prop, "Transmission Color", + "Result color of the volume, after other light has been scattered/absorbed"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "reflection_col"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Reflection Color", "Color of light scattered out of the volume (does not affect transmission)"); + RNA_def_property_ui_text(prop, "Reflection Color", + "Color of light scattered out of the volume (does not affect transmission)"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reflection"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3); - RNA_def_property_ui_text(prop, "Reflection", "Multiplier to make out-scattered light brighter or darker (non-physically correct)"); + RNA_def_property_ui_text(prop, "Reflection", + "Multiplier to make out-scattered light brighter or darker (non-physically correct)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); @@ -1329,7 +1415,8 @@ static void rna_def_material_sss(BlenderRNA *brna) srna= RNA_def_struct(brna, "MaterialSubsurfaceScattering", NULL); RNA_def_struct_sdna(srna, "Material"); RNA_def_struct_nested(brna, srna, "Material"); - RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock"); + RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", + "Diffuse subsurface scattering settings for a Material datablock"); prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "sss_radius"); @@ -1545,7 +1632,8 @@ static void rna_def_material_physics(BlenderRNA *brna) /* FH/Force Field Settings */ prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR); - RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area"); + RNA_def_property_ui_text(prop, "Align to Normal", + "Align dynamic game objects along the surface normal, when inside the physics distance area"); prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fh"); @@ -1594,11 +1682,13 @@ void RNA_def_material(BlenderRNA *brna) static EnumPropertyItem prop_shadows_only_items[] = { {MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", "Old shadow only method"}, {MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", "Improved shadow only method"}, - {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", "Improved shadow only method which also renders lightless areas as shadows"}, + {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", + "Improved shadow only method which also renders lightless areas as shadows"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Material", "ID"); - RNA_def_struct_ui_text(srna, "Material", "Material datablock to defined the appearance of geometric objects for rendering"); + RNA_def_struct_ui_text(srna, "Material", + "Material datablock to defined the appearance of geometric objects for rendering"); RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -1645,7 +1735,8 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_cubic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC); - RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions"); + RNA_def_property_ui_text(prop, "Cubic Interpolation", + "Use cubic interpolation for diffuse values, for smoother transitions"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE); @@ -1656,7 +1747,8 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sbias"); RNA_def_property_range(prop, 0, 0.25); - RNA_def_property_ui_text(prop, "Shadow Ray Bias", "Shadow raytracing bias to prevent terminator problems on shadow boundary"); + RNA_def_property_ui_text(prop, "Shadow Ray Bias", + "Shadow raytracing bias to prevent terminator problems on shadow boundary"); prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lbias"); @@ -1666,7 +1758,8 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "shadow_cast_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "shad_alpha"); RNA_def_property_range(prop, 0.001, 1); - RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, in use for Irregular and Deep shadow buffer"); + RNA_def_property_ui_text(prop, "Shadow Casting Alpha", + "Shadow casting alpha, in use for Irregular and Deep shadow buffer"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE); @@ -1685,12 +1778,14 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY); - RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting"); + RNA_def_property_ui_text(prop, "Light Group Exclusive", + "Material uses the light group exclusively - these lamps are excluded from other scene lighting"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE); - RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in ray tracing calculations"); + RNA_def_property_ui_text(prop, "Traceable", + "Include this material and geometry that uses it in ray tracing calculations"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE); @@ -1710,7 +1805,9 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_vertex_color_paint", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP); - RNA_def_property_ui_text(prop, "Vertex Color Paint", "Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures)"); + RNA_def_property_ui_text(prop, "Vertex Color Paint", + "Replaces object base color with vertex colors (multiplies with " + "'texture face' face assigned textures)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); @@ -1725,12 +1822,15 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV); - RNA_def_property_ui_text(prop, "Sky", "Renders this material with zero alpha, with sky background in place (scanline only)"); + RNA_def_property_ui_text(prop, "Sky", + "Renders this material with zero alpha, with sky background in place (scanline only)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW); - RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas"); + RNA_def_property_ui_text(prop, "Only Shadow", + "Renders shadows as the material's alpha value, making materials " + "transparent except for shadowed areas"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shadow_only_type", PROP_ENUM, PROP_NONE); @@ -1741,17 +1841,20 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE); - RNA_def_property_ui_text(prop, "Face Textures", "Replaces the object's base color with color from face assigned image textures"); + RNA_def_property_ui_text(prop, "Face Textures", + "Replaces the object's base color with color from face assigned image textures"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA); - RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replaces the object's base alpha value with alpha from face assigned image textures"); + RNA_def_property_ui_text(prop, "Face Textures Alpha", + "Replaces the object's base alpha value with alpha from face assigned image textures"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_cast_shadows_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST); - RNA_def_property_ui_text(prop, "Cast Shadows Only", "Makes objects with this material appear invisible, only casting shadows (not rendered)"); + RNA_def_property_ui_text(prop, "Cast Shadows Only", + "Makes objects with this material appear invisible, only casting shadows (not rendered)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE); @@ -1761,32 +1864,39 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "use_transparent_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA); - RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows cast through other objects"); + RNA_def_property_ui_text(prop, "Receive Transparent Shadows", + "Allow this object to receive transparent shadows cast through other objects"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_ray_shadow_bias", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS); - RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)"); + RNA_def_property_ui_text(prop, "Ray Shadow Bias", + "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_full_oversampling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA); - RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples"); + RNA_def_property_ui_text(prop, "Full Oversampling", + "Force this material to render full shading/textures for all anti-aliasing samples"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF); - RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps"); + RNA_def_property_ui_text(prop, "Cast Buffer Shadows", + "Allow this material to cast shadows from shadow buffer lamps"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_cast_approximate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_APPROX_OCCLUSION); - RNA_def_property_ui_text(prop, "Cast Approximate", "Allow this material to cast shadows when using approximate ambient occlusion."); + RNA_def_property_ui_text(prop, "Cast Approximate", + "Allow this material to cast shadows when using approximate ambient occlusion"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V); - RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects"); + RNA_def_property_ui_text(prop, "Tangent Shading", + "Use the material's tangent vector instead of the normal for shading " + "- for anisotropic shading effects"); RNA_def_property_update(prop, 0, "rna_Material_update"); /* nested structs */ @@ -1832,6 +1942,13 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Physics", "Game physics settings"); + /* game settings */ + prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "game"); + RNA_def_property_struct_type(prop, "MaterialGameSettings"); + RNA_def_property_ui_text(prop, "Game Settings", "Game material settings"); + /* nodetree */ prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); @@ -1846,7 +1963,8 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", + "rna_Material_active_node_material_set", NULL, NULL); RNA_def_property_ui_text(prop, "Material", "Active node material"); RNA_def_property_update(prop, NC_MATERIAL, NULL); @@ -1876,6 +1994,7 @@ void RNA_def_material(BlenderRNA *brna) rna_def_material_mtex(brna); rna_def_material_strand(brna); rna_def_material_physics(brna); + rna_def_material_gamesettings(brna); RNA_api_material(srna); } @@ -1896,19 +2015,19 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch /* functions */ func= RNA_def_function(srna, "add", "rna_mtex_texture_slots_add"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex."); + parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "create", "rna_mtex_texture_slots_create"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize.", 0, INT_MAX); + parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex."); + parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear.", 0, INT_MAX); + parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -1921,7 +2040,8 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, /* mtex */ prop= RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, structname); - RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", + "rna_iterator_array_dereference_get", 0, 0, 0); RNA_def_property_ui_text(prop, "Textures", "Texture slots defining the mapping and influence of textures"); rna_def_texture_slots(brna, prop, structname, structname_slots); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index b0554ea5b4f..1bbdc7cc853 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -90,6 +90,24 @@ void rna_Mesh_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA } } + +void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Mesh* me = ptr->data; + if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) { + me->editflag ^= ME_EDIT_PAINT_MASK; + } + rna_Mesh_update_draw(bmain, scene, ptr); +} + +void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Mesh* me = ptr->data; + if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) { + me->editflag ^= ME_EDIT_VERT_SEL; + } + rna_Mesh_update_draw(bmain, scene, ptr); +} static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { MVert *mvert= (MVert*)ptr->data; @@ -1402,6 +1420,9 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + //XXX to be deleted soon -- left for now in case we need it for debug + //XXX it should be out before Blender 2.6 (after texface to material patch) + prop= RNA_def_property(srna, "use_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX); RNA_def_property_ui_text(prop, "Tex", "Render face with texture"); @@ -1468,6 +1489,9 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + //XXX to be deleted soon -- left for now in case we need it for debug + //XXX it should be out before Blender 2.6 (after texface to material patch) + prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1); RNA_def_property_array(prop, 4); @@ -1701,7 +1725,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_vertices_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); + RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX); } /* mesh.edges */ @@ -1720,7 +1744,7 @@ static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_edges_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); + RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX); } /* mesh.faces */ @@ -1749,7 +1773,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_faces_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); + RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX); } /* mesh.vertex_colors */ @@ -1768,16 +1792,16 @@ static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh."); - RNA_def_string(func, "name", "Col", 0, "", "Vertex color name."); - parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer."); + RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh"); + RNA_def_string(func, "name", "Col", 0, "", "Vertex color name"); + parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer"); RNA_def_function_return(func, parm); /* func= RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove"); - RNA_def_function_ui_description(func, "Remove a vertex color layer."); + RNA_def_function_ui_description(func, "Remove a vertex color layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove."); + parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED); @@ -1809,16 +1833,16 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh."); - RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name."); - parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer."); + RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh"); + RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name"); + parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer"); RNA_def_function_return(func, parm); /* func= RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove"); - RNA_def_function_ui_description(func, "Remove a vertex color layer."); + RNA_def_function_ui_description(func, "Remove a vertex color layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove."); + parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED); @@ -2075,8 +2099,14 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK); RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting"); RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask"); + + prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL); + RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)"); + RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); + RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask"); /* readonly editmesh info - use for extrude menu */ prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 87bbea334db..ef636d9a515 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -52,19 +52,20 @@ void RNA_api_mesh(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "transform", "ED_mesh_transform"); - RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix."); - parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f); + RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix"); + parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals"); - RNA_def_function_ui_description(func, "Calculate vertex normals."); + RNA_def_function_ui_description(func, "Calculate vertex normals"); func= RNA_def_function(srna, "update", "ED_mesh_update"); - RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges."); + RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "validate", "BKE_mesh_validate"); - RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had invalid geometry corrected/removed."); + RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had " + "invalid geometry corrected/removed"); RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found"); parm= RNA_def_boolean(func, "result", 0, "Result", ""); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index d94fa130163..5e5cf0be0ae 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -236,15 +236,15 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements"); func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new"); - RNA_def_function_ui_description(func, "Add a new spline to the curve."); - RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element."); - parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element."); + RNA_def_function_ui_description(func, "Add a new spline to the curve"); + RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element"); + parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove."); + parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index b83f06c633c..33f5e41b2cc 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2526,29 +2526,29 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); - RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup."); + RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name"); - RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name."); + RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture."); + RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items); - RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking."); + RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items); RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates " - "to use for mapping."); + "to use for mapping"); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE); @@ -2560,7 +2560,7 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj"); RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture " - "coordinates from."); + "coordinates from"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -2583,43 +2583,43 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier"); RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier", - "Edit the weights of vertices in a group."); + "Edit the weights of vertices in a group"); RNA_def_struct_sdna(srna, "WeightVGEditModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); - RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); + RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items); - RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values."); + RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG); RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold " - "to vgroup."); + "to vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); 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); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if " - "it is not in the vgroup."); + "it is not in the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve"); - RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve."); + RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE); @@ -2627,7 +2627,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight " - "to be added to the vgroup."); + "to be added to the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE); @@ -2635,7 +2635,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0); RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight " - "to be removed from the vgroup."); + "to be removed from the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Common masking properties. */ @@ -2667,19 +2667,19 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier"); RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier", - "Mix the weights of two vertex groups."); + "Mix the weights of two vertex groups"); RNA_def_struct_sdna(srna, "WeightVGMixModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a"); - RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name."); + RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b"); - RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name."); + RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -2687,25 +2687,25 @@ 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, 10, 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 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, 10, 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 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."); + "of vgroup 1"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mix_set_items); - RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected."); + RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Common masking properties. */ @@ -2716,15 +2716,16 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) { static EnumPropertyItem weightvg_proximity_modes_items[] = { {MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance", - "Use distance between affected and target objects."}, + "Use distance between affected and target objects"}, {MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance", - "Use distance between affected object's vertices and target object, or target object's geometry."}, + "Use distance between affected object's vertices and target " + "object, or target object's geometry"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem proximity_geometry_items[] = { - {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex."}, - {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge."}, - {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face."}, + {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex"}, + {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge"}, + {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem weightvg_proximity_falloff_type_items[] = { @@ -2744,19 +2745,19 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier"); RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier", "Set the weights of vertices in a group from a target object's " - "distance."); + "distance"); RNA_def_struct_sdna(srna, "WeightVGProximityModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); - RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); + RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_proximity_modes_items); - RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use."); + RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE); @@ -2765,30 +2766,30 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */ RNA_def_property_ui_text(prop, "Proximity Geometry", "Use the shortest computed distance to target object's geometry " - "as weight."); + "as weight"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target"); - RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from."); + RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_NONE); 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 (or weight 1.0 if above Highest Dist)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_NONE); 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 (or weight 0.0 if below Lowest Dist)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items); - RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values."); + RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Common masking properties. */ diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 2a234dfaa61..b2ea4cd966b 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -299,7 +299,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo NlaStrip *strip = add_nlastrip(action); if (strip == NULL) { - BKE_reportf(reports, RPT_ERROR, "Unable to create new strip."); + BKE_reportf(reports, RPT_ERROR, "Unable to create new strip"); return NULL; } @@ -307,7 +307,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo strip->start = start; if (BKE_nlastrips_add_strip(&track->strips, strip) == 0) { - BKE_reportf(reports, RPT_ERROR, "Unable to add strip. Track doesn't have any space to accommodate this new strip."); + BKE_reportf(reports, RPT_ERROR, "Unable to add strip. Track doesn't have any space to accommodate this new strip"); free_nlastrip(NULL, strip); return NULL; } @@ -565,20 +565,20 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_NlaStrip_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track"); - parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips."); + parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip.", INT_MIN, INT_MAX); + parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip", INT_MIN, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip."); + parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* return type */ - parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip."); + parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a NLA Strip."); - parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove."); + RNA_def_function_ui_description(func, "Remove a NLA Strip"); + parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 61947977fee..1b113620663 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -391,6 +391,7 @@ static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *pt node_update(bmain, scene, ntree, node); } +#if 0 /* UNUSED */ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr) { bNodeTree *ntree= (bNodeTree*)ptr->id.data; @@ -398,6 +399,7 @@ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr) ntree->update |= NTREE_UPDATE_LINKS; ntreeUpdateTree(ntree); } +#endif static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max) { @@ -1486,7 +1488,7 @@ static void def_cmp_output_file(StructRNA *srna) prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output."); + RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "image_type", PROP_ENUM, PROP_NONE); @@ -2541,20 +2543,20 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Node Links", "Collection of Node Links"); func= RNA_def_function(srna, "new", "rna_NodeTree_link_new"); - RNA_def_function_ui_description(func, "Add a node link to this node tree."); + RNA_def_function_ui_description(func, "Add a node link to this node tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket."); + parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket."); + parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return */ - parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link."); + parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_NodeTree_link_remove"); - RNA_def_function_ui_description(func, "remove a node link from the node tree."); + RNA_def_function_ui_description(func, "remove a node link from the node tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove."); + parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -2570,19 +2572,19 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Compositor Nodes", "Collection of Compositor Nodes"); func= RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new"); - RNA_def_function_ui_description(func, "Add a node to this node tree."); + RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ - parm= RNA_def_pointer(func, "node", "Node", "", "New node."); + parm= RNA_def_pointer(func, "node", "Node", "", "New node"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); - RNA_def_function_ui_description(func, "remove a node from this node tree."); + RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove."); + parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -2598,19 +2600,19 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Shader Nodes", "Collection of Shader Nodes"); func= RNA_def_function(srna, "new", "rna_NodeTree_node_new"); - RNA_def_function_ui_description(func, "Add a node to this node tree."); + RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ - parm= RNA_def_pointer(func, "node", "Node", "", "New node."); + parm= RNA_def_pointer(func, "node", "Node", "", "New node"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); - RNA_def_function_ui_description(func, "remove a node from this node tree."); + RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove."); + parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -2626,19 +2628,19 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Texture Nodes", "Collection of Texture Nodes"); func= RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new"); - RNA_def_function_ui_description(func, "Add a node to this node tree."); + RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ - parm= RNA_def_pointer(func, "node", "Node", "", "New node."); + parm= RNA_def_pointer(func, "node", "Node", "", "New node"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); - RNA_def_function_ui_description(func, "remove a node from this node tree."); + RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove."); + parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -2847,22 +2849,22 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int RNA_def_struct_ui_text(srna, "Group Sockets", "Collection of group sockets"); func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new")); - RNA_def_function_ui_description(func, "Add a socket to the group tree."); + RNA_def_function_ui_description(func, "Add a socket to the group tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_string(func, "name", "Socket", 32, "Name", "Name of the socket"); RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket"); /* return value */ - parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket."); + parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "expose", (in_out==SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose")); - RNA_def_function_ui_description(func, "Expose an internal socket in the group tree."); + RNA_def_function_ui_description(func, "Expose an internal socket in the group tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_pointer(func, "sock", "NodeSocket", "Socket", "Internal node socket to expose"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "add_link", TRUE, "Add Link", "If TRUE, adds a link to the internal socket"); /* return value */ - parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket."); + parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket"); RNA_def_function_return(func, parm); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index e7b5529af02..720fea682ce 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1123,7 +1123,7 @@ static bConstraint *rna_Object_constraints_new(Object *object, int type) static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con) { if(BLI_findindex(&object->constraints, con) == -1) { - BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'.", con->name, object->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name+2); return; } @@ -1177,7 +1177,7 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re Object *ob = (Object *)id; if(ED_vgroup_object_is_edit_mode(ob)) { - BKE_reportf(reports, RPT_ERROR, "VertexGroup.add(): Can't be called while object is in edit mode."); + BKE_reportf(reports, RPT_ERROR, "VertexGroup.add(): Can't be called while object is in edit mode"); return; } @@ -1192,7 +1192,7 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList * Object *ob = (Object *)id; if(ED_vgroup_object_is_edit_mode(ob)) { - BKE_reportf(reports, RPT_ERROR, "VertexGroup.remove(): Can't be called while object is in edit mode."); + BKE_reportf(reports, RPT_ERROR, "VertexGroup.remove(): Can't be called while object is in edit mode"); return; } @@ -1265,6 +1265,11 @@ static void rna_def_vertex_group(BlenderRNA *brna) RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set"); RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */ + + prop= RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group"); + RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); + RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1272,29 +1277,29 @@ static void rna_def_vertex_group(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group"); func= RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add"); - RNA_def_function_ui_description(func, "Add vertices to the group."); + RNA_def_function_ui_description(func, "Add vertices to the group"); RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* TODO, see how array size of 0 works, this shouldnt be used */ - prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List.", 0, 0); + prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED); - prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f); + prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); RNA_def_property_flag(prop, PROP_REQUIRED); - prop= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode."); + prop= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode"); RNA_def_property_flag(prop, PROP_REQUIRED); func= RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove"); - RNA_def_function_ui_description(func, "Remove a vertex from the group."); + RNA_def_function_ui_description(func, "Remove a vertex from the group"); RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* TODO, see how array size of 0 works, this shouldnt be used */ - prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List.", 0, 0); + prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED); func= RNA_def_function(srna, "weight", "rna_VertexGroup_weight"); - RNA_def_function_ui_description(func, "Get a vertex weight from the group."); + RNA_def_function_ui_description(func, "Get a vertex weight from the group"); RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); - prop=RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex.", 0, INT_MAX); + prop=RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX); RNA_def_property_flag(prop, PROP_REQUIRED); - prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f); + prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); RNA_def_function_return(func, prop); } @@ -1588,17 +1593,17 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_Object_constraints_new"); RNA_def_function_ui_description(func, "Add a new constraint to this object"); /* object to add */ - parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add."); + parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint."); + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Object_constraints_remove"); - RNA_def_function_ui_description(func, "Remove a constraint from this object."); + RNA_def_function_ui_description(func, "Remove a constraint from this object"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* constraint to remove */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint."); + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -1631,22 +1636,22 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) /* add target */ func= RNA_def_function(srna, "new", "rna_Object_modifier_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Add a new modifier."); - parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone."); + RNA_def_function_ui_description(func, "Add a new modifier"); + parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone"); RNA_def_property_flag(parm, PROP_REQUIRED); /* modifier to add */ - parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add."); + parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ - parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier."); + parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier"); RNA_def_function_return(func, parm); /* remove target */ func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove an existing modifier from the object."); + RNA_def_function_ui_description(func, "Remove an existing modifier from the object"); /* target to remove*/ - parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove."); + parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -1709,14 +1714,14 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) /* vertex groups */ // add_vertex_group func= RNA_def_function(srna, "new", "rna_Object_vgroup_new"); - RNA_def_function_ui_description(func, "Add vertex group to object."); - RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */ - parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group."); + RNA_def_function_ui_description(func, "Add vertex group to object"); + RNA_def_string(func, "name", "Group", 0, "", "Vertex group name"); /* optional */ + parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Object_vgroup_remove"); - RNA_def_function_ui_description(func, "Delete vertex group from object."); - parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove."); + RNA_def_function_ui_description(func, "Delete vertex group from object"); + parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -1836,7 +1841,8 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_multi_array(prop, 2, boundbox_dimsize); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coordinates, all values are -1.0 when not available."); + RNA_def_property_ui_text(prop, "Bound Box", + "Objects bound box in object-space coordinates, all values are -1.0 when not available"); /* parent */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); @@ -2041,7 +2047,9 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Input Matrix", "Matrix access to location, rotation and scale (including deltas), before constraints and parenting are applied."); + RNA_def_property_ui_text(prop, "Input Matrix", + "Matrix access to location, rotation and scale (including deltas), " + "before constraints and parenting are applied"); RNA_def_property_float_funcs(prop, "rna_Object_matrix_basis_get", "rna_Object_matrix_basis_set", NULL); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index d48f1c93da8..84c3d2fd68b 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -289,13 +289,13 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) { if (!(ob->transflag & OB_DUPLI)) { - BKE_report(reports, RPT_ERROR, "Object does not have duplis."); + BKE_report(reports, RPT_ERROR, "Object does not have duplis"); return; } /* free duplilist if a user forgets to */ if (ob->duplilist) { - BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed."); + BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed"); free_object_duplilist(ob->duplilist); ob->duplilist= NULL; @@ -330,7 +330,7 @@ static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList * return keyptr; } else { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes.", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name+2); return PointerRNA_NULL; } } @@ -344,19 +344,19 @@ int rna_Object_is_visible(Object *ob, Scene *sce) static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode) { if (ob->type != OB_MESH) { - BKE_report(reports, RPT_ERROR, "Object should be of MESH type."); + BKE_report(reports, RPT_ERROR, "Object should be of MESH type"); return; } Mesh *me = (Mesh*)ob->data; int group_index = defgroup_find_index(ob, group); if (group_index == -1) { - BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh."); + BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh"); return; } if (assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD && assignmode != WEIGHT_SUBTRACT) { - BKE_report(reports, RPT_ERROR, "Bad assignment mode." ); + BKE_report(reports, RPT_ERROR, "Bad assignment mode" ); return; } @@ -367,7 +367,7 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int // loop list adding verts to group for (i= 0; i < totindex; i++) { if(i < 0 || i >= me->totvert) { - BKE_report(reports, RPT_ERROR, "Bad vertex index in list."); + BKE_report(reports, RPT_ERROR, "Bad vertex index in list"); return; } @@ -381,7 +381,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl BVHTreeFromMesh treeData= {NULL}; if(ob->derivedFinal==NULL) { - BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting.", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2); return; } @@ -389,7 +389,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6); if(treeData.tree==NULL) { - BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting.", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2); return; } else { @@ -420,7 +420,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi BVHTreeFromMesh treeData= {NULL}; if(ob->derivedFinal==NULL) { - BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point.", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2); return; } @@ -477,46 +477,48 @@ void RNA_api_object(StructRNA *srna) /* mesh */ func= RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); - RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied."); + RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers."); + parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); - parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers."); + parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply."); + parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export."); + parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export"); RNA_def_function_return(func, parm); /* duplis */ func= RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist"); - RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to be freed manually with free_dupli_list to restore the objects real matrix and layers."); - parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis."); + RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to " + "be freed manually with free_dupli_list to restore the " + "objects real matrix and layers"); + parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_function_flag(func, FUNC_USE_REPORTS); func= RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist"); - RNA_def_function_ui_description(func, "Free the list of dupli objects."); + RNA_def_function_ui_description(func, "Free the list of dupli objects"); /* Armature */ func= RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); - RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier."); - parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL."); + RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier"); + parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL"); RNA_def_function_return(func, parm); /* Shape key */ func= RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add"); - RNA_def_function_ui_description(func, "Add shape key to an object."); + RNA_def_function_ui_description(func, "Add shape key to an object"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock."); /* optional */ - RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes."); - parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock."); + RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */ + RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes"); + parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock"); RNA_def_property_flag(parm, PROP_RNAPTR); RNA_def_function_return(func, parm); /* Ray Cast */ func= RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast"); - RNA_def_function_ui_description(func, "Cast a ray onto in object space."); + RNA_def_function_ui_description(func, "Cast a ray onto in object space"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* ray start and end */ @@ -533,12 +535,12 @@ void RNA_api_object(StructRNA *srna) RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); - parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found.", 0, 0); + parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0); RNA_def_function_output(func, parm); /* Nearest Point */ func= RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh"); - RNA_def_function_ui_description(func, "Find the nearest point on the object."); + RNA_def_function_ui_description(func, "Find the nearest point on the object"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* location of point for test and max distance */ @@ -555,25 +557,25 @@ void RNA_api_object(StructRNA *srna) RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); - parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found.", 0, 0); + parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0); RNA_def_function_output(func, parm); /* View */ func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible"); - RNA_def_function_ui_description(func, "Determine if object is visible in a given scene."); + RNA_def_function_ui_description(func, "Determine if object is visible in a given scene"); parm= RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); - parm= RNA_def_boolean(func, "result", 0, "", "Object visibility."); + parm= RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); /* utility function for checking if the object is modified */ func= RNA_def_function(srna, "is_modified", "rna_Object_is_modified"); - RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data."); + RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data"); parm= RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); - parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply."); + parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "result", 0, "", "Object visibility."); + parm= RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); } @@ -584,7 +586,7 @@ void RNA_api_object_base(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view"); - RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)."); + RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)"); parm= RNA_def_pointer(func, "view", "SpaceView3D", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 490d9c38840..cc086bca6d8 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -823,11 +823,12 @@ static void rna_def_pointcache(BlenderRNA *brna) prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH); - RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file."); + RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", + "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list"); rna_def_ptcache_point_caches(brna, prop); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 434634f6b10..338073fde00 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -479,7 +479,7 @@ static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, int typ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, ReportList *reports, bConstraint *con) { if(BLI_findindex(&pchan->constraints, con) == -1) { - BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'.", con->name, pchan->name); + BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'", con->name, pchan->name); return; } else { @@ -714,17 +714,17 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro func= RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new"); RNA_def_function_ui_description(func, "Add a constraint to this object"); /* return type */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint."); + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint"); RNA_def_function_return(func, parm); /* constraint to add */ - parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add."); + parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add"); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove"); - RNA_def_function_ui_description(func, "Remove a constraint from this object."); + RNA_def_function_ui_description(func, "Remove a constraint from this object"); RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */ /* constraint to remove */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint."); + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -840,7 +840,8 @@ static void rna_def_pose_channel(BlenderRNA *brna) /* writable because it touches loc/scale/rot directly */ prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, matrix_dimsize); - RNA_def_property_ui_text(prop, "Basis Matrix", "Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone."); + RNA_def_property_ui_text(prop, "Basis Matrix", + "Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone"); RNA_def_property_float_funcs(prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", NULL); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c index e326aee212d..451a98e89fc 100644 --- a/source/blender/makesrna/intern/rna_pose_api.c +++ b/source/blender/makesrna/intern/rna_pose_api.c @@ -70,8 +70,9 @@ void RNA_api_pose_channel(StructRNA *srna) FunctionRNA *func; func= RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope"); - RNA_def_function_ui_description(func, "Calculate bone envelope at given point."); - parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); + RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); + parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", + "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* return value */ parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index e3e3296cb70..8c9f8c08a47 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -130,7 +130,8 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo return NULL; if(strlen(identifier) >= sizeof(dummyet.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyet.idname)); + BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d", + identifier, (int)sizeof(dummyet.idname)); return NULL; } @@ -238,7 +239,7 @@ static void rna_def_render_engine(BlenderRNA *brna) /* render */ func= RNA_def_function(srna, "render", NULL); - RNA_def_function_ui_description(func, "Render scene into an image."); + RNA_def_function_ui_description(func, "Render scene into an image"); RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_pointer(func, "scene", "Scene", "", ""); @@ -310,9 +311,10 @@ static void rna_def_render_result(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file"); - RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file."); + RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", "Filename to load into this render tile, must be no smaller than the render result"); + parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", + "Filename to load into this render tile, must be no smaller than the render result"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_define_verify_sdna(0); @@ -327,7 +329,8 @@ static void rna_def_render_result(BlenderRNA *brna) parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(parm, "RenderLayer"); - RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", + "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); RNA_define_verify_sdna(1); } @@ -342,12 +345,15 @@ static void rna_def_render_layer(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Render Layer", ""); func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file"); - RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file."); + RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller than the renderlayer"); + prop= RNA_def_string(func, "filename", "", 0, "Filename", + "Filename to load into this render tile, must be no smaller than the renderlayer"); RNA_def_property_flag(prop, PROP_REQUIRED); - RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); - RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); + RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", + "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); + RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", + "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); RNA_define_verify_sdna(0); @@ -355,7 +361,8 @@ static void rna_def_render_layer(BlenderRNA *brna) prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "RenderPass"); - RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", + "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index c7104119e56..2058edc6736 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -234,7 +234,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report Base *base; if (object_in_scene(ob, scene)) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name+2, scene->id.name+2); return NULL; } @@ -262,11 +262,11 @@ static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *o { Base *base= object_in_scene(ob, scene); if (!base) { - BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'", ob->id.name+2, scene->id.name+2); return; } if (base==scene->basact && ob->mode != OB_MODE_OBJECT) { - BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink", ob->id.name+2); return; } if(scene->basact==base) { @@ -1042,11 +1042,27 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons return ks; } else { - BKE_report(reports, RPT_ERROR, "Keying Set could not be added."); + BKE_report(reports, RPT_ERROR, "Keying Set could not be added"); return NULL; } } + + +/* note: without this, when Multi-Paint is activated/deactivated, the colors + * will not change right away when multiple bones are selected, this function + * is not for general use and only for the few cases where changing scene + * settings and NOT for general purpose updates, possibly this should be + * given its own notifier. */ +static void rna_Scene_update_active_object_data(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Object *ob= OBACT; + if(ob) { + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id); + } +} + static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr) { FreestyleLineSet *lineset= (FreestyleLineSet *)ptr->data; @@ -1163,9 +1179,17 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1); - RNA_def_property_ui_text(prop, "WPaint Auto-Normalize", - "Ensure all bone-deforming vertex groups add up to 1.0 while " - "weight painting"); + RNA_def_property_ui_text(prop, "WPaint Auto-Normalize", + "Ensure all bone-deforming vertex groups add up " + "to 1.0 while weight painting"); + RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data"); + + prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1); + RNA_def_property_ui_text(prop, "WPaint Multi-Paint", + "Paint across all selected bones while " + "weight painting"); + RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data"); prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "vpaint"); @@ -2138,7 +2162,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem material_items[] ={ - {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"}, + {GAME_MAT_TEXFACE, "SINGLETEXTURE", 0, "Singletexture", "Singletexture face materials"}, {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"}, {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"}, {0, NULL, 0, NULL, NULL}}; @@ -2358,7 +2382,9 @@ static void rna_def_scene_game_data(BlenderRNA *brna) prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES); - RNA_def_property_ui_text(prop, "Restrict Animation Updates", "Restrict the number of animation updates to the animation FPS. This is better for performance, but can cause issues with smooth playback."); + RNA_def_property_ui_text(prop, "Restrict Animation Updates", + "Restrict the number of animation updates to the animation FPS. This is " + "better for performance, but can cause issues with smooth playback"); /* materials */ prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE); @@ -3546,17 +3572,17 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects"); func= RNA_def_function(srna, "link", "rna_Scene_object_link"); - RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after."); + RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene."); + parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); - parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base."); + parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink"); - RNA_def_function_ui_description(func, "Unlink object from scene."); + RNA_def_function_ui_description(func, "Unlink object from scene"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene."); + parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -3606,8 +3632,8 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers"); func= RNA_def_function(srna, "new", "rna_TimeLine_add"); - RNA_def_function_ui_description(func, "Add a keyframe to the curve."); - parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)."); + RNA_def_function_ui_description(func, "Add a keyframe to the curve"); + parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker"); @@ -3615,9 +3641,9 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "rna_TimeLine_remove"); - RNA_def_function_ui_description(func, "Remove a timeline marker."); + RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove."); + parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } @@ -3637,13 +3663,13 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop) /* Add Keying Set */ func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new"); - RNA_def_function_ui_description(func, "Add a new Keying Set to Scene."); + RNA_def_function_ui_description(func, "Add a new Keying Set to Scene"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* name */ RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set"); /* returns the new KeyingSet */ - parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set."); + parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set"); RNA_def_function_return(func, parm); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index fd7987c18a2..39efa72e0ce 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -100,22 +100,22 @@ void RNA_api_scene(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "frame_set", "rna_Scene_frame_set"); - RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately."); - parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set.", MINAFRAME, MAXFRAME); + RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately"); + parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0); func= RNA_def_function(srna, "update", "rna_Scene_update_tagged"); - RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators."); + RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators"); #ifdef WITH_COLLADA /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export"); - RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file."); - parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements."); + RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file"); + parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ - RNA_def_function_ui_description(func, "Export to collada file."); + RNA_def_function_ui_description(func, "Export to collada file"); #endif } @@ -126,9 +126,11 @@ void RNA_api_scene_render(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path"); - RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame."); - RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", "Frame number to use, if unset the current frame will be used.", MINAFRAME, MAXFRAME); - parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path", "the resulting filepath from the scenes render settings."); + RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame"); + RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", + "Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME); + parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path", + "The resulting filepath from the scenes render settings"); RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ RNA_def_function_output(func, parm); } diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index bd1021f038a..686c8dffcd1 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -147,7 +147,10 @@ static void rna_def_area(BlenderRNA *brna) prop= RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL); RNA_def_property_struct_type(prop, "Space"); - RNA_def_property_ui_text(prop, "Spaces", "Spaces contained in this area, the first being the active space. NOTE: Useful for example to restore a previously used 3d view space in a certain area to get the old view orientation."); + RNA_def_property_ui_text(prop, "Spaces", + "Spaces contained in this area, the first being the active space. " + "NOTE: Useful for example to restore a previously used 3d view space " + "in a certain area to get the old view orientation"); rna_def_area_spaces(brna, prop); prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE); @@ -181,7 +184,7 @@ static void rna_def_area(BlenderRNA *brna) func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); RNA_def_function_ui_description(func, "Set the header text"); - RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text."); + RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text"); } static void rna_def_region(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c index cfa957bdd9e..7517443f4b7 100644 --- a/source/blender/makesrna/intern/rna_sensor_api.c +++ b/source/blender/makesrna/intern/rna_sensor_api.c @@ -61,14 +61,14 @@ void RNA_api_sensor(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "link", "rna_Sensor_link"); - RNA_def_function_ui_description(func, "Link the sensor to a controller."); - parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to."); + RNA_def_function_ui_description(func, "Link the sensor to a controller"); + parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_update(parm, NC_LOGIC, NULL); func= RNA_def_function(srna, "unlink", "rna_Sensor_unlink"); - RNA_def_function_ui_description(func, "Unlink the sensor from a controller."); - parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from."); + RNA_def_function_ui_description(func, "Unlink the sensor from a controller"); + parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_update(parm, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 79724adf91c..86682af189c 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1036,7 +1036,7 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM); - RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform."); + RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); /* strip positioning */ diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index fa240fa225a..6019f46a114 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -65,8 +65,9 @@ void RNA_api_sequence_strip(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "getStripElem", "give_stripelem"); - RNA_def_function_ui_description(func, "Return the strip element from a given frame or None."); - parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME); + RNA_def_function_ui_description(func, "Return the strip element from a given frame or None"); + parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", + "The frame to get the strip element from", -MAXFRAME, MAXFRAME); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame")); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 93ffa62a4c6..8ea00530c2f 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -245,7 +245,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_items(prop, smoke_domain_colli_items); - RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object."); + RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); @@ -255,21 +255,21 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH); - RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness."); + RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "time_scale"); RNA_def_property_range(prop, 0.2, 1.5); RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5); - RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed."); + RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vorticity"); RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5); - RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid."); + RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); } @@ -309,7 +309,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); - RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area."); + RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area"); prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 3a18fb0e7c0..a6c1f400ade 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -96,7 +96,7 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "mono", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO); - RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one."); + RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one"); RNA_def_property_update(prop, 0, "rna_Sound_update"); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3463b2f6c03..36c45cfa59e 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1589,7 +1589,7 @@ static void rna_def_space_image(BlenderRNA *brna) prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "scopes"); RNA_def_property_struct_type(prop, "Scopes"); - RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics."); + RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update"); prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c index 60208de5aa5..34c67335c79 100644 --- a/source/blender/makesrna/intern/rna_speaker.c +++ b/source/blender/makesrna/intern/rna_speaker.c @@ -62,13 +62,13 @@ static void rna_def_speaker(BlenderRNA *brna) prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker."); + RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker"); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* This shouldn't be changed actually, hiding it! prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE); - RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not."); + RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not"); // RNA_def_property_update(prop, 0, "rna_Speaker_update");*/ prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); @@ -76,7 +76,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Sound"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker."); + RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -84,7 +84,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "volume_max"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is."); + RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -92,7 +92,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "volume_min"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is."); + RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -100,7 +100,8 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "distance_max"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for volume calculation, no matter how far away the object is."); + RNA_def_property_ui_text(prop, "Maximum Distance", + "Maximum distance for volume calculation, no matter how far away the object is"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -108,7 +109,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "distance_reference"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %."); + RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -116,7 +117,7 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "attenuation"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model."); + RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -124,7 +125,9 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 360.0f); - RNA_def_property_ui_text(prop, "Outer Cone Angle", "Outer angle of the cone in degrees, outside this cone the volume is the outer cone volume, between inner and outer cone the volume is interpolated."); + RNA_def_property_ui_text(prop, "Outer Cone Angle", + "Outer angle of the cone in degrees, outside this cone the volume is " + "the outer cone volume, between inner and outer cone the volume is interpolated"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -132,7 +135,8 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 360.0f); - RNA_def_property_ui_text(prop, "Inner Cone Angle", "Inner angle of the cone in degrees, inside the cone the volume is 100 %."); + RNA_def_property_ui_text(prop, "Inner Cone Angle", + "Inner angle of the cone in degrees, inside the cone the volume is 100 %"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); @@ -140,21 +144,21 @@ static void rna_def_speaker(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone."); + RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "volume"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Volume", "How loud the sound is."); + RNA_def_property_ui_text(prop, "Volume", "How loud the sound is"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pitch"); RNA_def_property_range(prop, 0.1f, 10.0f); - RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound."); + RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound"); // RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); // RNA_def_property_update(prop, 0, "rna_Speaker_update"); diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c index 54cb6714b1b..7e90dba6e3f 100644 --- a/source/blender/makesrna/intern/rna_text_api.c +++ b/source/blender/makesrna/intern/rna_text_api.c @@ -42,11 +42,11 @@ void RNA_api_text(StructRNA *srna) PropertyRNA *prop; func= RNA_def_function(srna, "clear", "clear_text"); - RNA_def_function_ui_description(func, "clear the text block."); + RNA_def_function_ui_description(func, "clear the text block"); func= RNA_def_function(srna, "write", "write_text"); - RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block."); - prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock."); + RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block"); + prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock"); RNA_def_property_flag(prop, PROP_REQUIRED); } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 608a7326d79..e2beabf789d 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -668,22 +668,31 @@ static void rna_def_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0); RNA_def_property_boolean_sdna(prop, NULL, "ok", 2); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering."); + RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering"); RNA_api_environment_map(srna); } static EnumPropertyItem prop_noise_basis_items[] = { - {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", "Noise algorithm - Blender original: Smooth interpolated noise"}, - {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", "Noise algorithm - Original Perlin: Smooth interpolated noise"}, - {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", "Noise algorithm - Improved Perlin: Smooth interpolated noise"}, - {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"}, - {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"}, - {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"}, - {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"}, + {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", + "Noise algorithm - Blender original: Smooth interpolated noise"}, + {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", + "Noise algorithm - Original Perlin: Smooth interpolated noise"}, + {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", + "Noise algorithm - Improved Perlin: Smooth interpolated noise"}, + {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", + "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"}, + {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", + "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"}, + {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", + "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"}, + {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", + "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"}, {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", "Noise algorithm - Voronoi F1-F2"}, - {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"}, - {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", "Noise algorithm - Cell Noise: Square cell tessallation"}, + {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", + "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"}, + {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", + "Noise algorithm - Cell Noise: Square cell tessallation"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_noise_type[] = { diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index 4941c75c400..9a445ed8ae8 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -107,20 +107,23 @@ void RNA_api_environment_map(StructRNA *srna) static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 }; func= RNA_def_function(srna, "clear", "clear_envmap"); - RNA_def_function_ui_description(func, "Discard the environment map and free it from memory."); + RNA_def_function_ui_description(func, "Discard the environment map and free it from memory"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna,"save", "save_envmap"); - RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings."); + RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken."); + RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); - parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face. Order is [+Z -Z +Y -X -Y +X]. Use -1 to skip a face.", 0.0f, 0.0f); + parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", + "Flat array describing the X,Y position of each cube face in the " + "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " + "(use -1 to skip a face)", 0.0f, 0.0f); } #endif diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 1e60f747b4e..52c359d79dd 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -84,7 +84,7 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re /* region type not found? abort */ if (art==NULL) { - BKE_report(reports, RPT_ERROR, "Region not found in spacetype."); + BKE_report(reports, RPT_ERROR, "Region not found in spacetype"); return NULL; } @@ -167,7 +167,8 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier, + StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; PanelType *pt, dummypt = {NULL}; @@ -184,7 +185,8 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat return NULL; if(strlen(identifier) >= sizeof(dummypt.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummypt.idname)); + BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d", + identifier, (int)sizeof(dummypt.idname)); return NULL; } @@ -280,7 +282,8 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier, + StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; HeaderType *ht, dummyht = {NULL}; @@ -297,7 +300,8 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da return NULL; if(strlen(identifier) >= sizeof(dummyht.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyht.idname)); + BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d", + identifier, (int)sizeof(dummyht.idname)); return NULL; } @@ -397,7 +401,8 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, + StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { MenuType *mt, dummymt = {NULL}; Menu dummymenu= {NULL}; @@ -413,7 +418,8 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data return NULL; if(strlen(identifier) >= sizeof(dummymt.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummymt.idname)); + BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d", + identifier, (int)sizeof(dummymt.idname)); return NULL; } @@ -571,7 +577,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set"); - RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out."); + RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out"); prop= RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set"); @@ -587,11 +593,11 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL); - RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout."); + RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout"); prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); - RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout."); + RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout"); RNA_api_ui_layout(srna); } @@ -603,8 +609,11 @@ static void rna_def_panel(BlenderRNA *brna) FunctionRNA *func; static EnumPropertyItem panel_flag_items[] = { - {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation."}, - {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)."}, + {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", + "Defines if the panel has to be open or collapsed at the time of its creation"}, + {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header", + "If set to True, the panel shows a header, which contains a clickable " + "arrow to collapse the panel and the label (see bl_label)"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Panel", NULL); @@ -615,7 +624,7 @@ static void rna_def_panel(BlenderRNA *brna) /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn."); + RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); @@ -623,20 +632,20 @@ static void rna_def_panel(BlenderRNA *brna) /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout"); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); func= RNA_def_function(srna, "draw_header", NULL); - RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout"); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "UILayout"); - RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI."); + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI"); prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "drawname"); @@ -646,29 +655,37 @@ static void rna_def_panel(BlenderRNA *brna) prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); - RNA_def_property_ui_text(prop, "ID Name", "If this is set, the panel gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_PT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_PT_hello\""); + RNA_def_property_ui_text(prop, "ID Name", + "If this is set, the panel gets a custom ID, otherwise it takes the " + "name of the class used to define the panel. For example, if the " + "class name is \"OBJECT_PT_hello\", and bl_idname is not set by the " + "script, then bl_idname = \"OBJECT_PT_hello\""); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_flag(prop, PROP_REGISTER); - RNA_def_property_ui_text(prop, "Label", "The panel label, shows up in the panel header at the right of the triangle used to collapse the panel."); + RNA_def_property_ui_text(prop, "Label", + "The panel label, shows up in the panel header at the right of the " + "triangle used to collapse the panel"); prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); - RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in."); + RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in"); prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->region_type"); RNA_def_property_enum_items(prop, region_type_items); RNA_def_property_flag(prop, PROP_REGISTER); - RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in."); + RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in"); prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->context"); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */ - RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)"); + RNA_def_property_ui_text(prop, "Context", + "The context in which the panel belongs to. (TODO: explain the " + "possible combinations bl_context/bl_region_type/bl_space_type)"); prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); @@ -685,14 +702,14 @@ static void rna_def_header(BlenderRNA *brna) FunctionRNA *func; srna= RNA_def_struct(brna, "Header", NULL); - RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements."); + RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements"); RNA_def_struct_sdna(srna, "Header"); RNA_def_struct_refine_func(srna, "rna_Header_refine"); RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL); /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout"); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -702,19 +719,23 @@ static void rna_def_header(BlenderRNA *brna) prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_struct_type(prop, "UILayout"); - RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI."); + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI"); /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); - RNA_def_property_ui_text(prop, "ID Name", "If this is set, the header gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_HT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_HT_hello\""); + RNA_def_property_ui_text(prop, "ID Name", + "If this is set, the header gets a custom ID, otherwise it takes the " + "name of the class used to define the panel. For example, if the " + "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the " + "script, then bl_idname = \"OBJECT_HT_hello\""); prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); - RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in."); + RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in"); RNA_define_verify_sdna(1); } @@ -734,7 +755,7 @@ static void rna_def_menu(BlenderRNA *brna) /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn."); + RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); @@ -742,7 +763,7 @@ static void rna_def_menu(BlenderRNA *brna) /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout"); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -752,13 +773,17 @@ static void rna_def_menu(BlenderRNA *brna) prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_struct_type(prop, "UILayout"); - RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI."); + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI"); /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); - RNA_def_property_ui_text(prop, "ID Name", "If this is set, the menu gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_MT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_MT_hello\""); + RNA_def_property_ui_text(prop, "ID Name", + "If this is set, the menu gets a custom ID, otherwise it takes the " + "name of the class used to define the panel. For example, if the " + "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the " + "script, then bl_idname = \"OBJECT_MT_hello\""); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 92c93f41dfc..84568d914af 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -84,7 +84,7 @@ static void api_ui_item_common(FunctionRNA *func) { PropertyRNA *prop; - RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item."); + RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item"); prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, icon_items); @@ -95,7 +95,7 @@ static void api_ui_item_common(FunctionRNA *func) static void api_ui_item_op(FunctionRNA *func) { PropertyRNA *parm; - parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); + parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -109,9 +109,9 @@ static void api_ui_item_rna_common(FunctionRNA *func) { PropertyRNA *parm; - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); RNA_def_property_flag(parm, PROP_REQUIRED); } @@ -134,49 +134,52 @@ void RNA_api_ui_layout(StructRNA *srna) /* simple layout specifiers */ func= RNA_def_function(srna, "row", "uiLayoutRow"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); - RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row."); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row"); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); func= RNA_def_function(srna, "column", "uiLayoutColumn"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); - RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column."); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column"); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); - RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); /* box layout */ func= RNA_def_function(srna, "box", "uiLayoutBox"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); - RNA_def_function_ui_description(func, "Sublayout. Items placed in this sublayout are placed under each other in a column and are surrounded by a box."); + RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed " + "under each other in a column and are surrounded by a box)"); /* split layout */ func= RNA_def_function(srna, "split", "uiLayoutSplit"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); - RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); /* items */ func= RNA_def_function(srna, "prop", "rna_uiItemR"); - RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout."); + RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout"); api_ui_item_rna_common(func); api_ui_item_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); - RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); - RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); - RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text."); - RNA_def_boolean(func, "event", 0, "", "Use button to input key events."); - RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers."); - RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text."); - RNA_def_int(func, "index", -1, -2, INT_MAX, "", "The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used.", -2, INT_MAX); /* RNA_NO_INDEX == -1 */ + RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail"); + RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values"); + RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values"); + RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text"); + RNA_def_boolean(func, "event", 0, "", "Use button to input key events"); + RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers"); + RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text"); + RNA_def_int(func, "index", -1, -2, INT_MAX, "", + "The index of this button, when set a single member of an array can be accessed, " + "when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */ func= RNA_def_function(srna, "props_enum", "uiItemsEnumR"); api_ui_item_rna_common(func); @@ -187,190 +190,194 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string"); api_ui_item_rna_common(func); - parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); + parm= RNA_def_string(func, "value", "", 0, "", "Enum property value"); RNA_def_property_flag(parm, PROP_REQUIRED); api_ui_item_common(func); func= RNA_def_function(srna, "prop_search", "uiItemPointerR"); api_ui_item_rna_common(func); - parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in."); + parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property."); + parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property"); RNA_def_property_flag(parm, PROP_REQUIRED); api_ui_item_common(func); func= RNA_def_function(srna, "operator", "rna_uiItemO"); api_ui_item_op_common(func); - RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text."); - parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true."); + RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text"); + parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", + "Operator properties to fill in, return when 'properties' is set to true"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_function_return(func, parm); - RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator."); + RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator"); /* func= RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string"); api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); + parm= RNA_def_string(func, "value", "", 0, "", "Enum property value"); RNA_def_property_flag(parm, PROP_REQUIRED); */ func= RNA_def_function(srna, "operator_enum", "uiItemsEnumO"); - parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); + parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO"); api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */ - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); api_ui_item_common(func); /* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO"); api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with."); + parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with"); RNA_def_property_flag(parm, PROP_REQUIRED); */ /* func= RNA_def_function(srna, "operator_int", "uiItemIntO"); api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX); + parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", + "Value of the property to call the operator with", INT_MIN, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); */ /* func= RNA_def_function(srna, "operator_float", "uiItemFloatO"); api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX); + parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", + "Value of the property to call the operator with", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); */ /* func= RNA_def_function(srna, "operator_string", "uiItemStringO"); api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with."); + parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with"); RNA_def_property_flag(parm, PROP_REQUIRED); */ func= RNA_def_function(srna, "label", "uiItemL"); - RNA_def_function_ui_description(func, "Item. Display text in the layout."); + RNA_def_function_ui_description(func, "Item. Display text in the layout"); api_ui_item_common(func); func= RNA_def_function(srna, "menu", "uiItemM"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu."); + parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu"); api_ui_item_common(func); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "separator", "uiItemS"); - RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items."); + RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items"); /* context */ func= RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer"); - parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context."); + parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context."); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); /* templates */ func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander."); + RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander"); func= RNA_def_function(srna, "template_ID", "uiTemplateID"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); - RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); - RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); - RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); + RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block"); + RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block"); + RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block"); func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); - RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); - RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); - RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); + RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block"); + RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block"); + RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block"); RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX); RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX); func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "type_property", "", 0, "", "Identifier of property in data giving the type of the ID-blocks to use."); + parm= RNA_def_string(func, "type_property", "", 0, "", + "Identifier of property in data giving the type of the ID-blocks to use"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI."); + RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI"); func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from."); + parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI."); + RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI"); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers."); - parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data."); + RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers"); + parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); - RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints."); - parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data."); + RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints"); + parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc."); - parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); + parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?"); - RNA_def_pointer(func, "parent", "ID", "", "ID datablock."); - RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot."); + RNA_def_pointer(func, "parent", "ID", "", "ID datablock"); + RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot"); func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); - RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps."); + RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps"); api_ui_item_rna_common(func); - RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display."); - RNA_def_boolean(func, "levels", 0, "", "Show black/white levels."); - RNA_def_boolean(func, "brush", 0, "", "Show brush options."); + RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display"); + RNA_def_boolean(func, "levels", 0, "", "Show black/white levels"); + RNA_def_boolean(func, "brush", 0, "", "Show brush options"); func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp"); - RNA_def_function_ui_description(func, "Item. A color ramp widget."); + RNA_def_function_ui_description(func, "Item. A color ramp widget"); api_ui_item_rna_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); + RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail"); func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); - RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data."); + RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data"); api_ui_item_rna_common(func); func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform"); - RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data."); + RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data"); api_ui_item_rna_common(func); func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope"); - RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data."); + RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data"); api_ui_item_rna_common(func); func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); api_ui_item_rna_common(func); - parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property."); + parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data."); + parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data"); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel"); - RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors."); + RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors"); api_ui_item_rna_common(func); RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel"); RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color"); @@ -385,27 +392,27 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "template_image", "uiTemplateImage"); - RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths."); + RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - RNA_def_boolean(func, "compact", 0, "", "Use more compact layout."); + RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); func= RNA_def_function(srna, "template_list", "uiTemplateList"); - RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups."); + RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element."); + parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); - parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element."); + parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element"); RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX); - RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display.", 0, INT_MAX); - RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use."); + RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX); + RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX); + RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use"); func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4bc828cdc4f..b9a53acd6f4 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -44,6 +44,7 @@ #include "WM_types.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" #include "BKE_sound.h" @@ -76,6 +77,11 @@ static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */ } +static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) +{ + BLF_lang_set(NULL); +} + static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr) { UserDef *userdef = (UserDef *)ptr->data; @@ -2463,30 +2469,35 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; /* hardcoded here, could become dynamic somehow */ + /* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */ + /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */ static EnumPropertyItem language_items[] = { - {0, "ENGLISH", 0, "English", ""}, - {1, "JAPANESE", 0, "Japanese", ""}, - {2, "DUTCH", 0, "Dutch", ""}, - {3, "ITALIAN", 0, "Italian", ""}, - {4, "GERMAN", 0, "German", ""}, - {5, "FINNISH", 0, "Finnish", ""}, - {6, "SWEDISH", 0, "Swedish", ""}, - {7, "FRENCH", 0, "French", ""}, - {8, "SPANISH", 0, "Spanish", ""}, - {9, "CATALAN", 0, "Catalan", ""}, - {10, "CZECH", 0, "Czech", ""}, - {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""}, - {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""}, - {13, "RUSSIAN", 0, "Russian", ""}, - {14, "CROATIAN", 0, "Croatian", ""}, - {15, "SERBIAN", 0, "Serbian", ""}, - {16, "UKRAINIAN", 0, "Ukrainian", ""}, - {17, "POLISH", 0, "Polish", ""}, - {18, "ROMANIAN", 0, "Romanian", ""}, - {19, "ARABIC", 0, "Arabic", ""}, - {20, "BULGARIAN", 0, "Bulgarian", ""}, - {21, "GREEK", 0, "Greek", ""}, - {22, "KOREAN", 0, "Korean", ""}, + {0, "DEFAULT", 0, N_("Default (Default)"), ""}, + {1, "ENGLISH", 0, N_("English (English)"), "en_US"}, + {2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"}, + {3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"}, + {4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"}, + {5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"}, + {6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"}, + {7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"}, + {8, "FRENCH", 0, N_("French (Française)"), "fr_FR"}, + {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"}, + {10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"}, + {11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"}, + {12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"}, + {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"}, + {14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"}, + {15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"}, + {16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"}, + {17, "SERBIAN", 0, N_("Serbian (Српском језику)"), "sr_RS"}, + {18, "UKRAINIAN", 0, N_("Ukrainian (Український)"), "uk_UA"}, + {19, "POLISH", 0, N_("Polish (Polski)"), "pl_PL"}, + {20, "ROMANIAN", 0, N_("Romanian (Român)"), "ro_RO"}, + {21, "ARABIC", 0, N_("Arabic (العربية)"), "ar_EG"}, + {22, "BULGARIAN", 0, N_("Bulgarian (Български)"), "bg_BG"}, + {23, "GREEK", 0, N_("Greek (Ελληνικά)"), "el_GR"}, + {24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"}, + /*{25, "Nepali", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/ {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); @@ -2499,7 +2510,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE); RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); + RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update"); prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dpi"); @@ -2522,21 +2533,16 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, language_items); RNA_def_property_ui_text(prop, "Language", "Language use for translation"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); + RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update"); prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS); RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop= RNA_def_property(srna, "use_translate_buttons", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS); - RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "use_translate_toolbox", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS); - RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu"); + prop= RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE); + RNA_def_property_ui_text(prop, "Translate Interface", "Translate Interface"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE); @@ -3002,13 +3008,13 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_NO_SELF); RNA_def_function_ui_description(func, "Add a new addon"); /* return type */ - parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock."); + parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove"); RNA_def_function_flag(func, FUNC_NO_SELF); - RNA_def_function_ui_description(func, "Remove addon."); - parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove."); + RNA_def_function_ui_description(func, "Remove addon"); + parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index a259f84ff1a..606355c4fb6 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -970,12 +970,15 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void * } if(i > ((int)sizeof(dummyop.idname)) - 3) { - BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', is too long, maximum length is %d.", identifier, _operator_idname, (int)sizeof(dummyop.idname) - 3); + BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', " + "is too long, maximum length is %d", identifier, _operator_idname, + (int)sizeof(dummyop.idname) - 3); return NULL; } if(dot != 1) { - BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', must contain 1 '.' character", identifier, _operator_idname); + BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', " + "must contain 1 '.' character", identifier, _operator_idname); return NULL; } } @@ -1069,7 +1072,8 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v } if(strlen(identifier) >= sizeof(dummyop.idname)) { - BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyop.idname)); + BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d", + identifier, (int)sizeof(dummyop.idname)); return NULL; } diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 89e946f498a..8b0bae58455 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -92,7 +92,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons /* only on non-modal maps */ if (km->flag & KEYMAP_MODAL) { - BKE_report(reports, RPT_ERROR, "Not a non-modal keymap."); + BKE_report(reports, RPT_ERROR, "Not a non-modal keymap"); return NULL; } @@ -115,18 +115,18 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports /* only modal maps */ if ((km->flag & KEYMAP_MODAL) == 0) { - BKE_report(reports, RPT_ERROR, "Not a modal keymap."); + BKE_report(reports, RPT_ERROR, "Not a modal keymap"); return NULL; } if (!km->modal_items) { - BKE_report(reports, RPT_ERROR, "No property values defined."); + BKE_report(reports, RPT_ERROR, "No property values defined"); return NULL; } if(RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue)==0) { - BKE_report(reports, RPT_WARNING, "Property value not in enumeration."); + BKE_report(reports, RPT_WARNING, "Property value not in enumeration"); } if(shift) modifier |= KM_SHIFT; @@ -174,17 +174,17 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag) PropertyRNA *parm; RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); - parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); + parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call"); RNA_def_property_flag(parm, PROP_REQUIRED); if(flag & WM_GEN_INVOKE_EVENT) { - parm= RNA_def_pointer(func, "event", "Event", "", "Event."); + parm= RNA_def_pointer(func, "event", "Event", "", "Event"); RNA_def_property_flag(parm, PROP_REQUIRED); } if(flag & WM_GEN_INVOKE_SIZE) { - RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX); - RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX); + RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup", 0, INT_MAX); + RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup", 0, INT_MAX); } if(flag & WM_GEN_INVOKE_RETURN) { @@ -199,12 +199,12 @@ void RNA_api_wm(StructRNA *srna) PropertyRNA *parm; func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect"); - RNA_def_function_ui_description(func, "Show up the file selector."); + RNA_def_function_ui_description(func, "Show up the file selector"); rna_generic_op_invoke(func, 0); func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); - parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); + parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", "")); @@ -214,7 +214,7 @@ void RNA_api_wm(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_range(parm, 0.0, FLT_MAX); RNA_def_property_ui_text(parm, "Time Step", "Interval in seconds between timer events"); - RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None."); + RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None"); parm= RNA_def_pointer(func, "result", "Timer", "", ""); RNA_def_function_return(func, parm); @@ -226,12 +226,12 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); - RNA_def_function_ui_description(func, "Operator popup invoke."); + RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN); /* invoked dialog opens popup with OK button, does not auto-exec operator. */ func= RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup"); - RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke."); + RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); /* invoke enum */ @@ -240,11 +240,11 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup"); - RNA_def_function_ui_description(func, "Operator popup invoke."); + RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); func= RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm"); - RNA_def_function_ui_description(func, "Operator confirmation."); + RNA_def_function_ui_description(func, "Operator confirmation"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN); } @@ -266,7 +266,7 @@ void RNA_api_operator(StructRNA *srna) /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "Test if the operator can be called or not."); + RNA_def_function_ui_description(func, "Test if the operator can be called or not"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); @@ -274,7 +274,7 @@ void RNA_api_operator(StructRNA *srna) /* exec */ func= RNA_def_function(srna, "execute", NULL); - RNA_def_function_ui_description(func, "Execute the operator."); + RNA_def_function_ui_description(func, "Execute the operator"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -284,7 +284,7 @@ void RNA_api_operator(StructRNA *srna) /* check */ func= RNA_def_function(srna, "check", NULL); - RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw."); + RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -294,7 +294,7 @@ void RNA_api_operator(StructRNA *srna) /* invoke */ func= RNA_def_function(srna, "invoke", NULL); - RNA_def_function_ui_description(func, "Invoke the operator."); + RNA_def_function_ui_description(func, "Invoke the operator"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -305,7 +305,7 @@ void RNA_api_operator(StructRNA *srna) RNA_def_function_return(func, parm); func= RNA_def_function(srna, "modal", NULL); /* same as invoke */ - RNA_def_function_ui_description(func, "Modal operator function."); + RNA_def_function_ui_description(func, "Modal operator function"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -317,14 +317,14 @@ void RNA_api_operator(StructRNA *srna) /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw function for the operator."); + RNA_def_function_ui_description(func, "Draw function for the operator"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* cancel */ func= RNA_def_function(srna, "cancel", NULL); - RNA_def_function_ui_description(func, "Called when the operator is cancelled."); + RNA_def_function_ui_description(func, "Called when the operator is cancelled"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -350,7 +350,7 @@ void RNA_api_macro(StructRNA *srna) /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "Test if the operator can be called or not."); + RNA_def_function_ui_description(func, "Test if the operator can be called or not"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); @@ -358,7 +358,7 @@ void RNA_api_macro(StructRNA *srna) /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw function for the operator."); + RNA_def_function_ui_description(func, "Draw function for the operator"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -377,7 +377,7 @@ void RNA_api_keymap(StructRNA *srna) func= RNA_def_function(srna, "active", "rna_keymap_active"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map."); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default"); @@ -420,7 +420,7 @@ void RNA_api_keymapitems(StructRNA *srna) RNA_def_boolean(func, "alt", 0, "Alt", ""); RNA_def_boolean(func, "oskey", 0, "OS Key", ""); RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", ""); - parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item."); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal"); @@ -437,7 +437,7 @@ void RNA_api_keymapitems(StructRNA *srna) RNA_def_boolean(func, "alt", 0, "Alt", ""); RNA_def_boolean(func, "oskey", 0, "OS Key", ""); RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", ""); - parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item."); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "WM_keymap_remove_item"); @@ -463,7 +463,7 @@ void RNA_api_keymaps(StructRNA *srna) RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); RNA_def_boolean(func, "modal", 0, "Modal", ""); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map."); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "find", "rna_keymap_find"); // find_keymap @@ -471,13 +471,13 @@ void RNA_api_keymaps(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); // find_keymap_modal parm= RNA_def_string(func, "name", "", 0, "Operator Name", ""); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map"); RNA_def_function_return(func, parm); } @@ -489,11 +489,11 @@ void RNA_api_keyconfigs(StructRNA *srna) func= RNA_def_function(srna, "new", "WM_keyconfig_new_user"); // add_keyconfig parm= RNA_def_string(func, "name", "", 0, "Name", ""); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration."); + parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "WM_keyconfig_remove"); // remove_keyconfig - parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration."); + parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration"); RNA_def_property_flag(parm, PROP_REQUIRED); } diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index d8344a9e19b..fb4aa4ca4a5 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -65,7 +65,7 @@ set(SRC intern/MOD_meshdeform.c intern/MOD_mirror.c intern/MOD_multires.c - intern/MOD_navmesh.cpp + intern/MOD_navmesh.c intern/MOD_none.c intern/MOD_particleinstance.c intern/MOD_particlesystem.c @@ -117,11 +117,11 @@ if(NOT WITH_MOD_FLUID) endif() if(WITH_GAMEENGINE) - # for MOD_navmesh.cpp + # for MOD_navmesh.c add_definitions(-DWITH_GAMEENGINE) list(APPEND INC ../gpu - ../../../extern/recastnavigation/Recast/Include + ../../../extern/recastnavigation ) endif() diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript index da37539e950..77a2d577fb5 100644 --- a/source/blender/modifiers/SConscript +++ b/source/blender/modifiers/SConscript @@ -1,7 +1,7 @@ #!/usr/bin/python Import ('env') -sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp') +sources = env.Glob('intern/*.c') incs = '. ./intern' incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include' @@ -21,7 +21,7 @@ if env['BF_NO_ELBEEM']: defs.append('DISABLE_ELBEEM') if env['WITH_BF_GAMEENGINE']: - incs += ' #/extern/recastnavigation/Recast/Include' + incs += ' #/extern/recastnavigation' defs.append('WITH_GAMEENGINE') env.BlenderLib ( libname = 'bf_modifiers', sources = sources, diff --git a/source/blender/modifiers/intern/MOD_navmesh.cpp b/source/blender/modifiers/intern/MOD_navmesh.c index 927085033fc..cf4e01ad516 100644 --- a/source/blender/modifiers/intern/MOD_navmesh.cpp +++ b/source/blender/modifiers/intern/MOD_navmesh.c @@ -27,22 +27,17 @@ */ #include <math.h> -#ifdef WITH_GAMEENGINE -# include "Recast.h" -#endif - -extern "C"{ +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" #ifdef WITH_GAMEENGINE +# include "recast-capi.h" # include "BKE_navmesh_conversion.h" # include "GL/glew.h" # include "GPU_buffers.h" # include "GPU_draw.h" #endif -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" - #include "BLI_math.h" #include "BLI_utildefines.h" @@ -53,12 +48,12 @@ extern "C"{ #include "BKE_customdata.h" #include "MEM_guardedalloc.h" -inline int bit(int a, int b) +BM_INLINE int bit(int a, int b) { return (a & (1 << b)) >> b; } -inline void intToCol(int i, float* col) +BM_INLINE void intToCol(int i, float* col) { int r = bit(i, 0) + bit(i, 3) * 2 + 1; int g = bit(i, 1) + bit(i, 4) * 2 + 1; @@ -69,12 +64,12 @@ inline void intToCol(int i, float* col) } -static void initData(ModifierData *md) +static void initData(ModifierData *UNUSED(md)) { /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* UNUSED */ } -static void copyData(ModifierData *md, ModifierData *target) +static void copyData(ModifierData *UNUSED(md), ModifierData *UNUSED(target)) { /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* NavMeshModifierData *tnmmd = (NavMeshModifierData*) target; */ @@ -94,10 +89,12 @@ static void drawNavMeshColored(DerivedMesh *dm) MVert *mvert = (MVert *)CustomData_get_layer(&dm->vertData, CD_MVERT); MFace *mface = (MFace *)CustomData_get_layer(&dm->faceData, CD_MFACE); int* polygonIdx = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST); - if (!polygonIdx) - return; const float BLACK_COLOR[3] = {0.f, 0.f, 0.f}; float col[3]; + + if (!polygonIdx) + return; + /* //UI_ThemeColor(TH_WIRE); glDisable(GL_LIGHTING); @@ -138,23 +135,34 @@ static void drawNavMeshColored(DerivedMesh *dm) static void navDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr)) { + (void) setDrawOptions; + drawNavMeshColored(dm); } static void navDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)[4], - int fast, int (*setMaterial)(int, void *attribs)) + int UNUSED(fast), int (*setMaterial)(int, void *attribs)) { + (void) partial_redraw_planes; + (void) setMaterial; + //drawFacesSolid_original(dm, partial_redraw_planes, fast, setMaterial); drawNavMeshColored(dm); } #endif /* WITH_GAMEENGINE */ -static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,DerivedMesh *dm) +static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *UNUSED(mmd), DerivedMesh *dm) { #ifdef WITH_GAMEENGINE DerivedMesh *result; int maxFaces = dm->getNumFaces(dm); + int *recastData; + int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0; + float* verts=NULL; + unsigned short *dtris=NULL, *dmeshes=NULL, *polys=NULL; + int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL; + int res; result = CDDM_copy(dm); if (!CustomData_has_layer(&result->faceData, CD_RECAST)) @@ -163,24 +171,21 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE, sourceRecastData, maxFaces, "recastData"); } - int *recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST); + recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST); result->drawFacesTex = navDM_drawFacesTex; result->drawFacesSolid = navDM_drawFacesSolid; //process mesh - int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0; - float* verts=NULL; - unsigned short *dtris=NULL, *dmeshes=NULL, *polys=NULL; - int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL; - - bool res = buildNavMeshDataByDerivedMesh(dm, vertsPerPoly, nverts, verts, ndtris, dtris, - npolys, dmeshes, polys, dtrisToPolysMap, dtrisToTrisMap, - trisToFacesMap); + res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris, + &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, + &trisToFacesMap); if (res) { + size_t polyIdx; + //invalidate concave polygon - for (size_t polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) + for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) { unsigned short* poly = &polys[polyIdx*2*vertsPerPoly]; if (!polyIsConvex(poly, vertsPerPoly, verts)) @@ -189,7 +194,9 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv unsigned short *dmesh = &dmeshes[4*polyIdx]; unsigned short tbase = dmesh[2]; unsigned short tnum = dmesh[3]; - for (unsigned short ti=0; ti<tnum; ti++) + unsigned short ti; + + for (ti=0; ti<tnum; ti++) { unsigned short triidx = dtrisToTrisMap[tbase+ti]; unsigned short faceidx = trisToFacesMap[triidx]; @@ -207,19 +214,19 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv //clean up if (verts!=NULL) - delete verts; + MEM_freeN(verts); if (dtris!=NULL) - delete dtris; + MEM_freeN(dtris); if (dmeshes!=NULL) - delete dmeshes; + MEM_freeN(dmeshes); if (polys!=NULL) - delete polys; + MEM_freeN(polys); if (dtrisToPolysMap!=NULL) - delete dtrisToPolysMap; + MEM_freeN(dtrisToPolysMap); if (dtrisToTrisMap!=NULL) - delete dtrisToTrisMap; + MEM_freeN(dtrisToTrisMap); if (trisToFacesMap!=NULL) - delete trisToFacesMap; + MEM_freeN(trisToFacesMap); return result; #else // WITH_GAMEENGINE @@ -237,11 +244,11 @@ static int isDisabled(ModifierData *md, int useRenderParams) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) { DerivedMesh *result = NULL; NavMeshModifierData *nmmd = (NavMeshModifierData*) md; - bool hasRecastData = CustomData_has_layer(&derivedData->faceData, CD_RECAST)>0; + int hasRecastData = CustomData_has_layer(&derivedData->faceData, CD_RECAST)>0; if (ob->body_type!=OB_BODY_TYPE_NAVMESH || !hasRecastData ) { //convert to nav mesh object: @@ -255,10 +262,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der Mesh* obmesh = (Mesh *)ob->data; if (obmesh) { + int i; int numFaces = obmesh->totface; + int* recastData; CustomData_add_layer_named(&obmesh->fdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData"); - int* recastData = (int*)CustomData_get_layer(&obmesh->fdata, CD_RECAST); - for (int i=0; i<numFaces; i++) + recastData = (int*)CustomData_get_layer(&obmesh->fdata, CD_RECAST); + for (i=0; i<numFaces; i++) { recastData[i] = i+1; } @@ -296,5 +305,3 @@ ModifierTypeInfo modifierType_NavMesh = { /* foreachObjectLink */ 0, /* foreachIDLink */ 0, }; - -}; diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 912c14adfdd..0c343332736 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -369,7 +369,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, } if(override_image) { - tface->mode = TF_TEX; tface->tpage = image; } } diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h index 57ebe2191dd..f3e0f811f13 100644 --- a/source/blender/nodes/composite/node_composite_util.h +++ b/source/blender/nodes/composite/node_composite_util.h @@ -79,6 +79,10 @@ #include "RE_shader_ext.h" #include "RE_render_ext.h" +/* only for forward declarations */ +#include "NOD_composite.h" + + /* *************************** operations support *************************** */ /* general signal that's in output sockets, and goes over the wires */ diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c index 418d6802cec..cc55569e566 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c @@ -192,7 +192,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod /* Originally based on the information from the book "The Art and Science of Digital Composition" and * discussions from vfxtalk.com .*/ CompBuf *cbuf; - CompBuf *mask; + /* CompBuf *mask; */ /* UNUSED */ CompBuf *rgbbuf; CompBuf *spillmap; NodeColorspill *ncs; @@ -204,7 +204,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod if(in[0]->data==NULL) return; cbuf=typecheck_compbuf(in[0]->data, CB_RGBA); - mask=typecheck_compbuf(in[1]->data, CB_VAL); + /* mask= */ /* UNUSED */ typecheck_compbuf(in[1]->data, CB_VAL); spillmap=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); rgbbuf=dupalloc_compbuf(cbuf); diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c index 9f4af0e0d33..f3cb223079f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c @@ -91,7 +91,7 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack ** CompBuf *outbuf= NULL; CompBuf *imbuf1= NULL; CompBuf *imbuf2= NULL; - NodeChroma *c; + /* NodeChroma *c; */ /* UNUSED */ /*is anything connected?*/ if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return; @@ -107,7 +107,7 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack ** imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA); } - c=node->storage; + /* c=node->storage; */ /* UNUSED */ outbuf=dupalloc_compbuf(imbuf1); /* note, processor gets a keyvals array passed on as buffer constant */ diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c index d7830b6a260..35f2dbf7b32 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -826,11 +826,11 @@ bNodeTemplate node_forloop_template(bNode *node) void node_forloop_init(bNodeTree *ntree, bNode *node, bNodeTemplate *ntemp) { - bNodeSocket *sock; + /* bNodeSocket *sock; */ /* UNUSED */ node->id = (ID*)ntemp->ngroup; - sock = nodeAddInputFloat(ntree, node, "Iterations", PROP_UNSIGNED, 1, 0, 10000); + /* sock = */ nodeAddInputFloat(ntree, node, "Iterations", PROP_UNSIGNED, 1, 0, 10000); /* NB: group socket input/output roles are inverted internally! * Group "inputs" work as outputs in links and vice versa. @@ -932,11 +932,11 @@ void node_loop_update_tree(bNodeTree *ngroup) void node_whileloop_init(bNodeTree *ntree, bNode *node, bNodeTemplate *ntemp) { - bNodeSocket *sock; + /* bNodeSocket *sock; */ /* UNUSED */ node->id = (ID*)ntemp->ngroup; - sock = nodeAddInputFloat(ntree, node, "Condition", PROP_NONE, 1, 0, 1); + /* sock = */ nodeAddInputFloat(ntree, node, "Condition", PROP_NONE, 1, 0, 1); /* max iterations */ node->custom1 = 10000; diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 07f987f4751..e73abdeefd0 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -18,6 +18,9 @@ defs = [] if is_debug: defs.append('_DEBUG') +if env['WITH_BF_INTERNATIONAL']: + defs.append('INTERNATIONAL') + sources = env.Glob('generic/*.c') env.BlenderLib( libname = 'bf_python_ext', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [363,165]) # ketsji is 360 diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index 8dfbf476995..0a49036c15d 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -48,5 +48,8 @@ set(SRC py_capi_utils.h ) +if(WITH_INTERNATIONAL) + add_definitions(-DINTERNATIONAL) +endif() blender_add_lib(bf_python_ext "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index ae8069cf3c5..44d42a479ec 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -61,9 +61,9 @@ static PySequenceMethods Buffer_SeqMethods = { (binaryfunc) NULL, /*sq_concat */ (ssizeargfunc) NULL, /*sq_repeat */ (ssizeargfunc) Buffer_item, /*sq_item */ - (ssizessizeargfunc) Buffer_slice, /*sq_slice, deprecated TODO, replace */ + (ssizessizeargfunc) NULL, /*sq_slice, deprecated, handled in Buffer_item */ (ssizeobjargproc) Buffer_ass_item, /*sq_ass_item */ - (ssizessizeobjargproc) Buffer_ass_slice, /*sq_ass_slice, deprecated TODO, replace */ + (ssizessizeobjargproc) NULL, /*sq_ass_slice, deprecated handled in Buffer_ass_item */ (objobjproc) NULL, /* sq_contains */ (binaryfunc) NULL, /* sq_inplace_concat */ (ssizeargfunc) NULL, /* sq_inplace_repeat */ @@ -112,13 +112,6 @@ static PyObject *Buffer_to_list_recursive(Buffer *self) return list; } -/* *DEPRECATED* 2011/7/17 bgl.Buffer.list */ -static PyObject *Buffer_list(Buffer *self, void *UNUSED(arg)) -{ - fprintf(stderr, "Warning: 'Buffer.list' deprecated, use '[:]' instead\n"); - return Buffer_to_list(self); -} - static PyObject *Buffer_dimensions(Buffer *self, void *UNUSED(arg)) { PyObject *list= PyList_New(self->ndimensions); @@ -138,7 +131,6 @@ static PyMethodDef Buffer_methods[] = { }; static PyGetSetDef Buffer_getseters[] = { - {(char *)"list", (getter)Buffer_list, NULL, NULL, NULL}, {(char *)"dimensions", (getter)Buffer_dimensions, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL, NULL} }; diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c index 3cf0b0f1f27..87e4a301eff 100644 --- a/source/blender/python/generic/blf_py_api.c +++ b/source/blender/python/generic/blf_py_api.c @@ -31,9 +31,13 @@ #include "blf_py_api.h" #include "../../blenfont/BLF_api.h" +#include "../../blenfont/BLF_translation.h" #include "BLI_utildefines.h" +#ifdef INTERNATIONAL +#include "DNA_userdef_types.h" /* is it bad level? */ +#endif PyDoc_STRVAR(py_blf_position_doc, @@ -367,6 +371,35 @@ static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args) return PyLong_FromLong(BLF_load(filename)); } +PyDoc_STRVAR(py_blf_gettext_doc, +".. function:: gettext(msgid)\n" +"\n" +" Get a msg in local language.\n" +"\n" +" :arg msgid: the source string.\n" +" :type msgid: string\n" +" :return: the localized string.\n" +" :rtype: string\n" +); +static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *value) +{ +#ifdef INTERNATIONAL + if ((U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE)) { + const char *msgid= _PyUnicode_AsString(value); + if(msgid == NULL) { + PyErr_SetString(PyExc_TypeError, "blf.gettext expects a single string argument"); + return NULL; + } + + return PyUnicode_FromString(BLF_gettext(msgid)); + } + else +#endif /* INTERNATIONAL */ + { + return Py_INCREF(value), value; + } +} + /*----------------------------MODULE INIT-------------------------*/ static PyMethodDef BLF_methods[] = { {"aspect", (PyCFunction) py_blf_aspect, METH_VARARGS, py_blf_aspect_doc}, @@ -382,6 +415,7 @@ static PyMethodDef BLF_methods[] = { {"shadow_offset", (PyCFunction) py_blf_shadow_offset, METH_VARARGS, py_blf_shadow_offset_doc}, {"size", (PyCFunction) py_blf_size, METH_VARARGS, py_blf_size_doc}, {"load", (PyCFunction) py_blf_load, METH_VARARGS, py_blf_load_doc}, + {"gettext", (PyCFunction) py_blf_gettext, METH_O, py_blf_gettext_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 3ad5e000233..3bf22d26af4 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -48,6 +48,7 @@ set(SRC bpy_app_handlers.c bpy_driver.c bpy_interface.c + bpy_interface_atexit.c bpy_intern_string.c bpy_library.c bpy_operator.c diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h index 0ebc6bb2438..f60146021d3 100644 --- a/source/blender/python/intern/bpy.h +++ b/source/blender/python/intern/bpy.h @@ -28,3 +28,7 @@ void BPy_init_modules(void); extern PyObject *bpy_package_py; + +/* bpy_interface_atexit.c */ +void BPY_atexit_register(void); +void BPY_atexit_unregister(void); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index e5bfc1d633f..429a74fddc0 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -30,7 +30,7 @@ /* grr, python redefines */ #ifdef _POSIX_C_SOURCE -#undef _POSIX_C_SOURCE +# undef _POSIX_C_SOURCE #endif #include <Python.h> @@ -241,6 +241,8 @@ void BPY_python_start(int argc, const char **argv) pyrna_alloc_types(); + BPY_atexit_register(); /* this can init any time */ + #ifndef WITH_PYTHON_MODULE py_tstate= PyGILState_GetThisThreadState(); PyEval_ReleaseThread(py_tstate); @@ -260,6 +262,8 @@ void BPY_python_end(void) bpy_intern_string_exit(); + BPY_atexit_unregister(); /* without this we get recursive calls to WM_exit */ + Py_Finalize(); #ifdef TIME_PY_RUN diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c new file mode 100644 index 00000000000..ac8c90198a0 --- /dev/null +++ b/source/blender/python/intern/bpy_interface_atexit.c @@ -0,0 +1,94 @@ +/* + * $Id$ + * + * ***** 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 ***** + */ + +/** \file blender/python/intern/bpy_interface_atexit.c + * \ingroup pythonintern + */ + + +#include <Python.h> + +#include "bpy_util.h" + +#include "WM_api.h" + +#include "BLI_utildefines.h" + +static PyObject *bpy_atexit(PyObject *UNUSED(self), PyObject *UNUSED(args), PyObject *UNUSED(kw)) +{ + /* close down enough of blender at least not to crash */ + struct bContext *C= BPy_GetContext(); + + WM_exit_ext(C, 0); + + Py_RETURN_NONE; +} + +static PyMethodDef meth_bpy_atexit= {"bpy_atexit", (PyCFunction)bpy_atexit, METH_NOARGS, NULL}; +static PyObject *func_bpy_atregister= NULL; /* borrowed referebce, atexit holds */ + +static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg) +{ + /* note - no error checking, if any of these fail we'll get a crash + * this is intended, but if its problematic it could be changed + * - campbell */ + + PyObject *atexit_mod= PyImport_ImportModuleLevel((char *)"atexit", NULL, NULL, NULL, 0); + PyObject *atexit_func= PyObject_GetAttrString(atexit_mod, func_name); + PyObject *args= PyTuple_New(1); + PyObject *ret; + + PyTuple_SET_ITEM(args, 0, atexit_func_arg); + Py_INCREF(atexit_func_arg); /* only incref so we dont dec'ref along with 'args' */ + + ret= PyObject_CallObject(atexit_func, args); + + Py_DECREF(atexit_mod); + Py_DECREF(atexit_func); + Py_DECREF(args); + + if(ret) { + Py_DECREF(ret); + } + else { /* should never happen */ + PyErr_Print(); + } +} + +void BPY_atexit_register(void) +{ + /* atexit module owns this new function reference */ + BLI_assert(func_bpy_atregister == NULL); + + func_bpy_atregister= (PyObject *)PyCFunction_New(&meth_bpy_atexit, NULL); + atexit_func_call("register", func_bpy_atregister); +} + +void BPY_atexit_unregister(void) +{ + BLI_assert(func_bpy_atregister != NULL); + + atexit_func_call("unregister", func_bpy_atregister); + func_bpy_atregister= NULL; /* don't really need to set but just incase */ +} diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 5c609d8961f..c96eafcd6ad 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -196,16 +196,18 @@ PyDoc_STRVAR(Euler_rotate_axis_doc, static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args) { float angle = 0.0f; - const char *axis; + int axis; /* actually a character */ - if(!PyArg_ParseTuple(args, "sf:rotate", &axis, &angle)){ + if(!PyArg_ParseTuple(args, "Cf:rotate", &axis, &angle)){ PyErr_SetString(PyExc_TypeError, - "euler.rotate(): " - "expected angle (float) and axis (x, y, z)"); + "Euler.rotate_axis(): " + "expected an axis 'X', 'Y', 'Z' and an angle (float)"); return NULL; } - if(!(ELEM3(*axis, 'X', 'Y', 'Z') && axis[1]=='\0')){ - PyErr_SetString(PyExc_ValueError, "euler.rotate(): " + + if(!(ELEM3(axis, 'X', 'Y', 'Z'))){ + PyErr_SetString(PyExc_ValueError, + "Euler.rotate_axis(): " "expected axis to be 'X', 'Y' or 'Z'"); return NULL; } @@ -214,7 +216,7 @@ static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args) return NULL; - rotate_eulO(self->eul, self->order, *axis, angle); + rotate_eulO(self->eul, self->order, (char)axis, angle); (void)BaseMath_WriteCallback(self); diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 3953171f263..a2a15600965 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -119,7 +119,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { if(kwds && PyDict_Size(kwds)) { PyErr_SetString(PyExc_TypeError, - "mathutils.Matrix(): " + "Matrix(): " "takes no keyword args"); return NULL; } @@ -155,7 +155,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) /* will overwrite error */ PyErr_SetString(PyExc_TypeError, - "mathutils.Matrix(): " + "Matrix(): " "expects no args or 2-4 numeric sequences"); return NULL; } @@ -216,7 +216,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) if(!PyArg_ParseTuple(args, "di|O", &angle, &matSize, &vec)) { PyErr_SetString(PyExc_TypeError, - "mathutils.RotationMatrix(angle, size, axis): " + "Matrix.Rotation(angle, size, axis): " "expected float int and a string or vector"); return NULL; } @@ -225,7 +225,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) axis= _PyUnicode_AsString((PyObject *)vec); if(axis==NULL || axis[0]=='\0' || axis[1]!='\0' || axis[0] < 'X' || axis[0] > 'Z') { PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): " + "Matrix.Rotation(): " "3rd argument axis value must be a 3D vector " "or a string in 'X', 'Y', 'Z'"); return NULL; @@ -240,19 +240,19 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) if(matSize != 2 && matSize != 3 && matSize != 4) { PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): " + "Matrix.Rotation(): " "can only return a 2x2 3x3 or 4x4 matrix"); return NULL; } if(matSize == 2 && (vec != NULL)) { PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): " + "Matrix.Rotation(): " "cannot create a 2x2 rotation matrix around arbitrary axis"); return NULL; } if((matSize == 3 || matSize == 4) && (axis == NULL) && (vec == NULL)) { PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): " + "Matrix.Rotation(): " "axis of rotation for 3d and 4d matrices is required"); return NULL; } @@ -261,47 +261,24 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) if(vec) { float tvec[3]; - if (mathutils_array_parse(tvec, 3, 3, vec, "mathutils.RotationMatrix(angle, size, axis), invalid 'axis' arg") == -1) + if (mathutils_array_parse(tvec, 3, 3, vec, "Matrix.Rotation(angle, size, axis), invalid 'axis' arg") == -1) return NULL; axis_angle_to_mat3((float (*)[3])mat, tvec, angle); } - else if(matSize == 2) { + else if (matSize == 2) { + const float angle_cos= cosf(angle); + const float angle_sin= sinf(angle); + //2D rotation matrix - mat[0] = (float) cos (angle); - mat[1] = (float) sin (angle); - mat[2] = -((float) sin(angle)); - mat[3] = (float) cos(angle); - } - else if(strcmp(axis, "X") == 0) { - //rotation around X - mat[0] = 1.0f; - mat[4] = (float) cos(angle); - mat[5] = (float) sin(angle); - mat[7] = -((float) sin(angle)); - mat[8] = (float) cos(angle); - } - else if(strcmp(axis, "Y") == 0) { - //rotation around Y - mat[0] = (float) cos(angle); - mat[2] = -((float) sin(angle)); - mat[4] = 1.0f; - mat[6] = (float) sin(angle); - mat[8] = (float) cos(angle); - } - else if(strcmp(axis, "Z") == 0) { - //rotation around Z - mat[0] = (float) cos(angle); - mat[1] = (float) sin(angle); - mat[3] = -((float) sin(angle)); - mat[4] = (float) cos(angle); - mat[8] = 1.0f; + mat[0] = angle_cos; + mat[1] = angle_sin; + mat[2] = -angle_sin; + mat[3] = angle_cos; } else { - /* should never get here */ - PyErr_SetString(PyExc_ValueError, - "mathutils.RotationMatrix(): unknown error"); - return NULL; + /* valid axis checked above */ + single_axis_angle_to_mat3((float (*)[3])mat, axis[0], angle); } if(matSize == 4) { @@ -451,7 +428,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) } if(matSize != 2 && matSize != 3 && matSize != 4) { PyErr_SetString(PyExc_ValueError, - "mathutils.Matrix.OrthoProjection(): " + "Matrix.OrthoProjection(): " "can only return a 2x2 3x3 or 4x4 matrix"); return NULL; } @@ -468,7 +445,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) } else { PyErr_Format(PyExc_ValueError, - "mathutils.Matrix.OrthoProjection(): " + "Matrix.OrthoProjection(): " "unknown plane, expected: X, Y, not '%.200s'", plane); return NULL; @@ -489,7 +466,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) } else { PyErr_Format(PyExc_ValueError, - "mathutils.Matrix.OrthoProjection(): " + "Matrix.OrthoProjection(): " "unknown plane, expected: XY, XZ, YZ, not '%.200s'", plane); return NULL; @@ -568,7 +545,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args) } if(matSize != 2 && matSize != 3 && matSize != 4) { PyErr_SetString(PyExc_ValueError, - "mathutils.Matrix.Shear(): " + "Matrix.Shear(): " "can only return a 2x2 3x3 or 4x4 matrix"); return NULL; } @@ -578,7 +555,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args) if(factor==-1.0f && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, - "mathutils.Matrix.Shear(): " + "Matrix.Shear(): " "the factor to be a float"); return NULL; } @@ -627,7 +604,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args) } else { PyErr_SetString(PyExc_ValueError, - "mathutils.Matrix.Shear(): " + "Matrix.Shear(): " "expected: X, Y, XY, XZ, YZ"); return NULL; } @@ -686,7 +663,7 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self) /*must be 3-4 cols, 3-4 rows, square matrix*/ if((self->col_size < 3) || (self->row_size < 3) || (self->col_size != self->row_size)) { PyErr_SetString(PyExc_ValueError, - "matrix.to_quat(): " + "Matrix.to_quat(): " "inappropriate matrix size - expects 3x3 or 4x4 matrix"); return NULL; } @@ -750,13 +727,13 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args) } else { PyErr_SetString(PyExc_ValueError, - "matrix.to_euler(): " + "Matrix.to_euler(): " "inappropriate matrix size - expects 3x3 or 4x4 matrix"); return NULL; } if(order_str) { - order= euler_order_from_string(order_str, "matrix.to_euler()"); + order= euler_order_from_string(order_str, "Matrix.to_euler()"); if(order == -1) return NULL; @@ -785,11 +762,13 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self) if(self->wrapped==Py_WRAP){ PyErr_SetString(PyExc_TypeError, + "Matrix.resize_4x4(): " "cannot resize wrapped data - make a copy and resize that"); return NULL; } if(self->cb_user){ PyErr_SetString(PyExc_TypeError, + "Matrix.resize_4x4(): " "cannot resize owned data - make a copy and resize that"); return NULL; } @@ -797,7 +776,8 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self) self->contigPtr = PyMem_Realloc(self->contigPtr, (sizeof(float) * 16)); if(self->contigPtr == NULL) { PyErr_SetString(PyExc_MemoryError, - "matrix.resize_4x4(): problem allocating pointer space"); + "Matrix.resize_4x4(): " + "problem allocating pointer space"); return NULL; } /*set row pointers*/ @@ -858,7 +838,8 @@ static PyObject *Matrix_to_4x4(MatrixObject *self) /* TODO, 2x2 matrix */ PyErr_SetString(PyExc_TypeError, - "matrix.to_4x4(): inappropriate matrix size"); + "Matrix.to_4x4(): " + "inappropriate matrix size"); return NULL; } @@ -879,7 +860,7 @@ static PyObject *Matrix_to_3x3(MatrixObject *self) if((self->col_size < 3) || (self->row_size < 3)) { PyErr_SetString(PyExc_TypeError, - "matrix.to_3x3(): inappropriate matrix size"); + "Matrix.to_3x3(): inappropriate matrix size"); return NULL; } @@ -903,7 +884,7 @@ static PyObject *Matrix_to_translation(MatrixObject *self) if((self->col_size < 3) || self->row_size < 4){ PyErr_SetString(PyExc_TypeError, - "matrix.to_translation(): " + "Matrix.to_translation(): " "inappropriate matrix size"); return NULL; } @@ -933,7 +914,7 @@ static PyObject *Matrix_to_scale(MatrixObject *self) /*must be 3-4 cols, 3-4 rows, square matrix*/ if((self->col_size < 3) || (self->row_size < 3)) { PyErr_SetString(PyExc_TypeError, - "matrix.to_scale(): " + "Matrix.to_scale(): " "inappropriate matrix size, 3x3 minimum size"); return NULL; } @@ -969,7 +950,7 @@ static PyObject *Matrix_invert(MatrixObject *self) if(self->row_size != self->col_size){ PyErr_SetString(PyExc_TypeError, - "matrix.invert(ed): " + "Matrix.invert(ed): " "only square matrices are supported"); return NULL; } @@ -1005,6 +986,7 @@ static PyObject *Matrix_invert(MatrixObject *self) } else { PyErr_SetString(PyExc_ValueError, + "Matrix.invert(ed): " "matrix does not have an inverse"); return NULL; } @@ -1050,7 +1032,8 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value) if(self->col_size != 3 || self->row_size != 3) { PyErr_SetString(PyExc_TypeError, - "Matrix must have 3x3 dimensions"); + "Matrix.rotate(): " + "must have 3x3 dimensions"); return NULL; } @@ -1082,7 +1065,7 @@ static PyObject *Matrix_decompose(MatrixObject *self) if(self->col_size != 4 || self->row_size != 4) { PyErr_SetString(PyExc_TypeError, - "matrix.decompose(): " + "Matrix.decompose(): " "inappropriate matrix size - expects 4x4 matrix"); return NULL; } @@ -1125,7 +1108,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args) if(self->row_size != mat2->row_size || self->col_size != mat2->col_size) { PyErr_SetString(PyExc_ValueError, - "matrix.lerp(): " + "Matrix.lerp(): " "expects both matrix objects of the same dimensions"); return NULL; } @@ -1142,7 +1125,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args) } else { PyErr_SetString(PyExc_ValueError, - "matrix.lerp(): " + "Matrix.lerp(): " "only 3x3 and 4x4 matrices supported"); return NULL; } @@ -1168,7 +1151,7 @@ static PyObject *Matrix_determinant(MatrixObject *self) if(self->row_size != self->col_size){ PyErr_SetString(PyExc_TypeError, - "matrix.determinant: " + "Matrix.determinant(): " "only square matrices are supported"); return NULL; } @@ -1192,7 +1175,7 @@ static PyObject *Matrix_transpose(MatrixObject *self) if(self->row_size != self->col_size){ PyErr_SetString(PyExc_TypeError, - "matrix.transpose(d): " + "Matrix.transpose(d): " "only square matrices are supported"); return NULL; } @@ -1261,7 +1244,7 @@ static PyObject *Matrix_identity(MatrixObject *self) if(self->row_size != self->col_size){ PyErr_SetString(PyExc_TypeError, - "matrix.identity: " + "Matrix.identity(): " "only square matrices are supported"); return NULL; } @@ -1794,7 +1777,7 @@ static PyObject *Matrix_median_scale_get(MatrixObject *self, void *UNUSED(closur /*must be 3-4 cols, 3-4 rows, square matrix*/ if((self->col_size < 3) || (self->row_size < 3)) { PyErr_SetString(PyExc_AttributeError, - "matrix.median_scale: " + "Matrix.median_scale: " "inappropriate matrix size, 3x3 minimum"); return NULL; } @@ -1816,7 +1799,7 @@ static PyObject *Matrix_is_negative_get(MatrixObject *self, void *UNUSED(closure return PyBool_FromLong(is_negative_m3((float (*)[3])self->contigPtr)); else { PyErr_SetString(PyExc_AttributeError, - "matrix.is_negative: " + "Matrix.is_negative: " "inappropriate matrix size - expects 3x3 or 4x4 matrix"); return NULL; } @@ -1834,7 +1817,7 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->contigPtr)); else { PyErr_SetString(PyExc_AttributeError, - "matrix.is_orthogonal: " + "Matrix.is_orthogonal: " "inappropriate matrix size - expects 3x3 or 4x4 matrix"); return NULL; } diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 2be258a1ef0..947e4425d3f 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -161,7 +161,7 @@ static PyObject *Quaternion_cross(QuaternionObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "quaternion.cross(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.cross(other), invalid 'other' arg") == -1) return NULL; mul_qt_qtqt(quat, self->quat, tquat); @@ -186,7 +186,7 @@ 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)); @@ -209,7 +209,7 @@ 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); @@ -244,7 +244,7 @@ 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) { @@ -275,7 +275,7 @@ static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_any_to_rotmat(other_rmat, value, "quaternion.rotate(value)") == -1) + if(mathutils_any_to_rotmat(other_rmat, value, "Quaternion.rotate(value)") == -1) return NULL; length= normalize_qt_qt(tquat, self->quat); @@ -909,7 +909,7 @@ static int Quaternion_setAngle(QuaternionObject *self, PyObject *value, void *UN if(angle==-1.0 && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, - "quaternion.angle = value: float expected"); + "Quaternion.angle = value: float expected"); return -1; } diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 56c1334ecac..413df78f09e 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -48,6 +48,7 @@ static PyObject *Vector_copy(VectorObject *self); static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits); +static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat); /* Supports 2D, 3D, and 4D vector objects both int and float values * accepted. Mixed float and int values accepted. Ints are parsed to float @@ -158,13 +159,13 @@ static PyObject *Vector_resize_2d(VectorObject *self) { if(self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, - "vector.resize_2d(): " + "Vector.resize_2d(): " "cannot resize wrapped data - only python vectors"); return NULL; } if(self->cb_user) { PyErr_SetString(PyExc_TypeError, - "vector.resize_2d(): " + "Vector.resize_2d(): " "cannot resize a vector that has an owner"); return NULL; } @@ -172,7 +173,7 @@ static PyObject *Vector_resize_2d(VectorObject *self) self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, - "vector.resize_2d(): " + "Vector.resize_2d(): " "problem allocating pointer space"); return NULL; } @@ -193,13 +194,13 @@ static PyObject *Vector_resize_3d(VectorObject *self) { if (self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, - "vector.resize_3d(): " + "Vector.resize_3d(): " "cannot resize wrapped data - only python vectors"); return NULL; } if(self->cb_user) { PyErr_SetString(PyExc_TypeError, - "vector.resize_3d(): " + "Vector.resize_3d(): " "cannot resize a vector that has an owner"); return NULL; } @@ -207,7 +208,7 @@ static PyObject *Vector_resize_3d(VectorObject *self) self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, - "vector.resize_3d(): " + "Vector.resize_3d(): " "problem allocating pointer space"); return NULL; } @@ -231,13 +232,13 @@ static PyObject *Vector_resize_4d(VectorObject *self) { if(self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, - "vector.resize_4d(): " + "Vector.resize_4d(): " "cannot resize wrapped data - only python vectors"); return NULL; } if(self->cb_user) { PyErr_SetString(PyExc_TypeError, - "vector.resize_4d(): " + "Vector.resize_4d(): " "cannot resize a vector that has an owner"); return NULL; } @@ -245,7 +246,7 @@ static PyObject *Vector_resize_4d(VectorObject *self) self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, - "vector.resize_4d(): " + "Vector.resize_4d(): " "problem allocating pointer space"); return NULL; } @@ -353,7 +354,7 @@ static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args) if(ndigits > 22 || ndigits < 0) { PyErr_SetString(PyExc_ValueError, - "vector.to_tuple(ndigits): " + "Vector.to_tuple(ndigits): " "ndigits must be between 0 and 21"); return NULL; } @@ -390,7 +391,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args) if (self->size != 3) { PyErr_SetString(PyExc_TypeError, - "vector.to_track_quat(): " + "Vector.to_track_quat(): " "only for 3D vectors"); return NULL; } @@ -511,7 +512,7 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if((value_size= mathutils_array_parse(tvec, 2, 4, value, "vector.reflect(other), invalid 'other' arg")) == -1) + if((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1) return NULL; mirror[0] = tvec[0]; @@ -550,7 +551,7 @@ static PyObject *Vector_cross(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_array_parse(tvec, self->size, self->size, value, "vector.cross(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1) return NULL; ret= (VectorObject *)newVectorObject(NULL, 3, Py_NEW, Py_TYPE(self)); @@ -577,7 +578,7 @@ static PyObject *Vector_dot(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_array_parse(tvec, self->size, self->size, value, "vector.dot(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1) return NULL; for(x = 0; x < self->size; x++) { @@ -617,7 +618,7 @@ 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) + if(mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1) return NULL; for(x = 0; x < size; x++) { @@ -632,7 +633,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args) } else { PyErr_SetString(PyExc_ValueError, - "vector.angle(other): " + "Vector.angle(other): " "zero length vectors have no valid angle"); return NULL; } @@ -674,7 +675,7 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "vector.difference(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1) return NULL; normalize_v3_v3(vec_a, self->vec); @@ -706,7 +707,7 @@ static PyObject *Vector_project(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_array_parse(tvec, size, size, value, "vector.project(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1) return NULL; if(BaseMath_ReadCallback(self) == -1) @@ -748,7 +749,7 @@ static PyObject *Vector_lerp(VectorObject *self, PyObject *args) if(!PyArg_ParseTuple(args, "Of:lerp", &value, &fac)) return NULL; - if(mathutils_array_parse(tvec, size, size, value, "vector.lerp(other), invalid 'other' arg") == -1) + if(mathutils_array_parse(tvec, size, size, value, "Vector.lerp(other), invalid 'other' arg") == -1) return NULL; if(BaseMath_ReadCallback(self) == -1) @@ -777,7 +778,7 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value) if(BaseMath_ReadCallback(self) == -1) return NULL; - if(mathutils_any_to_rotmat(other_rmat, value, "vector.rotate(value)") == -1) + if(mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1) return NULL; if(self->size < 3) { @@ -838,7 +839,7 @@ static PyObject *vector_item_internal(VectorObject *self, int i, const int is_at if(i < 0 || i >= self->size) { if(is_attr) { PyErr_Format(PyExc_AttributeError, - "vector.%c: unavailable on %dd vector", + "Vector.%c: unavailable on %dd vector", *(((char *)"xyzw") + i), self->size); } else { @@ -874,7 +875,7 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value, if(i < 0 || i >= self->size){ if(is_attr) { PyErr_Format(PyExc_AttributeError, - "vector.%c = x: unavailable on %dd vector", + "Vector.%c = x: unavailable on %dd vector", *(((char *)"xyzw") + i), self->size); } else { @@ -1159,28 +1160,16 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2) } else if (vec1) { if (MatrixObject_Check(v2)) { - -/* ------ to be removed ------*/ -#if 1 - PyErr_SetString(PyExc_ValueError, - "(Vector * Matrix) is now removed, reverse the " - "order (promoted to an Error for Debug builds)"); - return NULL; -#else - /* VEC * MATRIX */ - /* this is deprecated!, use the reverse instead */ float tvec[MAX_DIMENSIONS]; if(BaseMath_ReadCallback((MatrixObject *)v2) == -1) return NULL; - if(column_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) { + if(row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) { return NULL; } return newVectorObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1)); -#endif -/* ------ to be removed ------*/ } else if (QuaternionObject_Check(v2)) { /* VEC * QUAT */ @@ -2219,20 +2208,19 @@ if len(unique) != len(items): print "ERROR" */ -#if 0 -//ROW VECTOR Multiplication - Vector X Matrix -//[x][y][z] * [1][4][7] -// [2][5][8] -// [3][6][9] -//vector/matrix multiplication IS NOT COMMUTATIVE!!!! -static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObject * mat) +/* ROW VECTOR Multiplication - Vector X Matrix + * [x][y][z] * [1][4][7] + * [2][5][8] + * [3][6][9] + * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */ +static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) { - float vec_cpy[4]; + float vec_cpy[MAX_DIMENSIONS]; double dot = 0.0f; - int x, y, z = 0, vec_size = vec->size; + int x, y, z= 0, vec_size= vec->size; - if(mat->colSize != vec_size){ - if(mat->colSize == 4 && vec_size != 3){ + if(mat->col_size != vec_size){ + if(mat->col_size == 4 && vec_size != 3){ PyErr_SetString(PyExc_ValueError, "vector * matrix: matrix column size " "and the vector size must be the same"); @@ -2247,11 +2235,11 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj return -1; memcpy(vec_cpy, vec->vec, vec_size * sizeof(float)); - +printf("asasas\n"); rvec[3] = 1.0f; //muliplication - for(x = 0; x < mat->rowSize; x++) { - for(y = 0; y < mat->colSize; y++) { + for(x = 0; x < mat->row_size; x++) { + for(y = 0; y < mat->col_size; y++) { dot += mat->matrix[x][y] * vec_cpy[y]; } rvec[z++] = (float)dot; @@ -2259,7 +2247,6 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj } return 0; } -#endif /*----------------------------Vector.negate() -------------------- */ PyDoc_STRVAR(Vector_negate_doc, diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index ba7af235acc..a15662f86f4 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -981,7 +981,7 @@ static void flag_render_node_material(Render *re, bNodeTree *ntree) } } -static Material *give_render_material(Render *re, Object *ob, int nr) +static Material *give_render_material(Render *re, Object *ob, short nr) { extern Material defmaterial; /* material.c */ Material *ma; @@ -2688,7 +2688,8 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr, int timeoffset, float *orco, float mat[4][4]) { Object *ob= obr->ob; - int a, a1, end, totvert, vertofs; + int a, end, totvert, vertofs; + short mat_iter; VertRen *ver; VlakRen *vlr; MVert *mvert = NULL; @@ -2718,16 +2719,16 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr, /* faces in order of color blocks */ vertofs= obr->totvert - totvert; - for(a1=0; (a1<ob->totcol || (a1==0 && ob->totcol==0)); a1++) { + for(mat_iter= 0; (mat_iter < ob->totcol || (mat_iter==0 && ob->totcol==0)); mat_iter++) { - ma= give_render_material(re, ob, a1+1); + ma= give_render_material(re, ob, mat_iter+1); end= dm->getNumFaces(dm); mface= dm->getFaceArray(dm); for(a=0; a<end; a++, mface++) { int v1, v2, v3, v4, flag; - if( mface->mat_nr==a1 ) { + if(mface->mat_nr == mat_iter) { float len; v1= mface->v1; diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index dd5deddece9..5c5162d268b 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -306,7 +306,7 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz, /* soften the halo if it intersects geometry */ if(har->mat && har->mat->mode & MA_HALO_SOFT) { - float segment_length, halo_depth, distance_from_z, visible_depth, soften; + float segment_length, halo_depth, distance_from_z /* , visible_depth */ /* UNUSED */, soften; /* calculate halo depth */ segment_length= har->hasize*sasqrt(1.0f - dist/(har->rad*har->rad)); @@ -317,7 +317,7 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz, /* calculate how much of this depth is visible */ distance_from_z = haloZtoDist(zz) - haloZtoDist(har->zs); - visible_depth = halo_depth; + /* visible_depth = halo_depth; */ /* UNUSED */ if(distance_from_z < segment_length) { soften= (segment_length + distance_from_z)/halo_depth; diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 980f6b6af1e..36ded5c10d2 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -107,7 +107,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa ParticleSimulationData sim= {NULL}; ParticleData *pa=NULL; float cfra = BKE_curframe(re->scene); - int i, childexists; + int i /*, childexists*/ /* UNUSED */; int total_particles, offset=0; int data_used = point_data_used(pd); float partco[3]; @@ -143,9 +143,11 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa pd->totpoints = total_particles; if (data_used & POINT_DATA_VEL) offset = pd->totpoints*3; +#if 0 /* UNUSED */ if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; - +#endif + for (i=0, pa=psys->particles; i < total_particles; i++, pa++) { state.time = cfra; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index ad592609ce6..641fec90cf3 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1994,7 +1994,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T else { /* same as above, but doing 5 taps, increasing quality at cost of speed */ float STc[3], STl[3], STr[3], STd[3], STu[3]; - float Hc, Hl, Hr, Hd, Hu; + float /* Hc, */ /* UNUSED */ Hl, Hr, Hd, Hu; texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt); @@ -2017,7 +2017,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T // use texres for the center sample, set rgbnor rgbnor = multitex_mtex(shi, mtex, STc, dxt, dyt, texres); - Hc = (fromrgb)? RGBTOBW(texres->tr, texres->tg, texres->tb) : texres->tin; + /* Hc = (fromrgb)? RGBTOBW(texres->tr, texres->tg, texres->tb) : texres->tin; */ /* UNUSED */ // use ttexr for the other taps multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 59a505a3195..bc5e7f23e21 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -992,7 +992,7 @@ static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl) } /* adds only alpha values */ -void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz) +static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz) { /* use zbuffer to define edges, add it to the image */ int y, x, col, *rz, *rz1, *rz2, *rz3; @@ -1133,7 +1133,7 @@ typedef struct ZbufSolidData { float *edgerect; } ZbufSolidData; -void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data) +static void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data) { ZbufSolidData *sdata= (ZbufSolidData*)data; ListBase *lb= sdata->psmlist; @@ -1515,7 +1515,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe { ShadeInput *shi= ssamp->shi; ShadeResult shr; - float texfac, orthoarea, nor[3], alpha, sx, sy; + float /* texfac,*/ /* UNUSED */ orthoarea, nor[3], alpha, sx, sy; /* cache for shadow */ shi->samplenr= R.shadowsamplenr[shi->thread]++; @@ -1578,7 +1578,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe VECCOPY(color, shr.combined); /* texture blending */ - texfac= shi->mat->sss_texfac; + /* texfac= shi->mat->sss_texfac; */ /* UNUSED */ alpha= shr.combined[3]; *area *= alpha; diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index e4b2a0cf1d1..a4bf6c6b5e1 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -61,16 +61,16 @@ /* XXX, could be better implemented... this is for endian issues */ -#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) -#define RCOMP 3 -#define GCOMP 2 -#define BCOMP 1 -#define ACOMP 0 +#ifdef __BIG_ENDIAN__ +# define RCOMP 3 +# define GCOMP 2 +# define BCOMP 1 +# define ACOMP 0 #else -#define RCOMP 0 -#define GCOMP 1 -#define BCOMP 2 -#define ACOMP 3 +# define RCOMP 0 +# define GCOMP 1 +# define BCOMP 2 +# define ACOMP 3 #endif /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 3f26c0ad6d0..e189b3cf638 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1502,12 +1502,12 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr) LampRen *lar; GroupObject *go; float inpr, lv[3]; - float *view, shadfac[4]; + float /* *view, */ shadfac[4]; float ir, accum, visifac, lampdist; float shaded = 0.0f, lightness = 0.0f; - view= shi->view; + /* view= shi->view; */ /* UNUSED */ accum= ir= 0.0f; lights= get_lights(shi); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index ac56304bdcb..f36994e0969 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2864,7 +2864,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float * float v1[3], v2[3], v3[3], v4[3], fx, fy; float *rectvz, *dvz, *dimg, *dvec1, *dvec2, *dz, *dz1, *dz2, *rectz; float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm, *ro; - float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed, totfac; + float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed; int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples; int tsktsk= 0; static int firsttime= 1; @@ -3038,7 +3038,6 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float * } memset(newrect, 0, sizeof(float)*xsize*ysize*4); - totfac= 0.0f; /* accumulate */ samples/= 2; diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index 80c526f8649..c60752b85f8 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -39,4 +39,7 @@ if env['OURPLATFORM'] != 'darwin' or env['WITH_GHOST_COCOA']: if env['BF_BUILDINFO']: defs.append('WITH_BUILDINFO') +if env['WITH_BF_INTERNATIONAL']: + defs.append('INTERNATIONAL') + env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] ) diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 5bdf1ec2787..9e19a057175 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -72,6 +72,7 @@ void WM_setinitialstate_fullscreen(void); void WM_setinitialstate_normal(void); void WM_init (struct bContext *C, int argc, const char **argv); +void WM_exit_ext (struct bContext *C, const short do_python); void WM_exit (struct bContext *C); void WM_main (struct bContext *C); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 518ebeafc80..75fec6ed705 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -85,7 +85,7 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA void wm_event_add(wmWindow *win, wmEvent *event_to_add) { - wmEvent *event= MEM_callocN(sizeof(wmEvent), "event"); + wmEvent *event= MEM_callocN(sizeof(wmEvent), "wmEvent"); *event= *event_to_add; BLI_addtail(&win->queue, event); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 6b3a574b6b6..f862af6173a 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -59,6 +59,8 @@ #include "BLI_utildefines.h" #include "BLI_callbacks.h" +#include "BLF_translation.h" + #include "DNA_anim_types.h" #include "DNA_ipo_types.h" // XXX old animation system #include "DNA_object_types.h" @@ -429,16 +431,17 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) else if(retval == BKE_READ_EXOTIC_OK_OTHER) BKE_write_undo(C, "Import file"); else if(retval == BKE_READ_EXOTIC_FAIL_OPEN) { - BKE_reportf(reports, RPT_ERROR, "Can't read file: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to open the file"); + BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Can't read file: \"%s\", %s.")), filepath, + errno ? strerror(errno) : UI_translate_do_iface(N_("Unable to open the file"))); } else if(retval == BKE_READ_EXOTIC_FAIL_FORMAT) { - BKE_reportf(reports, RPT_ERROR, "File format is not supported in file: \"%s\".", filepath); + BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File format is not supported in file: \"%s\".")), filepath); } else if(retval == BKE_READ_EXOTIC_FAIL_PATH) { - BKE_reportf(reports, RPT_ERROR, "File path invalid: \"%s\".", filepath); + BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File path invalid: \"%s\".")), filepath); } else { - BKE_reportf(reports, RPT_ERROR, "Unknown error loading: \"%s\".", filepath); + BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Unknown error loading: \"%s\".")), filepath); BLI_assert(!"invalid 'retval'"); } diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index de4afa79448..52c0cb902c1 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -232,7 +232,7 @@ static void wm_gesture_draw_circle(wmGesture *gt) static void draw_filled_lasso(wmGesture *gt) { EditVert *v=NULL, *lastv=NULL, *firstv=NULL; - EditEdge *e; + /* EditEdge *e; */ /* UNUSED */ EditFace *efa; short *lasso= (short *)gt->customdata; int i; @@ -246,7 +246,7 @@ static void draw_filled_lasso(wmGesture *gt) v = BLI_addfillvert(co); if (lastv) - e = BLI_addfilledge(lastv, v); + /* e = */ /* UNUSED */ BLI_addfilledge(lastv, v); lastv = v; if (firstv==NULL) firstv = v; } diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 850de9029c9..cf3f12da767 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -99,6 +99,7 @@ #include "UI_interface.h" #include "BLF_api.h" +#include "BLF_translation.h" #include "GPU_buffers.h" #include "GPU_extensions.h" @@ -143,6 +144,8 @@ void WM_init(bContext *C, int argc, const char **argv) /* get the default database, plus a wm */ WM_read_homefile(C, NULL, G.factory_startup); + BLF_lang_set(NULL); + /* note: there is a bug where python needs initializing before loading the * startup.blend because it may contain PyDrivers. It also needs to be after * initializing space types and other internal data. @@ -296,6 +299,8 @@ int WM_init_game(bContext *C) WM_operator_name_call(C, "VIEW3D_OT_game_start", WM_OP_EXEC_DEFAULT, NULL); + sound_exit(); + return 1; } else @@ -340,7 +345,8 @@ extern void free_fmodifiers_copybuf(void); extern void free_posebuf(void); /* called in creator.c even... tsk, split this! */ -void WM_exit(bContext *C) +/* note, doesnt run exit() call WM_exit() for that */ +void WM_exit_ext(bContext *C, const short do_python) { wmWindow *win; @@ -376,7 +382,7 @@ void WM_exit(bContext *C) BIF_freeTemplates(C); free_ttfont(); /* bke_font.h */ - + free_openrecent(); BKE_freecubetable(); @@ -396,6 +402,10 @@ void WM_exit(bContext *C) free_posebuf(); BLF_exit(); + +#ifdef INTERNATIONAL + BLF_free_unifont(); +#endif ANIM_keyingset_infos_exit(); @@ -406,14 +416,17 @@ void WM_exit(bContext *C) #ifdef WITH_PYTHON - /* XXX - old note */ - /* before free_blender so py's gc happens while library still exists */ - /* needed at least for a rare sigsegv that can happen in pydrivers */ - - /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's - * so decref'ing them after python ends causes bad problems every time - * the pyDriver bug can be fixed if it happens again we can deal with it then */ - BPY_python_end(); + /* option not to close python so we can use 'atexit' */ + if(do_python) { + /* XXX - old note */ + /* before free_blender so py's gc happens while library still exists */ + /* needed at least for a rare sigsegv that can happen in pydrivers */ + + /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's + * so decref'ing them after python ends causes bad problems every time + * the pyDriver bug can be fixed if it happens again we can deal with it then */ + BPY_python_end(); + } #endif GPU_global_buffer_pool_free(); @@ -458,6 +471,10 @@ void WM_exit(bContext *C) getchar(); } #endif - exit(G.afbreek==1); } +void WM_exit(bContext *C) +{ + WM_exit_ext(C, 1); + exit(G.afbreek==1); +} diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 68a4eebf93f..320dc2ecdda 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -49,7 +49,7 @@ #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" -#include "BLF_api.h" +#include "BLF_translation.h" #include "PIL_time.h" @@ -78,8 +78,10 @@ #include "BIF_gl.h" #include "BIF_glutil.h" /* for paint cursor */ +#include "BLF_api.h" #include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" #include "ED_screen.h" #include "ED_util.h" @@ -149,12 +151,11 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType*)) opfunc(ot); if(ot->name==NULL) { - static char dummy_name[] = "Dummy Name"; fprintf(stderr, "ERROR: Operator %s has no name property!\n", ot->idname); - ot->name= dummy_name; + ot->name= UI_translate_do_iface(N_("Dummy Name")); } - RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)"); // XXX All ops should have a description but for now allow them not to. + RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)"))); // XXX All ops should have a description but for now allow them not to. RNA_def_struct_identifier(ot->srna, ot->idname); BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot); @@ -167,7 +168,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *us ot= MEM_callocN(sizeof(wmOperatorType), "operatortype"); ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties"); opfunc(ot, userdata); - RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)"); + RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)"))); RNA_def_struct_identifier(ot->srna, ot->idname); BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot); @@ -361,7 +362,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam ot->poll= NULL; if(!ot->description) - ot->description= "(undocumented operator)"; + ot->description= UI_translate_do_iface(N_("(undocumented operator)")); RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); // XXX All ops should have a description but for now allow them not to. RNA_def_struct_identifier(ot->srna, ot->idname); @@ -386,7 +387,7 @@ void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType*, void*), vo ot->poll= NULL; if(!ot->description) - ot->description= "(undocumented operator)"; + ot->description= UI_translate_do_iface(N_("(undocumented operator)")); opfunc(ot, userdata); @@ -783,7 +784,7 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message else properties= NULL; - pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION); + pup= uiPupMenuBegin(C, UI_translate_do_iface(N_("OK?")), ICON_QUESTION); layout= uiPupMenuLayout(pup); uiItemFullO(layout, op->type->idname, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0); uiPupMenuEnd(C, pup); @@ -864,10 +865,10 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, void WM_operator_properties_select_all(wmOperatorType *ot) { static EnumPropertyItem select_all_actions[] = { - {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"}, - {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"}, - {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"}, - {SEL_INVERT, "INVERT", 0, "Invert", "Invert selection of all elements"}, + {SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"}, + {SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"}, + {SEL_DESELECT, "DESELECT", 0, N_("Deselect"), "Deselect all elements"}, + {SEL_INVERT, "INVERT", 0, N_("Invert"), "Invert selection of all elements"}, {0, NULL, 0, NULL, NULL} }; @@ -876,25 +877,25 @@ void WM_operator_properties_select_all(wmOperatorType *ot) { void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend) { - RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, N_("Gesture Mode"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, N_("X Min"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, N_("X Max"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, N_("Y Min"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, N_("Y Max"), "", INT_MIN, INT_MAX); if(extend) - RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first"); + RNA_def_boolean(ot->srna, "extend", 1, _("Extend"), _("Extend selection instead of deselecting everything first")); } void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor) { - RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, "X Start", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, "X End", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, "Y Start", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, "Y End", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, N_("X Start"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, N_("X End"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, N_("Y Start"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, N_("Y End"), "", INT_MIN, INT_MAX); if(cursor) - RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX); + RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, N_("Cursor"), N_("Mouse cursor style to use during the modal operator"), 0, INT_MAX); } @@ -923,7 +924,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) wmOperator *op= arg_op; uiBlock *block; uiLayout *layout; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); int width= 300; @@ -1001,7 +1002,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) wmOperator *op= data->op; uiBlock *block; uiLayout *layout; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); @@ -1025,7 +1026,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) col= uiLayoutColumn(layout, FALSE); col_block= uiLayoutGetBlock(col); /* Create OK button, the callback of which will execute op */ - btn= uiDefBut(col_block, BUT, 0, "OK", 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + btn= uiDefBut(col_block, BUT, 0, UI_translate_do_iface(N_("OK")), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiButSetFunc(btn, dialog_exec_cb, data, col_block); } @@ -1042,7 +1043,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) wmOperator *op= data->op; uiBlock *block; uiLayout *layout; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); block= uiBeginBlock(C, ar, "opui_popup", UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); @@ -1206,14 +1207,19 @@ static int wm_resource_check_prev(void) static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg)) { + extern char datatoc_splash_png[]; + extern int datatoc_splash_png_size; + uiBlock *block; uiBut *but; uiLayout *layout, *split, *col; - uiStyle *style= U.uistyles.first; + uiStyle *style= UI_GetStyle(); struct RecentFile *recent; int i; MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE); char url[96]; + /* hardcoded to splash, loading and freeing every draw, eek! */ + ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect); #ifdef WITH_BUILDINFO int ver_width, rev_width; @@ -1237,7 +1243,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); - but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, NULL, 0.0, 0.0, 0, 0, ""); + but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */ uiButSetFunc(but, wm_block_splash_close, block, NULL); uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); @@ -1266,19 +1272,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar split = uiLayoutSplit(layout, 0, 0); col = uiLayoutColumn(split, 0); uiItemL(col, "Links", ICON_NONE); - uiItemStringO(col, "Donations", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); - uiItemStringO(col, "Credits", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); - uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259"); - uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); - uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); - uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); + uiItemStringO(col, UI_translate_do_iface(N_("Donations")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); + uiItemStringO(col, UI_translate_do_iface(N_("Credits")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); + uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259"); + uiItemStringO(col, UI_translate_do_iface(N_("Manual")), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); + uiItemStringO(col, UI_translate_do_iface(N_("Blender Website")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); + uiItemStringO(col, UI_translate_do_iface(N_("User Community")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) { BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100); } else { BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); } - uiItemStringO(col, "Python API Reference", ICON_URL, "WM_OT_url_open", "url", url); + uiItemStringO(col, UI_translate_do_iface(N_("Python API Reference")), ICON_URL, "WM_OT_url_open", "url", url); uiItemL(col, "", ICON_NONE); col = uiLayoutColumn(split, 0); @@ -1288,7 +1294,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemS(col); } - uiItemL(col, "Recent", ICON_NONE); + uiItemL(col, UI_translate_do_iface(N_("Recent")), ICON_NONE); for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) { uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); } @@ -3298,13 +3304,13 @@ static void redraw_timer_window_swap(bContext *C) } static EnumPropertyItem redraw_timer_type_items[] = { - {0, "DRAW", 0, "Draw Region", "Draw Region"}, - {1, "DRAW_SWAP", 0, "Draw Region + Swap", "Draw Region and Swap"}, - {2, "DRAW_WIN", 0, "Draw Window", "Draw Window"}, - {3, "DRAW_WIN_SWAP", 0, "Draw Window + Swap", "Draw Window and Swap"}, - {4, "ANIM_STEP", 0, "Anim Step", "Animation Steps"}, - {5, "ANIM_PLAY", 0, "Anim Play", "Animation Playback"}, - {6, "UNDO", 0, "Undo/Redo", "Undo/Redo"}, + {0, "DRAW", 0, N_("Draw Region"), N_("Draw Region")}, + {1, "DRAW_SWAP", 0, N_("Draw Region + Swap"), N_("Draw Region and Swap")}, + {2, "DRAW_WIN", 0, N_("Draw Window"), N_("Draw Window")}, + {3, "DRAW_WIN_SWAP", 0, N_("Draw Window + Swap"), N_("Draw Window and Swap")}, + {4, "ANIM_STEP", 0, N_("Anim Step"), N_("Animation Steps")}, + {5, "ANIM_PLAY", 0, N_("Anim Play"), N_("Animation Playback")}, + {6, "UNDO", 0, N_("Undo/Redo"), N_("Undo/Redo")}, {0, NULL, 0, NULL, NULL}}; static int redraw_timer_exec(bContext *C, wmOperator *op) @@ -3537,14 +3543,14 @@ void wm_operatortype_init(void) static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, - {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, - {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, "Add", ""}, - {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, "Subtract", ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, + {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, N_("Confirm"), ""}, + {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, N_("Add"), ""}, + {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, N_("Subtract"), ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, - {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""}, - {GESTURE_MODAL_NOP,"NOP", 0, "No Operation", ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, + {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""}, + {GESTURE_MODAL_NOP,"NOP", 0, N_("No Operation"), ""}, {0, NULL, 0, NULL, NULL}}; @@ -3590,9 +3596,9 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Straight Line"); @@ -3618,10 +3624,10 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf) static void gesture_border_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, - {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, + {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Border"); @@ -3673,10 +3679,10 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf) static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, - {GESTURE_MODAL_IN, "IN", 0, "In", ""}, - {GESTURE_MODAL_OUT, "OUT", 0, "Out", ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, + {GESTURE_MODAL_IN, "IN", 0, N_("In"), ""}, + {GESTURE_MODAL_OUT, "OUT", 0, N_("Out"), ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Zoom Border"); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 7d6010786d2..d9ca275c819 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -48,6 +48,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_library.h" @@ -73,6 +75,8 @@ #include "GPU_draw.h" #include "GPU_extensions.h" +#include "UI_interface.h" + /* the global to talk to ghost */ static GHOST_SystemHandle g_system= NULL; @@ -504,11 +508,11 @@ void WM_window_open_temp(bContext *C, rcti *position, int type) ED_screen_set(C, win->screen); if(sa->spacetype==SPACE_IMAGE) - GHOST_SetTitle(win->ghostwin, "Blender Render"); + GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender Render"))); else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF)) - GHOST_SetTitle(win->ghostwin, "Blender User Preferences"); + GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender User Preferences"))); else if(sa->spacetype==SPACE_FILE) - GHOST_SetTitle(win->ghostwin, "Blender File View"); + GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender File View"))); else GHOST_SetTitle(win->ghostwin, "Blender"); } diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 730d2fd5d47..d66b783370a 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -357,7 +357,9 @@ if(UNIX AND NOT APPLE) ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) @@ -431,7 +433,9 @@ elseif(WIN32) DESTINATION ${TARGETDIR_VER} ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) @@ -450,8 +454,10 @@ elseif(WIN32) endif() install( # same as linux!, deduplicate - DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - DESTINATION ${TARGETDIR_VER}/datafiles/locale + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts + DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) @@ -663,9 +669,12 @@ elseif(APPLE) DESTINATION ${TARGETDIR_VER}/datafiles ) - install_dir( - ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/ - \${TARGETDIR_VER}/datafiles/locale + install( + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts + ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + DESTINATION ${TARGETDIR_VER}/datafiles + PATTERN ".svn" EXCLUDE ) endif() diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index d4b43cd7ac1..2c2fd052b5d 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -144,6 +144,8 @@ extern "C" { #include "BKE_cdderivedmesh.h" #include "BKE_DerivedMesh.h" #include "BKE_material.h" /* give_current_material */ +#include "BKE_image.h" +#include "IMB_imbuf_types.h" extern Material defmaterial; /* material.c */ } @@ -195,7 +197,7 @@ extern "C" { } #endif -static int default_face_mode = TF_DYNAMIC; +static bool default_light_mode = 0; static unsigned int KX_rgbaint2uint_new(unsigned int icol) { @@ -234,9 +236,9 @@ static unsigned int KX_Mcol2uint_new(MCol col) return out_color.integer; } -static void SetDefaultFaceType(Scene* scene) +static void SetDefaultLightMode(Scene* scene) { - default_face_mode = TF_DYNAMIC; + default_light_mode = false; Scene *sce_iter; Base *base; @@ -244,7 +246,7 @@ static void SetDefaultFaceType(Scene* scene) { if (base->object->type == OB_LAMP) { - default_face_mode = TF_DYNAMIC|TF_LIGHT; + default_light_mode = true; return; } } @@ -353,41 +355,41 @@ bool ConvertMaterial( // use lighting? material->ras_mode |= ( mat->mode & MA_SHLESS )?0:USE_LIGHT; + material->ras_mode |= ( mat->game.flag & GEMAT_BACKCULL )?0:TWOSIDED; + // cast shadows? material->ras_mode |= ( mat->mode & MA_SHADBUF )?CAST_SHADOW:0; MTex *mttmp = 0; numchan = getNumTexChannels(mat); int valid_index = 0; - // use the face texture if - // 1) it is set in the buttons - // 2) we have a face texture and a material but no valid texture in slot 1 + /* In Multitexture use the face texture if and only if + * it is set in the buttons + * In GLSL is not working yet :/ 3.2011 */ bool facetex = false; if(validface && mat->mode &MA_FACETEXTURE) facetex = true; - if(validface && !mat->mtex[0]) - facetex = true; - if(validface && mat->mtex[0]) { - MTex *tmp = mat->mtex[0]; - if(!tmp->tex || (tmp->tex && !tmp->tex->ima)) - facetex = true; - } + numchan = numchan>MAXTEX?MAXTEX:numchan; + if (facetex && numchan == 0) numchan = 1; // foreach MTex for(int i=0; i<numchan; i++) { // use face tex if(i==0 && facetex ) { + facetex = false; Image*tmp = (Image*)(tface->tpage); if(tmp) { material->img[i] = tmp; material->texname[i] = material->img[i]->id.name; - material->flag[i] |= ( tface->transp &TF_ALPHA )?USEALPHA:0; - material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0; material->flag[i] |= MIPMAP; + material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ALPHA_SORT )?USEALPHA:0; + material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ALPHA )?USEALPHA:0; + material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ADD )?CALCALPHA:0; + if(material->img[i]->flag & IMA_REFLECT) material->mapping[i].mapping |= USEREFL; else @@ -405,11 +407,6 @@ bool ConvertMaterial( material->mapping[i].mapping |= USEUV; } - if(material->ras_mode & USE_LIGHT) - material->ras_mode &= ~USE_LIGHT; - if(tface->mode & TF_LIGHT) - material->ras_mode |= USE_LIGHT; - valid_index++; } else { @@ -567,25 +564,31 @@ bool ConvertMaterial( material->ras_mode |= (mat->material_type == MA_TYPE_WIRE)? WIRE: 0; } - else { + else { // No Material int valid = 0; // check for tface tex to fallback on if( validface ){ - - // no light bugfix - if(tface->mode) material->ras_mode |= USE_LIGHT; - material->img[0] = (Image*)(tface->tpage); // ------------------------ if(material->img[0]) { material->texname[0] = material->img[0]->id.name; material->mapping[0].mapping |= ( (material->img[0]->flag & IMA_REFLECT)!=0 )?USEREFL:0; - material->flag[0] |= ( tface->transp &TF_ALPHA )?USEALPHA:0; - material->flag[0] |= ( tface->transp &TF_ADD )?CALCALPHA:0; + + /* see if depth of the image is 32bits */ + if(BKE_image_has_alpha(material->img[0])) { + material->flag[0] |= USEALPHA; + material->alphablend = GEMAT_ALPHA; + } + else + material->alphablend = GEMAT_SOLID; + valid++; } } + else + material->alphablend = GEMAT_SOLID; + material->SetUsers(-1); material->num_enabled = valid; material->IdMode = TEXFACE; @@ -598,6 +601,9 @@ bool ConvertMaterial( material->matcolor[2] = 0.5f; material->spec_f = 0.5f; material->ref = 0.8f; + + // No material - old default TexFace properties + material->ras_mode |= USE_LIGHT; } MT_Point2 uv[4]; MT_Point2 uv2[4]; @@ -606,13 +612,10 @@ bool ConvertMaterial( uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f); + /* No material, what to do? let's see what is in the UV and set the material accordingly + light and visible is always on */ if( validface ) { - - material->ras_mode |= (tface->mode & TF_INVISIBLE)?0:POLY_VIS; - - material->transp = tface->transp; material->tile = tface->tile; - material->mode = tface->mode; uv[0].setValue(tface->uv[0]); uv[1].setValue(tface->uv[1]); @@ -625,31 +628,26 @@ bool ConvertMaterial( } else { // nothing at all - material->ras_mode |= (POLY_VIS| (validmat?0:USE_LIGHT)); - material->mode = default_face_mode; - material->transp = TF_SOLID; + material->alphablend = GEMAT_SOLID; material->tile = 0; uv[0]= uv[1]= uv[2]= uv[3]= MT_Point2(0.0f, 0.0f); } + if (validmat && validface) { + material->alphablend = mat->game.alpha_blend; + } + // with ztransp enabled, enforce alpha blending mode - if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->transp == TF_SOLID)) - material->transp = TF_ALPHA; + if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->alphablend == GEMAT_SOLID)) + material->alphablend = GEMAT_ALPHA; // always zsort alpha + add - if((material->transp == TF_ALPHA || material->transp == TF_ADD || texalpha) && (material->transp != TF_CLIP)) { + if((ELEM3(material->alphablend, GEMAT_ALPHA, GEMAT_ALPHA_SORT, GEMAT_ADD) || texalpha) && (material->alphablend != GEMAT_CLIP )) { material->ras_mode |= ALPHA; - material->ras_mode |= (material->mode & TF_ALPHASORT)? ZSORT: 0; + material->ras_mode |= (mat && (mat->game.alpha_blend & GEMAT_ALPHA_SORT))? ZSORT: 0; } - // collider or not? - material->ras_mode |= (material->mode & TF_DYNAMIC)? COLLIDER: 0; - - // these flags are irrelevant at this point, remove so they - // don't hurt material bucketing - material->mode &= ~(TF_DYNAMIC|TF_ALPHASORT|TF_TEX); - // get uv sets if(validmat) { @@ -706,8 +704,8 @@ bool ConvertMaterial( unsigned int rgb[4]; GetRGB(type,mface,mmcol,mat,rgb[0],rgb[1],rgb[2], rgb[3]); - // swap the material color, so MCol on TF_BMFONT works - if (validmat && type==1 && (tface && tface->mode & TF_BMFONT)) + // swap the material color, so MCol on bitmap font works + if (validmat && type==1 && (mat->game.flag & GEMAT_TEXT)) { rgb[0] = KX_rgbaint2uint_new(rgb[0]); rgb[1] = KX_rgbaint2uint_new(rgb[1]); @@ -864,10 +862,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol, layers, converter->GetGLSLMaterials()); - visible = ((bl_mat->ras_mode & POLY_VIS)!=0); - collider = ((bl_mat->ras_mode & COLLIDER)!=0); - twoside = ((bl_mat->mode & TF_TWOSIDE)!=0); - /* vertex colors and uv's were stored in bl_mat temporarily */ bl_mat->GetConversionRGB(rgb); rgb0 = rgb[0]; rgb1 = rgb[1]; @@ -885,7 +879,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, if (kx_blmat == NULL) kx_blmat = new KX_BlenderMaterial(); - kx_blmat->Initialize(scene, bl_mat); + kx_blmat->Initialize(scene, bl_mat, (ma?&ma->game:NULL)); polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat); } else { @@ -893,37 +887,59 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, Image* bima = (tface)? (Image*)tface->tpage: NULL; imastr = (tface)? (bima? (bima)->id.name : "" ) : ""; - char transp=0; - short mode=0, tile=0; + char alpha_blend=0; + short tile=0; int tilexrep=4,tileyrep = 4; - + + /* set material properties - old TexFace */ + if (ma) { + alpha_blend = ma->game.alpha_blend; + /* Commented out for now. If we ever get rid of + * "Texture Face/Singletexture" we can then think about it */ + + /* Texture Face mode ignores texture but requires "Face Textures to be True "*/ + /** + if ((ma->mode &MA_FACETEXTURE)==0 && (ma->game.flag &GEMAT_TEXT)==0) { + bima = NULL; + imastr = ""; + alpha_blend = GEMAT_SOLID; + } + else + alpha_blend = ma->game.alpha_blend; + */ + } + /* check for tface tex to fallback on */ + else { + if (bima) { + /* see if depth of the image is 32 */ + if (BKE_image_has_alpha(bima)) + alpha_blend = GEMAT_ALPHA; + else + alpha_blend = GEMAT_SOLID; + } + else { + alpha_blend = GEMAT_SOLID; + } + } + if (bima) { tilexrep = bima->xrep; tileyrep = bima->yrep; } - /* get tface properties if available */ + /* set UV properties */ if(tface) { - /* TF_DYNAMIC means the polygon is a collision face */ - collider = ((tface->mode & TF_DYNAMIC) != 0); - transp = tface->transp; - tile = tface->tile; - mode = tface->mode; - - visible = !(tface->mode & TF_INVISIBLE); - twoside = ((tface->mode & TF_TWOSIDE)!=0); - uv0.setValue(tface->uv[0]); uv1.setValue(tface->uv[1]); uv2.setValue(tface->uv[2]); if (mface->v4) uv3.setValue(tface->uv[3]); + + tile = tface->tile; } else { - /* no texfaces, set COLLSION true and everything else FALSE */ - mode = default_face_mode; - transp = TF_SOLID; + /* no texfaces */ tile = 0; } @@ -964,16 +980,20 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, if (mface->v4) rgb3 = KX_rgbaint2uint_new(color); } - + // only zsort alpha + add - bool alpha = (transp == TF_ALPHA || transp == TF_ADD); - bool zsort = (mode & TF_ALPHASORT)? alpha: 0; + bool alpha = ELEM3(alpha_blend, GEMAT_ALPHA, GEMAT_ADD, GEMAT_ALPHA_SORT); + bool zsort = (alpha_blend == GEMAT_ALPHA_SORT); + bool light = (ma)?(ma->mode & MA_SHLESS)==0:default_light_mode; + + // don't need zort anymore, deal as if it it's alpha blend + if (alpha_blend == GEMAT_ALPHA_SORT) alpha_blend = GEMAT_ALPHA; if (kx_polymat == NULL) kx_polymat = new KX_PolygonMaterial(); kx_polymat->Initialize(imastr, ma, (int)mface->mat_nr, tile, tilexrep, tileyrep, - mode, transp, alpha, zsort, lightlayer, tface, (unsigned int*)mcol); + alpha_blend, alpha, zsort, light, lightlayer, tface, (unsigned int*)mcol); polymat = static_cast<RAS_IPolyMaterial*>(kx_polymat); if (ma) { @@ -987,6 +1007,19 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, } } + // set render flags + if (ma) + { + visible = ((ma->game.flag & GEMAT_INVISIBLE)==0); + twoside = ((ma->game.flag & GEMAT_BACKCULL)==0); + collider = ((ma->game.flag & GEMAT_NOPHYSICS)==0); + } + else{ + visible = true; + twoside = false; + collider = true; + } + /* mark face as flat, so vertices are split */ bool flat = (mface->flag & ME_SMOOTH) == 0; @@ -2035,7 +2068,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, logicmgr->RegisterActionName(curAct->id.name + 2, curAct); } - SetDefaultFaceType(blenderscene); + SetDefaultLightMode(blenderscene); // Let's support scene set. // Beware of name conflict in linked data, it will not crash but will create confusion // in Python scripting and in certain actuators (replace mesh). Linked scene *should* have diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 944ec9abd67..b452bb97cde 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -78,4 +78,8 @@ if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() +if(WITH_INTERNATIONAL) + add_definitions(-DINTERNATIONAL) +endif() + blender_add_lib_nolist(ge_player_ghost "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index d4ce19de83f..726a1d4119a 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -81,6 +81,7 @@ extern char btempdir[]; /* use this to store a valid temp directory */ // For BLF #include "BLF_api.h" +#include "BLF_translation.h" extern int datatoc_bfont_ttf_size; extern char datatoc_bfont_ttf[]; @@ -404,7 +405,7 @@ int main(int argc, char** argv) // We don't use threads directly in the BGE, but we need to call this so things like // freeing up GPU_Textures works correctly. BLI_threadapi_init(); - + RNA_init(); init_nodesystem(); @@ -420,6 +421,9 @@ int main(int argc, char** argv) // Setup builtin font for BLF (mostly copied from creator.c, wm_init_exit.c and interface_style.c) BLF_init(11, U.dpi); BLF_lang_init(); + BLF_lang_encoding(""); + BLF_lang_set(""); + BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); // Parse command line options @@ -994,6 +998,11 @@ int main(int argc, char** argv) // Cleanup RNA_exit(); BLF_exit(); + +#ifdef INTERNATIONAL + BLF_free_unifont(); +#endif + IMB_exit(); free_nodesystem(); diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index de063f5e297..57c1122c2cd 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -51,4 +51,7 @@ if env['WITH_BF_PYTHON']: if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') +if env['WITH_BF_INTERNATIONAL']: + defs.append('INTERNATIONAL') + env.BlenderLib (libname='ge_player_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[0], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 4ae937cdcd6..6680e9556b9 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -27,7 +27,7 @@ BL_BlenderShader::BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lig mGPUMat(NULL) { mBlenderScene = scene->GetBlenderScene(); - mBlendMode = GPU_BLEND_SOLID; + mAlphaBlend = GPU_BLEND_SOLID; ReloadMaterial(); } @@ -148,12 +148,12 @@ void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty ) GPU_material_bind_uniforms(gpumat, obmat, viewmat, viewinvmat, obcol); - mBlendMode = GPU_material_blend_mode(gpumat, obcol); + mAlphaBlend = GPU_material_alpha_blend(gpumat, obcol); } -int BL_BlenderShader::GetBlendMode() +int BL_BlenderShader::GetAlphaBlend() { - return mBlendMode; + return mAlphaBlend; } bool BL_BlenderShader::Equals(BL_BlenderShader *blshader) diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 2f22e121b8c..f187d93d648 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -63,7 +63,7 @@ private: struct Scene *mBlenderScene; struct Material *mMat; int mLightLayer; - int mBlendMode; + int mAlphaBlend; GPUMaterial *mGPUMat; bool VerifyShader() @@ -86,7 +86,7 @@ public: void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat); void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty); void ReloadMaterial(); - int GetBlendMode(); + int GetAlphaBlend(); void SetScene(KX_Scene *scene) { diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 25fd5467e93..fd0756d067d 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -52,12 +52,11 @@ void BL_Material::Initialize() speccolor[0] = 1.f; speccolor[1] = 1.f; speccolor[2] = 1.f; - transp = 0; + alphablend = 0; hard = 50.f; spec_f = 0.5f; alpha = 1.f; emit = 0.f; - mode = 0; material = 0; tface = 0; materialindex = 0; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index c0440e66501..2c6316ea32b 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -68,7 +68,7 @@ public: float matcolor[4]; float speccolor[3]; - short transp, pad; + short alphablend, pad; float hard, spec_f; float alpha, emit, color_blend[MAXTEX], ref; @@ -76,7 +76,6 @@ public: int blend_mode[MAXTEX]; - int mode; int num_enabled; BL_Mapping mapping[MAXTEX]; @@ -151,14 +150,16 @@ enum BL_flag // BL_Material::ras_mode enum BL_ras_mode { - POLY_VIS=1, + // POLY_VIS=1, COLLIDER=2, ZSORT=4, ALPHA=8, // TRIANGLE=16, USE_LIGHT=32, WIRE=64, - CAST_SHADOW=128 + CAST_SHADOW=128, + TEX=256, + TWOSIDED=512 }; // ------------------------------------- diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 33da17cc505..1a1e046f54c 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -34,6 +34,8 @@ #include "DNA_meshdata_types.h" #include "BKE_mesh.h" // ------------------------------------ +#include "BLI_utildefines.h" + #define spit(x) std::cout << x << std::endl; BL_Shader *KX_BlenderMaterial::mLastShader = NULL; @@ -56,21 +58,24 @@ KX_BlenderMaterial::KX_BlenderMaterial() } void KX_BlenderMaterial::Initialize( - KX_Scene *scene, - BL_Material *data) + KX_Scene *scene, + BL_Material *data, + GameSettings *game) { RAS_IPolyMaterial::Initialize( - data->texname[0], - data->matname, - data->materialindex, - data->tile, - data->tilexrep[0], - data->tileyrep[0], - data->mode, - data->transp, - ((data->ras_mode &ALPHA)!=0), - ((data->ras_mode &ZSORT)!=0) - ); + data->texname[0], + data->matname, + data->materialindex, + data->tile, + data->tilexrep[0], + data->tileyrep[0], + data->alphablend, + ((data->ras_mode &ALPHA)!=0), + ((data->ras_mode &ZSORT)!=0), + ((data->ras_mode &USE_LIGHT)!=0), + ((data->ras_mode &TEX)), + game + ); mMaterial = data; mShader = 0; mBlenderShader = 0; @@ -99,7 +104,7 @@ void KX_BlenderMaterial::Initialize( for(int i=0; i<mMaterial->num_enabled; i++) { m_multimode += (mMaterial->flag[i] + mMaterial->blend_mode[i]); } - m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT)); + m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(USE_LIGHT)); } KX_BlenderMaterial::~KX_BlenderMaterial() @@ -231,7 +236,7 @@ void KX_BlenderMaterial::OnExit() } if( mMaterial->tface ) - GPU_set_tpage(mMaterial->tface, 1); + GPU_set_tpage(mMaterial->tface, 1, mMaterial->alphablend); } @@ -247,7 +252,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) mLastShader = NULL; } - ras->SetBlendingMode(TF_SOLID); + ras->SetAlphaBlend(TF_SOLID); BL_Texture::DisableAllTextures(); return; } @@ -268,11 +273,11 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) } if(!mUserDefBlend) { - ras->SetBlendingMode(mMaterial->transp); + ras->SetAlphaBlend(mMaterial->alphablend); } else { - ras->SetBlendingMode(TF_SOLID); - ras->SetBlendingMode(-1); // indicates custom mode + ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(-1); // indicates custom mode // tested to be valid enums glEnable(GL_BLEND); @@ -283,7 +288,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras) void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras) { if( !enable || !mBlenderShader->Ok() ) { - ras->SetBlendingMode(TF_SOLID); + ras->SetAlphaBlend(TF_SOLID); // frame cleanup. if(mLastBlenderShader) { @@ -297,7 +302,7 @@ void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras } if(!mBlenderShader->Equals(mLastBlenderShader)) { - ras->SetBlendingMode(mMaterial->transp); + ras->SetAlphaBlend(mMaterial->alphablend); if(mLastBlenderShader) mLastBlenderShader->SetProg(false); @@ -314,14 +319,14 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) BL_Texture::DisableAllTextures(); if( !enable ) { - ras->SetBlendingMode(TF_SOLID); + ras->SetAlphaBlend(TF_SOLID); return; } BL_Texture::ActivateFirst(); if( mMaterial->IdMode == DEFAULT_BLENDER ) { - ras->SetBlendingMode(mMaterial->transp); + ras->SetAlphaBlend(mMaterial->alphablend); return; } @@ -331,7 +336,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) mTextures[0].ActivateTexture(); mTextures[0].setTexEnv(0, true); mTextures[0].SetMapping(mMaterial->mapping[0].mapping); - ras->SetBlendingMode(mMaterial->transp); + ras->SetAlphaBlend(mMaterial->alphablend); } return; } @@ -354,11 +359,11 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras) } if(!mUserDefBlend) { - ras->SetBlendingMode(mMaterial->transp); + ras->SetAlphaBlend(mMaterial->alphablend); } else { - ras->SetBlendingMode(TF_SOLID); - ras->SetBlendingMode(-1); // indicates custom mode + ras->SetAlphaBlend(TF_SOLID); + ras->SetAlphaBlend(-1); // indicates custom mode glEnable(GL_BLEND); glBlendFunc(mBlendFunc[0], mBlendFunc[1]); @@ -393,15 +398,15 @@ KX_BlenderMaterial::ActivatShaders( else tmp->setShaderData(false, rasty); - if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE) + if (mMaterial->ras_mode &TWOSIDED) rasty->SetCullFace(false); else rasty->SetCullFace(true); - if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) || + if ((mMaterial->ras_mode &WIRE) || (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME)) { - if((mMaterial->ras_mode &WIRE)!=0) + if (mMaterial->ras_mode &WIRE) rasty->SetCullFace(false); rasty->SetLines(true); } @@ -438,15 +443,15 @@ KX_BlenderMaterial::ActivateBlenderShaders( else tmp->setBlenderShaderData(false, rasty); - if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE) + if (mMaterial->ras_mode &TWOSIDED) rasty->SetCullFace(false); else rasty->SetCullFace(true); - if (((mMaterial->ras_mode & WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) || + if ((mMaterial->ras_mode &WIRE) || (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME)) { - if((mMaterial->ras_mode &WIRE)!=0) + if (mMaterial->ras_mode &WIRE) rasty->SetCullFace(false); rasty->SetLines(true); } @@ -487,15 +492,15 @@ KX_BlenderMaterial::ActivateMat( else tmp->setTexData( false,rasty); - if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE) + if (mMaterial->ras_mode &TWOSIDED) rasty->SetCullFace(false); else rasty->SetCullFace(true); - if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) || + if ((mMaterial->ras_mode &WIRE) || (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME)) { - if((mMaterial->ras_mode &WIRE)!=0) + if (mMaterial->ras_mode &WIRE) rasty->SetCullFace(false); rasty->SetLines(true); } @@ -570,17 +575,17 @@ void KX_BlenderMaterial::ActivateMeshSlot(const RAS_MeshSlot & ms, RAS_IRasteriz mShader->Update(ms, rasty); } else if(mBlenderShader && GLEW_ARB_shader_objects) { - int blendmode; + int alphablend; mBlenderShader->Update(ms, rasty); /* we do blend modes here, because they can change per object * with the same material due to obcolor/obalpha */ - blendmode = mBlenderShader->GetBlendMode(); - if((blendmode == TF_SOLID || blendmode == TF_ALPHA) && mMaterial->transp != TF_SOLID) - blendmode = mMaterial->transp; + alphablend = mBlenderShader->GetAlphaBlend(); + if(ELEM3(alphablend, GEMAT_SOLID, GEMAT_ALPHA, GEMAT_ALPHA_SORT) && mMaterial->alphablend != GEMAT_SOLID) + alphablend = mMaterial->alphablend; - rasty->SetBlendingMode(blendmode); + rasty->SetAlphaBlend(alphablend); } } diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 766e20be825..236bd6afdc8 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -38,7 +38,8 @@ public: KX_BlenderMaterial(); void Initialize( class KX_Scene* scene, - BL_Material* mat + BL_Material* mat, + GameSettings* game ); virtual ~KX_BlenderMaterial(); diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index f72c98fb4bf..5747d8641d0 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -26,6 +26,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "MEM_guardedalloc.h" + #include "BLI_math_vector.h" #include "KX_NavMeshObject.h" #include "RAS_MeshObject.h" @@ -117,8 +119,12 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL; int nAllVerts = 0; float *allVerts = NULL; - buildNavMeshDataByDerivedMesh(dm, vertsPerPoly, nAllVerts, allVerts, ndtris, dtris, - npolys, dmeshes, polys, dtrisToPolysMap, dtrisToTrisMap, trisToFacesMap); + buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nAllVerts, &allVerts, &ndtris, &dtris, + &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, &trisToFacesMap); + + MEM_freeN(dtrisToPolysMap); + MEM_freeN(dtrisToTrisMap); + MEM_freeN(trisToFacesMap); unsigned short *verticesMap = new unsigned short[nAllVerts]; memset(verticesMap, 0xffff, sizeof(unsigned short)*nAllVerts); @@ -207,6 +213,8 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, } } } + + MEM_freeN(allVerts); } else { @@ -445,7 +453,12 @@ bool KX_NavMeshObject::BuildNavMesh() m_navMesh->init(data, dataSize, true); delete [] vertices; - delete [] polys; + + /* navmesh conversion is using C guarded alloc for memory allocaitons */ + MEM_freeN(polys); + if (dmeshes) MEM_freeN(dmeshes); + if (dtris) MEM_freeN(dtris); + if (dvertices) { delete [] dvertices; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index d32f267f0e0..098c136bfa3 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -78,10 +78,10 @@ void KX_PolygonMaterial::Initialize( int tile, int tilexrep, int tileyrep, - int mode, - int transp, + int alphablend, bool alpha, bool zsort, + bool light, int lightlayer, struct MTFace* tface, unsigned int* mcol) @@ -93,10 +93,12 @@ void KX_PolygonMaterial::Initialize( tile, tilexrep, tileyrep, - mode, - transp, + alphablend, alpha, - zsort); + zsort, + light, + (texname && texname != ""?true:false), /* if we have a texture we have image */ + ma?&ma->game:NULL); m_tface = tface; m_mcol = mcol; m_material = ma; @@ -168,7 +170,7 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c if (GetCachingInfo() != cachingInfo) { if (!cachingInfo) - GPU_set_tpage(NULL, 0); + GPU_set_tpage(NULL, 0, 0); cachingInfo = GetCachingInfo(); @@ -176,15 +178,15 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c { Image *ima = (Image*)m_tface->tpage; GPU_update_image_time(ima, rasty->GetTime()); - GPU_set_tpage(m_tface, 1); + GPU_set_tpage(m_tface, 1, m_alphablend); } else - GPU_set_tpage(NULL, 0); + GPU_set_tpage(NULL, 0, 0); - if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE) - rasty->SetCullFace(false); - else + if(m_drawingmode & RAS_IRasterizer::KX_BACKCULL) rasty->SetCullFace(true); + else + rasty->SetCullFace(false); if ((m_drawingmode & RAS_IRasterizer::KX_LINES) || (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME)) @@ -318,7 +320,7 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setTexture, "setTexture(tface)") if (PyArg_ParseTuple(args, "O!:setTexture", &PyCapsule_Type, &pytface)) { MTFace *tface = (MTFace*) PyCapsule_GetPointer(pytface, KX_POLYGONMATERIAL_CAPSULE_ID); - GPU_set_tpage(tface, 1); + GPU_set_tpage(tface, 1, m_alphablend); Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 3520995def3..b09ddd39141 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -78,10 +78,10 @@ public: int tile, int tilexrep, int tileyrep, - int mode, - int transp, + int alphablend, bool alpha, bool zsort, + bool light, int lightlayer, struct MTFace* tface, unsigned int* mcol); diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index 5a1b52489b4..9948f48d7f3 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -36,6 +36,7 @@ #include "DNA_image_types.h" #include "DNA_meshdata_types.h" +#include "DNA_material_types.h" void RAS_IPolyMaterial::Initialize( const STR_String& texname, @@ -44,10 +45,12 @@ void RAS_IPolyMaterial::Initialize( int tile, int tilexrep, int tileyrep, - int mode, - int transp, + int alphablend, bool alpha, - bool zsort) + bool zsort, + bool light, + bool image, + struct GameSettings* game) { m_texturename = texname; m_materialname = matname; @@ -55,10 +58,10 @@ void RAS_IPolyMaterial::Initialize( m_tile = tile; m_tilexrep = tilexrep; m_tileyrep = tileyrep; - m_drawingmode = mode; - m_transp = transp; + m_alphablend = alphablend; m_alpha = alpha; m_zsort = zsort; + m_light = light; m_polymatid = m_newpolymatid++; m_flag = 0; m_multimode = 0; @@ -66,6 +69,7 @@ void RAS_IPolyMaterial::Initialize( m_specular.setValue(0.5,0.5,0.5); m_specularity = 1.0; m_diffuse.setValue(0.5,0.5,0.5); + m_drawingmode = ConvertFaceMode(game, image); } RAS_IPolyMaterial::RAS_IPolyMaterial() @@ -75,9 +79,10 @@ RAS_IPolyMaterial::RAS_IPolyMaterial() m_tilexrep(0), m_tileyrep(0), m_drawingmode (0), - m_transp(0), + m_alphablend(0), m_alpha(false), m_zsort(false), + m_light(false), m_materialindex(0), m_polymatid(0), m_flag(0), @@ -95,8 +100,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, int tile, int tilexrep, int tileyrep, - int mode, - int transp, + int alphablend, bool alpha, bool zsort) : m_texturename(texname), @@ -104,8 +108,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_tile(tile), m_tilexrep(tilexrep), m_tileyrep(tileyrep), - m_drawingmode (mode), - m_transp(transp), + m_alphablend(alphablend), m_alpha(alpha), m_zsort(zsort), m_materialindex(materialindex), @@ -128,9 +131,9 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const this->m_multimode == lhs.m_multimode && this->m_flag == lhs.m_flag && this->m_drawingmode == lhs.m_drawingmode && - this->m_transp == lhs.m_transp && - this->m_texturename.hash() == lhs.m_texturename.hash() && - this->m_materialname.hash() == lhs.m_materialname.hash() + this->m_alphablend == lhs.m_alphablend && + this->m_texturename.hash() == lhs.m_texturename.hash() && + this->m_materialname.hash() == lhs.m_materialname.hash() ); return test; @@ -141,9 +144,10 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const this->m_tile == lhs.m_tile && this->m_tilexrep == lhs.m_tilexrep && this->m_tileyrep == lhs.m_tileyrep && - this->m_transp == lhs.m_transp && + this->m_alphablend == lhs.m_alphablend && this->m_alpha == lhs.m_alpha && this->m_zsort == lhs.m_zsort && + this->m_light == lhs.m_light && this->m_drawingmode == lhs.m_drawingmode && this->m_texturename.hash() == lhs.m_texturename.hash() && this->m_materialname.hash() == lhs.m_materialname.hash() @@ -151,6 +155,21 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const } } +int RAS_IPolyMaterial::ConvertFaceMode(struct GameSettings *game, bool image) const +{ + if (!game) return (image?GEMAT_TEX:0); + + int modefinal = 0; + + int orimode = game->face_orientation; + int alpha_blend = game->alpha_blend; + int flags = game->flag & (GEMAT_TEXT | GEMAT_BACKCULL); + + modefinal = orimode | alpha_blend | flags; + modefinal |= (image ? GEMAT_TEX : 0); + + return modefinal; +} void RAS_IPolyMaterial::GetMaterialRGBAColor(unsigned char *rgba) const { @@ -241,7 +260,7 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const else if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID); else if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW); else - dolights = (m_drawingmode & RAS_IRasterizer::KX_LIGHT)!=0; + dolights = m_light; return dolights; } diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 2a5c6a179b6..69d07713c49 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -49,6 +49,7 @@ struct Material; struct Image; struct Scene; class SCA_IScene; +struct GameSettings; enum MaterialProps { @@ -78,10 +79,11 @@ protected: STR_HashedString m_materialname; //also needed for touchsensor int m_tile; int m_tilexrep,m_tileyrep; - int m_drawingmode; // tface->mode - int m_transp; + int m_drawingmode; + int m_alphablend; bool m_alpha; bool m_zsort; + bool m_light; int m_materialindex; unsigned int m_polymatid; @@ -102,9 +104,9 @@ public: // care! these are taken from blender polygonflags, see file DNA_mesh_types.h for #define TF_BILLBOARD etc. enum MaterialFlags { - BILLBOARD_SCREENALIGNED = 256, - BILLBOARD_AXISALIGNED = 4096, - SHADOW =8192 + BILLBOARD_SCREENALIGNED = 512, /* GEMAT_HALO */ + BILLBOARD_AXISALIGNED = 1024, /* GEMAT_BILLBOARD */ + SHADOW =2048 /* GEMAT_SHADOW */ }; RAS_IPolyMaterial(); @@ -114,7 +116,6 @@ public: int tile, int tilexrep, int tileyrep, - int mode, int transp, bool alpha, bool zsort); @@ -124,10 +125,13 @@ public: int tile, int tilexrep, int tileyrep, - int mode, int transp, bool alpha, - bool zsort); + bool zsort, + bool light, + bool image, + struct GameSettings* game); + virtual ~RAS_IPolyMaterial() {}; /** @@ -174,6 +178,11 @@ public: virtual void Replace_IScene(SCA_IScene *val) {}; /* overridden by KX_BlenderMaterial */ + /** + * @return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode). + */ + int ConvertFaceMode(struct GameSettings *game, bool image) const; + /* * PreCalculate texture gen */ diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 877a7219a1c..2988aa4effb 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -68,11 +68,7 @@ class RAS_IRasterizer public: RAS_IRasterizer(RAS_ICanvas* canv){}; virtual ~RAS_IRasterizer(){}; - /** - */ - enum { - RAS_RENDER_3DPOLYGON_TEXT = 16384 /* TF_BMFONT */ - }; + /** * Drawing types */ @@ -106,9 +102,9 @@ public: /** */ enum { - KX_TEX = 4, /* TF_TEX */ - KX_LIGHT = 16, /* TF_LIGHT */ - KX_TWOSIDE = 512, /* TF_TWOSIDE */ + RAS_RENDER_3DPOLYGON_TEXT = 64, /* GEMAT_TEXT */ + KX_BACKCULL = 16, /* GEMAT_BACKCULL */ + KX_TEX = 4096, /* GEMAT_TEX */ KX_LINES = 32768 }; @@ -417,7 +413,7 @@ public: virtual int GetMotionBlurState()=0; virtual void SetMotionBlurState(int newstate)=0; - virtual void SetBlendingMode(int blendmode)=0; + virtual void SetAlphaBlend(int alphablend)=0; virtual void SetFrontFace(bool ccw)=0; virtual void SetAnisotropicFiltering(short level)=0; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 6ad9e591474..d9039a2a68d 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -89,7 +89,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas) m_motionblurvalue(-1.0), m_texco_num(0), m_attrib_num(0), - //m_last_blendmode(GPU_BLEND_SOLID), + //m_last_alphablend(GPU_BLEND_SOLID), m_last_frontface(true), m_materialCachingInfo(0) { @@ -126,8 +126,8 @@ bool RAS_OpenGLRasterizer::Init() glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); - //m_last_blendmode = GPU_BLEND_SOLID; - GPU_set_material_blend_mode(GPU_BLEND_SOLID); + //m_last_alphablend = GPU_BLEND_SOLID; + GPU_set_material_alpha_blend(GPU_BLEND_SOLID); glFrontFace(GL_CCW); m_last_frontface = true; @@ -303,8 +303,8 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time) glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); - //m_last_blendmode = GPU_BLEND_SOLID; - GPU_set_material_blend_mode(GPU_BLEND_SOLID); + //m_last_alphablend = GPU_BLEND_SOLID; + GPU_set_material_alpha_blend(GPU_BLEND_SOLID); glFrontFace(GL_CCW); m_last_frontface = true; @@ -873,10 +873,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) // MCol *mcol = (MCol*)ms.m_pDerivedMesh->getFaceDataArray(ms.m_pDerivedMesh, CD_MCOL); /* UNUSED */ // handle two-side - if (current_polymat->GetDrawingMode() & RAS_IRasterizer::KX_TWOSIDE) - this->SetCullFace(false); - else + if (current_polymat->GetDrawingMode() & RAS_IRasterizer::KX_BACKCULL) this->SetCullFace(true); + else + this->SetCullFace(false); if (current_polymat->GetFlag() & RAS_BLENDERGLSL) { // GetMaterialIndex return the original mface material index, @@ -890,9 +890,9 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) else memset(¤t_gpu_attribs, 0, sizeof(current_gpu_attribs)); // DM draw can mess up blending mode, restore at the end - int current_blend_mode = GPU_get_material_blend_mode(); + int current_blend_mode = GPU_get_material_alpha_blend(); ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM); - GPU_set_material_blend_mode(current_blend_mode); + GPU_set_material_alpha_blend(current_blend_mode); } else { //ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); current_blmat_nr = current_polymat->GetMaterialIndex(); @@ -1204,36 +1204,36 @@ void RAS_OpenGLRasterizer::DisableMotionBlur() m_motionblurvalue = -1.0; } -void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode) +void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend) { - GPU_set_material_blend_mode(blendmode); + GPU_set_material_alpha_blend(alphablend); /* - if(blendmode == m_last_blendmode) + if(alphablend == m_last_alphablend) return; - if(blendmode == GPU_BLEND_SOLID) { + if(alphablend == GPU_BLEND_SOLID) { glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - else if(blendmode == GPU_BLEND_ADD) { + else if(alphablend == GPU_BLEND_ADD) { glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); glDisable(GL_ALPHA_TEST); } - else if(blendmode == GPU_BLEND_ALPHA) { + else if(alphablend == GPU_BLEND_ALPHA) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.0f); } - else if(blendmode == GPU_BLEND_CLIP) { + else if(alphablend == GPU_BLEND_CLIP) { glDisable(GL_BLEND); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.5f); } - m_last_blendmode = blendmode; + m_last_alphablend = alphablend; */ } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index c0e02f6df77..cbfa49510a5 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -111,7 +111,7 @@ protected: TexCoGen m_attrib[RAS_MAX_ATTRIB]; int m_texco_num; int m_attrib_num; - //int m_last_blendmode; + //int m_last_alphablend; bool m_last_frontface; /** Stores the caching information for the last material activated. */ @@ -312,7 +312,7 @@ public: m_motionblur = newstate; }; - virtual void SetBlendingMode(int blendmode); + virtual void SetAlphaBlend(int alphablend); virtual void SetFrontFace(bool ccw); virtual void SetAnisotropicFiltering(short level); diff --git a/source/tests/bl_load_py_modules.py b/source/tests/bl_load_py_modules.py index a88edd5f1fe..619cad67cb8 100644 --- a/source/tests/bl_load_py_modules.py +++ b/source/tests/bl_load_py_modules.py @@ -25,7 +25,6 @@ import addon_utils import sys import os -import imp def source_list(path, filename_check=None): |