diff options
93 files changed, 1438 insertions, 1042 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7abb6daa4df..83e6705e498 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,9 +202,6 @@ if(APPLE) option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF) endif() -# only for developers who want to make this functional -# option(WITH_LCMS "Enable color correction with lcms" OFF) - if(NOT WITH_GAMEENGINE AND WITH_PLAYER) message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE") endif() @@ -379,13 +376,6 @@ if(UNIX AND NOT APPLE) find_package(ZLIB REQUIRED) - if(WITH_LCMS) - set(LCMS /usr CACHE FILEPATH "LCMS directory") - set(LCMS_INCLUDE_DIR ${LCMS}/include) - set(LCMS_LIBRARY lcms) - set(LCMS_LIBPATH ${LCMS}/lib) - endif() - if(WITH_CODEC_FFMPEG) set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory") mark_as_advanced(FFMPEG) @@ -430,7 +420,7 @@ if(UNIX AND NOT APPLE) if(WITH_MEM_JEMALLOC) set(JEMALLOC /usr) - set(JEMALLOC_LIBRARY ljemalloc CACHE STRING "JeMalloc library") + set(JEMALLOC_LIBRARY jemalloc CACHE STRING "JeMalloc library") set(JEMALLOC_LIBPATH ${JEMALLOC}/lib CACHE FILEPATH "JeMalloc library path") # no use for this yet. # set(JEMALLOC_INCLUDE_DIR ${JEMALLOC}/include CACHE FILEPATH "JeMalloc include path") @@ -640,14 +630,7 @@ elseif(WIN32) set(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa UTF) set(PCRE_LIB pcre) endif() - - if(WITH_LCMS) - set(LCMS ${LIBDIR}/lcms) - set(LCMS_INCLUDE_DIR ${LCMS}/include) - set(LCMS_LIBPATH ${LCMS}/lib) - set(LCMS_LIB lcms) - endif() - + if(WITH_CODEC_FFMPEG) set(FFMPEG ${LIBDIR}/ffmpeg) set(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc) @@ -910,13 +893,6 @@ elseif(APPLE) set(OPENEXR_LIBPATH ${OPENEXR}/lib) endif() - if(WITH_LCMS) - set(LCMS ${LIBDIR}/lcms) - set(LCMS_INCLUDE_DIR ${LCMS}/include) - set(LCMS_LIBRARY lcms) - set(LCMS_LIBPATH ${LCMS}/lib) - endif() - if(WITH_CODEC_FFMPEG) set(FFMPEG ${LIBDIR}/ffmpeg) set(FFMPEG_INC ${FFMPEG}/include) diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index f55b2e95d5e..f55b2e95d5e 100644..100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py new file mode 100755 index 00000000000..c8bedb55148 --- /dev/null +++ b/build_files/cmake/cmake_netbeans_project.py @@ -0,0 +1,230 @@ +#!/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. +# +# Contributor(s): Campbell Barton, M.G. Kishalmi +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +""" +Example linux usage + python .~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake + +Windows not supported so far +""" + +from project_info import * + +import os +from os.path import join, dirname, normpath, abspath, splitext, relpath, exists + + +def create_nb_project_main(): + files = list(source_list(SOURCE_DIR, filename_check=is_project_file)) + files_rel = [relpath(f, start=PROJECT_DIR) for f in files] + files_rel.sort() + + if SIMPLE_PROJECTFILE: + pass + else: + includes, defines = cmake_advanced_info() + # for some reason it doesnt give all internal includes + includes = list(set(includes) | set(dirname(f) for f in files if is_c_header(f))) + includes.sort() + + PROJECT_NAME = "Blender" + FILE_NAME = PROJECT_NAME.lower() + + # --------------- NB spesific + defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines] + defines += [cdef.replace("#define", "").strip() for cdef in cmake_compiler_defines()] + + def file_list_to_nested(files): + # convert paths to hierarchy + paths_nested = {} + + def ensure_path(filepath): + filepath_split = filepath.split(os.sep) + + pn = paths_nested + for subdir in filepath_split[:-1]: + pn = pn.setdefault(subdir, {}) + pn[filepath_split[-1]] = None + + for path in files: + ensure_path(path) + return paths_nested + + PROJECT_DIR_NB = join(PROJECT_DIR, "nbproject") + if not exists(PROJECT_DIR_NB): + os.mkdir(PROJECT_DIR_NB) + + SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR) + + f = open(join(PROJECT_DIR_NB, "project.xml"), 'w') + + f.write('<?xml version="1.0" encoding="UTF-8"?>\n') + f.write('<project xmlns="http://www.netbeans.org/ns/project/1">\n') + f.write(' <type>org.netbeans.modules.cnd.makeproject</type>\n') + f.write(' <configuration>\n') + f.write(' <data xmlns="http://www.netbeans.org/ns/make-project/1">\n') + f.write(' <name>%s</name>\n' % PROJECT_NAME) + f.write(' <c-extensions>c,m</c-extensions>\n') + f.write(' <cpp-extensions>cpp,mm</cpp-extensions>\n') + f.write(' <header-extensions>h,hpp,inl</header-extensions>\n') + f.write(' <sourceEncoding>UTF-8</sourceEncoding>\n') + f.write(' <make-dep-projects/>\n') + f.write(' <sourceRootList>\n') + f.write(' <sourceRootElem>%s</sourceRootElem>\n' % SOURCE_DIR) # base_root_rel + f.write(' </sourceRootList>\n') + f.write(' <confList>\n') + f.write(' <confElem>\n') + f.write(' <name>Default</name>\n') + f.write(' <type>0</type>\n') + f.write(' </confElem>\n') + f.write(' </confList>\n') + f.write(' </data>\n') + f.write(' </configuration>\n') + f.write('</project>\n') + + f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w') + + f.write('<?xml version="1.0" encoding="UTF-8"?>\n') + f.write('<configurationDescriptor version="79">\n') + f.write(' <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">\n') + f.write(' <df name="blender" root="%s">\n' % SOURCE_DIR) # base_root_rel + + # write files! + files_rel_local = [normpath(relpath(join(CMAKE_DIR, path), SOURCE_DIR)) for path in files_rel] + files_rel_hierarchy = file_list_to_nested(files_rel_local) + # print(files_rel_hierarchy) + + def write_df(hdir, ident): + dirs = [] + files = [] + for key, item in sorted(hdir.items()): + if item is None: + files.append(key) + else: + dirs.append((key, item)) + + for key, item in dirs: + f.write('%s <df name="%s">\n' % (ident, key)) + write_df(item, ident + " ") + f.write('%s </df>\n' % ident) + + for key in files: + f.write('%s<in>%s</in>\n' % (ident, key)) + + write_df(files_rel_hierarchy, ident=" ") + + f.write(' </df>\n') + + f.write(' <logicalFolder name="ExternalFiles"\n') + f.write(' displayName="Important Files"\n') + f.write(' projectFiles="false"\n') + f.write(' kind="IMPORTANT_FILES_FOLDER">\n') + # f.write(' <itemPath>../GNUmakefile</itemPath>\n') + f.write(' </logicalFolder>\n') + + f.write(' </logicalFolder>\n') + # default, but this dir is infact not in blender dir so we can ignore it + # f.write(' <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n') + f.write(' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n') + + f.write(' <sourceRootList>\n') + f.write(' <Elem>%s</Elem>\n' % SOURCE_DIR) # base_root_rel + f.write(' </sourceRootList>\n') + + f.write(' <projectmakefile>Makefile</projectmakefile>\n') + + # paths again + f.write(' <confs>\n') + f.write(' <conf name="Default" type="0">\n') + + f.write(' <toolsSet>\n') + f.write(' <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>\n') + f.write(' <compilerSet>default</compilerSet>\n') + f.write(' </toolsSet>\n') + f.write(' <makefileType>\n') + + f.write(' <makeTool>\n') + f.write(' <buildCommandWorkingDir>.</buildCommandWorkingDir>\n') + f.write(' <buildCommand>${MAKE} -f Makefile</buildCommand>\n') + f.write(' <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>\n') + f.write(' <executablePath>./bin/blender</executablePath>\n') + + def write_toolinfo(): + f.write(' <incDir>\n') + for inc in includes: + f.write(' <pElem>%s</pElem>\n' % inc) + f.write(' </incDir>\n') + f.write(' <preprocessorList>\n') + for cdef in defines: + f.write(' <Elem>%s</Elem>\n' % cdef) + f.write(' </preprocessorList>\n') + + f.write(' <cTool>\n') + write_toolinfo() + f.write(' </cTool>\n') + + f.write(' <ccTool>\n') + write_toolinfo() + f.write(' </ccTool>\n') + + f.write(' </makeTool>\n') + f.write(' </makefileType>\n') + # finishe makefle info + + f.write(' \n') + + for path in files_rel_local: + f.write(' <item path="%s"\n' % path) + f.write(' ex="false"\n') + f.write(' tool="1"\n') + f.write(' flavor="0">\n') + f.write(' </item>\n') + + f.write(' <runprofile version="9">\n') + f.write(' <runcommandpicklist>\n') + f.write(' </runcommandpicklist>\n') + f.write(' <runcommand>%s</runcommand>\n' % os.path.join(CMAKE_DIR, "bin/blender")) + f.write(' <rundir>%s</rundir>\n' % SOURCE_DIR) + f.write(' <buildfirst>false</buildfirst>\n') + f.write(' <terminal-type>0</terminal-type>\n') + f.write(' <remove-instrumentation>0</remove-instrumentation>\n') + f.write(' <environment>\n') + f.write(' </environment>\n') + f.write(' </runprofile>\n') + + f.write(' </conf>\n') + f.write(' </confs>\n') + + # todo + + f.write('</configurationDescriptor>\n') + + +def main(): + create_nb_project_main() + + +if __name__ == "__main__": + main() diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py index 59b8b2a3b02..e38b2228cca 100644..100755 --- a/build_files/cmake/cmake_qtcreator_project.py +++ b/build_files/cmake/cmake_qtcreator_project.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# $Id: +# $Id$ # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or @@ -31,182 +31,16 @@ example linux usage python .~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake """ -import sys +from project_info import * + import os from os.path import join, dirname, normpath, abspath, splitext, relpath, exists -base = join(os.path.dirname(__file__), "..", "..") -base = normpath(base) -base = abspath(base) - -SIMPLE_PROJECTFILE = False - -# get cmake path -CMAKE_DIR = sys.argv[-1] - -if not os.path.exists(os.path.join(CMAKE_DIR, "CMakeCache.txt")): - CMAKE_DIR = os.getcwd() -if not os.path.exists(os.path.join(CMAKE_DIR, "CMakeCache.txt")): - print("CMakeCache.txt not found in %r or %r\n Pass CMake build dir as an argument, or run from that dir, aborting" % (CMAKE_DIR, os.getcwd())) - sys.exit(1) - - -# could be either. -# PROJECT_DIR = base -PROJECT_DIR = CMAKE_DIR - - -def source_list(path, filename_check=None): - for dirpath, dirnames, filenames in os.walk(path): - - # skip '.svn' - if dirpath.startswith("."): - continue - - for filename in filenames: - filepath = join(dirpath, filename) - if filename_check is None or filename_check(filepath): - yield filepath - - -# extension checking -def is_cmake(filename): - ext = splitext(filename)[1] - return (ext == ".cmake") or (filename.endswith("CMakeLists.txt")) - - -def is_c_header(filename): - ext = splitext(filename)[1] - return (ext in (".h", ".hpp", ".hxx")) - - -def is_py(filename): - ext = splitext(filename)[1] - return (ext == ".py") - - -def is_glsl(filename): - ext = splitext(filename)[1] - return (ext == ".glsl") - - -def is_c(filename): - ext = splitext(filename)[1] - return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc")) - - -def is_c_any(filename): - return is_c(filename) or is_c_header(filename) - - -def is_svn_file(filename): - dn, fn = os.path.split(filename) - filename_svn = join(dn, ".svn", "text-base", "%s.svn-base" % fn) - return exists(filename_svn) - - -def is_project_file(filename): - return (is_c_any(filename) or is_cmake(filename) or is_glsl(filename)) # and is_svn_file(filename) - - -def cmake_advanced_info(): - """ Extracr includes and defines from cmake. - """ - - def create_eclipse_project(CMAKE_DIR): - print("CMAKE_DIR %r" % CMAKE_DIR) - if sys.platform == "win32": - cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR - else: - cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR - - os.system(cmd) - - includes = [] - defines = [] - - create_eclipse_project(CMAKE_DIR) - - from xml.dom.minidom import parse - tree = parse(os.path.join(CMAKE_DIR, ".cproject")) - ''' - f = open(".cproject_pretty", 'w') - f.write(tree.toprettyxml(indent=" ", newl="")) - ''' - ELEMENT_NODE = tree.ELEMENT_NODE - - cproject, = tree.getElementsByTagName("cproject") - for storage in cproject.childNodes: - if storage.nodeType != ELEMENT_NODE: - continue - - if storage.attributes["moduleId"].value == "org.eclipse.cdt.core.settings": - cconfig = storage.getElementsByTagName("cconfiguration")[0] - for substorage in cconfig.childNodes: - if substorage.nodeType != ELEMENT_NODE: - continue - - moduleId = substorage.attributes["moduleId"].value - - # org.eclipse.cdt.core.settings - # org.eclipse.cdt.core.language.mapping - # org.eclipse.cdt.core.externalSettings - # org.eclipse.cdt.core.pathentry - # org.eclipse.cdt.make.core.buildtargets - - if moduleId == "org.eclipse.cdt.core.pathentry": - for path in substorage.childNodes: - if path.nodeType != ELEMENT_NODE: - continue - kind = path.attributes["kind"].value - - if kind == "mac": - # <pathentry kind="mac" name="PREFIX" path="" value=""/opt/blender25""/> - defines.append((path.attributes["name"].value, path.attributes["value"].value)) - elif kind == "inc": - # <pathentry include="/data/src/blender/blender/source/blender/editors/include" kind="inc" path="" system="true"/> - includes.append(path.attributes["include"].value) - else: - pass - - return includes, defines - - -def cmake_cache_var(var): - cache_file = open(os.path.join(CMAKE_DIR, "CMakeCache.txt")) - lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")] - cache_file.close() - - for l in lines: - if l.split(":")[0] == var: - return l.split("=", 1)[-1] - return None - - -def cmake_compiler_defines(): - compiler = cmake_cache_var("CMAKE_C_COMPILER") # could do CXX too - - if compiler is None: - print("Couldn't find the compiler, os defines will be omitted...") - return - - import tempfile - temp_c = tempfile.mkstemp(suffix=".c")[1] - temp_def = tempfile.mkstemp(suffix=".def")[1] - - os.system("%s -dM -E %s > %s" % (compiler, temp_c, temp_def)) - - temp_def_file = open(temp_def) - lines = [l.strip() for l in temp_def_file if l.strip()] - temp_def_file.close() - - os.remove(temp_c) - os.remove(temp_def) - return lines +import sys def create_qtc_project_main(): - files = list(source_list(base, filename_check=is_project_file)) + files = list(source_list(SOURCE_DIR, filename_check=is_project_file)) files_rel = [relpath(f, start=PROJECT_DIR) for f in files] files_rel.sort() @@ -260,7 +94,7 @@ def create_qtc_project_main(): def create_qtc_project_python(): - files = list(source_list(base, filename_check=is_py)) + files = list(source_list(SOURCE_DIR, filename_check=is_py)) files_rel = [relpath(f, start=PROJECT_DIR) for f in files] files_rel.sort() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 8a1f6875b6f..14bed8874fa 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -88,9 +88,6 @@ macro(SETUP_LIBDIRS) if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE) link_directories(${OPENJPEG_LIBPATH}) endif() - if(WITH_LCMS) - link_directories(${LCMS_LIBPATH}) - endif() if(WITH_CODEC_QUICKTIME) link_directories(${QUICKTIME_LIBPATH}) endif() @@ -193,9 +190,6 @@ macro(setup_liblinks if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE) target_link_libraries(${target} ${OPENJPEG_LIB}) endif() - if(WITH_LCMS) - target_link_libraries(${target} ${LCMS_LIBRARY}) - endif() if(WITH_CODEC_FFMPEG) target_link_libraries(${target} ${FFMPEG_LIB}) endif() @@ -217,12 +211,6 @@ macro(setup_liblinks target_link_libraries(${target} ${EXPAT_LIB}) endif() endif() - if(WITH_LCMS) - if(WIN32 AND NOT UNIX) - target_link_libraries(${target} debug ${LCMS_LIB}_d) - target_link_libraries(${target} optimized ${LCMS_LIB}) - endif() - endif() if(WITH_MEM_JEMALLOC) target_link_libraries(${target} ${JEMALLOC_LIBRARY}) endif() diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py new file mode 100755 index 00000000000..c25fbf4128d --- /dev/null +++ b/build_files/cmake/project_info.py @@ -0,0 +1,218 @@ +#!/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. +# +# Contributor(s): Campbell Barton, M.G. Kishalmi +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +""" +Example Win32 usage: + c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build + +example linux usage + python .~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake +""" + +__all__ = ( + "SIMPLE_PROJECTFILE", + "SOURCE_DIR", + "CMAKE_DIR", + "PROJECT_DIR", + "source_list", + "is_project_file", + "is_c_header", + "is_py", + "cmake_advanced_info", + "cmake_compiler_defines", +) + +import sys +import os +from os.path import join, dirname, normpath, abspath, splitext, relpath, exists + +SOURCE_DIR = join(dirname(__file__), "..", "..") +SOURCE_DIR = normpath(SOURCE_DIR) +SOURCE_DIR = abspath(SOURCE_DIR) + +SIMPLE_PROJECTFILE = False + +# get cmake path +CMAKE_DIR = sys.argv[-1] + +if not exists(join(CMAKE_DIR, "CMakeCache.txt")): + CMAKE_DIR = os.getcwd() +if not exists(join(CMAKE_DIR, "CMakeCache.txt")): + print("CMakeCache.txt not found in %r or %r\n Pass CMake build dir as an argument, or run from that dir, aborting" % (CMAKE_DIR, os.getcwd())) + sys.exit(1) + + +# could be either. +# PROJECT_DIR = SOURCE_DIR +PROJECT_DIR = CMAKE_DIR + + +def source_list(path, filename_check=None): + for dirpath, dirnames, filenames in os.walk(path): + + # skip '.svn' + if dirpath.startswith("."): + continue + + for filename in filenames: + filepath = join(dirpath, filename) + if filename_check is None or filename_check(filepath): + yield filepath + + +# extension checking +def is_cmake(filename): + ext = splitext(filename)[1] + return (ext == ".cmake") or (filename.endswith("CMakeLists.txt")) + + +def is_c_header(filename): + ext = splitext(filename)[1] + return (ext in (".h", ".hpp", ".hxx")) + + +def is_py(filename): + ext = splitext(filename)[1] + return (ext == ".py") + + +def is_glsl(filename): + ext = splitext(filename)[1] + return (ext == ".glsl") + + +def is_c(filename): + ext = splitext(filename)[1] + return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc")) + + +def is_c_any(filename): + return is_c(filename) or is_c_header(filename) + + +def is_svn_file(filename): + dn, fn = os.path.split(filename) + filename_svn = join(dn, ".svn", "text-base", "%s.svn-base" % fn) + return exists(filename_svn) + + +def is_project_file(filename): + return (is_c_any(filename) or is_cmake(filename) or is_glsl(filename)) # and is_svn_file(filename) + + +def cmake_advanced_info(): + """ Extracr includes and defines from cmake. + """ + + def create_eclipse_project(CMAKE_DIR): + print("CMAKE_DIR %r" % CMAKE_DIR) + if sys.platform == "win32": + cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR + else: + cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR + + os.system(cmd) + + includes = [] + defines = [] + + create_eclipse_project(CMAKE_DIR) + + from xml.dom.minidom import parse + tree = parse(join(CMAKE_DIR, ".cproject")) + ''' + f = open(".cproject_pretty", 'w') + f.write(tree.toprettyxml(indent=" ", newl="")) + ''' + ELEMENT_NODE = tree.ELEMENT_NODE + + cproject, = tree.getElementsByTagName("cproject") + for storage in cproject.childNodes: + if storage.nodeType != ELEMENT_NODE: + continue + + if storage.attributes["moduleId"].value == "org.eclipse.cdt.core.settings": + cconfig = storage.getElementsByTagName("cconfiguration")[0] + for substorage in cconfig.childNodes: + if substorage.nodeType != ELEMENT_NODE: + continue + + moduleId = substorage.attributes["moduleId"].value + + # org.eclipse.cdt.core.settings + # org.eclipse.cdt.core.language.mapping + # org.eclipse.cdt.core.externalSettings + # org.eclipse.cdt.core.pathentry + # org.eclipse.cdt.make.core.buildtargets + + if moduleId == "org.eclipse.cdt.core.pathentry": + for path in substorage.childNodes: + if path.nodeType != ELEMENT_NODE: + continue + kind = path.attributes["kind"].value + + if kind == "mac": + # <pathentry kind="mac" name="PREFIX" path="" value=""/opt/blender25""/> + defines.append((path.attributes["name"].value, path.attributes["value"].value)) + elif kind == "inc": + # <pathentry include="/data/src/blender/blender/source/blender/editors/include" kind="inc" path="" system="true"/> + includes.append(path.attributes["include"].value) + else: + pass + + return includes, defines + + +def cmake_cache_var(var): + cache_file = open(join(CMAKE_DIR, "CMakeCache.txt")) + lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")] + cache_file.close() + + for l in lines: + if l.split(":")[0] == var: + return l.split("=", 1)[-1] + return None + + +def cmake_compiler_defines(): + compiler = cmake_cache_var("CMAKE_C_COMPILER") # could do CXX too + + if compiler is None: + print("Couldn't find the compiler, os defines will be omitted...") + return + + import tempfile + temp_c = tempfile.mkstemp(suffix=".c")[1] + temp_def = tempfile.mkstemp(suffix=".def")[1] + + os.system("%s -dM -E %s > %s" % (compiler, temp_c, temp_def)) + + temp_def_file = open(temp_def) + lines = [l.strip() for l in temp_def_file if l.strip()] + temp_def_file.close() + + os.remove(temp_c) + os.remove(temp_def) + return lines diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index eeb50a9ca65..65076be85ed 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -149,12 +149,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' -WITH_BF_LCMS = False -BF_LCMS = LIBDIR + '/lcms' -BF_LCMS_INC = '${BF_LCMS}/include' -BF_LCMS_LIB = 'lcms' -BF_LCMS_LIBPATH = '${BF_LCMS}/lib' - #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE'] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 2dcbe8aeb2e..2c990941764 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -151,12 +151,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' -WITH_BF_LCMS = False -BF_LCMS = LIBDIR + '/lcms' -BF_LCMS_INC = '${BF_LCMS}/include' -BF_LCMS_LIB = 'lcms' -BF_LCMS_LIBPATH = '${BF_LCMS}/lib' - #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2'] diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 90c2c35bb98..4bfa1851acb 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -148,8 +148,6 @@ def setup_staticlibs(lenv): libincs += Split(lenv['BF_OPENEXR_LIBPATH']) if lenv['WITH_BF_STATICOPENEXR']: statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC']) - if lenv['WITH_BF_LCMS']: - libincs += Split(lenv['BF_LCMS_LIBPATH']) if lenv['WITH_BF_TIFF']: libincs += Split(lenv['BF_TIFF_LIBPATH']) if lenv['WITH_BF_STATICTIFF']: @@ -258,8 +256,6 @@ def setup_syslibs(lenv): syslibs += Split(lenv['BF_OPENGL_LIB']) if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'): syslibs += Split(lenv['BF_PTHREADS_LIB']) - if lenv['WITH_BF_LCMS']: - syslibs.append(lenv['BF_LCMS_LIB']) if lenv['WITH_BF_COLLADA']: syslibs.append(lenv['BF_PCRE_LIB']) syslibs += Split(lenv['BF_OPENCOLLADA_LIB']) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index fda88d7d5a9..fe6b092598c 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -125,7 +125,6 @@ def validate_arguments(args, bc): 'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', - 'WITH_BF_LCMS', 'BF_LCMS', 'BF_LCMS_INC', 'BF_LCMS_LIB', 'BF_LCMS_LIBPATH', 'WITH_BF_DOCS', 'BF_NUMJOBS', 'BF_MSVS', @@ -334,12 +333,6 @@ def read_opts(env, cfg, args): ('BF_TIFF_LIBPATH', 'TIFF library path', ''), ('BF_TIFF_LIB_STATIC', 'TIFF static library', ''), - (BoolVariable('WITH_BF_LCMS', 'Enable color correction with lcms', False)), - ('BF_LCMS', 'LCMS base path', ''), - ('BF_LCMS_INC', 'LCMS include path', ''), - ('BF_LCMS_LIB', 'LCMS library', ''), - ('BF_LCMS_LIBPATH', 'LCMS library path', ''), - (BoolVariable('WITH_BF_ZLIB', 'Use ZLib if true', True)), (BoolVariable('WITH_BF_STATICZLIB', 'Staticly link to ZLib', False)), ('BF_ZLIB', 'ZLib base path', ''), diff --git a/release/scripts/modules/bpy_extras/__init__.py b/release/scripts/modules/bpy_extras/__init__.py new file mode 100644 index 00000000000..e124d3c5b3d --- /dev/null +++ b/release/scripts/modules/bpy_extras/__init__.py @@ -0,0 +1,31 @@ +# ##### 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> + +""" +Utility modules assosiated with the bpy module. +""" + +__all__ = ( + "object_utils", + "io_utils", + "image_utils", + "mesh_utils", + "view3d_utils", +)
\ No newline at end of file diff --git a/release/scripts/modules/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 39e49ee1f96..39e49ee1f96 100644 --- a/release/scripts/modules/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py diff --git a/release/scripts/modules/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 820d7cfa39d..820d7cfa39d 100644 --- a/release/scripts/modules/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py diff --git a/release/scripts/modules/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index 5bacff7b0cc..5bacff7b0cc 100644 --- a/release/scripts/modules/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py diff --git a/release/scripts/modules/add_object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 1cf7fc2f4d5..1cf7fc2f4d5 100644 --- a/release/scripts/modules/add_object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py diff --git a/release/scripts/modules/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index 15f5aaa20b7..15f5aaa20b7 100644 --- a/release/scripts/modules/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index 460330a56a1..6ab803cc469 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -132,7 +132,7 @@ class AddTorus(bpy.types.Operator): mesh.faces.foreach_set("vertices_raw", faces) mesh.update() - import add_object_utils - add_object_utils.object_data_add(context, mesh, operator=self) + from bpy_extras import object_utils + object_utils.object_data_add(context, mesh, operator=self) return {'FINISHED'} diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index b1d1789fadd..7097988d25b 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -46,6 +46,8 @@ class MESH_MT_shape_key_specials(bpy.types.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.from_mix = True class MeshButtonsPanel(): @@ -193,7 +195,8 @@ class DATA_PT_shape_keys(MeshButtonsPanel, bpy.types.Panel): col = row.column() sub = col.column(align=True) - sub.operator("object.shape_key_add", icon='ZOOMIN', text="") + op = sub.operator("object.shape_key_add", icon='ZOOMIN', text="") + op.from_mix = False sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="") sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="") diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index ccf7cdde626..6bdff88c569 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -223,7 +223,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.label(text="Texture Coordinates:") col.prop(md, "texture_coords", text="") if md.texture_coords == 'OBJECT': - layout.prop(md, "texture_coordinate_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") @@ -677,7 +677,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.prop(md, "texture_coords", text="") if md.texture_coords == 'OBJECT': - layout.prop(md, "texture_coordinate_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") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 77583b80824..44a1c814e28 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -436,7 +436,8 @@ class IMAGE_PT_game_properties(bpy.types.Panel): def poll(cls, context): rd = context.scene.render sima = context.space_data - return (sima and sima.image) and (rd.engine == 'BLENDER_GAME') + # display even when not in game mode because these settings effect the 3d view + return (sima and sima.image) # and (rd.engine == 'BLENDER_GAME') def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 2079aef6402..858c619d3c1 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -213,6 +213,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu): 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(bpy.types.Menu): @@ -391,7 +392,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'PLUGIN', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED', - 'MULTICAM'} + 'MULTICAM', 'ADJUSTMENT'} def draw(self, context): layout = self.layout @@ -530,7 +531,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel): 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'PLUGIN', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', - 'MULTICAM', 'SPEED'} + 'MULTICAM', 'SPEED', 'ADJUSTMENT'} def draw(self, context): layout = self.layout @@ -680,7 +681,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'PLUGIN', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', - 'MULTICAM', 'SPEED'} + 'MULTICAM', 'SPEED', 'ADJUSTMENT'} def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 61ad08c711b..4a2192c4c8e 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2023,6 +2023,9 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel): elif not view.lock_object: 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") diff --git a/release/scripts/templates/operator_export.py b/release/scripts/templates/operator_export.py index 1b1c90c8a21..4cf943a53b7 100644 --- a/release/scripts/templates/operator_export.py +++ b/release/scripts/templates/operator_export.py @@ -12,7 +12,7 @@ def write_some_data(context, filepath, use_some_setting): # ExportHelper is a helper class, defines filename and # invoke() function which calls the file selector. -from io_utils import ExportHelper +from bpy_extras.io_utils import ExportHelper from bpy.props import StringProperty, BoolProperty, EnumProperty diff --git a/release/scripts/templates/operator_mesh_add.py b/release/scripts/templates/operator_mesh_add.py index 65b08eebb4e..10d23a6712d 100644 --- a/release/scripts/templates/operator_mesh_add.py +++ b/release/scripts/templates/operator_mesh_add.py @@ -80,8 +80,8 @@ class AddBox(bpy.types.Operator): mesh.update() # add the mesh as an object into the scene with this utility module - import add_object_utils - add_object_utils.object_data_add(context, mesh, operator=self) + from bpy_extras import object_utils + object_utils.object_data_add(context, mesh, operator=self) return {'FINISHED'} diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h index b3709853a8c..744ed9dba9c 100644 --- a/source/blender/blenkernel/BKE_colortools.h +++ b/source/blender/blenkernel/BKE_colortools.h @@ -78,7 +78,6 @@ void curvemapping_premultiply(struct CurveMapping *cumap, int restore); int curvemapping_RGBA_does_something(struct CurveMapping *cumap); void curvemapping_initialize(struct CurveMapping *cumap); void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size); -void colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile); void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management); void scopes_free(struct Scopes *scopes); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 57829e957f7..94c474c668f 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -268,6 +268,10 @@ void seq_translate(struct Scene *scene, struct Sequence *seq, int delta); void seq_sound_init(struct Scene *scene, struct Sequence *seq); struct Sequence *seq_foreground_frame_get(struct Scene *scene, int frame); struct ListBase *seq_seqbase(struct ListBase *seqbase, struct Sequence *seq); +struct Sequence *seq_metastrip( + ListBase * seqbase /* = ed->seqbase */, + struct Sequence * meta /* = NULL */, struct Sequence *seq); + void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs); void seq_dupe_animdata(struct Scene *scene, char *name_from, char *name_to); int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene); diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 68a4dd4ce0c..aca25b266a8 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -280,11 +280,6 @@ if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() -if(WITH_LCMS) - list(APPEND INC ${LCMS_INCLUDE_DIR}) - add_definitions(-DWITH_LCMS) -endif() - if(WITH_PYTHON) list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS}) add_definitions(-DWITH_PYTHON) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index ff04b46e18e..70641b340b2 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -79,10 +79,6 @@ if env['OURPLATFORM'] == 'darwin': if env['BF_NO_ELBEEM']: defs.append('DISABLE_ELBEEM') -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - incs += ' ' + env['BF_LCMS_INC'] - if env['WITH_BF_LZO']: incs += ' #/extern/lzo/minilzo' defs.append('WITH_LZO') diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 1d7481b365a..9a6c2cc7e31 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -37,10 +37,6 @@ #include <stdlib.h> #include <float.h> -#ifdef WITH_LCMS -#include <lcms.h> -#endif - #include "MEM_guardedalloc.h" #include "DNA_color_types.h" @@ -789,60 +785,6 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const } -#ifdef WITH_LCMS -/* basic error handler, if we dont do this blender will exit */ -static int ErrorReportingFunction(int ErrorCode, const char *ErrorText) -{ - fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode); - return 1; -} -#endif - -void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile) -{ -#ifdef WITH_LCMS - if (ibuf->crect == NULL) - { - cmsHPROFILE proofingProfile; - - /* TODO, move to initialization area of code */ - //cmsSetLogErrorHandler(ErrorReportingFunction); - cmsSetErrorHandler(ErrorReportingFunction); - - /* will return NULL if the file isn't fount */ - proofingProfile = cmsOpenProfileFromFile(profile, "r"); - - cmsErrorAction(LCMS_ERROR_SHOW); - - if(proofingProfile) { - cmsHPROFILE imageProfile; - cmsHTRANSFORM hTransform; - - ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect"); - - imageProfile = cmsCreate_sRGBProfile(); - - - hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8, - proofingProfile, - INTENT_ABSOLUTE_COLORIMETRIC, - INTENT_ABSOLUTE_COLORIMETRIC, - cmsFLAGS_SOFTPROOFING); - - cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y); - - cmsDeleteTransform(hTransform); - cmsCloseProfile(imageProfile); - cmsCloseProfile(proofingProfile); - } - } -#else - /* unused */ - (void)ibuf; - (void)profile; -#endif -} - /* only used for image editor curves */ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf) { diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 09c189a8847..18eda831c47 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -125,7 +125,7 @@ struct PreviewImage* BKE_previewimg_create(void) prv_img = MEM_callocN(sizeof(PreviewImage), "img_prv"); - for (i=0; i<PREVIEW_MIPMAPS; ++i) { + for (i=0; i<NUM_ICON_SIZES; ++i) { prv_img->changed[i] = 1; prv_img->changed_timestamp[i] = 0; } @@ -137,7 +137,7 @@ void BKE_previewimg_free(PreviewImage **prv) if(prv && (*prv)) { int i; - for (i=0; i<PREVIEW_MIPMAPS;++i) { + for (i=0; i<NUM_ICON_SIZES;++i) { if ((*prv)->rect[i]) { MEM_freeN((*prv)->rect[i]); (*prv)->rect[i] = NULL; @@ -155,7 +155,7 @@ struct PreviewImage* BKE_previewimg_copy(PreviewImage *prv) if (prv) { prv_img = MEM_dupallocN(prv); - for (i=0; i < PREVIEW_MIPMAPS; ++i) { + for (i=0; i < NUM_ICON_SIZES; ++i) { if (prv->rect[i]) { prv_img->rect[i] = MEM_dupallocN(prv->rect[i]); } else { @@ -237,7 +237,7 @@ void BKE_icon_changed(int id) /* all previews changed */ if (prv) { int i; - for (i=0; i<PREVIEW_MIPMAPS; ++i) { + for (i=0; i<NUM_ICON_SIZES; ++i) { prv->changed[i] = 1; prv->changed_timestamp[i]++; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index caae8763f83..74b63a83dce 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1671,21 +1671,20 @@ void object_rot_to_mat3(Object *ob, float mat[][3]) { float rmat[3][3], dmat[3][3]; - /* initialise the delta-rotation matrix, which will get (pre)multiplied + /* 'dmat' is the delta-rotation matrix, which will get (pre)multiplied * with the rotation matrix to yield the appropriate rotation */ - unit_m3(dmat); - + /* rotations may either be quats, eulers (with various rotation orders), or axis-angle */ if (ob->rotmode > 0) { /* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */ - eulO_to_mat3( rmat,ob->rot, ob->rotmode); - eulO_to_mat3( dmat,ob->drot, ob->rotmode); + eulO_to_mat3(rmat, ob->rot, ob->rotmode); + eulO_to_mat3(dmat, ob->drot, ob->rotmode); } else if (ob->rotmode == ROT_MODE_AXISANGLE) { /* axis-angle - not really that great for 3D-changing orientations */ - axis_angle_to_mat3( rmat,ob->rotAxis, ob->rotAngle); - axis_angle_to_mat3( dmat,ob->drotAxis, ob->drotAngle); + axis_angle_to_mat3(rmat, ob->rotAxis, ob->rotAngle); + axis_angle_to_mat3(dmat, ob->drotAxis, ob->drotAngle); } else { /* quats are normalised before use to eliminate scaling issues */ @@ -1720,9 +1719,22 @@ void object_mat3_to_rot(Object *ob, float mat[][3], short use_compat) ob->rotAngle -= ob->drotAngle; break; default: /* euler */ - if(use_compat) mat3_to_compatible_eulO(ob->rot, ob->rot, ob->rotmode, mat); - else mat3_to_eulO(ob->rot, ob->rotmode, mat); - sub_v3_v3(ob->rot, ob->drot); + { + float quat[4]; + float dquat[4]; + float tmat[3][3]; + + /* without drot we could apply 'mat' directly */ + mat3_to_quat(quat, mat); + eulO_to_quat(dquat, ob->drot, ob->rotmode); + invert_qt(dquat); + mul_qt_qtqt(quat, dquat, quat); + quat_to_mat3(tmat, quat); + /* end drot correction */ + + if(use_compat) mat3_to_compatible_eulO(ob->rot, ob->rot, ob->rotmode, tmat); + else mat3_to_eulO(ob->rot, ob->rotmode, tmat); + } } } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 3df56760697..e6ff5ab4bd4 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1250,7 +1250,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D double step, pos; step= (totpart < 2) ? 0.5 : 1.0/(double)totpart; - pos= 1e-16; /* tiny offset to avoid zero weight face */ + pos= 1e-6; /* tiny offset to avoid zero weight face */ i= 0; for(p=0; p<totpart; p++, pos+=step) { diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 6f49155c0fd..d2f05a8ca53 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -2859,6 +2859,83 @@ static struct ImBuf * do_multicam( } /* ********************************************************************** + ADJUSTMENT + ********************************************************************** */ + +/* no effect inputs for adjustment, we use give_ibuf_seq */ +static int num_inputs_adjustment(void) +{ + return 0; +} + +static int early_out_adjustment(struct Sequence *UNUSED(seq), float UNUSED(facf0), float UNUSED(facf1)) +{ + return -1; +} + +static struct ImBuf * do_adjustment_impl(SeqRenderData context, Sequence * seq, + float cfra) +{ + Editing * ed; + ListBase * seqbasep; + struct ImBuf * i = 0; + + ed = context.scene->ed; + + seqbasep = seq_seqbase(&ed->seqbase, seq); + + if (seq->machine > 0) { + i = give_ibuf_seqbase(context, cfra, + seq->machine - 1, seqbasep); + } + + /* found nothing? so let's work the way up the metastrip stack, so + that it is possible to group a bunch of adjustment strips into + a metastrip and have that work on everything below the metastrip + */ + + if (!i) { + Sequence * meta; + + meta = seq_metastrip(&ed->seqbase, NULL, seq); + + if (meta) { + i = do_adjustment_impl(context, meta, cfra); + } + } + + return i; +} + +static struct ImBuf * do_adjustment( + SeqRenderData context, Sequence *seq, float cfra, + float UNUSED(facf0), float UNUSED(facf1), + struct ImBuf *UNUSED(ibuf1), struct ImBuf *UNUSED(ibuf2), + struct ImBuf *UNUSED(ibuf3)) +{ + struct ImBuf * i = 0; + struct ImBuf * out; + Editing * ed; + + ed = context.scene->ed; + + if (!ed) { + return NULL; + } + + i = do_adjustment_impl(context, seq, cfra); + + if (input_have_to_preprocess(context, seq, cfra)) { + out = IMB_dupImBuf(i); + IMB_freeImBuf(i); + } else { + out = i; + } + + return out; +} + +/* ********************************************************************** SPEED ********************************************************************** */ static void init_speed_effect(Sequence *seq) @@ -3256,6 +3333,11 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) rval.early_out = early_out_multicam; rval.execute = do_multicam; break; + case SEQ_ADJUSTMENT: + rval.num_inputs = num_inputs_adjustment; + rval.early_out = early_out_adjustment; + rval.execute = do_adjustment; + break; } return rval; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index e3639dd1c51..fb72ab676b0 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -79,9 +79,15 @@ #define snprintf _snprintf #endif -/* **** XXX ******** */ -//static void waitcursor(int val) {} -//static int blender_test_break() {return 0;} + +static ImBuf* seq_render_strip_stack( + SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown); + +static ImBuf * seq_render_strip( + SeqRenderData context, Sequence * seq, float cfra); + +static void seq_free_animdata(Scene *scene, Sequence *seq); + /* **** XXX ******** */ #define SELECT 1 @@ -177,8 +183,6 @@ void seq_free_strip(Strip *strip) MEM_freeN(strip); } -static void seq_free_animdata(Scene *scene, Sequence *seq); - void seq_free_sequence(Scene *scene, Sequence *seq) { if(seq->strip) seq_free_strip(seq->strip); @@ -191,6 +195,10 @@ void seq_free_sequence(Scene *scene, Sequence *seq) sh.free(seq); } + if(seq->sound) { + ((ID *)seq->sound)->us--; + } + /* clipboard has no scene and will never have a sound handle or be active */ if(scene) { Editing *ed = scene->ed; @@ -446,51 +454,6 @@ void seq_end(SeqIterator *iter) * in metastrips!) ********************************************************************** */ -#if 0 /* UNUSED */ -static void do_seq_count(ListBase *seqbase, int *totseq) -{ - Sequence *seq; - - seq= seqbase->first; - while(seq) { - (*totseq)++; - if(seq->seqbase.first) do_seq_count(&seq->seqbase, totseq); - seq= seq->next; - } -} - -static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth) -{ - Sequence *seq; - - seq= seqbase->first; - while(seq) { - seq->depth= depth; - if(seq->seqbase.first) do_build_seqar(&seq->seqbase, seqar, depth+1); - **seqar= seq; - (*seqar)++; - seq= seq->next; - } -} - -static void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) -{ - Sequence **tseqar; - - *totseq= 0; - do_seq_count(seqbase, totseq); - - if(*totseq==0) { - *seqar= NULL; - return; - } - *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar"); - tseqar= *seqar; - - do_build_seqar(seqbase, seqar, 0); - *seqar= tseqar; -} -#endif /* UNUSED */ static void do_seq_count_cb(ListBase *seqbase, int *totseq, int (*test_func)(Sequence * seq)) @@ -916,6 +879,7 @@ static const char *give_seqname_by_type(int type) case SEQ_TRANSFORM: return "Transform"; case SEQ_COLOR: return "Color"; case SEQ_MULTICAM: return "Multicam"; + case SEQ_ADJUSTMENT: return "Adjustment"; case SEQ_SPEED: return "Speed"; default: return NULL; @@ -1039,7 +1003,11 @@ StripElem *give_stripelem(Sequence *seq, int cfra) { StripElem *se= seq->strip->stripdata; - if(seq->type != SEQ_MOVIE) { /* movie use the first */ + if(seq->type == SEQ_IMAGE) { /* only + IMAGE strips use the whole array, + MOVIE strips use only + the first element, all other strips + don't use this... */ int nr = (int) give_stripelem_index(seq, cfra); if (nr == -1 || se == NULL) return NULL; @@ -1093,15 +1061,12 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se } if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) { - if (b > 0) { - if (seq_arr[b] == NULL) { - return 0; - } - } else { - for (b = MAXSEQ; b > 0; b--) { - if (video_seq_is_rendered(seq_arr[b])) { - break; - } + if (b == 0) { + b = MAXSEQ; + } + for (; b > 0; b--) { + if (video_seq_is_rendered(seq_arr[b])) { + break; } } } @@ -2855,7 +2820,10 @@ void seq_tx_set_final_right(Sequence *seq, int val) since they work a bit differently to normal image seq's (during transform) */ int seq_single_check(Sequence *seq) { - return (seq->len==1 && ELEM3(seq->type, SEQ_IMAGE, SEQ_COLOR, SEQ_MULTICAM)); + return (seq->len==1 && ( + seq->type == SEQ_IMAGE + || ((seq->type & SEQ_EFFECT) && + get_sequence_effect_num_inputs(seq->type) == 0))); } /* check if the selected seq's reference unselected seq's */ @@ -3214,6 +3182,24 @@ ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq) return NULL; } +Sequence *seq_metastrip(ListBase * seqbase, Sequence * meta, Sequence *seq) +{ + Sequence * iseq; + + for(iseq = seqbase->first; iseq; iseq = iseq->next) { + Sequence * rval; + + if (seq == iseq) { + return meta; + } else if(iseq->seqbase.first && + (rval = seq_metastrip(&iseq->seqbase, iseq, seq))) { + return rval; + } + } + + return NULL; +} + int seq_swap(Sequence *seq_a, Sequence *seq_b) { char name[sizeof(seq_a->name)]; @@ -3523,7 +3509,8 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo strip->len = seq->len = ceil(info.length * FPS); strip->us= 1; - strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); + /* we only need 1 element to store the filename */ + strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); BLI_split_dirfile(seq_load->path, strip->dir, se->name); @@ -3572,7 +3559,8 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo strip->len = seq->len = IMB_anim_get_duration( an ); strip->us= 1; - strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); + /* we only need 1 element for MOVIE strips */ + strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); BLI_split_dirfile(seq_load->path, strip->dir, se->name); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7592e74f0bb..a99430cfcf0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1585,7 +1585,7 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p if (prv) { int i; - for (i=0; i < PREVIEW_MIPMAPS; ++i) { + for (i=0; i < NUM_ICON_SIZES; ++i) { if (prv->rect[i]) { prv->rect[i] = newdataadr(fd, prv->rect[i]); } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index cb93d2bf70b..1ba695209b2 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1360,6 +1360,7 @@ void ANIM_OT_keyframe_delete_v3d (wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Keyframe"; + ot->description= "Remove keyframes on current frame for selected object"; ot->idname= "ANIM_OT_keyframe_delete_v3d"; /* callbacks */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 34faa7b8726..4e693bb819c 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -112,6 +112,7 @@ void viewvector(struct RegionView3D *rv3d, float coord[3], float vec[3]); void viewline(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_end[3]); void viewray(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_normal[3]); +void get_object_clip_range(struct Object *ob, float *lens, float *clipsta, float *clipend); int get_view3d_cliprange(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend); int get_view3d_viewplane(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize); int get_view3d_ortho(struct View3D *v3d, struct RegionView3D *rv3d); @@ -191,9 +192,19 @@ unsigned int ED_viewedit_datamask(struct bScreen *screen); /* assigning view matrix */ -void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist); -void view3d_apply_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens); +void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist); + +void ED_view3d_from_object(struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens); +void ED_view3d_to_object(struct Object *ob, const float ofs[3], const float quat[4], const float dist); + +/* camera lock functions */ +/* copy the camera to the view before starting a view transformation */ +void ED_view3d_camera_lock_init(struct View3D *v3d, struct RegionView3D *rv3d); +/* copy the view to the camera */ +void ED_view3d_camera_lock_sync(struct View3D *v3d, struct RegionView3D *rv3d); + int view3d_is_ortho(struct View3D *v3d, struct RegionView3D *rv3d); + #endif /* ED_VIEW3D_H */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 9507a1a07f4..037cc22f879 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -798,36 +798,39 @@ void UI_icons_init(int first_dyn_id) init_brush_icons(); } -/* Render size for preview images at level miplevel */ -static int preview_render_size(int miplevel) +/* Render size for preview images and icons + */ +static int preview_render_size(enum eIconSizes size) { - switch (miplevel) { - case 0: return 32; - case 1: return PREVIEW_DEFAULT_HEIGHT; + switch (size) { + case ICON_SIZE_ICON: return 32; + case ICON_SIZE_PREVIEW: return PREVIEW_DEFAULT_HEIGHT; } return 0; } -static void icon_create_mipmap(struct PreviewImage* prv_img, int miplevel) +/* Create rect for the icon + */ +static void icon_create_rect(struct PreviewImage* prv_img, enum eIconSizes size) { - unsigned int size = preview_render_size(miplevel); + unsigned int render_size = preview_render_size(size); if (!prv_img) { if (G.f & G_DEBUG) printf("Error: requested preview image does not exist"); } - if (!prv_img->rect[miplevel]) { - prv_img->w[miplevel] = size; - prv_img->h[miplevel] = size; - prv_img->changed[miplevel] = 1; - prv_img->changed_timestamp[miplevel] = 0; - prv_img->rect[miplevel] = MEM_callocN(size*size*sizeof(unsigned int), "prv_rect"); + if (!prv_img->rect[size]) { + prv_img->w[size] = render_size; + prv_img->h[size] = render_size; + prv_img->changed[size] = 1; + prv_img->changed_timestamp[size] = 0; + prv_img->rect[size] = MEM_callocN(render_size*render_size*sizeof(unsigned int), "prv_rect"); } } /* only called when icon has changed */ /* only call with valid pointer from UI_icon_draw */ -static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miplevel) +static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, enum eIconSizes size) { if (!prv_img) { if (G.f & G_DEBUG) @@ -835,11 +838,10 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miple return; } - /* create the preview rect */ - icon_create_mipmap(prv_img, miplevel); + icon_create_rect(prv_img, size); - ED_preview_icon_job(C, prv_img, id, prv_img->rect[miplevel], - prv_img->w[miplevel], prv_img->h[miplevel]); + ED_preview_icon_job(C, prv_img, id, prv_img->rect[size], + prv_img->w[size], prv_img->h[size]); } static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb, short is_preview) @@ -928,17 +930,17 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy glDisable(GL_TEXTURE_2D); } -/* Drawing size for preview images at level miplevel */ -static int preview_size(int miplevel) +/* Drawing size for preview images */ +static int get_draw_size(enum eIconSizes size) { - switch (miplevel) { - case 0: return ICON_DEFAULT_HEIGHT; - case 1: return PREVIEW_DEFAULT_HEIGHT; + switch (size) { + case ICON_SIZE_ICON: return ICON_DEFAULT_HEIGHT; + case ICON_SIZE_PREVIEW: return PREVIEW_DEFAULT_HEIGHT; } return 0; } -static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int UNUSED(nocreate), int is_preview) +static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, enum eIconSizes size, int draw_size, int UNUSED(nocreate), int is_preview) { Icon *icon = NULL; DrawInfo *di = NULL; @@ -988,11 +990,11 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al if(pi) { /* no create icon on this level in code */ - if(!pi->rect[miplevel]) return; /* something has gone wrong! */ + if(!pi->rect[size]) return; /* something has gone wrong! */ /* preview images use premul alpha ... */ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - icon_draw_rect(x, y, w, h, aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel], 1.0f, NULL, is_preview); + icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], 1.0f, NULL, is_preview); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } @@ -1024,7 +1026,7 @@ static void ui_id_brush_render(bContext *C, ID *id) if(!pi) return; - for(i = 0; i < PREVIEW_MIPMAPS; i++) { + for(i = 0; i < NUM_ICON_SIZES; i++) { /* check if rect needs to be created; changed only set by dynamic icons */ if((pi->changed[i] || !pi->rect[i])) { @@ -1113,21 +1115,21 @@ int ui_id_icon_get(bContext *C, ID *id, int big) return iconid; } -static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, float alpha, int miplevel, int nocreate) +static void icon_draw_at_size(float x, float y, int icon_id, float aspect, float alpha, enum eIconSizes size, int nocreate) { - int draw_size = preview_size(miplevel); - icon_draw_size(x, y, icon_id, aspect, alpha, NULL, miplevel, draw_size, nocreate, FALSE); + int draw_size = get_draw_size(size); + icon_draw_size(x, y, icon_id, aspect, alpha, NULL, size, draw_size, nocreate, FALSE); } void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha) { - icon_draw_mipmap(x, y, icon_id, aspect, alpha, PREVIEW_MIPMAP_ZERO, 0); + icon_draw_at_size(x, y, icon_id, aspect, alpha, ICON_SIZE_ICON, 0); } void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb) { - int draw_size = preview_size(PREVIEW_MIPMAP_ZERO); - icon_draw_size(x, y, icon_id, aspect, 1.0f, rgb, PREVIEW_MIPMAP_ZERO, draw_size, FALSE, FALSE); + int draw_size = get_draw_size(ICON_SIZE_ICON); + icon_draw_size(x, y, icon_id, aspect, 1.0f, rgb, ICON_SIZE_ICON, draw_size, FALSE, FALSE); } void UI_icon_draw(float x, float y, int icon_id) @@ -1137,21 +1139,21 @@ void UI_icon_draw(float x, float y, int icon_id) void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha) { - icon_draw_size(x, y, icon_id, 1.0f, alpha, NULL, PREVIEW_MIPMAP_ZERO, size, TRUE, FALSE); + icon_draw_size(x, y, icon_id, 1.0f, alpha, NULL, ICON_SIZE_ICON, size, TRUE, FALSE); } void UI_icon_draw_preview(float x, float y, int icon_id) { - icon_draw_mipmap(x, y, icon_id, 1.0f, 1.0f, PREVIEW_MIPMAP_LARGE, 0); + icon_draw_at_size(x, y, icon_id, 1.0f, 1.0f, ICON_SIZE_PREVIEW, 0); } void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect) { - icon_draw_mipmap(x, y, icon_id, aspect, 1.0f, PREVIEW_MIPMAP_LARGE, 0); + icon_draw_at_size(x, y, icon_id, aspect, 1.0f, ICON_SIZE_PREVIEW, 0); } void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size) { - icon_draw_size(x, y, icon_id, aspect, 1.0f, NULL, PREVIEW_MIPMAP_LARGE, size, FALSE, TRUE); + icon_draw_size(x, y, icon_id, aspect, 1.0f, NULL, ICON_SIZE_PREVIEW, size, FALSE, TRUE); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 94f12911d33..af5a69da653 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -461,7 +461,7 @@ 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 gets not saved"); + 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"); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); if(RNA_property_flag(template->prop) & PROP_NEVER_NULL) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index ce353f11248..4a71ca4f07e 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1692,6 +1692,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Flat"; + ot->description= "Display faces 'smooth' (using vertext normals)"; ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ @@ -1706,6 +1707,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Smooth"; + ot->description= "Display faces 'flat'"; ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ @@ -2061,6 +2063,7 @@ void OBJECT_OT_game_property_new(wmOperatorType *ot) { /* identifiers */ ot->name= "New Game Property"; + ot->description= "Create a new property available to the game engine"; ot->idname= "OBJECT_OT_game_property_new"; /* api callbacks */ @@ -2098,6 +2101,7 @@ void OBJECT_OT_game_property_remove(wmOperatorType *ot) { /* identifiers */ ot->name= "Remove Game Property"; + ot->description= "Remove game property"; ot->idname= "OBJECT_OT_game_property_remove"; /* api callbacks */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 228eefe9148..54ed6d48636 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -205,17 +205,28 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob ob->dt = OB_TEXTURE; } else if(md->type == eModifierType_Multires) { + int ok= 1; Mesh *me= ob->data; + ModifierData *tmpmd; - if(me->edit_btmesh) { - BMEditMesh *em= me->edit_btmesh; - /* CustomData_external_remove is used here only to mark layer as non-external - for further free-ing, so zero element count looks safer than em->totface */ - CustomData_external_remove(&em->bm->ldata, &me->id, CD_MDISPS, 0); - BM_free_data_layer(em->bm, &em->bm->ldata, CD_MDISPS); - } else { - CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop); - CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop); + /* ensure MDISPS CustomData layer is't used by another multires modifiers */ + for(tmpmd= ob->modifiers.first; tmpmd; tmpmd= tmpmd->next) + if(tmpmd!=md && tmpmd->type == eModifierType_Multires) { + ok= 0; + break; + } + + if(ok) { + if(me->edit_btmesh) { + BMEditMesh *em= me->edit_btmesh; + /* CustomData_external_remove is used here only to mark layer as non-external + for further free-ing, so zero element count looks safer than em->totface */ + CustomData_external_remove(&em->bm->ldata, &me->id, CD_MDISPS, 0); + BM_free_data_layer(em->bm, &em->bm->ldata, CD_MDISPS); + } else { + CustomData_external_remove(&me->ldata, &me->id, CD_MDISPS, me->totloop); + CustomData_free_layer_active(&me->ldata, CD_MDISPS, me->totloop); + } } } @@ -978,6 +989,7 @@ static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, wmE void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot) { ot->name= "Delete Higher Levels"; + ot->description= "Deletes the higher resolution mesh, potential loss of detail"; ot->idname= "OBJECT_OT_multires_higher_levels_delete"; ot->poll= multires_poll; diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index aafa5a185ed..56bd8b97532 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -110,6 +110,9 @@ static void keymap_particle(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0); + RNA_boolean_set(kmi->ptr, "release_confirm", 1); + WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index df6cdb577a2..797ead3cd90 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -156,6 +156,7 @@ void PTCACHE_OT_bake_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Bake All Physics"; + ot->description= "Bake all physics"; ot->idname= "PTCACHE_OT_bake_all"; /* api callbacks */ @@ -171,6 +172,7 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Free All Physics Bakes"; + ot->name= "Free all physics bakes"; ot->idname= "PTCACHE_OT_free_bake_all"; /* api callbacks */ @@ -268,6 +270,7 @@ void PTCACHE_OT_bake(wmOperatorType *ot) { /* identifiers */ ot->name= "Bake Physics"; + ot->description= "Bake physics"; ot->idname= "PTCACHE_OT_bake"; /* api callbacks */ @@ -283,6 +286,7 @@ void PTCACHE_OT_free_bake(wmOperatorType *ot) { /* identifiers */ ot->name= "Free Physics Bake"; + ot->description= "Free physics bake"; ot->idname= "PTCACHE_OT_free_bake"; /* api callbacks */ @@ -296,6 +300,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot) { /* identifiers */ ot->name= "Bake From Cache"; + ot->description= "Bake from cache"; ot->idname= "PTCACHE_OT_bake_from_cache"; /* api callbacks */ @@ -364,7 +369,8 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op)) void PTCACHE_OT_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add new cache"; + ot->name= "Add New Cache"; + ot->description= "Add new cache"; ot->idname= "PTCACHE_OT_add"; /* api callbacks */ @@ -377,7 +383,8 @@ void PTCACHE_OT_add(wmOperatorType *ot) void PTCACHE_OT_remove(wmOperatorType *ot) { /* identifiers */ - ot->name= "Delete current cache"; + ot->name= "Delete Current Cache"; + ot->description= "Delete current cache"; ot->idname= "PTCACHE_OT_remove"; /* api callbacks */ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 5b55095fdf9..092dfe0752e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3313,18 +3313,23 @@ static void sculpt_brush_init_tex(Sculpt *sd, SculptSession *ss) sculpt_update_tex(sd, ss); } -static int sculpt_brush_stroke_init(bContext *C, ReportList *UNUSED(reports)) +static int sculpt_brush_stroke_init(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt; Brush *brush = paint_brush(&sd->paint); + int mode= RNA_enum_get(op->ptr, "mode"); + int is_smooth= 0; view3d_operator_needs_opengl(C); sculpt_brush_init_tex(sd, ss); - sculpt_update_mesh_elements(scene, sd, ob, brush->sculpt_tool == SCULPT_TOOL_SMOOTH); + is_smooth|= mode == BRUSH_STROKE_SMOOTH; + is_smooth|= brush->sculpt_tool == SCULPT_TOOL_SMOOTH; + + sculpt_update_mesh_elements(scene, sd, ob, is_smooth); return 1; } @@ -3541,7 +3546,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even struct PaintStroke *stroke; int ignore_background_click; - if(!sculpt_brush_stroke_init(C, op->reports)) + if(!sculpt_brush_stroke_init(C, op)) return OPERATOR_CANCELLED; stroke = paint_stroke_new(C, sculpt_stroke_get_location, @@ -3570,7 +3575,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) { - if(!sculpt_brush_stroke_init(C, op->reports)) + if(!sculpt_brush_stroke_init(C, op)) return OPERATOR_CANCELLED; op->customdata = paint_stroke_new(C, sculpt_stroke_get_location, sculpt_stroke_test_start, diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index bee872dbe60..6637e7004d5 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -858,9 +858,9 @@ static int actkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent /* determine which side of the current frame mouse is on */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, NULL); if (x < CFRA) - RNA_int_set(op->ptr, "mode", ACTKEYS_LRSEL_LEFT); + RNA_enum_set(op->ptr, "mode", ACTKEYS_LRSEL_LEFT); else - RNA_int_set(op->ptr, "mode", ACTKEYS_LRSEL_RIGHT); + RNA_enum_set(op->ptr, "mode", ACTKEYS_LRSEL_RIGHT); } /* perform selection */ diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index b097ad0f55e..155c19f0763 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1070,9 +1070,9 @@ void filelist_from_library(struct FileList* filelist) PreviewImage *img= l->link; if (img) { - unsigned int w = img->w[PREVIEW_MIPMAP_LARGE]; - unsigned int h = img->h[PREVIEW_MIPMAP_LARGE]; - unsigned int *rect = img->rect[PREVIEW_MIPMAP_LARGE]; + unsigned int w = img->w[ICON_SIZE_PREVIEW]; + unsigned int h = img->h[ICON_SIZE_PREVIEW]; + unsigned int *rect = img->rect[ICON_SIZE_PREVIEW]; /* first allocate imbuf for copying preview into it */ if (w > 0 && h > 0 && rect) { diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index f57153f7f49..daf7ba1e38b 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -60,9 +60,4 @@ if(WITH_IMAGE_CINEON) add_definitions(-DWITH_CINEON) endif() -if(WITH_LCMS) - set(INC ${INC} ${LCMS_INCLUDE_DIR}) - add_definitions(-DWITH_LCMS) -endif() - blender_add_lib(bf_editor_space_image "${SRC}" "${INC}") diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index 47d9102b3bf..cdd2133d0f5 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -9,9 +9,6 @@ incs += ' ../../bmesh ../../render/extern/include ../../makesrna ../../blenloade defs = [] -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - incs += ' ' + env['BF_LCMS_INC'] if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') if env['WITH_BF_OPENJPEG']: diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 4cdac361bf3..112359726ea 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -58,10 +58,6 @@ #include "BKE_image.h" #include "BKE_paint.h" -#ifdef WITH_LCMS -#include "BKE_colortools.h" -#endif - #include "BIF_gl.h" #include "BIF_glutil.h" @@ -452,20 +448,6 @@ static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, fl // glColorMask(1, 1, 1, 1); } -#ifdef WITH_LCMS -static int sima_draw_colorcorrected_pixels(float x1, float y1, ImBuf *ibuf) -{ - colorcorrection_do_ibuf(ibuf, "MONOSCNR.ICM"); /* path is hardcoded here, find some place better */ - - if(ibuf->crect) { - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->crect); - return 1; - } - - return 0; -} -#endif - static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int *recti) { /* zbuffer values are signed, so we need to shift color range */ @@ -544,17 +526,6 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image else if(ibuf->channels==1) sima_draw_zbuffloat_pixels(scene, x, y, ibuf->x, ibuf->y, ibuf->rect_float); } -#ifdef WITH_LCMS - else if(sima->flag & SI_COLOR_CORRECTION) { - image_verify_buffer_float(ima, ibuf, color_manage); - - if(sima_draw_colorcorrected_pixels(x, y, ibuf)==0) { - unsigned char col1[3]= {100, 0, 100}, col2[3]= {160, 0, 160}; /* pink says 'warning' in blender land */ - sima_draw_alpha_backdrop(x, y, ibuf->x, ibuf->y, zoomx, zoomy, col1, col2); - } - - } -#endif else { if(sima->flag & SI_USE_ALPHA) { unsigned char col1[3]= {100, 100, 100}, col2[3]= {160, 160, 160}; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 17244a5251c..c4d52e3b836 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -802,6 +802,7 @@ void IMAGE_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open Image"; + ot->description= "Open image"; ot->idname= "IMAGE_OT_open"; /* api callbacks */ @@ -1345,6 +1346,7 @@ void IMAGE_OT_new(wmOperatorType *ot) /* identifiers */ ot->name= "New Image"; + ot->description= "Create a new image"; ot->idname= "IMAGE_OT_new"; /* api callbacks */ diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 77901f7fd29..ad0d0048388 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -633,12 +633,13 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load.", path); return OPERATOR_CANCELLED; } - } - else if (seq->type==SEQ_COLOR) { + } else if (seq->type == SEQ_COLOR) { SolidColorVars *colvars= (SolidColorVars *)seq->effectdata; RNA_float_get_array(op->ptr, "color", colvars->col); seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ + } else if (seq->type == SEQ_ADJUSTMENT) { + seq->blend_mode= SEQ_CROSS; } // XXX, this conflicts with giving a channel with invoke, perhaps we should have an active channel diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 2f95e8fa64c..f351d52db07 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -126,6 +126,7 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[ case SEQ_OVERDROP: case SEQ_GLOW: case SEQ_MULTICAM: + case SEQ_ADJUSTMENT: UI_GetThemeColor3ubv(TH_SEQ_EFFECT, col); /* slightly offset hue to distinguish different effects */ @@ -137,6 +138,8 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[ if (seq->type == SEQ_OVERDROP) rgb_byte_set_hue_float_offset(col,0.24); if (seq->type == SEQ_GLOW) rgb_byte_set_hue_float_offset(col,0.28); if (seq->type == SEQ_TRANSFORM) rgb_byte_set_hue_float_offset(col,0.36); + if (seq->type == SEQ_MULTICAM) rgb_byte_set_hue_float_offset(col,0.32); + if (seq->type == SEQ_ADJUSTMENT) rgb_byte_set_hue_float_offset(col,0.40); break; case SEQ_COLOR: @@ -476,7 +479,7 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float if(name[0]=='\0') name= give_seqname(seq); - if(seq->type == SEQ_META) { + if(seq->type == SEQ_META || seq->type == SEQ_ADJUSTMENT) { sprintf(str, "%d | %s", seq->len, name); } else if(seq->type == SEQ_SCENE) { diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 6d74ba07005..880f285c3e3 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -100,6 +100,7 @@ EnumPropertyItem sequencer_prop_effect_types[] = { {SEQ_COLOR, "COLOR", 0, "Color", "Color effect strip type"}, {SEQ_SPEED, "SPEED", 0, "Speed", "Color effect strip type"}, {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""}, + {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""}, {0, NULL, 0, NULL, NULL} }; @@ -406,6 +407,7 @@ int event_to_efftype(int event) if(event==15) return SEQ_TRANSFORM; if(event==16) return SEQ_COLOR; if(event==17) return SEQ_SPEED; + if(event==18) return SEQ_ADJUSTMENT; return 0; } @@ -517,7 +519,8 @@ static void change_sequence(Scene *scene) "|Glow%x14" "|Transform%x15" "|Color Generator%x16" - "|Speed Control%x17"); + "|Speed Control%x17" + "|Adjustment Layer%x18"); if(event > 0) { if(event==1) { SWAP(Sequence *,last_seq->seq1,last_seq->seq2); @@ -703,15 +706,9 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de while(seq) { seqn= seq->next; if((seq->flag & flag) || deleteall) { - if(seq->type==SEQ_SOUND && seq->sound) { - ((ID *)seq->sound)->us--; /* TODO, could be moved into seq_free_sequence() */ - } - BLI_remlink(lb, seq); if(seq==last_seq) seq_active_set(scene, NULL); if(seq->type==SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1); - /* if(seq->ipo) seq->ipo->id.us--; */ - /* XXX, remove fcurve */ seq_free_sequence(scene, seq); } seq= seqn; @@ -1706,11 +1703,6 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op)) if (nothingSelected) return OPERATOR_FINISHED; - /* free imbufs of all dependent strips */ - for(seq=ed->seqbasep->first; seq; seq=seq->next) - if(seq->flag & SELECT) - update_changed_seq_and_deps(scene, seq, 1, 0); - /* for effects, try to find a replacement input */ for(seq=ed->seqbasep->first; seq; seq=seq->next) if((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT)) diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6f5960f5ed3..4ef02243cd5 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -763,7 +763,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d) /* draw info beside axes in bottom left-corner: * framenum, object name, bone name (if available), marker name (if available) */ -static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d) +static void draw_selected_name(Scene *scene, Object *ob) { char info[256], *markern; short offset=30; @@ -832,7 +832,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d) } /* color depends on whether there is a keyframe */ - if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), v3d->keyflags)) + if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), ANIMFILTER_KEYS_LOCAL)) UI_ThemeColor(TH_VERTEX_SELECT); else UI_ThemeColor(TH_TEXT_HI); @@ -921,7 +921,7 @@ void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, Vi } } -static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float fac, char diagonal) +static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float fac) { float x3, y3, x4, y4; @@ -931,46 +931,63 @@ static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float f y4= y1 + (1.0f - fac) * (y2-y1); glBegin(GL_LINES); - switch(diagonal) { - case '\0': - glVertex2f(x1, y3); - glVertex2f(x2, y3); + glVertex2f(x1, y3); + glVertex2f(x2, y3); - glVertex2f(x1, y4); - glVertex2f(x2, y4); + glVertex2f(x1, y4); + glVertex2f(x2, y4); - glVertex2f(x3, y1); - glVertex2f(x3, y2); + glVertex2f(x3, y1); + glVertex2f(x3, y2); - glVertex2f(x4, y1); - glVertex2f(x4, y2); - break; - case 'H': /* hoz */ - glVertex2f(x1, y1); - glVertex2f(x2, y4); + glVertex2f(x4, y1); + glVertex2f(x4, y2); + glEnd(); +} + +/* harmonious triangle */ +static void drawviewborder_triangle(float x1, float x2, float y1, float y2, const char golden, const char dir) +{ + float ofs; + float w= x2 - x1; + float h= y2 - y1; + + glBegin(GL_LINES); + if(w > h) { + if(golden) { + ofs = w * (1.0f-(1.0f/1.61803399)); + } + else { + ofs = h * (h / w); + } + if(dir == 'B') SWAP(float, y1, y2); - glVertex2f(x1, y3); + glVertex2f(x1, y1); glVertex2f(x2, y2); glVertex2f(x2, y1); - glVertex2f(x1, y4); + glVertex2f(x1 + (w - ofs), y2); - glVertex2f(x2, y3); glVertex2f(x1, y2); - break; - case 'V': /* vert */ - glVertex2f(x1, y1); - glVertex2f(x4, y2); + glVertex2f(x1 + ofs, y1); + } + else { + if(golden) { + ofs = h * (1.0f-(1.0f/1.61803399)); + } + else { + ofs = w * (w / h); + } + if(dir == 'B') SWAP(float, x1, x2); - glVertex2f(x3, y1); + glVertex2f(x1, y1); glVertex2f(x2, y2); - glVertex2f(x1, y2); - glVertex2f(x4, y1); - - glVertex2f(x3, y2); glVertex2f(x2, y1); - break; + glVertex2f(x1, y1 + ofs); + + glVertex2f(x1, y2); + glVertex2f(x2, y1 + (h - ofs)); } glEnd(); } @@ -1083,22 +1100,32 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) if (ca->dtx & CAM_DTX_THIRDS) { UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); - drawviewborder_grid3(x1, x2, y1, y2, 1.0f/3.0f, '\0'); + drawviewborder_grid3(x1, x2, y1, y2, 1.0f/3.0f); } if (ca->dtx & CAM_DTX_GOLDEN) { UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); - drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399), '\0'); + drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399)); + } + + if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) { + UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); + drawviewborder_triangle(x1, x2, y1, y2, 0, 'A'); + } + + if (ca->dtx & CAM_DTX_GOLDEN_TRI_B) { + UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); + drawviewborder_triangle(x1, x2, y1, y2, 0, 'B'); } - if (ca->dtx & CAM_DTX_GOLDEN_DIAG_H) { + if (ca->dtx & CAM_DTX_HARMONY_TRI_A) { UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); - drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399), 'H'); + drawviewborder_triangle(x1, x2, y1, y2, 1, 'A'); } - if (ca->dtx & CAM_DTX_GOLDEN_DIAG_V) { + if (ca->dtx & CAM_DTX_HARMONY_TRI_B) { UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); - drawviewborder_grid3(x1, x2, y1, y2, 1.0f-(1.0f/1.61803399), 'V'); + drawviewborder_triangle(x1, x2, y1, y2, 1, 'B'); } if (ca->flag & CAM_SHOWTITLESAFE) { @@ -2469,7 +2496,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) // needs to be done always, gridview is adjusted in drawgrid() now rv3d->gridview= v3d->grid; - if(rv3d->view==0 || rv3d->persp != RV3D_ORTHO) { + if((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) { if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { drawfloor(scene, v3d, &grid_unit); } @@ -2641,7 +2668,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) ob= OBACT; if(U.uiflag & USER_DRAWVIEWINFO) - draw_selected_name(scene, ob, v3d); + draw_selected_name(scene, ob); /* XXX here was the blockhandlers for floating panels */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 53d2bed996e..ee73ed3a0fd 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -40,6 +40,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_camera_types.h" +#include "DNA_lamp_types.h" #include "MEM_guardedalloc.h" @@ -55,6 +56,7 @@ #include "BKE_paint.h" #include "BKE_report.h" #include "BKE_scene.h" +#include "BKE_depsgraph.h" /* for ED_view3d_camera_lock_sync */ #include "BIF_gl.h" @@ -79,6 +81,23 @@ /* ********************** view3d_edit: view manipulations ********************* */ +void ED_view3d_camera_lock_init(View3D *v3d, RegionView3D *rv3d) +{ + if(v3d->camera && (v3d->flag2 & V3D_LOCK_CAMERA) && (rv3d->persp==RV3D_CAMOB)) { + ED_view3d_from_object(v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL); + } +} + +void ED_view3d_camera_lock_sync(View3D *v3d, RegionView3D *rv3d) +{ + if(v3d->camera && (v3d->flag2 & V3D_LOCK_CAMERA) && (rv3d->persp==RV3D_CAMOB)) { + ED_view3d_to_object(v3d->camera, rv3d->ofs, rv3d->viewquat, rv3d->dist); + DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB); + WM_main_add_notifier(NC_OBJECT|ND_TRANSFORM, v3d->camera); + } +} + + /* ********************* box view support ***************** */ static void view3d_boxview_clip(ScrArea *sa) @@ -277,6 +296,7 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *ar, short do_clip) typedef struct ViewOpsData { ScrArea *sa; ARegion *ar; + View3D *v3d; RegionView3D *rv3d; /* needed for continuous zoom */ @@ -331,7 +351,6 @@ static void calctrackballvec(rcti *rect, int mx, int my, float *vec) static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) { static float lastofs[3] = {0,0,0}; - View3D *v3d; RegionView3D *rv3d; ViewOpsData *vod= MEM_callocN(sizeof(ViewOpsData), "viewops data"); @@ -339,8 +358,13 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) op->customdata= vod; vod->sa= CTX_wm_area(C); vod->ar= CTX_wm_region(C); - v3d= vod->sa->spacedata.first; + vod->v3d= vod->sa->spacedata.first; vod->rv3d= rv3d= vod->ar->regiondata; + + /* set the view from the camera, if view locking is enabled. + * we may want to make this optional but for now its needed always */ + ED_view3d_camera_lock_init(vod->v3d, vod->rv3d); + vod->dist0= rv3d->dist; copy_qt_qt(vod->oldquat, rv3d->viewquat); vod->origx= vod->oldx= event->x; @@ -358,8 +382,8 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) view3d_operator_needs_opengl(C); /* needed for zbuf drawing */ - if((vod->use_dyn_ofs=view_autodist(CTX_data_scene(C), vod->ar, v3d, event->mval, vod->dyn_ofs))) { - if (rv3d->persp==RV3D_PERSP) { + if((vod->use_dyn_ofs=view_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs))) { + if (rv3d->persp==RV3D_PERSP || (rv3d->persp==RV3D_CAMOB && (vod->v3d->flag2 & V3D_LOCK_CAMERA))) { float my_origin[3]; /* original G.vd->ofs */ float my_pivot[3]; /* view */ float dvec[3]; @@ -390,8 +414,6 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) } negate_v3(vod->dyn_ofs); copy_v3_v3(vod->ofs, rv3d->ofs); - } else { - vod->ofs[0] = vod->ofs[1] = vod->ofs[2] = 0.0f; } } @@ -399,8 +421,8 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) window_to_3d_vector(vod->ar, vod->mousevec, vod->oldx - vod->ar->winrct.xmin, vod->oldy - vod->ar->winrct.ymin); /* lookup, we dont pass on v3d to prevent confusement */ - vod->grid= v3d->grid; - vod->far= v3d->far; + vod->grid= vod->v3d->grid; + vod->far= vod->v3d->far; calctrackballvec(&vod->ar->winrct, event->x, event->y, vod->trackvec); @@ -546,7 +568,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) { RegionView3D *rv3d= vod->rv3d; - rv3d->view= 0; /* need to reset everytime because of view snapping */ + rv3d->view= RV3D_VIEW_USER; /* need to reset everytime because of view snapping */ if (U.flag & USER_TRACKBALL) { float phi, si, q1[4], dvec[3], newvec[3]; @@ -711,6 +733,8 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) /* avoid precision loss over time */ normalize_qt(rv3d->viewquat); + ED_view3d_camera_lock_sync(vod->v3d, rv3d); + ED_region_tag_redraw(vod->ar); } @@ -782,18 +806,18 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) if(rv3d->persp != RV3D_PERSP) { if (U.uiflag & USER_AUTOPERSP) { - rv3d->persp= RV3D_PERSP; + if(!((rv3d->persp==RV3D_CAMOB) && (vod->v3d->flag2 & V3D_LOCK_CAMERA))) { + rv3d->persp= RV3D_PERSP; + } } else if(rv3d->persp==RV3D_CAMOB) { /* changed since 2.4x, use the camera view */ - View3D *v3d = vod->sa->spacedata.first; - - if(v3d->camera) { - view3d_apply_ob(v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL); + if(vod->v3d->camera) { + ED_view3d_from_object(vod->v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, NULL); } - if(rv3d->persp==RV3D_CAMOB) { + if(!(vod->v3d->flag2 & V3D_LOCK_CAMERA)) { rv3d->persp= rv3d->lpersp; } } @@ -894,7 +918,7 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf) static void viewmove_apply(ViewOpsData *vod, int x, int y) { - if(vod->rv3d->persp==RV3D_CAMOB) { + if((vod->rv3d->persp==RV3D_CAMOB) && !(vod->v3d->flag2 & V3D_LOCK_CAMERA)) { float zoomfac= ((float)M_SQRT2 + (float)vod->rv3d->camzoom / 50.0f); zoomfac= (zoomfac * zoomfac) * 0.5f; @@ -917,6 +941,8 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y) vod->oldx= x; vod->oldy= y; + ED_view3d_camera_lock_sync(vod->v3d, vod->rv3d); + ED_region_tag_redraw(vod->ar); } @@ -966,11 +992,13 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) static int viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) { + ViewOpsData *vod; + /* makes op->customdata */ viewops_data_create(C, op, event); + vod= op->customdata; if (event->type == MOUSEPAN) { - ViewOpsData *vod= op->customdata; viewmove_apply(vod, event->prevx, event->prevy); request_depth_update(vod->rv3d); @@ -1159,6 +1187,8 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom, if(vod->rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_sync(vod->sa, vod->ar); + ED_view3d_camera_lock_sync(vod->v3d, vod->rv3d); + ED_region_tag_redraw(vod->ar); } @@ -1237,7 +1267,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) if(delta < 0) { /* this min and max is also in viewmove() */ - if(rv3d->persp==RV3D_CAMOB) { + if((rv3d->persp==RV3D_CAMOB) && !(v3d->flag2 & V3D_LOCK_CAMERA)) { rv3d->camzoom-= 10; if(rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom= RV3D_CAMZOOM_MIN; } @@ -1246,7 +1276,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) } } else { - if(rv3d->persp==RV3D_CAMOB) { + if((rv3d->persp==RV3D_CAMOB) && !(v3d->flag2 & V3D_LOCK_CAMERA)) { rv3d->camzoom+= 10; if(rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom= RV3D_CAMZOOM_MAX; } @@ -1259,6 +1289,9 @@ static int viewzoom_exec(bContext *C, wmOperator *op) view3d_boxview_sync(sa, ar); request_depth_update(rv3d); + + ED_view3d_camera_lock_sync(v3d, rv3d); + ED_region_tag_redraw(ar); viewops_data_free(C, op); @@ -1269,6 +1302,12 @@ static int viewzoom_exec(bContext *C, wmOperator *op) /* viewdolly_invoke() copied this function, changes here may apply there */ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event) { + ViewOpsData *vod; + + /* makes op->customdata */ + viewops_data_create(C, op, event); + vod= op->customdata; + /* if one or the other zoom position aren't set, set from event */ if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { @@ -1277,18 +1316,9 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event) } if(RNA_property_is_set(op->ptr, "delta")) { - /* makes op->customdata */ - viewops_data_create(C, op, event); viewzoom_exec(C, op); } else { - ViewOpsData *vod; - - /* makes op->customdata */ - viewops_data_create(C, op, event); - - vod= op->customdata; - if (event->type == MOUSEZOOM) { /* Bypass Zoom invert flag for track pads (pass FALSE always) */ @@ -1379,6 +1409,8 @@ static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_inv if(vod->rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_sync(vod->sa, vod->ar); + ED_view3d_camera_lock_sync(vod->v3d, vod->rv3d); + ED_region_tag_redraw(vod->ar); } @@ -1476,7 +1508,13 @@ static int viewdolly_exec(bContext *C, wmOperator *op) /* copied from viewzoom_invoke(), changes here may apply there */ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ +{ + ViewOpsData *vod; + + /* makes op->customdata */ + viewops_data_create(C, op, event); + vod= op->customdata; + /* if one or the other zoom position aren't set, set from event */ if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { @@ -1485,18 +1523,9 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event) } if(RNA_property_is_set(op->ptr, "delta")) { - /* makes op->customdata */ - viewops_data_create(C, op, event); viewdolly_exec(C, op); } else { - ViewOpsData *vod; - - /* makes op->customdata */ - viewops_data_create(C, op, event); - - vod= op->customdata; - /* overwrite the mouse vector with the view direction (zoom into the center) */ if((U.uiflag & USER_ZOOM_TO_MOUSEPOS) == 0) { negate_v3_v3(vod->mousevec, vod->rv3d->viewinv[2]); @@ -1536,10 +1565,17 @@ static int viewdolly_poll(bContext *C) { RegionView3D *rv3d= CTX_wm_region_view3d(C); - if (rv3d && rv3d->persp == RV3D_PERSP) { - return 1; + if(rv3d) { + if (rv3d->persp == RV3D_PERSP) { + return 1; + } + else { + View3D *v3d= CTX_wm_view3d(C); + if ((rv3d->persp == RV3D_CAMOB) && (v3d->flag2 & V3D_LOCK_CAMERA)) { + return 1; + } + } } - return 0; } @@ -1574,6 +1610,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in Scene *scene= CTX_data_scene(C); Base *base; float *curs; + const short skip_camera= ((rv3d->persp==RV3D_CAMOB) && (v3d->flag2 & V3D_LOCK_CAMERA)); int center= RNA_boolean_get(op->ptr, "center"); @@ -1594,6 +1631,11 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in for(base= scene->base.first; base; base= base->next) { if(BASE_VISIBLE(v3d, base)) { onedone= 1; + + if(skip_camera && base->object == v3d->camera) { + continue; + } + minmax_object(base->object, min, max); } } @@ -1629,7 +1671,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in new_dist*= size; } - if (rv3d->persp==RV3D_CAMOB) { + if ((rv3d->persp==RV3D_CAMOB) && !(v3d->flag2 & V3D_LOCK_CAMERA)) { rv3d->persp= RV3D_PERSP; smooth_view(C, v3d, ar, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL); } @@ -1673,6 +1715,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a loca Object *obedit= CTX_data_edit_object(C); float size, min[3], max[3], afm[3]; int ok=0, ok_dist=1; + const short skip_camera= ((rv3d->persp==RV3D_CAMOB) && (v3d->flag2 & V3D_LOCK_CAMERA)); /* SMOOTHVIEW */ float new_ofs[3]; @@ -1726,17 +1769,20 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a loca ok= PE_minmax(scene, min, max); } else { - Base *base= FIRSTBASE; - while(base) { + Base *base; + for(base= FIRSTBASE; base; base = base->next) { if(TESTBASE(v3d, base)) { + if(skip_camera && base->object == v3d->camera) { + continue; + } + /* account for duplis */ if (minmax_object_duplis(scene, base->object, min, max)==0) minmax_object(base->object, min, max); /* use if duplis not found */ ok= 1; } - base= base->next; } } @@ -1772,7 +1818,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a loca new_dist*= size; } - if (rv3d->persp==RV3D_CAMOB) { + if (rv3d->persp==RV3D_CAMOB && !(v3d->flag2 & V3D_LOCK_CAMERA)) { rv3d->persp= RV3D_PERSP; smooth_view(C, v3d, ar, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL); } @@ -1840,10 +1886,23 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot) static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */ { + ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); + Scene *scene= CTX_data_scene(C); + float xfac, yfac; + float size[2]; rv3d->camdx= rv3d->camdy= 0.0f; + view3d_viewborder_size_get(scene, ar, size); + + /* 4px is just a little room from the edge of the area */ + xfac= (float)ar->winx / (float)(size[0] + 4); + yfac= (float)ar->winy / (float)(size[1] + 4); + + rv3d->camzoom= (sqrtf(4.0f * MIN2(xfac, yfac)) - (float)M_SQRT2) * 50.0f; + rv3d->camzoom= CLAMPIS(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C)); return OPERATOR_FINISHED; @@ -2055,10 +2114,11 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event) { + View3D *v3d= CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); /* if in camera view do not exec the operator so we do not conflict with set render border*/ - if (rv3d->persp != RV3D_CAMOB) + if ((rv3d->persp != RV3D_CAMOB) || (v3d->flag2 & V3D_LOCK_CAMERA)) return WM_border_select_invoke(C, op, event); else return OPERATOR_PASS_THROUGH; @@ -2171,7 +2231,7 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar, float q1, float invert_qt(obact_quat); mul_qt_qtqt(new_quat, new_quat, obact_quat); - rv3d->view= view= 0; + rv3d->view= view= RV3D_VIEW_USER; } } @@ -2363,6 +2423,7 @@ static EnumPropertyItem prop_view_orbit_items[] = { static int vieworbit_exec(bContext *C, wmOperator *op) { + View3D *v3d= CTX_wm_view3d(C); ARegion *ar= ED_view3d_context_region_unlock(C); RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */ float phi, q1[4], new_quat[4]; @@ -2371,8 +2432,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) orbitdir = RNA_enum_get(op->ptr, "type"); if(rv3d->viewlock==0) { - - if(rv3d->persp != RV3D_CAMOB) { + if((rv3d->persp != RV3D_CAMOB) || (v3d->flag2 & V3D_LOCK_CAMERA)) { if(orbitdir == V3D_VIEW_STEPLEFT || orbitdir == V3D_VIEW_STEPRIGHT) { float si; /* z-axis */ @@ -2383,7 +2443,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) q1[1]= q1[2]= 0.0; q1[3]= si; mul_qt_qtqt(new_quat, rv3d->viewquat, q1); - rv3d->view= 0; + rv3d->view= RV3D_VIEW_USER; } else if(orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) { /* horizontal axis */ @@ -2395,7 +2455,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) q1[0]= (float)cos(phi); mul_v3_fl(q1+1, sin(phi)); mul_qt_qtqt(new_quat, rv3d->viewquat, q1); - rv3d->view= 0; + rv3d->view= RV3D_VIEW_USER; } smooth_view(C, CTX_wm_view3d(C), ar, NULL, NULL, NULL, new_quat, NULL, NULL); @@ -3448,3 +3508,62 @@ void view3d_persp_mat4(RegionView3D *rv3d, float mat[][4]) mul_v3_v3fl(dvec, mat[2], -rv3d->dist); sub_v3_v3v3(mat[3], dvec, rv3d->ofs); } + + +/* Gets the view trasnformation from a camera +* currently dosnt take camzoom into account +* +* The dist is not modified for this function, if NULL its assimed zero +* */ +void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist) +{ + /* Offset */ + if (ofs) + negate_v3_v3(ofs, mat[3]); + + /* Quat */ + if (quat) { + float imat[4][4]; + invert_m4_m4(imat, mat); + mat4_to_quat(quat, imat); + } + + if (dist) { + float nmat[3][3]; + float vec[3]; + + vec[0]= 0.0f; + vec[1]= 0.0f; + vec[2]= -(*dist); + + copy_m3_m4(nmat, mat); + normalize_m3(nmat); + + mul_m3_v3(nmat, vec);; + sub_v3_v3(ofs, vec); + } +} + + +/* object -> view */ +void ED_view3d_from_object(Object *ob, float ofs[3], float quat[4], float *dist, float *lens) +{ + ED_view3d_from_m4(ob->obmat, ofs, quat, dist); + + if (lens) { + get_object_clip_range(ob, lens, NULL, NULL); + } +} + +/* view -> object */ +void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], const float dist) +{ + float mat4[4][4]; + float dvec[3]= {0.0f, 0.0f, dist}; + float iviewquat[4]= {-quat[0], quat[1], quat[2], quat[3]}; + + quat_to_mat4(mat4, iviewquat); + mul_mat3_m4_v3(mat4, dvec); + sub_v3_v3v3(mat4[3], dvec, ofs); + object_apply_mat4(ob, mat4, TRUE, TRUE); +} diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 4adfcd51f56..60c863b4be3 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -523,9 +523,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) block= uiLayoutGetBlock(row); if(v3d->twflag & V3D_USE_MANIPULATOR) { - uiDefIconButBitS(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode"); - uiDefIconButBitS(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode"); - uiDefIconButBitS(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode"); + uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode"); + uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode"); + uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode"); } if (v3d->twmode > (BIF_countTransformOrientation(C) - 1) + V3D_MANIP_CUSTOM) { @@ -533,7 +533,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) } str_menu = BIF_menustringTransformOrientation(C, "Orientation"); - uiDefButS(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation"); + uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation"); MEM_freeN((void *)str_menu); } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 8adcd80d1c2..ac108caec80 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -32,9 +32,9 @@ #include "DNA_camera_types.h" -#include "DNA_lamp_types.h" #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "DNA_lamp_types.h" #include "MEM_guardedalloc.h" @@ -105,7 +105,7 @@ float *give_cursor(Scene *scene, View3D *v3d) /* Gets the lens and clipping values from a camera of lamp type object */ -static void object_lens_clip_settings(Object *ob, float *lens, float *clipsta, float *clipend) +void get_object_clip_range(Object *ob, float *lens, float *clipsta, float *clipend) { if(ob->type==OB_LAMP ) { Lamp *la = ob->data; @@ -129,51 +129,6 @@ static void object_lens_clip_settings(Object *ob, float *lens, float *clipsta, f } } - -/* Gets the view trasnformation from a camera -* currently dosnt take camzoom into account -* -* The dist is not modified for this function, if NULL its assimed zero -* */ -void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist) -{ - /* Offset */ - if (ofs) - negate_v3_v3(ofs, mat[3]); - - /* Quat */ - if (quat) { - float imat[4][4]; - invert_m4_m4(imat, mat); - mat4_to_quat(quat, imat); - } - - if (dist) { - float nmat[3][3]; - float vec[3]; - - vec[0]= 0.0f; - vec[1]= 0.0f; - vec[2]= -(*dist); - - copy_m3_m4(nmat, mat); - normalize_m3(nmat); - - mul_m3_v3(nmat, vec);; - sub_v3_v3(ofs, vec); - } -} - -void view3d_apply_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens) -{ - view3d_apply_mat4(ob->obmat, ofs, quat, dist); - - if (lens) { - object_lens_clip_settings(ob, lens, NULL, NULL); - } -} - - /* ****************** smooth view operator ****************** */ /* This operator is one of the 'timer refresh' ones like animation playback */ @@ -206,7 +161,19 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec sms.new_dist= rv3d->dist; sms.new_lens= v3d->lens; sms.to_camera= 0; - + + /* note on camera locking, this is a little confusing but works ok. + * we may be changing the view 'as if' there is no active camera, but infact + * there is an active camera which is locked to the view. + * + * In the case where smooth view is moving _to_ a camera we dont want that + * camera to be moved or changed, so only when the camera is not being set should + * we allow camera option locking to initialize the view settings from the camera. + */ + if(camera == NULL && oldcamera == NULL) { + ED_view3d_camera_lock_init(v3d, rv3d); + } + /* store the options we want to end with */ if(ofs) copy_v3_v3(sms.new_ofs, ofs); if(quat) copy_qt_qt(sms.new_quat, quat); @@ -214,7 +181,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec if(lens) sms.new_lens= *lens; if (camera) { - view3d_apply_ob(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens); + ED_view3d_from_object(camera, sms.new_ofs, sms.new_quat, &sms.new_dist, &sms.new_lens); sms.to_camera= 1; /* restore view3d values in end */ } @@ -239,7 +206,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec /* original values */ if (oldcamera) { sms.orig_dist= rv3d->dist; // below function does weird stuff with it... - view3d_apply_ob(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens); + ED_view3d_from_object(oldcamera, sms.orig_ofs, sms.orig_quat, &sms.orig_dist, &sms.orig_lens); } else { copy_v3_v3(sms.orig_ofs, rv3d->ofs); @@ -251,7 +218,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec if((rv3d->viewlock & RV3D_LOCKED)==0) { /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */ sms.orig_view= rv3d->sms ? rv3d->sms->orig_view : rv3d->view; - rv3d->view= 0; + rv3d->view= RV3D_VIEW_USER; } sms.time_allowed= (double)U.smooth_viewtx / 1000.0; @@ -341,6 +308,8 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent copy_qt_qt(rv3d->viewquat, sms->new_quat); rv3d->dist = sms->new_dist; v3d->lens = sms->new_lens; + + ED_view3d_camera_lock_sync(v3d, rv3d); } if((rv3d->viewlock & RV3D_LOCKED)==0) { @@ -370,6 +339,8 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent rv3d->dist = sms->new_dist * step + sms->orig_dist*step_inv; v3d->lens = sms->new_lens * step + sms->orig_lens*step_inv; + + ED_view3d_camera_lock_sync(v3d, rv3d); } if(rv3d->viewlock & RV3D_BOXVIEW) @@ -396,25 +367,6 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot) /* ****************** change view operators ****************** */ -static void setcameratoview3d(RegionView3D *rv3d, Object *ob) -{ - float dvec[3]; - float mat3[3][3]; - - mul_v3_v3fl(dvec, rv3d->viewinv[2], rv3d->dist); - sub_v3_v3v3(ob->loc, dvec, rv3d->ofs); - rv3d->viewquat[0]= -rv3d->viewquat[0]; - - // quat_to_eul( ob->rot,rv3d->viewquat); // in 2.4x for xyz eulers only - quat_to_mat3(mat3, rv3d->viewquat); - object_mat3_to_rot(ob, mat3, 0); - - rv3d->viewquat[0]= -rv3d->viewquat[0]; - - ob->recalc= OB_RECALC_OB; -} - - static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d = CTX_wm_view3d(C); @@ -426,7 +378,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op)) rv3d->lpersp= rv3d->persp; } - setcameratoview3d(rv3d, v3d->camera); + ED_view3d_to_object(v3d->camera, rv3d->ofs, rv3d->viewquat, rv3d->dist); DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB); rv3d->persp = RV3D_CAMOB; @@ -1185,7 +1137,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short float bmat[4][4]; float tmat[3][3]; - rv3d->view= 0; /* dont show the grid */ + rv3d->view= RV3D_VIEW_USER; /* dont show the grid */ copy_m4_m4(bmat, ob->obmat); normalize_m4(bmat); @@ -1209,7 +1161,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short rv3d->persp=RV3D_PERSP; rv3d->dist= 0.0; - view3d_apply_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); + ED_view3d_from_object(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); smooth_view(NULL, NULL, NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX rv3d->persp=RV3D_CAMOB; /* just to be polite, not needed */ @@ -1938,7 +1890,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f cross_v3_v3v3(axis, alignaxis, norm); axis_angle_to_quat( new_quat,axis, -angle); - rv3d->view= 0; + rv3d->view= RV3D_VIEW_USER; if (rv3d->persp==RV3D_CAMOB && v3d->camera) { /* switch out of camera view */ @@ -1949,7 +1901,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f copy_v3_v3(orig_ofs, rv3d->ofs); rv3d->persp= RV3D_PERSP; rv3d->dist= 0.0; - view3d_apply_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); + ED_view3d_from_object(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens); smooth_view(NULL, NULL, NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX } else { if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP; /* switch out of camera mode */ diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c9db202718a..4c7f211833c 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -938,6 +938,7 @@ void UV_OT_unwrap(wmOperatorType *ot) /* identifiers */ ot->name= "Unwrap"; + ot->description= "Unwrap the mesh of the object being edited"; ot->idname= "UV_OT_unwrap"; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 24f04098d0c..6404ae3de75 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -146,8 +146,4 @@ if(WITH_IMAGE_HDR) add_definitions(-DWITH_HDR) endif() -if(WITH_LCMS) - add_definitions(-DWITH_LCMS) -endif() - blender_add_lib(bf_imbuf "${SRC}" "${INC}") diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 5717a92db54..f5e2bf71468 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -88,11 +88,6 @@ typedef struct ImBuf { Linear RGB color space - may need gamma correction to sRGB when generating 8bit representations */ -#ifdef WITH_LCMS - unsigned int *crect; /* color corrected pixel values stored here */ - char profile_filename[256]; /* to be implemented properly, specific filename for custom profiles */ -#endif - /* resolution - pixels per meter */ double ppm[2]; diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index 59b938c3373..ecb9a89c274 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -48,7 +48,4 @@ if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] defs.append('WITH_QUICKTIME') -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [185,115] ) diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 91583f02a49..59772771f3b 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -85,12 +85,6 @@ void imb_freerectImBuf(ImBuf *ibuf) { if(ibuf==NULL) return; -#ifdef WITH_LCMS - if(ibuf->crect) - MEM_freeN(ibuf->crect); - ibuf->crect= NULL; -#endif - if(ibuf->rect && (ibuf->mall & IB_rect)) MEM_freeN(ibuf->rect); ibuf->rect= NULL; diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 267283ee47a..4cf9f47041b 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -123,12 +123,14 @@ typedef struct Library { struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */ } Library; -#define PREVIEW_MIPMAPS 2 -#define PREVIEW_MIPMAP_ZERO 0 -#define PREVIEW_MIPMAP_LARGE 1 +enum eIconSizes { + ICON_SIZE_ICON, + ICON_SIZE_PREVIEW, +}; +#define NUM_ICON_SIZES (ICON_SIZE_PREVIEW + 1) typedef struct PreviewImage { - /* All values of 2 are really PREVIEW_MIPMAPS */ + /* All values of 2 are really NUM_ICON_SIZES */ unsigned int w[2]; unsigned int h[2]; short changed[2]; diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index d64b72c6f40..952b4e799b5 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -76,8 +76,10 @@ typedef struct Camera { #define CAM_DTX_CENTER_DIAG 2 #define CAM_DTX_THIRDS 4 #define CAM_DTX_GOLDEN 8 -#define CAM_DTX_GOLDEN_DIAG_H 16 -#define CAM_DTX_GOLDEN_DIAG_V 32 +#define CAM_DTX_GOLDEN_TRI_A 16 +#define CAM_DTX_GOLDEN_TRI_B 32 +#define CAM_DTX_HARMONY_TRI_A 64 +#define CAM_DTX_HARMONY_TRI_B 128 /* flag */ #define CAM_SHOWLIMITS 1 diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 22f0c23ea9b..f89cc9d518a 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -310,7 +310,8 @@ typedef struct SpeedControlVars { #define SEQ_COLOR 28 #define SEQ_SPEED 29 #define SEQ_MULTICAM 30 -#define SEQ_EFFECT_MAX 30 +#define SEQ_ADJUSTMENT 31 +#define SEQ_EFFECT_MAX 31 #define STRIPELEM_FAILED 0 #define STRIPELEM_OK 1 diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index c9a440522d1..60fa48d9717 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -163,26 +163,21 @@ typedef struct View3D { * OB_SHADED or OB_TEXTURE */ short drawtype; short ob_centre_cursor; /* optional bool for 3d cursor to define center */ - short scenelock, around, pad3; + short scenelock, around; short flag, flag2; - short pivot_last; /* pivot_last is for rotating around the last edited element */ - float lens, grid; - float gridview; /* XXX deprecated, now in RegionView3D */ float near, far; float ofs[3]; /* XXX deprecated */ float cursor[3]; - short gridlines, pad4; - short gridflag; - short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */ short modeselect; - short keyflags; /* flags for display of keyframes */ - + short gridlines; + short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */ + char gridflag; + /* transform widget info */ - short twtype, twmode, twflag; - short twdrawflag; /* XXX deprecated */ + char twtype, twmode, twflag, pad2[2]; /* afterdraw, for xray & transparent */ struct ListBase afterdraw_transp; @@ -195,7 +190,7 @@ typedef struct View3D { char ndofmode; /* mode of transform for 6DOF devices -1 not found, 0 normal, 1 fly, 2 ob transform */ char ndoffilter; /* filter for 6DOF devices 0 normal, 1 dominant */ - void *properties_storage; /* Nkey panel stores stuff here, not in file */ + void *properties_storage; /* Nkey panel stores stuff here (runtime only!) */ /* XXX depricated? */ struct bGPdata *gpd; /* Grease-Pencil Data (annotation layers) */ @@ -231,10 +226,11 @@ typedef struct View3D { #define RV3D_BOXCLIP 4 /* RegionView3d->view */ -#define RV3D_VIEW_FRONT 1 +#define RV3D_VIEW_USER 0 +#define RV3D_VIEW_FRONT 1 #define RV3D_VIEW_BACK 2 #define RV3D_VIEW_LEFT 3 -#define RV3D_VIEW_RIGHT 4 +#define RV3D_VIEW_RIGHT 4 #define RV3D_VIEW_TOP 5 #define RV3D_VIEW_BOTTOM 6 #define RV3D_VIEW_PERSPORTHO 7 @@ -244,6 +240,7 @@ typedef struct View3D { #define V3D_RENDER_OVERRIDE 4 #define V3D_SOLID_TEX 8 #define V3D_DISPGP 16 +#define V3D_LOCK_CAMERA 32 /* View3D->around */ #define V3D_CENTER 0 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 5b42e01989e..4672a77bd06 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -53,6 +53,7 @@ extern StructRNA RNA_ActionGroup; extern StructRNA RNA_Actuator; extern StructRNA RNA_ActuatorSensor; extern StructRNA RNA_Addon; +extern StructRNA RNA_AdjustmentSequence; extern StructRNA RNA_AlwaysSensor; extern StructRNA RNA_AndController; extern StructRNA RNA_AnimData; diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 9942420ae48..573bdfa2b28 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -42,10 +42,6 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../quicktime' -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - incs += ' ' + env['BF_LCMS_INC'] - if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 823844b1524..8eec0f00c5a 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -175,11 +175,6 @@ if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() -if(WITH_LCMS) - list(APPEND INC ${LCMS_INCLUDE_DIR}) - add_definitions(-DWITH_LCMS) -endif() - if(NOT WITH_MOD_FLUID) add_definitions(-DDISABLE_ELBEEM) endif() diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 4d8e2ea8793..2adb8a4c2d1 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -65,9 +65,6 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../../quicktime' -if env['WITH_BF_LCMS']: - defs.append('WITH_LCMS') - if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 14a2f27bd8c..1705e2e5376 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -72,8 +72,10 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""}, {CAM_DTX_THIRDS, "THIRDS", 0, "Thirds", ""}, {CAM_DTX_GOLDEN, "GOLDEN", 0, "Golden", ""}, - {CAM_DTX_GOLDEN_DIAG_H, "GOLDEN_DIAGONAL_H", 0, "Golden Diagonal Hoz", ""}, - {CAM_DTX_GOLDEN_DIAG_V, "GOLDEN_DIAGONAL_V", 0, "Golden Diagonal Vert", ""}, + {CAM_DTX_GOLDEN_TRI_A, "GOLDEN_TRIANGLE_A", 0, "Golden Triangle A", ""}, + {CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""}, + {CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""}, + {CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_lens_unit_items[] = { {0, "MILLIMETERS", 0, "Millimeters", ""}, @@ -106,7 +108,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); - RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index a8e3500f08f..9709ba7e8f6 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -435,13 +435,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna) prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Position", ""); + RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); } diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 966e679f0fe..e7604b2beb4 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -75,18 +75,25 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem space_pchan_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {2, "POSE", 0, "Pose Space", ""}, - {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""}, - {1, "LOCAL", 0, "Local Space", ""}, +static EnumPropertyItem target_space_pchan_items[] = { + {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {2, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"}, + {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, + {0, NULL, 0, NULL, NULL}}; + +static EnumPropertyItem owner_space_pchan_items[] = { + {0, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"}, + {2, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"}, + {3, "LOCAL_WITH_PARENT", 0, "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, + {1, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME static EnumPropertyItem space_object_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {1, "LOCAL", 0, "Local Space", ""}, + {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, {0, NULL, 0, NULL, NULL}}; #include "BKE_animsys.h" @@ -242,7 +249,7 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRN bConstraint *con= (bConstraint*)ptr->data; if(BLI_findindex(&ob->constraints, con) == -1) - return space_pchan_items; + return owner_space_pchan_items; else /* object */ return space_object_items; } @@ -265,7 +272,7 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR cti->flush_constraint_targets(con, &targets, 1); if(ct) - return space_pchan_items; + return target_space_pchan_items; } return space_object_items; @@ -318,9 +325,9 @@ static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const flo #else EnumPropertyItem constraint_distance_items[] = { - {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""}, - {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""}, - {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""}, + {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", "The object is constrained inside a virtual sphere around the target object, with a radius defined by the limit distance"}, + {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", "The object is constrained outside a virtual sphere around the target object, with a radius defined by the limit distance"}, + {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", "The object is constrained on the surface of a virtual sphere around the target object, with a radius defined by the limit distance"}, {0, NULL, 0, NULL, NULL} }; @@ -966,7 +973,7 @@ static void rna_def_constraint_action(BlenderRNA *brna) prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); - RNA_def_property_ui_text(prop, "Action", ""); + RNA_def_property_ui_text(prop, "Action", "The constraining action"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); @@ -1183,10 +1190,10 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_items[] = { - {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", ""}, - {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", ""}, - {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", ""}, - {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", ""}, + {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", "Allows rotations around all axes"}, + {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", "Works in one plane, allows rotations around one axis only"}, + {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", "Allows rotations around all axes with limits for the cone and twist axes"}, + {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint"); @@ -1788,9 +1795,9 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", ""}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""}, + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrinks the location to the nearest target surface"}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the location to the nearest target surface along a given axis"}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the location to the nearest target vertex"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); @@ -1940,13 +1947,13 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_rotAxis_items[] = { - {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", ""}, - {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", ""}, - {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", ""}, - {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", ""}, - {PIVOTCON_AXIS_X, "X", 0, "X Rot", ""}, - {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", ""}, - {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", ""}, + {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"}, + {PIVOTCON_AXIS_X_NEG, "NX", 0, "-X Rot", "Use the pivot point in the negative rotation range around the X-axis"}, + {PIVOTCON_AXIS_Y_NEG, "NY", 0, "-Y Rot", "Use the pivot point in the negative rotation range around the Y-axis"}, + {PIVOTCON_AXIS_Z_NEG, "NZ", 0, "-Z Rot", "Use the pivot point in the negative rotation range around the Z-axis"}, + {PIVOTCON_AXIS_X, "X", 0, "X Rot", "Use the pivot point in the positive rotation range around the X-axis"}, + {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", "Use the pivot point in the positive rotation range around the Y-axis"}, + {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", "Use the pivot point in the positive rotation range around the Z-axis"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "PivotConstraint", "Constraint"); @@ -2019,13 +2026,13 @@ void RNA_def_constraint(BlenderRNA *brna) prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ownspace"); - RNA_def_property_enum_items(prop, space_pchan_items); + RNA_def_property_enum_items(prop, owner_space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf"); RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in"); prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tarspace"); - RNA_def_property_enum_items(prop, space_pchan_items); + RNA_def_property_enum_items(prop, target_space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf"); RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in"); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 3f0ccf99266..3e65eb8665e 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -521,7 +521,7 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of Shape Key"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set"); RNA_def_struct_name_property(srna, prop); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 909c824074e..0e9629f973d 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -743,7 +743,7 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Diffuse Color", ""); + RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the material"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR); @@ -797,25 +797,25 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_col"); RNA_def_property_enum_items(prop, ramp_blend_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the diffuse color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec"); RNA_def_property_enum_items(prop, ramp_blend_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the specular color"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_col"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Diffuse Ramp Input", ""); + RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "Determines how the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_spec"); RNA_def_property_enum_items(prop, prop_ramp_input_items); - RNA_def_property_ui_text(prop, "Specular Ramp Input", ""); + RNA_def_property_ui_text(prop, "Specular Ramp Input", "Determines how the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR); @@ -836,11 +836,11 @@ static void rna_def_material_diffuse(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_diff_shader_items[] = { - {MA_DIFF_LAMBERT, "LAMBERT", 0, "Lambert", ""}, - {MA_DIFF_ORENNAYAR, "OREN_NAYAR", 0, "Oren-Nayar", ""}, - {MA_DIFF_TOON, "TOON", 0, "Toon", ""}, - {MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", ""}, - {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", ""}, + {MA_DIFF_LAMBERT, "LAMBERT", 0, "Lambert", "Use a Lambertian shader"}, + {MA_DIFF_ORENNAYAR, "OREN_NAYAR", 0, "Oren-Nayar", "Use an Oren-Nayar shader"}, + {MA_DIFF_TOON, "TOON", 0, "Toon", "Use a toon shader"}, + {MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", "Use a Minnaert shader"}, + {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"}, {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE); @@ -1048,7 +1048,7 @@ static void rna_def_material_volume(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_lighting_items[] = { - {MA_VOL_SHADE_SHADELESS, "SHADELESS", 0, "Shadeless", ""}, + {MA_VOL_SHADE_SHADELESS, "SHADELESS", 0, "Shadeless", "Do not calculate lighting and shadows"}, {MA_VOL_SHADE_SHADOWED, "SHADOWED", 0, "Shadowed", ""}, {MA_VOL_SHADE_SHADED, "SHADED", 0, "Shaded", ""}, {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""}, @@ -1168,7 +1168,7 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "emission_col"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Emission Color", ""); + RNA_def_property_ui_text(prop, "Emission Color", "Color of emitted light"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE); @@ -1389,11 +1389,11 @@ static void rna_def_material_specularity(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_specular_shader_items[] = { - {MA_SPEC_COOKTORR, "COOKTORR", 0, "CookTorr", ""}, - {MA_SPEC_PHONG, "PHONG", 0, "Phong", ""}, - {MA_SPEC_BLINN, "BLINN", 0, "Blinn", ""}, - {MA_SPEC_TOON, "TOON", 0, "Toon", ""}, - {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", ""}, + {MA_SPEC_COOKTORR, "COOKTORR", 0, "CookTorr", "Use a Cook-Torrance shader"}, + {MA_SPEC_PHONG, "PHONG", 0, "Phong", "Use a Phong shader"}, + {MA_SPEC_BLINN, "BLINN", 0, "Blinn", "Use a Blinn shader"}, + {MA_SPEC_TOON, "TOON", 0, "Toon", "Use a toon shader"}, + {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"}, {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE); @@ -1405,7 +1405,7 @@ static void rna_def_material_specularity(StructRNA *srna) prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Specular Intensity", ""); + RNA_def_property_ui_text(prop, "Specular Intensity", "How intense (bright) the specular reflection is"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); /* NOTE: "har", "param", etc are used for multiple purposes depending on @@ -1416,13 +1416,13 @@ static void rna_def_material_specularity(StructRNA *srna) prop= RNA_def_property(srna, "specular_hardness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); - RNA_def_property_ui_text(prop, "Specular Hardness", ""); + RNA_def_property_ui_text(prop, "Specular Hardness", "How hard (sharp) the specular reflection is"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "refrac"); RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_text(prop, "Specular IOR", ""); + RNA_def_property_ui_text(prop, "Specular IOR", "Specular index of refraction"); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE); @@ -1585,9 +1585,9 @@ void RNA_def_material(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_shadows_only_items[] = { - {MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", ""}, - {MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", ""}, - {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", ""}, + {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"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Material", "ID"); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 7951f1dcc2c..d7d72659ab1 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1250,7 +1250,7 @@ static void rna_def_mtexpoly(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of UV unwrapping layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -1411,7 +1411,7 @@ static void rna_def_mloopcol(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); - RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_ui_text(prop, "Name", "Name of Vertex color layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index c9a21f7cbc1..487e850475f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -634,10 +634,10 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) static void rna_def_modifier_generic_map_info(StructRNA *srna) { static EnumPropertyItem prop_texture_coordinates_items[] = { - {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", ""}, - {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""}, - {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""}, - {MOD_DISP_MAP_UV, "UV", 0, "UV", ""}, + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", "Uses the local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Uses the global coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Uses the linked object's local coordinate system for the texture coordinates"}, + {MOD_DISP_MAP_UV, "UV", 0, "UV", "Uses UV coordinates for the texture coordinates"}, {0, NULL, 0, NULL, NULL}}; PropertyRNA *prop; @@ -659,9 +659,9 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); - RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); + RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -757,7 +757,7 @@ static void rna_def_modifier_multires(BlenderRNA *brna) prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "renderlvl"); - RNA_def_property_ui_text(prop, "Render Levels", ""); + RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range"); prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED); @@ -1023,39 +1023,39 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "lifetime"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Lifetime", ""); + RNA_def_property_ui_text(prop, "Lifetime", "Lifetime of the wave in frames, zero means infinite"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Damping Time", ""); + RNA_def_property_ui_text(prop, "Damping Time", "Number of frames in which the waves damps out after it dies"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "falloff"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); - RNA_def_property_ui_text(prop, "Falloff Radius", ""); + RNA_def_property_ui_text(prop, "Falloff Radius", "Distance after which it fades out"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "startx"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); - RNA_def_property_ui_text(prop, "Start Position X", ""); + RNA_def_property_ui_text(prop, "Start Position X", "X coordinate of the start position"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "starty"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); - RNA_def_property_ui_text(prop, "Start Position Y", ""); + RNA_def_property_ui_text(prop, "Start Position Y", "Z coordinate of the start position"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "objectcenter"); - RNA_def_property_ui_text(prop, "Start Position Object", ""); + RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1091,26 +1091,26 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -1, 1, 10, 2); - RNA_def_property_ui_text(prop, "Speed", ""); + RNA_def_property_ui_text(prop, "Speed", "Speed of the wave, towards the starting point when negative"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); - RNA_def_property_ui_text(prop, "Height", ""); + RNA_def_property_ui_text(prop, "Height", "Height of the wave"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 5, 10, 2); - RNA_def_property_ui_text(prop, "Width", ""); + RNA_def_property_ui_text(prop, "Width", "Distance between the waves"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "narrow"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10, 10, 2); - RNA_def_property_ui_text(prop, "Narrowness", ""); + RNA_def_property_ui_text(prop, "Narrowness", "Distance between the top and the base of a wave, the higher the value, the more narrow the wave"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -1132,12 +1132,12 @@ static void rna_def_modifier_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE); - RNA_def_property_ui_text(prop, "Use Bone Envelopes", ""); + RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Binds Bone envelope to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); - RNA_def_property_ui_text(prop, "Use Vertex Groups", ""); + RNA_def_property_ui_text(prop, "Use Vertex Groups", "Binds vertex group to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); @@ -1229,9 +1229,9 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_operation_items[] = { - {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", ""}, - {eBooleanModifierOp_Union, "UNION", 0, "Union", ""}, - {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", ""}, + {eBooleanModifierOp_Intersect, "INTERSECT", 0, "Intersect", "Keeps the part of the mesh that intersects with the other selected object"}, + {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combines two meshes in an additive way"}, + {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combines two meshes in a subtractive way"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BooleanModifier", "Modifier"); @@ -1257,9 +1257,9 @@ static void rna_def_modifier_array(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_fit_type_items[] = { - {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", ""}, - {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", ""}, - {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", ""}, + {MOD_ARR_FIXEDCOUNT, "FIXED_COUNT", 0, "Fixed Count", "Duplicate the object a certain number of times"}, + {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"}, + {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ArrayModifier", "Modifier"); @@ -1301,7 +1301,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "offset"); - RNA_def_property_ui_text(prop, "Constant Offset Displacement", ""); + RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE); @@ -1311,7 +1311,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); /* PROP_TRANSLATION causes units to be used which we dont want */ RNA_def_property_float_sdna(prop, NULL, "scale"); - RNA_def_property_ui_text(prop, "Relative Offset Displacement", ""); + RNA_def_property_ui_text(prop, "Relative Offset Displacement", "The size of the geometry will determine the distance between arrayed items"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Vertex merging parameters */ @@ -1340,7 +1340,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "offset_ob"); - RNA_def_property_ui_text(prop, "Object Offset", ""); + RNA_def_property_ui_text(prop, "Object Offset", "Uses the location and rotation of another object to determine the distance and rotational change between arrayed items"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1392,11 +1392,11 @@ static void rna_def_modifier_displace(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_direction_items[] = { - {MOD_DISP_DIR_X, "X", 0, "X", ""}, - {MOD_DISP_DIR_Y, "Y", 0, "Y", ""}, - {MOD_DISP_DIR_Z, "Z", 0, "Z", ""}, - {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", ""}, - {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", ""}, + {MOD_DISP_DIR_X, "X", 0, "X", "Uses the texture's intensity value to displace in the X direction"}, + {MOD_DISP_DIR_Y, "Y", 0, "Y", "Uses the texture's intensity value to displace in the Y direction"}, + {MOD_DISP_DIR_Z, "Z", 0, "Z", "Uses the texture's intensity value to displace in the Z direction"}, + {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", "Uses the texture's intensity value to displace in the normal direction"}, + {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Uses the texture's RGB values to displace the mesh in the XYZ direction"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier"); @@ -1412,7 +1412,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "midlevel"); - RNA_def_property_range(prop, 0, 1); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -1420,7 +1420,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 3); - RNA_def_property_ui_text(prop, "Strength", ""); + RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); @@ -1520,24 +1520,24 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) prop= RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X); - RNA_def_property_ui_text(prop, "X", ""); + RNA_def_property_ui_text(prop, "X", "Smooth object along X axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y); - RNA_def_property_ui_text(prop, "Y", ""); + RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z); - RNA_def_property_ui_text(prop, "Z", ""); + RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 1, 3); - RNA_def_property_ui_text(prop, "Factor", ""); + RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); @@ -1572,7 +1572,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_cast_type_items); - RNA_def_property_ui_text(prop, "Cast Type", ""); + RNA_def_property_ui_text(prop, "Cast Type", "Target object shape"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); @@ -1982,9 +1982,9 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem shrink_type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", ""}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""}, + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", "Shrinks the mesh to the nearest target surface"}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", "Shrinks the mesh to the nearest target surface along a given axis"}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrinks the mesh to the nearest target vertex"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem shrink_face_cull_items[] = { @@ -2136,10 +2136,10 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem simple_deform_mode_items[] = { - {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", ""}, - {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", ""}, - {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", ""}, - {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", ""}, + {MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", "Rotates around the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", "Bends the mesh over the Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scales along Z axis of the modifier space"}, + {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretches the object along the Z axis of the modifier space"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SimpleDeformModifier", "Modifier"); @@ -2172,7 +2172,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 1, 3); - RNA_def_property_ui_text(prop, "Factor", ""); + RNA_def_property_ui_text(prop, "Factor", "Amount to deform object"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE); @@ -2185,12 +2185,12 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X); - RNA_def_property_ui_text(prop, "Lock X Axis", ""); + RNA_def_property_ui_text(prop, "Lock X Axis", "Do not allow tapering along the X axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y); - RNA_def_property_ui_text(prop, "Lock Y Axis", ""); + RNA_def_property_ui_text(prop, "Lock Y Axis", "Do not allow tapering along the Y axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index c3ceb31fc4c..13f352a3237 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -69,14 +69,14 @@ EnumPropertyItem object_mode_items[] = { {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem parent_type_items[] = { - {PAROBJECT, "OBJECT", 0, "Object", ""}, - {PARCURVE, "CURVE", 0, "Curve", ""}, + {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, + {PARCURVE, "CURVE", 0, "Curve", "The object is parented to a curve"}, {PARKEY, "KEY", 0, "Key", ""}, {PARSKEL, "ARMATURE", 0, "Armature", ""}, - {PARSKEL, "LATTICE", 0, "Lattice", ""}, // PARSKEL reuse will give issues - {PARVERT1, "VERTEX", 0, "Vertex", ""}, + {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, // PARSKEL reuse will give issues + {PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"}, {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, - {PARBONE, "BONE", 0, "Bone", ""}, + {PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem collision_bounds_items[] = { @@ -1716,20 +1716,20 @@ static void rna_def_object(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem drawtype_items[] = { - {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", ""}, - {OB_WIRE, "WIRE", 0, "Wire", ""}, - {OB_SOLID, "SOLID", 0, "Solid", ""}, + {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"}, + {OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"}, + {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (If solid drawing is enabled in the viewport)"}, // disabled {OB_SHADED, "SHADED", 0, "Shaded", ""}, - {OB_TEXTURE, "TEXTURED", 0, "Textured", ""}, + {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (If textures are enabled in the viewport)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem boundtype_items[] = { - {OB_BOUND_BOX, "BOX", 0, "Box", ""}, - {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, - {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, - {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", ""}, - {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""}, + {OB_BOUND_BOX, "BOX", 0, "Box", "Draw bounds as box"}, + {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, + {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, + {OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"}, + {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", "Draw bounds as polyhedron"}, + {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dupli_items[] = { diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index a4fbd7c160e..6955c7f8fa8 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1055,18 +1055,18 @@ static void rna_def_field(BlenderRNA *brna) static EnumPropertyItem field_type_items[] = { {0, "NONE", 0, "None", ""}, - {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", ""}, - {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", ""}, - {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", ""}, - {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", ""}, - {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", ""}, - {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", ""}, - {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", ""}, - {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", ""}, - {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", ""}, + {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Gives a radial field toward the center of object"}, + {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", "Gives a constant force along the force object’s local Z axis"}, + {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", "Gives a spiraling force that twists the force object’s local Z axis"}, + {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", "Forcefield depends on the speed of the particles"}, + {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", "The source of this force field is the zero point of a harmonic oscillator"}, + {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", "Spherical forcefield based on the charge of particles, only influences other charge force fields"}, + {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", "Forcefield based on the Lennard-Jones potential"}, + {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", "Forcefield based on a texture"}, + {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", "Creates a force along a curve object"}, {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""}, - {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""}, - {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""}, + {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Creates turbulence with a noise field"}, + {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Creates a force that dampens motion"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem falloff_items[] = { @@ -1126,7 +1126,7 @@ static void rna_def_field(BlenderRNA *brna) prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, falloff_items); - RNA_def_property_ui_text(prop, "Fall-Off", "Fall-off shape"); + RNA_def_property_ui_text(prop, "Fall-Off", ""); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 9fd5fafc712..fa69fad253f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1682,7 +1682,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_ui_text(prop, "Type", "Particle Type"); RNA_def_property_update(prop, 0, "rna_Particle_change_type"); prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); @@ -1840,15 +1840,15 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 7); - RNA_def_property_ui_range(prop, 0, 10, 1, 0); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_range(prop, 0, 7, 1, 0); RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_step"); - RNA_def_property_range(prop, 0, 9); - RNA_def_property_ui_range(prop, 0, 20, 1, 0); + RNA_def_property_range(prop, 0, 20); + RNA_def_property_ui_range(prop, 0, 9, 1, 0); RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)"); prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE); @@ -1896,7 +1896,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, integrator_type_items); - RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type"); + RNA_def_property_ui_text(prop, "Integration", "Algorithm used to calculate physics. Fastest to most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index 08a3f174c15..9fd5610a577 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -101,11 +101,11 @@ void RNA_def_gameproperty(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem gameproperty_type_items[] ={ - {GPROP_BOOL, "BOOL", 0, "Boolean", ""}, - {GPROP_INT, "INT", 0, "Integer", ""}, - {GPROP_FLOAT, "FLOAT", 0, "Float", ""}, - {GPROP_STRING, "STRING", 0, "String", ""}, - {GPROP_TIME, "TIMER", 0, "Timer", ""}, + {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"}, + {GPROP_INT, "INT", 0, "Integer", "Integer Property"}, + {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, + {GPROP_STRING, "STRING", 0, "String", "String Property"}, + {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"}, {0, NULL, 0, NULL, NULL}}; /* Base Struct for GameProperty */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 47988e3b383..bc429f47c3f 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -69,13 +69,13 @@ EnumPropertyItem snap_target_items[] = { {0, NULL, 0, NULL, NULL}}; EnumPropertyItem proportional_falloff_items[] ={ - {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, - {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, - {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, - {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, - {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", ""}, - {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", ""}, - {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, + {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"}, + {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"}, + {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"}, + {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"}, + {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"}, + {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Consant falloff"}, + {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"}, {0, NULL, 0, NULL, NULL}}; @@ -102,54 +102,54 @@ EnumPropertyItem snap_element_items[] = { EnumPropertyItem image_type_items[] = { {0, "", 0, "Image", NULL}, - {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""}, + {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, #ifdef WITH_DDS - {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, + {R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, #endif - {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""}, - {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""}, - {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""}, + {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in (old!) SGI IRIS format"}, + {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, + {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, #ifdef WITH_OPENJPEG - {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""}, + {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", "Output image in JPEG 2000 format"}, #endif - {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""}, - {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""}, + {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, + {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", "Output image in uncompressed Targa format"}, {0, "", 0, " ", NULL}, #ifdef WITH_CINEON - {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""}, - {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""}, + {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"}, + {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, #endif #ifdef WITH_OPENEXR - {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""}, - {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""}, + {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, + {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, #endif #ifdef WITH_HDR - {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""}, + {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", "Output image in Radiance HDR format"}, #endif #ifdef WITH_TIFF - {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, + {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, #endif {0, "", 0, "Movie", NULL}, #ifdef _WIN32 - {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, // XXX Missing codec menu + {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", "Output video in AVI format"}, // XXX Missing codec menu #endif - {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""}, - {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""}, - {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""}, + {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"}, + {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"}, + {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"}, #ifdef WITH_FFMPEG - {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""}, - {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""}, - {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""}, + {R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"}, + {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"}, + {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", "Output video in Ogg format"}, #endif #ifdef WITH_QUICKTIME # ifdef USE_QTKIT - {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", ""}, + {R_QUICKTIME, "QUICKTIME_QTKIT", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"}, # else - {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", ""}, + {R_QUICKTIME, "QUICKTIME_CARBON", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"}, # endif #endif #ifdef WITH_FFMPEG - {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""}, + {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", "Output video in Xvid format"}, #endif {0, NULL, 0, NULL, NULL}}; @@ -1330,7 +1330,7 @@ static void rna_def_unit_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem rotation_units[] = { - {0, "DEGREES", 0, "Degrees", ""}, + {0, "DEGREES", 0, "Degrees", "Use degrees for measuring rotation"}, {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""}, {0, NULL, 0, NULL, NULL}}; @@ -1661,12 +1661,12 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem physics_engine_items[] = { - {WOPHY_NONE, "NONE", 0, "None", ""}, + {WOPHY_NONE, "NONE", 0, "None", "Don't use a physics engine"}, //{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, //{WOPHY_ODE, "ODE", 0, "ODE", ""}, - {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, + {WOPHY_BULLET, "BULLET", 0, "Bullet", "Use the Bullet physics engine"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem material_items[] ={ @@ -1971,13 +1971,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pixel_filter_items[] ={ - {R_FILTER_BOX, "BOX", 0, "Box", ""}, - {R_FILTER_TENT, "TENT", 0, "Tent", ""}, - {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""}, - {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""}, - {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""}, - {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""}, - {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""}, + {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"}, + {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"}, + {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", "Use a quadratic filter for anti-aliasing"}, + {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", "Use a cubic filter for anti-aliasing"}, + {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", "Use a Catmull-Rom filter for anti-aliasing"}, + {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", "Use a Gaussian filter for anti-aliasing"}, + {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem alpha_mode_items[] ={ @@ -2001,19 +2001,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* Bake */ static EnumPropertyItem bake_mode_items[] ={ - {RE_BAKE_ALL, "FULL", 0, "Full Render", ""}, - {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""}, - {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""}, - {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""}, - {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""}, - {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""}, + {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"}, + {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"}, + {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", "Bake shadows"}, + {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"}, + {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", "Bake textures"}, + {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem bake_normal_space_items[] ={ - {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""}, - {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""}, - {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""}, - {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""}, + {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", "Bake the normals in camera space"}, + {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", "Bake the normals in world space"}, + {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"}, + {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem bake_qyad_split_items[] ={ @@ -2030,12 +2030,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem raytrace_structure_items[] = { - {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""}, + {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", "Automatically select acceleration structure"}, {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure"}, {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"}, - {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""}, - {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""}, - {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""}, + {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", "Use vBVH"}, + {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", "Use SIMD SVBVH"}, + {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", "Use SIMD QBVH"}, {0, NULL, 0, NULL, NULL} }; @@ -2164,7 +2164,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) #endif static EnumPropertyItem engine_items[] = { - {0, "BLENDER_RENDER", 0, "Blender Render", ""}, + {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RenderSettings", NULL); @@ -2605,7 +2605,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "edgeR"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Edge Color", ""); + RNA_def_property_ui_text(prop, "Edge Color", "Edge color"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); /* threads */ @@ -3224,7 +3224,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "r.cfra"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL); - RNA_def_property_ui_text(prop, "Current Frame", ""); + RNA_def_property_ui_text(prop, "Current Frame", "Current Frame"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 34963e9507f..90ae95894b0 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -387,6 +387,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) return &RNA_EffectSequence; case SEQ_MULTICAM: return &RNA_MulticamSequence; + case SEQ_ADJUSTMENT: + return &RNA_AdjustmentSequence; case SEQ_PLUGIN: return &RNA_PluginSequence; case SEQ_WIPE: @@ -844,6 +846,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_COLOR, "COLOR", 0, "Color", ""}, {SEQ_SPEED, "SPEED", 0, "Speed", ""}, {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""}, + {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""}, {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem blend_mode_items[]= { @@ -1371,6 +1374,20 @@ static void rna_def_multicam(BlenderRNA *brna) rna_def_input(srna); } +static void rna_def_adjustment(BlenderRNA *brna) +{ + StructRNA *srna; +// PropertyRNA *prop; + + srna = RNA_def_struct(brna, "AdjustmentSequence", "Sequence"); + RNA_def_struct_ui_text(srna, "Adjustment Layer Sequence", "Sequence strip to perform filter adjustments to layers below"); + RNA_def_struct_sdna(srna, "Sequence"); + + rna_def_filter_video(srna); + rna_def_proxy(srna); + rna_def_input(srna); +} + static void rna_def_plugin(BlenderRNA *brna) { StructRNA *srna; @@ -1620,6 +1637,7 @@ void RNA_def_sequencer(BlenderRNA *brna) rna_def_sound(brna); rna_def_effect(brna); rna_def_multicam(brna); + rna_def_adjustment(brna); rna_def_plugin(brna); rna_def_wipe(brna); rna_def_glow(brna); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5281e152d54..2dbbb29f174 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -76,9 +76,6 @@ static EnumPropertyItem draw_channels_items[] = { {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"}, {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"}, {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"}, -#ifdef WITH_LCMS - {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image"}, -#endif {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem transform_orientation_items[] = { @@ -426,7 +423,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value { RegionView3D *rv3d= (RegionView3D *)(ptr->data); negate_v3_v3(rv3d->ofs, values); - view3d_apply_mat4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); + ED_view3d_from_m4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); } /* Space Image Editor */ @@ -498,10 +495,6 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF); } -#ifdef WITH_LCMS - RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_CORRECTION); -#endif - RNA_enum_item_end(&item, &totitem); *free= 1; @@ -1038,18 +1031,18 @@ static void rna_def_space_outliner(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem display_mode_items[] = { - {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""}, - {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""}, - {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""}, - {SO_SELECTED, "SELECTED", 0, "Selected", ""}, - {SO_ACTIVE, "ACTIVE", 0, "Active", ""}, - {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""}, - {SO_GROUPS, "GROUPS", 0, "Groups", ""}, - {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""}, - {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""}, - {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""}, - {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""}, - {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""}, + {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display datablocks in all scenes"}, + {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display datablocks in current scene"}, + {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display datablocks in visible layers"}, + {SO_SELECTED, "SELECTED", 0, "Selected", "Display datablocks of selected objects"}, + {SO_ACTIVE, "ACTIVE", 0, "Active", "Display datablocks of active object"}, + {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", "Display datablocks of all objects of same type as selected object"}, + {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their datablocks"}, + {SO_LIBRARIES, "LIBRARIES", 0, "Libraries", "Display libraries"}, + {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence datablocks"}, + {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"}, + {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"}, + {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceOutliner", "Space"); @@ -1091,20 +1084,20 @@ static void rna_def_background_image(BlenderRNA *brna) /* note: combinations work but dont flip so arnt that useful */ static EnumPropertyItem bgpic_axis_items[] = { {0, "", 0, "X Axis", ""}, - {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", ""}, - {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", ""}, + {(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"}, + {(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"}, /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/ {0, "", 0, "Y Axis", ""}, - {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", ""}, - {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", ""}, + {(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"}, + {(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"}, /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/ {0, "", 0, "Z Axis", ""}, - {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", ""}, - {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", ""}, + {(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"}, + {(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"}, /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/ {0, "", 0, "Other", ""}, - {0, "ALL", 0, "All Views", ""}, - {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", ""}, + {0, "ALL", 0, "All Views", "Show background image in all views"}, + {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BackgroundImage", NULL); @@ -1166,11 +1159,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) const int matrix_dimsize[]= {4, 4}; static EnumPropertyItem pivot_items[] = { - {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""}, - {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", ""}, - {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", ""}, - {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", ""}, - {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""}, + {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", "Pivot around bounding box center of selected object(s)"}, + {V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"}, + {V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"}, + {V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"}, + {V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem rv3d_persp_items[] = { @@ -1230,7 +1223,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "near"); - RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); @@ -1298,6 +1291,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA); + RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE); RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered"); @@ -1874,10 +1872,10 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""}, - {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""}, - {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, - {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, + {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", "DopeSheet Editor"}, + {SACTCONT_ACTION, "ACTION", 0, "Action Editor", "Action Editor"}, + {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", "ShapeKey Editor"}, + {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", "Grease Pencil"}, {0, NULL, 0, NULL, NULL}}; @@ -1956,8 +1954,8 @@ static void rna_def_space_graph(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mode_items[] = { - {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", ""}, - {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""}, + {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", "Edit f-curves"}, + {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", "Edit drivers"}, {0, NULL, 0, NULL, NULL}}; /* this is basically the same as the one for the 3D-View, but with some entries ommitted */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index fc74fc7268d..a750fa3765f 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -56,21 +56,21 @@ EnumPropertyItem texture_filter_items[] = { EnumPropertyItem texture_type_items[] = { {0, "NONE", 0, "None", ""}, - {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", ""}, - {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", ""}, - {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", ""}, - {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", ""}, - {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", ""}, - {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", ""}, - {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""}, - {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", ""}, - {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", ""}, + {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - Creates a ramp texture"}, + {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - Creates a cloud-like fractal noise texture"}, + {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"}, + {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", "Creates a render of the environment mapped to a texture"}, + {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allows for images or movies to be used as textures"}, + {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - Color texture based on trigonometric functions"}, + {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - Marble-like noise texture with wave generated bands"}, + {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - Highly flexible fractal noise texture"}, + {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"}, //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, - {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", ""}, - {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", ""}, - {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", ""}, - {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", ""}, + {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Creates a fractal noise texture"}, + {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Creates cell-like patterns based on Worley noise"}, + {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Creates a 3d texture based on volumetric data"}, + {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -509,7 +509,7 @@ static void rna_def_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendtype"); RNA_def_property_enum_items(prop, prop_blend_type_items); - RNA_def_property_ui_text(prop, "Blend Type", ""); + RNA_def_property_ui_text(prop, "Blend Type", "The mode used to apply the texture"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE); @@ -627,7 +627,7 @@ static void rna_def_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); - RNA_def_property_range(prop, 0.01, FLT_MAX); + RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.01, 50, 100, 2); RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map"); RNA_def_property_update(prop, 0, "rna_Texture_update"); @@ -665,21 +665,21 @@ static void rna_def_environment_map(BlenderRNA *brna) } static EnumPropertyItem prop_noise_basis_items[] = { - {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", ""}, - {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", ""}, - {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", ""}, - {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""}, - {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""}, - {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""}, - {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""}, - {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""}, - {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""}, - {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", ""}, + {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"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_noise_type[] = { - {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", ""}, - {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", ""}, + {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", "Generate soft noise (smooth transitions)"}, + {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", "Generate hard noise (sharp transitions)"}, {0, NULL, 0, NULL, NULL}}; @@ -726,7 +726,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna) prop= RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_clouds_stype); - RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_ui_text(prop, "Color", "Determines whether Noise returns grayscale or RGB values"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); @@ -1195,11 +1195,11 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_musgrave_type[] = { - {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""}, - {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""}, - {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""}, - {TEX_FBM, "FBM", 0, "fBM", ""}, - {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""}, + {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"}, + {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"}, + {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"}, + {TEX_FBM, "FBM", 0, "fBM", "Fractal noise algorithm. Fractal Brownian Motion: Uses Brownian noise as a basis"}, + {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Fractal noise algorithm. Hetero Terrain: similar to multifractal"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); @@ -1245,7 +1245,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Noise Intensity", ""); + RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1274,13 +1274,13 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_distance_metric_items[] = { - {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", ""}, - {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""}, - {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""}, - {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""}, - {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""}, - {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""}, - {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""}, + {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "Algorithm used to calculate distance of sample points to feature points. Actual Distance: sqrt(x*x+y*y+z*z)"}, + {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "Algorithm used to calculate distance of sample points to feature points. Distance squared: (x*x+y*y+z*z)"}, + {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", "Algorithm used to calculate distance of sample points to feature points. Manhattan: The length of the distance in axial directions"}, + {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "Algorithm used to calculate distance of sample points to feature points. Chebychev: The length of the longest Axial journey"}, + {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", "Algorithm used to calculate distance of sample points to feature points. Minovsky 1/2: Sets Minkovsky variable to 0.5"}, + {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", "Algorithm used to calculate distance of sample points to feature points. Minkovsky 4: Sets Minkovsky variable to 4"}, + {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", "Algorithm used to calculate distance of sample points to feature points. Minkovsky: Uses the Minkowsky function to calculate distance. Exponent value determines the shape of the boundaries"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_coloring_items[] = { @@ -1340,7 +1340,7 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0.01, 10); - RNA_def_property_ui_text(prop, "Noise Intensity", ""); + RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1369,7 +1369,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist_amount"); RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "Distortion Amount", ""); + RNA_def_property_ui_text(prop, "Distortion Amount", "Amount of distortion"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); @@ -1550,7 +1550,6 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_fac"); RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Strength", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); @@ -1737,17 +1736,17 @@ static void rna_def_texture(BlenderRNA *brna) prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bright"); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Brightness", ""); + RNA_def_property_ui_text(prop, "Brightness", "Adjusts the brightness of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 5); - RNA_def_property_ui_text(prop, "Contrast", ""); + RNA_def_property_ui_text(prop, "Contrast", "Adjusts the contrast of the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 2); - RNA_def_property_ui_text(prop, "Saturation", ""); + RNA_def_property_ui_text(prop, "Saturation", "Adjusts the saturation of colors in the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); /* RGB Factor */ diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index d48c1d35c13..b5c6de679b2 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -622,7 +622,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_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + 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", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); @@ -741,7 +741,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_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + 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", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 7166d51da5a..064f28df85d 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -223,7 +223,7 @@ static void rna_def_lighting(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_sample_method_items[] = { - {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, + {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", "Fastest and gives the most noise"}, {WO_AOSAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", "Fast in high-contrast areas"}, {WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", "Best quality"}, {0, NULL, 0, NULL, NULL}}; @@ -314,7 +314,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aodistfac"); - RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the less influence farther away objects have influence"); + RNA_def_property_ui_text(prop, "Strength", "Attenuation falloff strength, the higher, the less influence distant objects have"); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE); @@ -350,7 +350,7 @@ static void rna_def_lighting(BlenderRNA *brna) prop= RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST); - RNA_def_property_ui_text(prop, "Falloff", ""); + RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate shadows"); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE); @@ -515,7 +515,7 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Ambient Color", ""); + RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); RNA_def_property_update(prop, 0, "rna_World_update"); /* exp, range */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index e624768c86e..745ae0ae47e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1328,10 +1328,20 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev /* op->poll */ static int wm_search_menu_poll(bContext *C) { - if(CTX_wm_window(C)==NULL) return 0; - if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console - if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor - if(CTX_data_edit_object(C) && CTX_data_edit_object(C)->type==OB_FONT) return 0; // XXX - so we can use the spacebar for entering text + if(CTX_wm_window(C)==NULL) { + return 0; + } + else { + ScrArea *sa= CTX_wm_area(C); + if(sa) { + if(sa->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console + if(sa->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor + } + else { + Object *editob= CTX_data_edit_object(C); + if(editob && editob->type==OB_FONT) return 0; // XXX - so we can use the spacebar for entering text + } + } return 1; } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 3fc25dc4f14..fff219babd2 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -262,6 +262,7 @@ void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} +void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist){} void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist){} int text_file_modified(struct Text *text){return 0;} void ED_node_shader_default(struct Material *ma){} diff --git a/source/creator/creator.c b/source/creator/creator.c index a29a5d50929..2b2e30d5756 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -154,7 +154,7 @@ char btempdir[FILE_MAX]; #define BLEND_VERSION_STRING_FMT "Blender %d.%02d (sub %d)\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION -/* Initialise callbacks for the modules that need them */ +/* Initialize callbacks for the modules that need them */ static void setCallbacks(void); /* set breakpoints here when running in debug mode, useful to catch floating point errors */ @@ -341,18 +341,6 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) double PIL_check_seconds_timer(void); -/* XXX This was here to fix a crash when running python scripts - * with -P that used the screen. - * - * static void main_init_screen( void ) -{ - setscreen(G.curscreen); - - if(G.main->scene.first==0) { - set_scene( add_scene("1") ); - } -}*/ - void segmentation_handler(int UNUSED(sig)) { char fname[256]; diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 571cc9087b3..4789155dced 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -427,6 +427,13 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c { // first check if we want to exit exitrequested = ketsjiengine->GetExitCode(); + + // Clear screen to border color + // We do this here since we set the canvas to be within the frames. This means the engine + // itself is unaware of the extra space, so we clear the whole region for it. + glClearColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 1.0f); + glViewport(ar->winrct.xmin, ar->winrct.ymin, ar->winrct.xmax, ar->winrct.ymax); + glClear(GL_COLOR_BUFFER_BIT); // kick the engine bool render = ketsjiengine->NextFrame(); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 230dd9dca03..0e0f617bddf 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -460,7 +460,9 @@ bool ConvertMaterial( } } } - material->flag[i] |= (mat->ipo!=0)?HASIPO:0; +#if 0 /* this flag isnt used anymore */ + material->flag[i] |= (BKE_animdata_from_id(mat->id) != NULL) ? HASIPO : 0; +#endif /// -------------------------------- // mapping methods material->mapping[i].mapping |= ( mttmp->texco & TEXCO_REFL )?USEREFL:0; @@ -835,6 +837,12 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, else ma = mesh->mat ? mesh->mat[mface->mat_nr]:NULL; + /* ckeck for texface since texface _only_ is used as a fallback */ + if(ma == NULL && tface == NULL) { + extern Material defmaterial; /* material.c */ + ma= &defmaterial; + } + { bool visible = true; bool twoside = false; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 126135f3d46..ef25c9218a3 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -144,7 +144,7 @@ enum BL_flag USEALPHA=4, // use actual alpha channel TEXALPHA=8, // use alpha combiner functions TEXNEG=16, // negate blending - HASIPO=32, + /*HASIPO=32,*/ // unused, commeted for now. USENEGALPHA=64 }; |