diff options
Diffstat (limited to 'release/scripts')
71 files changed, 1138 insertions, 606 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index ab68c9424cd..7e604c5de4c 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -311,7 +311,7 @@ def disable(module_name, default_set=True): # possible this addon is from a previous session and didn't load a # module this time. So even if the module is not found, still disable # the addon in the user prefs. - if mod: + if mod and getattr(mod, "__addon_enabled__", False) is not False: mod.__addon_enabled__ = False mod.__addon_persistent = False @@ -323,7 +323,8 @@ def disable(module_name, default_set=True): import traceback traceback.print_exc() else: - print("addon_utils.disable", module_name, "not loaded") + print("addon_utils.disable: %s not %s." % + (module_name, "disabled" if mod is None else "loaded")) # could be in more then once, unlikely but better do this just in case. addons = _bpy.context.user_preferences.addons diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py index 33d3be63b0b..7e9266d0530 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py +++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py @@ -33,8 +33,7 @@ from bl_i18n_utils import settings SOURCE_DIR = settings.SOURCE_DIR -CUSTOM_PY_UI_FILES = [os.path.abspath(os.path.join(SOURCE_DIR, p)) - for p in settings.CUSTOM_PY_UI_FILES] +CUSTOM_PY_UI_FILES = [os.path.abspath(os.path.join(SOURCE_DIR, p)) for p in settings.CUSTOM_PY_UI_FILES] FILE_NAME_MESSAGES = settings.FILE_NAME_MESSAGES COMMENT_PREFIX = settings.COMMENT_PREFIX CONTEXT_PREFIX = settings.CONTEXT_PREFIX @@ -64,8 +63,7 @@ def check(check_ctxt, messages, key, msgsrc): if key in py_in_rna[1]: py_in_rna[0].add(key) if not_capitalized is not None: - if(key[1] not in NC_ALLOWED and key[1][0].isalpha() and - not key[1][0].isupper()): + if(key[1] not in NC_ALLOWED and key[1][0].isalpha() and not key[1][0].isupper()): not_capitalized.add(key) if end_point is not None: if key[1].strip().endswith('.'): @@ -81,11 +79,9 @@ def dump_messages_rna(messages, check_ctxt): def classBlackList(): blacklist_rna_class = [ # core classes - "Context", "Event", "Function", "UILayout", - "BlendData", + "Context", "Event", "Function", "UILayout", "BlendData", # registerable classes - "Panel", "Menu", "Header", "RenderEngine", - "Operator", "OperatorMacro", "Macro", + "Panel", "Menu", "Header", "RenderEngine", "Operator", "OperatorMacro", "Macro", "KeyingSetInfo", "UnknownType", # window classes "Window", @@ -97,28 +93,22 @@ def dump_messages_rna(messages, check_ctxt): # extend with all internal operators # note that this uses internal api introspection functions # all possible operator names - op_ids = set(cls.bl_rna.identifier for cls in - bpy.types.OperatorProperties.__subclasses__()) | \ - set(cls.bl_rna.identifier for cls in - bpy.types.Operator.__subclasses__()) | \ - set(cls.bl_rna.identifier for cls in - bpy.types.OperatorMacro.__subclasses__()) + op_ids = set(cls.bl_rna.identifier for cls in bpy.types.OperatorProperties.__subclasses__()) | \ + set(cls.bl_rna.identifier for cls in bpy.types.Operator.__subclasses__()) | \ + set(cls.bl_rna.identifier for cls in bpy.types.OperatorMacro.__subclasses__()) get_instance = __import__("_bpy").ops.get_instance path_resolve = type(bpy.context).__base__.path_resolve for idname in op_ids: op = get_instance(idname) - # XXX Do not skip INTERNAL's anymore, some of those ops - # show up in UI now! + # XXX Do not skip INTERNAL's anymore, some of those ops show up in UI now! # if 'INTERNAL' in path_resolve(op, "bl_options"): # blacklist_rna_class.append(idname) # --------------------------------------------------------------------- # Collect builtin classes we don't need to doc blacklist_rna_class.append("Property") - blacklist_rna_class.extend( - [cls.__name__ for cls in - bpy.types.Property.__subclasses__()]) + blacklist_rna_class.extend([cls.__name__ for cls in bpy.types.Property.__subclasses__()]) # --------------------------------------------------------------------- # Collect classes which are attached to collections, these are api @@ -252,6 +242,12 @@ def dump_messages_rna(messages, check_ctxt): cls_list.sort(key=full_class_id) processed = 0 for cls in cls_list: + # XXX translation_context of Operator sub-classes are not "good"! + # So ignore those Operator sub-classes (anyway, will get the same from OperatorProperties + # sub-classes!)... + if issubclass(cls, bpy.types.Operator): + continue + walkClass(cls) # classes.add(cls) # Recursively process subclasses. @@ -298,7 +294,7 @@ def dump_messages_pytext(messages, check_ctxt): # check it has a 'text' argument for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()): if ((arg_kw in translate_kw) and - (arg.is_output == False) and + (arg.is_output is False) and (arg.type == 'STRING')): func_translate_args.setdefault(func_id, []).append((arg_kw, @@ -389,6 +385,7 @@ def dump_messages_pytext(messages, check_ctxt): def dump_messages(do_messages, do_checks): import collections + import re def enable_addons(): """For now, enable all official addons, before extracting msgids.""" @@ -419,21 +416,8 @@ def dump_messages(do_messages, do_checks): getattr(cat, op).get_rna() # check for strings like ": %d" - ignore = ("%d", "%f", "%s", "%r", # string formatting - "*", ".", "(", ")", "-", "/", "\\", "+", ":", "#", "%" - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - "x", # used on its own eg: 100x200 - "X", "Y", "Z", "W", # used alone. no need to include - ) - - def filter_message(msg): - msg_tmp = msg - for ign in ignore: - msg_tmp = msg_tmp.replace(ign, "") - if not msg_tmp.strip(): - return True - # we could filter out different strings here - return False + ignore_reg = re.compile(r"^(?:[-*.()/\\+:%xWXYZ0-9]|%d|%f|%s|%r|\s)*$") + filter_message = ignore_reg.match messages = getattr(collections, 'OrderedDict', dict)() @@ -503,7 +487,7 @@ def dump_messages(do_messages, do_checks): message_file.write(key.replace("\n", "") + "\n") num_written += 1 - print("Written {} messages to: {} ({} were filtered out)." \ + print("Written {} messages to: {} ({} were filtered out)." "".format(num_written, FILE_NAME_MESSAGES, num_filtered)) @@ -516,17 +500,13 @@ def main(): import sys back_argv = sys.argv + # Get rid of Blender args! sys.argv = sys.argv[sys.argv.index("--") + 1:] import argparse - parser = argparse.ArgumentParser(description="Process UI messages " \ - "from inside Blender.") - parser.add_argument('-c', '--no_checks', default=True, - action="store_false", - help="No checks over UI messages.") - parser.add_argument('-m', '--no_messages', default=True, - action="store_false", - help="No export of UI messages.") + parser = argparse.ArgumentParser(description="Process UI messages from inside Blender.") + parser.add_argument('-c', '--no_checks', default=True, action="store_false", help="No checks over UI messages.") + parser.add_argument('-m', '--no_messages', default=True, action="store_false", help="No export of UI messages.") parser.add_argument('-o', '--output', help="Output messages file path.") args = parser.parse_args() diff --git a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py index a15bea9ef0d..533dded3c57 100755 --- a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py +++ b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py @@ -39,6 +39,8 @@ except: TRUNK_PO_DIR = settings.TRUNK_PO_DIR BRANCHES_DIR = settings.BRANCHES_DIR +IMPORT_LANGUAGES_SKIP = settings.IMPORT_LANGUAGES_SKIP + RTL_PREPROCESS_FILE = settings.RTL_PREPROCESS_FILE PY3 = settings.PYTHON3_EXEC @@ -63,7 +65,7 @@ def main(): threshold = float(args.threshold) / 100.0 for lang in os.listdir(BRANCHES_DIR): - if args.langs and lang not in args.langs: + if (args.langs and lang not in args.langs) or lang in IMPORT_LANGUAGES_SKIP: continue po = os.path.join(BRANCHES_DIR, lang, ".".join((lang, "po"))) if os.path.exists(po): diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py index d323dd37979..0db3f85f1ff 100644 --- a/release/scripts/modules/bl_i18n_utils/settings.py +++ b/release/scripts/modules/bl_i18n_utils/settings.py @@ -31,10 +31,67 @@ import os.path # MISC ############################################################################### +# The languages defined in Blender. +LANGUAGES_CATEGORIES = ( + # Min completeness level, UI english label. + ( 0.95, "Complete"), + ( 0.33, "In Progress"), + ( -1.0, "Starting"), +) +LANGUAGES = ( + # ID, UI english label, ISO code. + ( 0, "Default (Default)", "DEFAULT", ""), + ( 1, "English (English)", "en_US", "english"), + ( 2, "Japanese (日本語)", "ja_JP", "japanese"), + ( 3, "Dutch (Nederlandse taal)", "nl_NL", "dutch"), + ( 4, "Italian (Italiano)", "it_IT", "italian"), + ( 5, "German (Deutsch)", "de_DE", "german"), + ( 6, "Finnish (Suomi)", "fi_FI", "finnish"), + ( 7, "Swedish (Svenska)", "sv_SE", "swedish"), + ( 8, "French (Français)", "fr_FR", "french"), + ( 9, "Spanish (Español)", "es", "spanish"), + (10, "Catalan (Català)", "ca_AD", "catalan"), + (11, "Czech (Český)", "cs_CZ", "czech"), + (12, "Portuguese (Português)", "pt_PT", "portuguese_portugal"), + (13, "Simplified Chinese (简体中文)", "zh_CN", "Chinese (Simplified)_China.1252"), + (14, "Traditional Chinese (繁體中文)", "zh_TW", "Chinese (Traditional)_China.1252"), + (15, "Russian (Русский)", "ru_RU", "russian"), + (16, "Croatian (Hrvatski)", "hr_HR", "croatian"), + (17, "Serbian (Српски)", "sr_RS", "serbian"), + (18, "Ukrainian (Український)", "uk_UA", "ukrainian"), + (19, "Polish (Polski)", "pl_PL", "polish"), + (20, "Romanian (Român)", "ro_RO", "romanian"), + # Using the utf8 flipped form of Arabic (العربية). + (21, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG", "arabic"), + (22, "Bulgarian (Български)", "bg_BG", "bulgarian"), + (23, "Greek (Ελληνικά)", "el_GR", "greek"), + (24, "Korean (한국 언어)", "ko_KR", "korean"), + (25, "Nepali (नेपाली)", "ne_NP", "nepali"), + # Using the utf8 flipped form of Persian (فارسی). + (26, "Persian (ﯽﺳﺭﺎﻓ)", "fa_IR", "farsi"), + (27, "Indonesian (Bahasa indonesia)", "id_ID", "indonesian"), + (28, "Serbian Latin (Srpski latinica)", "sr_RS@latin", "serbian (latin)"), + (29, "Kyrgyz (Кыргыз тили)", "ky_KG", "kyrgyz"), + (30, "Turkish (Türkçe)", "tr_TR", "turkish"), + (31, "Hungarian (Magyar)", "hu_HU", "hungarian"), + (32, "Brazilian Portuguese (Português do Brasil)", "pt_BR", "protuguese_brazil"), + # Using the utf8 flipped form of Hebrew (עִבְרִית)). + (33, "Hebrew (תירִבְעִ)", "he_IL", "hebrew"), + (34, "Estonian (Eestlane)", "et_EE", "estonian"), + (35, "Esperanto (Esperanto)", "eo", "esperanto"), + (36, "Spanish from Spain (Español de España)", "es_ES", "spanish_spain"), +) + +# Name of language file used by Blender to generate translations' menu. +LANGUAGES_FILE = "languages" + # The min level of completeness for a po file to be imported from /branches # into /trunk, as a percentage. -1 means "import everything". IMPORT_MIN_LEVEL = -1 +# Languages in /branches we do not want to import in /trunk currently... +IMPORT_LANGUAGES_SKIP = {'bg', 'ca', 'fi', 'el', 'ko', 'ne', 'pl', 'ro'} + # The comment prefix used in generated messages.txt file. COMMENT_PREFIX = "#~ " @@ -97,12 +154,22 @@ _msg_re = r"(?P<msg_raw>" + _str_whole_re.format(_="_msg") + r")" PYGETTEXT_KEYWORDS = (() + tuple((r"{}\(\s*" + _msg_re + r"\s*\)").format(it) for it in ("IFACE_", "TIP_", "N_")) + + tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it) - for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) + for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) + + + tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it) + for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) + + + tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*,").format(it) + for it in ("BMO_error_raise",)) + + + tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it) + for it in ("modifier_setError",)) ) ESCAPE_RE = ( - ('((?<!\\\\)"|(?<!\\\\)\\\\(?!\\\\|"))', r"\\\1"), + (r'((?<!\\)"|(?<!\\)\\(?!\\|"))', r"\\\1"), ('\t', r"\\t"), ) @@ -136,37 +203,8 @@ WARN_MSGID_NOT_CAPITALIZED_ALLOWED = { "iTaSC parameters", "vBVH", "rv", - "en_US", - "fr_FR", - "it_IT", - "ru_RU", - "zh_CN", - "es", - "zh_TW", - "ar_EG", - "pt", - "bg_BG", - "ca_AD", - "hr_HR", - "cs_CZ", - "nl_NL", - "fi_FI", - "de_DE", - "el_GR", - "id_ID", - "ja_JP", - "ky_KG", - "ko_KR", - "ne_NP", - "fa_IR", - "pl_PL", - "ro_RO", - "sr_RS", - "sr_RS@latin", - "sv_SE", - "uk_UA", - "tr_TR", - "hu_HU", + "et_EE", + "eo", "available with", # Is part of multi-line msg. "virtual parents", # Is part of multi-line msg. "description", # Addons' field. :/ @@ -178,6 +216,7 @@ WARN_MSGID_NOT_CAPITALIZED_ALLOWED = { "p0", "res", } +WARN_MSGID_NOT_CAPITALIZED_ALLOWED |= set(lng[2] for lng in LANGUAGES) ############################################################################### @@ -192,47 +231,35 @@ TOOLS_DIR = os.path.join(os.path.dirname(__file__)) PYTHON3_EXEC = "python3" # The Blender executable! -# This is just an example, you’ll most likely have to edit it in your -# user_settings.py! -BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", - "blender")) +# This is just an example, you’ll most likely have to edit it in your user_settings.py! +BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "blender")) -# The xgettext tool. You’ll likely have to edit it in your user_settings.py -# if you’re under Windows. +# The xgettext tool. You’ll likely have to edit it in your user_settings.py if you’re under Windows. GETTEXT_XGETTEXT_EXECUTABLE = "xgettext" -# The gettext msgmerge tool. You’ll likely have to edit it in your -# user_settings.py if you’re under Windows. +# The gettext msgmerge tool. You’ll likely have to edit it in your user_settings.py if you’re under Windows. GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge" -# The gettext msgfmt "compiler". You’ll likely have to edit it in your -# user_settings.py if you’re under Windows. +# The gettext msgfmt "compiler". You’ll likely have to edit it in your user_settings.py if you’re under Windows. GETTEXT_MSGFMT_EXECUTABLE = "msgfmt" -# The svn binary... You’ll likely have to edit it in your -# user_settings.py if you’re under Windows. +# The svn binary... You’ll likely have to edit it in your user_settings.py if you’re under Windows. SVN_EXECUTABLE = "svn" # The FriBidi C compiled library (.so under Linux, .dll under windows...). -# You’ll likely have to edit it in your user_settings.py if you’re under -# Windows., e.g. using the included one: +# You’ll likely have to edit it in your user_settings.py if you’re under Windows., e.g. using the included one: # FRIBIDI_LIB = os.path.join(TOOLS_DIR, "libfribidi.dll") FRIBIDI_LIB = "libfribidi.so.0" -# The name of the (currently empty) file that must be present in a po's -# directory to enable rtl-preprocess. +# The name of the (currently empty) file that must be present in a po's directory to enable rtl-preprocess. RTL_PREPROCESS_FILE = "is_rtl" # The Blender source root path. -# This is just an example, you’ll most likely have to override it in your -# user_settings.py! -SOURCE_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", - "..", "..", "blender_msgs")) +# This is just an example, you’ll most likely have to override it in your user_settings.py! +SOURCE_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "..", "..", "blender_msgs")) -# The bf-translation repository (you'll likely have to override this in your -# user_settings.py). -I18N_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", - "..", "..", "i18n")) +# The bf-translation repository (you'll likely have to override this in your user_settings.py). +I18N_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "..", "..", "i18n")) # The /branches path (overriden in bf-translation's i18n_override_settings.py). BRANCHES_DIR = os.path.join(I18N_DIR, "branches") @@ -252,12 +279,10 @@ FILE_NAME_MESSAGES = os.path.join(TRUNK_PO_DIR, "messages.txt") # The Blender source path to check for i18n macros. POTFILES_SOURCE_DIR = os.path.join(SOURCE_DIR, "source") -# The "source" file storing which files should be processed by xgettext, -# used to create FILE_NAME_POTFILES +# The "source" file storing which files should be processed by xgettext, used to create FILE_NAME_POTFILES FILE_NAME_SRC_POTFILES = os.path.join(TRUNK_PO_DIR, "_POTFILES.in") -# The final (generated) file storing which files -# should be processed by xgettext. +# The final (generated) file storing which files should be processed by xgettext. FILE_NAME_POTFILES = os.path.join(TRUNK_PO_DIR, "POTFILES.in") # The template messages file. @@ -265,9 +290,7 @@ FILE_NAME_POT = os.path.join(TRUNK_PO_DIR, ".".join((DOMAIN, "pot"))) # Other py files that should be searched for ui strings, relative to SOURCE_DIR. # Needed for Cycles, currently... -CUSTOM_PY_UI_FILES = [os.path.join("intern", "cycles", "blender", - "addon", "ui.py"), - ] +CUSTOM_PY_UI_FILES = [os.path.join("intern", "cycles", "blender", "addon", "ui.py"),] # A cache storing validated msgids, to avoid re-spellchecking them. diff --git a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py index 46b369146b7..34eab11f9d4 100644 --- a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py +++ b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py @@ -37,10 +37,12 @@ dict_uimsgs = { "aren", # aren't "betweens", # yuck! in-betweens! "boolean", "booleans", + "couldn", #couldn't "decrement", "derivate", "doesn", # doesn't "fader", + "hasn", # hasn't "hoc", # ad-hoc "indices", "iridas", @@ -75,6 +77,7 @@ dict_uimsgs = { "boxpack", "buffersize", "builtin", "builtins", + "bytecode", "chunksize", "de", "defocus", @@ -89,7 +92,9 @@ dict_uimsgs = { "fullscreen", "gridline", "hemi", + "inbetween", "inscatter", "inscattering", + "libdata", "lightless", "lookup", "lookups", "mathutils", @@ -101,6 +106,7 @@ dict_uimsgs = { "multires", "multiresolution", "multisampling", "multitexture", + "multiuser", "namespace", "keyconfig", "playhead", @@ -143,6 +149,7 @@ dict_uimsgs = { "tilemode", "timestamp", "timestamps", "timestep", "timesteps", + "todo", "un", "unbake", "uncomment", @@ -157,7 +164,7 @@ dict_uimsgs = { "unreacted", "unregister", "unselected", - "unsubdivided", + "unsubdivided", "unsubdivide", "unshadowed", "unspill", "unstitchable", @@ -185,6 +192,7 @@ dict_uimsgs = { "selectability", "slurph", "stitchable", + "symmetrize", "trackability", "transmissivity", "rasterized", "rasterization", @@ -230,6 +238,7 @@ dict_uimsgs = { "quat", "quats", "recalc", "recalcs", "refl", + "sel", "spec", "struct", "structs", "tex", @@ -290,6 +299,7 @@ dict_uimsgs = { "crossfade", "deinterlace", "dropoff", + "dv", "eigenvectors", "equirectangular", "fisheye", @@ -303,6 +313,7 @@ dict_uimsgs = { "midtones", "mipmap", "mipmaps", "mip", "ngon", "ngons", + "ntsc", "nurb", "nurbs", "perlin", "phong", @@ -323,6 +334,7 @@ dict_uimsgs = { "ztransp", # Blender terms + "audaspace", "bbone", "breakdowner", "bspline", @@ -347,6 +359,8 @@ dict_uimsgs = { "metaelement", "metaelements", "metastrip", "metastrips", "movieclip", + "mpoly", + "mtex", "nabla", "navmesh", "outliner", @@ -362,6 +376,7 @@ dict_uimsgs = { "stucci", "sunsky", "subsurf", + "tessface", "tessfaces", "texface", "timeline", "timelines", "tosphere", @@ -376,6 +391,7 @@ dict_uimsgs = { "catmull", "catrom", "chebychev", + "courant", "kutta", "lennard", "minkowski", @@ -406,6 +422,7 @@ dict_uimsgs = { "dpi", "dvar", "dx", + "eo", "fh", "fov", "fft", @@ -448,6 +465,7 @@ dict_uimsgs = { "dop", # BLI K-Dop BVH "ik", "nla", + "py", "qbvh", "rna", "rvo", @@ -485,6 +503,8 @@ dict_uimsgs = { "mtl", "ogg", "openjpeg", + "osl", + "oso", "piz", "png", "po", diff --git a/release/scripts/modules/bl_i18n_utils/update_branches.py b/release/scripts/modules/bl_i18n_utils/update_branches.py index 199b09aa13a..4c38a2f71fb 100755 --- a/release/scripts/modules/bl_i18n_utils/update_branches.py +++ b/release/scripts/modules/bl_i18n_utils/update_branches.py @@ -38,6 +38,8 @@ except: PY3 = settings.PYTHON3_EXEC +FILE_NAME_POT = settings.FILE_NAME_POT + def main(): import argparse @@ -71,16 +73,13 @@ def main(): if t: ret = t - # Regenerate POTFILES.in. -# cmd = (PY3, "./update_potinput.py") -# t = subprocess.call(cmd) -# if t: -# ret = t - # Generate a temp pot file. - dummy, potfile = tempfile.mkstemp(suffix=".pot", - prefix="blender_pot_") - os.close(dummy) + # Back to having a pot file in trunk/po. It's quite useful for translators that want to start + # a new translation and not not want to bother generating their own po from scratch! +# dummy, potfile = tempfile.mkstemp(suffix=".pot", +# prefix="blender_pot_") +# os.close(dummy) + potfile = FILE_NAME_POT cmd = [PY3, "./update_pot.py", "-i", msgfile, "-o", potfile] if not args.no_checks: cmd.append("-c") diff --git a/release/scripts/modules/bl_i18n_utils/update_languages_menu.py b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py new file mode 100755 index 00000000000..d45a5543220 --- /dev/null +++ b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py @@ -0,0 +1,148 @@ +#!/usr/bin/python3 + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> + +# Update "languages" text file used by Blender at runtime to build translations menu. + +import os +import sys +import shutil + +try: + import settings + import utils +except: + from . import (settings, utils) + +TRUNK_PO_DIR = settings.TRUNK_PO_DIR +TRUNK_MO_DIR = settings.TRUNK_MO_DIR + +LANGUAGES_CATEGORIES = settings.LANGUAGES_CATEGORIES +LANGUAGES = settings.LANGUAGES +LANGUAGES_FILE = settings.LANGUAGES_FILE + +OK = 0 +MISSING = 1 +TOOLOW = 2 +FORBIDDEN = 3 +FLAG_MESSAGES = { + OK: "", + MISSING: "No translation yet!", + TOOLOW: "Not enough advanced to be included...", + FORBIDDEN: "Explicitly forbidden!", +} + +def find_matching_po(languages, stats, forbidden): + """Match languages defined in LANGUAGES setting to relevant po, if possible!""" + ret = [] + for uid, label, org_key, long_loc in languages: + key = org_key + if key not in stats: + # Try to simplify the key (eg from es_ES to es). + if '_' in org_key: + key = org_key[0:org_key.index('_')] + # For stuff like sr_SR@latin -> sr@latin... + if '@' in org_key: + key = key + org_key[org_key.index('@'):] + if key in stats: + if key in forbidden: + ret.append((stats[key], uid, label, org_key, long_loc, FORBIDDEN)) + else: + ret.append((stats[key], uid, label, org_key, long_loc, OK)) + else: + ret.append((0.0, uid, label, org_key, long_loc, MISSING)) + return ret + +def main(): + import argparse + parser = argparse.ArgumentParser(description="" + "Update 'languages' text file used by Blender at runtime to build translations menu.") + parser.add_argument('-m', '--min_translation', type=int, default=-100, + help="Minimum level of translation, as a percentage " + "(translations below this are commented out in menu).") + parser.add_argument('langs', metavar='ISO_code', nargs='*', + help="Unconditionally exclude those languages from the menu.") + args = parser.parse_args() + + ret = 0 + min_trans = args.min_translation / 100.0 + forbidden = set(args.langs) + # 'DEFAULT' and en_US are always valid, fully-translated "languages"! + stats = {"DEFAULT": 1.0, "en_US": 1.0} + + # Get the "done level" of each po in trunk... + for po in os.listdir(TRUNK_PO_DIR): + if po.endswith(".po") and not po.endswith("_raw.po"): + lang = os.path.basename(po)[:-3] + u1, u2, _stats = utils.parse_messages(os.path.join(TRUNK_PO_DIR, po)) + stats[lang] = _stats["trans_msg"] / _stats["tot_msg"] + + # Generate languages file used by Blender's i18n system. + # First, match all entries in LANGUAGES to a lang in stats, if possible! + stats = find_matching_po(LANGUAGES, stats, forbidden) + limits = sorted(LANGUAGES_CATEGORIES, key=lambda it: it[0], reverse=True) + idx = 0 + stats = sorted(stats, key=lambda it: it[0], reverse=True) + langs_cats = [[] for i in range(len(limits))] + highest_uid = 0 + for prop, uid, label, key, long_loc, flag in stats: + if prop < limits[idx][0]: + # Sub-sort languages by iso-codes. + langs_cats[idx].sort(key=lambda it: it[2]) + idx += 1 + if prop < min_trans and flag == OK: + flag = TOOLOW + langs_cats[idx].append((uid, label, key, long_loc, flag)) + if abs(uid) > highest_uid: + highest_uid = abs(uid) + # Sub-sort last group of languages by iso-codes! + langs_cats[idx].sort(key=lambda it: it[2]) + with open(os.path.join(TRUNK_MO_DIR, LANGUAGES_FILE), 'w', encoding="utf-8") as f: + f.write("# File used by Blender to know which languages (translations) are available, \n") + f.write("# and to generate translation menu.\n") + f.write("#\n") + f.write("# File format:\n") + f.write("# ID:MENULABEL:ISOCODE:WINCODE\n") + f.write("# ID must be unique, except for 0 value (marks categories for menu).\n") + f.write("# Line starting with a # are comments!\n") + f.write("#\n") + f.write("# Automatically generated by bl_i18n_utils/update_languages_menu.py script.\n") + f.write("# Highest ID currently in use: {}\n".format(highest_uid)) + for cat, langs_cat in zip(limits, langs_cats): + f.write("#\n") + # Write "category menu label"... + if langs_cat: + f.write("0:{}::\n".format(cat[1])) + else: + # Do not write the category if it has no language! + f.write("# Void category! #0:{}:\n".format(cat[1])) + # ...and all matching language entries! + for uid, label, key, long_loc, flag in langs_cat: + if flag == OK: + f.write("{}:{}:{}:{}\n".format(uid, label, key, long_loc)) + else: + # Non-existing, commented entry! + f.write("# {} #{}:{}:{}:{}\n".format(FLAG_MESSAGES[flag], uid, label, key, long_loc)) + + +if __name__ == "__main__": + print("\n\n *** Running {} *** \n".format(__file__)) + sys.exit(main()) diff --git a/release/scripts/modules/bl_i18n_utils/update_mo.py b/release/scripts/modules/bl_i18n_utils/update_mo.py index 4a68f19fab0..7f68736593c 100755 --- a/release/scripts/modules/bl_i18n_utils/update_mo.py +++ b/release/scripts/modules/bl_i18n_utils/update_mo.py @@ -69,9 +69,9 @@ def main(): "under {}.".format(TRUNK_MO_DIR)) parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.") - parser.add_argument('po', help="Only process that po file (implies --mo).", + parser.add_argument('--po', help="Only process that po file (implies --mo).", nargs='?') - parser.add_argument('mo', help="Mo file to generate (implies --po).", + parser.add_argument('--mo', help="Mo file to generate (implies --po).", nargs='?') args = parser.parse_args() @@ -97,6 +97,7 @@ def main(): t = process_po(po, lang) if t: ret = t + return ret diff --git a/release/scripts/modules/bl_i18n_utils/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py index f98fc5d7705..51197b86678 100755 --- a/release/scripts/modules/bl_i18n_utils/update_pot.py +++ b/release/scripts/modules/bl_i18n_utils/update_pot.py @@ -38,6 +38,9 @@ except: from . import (settings, utils) +LANGUAGES_CATEGORIES = settings.LANGUAGES_CATEGORIES +LANGUAGES = settings.LANGUAGES + COMMENT_PREFIX = settings.COMMENT_PREFIX COMMENT_PREFIX_SOURCE = settings.COMMENT_PREFIX_SOURCE CONTEXT_PREFIX = settings.CONTEXT_PREFIX @@ -117,28 +120,30 @@ def check_file(path, rel_path, messages): def py_xgettext(messages): + forbidden = set() + forced = set() with open(SRC_POTFILES) as src: - forbidden = set() - forced = set() for l in src: if l[0] == '-': forbidden.add(l[1:].rstrip('\n')) elif l[0] != '#': forced.add(l.rstrip('\n')) - for root, dirs, files in os.walk(POTFILES_DIR): - if "/.svn" in root: + for root, dirs, files in os.walk(POTFILES_DIR): + if "/.svn" in root: + continue + for fname in files: + if os.path.splitext(fname)[1] not in PYGETTEXT_ALLOWED_EXTS: continue - for fname in files: - if os.path.splitext(fname)[1] not in PYGETTEXT_ALLOWED_EXTS: - continue - path = os.path.join(root, fname) - rel_path = os.path.relpath(path, SOURCE_DIR) - if rel_path in forbidden | forced: - continue - check_file(path, rel_path, messages) - for path in forced: - if os.path.exists(path): - check_file(os.path.join(SOURCE_DIR, path), path, messages) + path = os.path.join(root, fname) + rel_path = os.path.relpath(path, SOURCE_DIR) + if rel_path in forbidden: + continue + elif rel_path in forced: + forced.remove(rel_path) + check_file(path, rel_path, messages) + for path in forced: + if os.path.exists(path): + check_file(os.path.join(SOURCE_DIR, path), path, messages) # Spell checking! @@ -187,7 +192,7 @@ def get_svnrev(): def gen_empty_pot(): - blender_rev = get_svnrev() + blender_rev = get_svnrev().decode() utctime = time.gmtime() time_str = time.strftime("%Y-%m-%d %H:%M+0000", utctime) year_str = time.strftime("%Y", utctime) @@ -231,8 +236,8 @@ def merge_messages(msgs, states, messages, do_checks, spell_cache): def main(): - parser = argparse.ArgumentParser(description="Update blender.pot file " \ - "from messages.txt") + parser = argparse.ArgumentParser(description="Update blender.pot file from messages.txt and source code parsing, " + "and performs some checks over msgids.") parser.add_argument('-w', '--warning', action="store_true", help="Show warnings.") parser.add_argument('-i', '--input', metavar="File", @@ -250,7 +255,7 @@ def main(): print("Running fake py gettext…") # Not using any more xgettext, simpler to do it ourself! - messages = {} + messages = utils.new_messages() py_xgettext(messages) print("Finished, found {} messages.".format(len(messages))) @@ -259,7 +264,6 @@ def main(): spell_cache = pickle.load(f) else: spell_cache = set() - print(len(spell_cache)) print("Generating POT file {}…".format(FILE_NAME_POT)) msgs, states = gen_empty_pot() @@ -268,7 +272,7 @@ def main(): # add messages collected automatically from RNA print("\tMerging RNA messages from {}…".format(FILE_NAME_MESSAGES)) - messages = {} + messages = utils.new_messages() with open(FILE_NAME_MESSAGES, encoding="utf-8") as f: srcs = [] context = "" @@ -290,11 +294,22 @@ def main(): print("\tMerged {} messages ({} were already present)." "".format(num_added, num_present)) + print("\tAdding languages labels...") + messages = {(CONTEXT_DEFAULT, lng[1]): + ("Languages’ labels from bl_i18n_utils/settings.py",) + for lng in LANGUAGES} + messages.update({(CONTEXT_DEFAULT, cat[1]): + ("Language categories’ labels from bl_i18n_utils/settings.py",) + for cat in LANGUAGES_CATEGORIES}) + num_added, num_present = merge_messages(msgs, states, messages, + True, spell_cache) + tot_messages += num_added + print("\tAdded {} language messages.".format(num_added)) + # Write back all messages into blender.pot. utils.write_messages(FILE_NAME_POT, msgs, states["comm_msg"], states["fuzzy_msg"]) - print(len(spell_cache)) if SPELL_CACHE and spell_cache: with open(SPELL_CACHE, 'wb') as f: pickle.dump(spell_cache, f) diff --git a/release/scripts/modules/bl_i18n_utils/update_trunk.py b/release/scripts/modules/bl_i18n_utils/update_trunk.py index b7f8f375744..9b904ec861a 100755 --- a/release/scripts/modules/bl_i18n_utils/update_trunk.py +++ b/release/scripts/modules/bl_i18n_utils/update_trunk.py @@ -35,34 +35,55 @@ import shutil try: import settings + import utils except: - from . import settings + from . import (settings, utils) +BRANCHES_DIR = settings.BRANCHES_DIR TRUNK_PO_DIR = settings.TRUNK_PO_DIR TRUNK_MO_DIR = settings.TRUNK_MO_DIR +LANGUAGES_CATEGORIES = settings.LANGUAGES_CATEGORIES +LANGUAGES = settings.LANGUAGES +LANGUAGES_FILE = settings.LANGUAGES_FILE + PY3 = settings.PYTHON3_EXEC +def find_matching_po(languages, stats): + """Match languages defined in LANGUAGES setting to relevant po, if possible!""" + ret = [] + for uid, label, org_key in languages: + key = org_key + if key not in stats: + # Try to simplify the key (eg from es_ES to es). + if '_' in org_key: + key = org_key[0:org_key.index('_')] + if '@' in org_key: + key = key + org_key[org_key.index('@'):] + if key in stats: + ret.append((stats[key], uid, label, org_key)) + else: + # Mark invalid entries, so that we can put them in the languages file, + # but commented! + ret.append((0.0, -uid, label, org_key)) + return ret + def main(): import argparse - parser = argparse.ArgumentParser(description="" \ - "Update trunk from branches:\n" \ - "* Remove po’s in trunk.\n" \ - "* Copy po’s from branches advanced enough.\n" \ - "* Clean po’s in trunk.\n" \ - "* Compile po’s in trunk in mo’s, keeping " \ - "track of those failing.\n" \ - "* Remove po’s and mo’s (and their dir’s) that " \ - "failed to compile or are no more present in trunk.") - parser.add_argument('-t', '--threshold', type=int, - help="Import threshold, as a percentage.") - parser.add_argument('-p', '--po', action="store_false", - help="Do not remove failing po’s.") - parser.add_argument('-m', '--mo', action="store_false", - help="Do not remove failing mo’s.") - parser.add_argument('langs', metavar='ISO_code', nargs='*', - help="Restrict processed languages to those.") + parser = argparse.ArgumentParser(description="" + "Update trunk from branches:\n" + "* Remove po’s in trunk.\n" + "* Copy po’s from branches advanced enough.\n" + "* Clean po’s in trunk.\n" + "* Compile po’s in trunk in mo’s, keeping track of those failing.\n" + "* Remove po’s and mo’s (and their dir’s) that " + "failed to compile or are no more present in trunk." + "* Generate languages file used by Blender's i18n.") + parser.add_argument('-t', '--threshold', type=int, help="Import threshold, as a percentage.") + parser.add_argument('-p', '--po', action="store_true", help="Remove failing po’s.") + parser.add_argument('-m', '--mo', action="store_true", help="Remove failing mo’s.") + parser.add_argument('langs', metavar='ISO_code', nargs='*', help="Restrict processed languages to those.") args = parser.parse_args() ret = 0 @@ -89,7 +110,7 @@ def main(): # Add in failed all mo’s no more having relevant po’s in trunk. for lang in os.listdir(TRUNK_MO_DIR): - if lang == ".svn": + if lang in {".svn", LANGUAGES_FILE}: continue # !!! if not os.path.exists(os.path.join(TRUNK_PO_DIR, ".".join((lang, "po")))): failed.add(lang) @@ -115,6 +136,13 @@ def main(): if t: ret = t failed.add(lang) + continue + + # Generate languages file used by Blender's i18n system. + cmd = [PY3, "./update_languages_menu.py"] + t = subprocess.call(cmd) + if t: + ret = t # Remove failing po’s, mo’s and related dir’s. for lang in failed: diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 25b9daa99e5..9481f750092 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -41,6 +41,10 @@ def is_tooltip(msgid): return len(msgid) > 30 +def new_messages(): + return getattr(collections, 'OrderedDict', dict)() + + def parse_messages(fname): """ Returns a tupple (messages, states, stats). @@ -78,7 +82,7 @@ def parse_messages(fname): msgctxt_lines = [] comment_lines = [] - messages = getattr(collections, 'OrderedDict', dict)() + messages = new_messages() translated_messages = set() fuzzy_messages = set() commented_messages = set() @@ -282,7 +286,7 @@ def gen_empty_messages(blender_rev, time_str, year_str): """Generate an empty messages & state data (only header if present!).""" header_key = ("", "") - messages = getattr(collections, 'OrderedDict', dict)() + messages = new_messages() messages[header_key] = { "msgid_lines": [""], "msgctxt_lines": [], diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 41fe052c434..d32b69b501c 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -264,8 +264,8 @@ def module_names(path, recursive=False): if recursive: for mod_name, mod_path in module_names(directory, True): modules.append(("%s.%s" % (filename, mod_name), - mod_path, - )) + mod_path, + )) return modules diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index ad0fe06b68b..ad3cf8c08ec 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -232,7 +232,7 @@ def edge_loops_from_tessfaces(mesh, tessfaces=None, seams=()): ed_adj = edges[context_loop[-1]] if len(ed_adj) != 2: # the original edge had 2 other edges - if other_dir and flipped == False: + if other_dir and flipped is False: flipped = True # only flip the list once context_loop.reverse() ed_adj[:] = [] diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index b1de1fd47a4..46731b807f7 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -187,3 +187,16 @@ class AddObjectHelper: name="Rotation", subtype='EULER', ) + + +def object_add_grid_scale(context): + """ + Return scale which should be applied on object data to align it to grid scale + """ + + space_data = context.space_data + + if space_data and space_data.type == 'VIEW_3D': + return space_data.grid_scale_unit + + return 1.0 diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 9ad9a7affc3..4cd823d9184 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -689,10 +689,10 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): files = [] for directory in searchpaths: files.extend([(f, os.path.join(directory, f)) - for f in os.listdir(directory) - if (not f.startswith(".")) - if ((filter_ext is None) or - (filter_ext(os.path.splitext(f)[1]))) + for f in os.listdir(directory) + if (not f.startswith(".")) + if ((filter_ext is None) or + (filter_ext(os.path.splitext(f)[1]))) ]) files.sort() diff --git a/release/scripts/modules/bpyml.py b/release/scripts/modules/bpyml.py index 42d2bf94fba..e942006010b 100644 --- a/release/scripts/modules/bpyml.py +++ b/release/scripts/modules/bpyml.py @@ -160,7 +160,7 @@ if __name__ == "__main__": from bpyml_test import * draw = [ - ui()[ + ui()[ split()[ column()[ prop(data='context.scene.render', property='use_stamp_time', text='Time'), diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 582a1c6ae14..60dfa2b6344 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -30,7 +30,7 @@ _BPY_MAIN_OWN = True def add_scrollback(text, text_type): for l in text.split("\n"): bpy.ops.console.scrollback_append(text=l.replace("\t", " "), - type=text_type) + type=text_type) def replace_help(namespace): @@ -195,7 +195,7 @@ def execute(context): # insert a new blank line bpy.ops.console.history_append(text="", current_character=0, - remove_duplicates=True) + remove_duplicates=True) # Insert the output into the editor # not quite correct because the order might have changed, @@ -294,8 +294,8 @@ def copy_as_script(context): sc = context.space_data lines = [ "import bpy", - "import bpy.context as C", - "import bpy.data as D", + "from bpy import data as D", + "from bpy import context as C", "from mathutils import *", "from math import *", "", diff --git a/release/scripts/modules/console_shell.py b/release/scripts/modules/console_shell.py index 8beff24eedb..42348f453cd 100644 --- a/release/scripts/modules/console_shell.py +++ b/release/scripts/modules/console_shell.py @@ -26,7 +26,7 @@ language_id = "shell" def add_scrollback(text, text_type): for l in text.split("\n"): bpy.ops.console.scrollback_append(text=l.replace("\t", " "), - type=text_type) + type=text_type) def shell_run(text): @@ -57,7 +57,7 @@ def execute(context): # insert a new blank line bpy.ops.console.history_append(text="", current_character=0, - remove_duplicates=True) + remove_duplicates=True) sc.prompt = os.getcwd() + PROMPT return {'FINISHED'} diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index 0ef2ac5164d..6f4b63fc99a 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -249,7 +249,7 @@ class InfoPropertyRNA: def get_arg_default(self, force=True): default = self.default_str - if default and (force or self.is_required == False): + if default and (force or self.is_required is False): return "%s=%s" % (self.identifier, default) return self.identifier @@ -493,7 +493,7 @@ def BuildRNAInfo(): # Arrange so classes are always defined in the correct order deps_ok = False - while deps_ok == False: + while deps_ok is False: deps_ok = True rna_done = set() diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py index 2ea978419b9..fc8e3125228 100644 --- a/release/scripts/modules/rna_xml.py +++ b/release/scripts/modules/rna_xml.py @@ -250,7 +250,7 @@ def xml2rna(root_xml, if value_xml.startswith("#"): # read hexidecimal value as float array value_xml_split = value_xml[1:] - value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)] + value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)] del value_xml_split else: value_xml_split = value_xml.split() diff --git a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml index d54766ec88f..05075f06239 100644 --- a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml +++ b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml @@ -1,69 +1,69 @@ <bpy> <Theme> <view_3d> - <ThemeView3D object_active="#f58032" + <ThemeView3D object_active="#f47421" editmesh_active="#ffffff80" act_spline="#ee4000" - handle_align="#862074" - handle_sel_align="#f090a0" - handle_auto="#909000" - handle_sel_auto="#f0ff40" + handle_align="#93237f" + handle_sel_align="#f47421" + handle_auto="#00c59a" + handle_sel_auto="#f47421" bone_pose="#50c8ff" bone_pose_active="#8cffff" bone_solid="#c8c8c8" bundle_solid="#c8c8c8" - camera="#000000" - camera_path="#000000" + camera="#159dce" + camera_path="#7dbd00" frame_current="#60c040" edge_crease="#ce33b8" extra_edge_len="#200000" edge_seam="#db4100" - edge_select="#f68d46" + edge_select="#f47421" edge_sharp="#ff4c00" edge_facesel="#4b4b4b" - empty="#000000" + empty="#93237f" face="#75757512" extra_face_angle="#002000" extra_face_area="#0059ee" - face_dot="#ff8500" + face_dot="#f47421" facedot_size="3" normal="#19b6ee" - face_select="#ff85003c" - handle_free="#000000" - handle_sel_free="#000000" + face_select="#f474213c" + handle_free="#a5ca00" + handle_sel_free="#f47421" grid="#3c3b37" - lamp="#00000028" + lamp="#ffffff34" lastsel_point="#ffffff" nurb_uline="#909000" nurb_vline="#862074" nurb_sel_uline="#f0ff40" nurb_sel_vline="#d15d85" - object_grouped="#083008" - object_grouped_active="#55bb55" + object_grouped="#117211" + object_grouped_active="#65d665" object_selected="#f15800" - outline_width="1" + outline_width="2" panel="#a5a5a57f" skin_root="#000000" - speaker="#000000" + speaker="#93237f" transform="#ffffff" handle_vect="#409030" handle_sel_vect="#82c036" vertex="#c96cb8" vertex_normal="#19b6ee" - vertex_select="#f15800" + vertex_select="#f47421" vertex_size="2" - wire="#862074"> + wire="#93237f"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#9c9c9c" button_text_hi="#ffffff" button_title="#9c9c9c" - text="#000000" + text="#9c9c9c" text_hi="#ffffff" - title="#000000" + title="#9c9c9c" back="#131311"> </ThemeSpaceGeneric> </space> @@ -71,7 +71,7 @@ </view_3d> <clip_editor> <ThemeClipEditor active_marker="#ffffff" - frame_current="#c07100" + frame_current="#f47421" disabled_marker="#7f0000" grid="#302e2c" handle_vertex="#000000" @@ -86,16 +86,16 @@ strips="#0c0a0a" strips_selected="#ff8c00"> <space> - <ThemeSpaceGeneric header="#3c3b37" - header_text="#000000" + <ThemeSpaceGeneric header="#464541" + header_text="#9c9c9c" header_text_hi="#ffffff" button="#3c3b37" - button_text="#000000" + button_text="#ffffff" button_text_hi="#ffffff" - button_title="#000000" - text="#000000" + button_title="#9c9c9c" + text="#9c9c9c" text_hi="#ffffff" - title="#000000" + title="#9c9c9c" back="#131311"> </ThemeSpaceGeneric> </space> @@ -109,14 +109,14 @@ </ThemeClipEditor> </clip_editor> <console> - <ThemeConsole cursor="#dc5a00" - line_error="#dc0000" - line_info="#85aa00" - line_input="#828282" - line_output="#f58032"> + <ThemeConsole cursor="#f47421" + line_error="#ff0000" + line_info="#f47421" + line_input="#19b6ee" + line_output="#97f500"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#000000" @@ -133,7 +133,7 @@ <dopesheet_editor> <ThemeDopeSheet active_channels_group="#a2b15c" channel_group="#4f6549" - channels="#74736e" + channels="#9c9c9c" channels_selected="#6592f5" frame_current="#f58032" dopesheet_channel="#64486e" @@ -143,26 +143,26 @@ long_key_selected="#f47421" summary="#00000000" value_sliders="#000000" - view_sliders="#969696"> + view_sliders="#9c9c9c"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#cacaca" header_text_hi="#ffffff" button="#3c3b37" - button_text="#000000" + button_text="#9c9c9c" button_text_hi="#ffffff" - button_title="#000000" - text="#000000" + button_title="#9c9c9c" + text="#e7e7e7" text_hi="#ffffff" - title="#000000" + title="#9c9c9c" back="#131311"> </ThemeSpaceGeneric> </space> <space_list> <ThemeSpaceListGeneric list="#3c3b37" - list_text="#000000" - list_text_hi="#ffffff" - list_title="#dddddd"> + list_text="#e2e2e2" + list_text_hi="#f47421" + list_title="#ffffff"> </ThemeSpaceListGeneric> </space_list> </ThemeDopeSheet> @@ -175,8 +175,8 @@ selected_file="#6b395a" tiles="#3c3b37"> <space> - <ThemeSpaceGeneric header="#3c3b37" - header_text="#000000" + <ThemeSpaceGeneric header="#464541" + header_text="#acacac" header_text_hi="#ffffff" button="#727272" button_text="#000000" @@ -199,50 +199,50 @@ </file_browser> <graph_editor> <ThemeGraphEditor active_channels_group="#87b17d" - handle_align="#803060" - handle_sel_align="#f090a0" - handle_auto="#909000" - handle_sel_auto="#f0ff40" - handle_auto_clamped="#994030" - handle_sel_auto_clamped="#f0af90" + handle_align="#93237f" + handle_sel_align="#f49600" + handle_auto="#00c59a" + handle_sel_auto="#f49600" + handle_auto_clamped="#03aa60" + handle_sel_auto_clamped="#f49600" channel_group="#4f6549" channels_region="#707070" frame_current="#f58032" dopesheet_channel="#695c6e" dopesheet_subchannel="#7c8996" - handle_free="#000000" - handle_sel_free="#000000" + handle_free="#a5ca00" + handle_sel_free="#f49600" grid="#3c3b37" - handle_vertex="#000000" - handle_vertex_select="#f47421" - handle_vertex_size="3" - lastsel_point="#000000" + handle_vertex="#bbbbbb" + handle_vertex_select="#f49600" + handle_vertex_size="4" + lastsel_point="#fafafa" panel="#ffffff" handle_vect="#409030" handle_sel_vect="#40c030" - vertex="#000000" - vertex_select="#ff8500" - vertex_size="3" + vertex="#ffffff" + vertex_select="#f49600" + vertex_size="4" window_sliders="#95948f"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" - button_text="#c3c2bc" + button_text="#9c9c9c" button_text_hi="#ffffff" - button_title="#9e9d98" - text="#000000" + button_title="#9c9c9c" + text="#e9e9e9" text_hi="#ffffff" - title="#000000" + title="#9c9c9c" back="#131311"> </ThemeSpaceGeneric> </space> <space_list> <ThemeSpaceListGeneric list="#3c3b37" - list_text="#000000" - list_text_hi="#ffffff" - list_title="#000000"> + list_text="#e2e2e2" + list_text_hi="#f47421" + list_title="#ffffff"> </ThemeSpaceListGeneric> </space_list> </ThemeGraphEditor> @@ -265,7 +265,7 @@ vertex_size="3"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#b9b9b9" @@ -301,16 +301,16 @@ <ThemeLogicEditor panel="#acacac"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" - button="#131311" + button="#353430" button_text="#acacac" button_text_hi="#ffffff" button_title="#7d7d7d" text="#acacac" text_hi="#ffffff" title="#000000" - back="#131311"> + back="#29001b"> </ThemeSpaceGeneric> </space> </ThemeLogicEditor> @@ -333,7 +333,7 @@ view_sliders="#969696"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#000000" @@ -369,7 +369,7 @@ wire="#f45b00"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#353430" button_text="#acacac" @@ -395,7 +395,7 @@ selected_highlight="#6a3859"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#000000" @@ -413,7 +413,7 @@ <ThemeProperties panel="#3c3b37"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" button_text="#000000" @@ -444,32 +444,32 @@ window_sliders="#a0a0a0"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" - button_text="#000000" + button_text="#acacac" button_text_hi="#ffffff" - button_title="#000000" - text="#000000" + button_title="#acacac" + text="#acacac" text_hi="#ffffff" - title="#000000" + title="#acacac" back="#191919"> </ThemeSpaceGeneric> </space> </ThemeSequenceEditor> </sequence_editor> <text_editor> - <ThemeTextEditor cursor="#df5106" - syntax_special="#8c8c28" + <ThemeTextEditor cursor="#f47421" + syntax_special="#33a500" line_numbers_background="#3c3b37" - selected_text="#ffffff" - syntax_builtin="#df3ac2" + selected_text="#641f44" + syntax_builtin="#d6ff01" syntax_comment="#249d60" - syntax_numbers="#3c68ff" - syntax_string="#aa2694"> + syntax_numbers="#972144" + syntax_string="#6e00ff"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#191919" button_text="#95948f" @@ -488,13 +488,13 @@ grid="#272727"> <space> <ThemeSpaceGeneric header="#464541" - header_text="#000000" + header_text="#acacac" header_text_hi="#ffffff" button="#3c3b37" - button_text="#000000" + button_text="#9c9c9c" button_text_hi="#ffffff" - button_title="#000000" - text="#949494" + button_title="#9c9c9c" + text="#9c9c9c" text_hi="#ffffff" title="#000000" back="#131311"> @@ -532,13 +532,13 @@ <wcol_menu_back> <ThemeWidgetColors inner="#131312db" inner_sel="#2d2d2de6" - item="#cbc3bbff" + item="#6a3859ff" outline="#0d0d0d" shadedown="-20" shadetop="25" show_shaded="FALSE" - text="#7a7a7a" - text_sel="#ffffff"> + text="#dddddd" + text_sel="#dddddd"> </ThemeWidgetColors> </wcol_menu_back> <wcol_menu_item> @@ -574,7 +574,7 @@ shadetop="20" show_shaded="TRUE" text="#dfdbcf" - text_sel="#fffbed"> + text_sel="#f47421"> </ThemeWidgetColors> </wcol_num> <wcol_option> @@ -615,7 +615,7 @@ shadetop="25" show_shaded="FALSE" text="#dddddd" - text_sel="#fff7fb"> + text_sel="#ffffff"> </ThemeWidgetColors> </wcol_pulldown> <wcol_radio> @@ -627,7 +627,7 @@ shadetop="5" show_shaded="TRUE" text="#dfdbcf" - text_sel="#ffffff"> + text_sel="#dfdbcf"> </ThemeWidgetColors> </wcol_radio> <wcol_regular> @@ -639,16 +639,16 @@ shadetop="21" show_shaded="TRUE" text="#dfdfdf" - text_sel="#ffffff"> + text_sel="#dfdfdf"> </ThemeWidgetColors> </wcol_regular> <wcol_scroll> - <ThemeWidgetColors inner="#020202b4" + <ThemeWidgetColors inner="#000000b4" inner_sel="#646464c6" - item="#2c2b28ff" - outline="#0d0d0d" - shadedown="-5" - shadetop="5" + item="#2e2d2aff" + outline="#000000" + shadedown="-10" + shadetop="10" show_shaded="TRUE" text="#cbc3bb" text_sel="#ffffff"> @@ -685,7 +685,7 @@ shadetop="-10" show_shaded="TRUE" text="#dfdbcf" - text_sel="#fffaec"> + text_sel="#ffffff"> </ThemeWidgetColors> </wcol_text> <wcol_toggle> @@ -721,7 +721,7 @@ shadetop="25" show_shaded="FALSE" text="#ffffff" - text_sel="#ffffff"> + text_sel="#ff5d0d"> </ThemeWidgetColors> </wcol_tooltip> </ThemeUserInterface> diff --git a/release/scripts/presets/keyconfig/maya.py b/release/scripts/presets/keyconfig/maya.py index fe011a51e22..b5df519cf59 100644 --- a/release/scripts/presets/keyconfig/maya.py +++ b/release/scripts/presets/keyconfig/maya.py @@ -133,42 +133,42 @@ kmi = km.keymap_items.new('wm.context_toggle_enum', 'Z', 'PRESS', alt=True) kmi.properties.data_path = 'space_data.viewport_shade' kmi.properties.value_1 = 'TEXTURED' kmi.properties.value_2 = 'SOLID' -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS') +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE') kmi.properties.extend = False kmi.properties.center = False kmi.properties.object = False kmi.properties.enumerate = False -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True) kmi.properties.extend = True kmi.properties.center = False kmi.properties.object = False kmi.properties.enumerate = False -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', ctrl=True) kmi.properties.extend = False kmi.properties.center = True kmi.properties.object = False kmi.properties.enumerate = False -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', alt=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', alt=True) kmi.properties.extend = False kmi.properties.center = False kmi.properties.object = False kmi.properties.enumerate = True -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, ctrl=True) kmi.properties.extend = True kmi.properties.center = True kmi.properties.object = False kmi.properties.enumerate = False -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', ctrl=True, alt=True) kmi.properties.extend = False kmi.properties.center = True kmi.properties.object = False kmi.properties.enumerate = True -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, alt=True) kmi.properties.extend = True kmi.properties.center = False kmi.properties.object = False kmi.properties.enumerate = True -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'RELEASE', shift=True, ctrl=True, alt=True) kmi.properties.extend = True kmi.properties.center = True kmi.properties.object = False diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index 6c48ae72e4b..552247f0940 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -49,9 +49,9 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg): angle = 2 * pi * minor_index / minor_seg vec = quat * Vector((major_rad + (cos(angle) * minor_rad), - 0.0, - (sin(angle) * minor_rad), - )) + 0.0, + (sin(angle) * minor_rad), + )) verts.extend(vec[:]) @@ -133,13 +133,15 @@ class AddTorus(Operator, object_utils.AddObjectHelper): ) def execute(self, context): - if self.use_abso == True: + grid_scale = object_utils.object_add_grid_scale(context) + + if self.use_abso is True: extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5 self.major_radius = self.abso_minor_rad + extra_helper self.minor_radius = extra_helper - verts_loc, faces = add_torus(self.major_radius, - self.minor_radius, + verts_loc, faces = add_torus(self.major_radius * grid_scale, + self.minor_radius * grid_scale, self.major_segments, self.minor_segments) diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index c5fc3c50f3f..902c7007fb9 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -214,7 +214,7 @@ class BakeAction(Operator): 'OBJECT' in self.bake_types, self.clear_constraints, True, - ) + ) if action is None: self.report({'INFO'}, "Nothing to bake") @@ -252,8 +252,8 @@ class ClearUselessActions(Operator): for action in bpy.data.actions: # if only user is "fake" user... - if ((self.only_unused is False) or - (action.use_fake_user and action.users == 1)): + if ((self.only_unused is False) or + (action.use_fake_user and action.users == 1)): # if it has F-Curves, then it's a "action library" # (i.e. walk, wave, jump, etc.) diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index c45d2f2e702..70967a01d1c 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -57,7 +57,7 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user): space_v3d.show_background_images = True CLIP_spaces_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D', - set_background, clip, clip_user) + set_background, clip, clip_user) def CLIP_camera_for_clip(context, clip): @@ -329,7 +329,7 @@ object's movement caused by this constraint""" if not con: self.report({'ERROR'}, - "Motion Tracking constraint to be converted not found") + "Motion Tracking constraint to be converted not found") return {'CANCELLED'} @@ -341,7 +341,7 @@ object's movement caused by this constraint""" if not clip: self.report({'ERROR'}, - "Movie clip to use tracking data from isn't set") + "Movie clip to use tracking data from isn't set") return {'CANCELLED'} @@ -461,9 +461,9 @@ class CLIP_OT_setup_tracking_scene(Operator): scene.camera = camob camob.matrix_local = (Matrix.Translation((7.481, -6.508, 5.344)) * - Matrix.Rotation(0.815, 4, 'Z') * - Matrix.Rotation(0.011, 4, 'Y') * - Matrix.Rotation(1.109, 4, 'X')) + Matrix.Rotation(0.815, 4, 'Z') * + Matrix.Rotation(0.011, 4, 'Y') * + Matrix.Rotation(1.109, 4, 'X')) return camob @@ -629,7 +629,7 @@ class CLIP_OT_setup_tracking_scene(Operator): if need_stabilization: tree.links.new(distortion.outputs["Image"], - stabilize.inputs["Image"]) + stabilize.inputs["Image"]) tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"]) else: tree.links.new(distortion.outputs["Image"], scale.inputs["Image"]) diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py index fd95da02b28..307165a4d18 100644 --- a/release/scripts/startup/bl_operators/console.py +++ b/release/scripts/startup/bl_operators/console.py @@ -129,6 +129,6 @@ class ConsoleLanguage(Operator): # insert a new blank line bpy.ops.console.history_append(text="", current_character=0, - remove_duplicates=True) + remove_duplicates=True) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index 3dc25d84aca..df21349da47 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -92,7 +92,7 @@ class MeshMirrorUV(Operator): puvs[i] = tuple(uv.uv for uv in uv_loops[lstart:lend]) puvs_cpy[i] = tuple(uv.copy() for uv in puvs[i]) puvsel[i] = (False not in - (uv.select for uv in uv_loops[lstart:lend])) + (uv.select for uv in uv_loops[lstart:lend])) # Vert idx of the poly. vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend]) # As we have no poly.center yet... diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 5000d718182..4e90f2e8585 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -408,13 +408,13 @@ class ShapeTransfer(Operator): n2loc_to = v2_to + target_normals[i2] * edlen_to pt = barycentric_transform(orig_shape_coords[i1], - v2, v1, n1loc, - v2_to, v1_to, n1loc_to) + v2, v1, n1loc, + v2_to, v1_to, n1loc_to) median_coords[i1].append(pt) pt = barycentric_transform(orig_shape_coords[i2], - v1, v2, n2loc, - v1_to, v2_to, n2loc_to) + v1, v2, n2loc, + v1_to, v2_to, n2loc_to) median_coords[i2].append(pt) # apply the offsets to the new shape @@ -507,7 +507,7 @@ class JoinUVs(Operator): if obj_other != obj and obj_other.type == 'MESH': mesh_other = obj_other.data if mesh_other != mesh: - if mesh_other.tag == False: + if mesh_other.tag is False: mesh_other.tag = True if len(mesh_other.loops) != nbr_loops: @@ -520,7 +520,7 @@ class JoinUVs(Operator): len(mesh_other.polygons), nbr_loops, ), - ) + ) else: uv_other = mesh_other.uv_layers.active if not uv_other: diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 35b496b6dd0..cd0b63a6b78 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -299,7 +299,6 @@ class QuickSmoke(Operator): style = EnumProperty( name="Smoke Style", items=(('STREAM', "Stream", ""), - ('PUFF', "Puff", ""), ('FIRE', "Fire", ""), ), default='STREAM', @@ -328,20 +327,9 @@ class QuickSmoke(Operator): bpy.ops.object.modifier_add(fake_context, type='SMOKE') obj.modifiers[-1].smoke_type = 'FLOW' - psys = obj.particle_systems[-1] - if self.style == 'PUFF': - psys.settings.frame_end = psys.settings.frame_start - psys.settings.emit_from = 'VOLUME' - psys.settings.distribution = 'RAND' - elif self.style == 'FIRE': - psys.settings.effector_weights.gravity = -1 - psys.settings.lifetime = 5 - psys.settings.count = 100000 - - obj.modifiers[-2].flow_settings.initial_velocity = True - obj.modifiers[-2].flow_settings.temperature = 2 - - psys.settings.use_render_emitter = self.show_flows + if self.style == 'FIRE': + obj.modifiers[-1].flow_settings.smoke_flow_type = 'FIRE' + if not self.show_flows: obj.draw_type = 'WIRE' @@ -361,8 +349,6 @@ class QuickSmoke(Operator): bpy.ops.object.modifier_add(type='SMOKE') obj.modifiers[-1].smoke_type = 'DOMAIN' if self.style == 'FIRE': - obj.modifiers[-1].domain_settings.use_dissolve_smoke = True - obj.modifiers[-1].domain_settings.dissolve_speed = 20 obj.modifiers[-1].domain_settings.use_high_resolution = True # create a volume material with a voxel data texture for the domain @@ -373,6 +359,7 @@ class QuickSmoke(Operator): mat.type = 'VOLUME' mat.volume.density = 0 mat.volume.density_scale = 5 + mat.volume.step_size = 0.1 tex = bpy.data.textures.new("Smoke Density", 'VOXEL_DATA') tex.voxel_data.domain_object = obj @@ -381,29 +368,35 @@ class QuickSmoke(Operator): tex_slot.texture = tex tex_slot.use_map_color_emission = False tex_slot.use_map_density = True + tex_slot.use_map_color_reflection = True - # for fire add a second texture for emission and emission color - if self.style == 'FIRE': - mat.volume.emission = 5 - tex = bpy.data.textures.new("Smoke Heat", 'VOXEL_DATA') - tex.voxel_data.domain_object = obj - tex.use_color_ramp = True - - tex_slot = mat.texture_slots.add() - tex_slot.texture = tex - - ramp = tex.color_ramp - - elem = ramp.elements.new(0.333) - elem.color[0] = elem.color[3] = 1 - elem.color[1] = elem.color[2] = 0 + # for fire add a second texture for flame emission + mat.volume.emission_color = Vector((0.0, 0.0, 0.0)) + tex = bpy.data.textures.new("Flame", 'VOXEL_DATA') + tex.voxel_data.domain_object = obj + tex.voxel_data.smoke_data_type = 'SMOKEFLAME' + tex.use_color_ramp = True - elem = ramp.elements.new(0.666) - elem.color[0] = elem.color[1] = elem.color[3] = 1 - elem.color[2] = 0 + tex_slot = mat.texture_slots.add() + tex_slot.texture = tex - mat.texture_slots[1].use_map_emission = True - mat.texture_slots[1].blend_type = 'MULTIPLY' + # add color ramp for flame color + ramp = tex.color_ramp + # dark orange + elem = ramp.elements.new(0.333) + elem.color[0] = 0.2 + elem.color[1] = 0.03 + elem.color[2] = 0 + elem.color[3] = 1 + # yellow glow + elem = ramp.elements.new(0.666) + elem.color[0] = elem.color[3] = 1 + elem.color[1] = 0.65 + elem.color[2] = 0.25 + + mat.texture_slots[1].use_map_density = True + mat.texture_slots[1].use_map_emission = True + mat.texture_slots[1].emission_factor = 5 return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index db492450e28..b7adf53dbf1 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -185,10 +185,12 @@ class ExecutePreset(Operator): filepath = StringProperty( subtype='FILE_PATH', + options={'SKIP_SAVE'}, ) menu_idname = StringProperty( name="Menu ID Name", description="ID name of the menu this was called from", + options={'SKIP_SAVE'}, ) def execute(self, context): @@ -436,19 +438,19 @@ class AddPresetTrackingSettings(AddPresetBase, Operator): ] preset_values = [ - "default_correlation_min", - "default_pattern_size", - "default_search_size", - "default_frames_limit", - "default_pattern_match", - "default_margin", - "default_motion_model", - "use_default_brute", - "use_default_normalization", - "use_default_mask", - "use_default_red_channel", - "use_default_green_channel", - "use_default_blue_channel" + "settings.default_correlation_min", + "settings.default_pattern_size", + "settings.default_search_size", + "settings.default_frames_limit", + "settings.default_pattern_match", + "settings.default_margin", + "settings.default_motion_model", + "settings.use_default_brute", + "settings.use_default_normalization", + "settings.use_default_mask", + "settings.use_default_red_channel", + "settings.use_default_green_channel", + "settings.use_default_blue_channel" ] preset_subdir = "tracking_settings" @@ -504,7 +506,7 @@ class AddPresetKeyconfig(AddPresetBase, Operator): class AddPresetOperator(AddPresetBase, Operator): - """Add an Application Interaction Preset""" + """Add an Operator Preset""" bl_idname = "wm.operator_preset_add" bl_label = "Operator Preset" preset_menu = "WM_MT_operator_presets" @@ -512,7 +514,7 @@ class AddPresetOperator(AddPresetBase, Operator): operator = StringProperty( name="Operator", maxlen=64, - options={'HIDDEN'}, + options={'HIDDEN', 'SKIP_SAVE'}, ) preset_defines = [ diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index 32658d353d9..694412e51d7 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -89,7 +89,7 @@ class PlayRenderedAnim(Operator): if player_path == "": player_path = guess_player_path(preset) - if is_movie == False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}: + if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}: # replace the number with '#' file_a = rd.frame_path(frame=0) diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 21843d80742..2bff11a686d 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -608,9 +608,9 @@ class WM_OT_context_collection_boolean_set(Operator): except: continue - if value_orig == True: + if value_orig is True: is_set = True - elif value_orig == False: + elif value_orig is False: pass else: self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" % @@ -1124,9 +1124,15 @@ class WM_OT_properties_add(Operator): return prop_new - property = unique_name(item.keys()) + prop = unique_name(item.keys()) + + item[prop] = 1.0 + + # not essential, but without this we get [#31661] + prop_ui = rna_idprop_ui_prop_get(item, prop) + prop_ui["soft_min"] = prop_ui["min"] = 0.0 + prop_ui["soft_max"] = prop_ui["max"] = 1.0 - item[property] = 1.0 return {'FINISHED'} @@ -1284,7 +1290,7 @@ class WM_OT_blenderplayer_start(Operator): return {'CANCELLED'} filepath = os.path.join(bpy.app.tempdir, "game.blend") - bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True) + bpy.ops.wm.save_as_mainfile('EXEC_DEFAULT', filepath=filepath, copy=True) subprocess.call([player_path, filepath]) return {'FINISHED'} @@ -1583,7 +1589,7 @@ class WM_OT_addon_enable(Operator): "version %d.%d.%d and might not " "function (correctly), " "though it is enabled") % - info_ver) + info_ver) return {'FINISHED'} else: return {'CANCELLED'} @@ -1668,7 +1674,7 @@ class WM_OT_theme_install(Operator): class WM_OT_addon_install(Operator): "Install an addon" bl_idname = "wm.addon_install" - bl_label = "Install Addon..." + bl_label = "Install from File..." overwrite = BoolProperty( name="Overwrite", @@ -1773,12 +1779,6 @@ class WM_OT_addon_install(Operator): try: # extract the file to "addons" file_to_extract.extractall(path_addons) - - # zip files can create this dir with metadata, don't need it - macosx_dir = os.path.join(path_addons, '__MACOSX') - if os.path.isdir(macosx_dir): - shutil.rmtree(macosx_dir) - except: traceback.print_exc() return {'CANCELLED'} @@ -1822,8 +1822,11 @@ class WM_OT_addon_install(Operator): # in case a new module path was created to install this addon. bpy.utils.refresh_script_paths() - # TODO, should not be a warning. - #~ self.report({'WARNING'}, "File installed to '%s'\n" % path_dest) + # print message + msg = "Modules Installed from %r into %r (%s)" % (pyfile, path_addons, ", ".join(sorted(addons_new))) + print(msg) + self.report({'INFO'}, msg) + return {'FINISHED'} def invoke(self, context, event): diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 847807029fa..e4be84d5396 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -92,10 +92,11 @@ def register(): def addon_filter_items(self, context): import addon_utils - items = [('All', "All", ""), - ('Enabled', "Enabled", ""), - ('Disabled', "Disabled", ""), - ] + items = [('All', "All", "All Addons"), + ('User', "User", "All Addons Installed by User"), + ('Enabled', "Enabled", "All Enabled Addons"), + ('Disabled', "Disabled", "All Disabled Addons"), + ] items_unique = set() @@ -119,8 +120,8 @@ def register(): WindowManager.addon_support = EnumProperty( items=[('OFFICIAL', "Official", "Officially supported"), ('COMMUNITY', "Community", "Maintained by community developers"), - ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"), - ], + ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)") + ], name="Support", description="Display support level", default={'OFFICIAL', 'COMMUNITY'}, diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index e194d7a1370..50c34be1414 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -285,10 +285,9 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): row.prop(itasc, "damping_max", text="Damp", slider=True) row.prop(itasc, "damping_epsilon", text="Eps", slider=True) -from bl_ui.properties_animviz import ( - MotionPathButtonsPanel, - OnionSkinButtonsPanel, - ) +from bl_ui.properties_animviz import (MotionPathButtonsPanel, + OnionSkinButtonsPanel, + ) class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index e6d9affee93..1441c642d51 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -246,72 +246,74 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): row = layout.row() row.prop(ob.pose, "ik_solver") + active = pchan.is_in_ik_chain + split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X") - split.active = pchan.is_in_ik_chain + split.active = active row = split.row() row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True) - row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain + row.active = pchan.lock_ik_x is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_x", text="Limit") - sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_x is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_x", text="") sub.prop(pchan, "ik_max_x", text="") - sub.active = pchan.lock_ik_x == False and pchan.use_ik_limit_x and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y") - split.active = pchan.is_in_ik_chain + split.active = active row = split.row() row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True) - row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain + row.active = pchan.lock_ik_y is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_y", text="Limit") - sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_y is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_y", text="") sub.prop(pchan, "ik_max_y", text="") - sub.active = pchan.lock_ik_y == False and pchan.use_ik_limit_y and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z") - split.active = pchan.is_in_ik_chain + split.active = active sub = split.row() sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True) - sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_z", text="Limit") - sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_z", text="") sub.prop(pchan, "ik_max_z", text="") - sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active split = layout.split(percentage=0.25) split.label(text="Stretch:") sub = split.row() sub.prop(pchan, "ik_stretch", text="", slider=True) - sub.active = pchan.is_in_ik_chain + sub.active = active if ob.pose.ik_solver == 'ITASC': split = layout.split() col = split.column() col.prop(pchan, "use_ik_rotation_control", text="Control Rotation") - col.active = pchan.is_in_ik_chain + col.active = active col = split.column() col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True) - col.active = pchan.is_in_ik_chain + col.active = active # not supported yet #row = layout.row() #row.prop(pchan, "use_ik_linear_control", text="Joint Size") diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 49457b8e569..5f6036c8945 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -88,7 +88,8 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): col.prop(cam, "ortho_scale") elif cam.type == 'PANO': - if context.scene.render.engine == 'CYCLES': + engine = context.scene.render.engine + if engine == 'CYCLES': ccam = cam.cycles col.prop(ccam, "panorama_type", text="Type") if ccam.panorama_type == 'FISHEYE_EQUIDISTANT': @@ -97,6 +98,13 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): row = layout.row() row.prop(ccam, "fisheye_lens", text="Lens") row.prop(ccam, "fisheye_fov") + elif engine == 'BLENDER_RENDER': + row = col.row() + if cam.lens_unit == 'MILLIMETERS': + row.prop(cam, "lens") + elif cam.lens_unit == 'DEGREES': + row.prop(cam, "angle") + row.prop(cam, "lens_unit", text="") split = layout.split() @@ -175,7 +183,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel): col = split.column() col.prop(cam, "show_limits", text="Limits") col.prop(cam, "show_mist", text="Mist") - col.prop(cam, "show_title_safe", text="Title Safe") + col.prop(cam, "show_title_safe", text="Safe Areas") col.prop(cam, "show_sensor", text="Sensor") col.prop(cam, "show_name", text="Name") diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index a8f4aa30e95..7747ef45c4d 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -174,11 +174,14 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel): col.prop(curve, "bevel_object", text="") col = layout.column(align=True) - col.active = (curve.bevel_object is not None) - col.prop(curve, "use_fill_caps") col.prop(curve, "bevel_factor_start") col.prop(curve, "bevel_factor_end") + row = col.row() + row.active = (curve.bevel_object is not None) + row.prop(curve, "use_fill_caps") + row.prop(curve, "use_map_taper") + class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): bl_label = "Path Animation" diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 769715ef1b9..71fdc1d7b67 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -118,7 +118,7 @@ class DATA_PT_lamp(DataButtonsPanel, Panel): class DATA_PT_sunsky(DataButtonsPanel, Panel): bl_label = "Sky & Atmosphere" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER'} @classmethod def poll(cls, context): diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index ed390be49f5..ea8ffbe6c9f 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -211,7 +211,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.row().prop(md, "deform_axis", expand=True) def DECIMATE(self, layout, ob, md): - layout.prop(md, "ratio") + row = layout.row() + row.prop(md, "decimate_type", expand=True) + decimate_type = md.decimate_type + + if decimate_type == 'COLLAPSE': + layout.prop(md, "ratio") + row = layout.row() + row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + row.prop(md, "invert_vertex_group") + layout.prop(md, "use_collapse_triangulate") + elif decimate_type == 'UNSUBDIV': + layout.prop(md, "iterations") + else: # decimate_type == 'DISSOLVE': + layout.prop(md, "angle_limit") + layout.prop(md, "use_dissolve_boundaries") + layout.label(text="Face Count" + ": %d" % md.face_count) def DISPLACE(self, layout, ob, md): @@ -316,6 +331,28 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): row.operator("object.hook_select", text="Select") row.operator("object.hook_assign", text="Assign") + def LAPLACIANSMOOTH(self, layout, ob, md): + layout.prop(md, "iterations") + + split = layout.split(percentage=0.25) + + col = split.column() + col.label(text="Axis:") + col.prop(md, "use_x") + col.prop(md, "use_y") + col.prop(md, "use_z") + + col = split.column() + col.label(text="Lambda:") + col.prop(md, "lambda_factor", text="Factor") + col.prop(md, "lambda_border", text="Border") + + col.separator() + col.prop(md, "use_volume_preserve") + + layout.label(text="Vertex Group:") + layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + def LATTICE(self, layout, ob, md): split = layout.split() @@ -397,7 +434,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = layout.column() - if md.use_mirror_merge == True: + if md.use_mirror_merge is True: col.prop(md, "merge_threshold") col.label(text="Mirror Object:") col.prop(md, "mirror_object", text="") @@ -559,7 +596,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() row = col.row() - row.active = (md.object is None or md.use_object_screw_offset == False) + row.active = (md.object is None or md.use_object_screw_offset is False) row.prop(md, "screw_offset") row = col.row() row.active = (md.object is not None) @@ -588,6 +625,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "wrap_method", text="") if md.wrap_method == 'PROJECT': + col.prop(md, "project_limit", text="Limit") split = layout.split(percentage=0.25) col = split.column() @@ -605,8 +643,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.label(text="Cull Faces:") col.prop(md, "cull_face", expand=True) - layout.label(text="Auxiliary Target:") - layout.prop(md, "auxiliary_target", text="") + layout.prop(md, "auxiliary_target") elif md.wrap_method == 'NEAREST_SURFACEPOINT': layout.prop(md, "use_keep_above_surface") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index da05fb268c5..f9787c24695 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -190,6 +190,14 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): layout.operator("mesh.navmesh_reset") layout.operator("mesh.navmesh_clear") + if physics_type not in {'NO_COLLISION', 'OCCLUDE'}: + layout.separator() + split = layout.split() + + col = split.column() + col.prop(game, "collision_group") + col = split.column() + col.prop(game, "collision_mask") class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): bl_label = "Collision Bounds" diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 8eecbf4b604..951644db752 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -753,6 +753,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, Panel): row = sub.row() row.active = bool(mat.light_group) row.prop(mat, "use_light_group_exclusive", text="Exclusive") + row.prop(mat, "use_light_group_local", text="Local") col = split.column() col.prop(mat, "use_face_texture") diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index f2c631b7ab1..8a668b5d95b 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -290,10 +290,8 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): row.prop(ob, "slow_parent_offset", text="Offset") -from bl_ui.properties_animviz import ( - MotionPathButtonsPanel, - OnionSkinButtonsPanel, - ) +from bl_ui.properties_animviz import (MotionPathButtonsPanel, + OnionSkinButtonsPanel) class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index fba7bd8712a..3fa63bac13c 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -88,7 +88,6 @@ class ConstraintButtonsPanel(): col = split.column() col.prop(con, "chain_count") - col.prop(con, "use_target") def CHILD_OF(self, context, layout, con): self.target_template(layout, con) @@ -162,7 +161,6 @@ class ConstraintButtonsPanel(): col.prop(con, "use_tail") col.prop(con, "use_stretch") col.separator() - col.prop(con, "use_target") col.prop(con, "use_rotation") def IK_COPY_POSE(self, context, layout, con): @@ -485,6 +483,8 @@ class ConstraintButtonsPanel(): row.prop(con, "use_transform_limit") row.label() + self.space_template(layout, con) + def STRETCH_TO(self, context, layout, con): self.target_template(layout, con) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index aa0ea1d2d9e..6fcd56fb99e 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -21,12 +21,11 @@ import bpy from bpy.types import Panel from rna_prop_ui import PropertyPanel -from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - basic_force_field_settings_ui, - basic_force_field_falloff_ui, - ) +from bl_ui.properties_physics_common import (point_cache_ui, + effector_weights_ui, + basic_force_field_settings_ui, + basic_force_field_falloff_ui, + ) def particle_panel_enabled(context, psys): @@ -52,7 +51,7 @@ def particle_panel_poll(cls, context): if not settings: return False - return settings.is_fluid == False and (engine in cls.COMPAT_ENGINES) + return settings.is_fluid is False and (engine in cls.COMPAT_ENGINES) def particle_get_settings(context): @@ -133,13 +132,13 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): split = layout.split(percentage=0.32) col = split.column() col.label(text="Name:") - if part.is_fluid == False: + if part.is_fluid is False: col.label(text="Settings:") col.label(text="Type:") col = split.column() col.prop(psys, "name", text="") - if part.is_fluid == False: + if part.is_fluid is False: row = col.row() row.enabled = particle_panel_enabled(context, psys) row.template_ID(psys, "settings", new="particle.new") @@ -279,7 +278,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): cloth = psys.cloth.settings - layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked == False + layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False split = layout.split() @@ -813,7 +812,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): sub.active = (part.use_strand_primitive is False) sub.prop(part, "use_render_adaptive") sub = col.column() - sub.active = part.use_render_adaptive or part.use_strand_primitive == True + sub.active = part.use_render_adaptive or part.use_strand_primitive is True sub.prop(part, "adaptive_angle") sub = col.column() sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False) @@ -831,9 +830,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): row = layout.row() col = row.column() - if part.type == 'HAIR' and part.use_strand_primitive == True and part.child_type == 'INTERPOLATED': + if part.type == 'HAIR' and part.use_strand_primitive is True and part.child_type == 'INTERPOLATED': layout.prop(part, "use_simplify") - if part.use_simplify == True: + if part.use_simplify is True: row = layout.row() row.prop(part, "simplify_refsize") row.prop(part, "simplify_rate") @@ -841,7 +840,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): row = layout.row() row.prop(part, "use_simplify_viewport") sub = row.row() - sub.active = part.use_simplify_viewport == True + sub.active = part.use_simplify_viewport is True sub.prop(part, "simplify_viewport") elif part.render_type == 'OBJECT': @@ -988,11 +987,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): if part.draw_percentage != 100 and psys is not None: if part.type == 'HAIR': - if psys.use_hair_dynamics and psys.point_cache.is_baked == False: + if psys.use_hair_dynamics and psys.point_cache.is_baked is False: layout.row().label(text="Display percentage makes dynamics inaccurate without baking!") else: phystype = part.physics_type - if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked == False: + if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False: layout.row().label(text="Display percentage makes dynamics inaccurate without baking!") row = layout.row() @@ -1125,7 +1124,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel): def draw(self, context): part = particle_get_settings(context) - effector_weights_ui(self, context, part.effector_weights) + effector_weights_ui(self, context, part.effector_weights, 'PSYS') if part.type == 'HAIR': row = self.layout.row() diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 33b977b5f04..5a44294f0e0 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -20,10 +20,8 @@ import bpy from bpy.types import Menu, Panel -from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - ) +from bl_ui.properties_physics_common import (point_cache_ui, + effector_weights_ui) def cloth_panel_enabled(md): @@ -178,7 +176,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): ob = context.object cloth = context.cloth.settings - layout.active = cloth.use_stiffness_scale and cloth_panel_enabled(md) + layout.active = (cloth.use_stiffness_scale and cloth_panel_enabled(md)) split = layout.split() @@ -199,7 +197,7 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): def draw(self, context): cloth = context.cloth.settings - effector_weights_ui(self, context, cloth.effector_weights) + effector_weights_ui(self, context, cloth.effector_weights, 'CLOTH') if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 7f824d94431..405e877d1e2 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -133,7 +133,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): row.prop(cache, "frame_end") if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}: row.prop(cache, "frame_step") - row.prop(cache, "use_quick_cache") + if cachetype != 'SMOKE': layout.label(text=cache.info) @@ -160,7 +160,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): col = split.column() - if cache.is_baked == True: + if cache.is_baked is True: col.operator("ptcache.free_bake", text="Free Bake") else: col.operator("ptcache.bake", text="Bake").bake = True @@ -179,7 +179,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): col.operator("ptcache.bake_all", text="Update All To Frame").bake = False -def effector_weights_ui(self, context, weights): +def effector_weights_ui(self, context, weights, weight_type): layout = self.layout layout.prop(weights, "group") @@ -200,6 +200,8 @@ def effector_weights_ui(self, context, weights): col.prop(weights, "wind", slider=True) col.prop(weights, "curve_guide", slider=True) col.prop(weights, "texture", slider=True) + if weight_type != 'SMOKE': + col.prop(weights, "smokeflow", slider=True) col = split.column() col.prop(weights, "harmonic", slider=True) diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index db0794d8a8a..1df2936b2d4 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -20,10 +20,9 @@ import bpy from bpy.types import Panel -from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - ) +from bl_ui.properties_physics_common import (point_cache_ui, + effector_weights_ui, + ) class PhysicButtonsPanel(): @@ -350,7 +349,7 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): col = layout.column() col.active = surface.use_drip - effector_weights_ui(self, context, surface.effector_weights) + effector_weights_ui(self, context, surface.effector_weights, 'DYNAMIC_PAINT') layout.label(text="Surface Movement:") row = layout.row() diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index 569037cb0da..933a9aa12a3 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -20,10 +20,9 @@ import bpy from bpy.types import Panel -from bl_ui.properties_physics_common import ( - basic_force_field_settings_ui, - basic_force_field_falloff_ui, - ) +from bl_ui.properties_physics_common import (basic_force_field_settings_ui, + basic_force_field_falloff_ui, + ) class PhysicButtonsPanel(): @@ -113,6 +112,14 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): col = split.column() col.prop(field, "use_object_coords") col.prop(field, "use_2d_force") + elif field.type == 'SMOKE_FLOW': + col = split.column() + col.prop(field, "strength") + col.prop(field, "flow") + col = split.column() + col.label(text="Domain Object:") + col.prop(field, "source_object", "") + col.prop(field, "use_smoke_density") else: basic_force_field_settings_ui(self, context, field) diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 1b333f1e505..ce5053f0ecf 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -20,10 +20,8 @@ import bpy from bpy.types import Panel -from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - ) +from bl_ui.properties_physics_common import (point_cache_ui, + effector_weights_ui) class PhysicButtonsPanel(): @@ -78,28 +76,40 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): elif md.smoke_type == 'FLOW': flow = md.flow_settings - - split = layout.split() - - col = split.column() - col.prop(flow, "use_outflow") - col.label(text="Particle System:") - col.prop_search(flow, "particle_system", ob, "particle_systems", text="") - - sub = col.column() - sub.active = not md.flow_settings.use_outflow - - sub.prop(flow, "initial_velocity", text="Initial Velocity") - sub = sub.column() - sub.active = flow.initial_velocity - sub.prop(flow, "velocity_factor", text="Multiplier") - - sub = split.column() - sub.active = not md.flow_settings.use_outflow - sub.label(text="Initial Values:") - sub.prop(flow, "use_absolute") - sub.prop(flow, "density") - sub.prop(flow, "temperature") + + layout.prop(flow, "smoke_flow_type", expand=False) + + if flow.smoke_flow_type != "OUTFLOW": + split = layout.split() + col = split.column() + col.label(text="Flow Source:") + col.prop(flow, "smoke_flow_source", expand=False, text="") + if flow.smoke_flow_source == "PARTICLES": + col.label(text="Particle System:") + col.prop_search(flow, "particle_system", ob, "particle_systems", text="") + else: + col.prop(flow, "surface_distance") + col.prop(flow, "volume_density") + + sub = col.column(align=True) + + sub.prop(flow, "initial_velocity") + sub = sub.column() + sub.active = flow.initial_velocity + sub.prop(flow, "velocity_factor") + if flow.smoke_flow_source == "MESH": + sub.prop(flow, "velocity_normal") + #sub.prop(flow, "velocity_random") + + sub = split.column() + sub.label(text="Initial Values:") + sub.prop(flow, "use_absolute") + if flow.smoke_flow_type in {'SMOKE', 'BOTH'}: + sub.prop(flow, "density") + sub.prop(flow, "temperature") + sub.prop(flow, "smoke_color") + if flow.smoke_flow_type in {'FIRE', 'BOTH'}: + sub.prop(flow, "fuel_amount") elif md.smoke_type == 'COLLISION': coll = md.coll_settings @@ -108,36 +118,99 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): col = split.column() col.prop(coll, "collision_type") + +class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): + bl_label = "Smoke Flow Advanced" + bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'FLOW') and (md.flow_settings.smoke_flow_source == "MESH") -class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): - bl_label = "Smoke Groups" + def draw(self, context): + layout = self.layout + ob = context.object + flow = context.smoke.flow_settings + + split = layout.split() + col = split.column() + + col.prop(flow, "use_texture") + sub = col.column() + sub.active = flow.use_texture + sub.prop(flow, "noise_texture", text="") + sub.label(text="Mapping:") + sub.prop(flow, "texture_map_type", expand=False, text="") + if flow.texture_map_type == "UV": + sub.prop_search(flow, "uv_layer", ob.data, "uv_textures", text="") + if flow.texture_map_type == "AUTO": + sub.prop(flow, "texture_size") + sub.prop(flow, "texture_offset") + + col = split.column() + col.label(text="Vertex Group:") + col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="") + +class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): + bl_label = "Smoke Flames" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) + return md and (md.smoke_type == 'DOMAIN') def draw(self, context): layout = self.layout - - group = context.smoke.domain_settings + domain = context.smoke.domain_settings split = layout.split() + split.enabled = not domain.point_cache.is_baked + + col = split.column(align=True) + col.label(text="Reaction:") + col.prop(domain, "burning_rate") + col.prop(domain, "flame_smoke") + col.prop(domain, "flame_vorticity") + + col = split.column(align=True) + col.label(text="Temperatures:") + col.prop(domain, "flame_ignition") + col.prop(domain, "flame_max_temp") + col.prop(domain, "flame_smoke_color") + +class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): + bl_label = "Smoke Adaptive Domain" + bl_options = {'DEFAULT_CLOSED'} - col = split.column() - col.label(text="Flow Group:") - col.prop(group, "fluid_group", text="") + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'DOMAIN') - #col.label(text="Effector Group:") - #col.prop(group, "effector_group", text="") + def draw_header(self, context): + md = context.smoke.domain_settings - col = split.column() - col.label(text="Collision Group:") - col.prop(group, "collision_group", text="") + self.layout.prop(md, "use_adaptive_domain", text="") + def draw(self, context): + layout = self.layout + + domain = context.smoke.domain_settings + layout.active = domain.use_adaptive_domain + + split = layout.split() + split.enabled = not domain.point_cache.is_baked + + col = split.column(align=True) + col.label(text="Resolution:") + col.prop(domain, "additional_res") + col.prop(domain, "adapt_margin") + + col = split.column(align=True) + col.label(text="Advanced:") + col.prop(domain, "adapt_threshold") class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): bl_label = "Smoke High Resolution" @@ -176,6 +249,32 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): layout.prop(md, "show_high_resolution") +class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): + bl_label = "Smoke Groups" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.smoke + rd = context.scene.render + return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) + + def draw(self, context): + layout = self.layout + domain = context.smoke.domain_settings + + split = layout.split() + + col = split.column() + col.label(text="Flow Group:") + col.prop(domain, "fluid_group", text="") + + #col.label(text="Effector Group:") + #col.prop(domain, "effector_group", text="") + + col = split.column() + col.label(text="Collision Group:") + col.prop(domain, "collision_group", text="") class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): bl_label = "Smoke Cache" @@ -211,7 +310,7 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): def draw(self, context): domain = context.smoke.domain_settings - effector_weights_ui(self, context, domain.effector_weights) + effector_weights_ui(self, context, domain.effector_weights, 'SMOKE') if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index b043c1f9b68..79d676533a5 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -20,10 +20,8 @@ import bpy from bpy.types import Panel -from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - ) +from bl_ui.properties_physics_common import (point_cache_ui, + effector_weights_ui) def softbody_panel_enabled(md): @@ -233,7 +231,7 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel): md = context.soft_body softbody = md.settings - effector_weights_ui(self, context, softbody.effector_weights) + effector_weights_ui(self, context, softbody.effector_weights, 'SOFTBODY') if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 74f4c719cd5..9814dd7e902 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -225,7 +225,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): # TODO: Change the following to iterate over existing presets custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60}) - if custom_framerate == True: + if custom_framerate is True: fps_label_text = "Custom (" + str(fps_rate) + " fps)" else: fps_label_text = str(fps_rate) + " fps" @@ -332,15 +332,17 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Threads:") - col.row().prop(rd, "threads_mode", expand=True) - sub = col.column() - sub.enabled = rd.threads_mode == 'FIXED' - sub.prop(rd, "threads") sub = col.column(align=True) - sub.label(text="Tiles:") - sub.prop(rd, "parts_x", text="X") - sub.prop(rd, "parts_y", text="Y") + sub.label(text="Threads:") + sub.row().prop(rd, "threads_mode", expand=True) + subsub = sub.column() + subsub.enabled = rd.threads_mode == 'FIXED' + subsub.prop(rd, "threads") + + sub = col.column(align=True) + sub.label(text="Tile Size:") + sub.prop(rd, "tile_x", text="X") + sub.prop(rd, "tile_y", text="Y") col = split.column() col.label(text="Memory:") diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 46a17675c91..e623d034b48 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -111,8 +111,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): engine = context.scene.render.engine if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")): return False - return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings)) - and (engine in cls.COMPAT_ENGINES)) + return ((context.material or + context.world or + context.lamp or + context.brush or + context.texture or + context.particle_system or + isinstance(context.space_data.pin_id, ParticleSettings)) and + (engine in cls.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -143,20 +149,15 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN' col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="") - split = layout.split(percentage=0.65) - col = split.column() - if tex_collection: - col.template_ID(idblock, "active_texture", new="texture.new") + layout.template_ID(idblock, "active_texture", new="texture.new") elif node: - col.template_ID(node, "texture", new="texture.new") + layout.template_ID(node, "texture", new="texture.new") elif idblock: - col.template_ID(idblock, "texture", new="texture.new") + layout.template_ID(idblock, "texture", new="texture.new") if pin_id: - col.template_ID(space, "pin_id") - - col = split.column() + layout.template_ID(space, "pin_id") if tex: split = layout.split(percentage=0.2) @@ -881,8 +882,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): col = split.column() if tex.texture_coords in {'ORCO', 'UV'}: col.prop(tex, "use_from_dupli") + if (idblock.type == 'VOLUME' and tex.texture_coords == 'ORCO'): + col.prop(tex, "use_map_to_bounds") elif tex.texture_coords == 'OBJECT': col.prop(tex, "use_from_original") + if (idblock.type == 'VOLUME'): + col.prop(tex, "use_map_to_bounds") else: col.label() diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index b0e8a847084..cb88226b55a 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -311,8 +311,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): col = layout.column(align=True) col.active = not settings.use_tripod_solver - col.prop(settings, "keyframe_a") - col.prop(settings, "keyframe_b") + col.prop(tracking_object, "keyframe_a") + col.prop(tracking_object, "keyframe_b") col = layout.column(align=True) col.active = (tracking_object.is_camera and @@ -320,6 +320,13 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): col.label(text="Refine:") col.prop(settings, "refine_intrinsics", text="") + col = layout.column(align=True) + col.active = not settings.use_tripod_solver + col.prop(settings, "use_fallback_reconstruction", text="Allow Fallback") + sub = col.column() + sub.active = settings.use_fallback_reconstruction + sub.prop(settings, "reconstruction_success_threshold") + class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' @@ -891,6 +898,12 @@ class CLIP_MT_view(Menu): layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b else: + if sc.view == 'GRAPH': + layout.operator_context = 'INVOKE_REGION_PREVIEW' + layout.operator("clip.graph_center_current_frame") + layout.operator("clip.graph_view_all") + layout.operator_context = 'INVOKE_DEFAULT' + layout.prop(sc, "show_seconds") layout.separator() @@ -942,7 +955,7 @@ class CLIP_MT_track(Menu): props.action = 'UPTO' props = layout.operator("clip.clear_track_path", - text="Clear Track Path") + text="Clear Track Path") props.action = 'ALL' layout.separator() @@ -957,7 +970,7 @@ class CLIP_MT_track(Menu): layout.separator() props = layout.operator("clip.track_markers", - text="Track Frame Backwards") + text="Track Frame Backwards") props.backwards = True props = layout.operator("clip.track_markers", text="Track Backwards") diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py index 7ded4954f80..5ff179902a3 100644 --- a/release/scripts/startup/bl_ui/space_console.py +++ b/release/scripts/startup/bl_ui/space_console.py @@ -86,7 +86,7 @@ class CONSOLE_MT_language(Menu): def add_scrollback(text, text_type): for l in text.split("\n"): bpy.ops.console.scrollback_append(text=l.replace('\t', ' '), - type=text_type) + type=text_type) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 8e955338480..a81553a8257 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -29,6 +29,7 @@ from bpy.types import Header, Menu def dopesheet_filter(layout, context, genericFiltersOnly=False): dopesheet = context.space_data.dopesheet is_nla = context.area.type == 'NLA_EDITOR' + is_drivers = (context.area.type == 'GRAPH_EDITOR' and context.space_data.mode == 'DRIVERS') row = layout.row(align=True) row.prop(dopesheet, "show_only_selected", text="") @@ -37,6 +38,9 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False): if is_nla: row.prop(dopesheet, "show_missing_nla", text="") + if is_drivers: + row.prop(dopesheet, "show_only_errors", text="") + if not genericFiltersOnly: if bpy.data.groups: row = layout.row(align=True) @@ -161,7 +165,6 @@ class DOPESHEET_MT_view(Menu): layout.operator("action.previewrange_set") layout.separator() - layout.operator("action.frame_jump") layout.operator("action.view_all") layout.operator("action.view_selected") @@ -272,6 +275,9 @@ class DOPESHEET_MT_key(Menu): layout.operator("action.keyframe_insert") layout.separator() + layout.operator("action.frame_jump") + + layout.separator() layout.operator("action.duplicate_move") layout.operator("action.delete") diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 435b968f243..256545bab70 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -67,6 +67,7 @@ class FILEBROWSER_HT_header(Header): row.label(params.filter_glob) else: row.prop(params, "use_filter_blender", text="") + row.prop(params, "use_filter_backup", text="") row.prop(params, "use_filter_image", text="") row.prop(params, "use_filter_movie", text="") row.prop(params, "use_filter_script", text="") diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 972b4ebe721..e89bd78a84f 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -96,7 +96,6 @@ class GRAPH_MT_view(Menu): layout.operator("graph.previewrange_set") layout.separator() - layout.operator("graph.frame_jump") layout.operator("graph.view_all") layout.operator("graph.view_selected") @@ -199,6 +198,9 @@ class GRAPH_MT_key(Menu): layout.operator("graph.sound_bake") layout.separator() + layout.operator("graph.frame_jump") + + layout.separator() layout.operator("graph.duplicate_move") layout.operator("graph.delete") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 5302ad9b471..18eb8f8d9dd 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -684,7 +684,7 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel): if brush: col = layout.column() - col.template_color_wheel(brush, "color", value_slider=True) + col.template_color_picker(brush, "color", value_slider=True) col.prop(brush, "color", text="") row = col.row(align=True) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 9ab2a772df0..c0f2d3c361b 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -112,8 +112,9 @@ class INFO_MT_file(Menu): layout.separator() - layout.operator_context = 'INVOKE_AREA' - layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False + layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA' + layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK') + layout.operator_context = 'INVOKE_AREA' layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS') layout.operator_context = 'INVOKE_AREA' diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 846169b3339..730398171d6 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -107,5 +107,10 @@ class LOGIC_MT_view(Menu): layout.operator("logic.properties", icon='MENU_PANEL') + layout.separator() + + layout.operator("screen.area_dupli") + layout.operator("screen.screen_full_area") + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 5b7ecbfb618..c46b1c20738 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -166,11 +166,19 @@ class NODE_MT_node(Menu): layout.operator("node.delete_reconnect") layout.separator() + + layout.operator("node.join", text="Join in new Frame") + layout.operator("node.detach", text="Remove from Frame") + + layout.separator() + layout.operator("node.link_make") layout.operator("node.link_make", text="Make and Replace Links").replace = True layout.operator("node.links_cut") + layout.operator("node.links_detach") layout.separator() + layout.operator("node.group_edit") layout.operator("node.group_ungroup") layout.operator("node.group_make") diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 4a418698e26..ad4074d9744 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -31,21 +31,21 @@ def act_strip(context): def draw_color_balance(layout, color_balance): col = layout.column() col.label(text="Lift:") - col.template_color_wheel(color_balance, "lift", value_slider=True, cubic=True) + col.template_color_picker(color_balance, "lift", value_slider=True, cubic=True) row = col.row() row.prop(color_balance, "lift", text="") row.prop(color_balance, "invert_lift", text="Inverse") col = layout.column() col.label(text="Gamma:") - col.template_color_wheel(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True) + col.template_color_picker(color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True) row = col.row() row.prop(color_balance, "gamma", text="") row.prop(color_balance, "invert_gamma", text="Inverse") col = layout.column() col.label(text="Gain:") - col.template_color_wheel(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True) + col.template_color_picker(color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True) row = col.row() row.prop(color_balance, "gain", text="") row.prop(color_balance, "invert_gain", text="Inverse") @@ -601,6 +601,8 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): split.label(text="File:") split.prop(elem, "filename", text="") # strip.elements[0] could be a fallback + layout.prop(strip.colorspace_settings, "name") + layout.operator("sequencer.change_path") elif seq_type == 'MOVIE': @@ -608,6 +610,8 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): split.label(text="Path:") split.prop(strip, "filepath", text="") + layout.prop(strip.colorspace_settings, "name") + layout.prop(strip, "mpeg_preseek") layout.prop(strip, "stream_index") @@ -860,7 +864,6 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): render = context.scene.render col = layout.column() - col.active = False # Currently only opengl preview works! col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview") col = layout.column() #col.active = render.use_sequencer_gl_preview diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index eca9bc22db9..a64f8aa4aed 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -56,12 +56,17 @@ class TEXT_HT_header(Header): row.prop(st, "show_syntax_highlight", text="") if text: - row = layout.row() - row.operator("text.run_script") + osl = text.name.endswith(".osl") or text.name.endswith(".oso") - row = layout.row() - row.active = text.name.endswith(".py") - row.prop(text, "use_module") + if osl: + row = layout.row() + row.operator("node.shader_script_update") + else: + row = layout.row() + row.operator("text.run_script") + + row = layout.row() + row.prop(text, "use_module") row = layout.row() if text.filepath: @@ -149,12 +154,7 @@ class TEXT_MT_view(Menu): layout = self.layout layout.operator("text.properties", icon='MENU_PANEL') - - layout.separator() - - layout.operator("screen.area_dupli") - layout.operator("screen.screen_full_area") - + layout.separator() layout.operator("text.move", @@ -164,6 +164,11 @@ class TEXT_MT_view(Menu): text="Bottom of File", ).type = 'FILE_BOTTOM' + layout.separator() + + layout.operator("screen.area_dupli") + layout.operator("screen.screen_full_area") + class TEXT_MT_text(Menu): bl_label = "Text" diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index ed1d2a0ae24..cb9e2444793 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -127,6 +127,11 @@ class TIME_MT_view(Menu): layout.operator("marker.camera_bind") + layout.separator() + + layout.operator("screen.area_dupli") + layout.operator("screen.screen_full_area") + class TIME_MT_cache(Menu): bl_label = "Cache" diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 64bf1e29348..de55eaba775 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -92,7 +92,7 @@ class USERPREF_HT_header(Header): layout.operator("wm.keyconfig_import") layout.operator("wm.keyconfig_export") elif userpref.active_section == 'ADDONS': - layout.operator("wm.addon_install") + layout.operator("wm.addon_install", icon="FILESEL") layout.menu("USERPREF_MT_addons_dev_guides") elif userpref.active_section == 'THEMES': layout.operator("ui.reset_default_theme") @@ -248,7 +248,7 @@ class USERPREF_PT_interface(Panel): col.prop(view, "show_splash") if os.name == "nt": - col.prop(view, "quit_dialog") + col.prop(view, "use_quit_dialog") class USERPREF_PT_edit(Panel): @@ -299,9 +299,9 @@ class USERPREF_PT_edit(Panel): col.label(text="Grease Pencil:") col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") - #~ col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") col.prop(edit, "use_grease_pencil_smooth_stroke", text="Smooth Stroke") + col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") col.separator() col.separator() col.separator() @@ -324,6 +324,7 @@ class USERPREF_PT_edit(Panel): col.separator() col.prop(edit, "use_auto_keying", text="Auto Keyframing:") + col.prop(edit, "use_auto_keying_warning") sub = col.column() @@ -421,7 +422,7 @@ class USERPREF_PT_system(Panel): col.separator() col.separator() - if hasattr(system, "compute_device"): + if hasattr(system, "compute_device_type"): col.label(text="Compute Device:") col.row().prop(system, "compute_device_type", expand=True) sub = col.row() @@ -445,6 +446,7 @@ class USERPREF_PT_system(Panel): #~ col.prop(system, "use_antialiasing") col.label(text="Window Draw Method:") col.prop(system, "window_draw_method", text="") + col.prop(system, "ogl_multisamples", text="") col.label(text="Text Draw Options:") col.prop(system, "use_text_antialiasing") col.label(text="Textures:") @@ -727,6 +729,29 @@ class USERPREF_PT_theme(Panel): colsub = padding.column() colsub.row().prop(ui, "header") + col.separator() + col.separator() + + ui = theme.user_interface + col.label("Axis Colors:") + + row = col.row() + + subsplit = row.split(percentage=0.95) + + padding = subsplit.split(percentage=0.15) + colsub = padding.column() + colsub = padding.column() + colsub.row().prop(ui, "axis_x") + colsub.row().prop(ui, "axis_y") + colsub.row().prop(ui, "axis_z") + + subsplit = row.split(percentage=0.85) + + padding = subsplit.split(percentage=0.15) + colsub = padding.column() + colsub = padding.column() + layout.separator() layout.separator() elif theme.theme_area == 'BONE_COLOR_SETS': @@ -822,6 +847,7 @@ class USERPREF_PT_file(Panel): col.prop(paths, "use_filter_files") col.prop(paths, "show_hidden_files_datablocks") col.prop(paths, "hide_recent_locations") + col.prop(paths, "hide_system_bookmarks") col.prop(paths, "show_thumbnails") col.separator() @@ -1039,6 +1065,9 @@ class USERPREF_PT_addons(Panel): userpref = context.user_preferences used_ext = {ext.module for ext in userpref.addons} + userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons") + scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons") + # collect the categories that can be filtered on addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)] @@ -1084,10 +1113,12 @@ class USERPREF_PT_addons(Panel): continue # check if addon should be visible with current filters - if ((filter == "All") or - (filter == info["category"]) or - (filter == "Enabled" and is_enabled) or - (filter == "Disabled" and not is_enabled)): + if ((filter == "All") or + (filter == info["category"]) or + (filter == "Enabled" and is_enabled) or + (filter == "Disabled" and not is_enabled) or + (filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder)))) + ): if search and search not in info["name"].lower(): if info["author"]: diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 6646da4a91a..81d67aa662c 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -186,10 +186,10 @@ class InputKeyMapPanel: sub = split.column() subrow = sub.row(align=True) - if map_type in {'KEYBOARD', 'NDOF'}: + if map_type == 'KEYBOARD': subrow.prop(kmi, "type", text="", event=True) subrow.prop(kmi, "value", text="") - elif map_type == 'MOUSE': + elif map_type in {'MOUSE', 'NDOF'}: subrow.prop(kmi, "type", text="") subrow.prop(kmi, "value", text="") @@ -218,8 +218,8 @@ class InputKeyMapPanel: layout.context_pointer_set("keymap", km) filtered_items = [kmi for kmi in km.keymap_items - if filter_text in kmi.idname.lower() or - filter_text in kmi.name.lower()] + if (filter_text in kmi.idname.lower() or + filter_text in kmi.name.lower())] if filtered_items: col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a77c5818fca..b29f51d90a2 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -168,6 +168,8 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base): # generic... layout = self.layout + layout.operator("transform.shrink_fatten", text="Shrink Fatten") + layout.separator() layout.operator("transform.translate", text="Move Texture Space").texture_space = True @@ -223,8 +225,8 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): layout.separator() obj = context.object - if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and - obj.data.draw_type in {'BBONE', 'ENVELOPE'}): + if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and + obj.data.draw_type in {'BBONE', 'ENVELOPE'}): layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE' if context.edit_object and context.edit_object.type == 'ARMATURE': @@ -356,6 +358,7 @@ class VIEW3D_MT_view(Menu): layout.operator("view3d.clip_border", text="Clipping Border...") layout.operator("view3d.zoom_border", text="Zoom Border...") + layout.operator("view3d.render_border", text="Render Border...") layout.separator() @@ -571,7 +574,7 @@ class VIEW3D_MT_select_edit_mesh(Menu): layout.separator() layout.operator("mesh.select_random", text="Random") - layout.operator("mesh.select_nth", text="Every N Number of Verts") + layout.operator("mesh.select_nth") layout.operator("mesh.edges_select_sharp", text="Sharp Edges") layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces") layout.operator("mesh.select_interior_faces", text="Interior Faces") @@ -579,8 +582,8 @@ class VIEW3D_MT_select_edit_mesh(Menu): layout.separator() - layout.operator("mesh.select_by_number_vertices", text="By Number of Verts") - if context.scene.tool_settings.mesh_select_mode[2] == False: + layout.operator("mesh.select_face_by_sides") + if context.scene.tool_settings.mesh_select_mode[2] is False: layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges") layout.operator_menu_enum("mesh.select_similar", "type", text="Similar") @@ -968,8 +971,9 @@ class VIEW3D_MT_object_parent(Menu): def draw(self, context): layout = self.layout - layout.operator_menu_enum("object.parent_set", "type", text="Set") - layout.operator_menu_enum("object.parent_clear", "type", text="Clear") + layout.operator_enum("object.parent_set", "type") + layout.separator() + layout.operator_enum("object.parent_clear", "type") class VIEW3D_MT_object_track(Menu): @@ -978,8 +982,9 @@ class VIEW3D_MT_object_track(Menu): def draw(self, context): layout = self.layout - layout.operator_menu_enum("object.track_set", "type", text="Set") - layout.operator_menu_enum("object.track_clear", "type", text="Clear") + layout.operator_enum("object.track_set", "type") + layout.separator() + layout.operator_enum("object.track_clear", "type") class VIEW3D_MT_object_group(Menu): @@ -1247,6 +1252,8 @@ class VIEW3D_MT_paint_weight(Menu): layout.operator("object.vertex_group_clean", text="Clean") layout.operator("object.vertex_group_levels", text="Levels") layout.operator("object.vertex_group_blend", text="Blend") + layout.operator("object.vertex_group_transfer_weight", text="Transfer Weights") + layout.operator("object.vertex_group_limit_total", text="Limit Total") layout.operator("object.vertex_group_fix", text="Fix Deforms") layout.separator() @@ -1283,6 +1290,7 @@ class VIEW3D_MT_sculpt(Menu): layout.prop(sculpt, "show_low_resolution") layout.prop(sculpt, "show_brush") layout.prop(sculpt, "use_deform_only") + layout.prop(sculpt, "show_diffuse_color") class VIEW3D_MT_hide_mask(Menu): @@ -1528,13 +1536,20 @@ class VIEW3D_MT_pose_group(Menu): def draw(self, context): layout = self.layout - layout.operator("pose.group_add") - layout.operator("pose.group_remove") + + pose = context.active_object.pose - layout.separator() + layout.operator_context = 'EXEC_AREA' + layout.operator("pose.group_assign", text="Assign to New Group").type = 0 + if pose.bone_groups: + active_group = pose.bone_groups.active_index + 1 + layout.operator("pose.group_assign", text="Assign to Group").type = active_group + + layout.separator() - layout.operator("pose.group_assign") - layout.operator("pose.group_unassign") + #layout.operator_context = 'INVOKE_AREA' + layout.operator("pose.group_unassign") + layout.operator("pose.group_remove") class VIEW3D_MT_pose_ik(Menu): @@ -1659,7 +1674,7 @@ class VIEW3D_MT_edit_mesh(Menu): layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...") layout.separator() - + layout.operator("mesh.symmetrize") layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region") layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual") layout.operator("mesh.duplicate_move") @@ -1701,6 +1716,7 @@ class VIEW3D_MT_edit_mesh_specials(Menu): layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT' layout.operator("mesh.flip_normals") layout.operator("mesh.vertices_smooth", text="Smooth") + layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth") layout.operator("mesh.inset") layout.operator("mesh.bevel", text="Bevel") layout.operator("mesh.bridge_edge_loops") @@ -1710,6 +1726,7 @@ class VIEW3D_MT_edit_mesh_specials(Menu): layout.operator("mesh.shape_propagate_to_all") layout.operator("mesh.select_vertex_path") layout.operator("mesh.sort_elements") + layout.operator("mesh.symmetrize") class VIEW3D_MT_edit_mesh_select_mode(Menu): @@ -1776,6 +1793,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu): layout.operator("mesh.merge") layout.operator("mesh.rip_move") + layout.operator("mesh.rip_move_fill") layout.operator("mesh.split") layout.operator_menu_enum("mesh.separate", "type") layout.operator("mesh.vert_connect") @@ -1810,6 +1828,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.operator("mesh.edge_face_add") layout.operator("mesh.subdivide") + layout.operator("mesh.unsubdivide") layout.separator() @@ -1927,10 +1946,6 @@ class VIEW3D_MT_edit_mesh_dissolve(Menu): layout.separator() - layout.operator_enum("mesh.dissolve", "type") - - layout.separator() - layout.operator("mesh.dissolve_limited") @@ -2145,6 +2160,7 @@ class VIEW3D_MT_edit_lattice(Menu): layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_mirror") layout.menu("VIEW3D_MT_snap") + layout.operator_menu_enum("lattice.flip", "axis") layout.separator() @@ -2282,7 +2298,7 @@ class VIEW3D_PT_view3d_properties(Panel): if lock_object.type == 'ARMATURE': col.prop_search(view, "lock_bone", lock_object.data, "edit_bones" if lock_object.mode == 'EDIT' - else "bones", + else "bones", text="") else: col.prop(view, "lock_cursor", text="Lock to Cursor") @@ -2300,6 +2316,9 @@ class VIEW3D_PT_view3d_properties(Panel): subcol.label(text="Local Camera:") subcol.prop(view, "camera", text="") + col = layout.column(align=True) + col.prop(view, "use_render_border") + class VIEW3D_PT_view3d_cursor(Panel): bl_space_type = 'VIEW_3D' diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 1b67b30d17a..91132a72b07 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -520,8 +520,8 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): row = col.row(align=True) ups = toolsettings.unified_paint_settings - if ((ups.use_unified_size and ups.use_locked_size) or - ((not ups.use_unified_size) and brush.use_locked_size)): + if ((ups.use_unified_size and ups.use_locked_size) or + ((not ups.use_unified_size) and brush.use_locked_size)): self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED') self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius") else: @@ -633,7 +633,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): elif context.image_paint_object and brush: col = layout.column() - col.template_color_wheel(brush, "color", value_slider=True) + col.template_color_picker(brush, "color", value_slider=True) col.prop(brush, "color", text="") row = col.row(align=True) @@ -681,7 +681,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): # Vertex Paint Mode # elif context.vertex_paint_object and brush: col = layout.column() - col.template_color_wheel(brush, "color", value_slider=True) + col.template_color_picker(brush, "color", value_slider=True) col.prop(brush, "color", text="") row = col.row(align=True) @@ -707,8 +707,8 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): @classmethod def poll(cls, context): settings = cls.paint_settings(context) - return (settings and settings.brush and (context.sculpt_object or - context.image_paint_object)) + return (settings and settings.brush and + (context.sculpt_object or context.image_paint_object)) def draw(self, context): layout = self.layout @@ -747,10 +747,12 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): @classmethod def poll(cls, context): settings = cls.paint_settings(context) - return (settings and settings.brush and (context.sculpt_object or - context.vertex_paint_object or - context.weight_paint_object or - context.image_paint_object)) + return (settings and + settings.brush and + (context.sculpt_object or + context.vertex_paint_object or + context.weight_paint_object or + context.image_paint_object)) def draw(self, context): layout = self.layout @@ -876,6 +878,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): layout.prop(sculpt, "show_low_resolution") layout.prop(sculpt, "show_brush") layout.prop(sculpt, "use_deform_only") + layout.prop(sculpt, "show_diffuse_color") layout.prop(sculpt, "input_samples") @@ -965,6 +968,8 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel): col.operator("object.vertex_group_clean", text="Clean") col.operator("object.vertex_group_levels", text="Levels") col.operator("object.vertex_group_blend", text="Blend") + col.operator("object.vertex_group_transfer_weight", text="Transfer Weights") + col.operator("object.vertex_group_limit_total", text="Limit Total") col.operator("object.vertex_group_fix", text="Fix Deforms") @@ -1043,7 +1048,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): @classmethod def poll(cls, context): brush = context.tool_settings.image_paint.brush - return (brush and brush.image_tool != 'SOFTEN') + return (brush is not None) def draw_header(self, context): ipaint = context.tool_settings.image_paint diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index b7693880f9c..6ad87375738 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -360,10 +360,10 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # add rotation properties if they will if bone.lock_rotations_4d: # can check individually - if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w == False): + if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w is False): ksi.addProp(ks, bone, prop) else: - if bone.lock_rotation_w == False: + if bone.lock_rotation_w is False: ksi.addProp(ks, bone, prop, 0) # w = 0 for i in range(3): diff --git a/release/scripts/templates/script_stub.py b/release/scripts/templates/script_stub.py new file mode 100644 index 00000000000..3b3212892d5 --- /dev/null +++ b/release/scripts/templates/script_stub.py @@ -0,0 +1,11 @@ +# This stub runs a python script relative to the currently open +# blend file, useful when editing scripts externally. + +import bpy +import os + +# Use your own script name here: +filename = "my_script.py" + +filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename) +exec(compile(open(filepath).read(), filepath, 'exec')) diff --git a/release/scripts/templates/ui_panel.py b/release/scripts/templates/ui_panel.py index 9ffa0cbeeea..cacdb83e815 100644 --- a/release/scripts/templates/ui_panel.py +++ b/release/scripts/templates/ui_panel.py @@ -22,7 +22,7 @@ class LayoutDemoPanel(bpy.types.Panel): row.prop(scene, "frame_end") # Create an row where the buttons are aligned to each other. - layout.label(text=" Aligned Row") + layout.label(text=" Aligned Row:") row = layout.row(align=True) row.prop(scene, "frame_start") @@ -39,9 +39,26 @@ class LayoutDemoPanel(bpy.types.Panel): # Second column, aligned col = split.column(align=True) - col.label(text="Column Two") + col.label(text="Column Two:") col.prop(scene, "frame_start") col.prop(scene, "frame_end") + + # Big render button + layout.label(text="Big Button:") + row = layout.row() + row.scale_y = 3.0 + row.operator("render.render") + + # Different sizes in a row + layout.label(text="Different button sizes:") + row = layout.row(align=True) + row.operator("render.render") + + sub = row.row() + sub.scale_x = 2.0 + sub.operator("render.render") + + row.operator("render.render") def register(): |