diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2012-02-02 03:22:55 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2012-02-02 03:22:55 +0400 |
commit | 28f1fdd39bbb11b1081594e2f41bebef77a31518 (patch) | |
tree | 3475d4f0b15d7ba8e59150fec25adc582ae62afb /release/scripts | |
parent | 6b39a476cbe83febfe67daa31be6fade83194c7a (diff) | |
parent | d882f05b824f4111ef5c319c89a2f85b1773c579 (diff) |
svn merge ^/trunk/blender -r43091:43824(HEAD)
Conflicted file manually update:
===============================
readfile.c
Note 1:
=======
The Double Edge Mask is not in tile since it's not a simple convert.
The author of this node is aware of it and should have it working there eventually.
(I'm going to add it in COM_Converter.cpp in a next commit)
Note 2:
=======
In COM_compositor.cpp we are passing only "Compositing" instead of what we have in trunk "Compositing 1 Gamma"
If we decide to go with trunk then we need to incorporate the 43283 and 43287 commits.
Something like:
COM_compositor.cpp:51
- editingtree->stats_draw(editingtree->sdh, (char*)"Compositing");
+ char str[128];
+ BLI_snprintf(str, sizeof(str), "Compositing %d %s", curnode, node->name)
+ editingtree->stats_draw(editingtree->sdh, str);
Diffstat (limited to 'release/scripts')
49 files changed, 960 insertions, 548 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 21f856a1396..2b1616a0022 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -38,17 +38,17 @@ addons_fake_modules = {} def paths(): # RELEASE SCRIPTS: official scripts distributed in Blender releases - paths = _bpy.utils.script_paths("addons") + addon_paths = _bpy.utils.script_paths("addons") # CONTRIB SCRIPTS: good for testing but not official scripts yet # if folder addons_contrib/ exists, scripts in there will be loaded too - paths += _bpy.utils.script_paths("addons_contrib") + addon_paths += _bpy.utils.script_paths("addons_contrib") # EXTERN SCRIPTS: external projects scripts # if folder addons_extern/ exists, scripts in there will be loaded too - paths += _bpy.utils.script_paths("addons_extern") + addon_paths += _bpy.utils.script_paths("addons_extern") - return paths + return addon_paths def modules(module_cache): @@ -361,7 +361,6 @@ def module_bl_info(mod, info_basis={"name": "", "author": "", "version": (), "blender": (), - "api": 0, "location": "", "description": "", "wiki_url": "", diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py index 8db21e357d9..097a0296a8e 100644 --- a/release/scripts/modules/animsys_refactor.py +++ b/release/scripts/modules/animsys_refactor.py @@ -532,8 +532,6 @@ data_2_56_to_2_59 = ( ("ShaderNodeMapping", "minimum", "min"), ("ShaderNodeMapping", "clamp_maximum", "use_max"), ("ShaderNodeMapping", "clamp_minimum", "use_min"), - ("VertexPaint", "all_faces", "use_all_faces"), - ("VertexPaint", "spray", "use_spray"), ("ParticleEdit", "add_keys", "default_key_count"), ("ParticleEdit", "selection_mode", "select_mode"), ("ParticleEdit", "auto_velocity", "use_auto_velocity"), diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index 6fd15c146f2..d5abcb03164 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -281,10 +281,7 @@ def script_paths(subdir=None, user_pref=True, check_all=False): prefs = _bpy.context.user_preferences # add user scripts dir - if user_pref: - user_script_path = prefs.filepaths.script_directory - else: - user_script_path = None + user_script = prefs.filepaths.script_directory if user_pref else None if check_all: # all possible paths @@ -294,7 +291,7 @@ def script_paths(subdir=None, user_pref=True, check_all=False): # only paths blender uses base_paths = _bpy_script_paths() - for path in base_paths + (user_script_path, ): + for path in base_paths + (user_script, ): if path: path = _os.path.normpath(path) if path not in scripts and _os.path.isdir(path): @@ -303,13 +300,13 @@ def script_paths(subdir=None, user_pref=True, check_all=False): if subdir is None: return scripts - script_paths = [] + scripts_subdir = [] for path in scripts: path_subdir = _os.path.join(path, subdir) if _os.path.isdir(path_subdir): - script_paths.append(path_subdir) + scripts_subdir.append(path_subdir) - return script_paths + return scripts_subdir def refresh_script_paths(): @@ -408,7 +405,7 @@ def smpte_from_frame(frame, fps=None, fps_base=None): return smpte_from_seconds((frame * fps_base) / fps, fps) -def preset_find(name, preset_path, display_name=False): +def preset_find(name, preset_path, display_name=False, ext=".py"): if not name: return None @@ -417,11 +414,11 @@ def preset_find(name, preset_path, display_name=False): if display_name: filename = "" for fn in _os.listdir(directory): - if fn.endswith(".py") and name == _bpy.path.display_name(fn): + if fn.endswith(ext) and name == _bpy.path.display_name(fn): filename = fn break else: - filename = name + ".py" + filename = name + ext if filename: filepath = _os.path.join(directory, filename) @@ -464,7 +461,7 @@ def keyconfig_set(filepath): keyconfigs.active = kc_new -def user_resource(type, path="", create=False): +def user_resource(resource_type, path="", create=False): """ Return a user resource path (normally from the users home directory). @@ -479,7 +476,7 @@ def user_resource(type, path="", create=False): :rtype: string """ - target_path = _user_resource(type, path) + target_path = _user_resource(resource_type, path) if create: # should always be true. diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index a9eb86aaf79..20b0669e531 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -70,6 +70,7 @@ KM_HIERARCHY = [ ('Image', 'IMAGE_EDITOR', 'WINDOW', [ ('UV Editor', 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d + ('UV Sculpt', 'EMPTY', 'WINDOW', []), ('Image Generic', 'IMAGE_EDITOR', 'WINDOW', []) ]), diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py index 1a0cf4bab9d..c39d904bf08 100644 --- a/release/scripts/modules/rna_xml.py +++ b/release/scripts/modules/rna_xml.py @@ -32,7 +32,13 @@ def build_property_typemap(skip_classes): if issubclass(cls, skip_classes): continue - properties = cls.bl_rna.properties.keys() + ## to support skip-save we cant get all props + # properties = cls.bl_rna.properties.keys() + properties = [] + for prop_id, prop in cls.bl_rna.properties.items(): + if not prop.is_skip_save: + properties.append(prop_id) + properties.remove("rna_type") property_typemap[attr] = properties @@ -47,7 +53,8 @@ def rna2xml(fw=print_ln, root_node="", root_rna=None, # must be set root_rna_skip=set(), - ident_val=" ", + root_ident="", + ident_val=" ", skip_classes=(bpy.types.Operator, bpy.types.Panel, bpy.types.KeyingSet, @@ -134,7 +141,7 @@ def rna2xml(fw=print_ln, return number_to_str(s, subsubvalue_type) else: return " ".join([str_recursive(si) for si in s]) - + array_value = " ".join(str_recursive(v) for v in subvalue_rna) node_attrs.append("%s=\"%s\"" % (prop, array_value)) @@ -173,10 +180,11 @@ def rna2xml(fw=print_ln, # needs re-workign to be generic if root_node: - fw("<%s>\n" % root_node) + fw("%s<%s>\n" % (root_ident, root_node)) # bpy.data if method == 'DATA': + ident = root_ident + ident_val for attr in dir(root_rna): # exceptions @@ -192,16 +200,16 @@ def rna2xml(fw=print_ln, ls = None if type(ls) == list: - fw("%s<%s>\n" % (ident_val, attr)) + fw("%s<%s>\n" % (ident, attr)) for blend_id in ls: - rna2xml_node(ident_val + ident_val, blend_id, None) + rna2xml_node(ident + ident_val, blend_id, None) fw("%s</%s>\n" % (ident_val, attr)) # any attribute elif method == 'ATTR': - rna2xml_node("", root_rna, None) + rna2xml_node(root_ident, root_rna, None) if root_node: - fw("</%s>\n" % root_node) + fw("%s</%s>\n" % (root_ident, root_node)) def xml2rna(root_xml, @@ -298,3 +306,64 @@ def xml2rna(root_xml, pass rna2xml_node(root_xml, root_rna) + + +# ----------------------------------------------------------------------------- +# Utility function used by presets. +# The idea is you can run a preset like a script with a few args. +# +# This roughly matches the operator 'bpy.ops.script.python_file_run' + + +def _get_context_val(context, path): + path_full = "context." + path + try: + value = eval(path_full) + except: + import traceback + traceback.print_exc() + print("Error: %r could not be found" % path_full) + + value = Ellipsis + + return value + + +def xml_file_run(context, filepath, rna_map): + + import xml.dom.minidom + + xml_nodes = xml.dom.minidom.parse(filepath) + bpy_xml = xml_nodes.getElementsByTagName("bpy")[0] + + for rna_path, xml_tag in rna_map: + + # first get xml + # TODO, error check + xml_node = bpy_xml.getElementsByTagName(xml_tag)[0] + + value = _get_context_val(context, rna_path) + + if value is not Ellipsis and value is not None: + print(" loading XML: %r" % rna_path) + xml2rna(xml_node, root_rna=value) + + +def xml_file_write(context, filepath, rna_map): + + file = open(filepath, 'w', encoding='utf-8') + fw = file.write + + fw("<bpy>\n") + + for rna_path, xml_tag in rna_map: + # xml_tag is ignored, we get this from the rna + value = _get_context_val(context, rna_path) + rna2xml(fw, + root_rna=value, + method='ATTR', + root_ident=" ", + ident_val=" ") + + fw("</bpy>\n") + file.close() diff --git a/release/scripts/presets/ffmpeg/DV.py b/release/scripts/presets/ffmpeg/DV.py index 241d6938a5f..a95d861111a 100644 --- a/release/scripts/presets/ffmpeg/DV.py +++ b/release/scripts/presets/ffmpeg/DV.py @@ -1,7 +1,7 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "DV" +bpy.context.scene.render.ffmpeg.format = "DV" bpy.context.scene.render.resolution_x = 720 if is_ntsc: @@ -9,6 +9,6 @@ if is_ntsc: else: bpy.context.scene.render.resolution_y = 576 -bpy.context.scene.render.ffmpeg_audio_mixrate = 48000 -bpy.context.scene.render.ffmpeg_audio_codec = "PCM" -bpy.context.scene.render.ffmpeg_audio_channels = "STEREO" +bpy.context.scene.render.ffmpeg.audio_mixrate = 48000 +bpy.context.scene.render.ffmpeg.audio_codec = "PCM" +bpy.context.scene.render.ffmpeg.audio_channels = "STEREO" diff --git a/release/scripts/presets/ffmpeg/DVD.py b/release/scripts/presets/ffmpeg/DVD.py index 07828a755cd..d858bd70836 100644 --- a/release/scripts/presets/ffmpeg/DVD.py +++ b/release/scripts/presets/ffmpeg/DVD.py @@ -1,24 +1,24 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "MPEG2" +bpy.context.scene.render.ffmpeg.format = "MPEG2" bpy.context.scene.render.resolution_x = 720 if is_ntsc: bpy.context.scene.render.resolution_y = 480 - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: bpy.context.scene.render.resolution_y = 576 - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 6000 -bpy.context.scene.render.ffmpeg_maxrate = 9000 -bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 +bpy.context.scene.render.ffmpeg.video_bitrate = 6000 +bpy.context.scene.render.ffmpeg.maxrate = 9000 +bpy.context.scene.render.ffmpeg.minrate = 0 +bpy.context.scene.render.ffmpeg.buffersize = 224 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2048 +bpy.context.scene.render.ffmpeg.muxrate = 10080000 -bpy.context.scene.render.ffmpeg_audio_codec = "AC3" -bpy.context.scene.render.ffmpeg_audio_bitrate = 448 -bpy.context.scene.render.ffmpeg_audio_mixrate = 48000 -bpy.context.scene.render.ffmpeg_audio_channels = "SURROUND51" +bpy.context.scene.render.ffmpeg.audio_codec = "AC3" +bpy.context.scene.render.ffmpeg.audio_bitrate = 448 +bpy.context.scene.render.ffmpeg.audio_mixrate = 48000 +bpy.context.scene.render.ffmpeg.audio_channels = "SURROUND51" diff --git a/release/scripts/presets/ffmpeg/SVCD.py b/release/scripts/presets/ffmpeg/SVCD.py index 584f192c3d8..deaf9697045 100644 --- a/release/scripts/presets/ffmpeg/SVCD.py +++ b/release/scripts/presets/ffmpeg/SVCD.py @@ -1,24 +1,24 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "MPEG2" +bpy.context.scene.render.ffmpeg.format = "MPEG2" bpy.context.scene.render.resolution_x = 480 if is_ntsc: bpy.context.scene.render.resolution_y = 480 - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: bpy.context.scene.render.resolution_y = 576 - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 2040 -bpy.context.scene.render.ffmpeg_maxrate = 2516 -bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2324 -bpy.context.scene.render.ffmpeg_muxrate = 0 +bpy.context.scene.render.ffmpeg.video_bitrate = 2040 +bpy.context.scene.render.ffmpeg.maxrate = 2516 +bpy.context.scene.render.ffmpeg.minrate = 0 +bpy.context.scene.render.ffmpeg.buffersize = 224 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2324 +bpy.context.scene.render.ffmpeg.muxrate = 0 -bpy.context.scene.render.ffmpeg_audio_bitrate = 224 -bpy.context.scene.render.ffmpeg_audio_mixrate = 44100 -bpy.context.scene.render.ffmpeg_audio_codec = "MP2" -bpy.context.scene.render.ffmpeg_audio_channels = "STEREO" +bpy.context.scene.render.ffmpeg.audio_bitrate = 224 +bpy.context.scene.render.ffmpeg.audio_mixrate = 44100 +bpy.context.scene.render.ffmpeg.audio_codec = "MP2" +bpy.context.scene.render.ffmpeg.audio_channels = "STEREO" diff --git a/release/scripts/presets/ffmpeg/VCD.py b/release/scripts/presets/ffmpeg/VCD.py index 35dda07a064..3e57be720fb 100644 --- a/release/scripts/presets/ffmpeg/VCD.py +++ b/release/scripts/presets/ffmpeg/VCD.py @@ -1,24 +1,24 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "MPEG1" +bpy.context.scene.render.ffmpeg.format = "MPEG1" bpy.context.scene.render.resolution_x = 352 if is_ntsc: bpy.context.scene.render.resolution_y = 240 - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: bpy.context.scene.render.resolution_y = 288 - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 1150 -bpy.context.scene.render.ffmpeg_maxrate = 1150 -bpy.context.scene.render.ffmpeg_minrate = 1150 -bpy.context.scene.render.ffmpeg_buffersize = 40 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2324 -bpy.context.scene.render.ffmpeg_muxrate = 2352 * 75 * 8 +bpy.context.scene.render.ffmpeg.video_bitrate = 1150 +bpy.context.scene.render.ffmpeg.maxrate = 1150 +bpy.context.scene.render.ffmpeg.minrate = 1150 +bpy.context.scene.render.ffmpeg.buffersize = 40 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2324 +bpy.context.scene.render.ffmpeg.muxrate = 2352 * 75 * 8 -bpy.context.scene.render.ffmpeg_audio_bitrate = 224 -bpy.context.scene.render.ffmpeg_audio_mixrate = 44100 -bpy.context.scene.render.ffmpeg_audio_codec = "MP2" -bpy.context.scene.render.ffmpeg_audio_channels = "STEREO" +bpy.context.scene.render.ffmpeg.audio_bitrate = 224 +bpy.context.scene.render.ffmpeg.audio_mixrate = 44100 +bpy.context.scene.render.ffmpeg.audio_codec = "MP2" +bpy.context.scene.render.ffmpeg.audio_channels = "STEREO" diff --git a/release/scripts/presets/ffmpeg/h264.py b/release/scripts/presets/ffmpeg/h264.py index 1cd5d61a926..e1dbdc1d8b9 100644 --- a/release/scripts/presets/ffmpeg/h264.py +++ b/release/scripts/presets/ffmpeg/h264.py @@ -1,17 +1,17 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "H264" -bpy.context.scene.render.ffmpeg_codec = "H264" +bpy.context.scene.render.ffmpeg.format = "H264" +bpy.context.scene.render.ffmpeg.codec = "H264" if is_ntsc: - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 6000 -bpy.context.scene.render.ffmpeg_maxrate = 9000 -bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 +bpy.context.scene.render.ffmpeg.video_bitrate = 6000 +bpy.context.scene.render.ffmpeg.maxrate = 9000 +bpy.context.scene.render.ffmpeg.minrate = 0 +bpy.context.scene.render.ffmpeg.buffersize = 224 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2048 +bpy.context.scene.render.ffmpeg.muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/theora.py b/release/scripts/presets/ffmpeg/theora.py index 9a35227ad57..88f1ac9bbae 100644 --- a/release/scripts/presets/ffmpeg/theora.py +++ b/release/scripts/presets/ffmpeg/theora.py @@ -1,17 +1,17 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "OGG" -bpy.context.scene.render.ffmpeg_codec = "THEORA" +bpy.context.scene.render.ffmpeg.format = "OGG" +bpy.context.scene.render.ffmpeg.codec = "THEORA" if is_ntsc: - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 6000 -bpy.context.scene.render.ffmpeg_maxrate = 9000 -bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 +bpy.context.scene.render.ffmpeg.video_bitrate = 6000 +bpy.context.scene.render.ffmpeg.maxrate = 9000 +bpy.context.scene.render.ffmpeg.minrate = 0 +bpy.context.scene.render.ffmpeg.buffersize = 224 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2048 +bpy.context.scene.render.ffmpeg.muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/xvid.py b/release/scripts/presets/ffmpeg/xvid.py index c006ba267cc..e69ab663dc8 100644 --- a/release/scripts/presets/ffmpeg/xvid.py +++ b/release/scripts/presets/ffmpeg/xvid.py @@ -1,16 +1,16 @@ import bpy is_ntsc = (bpy.context.scene.render.fps != 25) -bpy.context.scene.render.ffmpeg_format = "XVID" +bpy.context.scene.render.ffmpeg.format = "XVID" if is_ntsc: - bpy.context.scene.render.ffmpeg_gopsize = 18 + bpy.context.scene.render.ffmpeg.gopsize = 18 else: - bpy.context.scene.render.ffmpeg_gopsize = 15 + bpy.context.scene.render.ffmpeg.gopsize = 15 -bpy.context.scene.render.ffmpeg_video_bitrate = 6000 -bpy.context.scene.render.ffmpeg_maxrate = 9000 -bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 -bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 +bpy.context.scene.render.ffmpeg.video_bitrate = 6000 +bpy.context.scene.render.ffmpeg.maxrate = 9000 +bpy.context.scene.render.ffmpeg.minrate = 0 +bpy.context.scene.render.ffmpeg.buffersize = 224 * 8 +bpy.context.scene.render.ffmpeg.packetsize = 2048 +bpy.context.scene.render.ffmpeg.muxrate = 10080000 diff --git a/release/scripts/presets/keyconfig/maya.py b/release/scripts/presets/keyconfig/maya.py index 87f4791ec51..5e1e5d0d778 100644 --- a/release/scripts/presets/keyconfig/maya.py +++ b/release/scripts/presets/keyconfig/maya.py @@ -219,7 +219,8 @@ kmi.properties.value_1 = 'DISABLED' kmi.properties.value_2 = 'ENABLED' kmi = km.keymap_items.new('view3d.game_start', 'P', 'PRESS') kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS') -kmi = km.keymap_items.new('object.select_inverse', 'I', 'PRESS', ctrl=True) +kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True) +kmi.properties.action = 'INVERT' kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True) kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True) kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) @@ -304,7 +305,8 @@ kmi = km.keymap_items.new('mesh.select_shortest_path', 'SELECTMOUSE', 'PRESS', c kmi = km.keymap_items.new('mesh.select_all', 'A', 'PRESS') kmi = km.keymap_items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) kmi = km.keymap_items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.select_inverse', 'I', 'PRESS', ctrl=True) +kmi = km.keymap_items.new('mesh.select_all', 'I', 'PRESS', ctrl=True) +kmi.properties.action = 'INVERT' kmi = km.keymap_items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True) kmi = km.keymap_items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True) kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS') diff --git a/release/scripts/presets/tracking_settings/blurry_footage.py b/release/scripts/presets/tracking_settings/blurry_footage.py index c805301df78..c06d4c3835b 100644 --- a/release/scripts/presets/tracking_settings/blurry_footage.py +++ b/release/scripts/presets/tracking_settings/blurry_footage.py @@ -9,3 +9,6 @@ settings.default_search_size = 100 settings.default_frames_limit = 0 settings.default_pattern_match = 'PREV_FRAME' settings.default_margin = 0 +settings.use_default_red_channel = True +settings.use_default_green_channel = True +settings.use_default_blue_channel = True diff --git a/release/scripts/presets/tracking_settings/default.py b/release/scripts/presets/tracking_settings/default.py index 3846f92d828..b9fd1928472 100644 --- a/release/scripts/presets/tracking_settings/default.py +++ b/release/scripts/presets/tracking_settings/default.py @@ -9,3 +9,6 @@ settings.default_search_size = 61 settings.default_frames_limit = 0 settings.default_pattern_match = 'KEYFRAME' settings.default_margin = 0 +settings.use_default_red_channel = True +settings.use_default_green_channel = True +settings.use_default_blue_channel = True diff --git a/release/scripts/presets/tracking_settings/fast_motion.py b/release/scripts/presets/tracking_settings/fast_motion.py index f99fd7f0c42..dce3304eddb 100644 --- a/release/scripts/presets/tracking_settings/fast_motion.py +++ b/release/scripts/presets/tracking_settings/fast_motion.py @@ -9,3 +9,6 @@ settings.default_search_size = 300 settings.default_frames_limit = 0 settings.default_pattern_match = 'PREV_FRAME' settings.default_margin = 5 +settings.use_default_red_channel = True +settings.use_default_green_channel = True +settings.use_default_blue_channel = True diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index cb21f17cff5..77c28b1bc11 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -24,7 +24,7 @@ from bpy.types import Operator from mathutils import Vector, Matrix -def CLIP_spacees_walk(context, all_screens, tarea, tspace, callback, *args): +def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args): screens = bpy.data.screens if all_screens else [context.screen] for screen in screens: @@ -56,10 +56,27 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user): space_v3d.show_background_images = True - CLIP_spacees_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D', + CLIP_spaces_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D', set_background, clip, clip_user) +def CLIP_camera_for_clip(context, clip): + scene = context.scene + + camera = scene.camera + + for ob in scene.objects: + if ob.type == 'CAMERA': + for con in ob.constraints: + if con.type == 'CAMERA_SOLVER': + cur_clip = scene.clip if con.use_active_clip else con.clip + + if cur_clip == clip: + return ob + + return camera + + def CLIP_track_view_selected(sc, track): if track.select_anchor: return True @@ -73,6 +90,34 @@ def CLIP_track_view_selected(sc, track): return False +def CLIP_default_settings_from_track(clip, track): + settings = clip.tracking.settings + + width = clip.size[0] + height = clip.size[1] + + pattern = track.pattern_max - track.pattern_min + search = track.search_max - track.search_min + + pattern[0] = pattern[0] * clip.size[0] + pattern[1] = pattern[1] * clip.size[1] + + search[0] = search[0] * clip.size[0] + search[1] = search[1] * clip.size[1] + + settings.default_tracker = track.tracker + settings.default_pyramid_levels = track.pyramid_levels + settings.default_correlation_min = track.correlation_min + settings.default_pattern_size = max(pattern[0], pattern[1]) + settings.default_search_size = max(search[0], search[1]) + settings.default_frames_limit = track.frames_limit + settings.default_pattern_match = track.pattern_match + settings.default_margin = track.margin + settings.use_default_red_channel = track.use_red_channel + settings.use_default_green_channel = track.use_green_channel + settings.use_default_blue_channel = track.use_blue_channel + + class CLIP_OT_track_to_empty(Operator): """Create an Empty object which will be copying movement of active track""" @@ -80,7 +125,7 @@ class CLIP_OT_track_to_empty(Operator): bl_label = "Link Empty to Track" bl_options = {'UNDO', 'REGISTER'} - def _link_track(self, context, track): + def _link_track(self, context, clip, tracking_object, track): sc = context.space_data constraint = None ob = None @@ -101,14 +146,17 @@ class CLIP_OT_track_to_empty(Operator): constraint.clip = sc.clip constraint.track = track.name constraint.use_3d_position = False + constraint.object = tracking_object.name + constraint.camera = CLIP_camera_for_clip(context, clip) def execute(self, context): sc = context.space_data clip = sc.clip + tracking_object = clip.tracking.objects.active - for track in clip.tracking.tracks: + for track in tracking_object.tracks: if CLIP_track_view_selected(sc, track): - self._link_track(context, track) + self._link_track(context, clip, tracking_object, track) return {'FINISHED'} @@ -130,11 +178,12 @@ class CLIP_OT_bundles_to_mesh(Operator): sc = context.space_data clip = sc.clip + tracking_object = clip.tracking.objects.active new_verts = [] mesh = bpy.data.meshes.new(name="Tracks") - for track in clip.tracking.tracks: + for track in tracking_object.tracks: if track.has_bundle: new_verts.append(track.bundle) @@ -269,7 +318,7 @@ object's movement caused by this constraint""" # TODO: several camera solvers and track followers would fail, # but can't think about eal workflow where it'll be useful for x in ob.constraints: - if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK'}: + if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK', 'OBJECT_SOLVER'}: con = x if not con: @@ -509,7 +558,7 @@ class CLIP_OT_setup_tracking_scene(Operator): def setup_space(space): space.show_backdrop = True - CLIP_spacees_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR', + CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR', setup_space) sc = context.space_data @@ -784,3 +833,29 @@ class CLIP_OT_setup_tracking_scene(Operator): self._setupObjects(context) return {'FINISHED'} + +class CLIP_OT_track_settings_as_default(Operator): + """Copy tracking settings from active track to default settings""" + + bl_idname = "clip.track_settings_as_default" + bl_label = "Track Settings As Default" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + if sc.type != 'CLIP_EDITOR': + return False + + clip = sc.clip + + return clip and clip.tracking.tracks.active + + def execute(self, context): + sc = context.space_data + clip = sc.clip + + CLIP_default_settings_from_track(clip, clip.tracking.tracks.active) + + return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index bf9fa562ee1..3e206017238 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -25,7 +25,7 @@ from bpy.props import EnumProperty class MeshSelectInteriorFaces(Operator): - '''Select faces where all edges have more then 2 face users''' + '''Select faces where all edges have more than 2 face users''' bl_idname = "mesh.faces_select_interior" bl_label = "Select Interior Faces" diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 738cc7b24e0..2c329de3644 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -489,8 +489,7 @@ class ShapeTransfer(Operator): return (obj and obj.mode != 'EDIT') def execute(self, context): - C = bpy.context - ob_act = C.active_object + ob_act = context.active_object objects = [ob for ob in C.selected_editable_objects if ob != ob_act] if 1: # swap from/to, means we cant copy to many at once. @@ -585,11 +584,6 @@ class MakeDupliFace(Operator): bl_idname = "object.make_dupli_face" bl_label = "Make Dupli-Face" - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj and obj.type == 'MESH') - def _main(self, context): from mathutils import Vector @@ -601,22 +595,22 @@ class MakeDupliFace(Operator): Vector((-offset, +offset, 0.0)), ) - def matrix_to_quat(matrix): + def matrix_to_quad(matrix): # scale = matrix.median_scale trans = matrix.to_translation() rot = matrix.to_3x3() # also contains scale return [(rot * b) + trans for b in base_tri] - scene = bpy.context.scene + scene = context.scene linked = {} - for obj in bpy.context.selected_objects: + for obj in context.selected_objects: data = obj.data if data: linked.setdefault(data, []).append(obj) for data, objects in linked.items(): face_verts = [axis for obj in objects - for v in matrix_to_quat(obj.matrix_world) + for v in matrix_to_quad(obj.matrix_world) for axis in v] faces = list(range(len(face_verts) // 3)) diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 308c46ca416..1aecfbbaa77 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -55,6 +55,13 @@ class AddPresetBase(): preset_menu_class = getattr(bpy.types, self.preset_menu) + is_xml = getattr(preset_menu_class, "preset_type", None) == 'XML' + + if is_xml: + ext = ".xml" + else: + ext = ".py" + if not self.remove_active: name = self.name.strip() if not name: @@ -71,32 +78,40 @@ class AddPresetBase(): self.report({'WARNING'}, "Failed to create presets path") return {'CANCELLED'} - filepath = os.path.join(target_path, filename) + ".py" + filepath = os.path.join(target_path, filename) + ext if hasattr(self, "add"): self.add(context, filepath) else: print("Writing Preset: %r" % filepath) - file_preset = open(filepath, 'w') - file_preset.write("import bpy\n") - - if hasattr(self, "preset_defines"): - for rna_path in self.preset_defines: - exec(rna_path) - file_preset.write("%s\n" % rna_path) - file_preset.write("\n") - - for rna_path in self.preset_values: - value = eval(rna_path) - # convert thin wrapped sequences to simple lists to repr() - try: - value = value[:] - except: - pass - - file_preset.write("%s = %r\n" % (rna_path, value)) - file_preset.close() + if is_xml: + import rna_xml + rna_xml.xml_file_write(context, + filepath, + preset_menu_class.preset_xml_map) + else: + file_preset = open(filepath, 'w') + file_preset.write("import bpy\n") + + if hasattr(self, "preset_defines"): + for rna_path in self.preset_defines: + exec(rna_path) + file_preset.write("%s\n" % rna_path) + file_preset.write("\n") + + for rna_path in self.preset_values: + value = eval(rna_path) + # convert thin wrapped sequences + # to simple lists to repr() + try: + value = value[:] + except: + pass + + file_preset.write("%s = %r\n" % (rna_path, value)) + + file_preset.close() preset_menu_class.bl_label = bpy.path.display_name(filename) @@ -104,12 +119,15 @@ class AddPresetBase(): preset_active = preset_menu_class.bl_label # fairly sloppy but convenient. - filepath = bpy.utils.preset_find(preset_active, self.preset_subdir) + filepath = bpy.utils.preset_find(preset_active, + self.preset_subdir, + ext=ext) if not filepath: filepath = bpy.utils.preset_find(preset_active, self.preset_subdir, - display_name=True) + display_name=True, + ext=ext) if not filepath: return {'CANCELLED'} @@ -158,15 +176,27 @@ class ExecutePreset(Operator): ) def execute(self, context): - from os.path import basename + from os.path import basename, splitext filepath = self.filepath # change the menu title to the most recently chosen option preset_class = getattr(bpy.types, self.menu_idname) preset_class.bl_label = bpy.path.display_name(basename(filepath)) + ext = splitext(filepath)[1].lower() + # execute the preset using script.python_file_run - bpy.ops.script.python_file_run(filepath=filepath) + if ext == ".py": + bpy.ops.script.python_file_run(filepath=filepath) + elif ext == ".xml": + import rna_xml + rna_xml.xml_file_run(context, + filepath, + preset_class.preset_xml_map) + else: + self.report({'ERROR'}, "unknown filetype: %r" % ext) + return {'CANCELLED '} + return {'FINISHED'} @@ -379,12 +409,23 @@ class AddPresetTrackingSettings(AddPresetBase, Operator): "settings.default_search_size", "settings.default_frames_limit", "settings.default_pattern_match", - "settings.default_margin" + "settings.default_margin", + "settings.use_default_red_channel", + "settings.use_default_green_channel", + "settings.use_default_blue_channel" ] preset_subdir = "tracking_settings" +class AddPresetInterfaceTheme(AddPresetBase, Operator): + '''Add a theme preset''' + bl_idname = "wm.interface_theme_preset_add" + bl_label = "Add Tracking Settings Preset" + preset_menu = "USERPREF_MT_interface_theme_presets" + preset_subdir = "interface_theme" + + class AddPresetKeyconfig(AddPresetBase, Operator): '''Add a Keyconfig Preset''' bl_idname = "wm.keyconfig_preset_add" diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 11326377a79..e9cb8af1cbd 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -166,9 +166,10 @@ class BRUSH_OT_active_index_set(Operator): if attr is None: return {'CANCELLED'} + toolsettings = context.tool_settings for i, brush in enumerate((cur for cur in bpy.data.brushes if getattr(cur, attr))): if i == self.index: - getattr(context.tool_settings, self.mode).brush = brush + getattr(toolsettings, self.mode).brush = brush return {'FINISHED'} return {'CANCELLED'} @@ -1178,7 +1179,7 @@ class WM_OT_copy_prev_settings(Operator): return {'CANCELLED'} -class WM_OT_blenderplayer_start(bpy.types.Operator): +class WM_OT_blenderplayer_start(Operator): '''Launch the Blenderplayer with the current blendfile''' bl_idname = "wm.blenderplayer_start" bl_label = "Start" @@ -1768,61 +1769,3 @@ class WM_OT_addon_expand(Operator): info = addon_utils.module_bl_info(mod) info["show_expanded"] = not info["show_expanded"] return {'FINISHED'} - - -# ----------------------------------------------------------------------------- -# Theme IO -from bpy_extras.io_utils import (ImportHelper, - ExportHelper, - ) - - -class WM_OT_theme_import(Operator, ImportHelper): - bl_idname = "wm.theme_import" - bl_label = "Import Theme" - bl_options = {'REGISTER', 'UNDO'} - - filename_ext = ".xml" - filter_glob = StringProperty(default="*.xml", options={'HIDDEN'}) - - def execute(self, context): - import rna_xml - import xml.dom.minidom - - filepath = self.filepath - - xml_nodes = xml.dom.minidom.parse(filepath) - theme_xml = xml_nodes.getElementsByTagName("Theme")[0] - - # XXX, why always 0?, allow many? - theme = context.user_preferences.themes[0] - - rna_xml.xml2rna(theme_xml, - root_rna=theme, - ) - - return {'FINISHED'} - - -class WM_OT_theme_export(Operator, ExportHelper): - bl_idname = "wm.theme_export" - bl_label = "Export Theme" - - filename_ext = ".xml" - filter_glob = StringProperty(default="*.xml", options={'HIDDEN'}) - - def execute(self, context): - import rna_xml - - filepath = self.filepath - file = open(filepath, 'w', encoding='utf-8') - - # XXX, why always 0?, allow many? - theme = context.user_preferences.themes[0] - - rna_xml.rna2xml(file.write, - root_rna=theme, - method='ATTR', - ) - - return {'FINISHED'} diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 6aa08a7f50d..84049e9f1fe 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -86,7 +86,7 @@ def register(): # space_userprefs.py from bpy.props import StringProperty, EnumProperty - WindowManager = bpy.types.WindowManager + from bpy.types import WindowManager def addon_filter_items(self, context): import addon_utils diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 02e13966c48..79d722eb19d 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -214,12 +214,11 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): if is_poly: # These settings are below but its easier to have # poly's set aside since they use so few settings - col = split.column() - col.label(text="Cyclic:") - col.prop(act_spline, "use_smooth") - col = split.column() - col.prop(act_spline, "use_cyclic_u", text="U") + row = layout.row() + row.label(text="Cyclic:") + row.prop(act_spline, "use_cyclic_u", text="U") + layout.prop(act_spline, "use_smooth") else: col = split.column() col.label(text="Cyclic:") @@ -257,13 +256,13 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): sub.prop(act_spline, "resolution_v", text="V") if not is_surf: - split = layout.split() - col = split.column() - + col = layout.column() col.label(text="Interpolation:") - colsub = col.column() - colsub.active = (curve.dimensions == '3D') - colsub.prop(act_spline, "tilt_interpolation", text="Tilt") + + sub = col.column() + sub.active = (curve.dimensions == '3D') + sub.prop(act_spline, "tilt_interpolation", text="Tilt") + col.prop(act_spline, "radius_interpolation", text="Radius") layout.prop(act_spline, "use_smooth") diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 5be9e57356c..7828d90b39d 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -226,10 +226,10 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): row.alignment = 'RIGHT' sub = row.row(align=True) + sub.label() # XXX, for alignment only subsub = sub.row(align=True) subsub.active = enable_edit_value subsub.prop(ob, "show_only_shape_key", text="") - subsub.prop(kb, "mute", text="") sub.prop(ob, "use_shape_key_edit_mode", text="") sub = row.row() diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index d6f2173306a..766daba58b8 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -587,11 +587,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "use_keep_above_surface") def SIMPLE_DEFORM(self, layout, ob, md): - split = layout.split() - col = split.column() - col.label(text="Mode:") - col.prop(md, "deform_method", text="") + layout.row().prop(md, "deform_method", expand=True) + + split = layout.split() col = split.column() col.label(text="Vertex Group:") @@ -610,7 +609,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.label(text="Deform:") col.prop(md, "factor") col.prop(md, "limits", slider=True) - if md.deform_method in {'TAPER', 'STRETCH'}: + if md.deform_method in {'TAPER', 'STRETCH', 'TWIST'}: col.prop(md, "lock_x") col.prop(md, "lock_y") @@ -815,12 +814,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def REMESH(self, layout, ob, md): layout.prop(md, "mode") - - layout.prop(md, "octree_depth") - layout.prop(md, "scale") + row = layout.row() - row.active = md.mode == "SHARP" - row.prop(md, "sharpness") + row.prop(md, "octree_depth") + row.prop(md, "scale") + + if md.mode == "SHARP": + layout.prop(md, "sharpness") layout.prop(md, "remove_disconnected_pieces") row = layout.row() diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index b7b2acc6b08..ee5702e324e 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -244,7 +244,7 @@ class RenderButtonsPanel(): return (rd.engine in cls.COMPAT_ENGINES) -class RENDER_PT_embedded(RenderButtonsPanel, bpy.types.Panel): +class RENDER_PT_embedded(RenderButtonsPanel, Panel): bl_label = "Embedded Player" COMPAT_ENGINES = {'BLENDER_GAME'} @@ -274,16 +274,23 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel): row = layout.row() row.operator("wm.blenderplayer_start", text="Start") - row.prop(gs, "show_fullscreen") + row.label() row = layout.row() row.label(text="Resolution:") row = layout.row(align=True) row.prop(gs, "resolution_x", slider=False, text="X") row.prop(gs, "resolution_y", slider=False, text="Y") + row = layout.row() + col = row.column() + col.prop(gs, "show_fullscreen") + col = row.column() + col.prop(gs, "use_desktop") + col.active = gs.show_fullscreen col = layout.column() col.label(text="Quality:") + col.prop(gs, "samples") col = layout.column(align=True) col.prop(gs, "depth", text="Bit Depth", slider=False) col.prop(gs, "frequency", text="Refresh Rate", slider=False) diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 32ed1c3f1b1..dff23e6238f 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -434,25 +434,28 @@ class ConstraintButtonsPanel(): def ACTION(self, context, layout, con): self.target_template(layout, con) - layout.prop(con, "action") - - layout.prop(con, "transform_channel") - split = layout.split() - - col = split.column(align=True) - col.label(text="Action Length:") - col.prop(con, "frame_start", text="Start") - col.prop(con, "frame_end", text="End") - + + col = split.column() + col.label(text="From Target:") + col.prop(con, "transform_channel", text="") + col.prop(con, "target_space", text="") + + col = split.column() + col.label(text="To Action:") + col.prop(con, "action", text="") + + split = layout.split() + col = split.column(align=True) col.label(text="Target Range:") col.prop(con, "min", text="Min") col.prop(con, "max", text="Max") - - row = layout.row() - row.label(text="Convert:") - row.prop(con, "target_space", text="") + + col = split.column(align=True) + col.label(text="Action Range:") + col.prop(con, "frame_start", text="Start") + col.prop(con, "frame_end", text="End") def LOCKED_TRACK(self, context, layout, con): self.target_template(layout, con) @@ -774,10 +777,14 @@ class ConstraintButtonsPanel(): if clip: layout.prop_search(con, "object", clip.tracking, "objects", icon='OBJECT_DATA') - layout.prop_search(con, "track", clip.tracking, "tracks", icon='ANIMATION_DATA') + layout.prop_search(con, "track", clip.tracking, "tracks", icon='ANIM_DATA') layout.prop(con, "camera") + row = layout.row() + row.active = not con.use_3d_position + row.prop(con, "depth_object") + layout.operator("clip.constraint_to_fcurve") def CAMERA_SOLVER(self, context, layout, con): diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py new file mode 100644 index 00000000000..25ea85a9a6a --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -0,0 +1,61 @@ +# ##### 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> + + +class UnifiedPaintPanel(): + # subclass must set + # bl_space_type = 'IMAGE_EDITOR' + # bl_region_type = 'UI' + + @staticmethod + def paint_settings(context): + toolsettings = context.tool_settings + + if context.sculpt_object: + return toolsettings.sculpt + elif context.vertex_paint_object: + return toolsettings.vertex_paint + elif context.weight_paint_object: + return toolsettings.weight_paint + elif context.image_paint_object: + return toolsettings.image_paint + elif context.particle_edit_object: + return toolsettings.particle_edit + + return None + + @staticmethod + def unified_paint_settings(parent, context): + ups = context.tool_settings.unified_paint_settings + parent.label(text="Unified Settings:") + parent.prop(ups, "use_unified_size", text="Size") + parent.prop(ups, "use_unified_strength", text="Strength") + + @staticmethod + def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False): + ups = context.tool_settings.unified_paint_settings + ptr = ups if ups.use_unified_size else brush + parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider) + + @staticmethod + def prop_unified_strength(parent, context, brush, prop_name, icon='NONE', text="", slider=False): + ups = context.tool_settings.unified_paint_settings + ptr = ups if ups.use_unified_strength else brush + parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 5e68351d9e6..4e511f18cd4 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -911,7 +911,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures") split = layout.split(percentage=0.33) - split.label(text="Split uv's:") + split.label(text="Split UVs:") split.prop(part, "billboard_uv_split", text="Number of splits") if psys: diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 32b94504525..dc64aacf043 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -87,6 +87,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col.label(text="Damping:") col.prop(cloth, "spring_damping", text="Spring") col.prop(cloth, "air_damping", text="Air") + col.prop(cloth, "vel_damping", text="Velocity") col.prop(cloth, "use_pin_cloth", text="Pinning") sub = col.column() diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 3797d7f363c..e6801f00fce 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -137,11 +137,14 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): # dissolve if surface_type == 'PAINT': split = layout.split(percentage=0.35) - split.label(text="Wetmap drying:") + split.prop(surface, "use_drying", text="Dry:") col = split.column() + col.active = surface.use_drying split = col.split(percentage=0.7) - split.prop(surface, "dry_speed", text="Time") + col = split.column(align=True) + col.prop(surface, "dry_speed", text="Time") + col.prop(surface, "color_dry_threshold") split.prop(surface, "use_dry_log", text="Slow") if surface_type != 'WAVE': @@ -179,7 +182,10 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): col.prop(surface, "wave_spring") layout.separator() - layout.prop(surface, "brush_group", text="Brush Group") + layout.prop(surface, "brush_group") + row = layout.row() + row.prop(surface, "brush_influence_scale") + row.prop(surface, "brush_radius_scale") class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): @@ -406,14 +412,14 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): col.prop(brush, "paint_distance", text="Paint Distance") split = layout.row().split(percentage=0.4) sub = split.column() - if brush.paint_source == 'DISTANCE': + if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE'}: sub.prop(brush, "use_proximity_project") - elif brush.paint_source == 'VOLUME_DISTANCE': + if brush.paint_source == 'VOLUME_DISTANCE': sub.prop(brush, "invert_proximity") sub.prop(brush, "use_negative_volume") sub = split.column() - if brush.paint_source == 'DISTANCE': + if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE'}: column = sub.column() column.active = brush.use_proximity_project column.prop(brush, "ray_direction") diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index a89249a6f75..363b0f20428 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -56,6 +56,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): layout.active = fluid.use if fluid.type == 'DOMAIN': + # odd formatting here so translation script can extract string layout.operator("fluid.bake", text="Bake (Req. Memory:" + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM') split = layout.split() @@ -78,11 +79,13 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): sub = col.column(align=True) sub.prop(fluid, "start_time", text="Start") sub.prop(fluid, "end_time", text="End") + col.prop(fluid, "simulation_rate", text="Speed") col = split.column() col.label() col.prop(fluid, "use_speed_vectors") col.prop(fluid, "use_reverse_frames") + col.prop(fluid, "frame_offset", text="Offset") layout.prop(fluid, "filepath", text="") @@ -229,6 +232,10 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): if fluid.viscosity_preset == 'MANUAL': sub.prop(fluid, "viscosity_base", text="Base") sub.prop(fluid, "viscosity_exponent", text="Exponent", slider=True) + else: + # just for padding to prevent jumping around + sub.separator() + sub.separator() col.label(text="Optimization:") col.prop(fluid, "grid_levels", slider=True) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 7887998b90f..fea7b9673ec 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -419,6 +419,12 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel): layout.active = rd.use_stamp + layout.prop(rd, "stamp_font_size", text="Font Size") + + row = layout.row() + row.column().prop(rd, "stamp_foreground", slider=True) + row.column().prop(rd, "stamp_background", slider=True) + split = layout.split() col = split.column() @@ -427,19 +433,14 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel): col.prop(rd, "use_stamp_render_time", text="RenderTime") col.prop(rd, "use_stamp_frame", text="Frame") col.prop(rd, "use_stamp_scene", text="Scene") + + col = split.column() col.prop(rd, "use_stamp_camera", text="Camera") col.prop(rd, "use_stamp_lens", text="Lens") col.prop(rd, "use_stamp_filename", text="Filename") col.prop(rd, "use_stamp_marker", text="Marker") col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip") - col = split.column() - col.active = rd.use_stamp - col.prop(rd, "stamp_foreground", slider=True) - col.prop(rd, "stamp_background", slider=True) - col.separator() - col.prop(rd, "stamp_font_size", text="Font Size") - row = layout.split(percentage=0.2) row.prop(rd, "use_stamp_note", text="Note") sub = row.row() @@ -471,33 +472,35 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): layout.operator("scene.render_data_set_quicktime_codec") elif file_format == 'QUICKTIME_QTKIT': + quicktime = rd.quicktime + split = layout.split() col = split.column() - col.prop(rd, "quicktime_codec_type", text="Video Codec") - col.prop(rd, "quicktime_codec_spatial_quality", text="Quality") + col.prop(quicktime, "codec_type", text="Video Codec") + col.prop(quicktime, "codec_spatial_quality", text="Quality") # Audio - col.prop(rd, "quicktime_audiocodec_type", text="Audio Codec") - if rd.quicktime_audiocodec_type != 'No audio': + col.prop(quicktime, "audiocodec_type", text="Audio Codec") + if quicktime.audiocodec_type != 'No audio': split = layout.split() - if rd.quicktime_audiocodec_type == 'LPCM': - split.prop(rd, "quicktime_audio_bitdepth", text="") + if quicktime.audiocodec_type == 'LPCM': + split.prop(quicktime, "audio_bitdepth", text="") - split.prop(rd, "quicktime_audio_samplerate", text="") + split.prop(quicktime, "audio_samplerate", text="") split = layout.split() col = split.column() - if rd.quicktime_audiocodec_type == 'AAC': - col.prop(rd, "quicktime_audio_bitrate") + if quicktime.audiocodec_type == 'AAC': + col.prop(quicktime, "audio_bitrate") subsplit = split.split() col = subsplit.column() - if rd.quicktime_audiocodec_type == 'AAC': - col.prop(rd, "quicktime_audio_codec_isvbr") + if rquicktime.audiocodec_type == 'AAC': + col.prop(quicktime, "audio_codec_isvbr") col = subsplit.column() - col.prop(rd, "quicktime_audio_resampling_hq") + col.prop(quicktime, "audio_resampling_hq") class RENDER_PT_encoding(RenderButtonsPanel, Panel): @@ -514,43 +517,46 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): layout = self.layout rd = context.scene.render + ffmpeg = rd.ffmpeg layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") split = layout.split() - split.prop(rd, "ffmpeg_format") - if rd.ffmpeg_format in {'AVI', 'QUICKTIME', 'MKV', 'OGG'}: - split.prop(rd, "ffmpeg_codec") + split.prop(rd.ffmpeg, "format") + if ffmpeg.format in {'AVI', 'QUICKTIME', 'MKV', 'OGG'}: + split.prop(ffmpeg, "codec") + elif rd.ffmpeg.format == 'H264': + split.prop(ffmpeg, 'use_lossless_output') else: split.label() row = layout.row() - row.prop(rd, "ffmpeg_video_bitrate") - row.prop(rd, "ffmpeg_gopsize") + row.prop(ffmpeg, "video_bitrate") + row.prop(ffmpeg, "gopsize") split = layout.split() col = split.column() col.label(text="Rate:") - col.prop(rd, "ffmpeg_minrate", text="Minimum") - col.prop(rd, "ffmpeg_maxrate", text="Maximum") - col.prop(rd, "ffmpeg_buffersize", text="Buffer") + col.prop(ffmpeg, "minrate", text="Minimum") + col.prop(ffmpeg, "maxrate", text="Maximum") + col.prop(ffmpeg, "buffersize", text="Buffer") col = split.column() - col.prop(rd, "ffmpeg_autosplit") + col.prop(ffmpeg, "use_autosplit") col.label(text="Mux:") - col.prop(rd, "ffmpeg_muxrate", text="Rate") - col.prop(rd, "ffmpeg_packetsize", text="Packet Size") + col.prop(ffmpeg, "muxrate", text="Rate") + col.prop(ffmpeg, "packetsize", text="Packet Size") layout.separator() # Audio: - if rd.ffmpeg_format not in {'MP3'}: - layout.prop(rd, "ffmpeg_audio_codec", text="Audio Codec") + if ffmpeg.format != 'MP3': + layout.prop(ffmpeg, "audio_codec", text="Audio Codec") row = layout.row() - row.prop(rd, "ffmpeg_audio_bitrate") - row.prop(rd, "ffmpeg_audio_volume", slider=True) + row.prop(ffmpeg, "audio_bitrate") + row.prop(ffmpeg, "audio_volume", slider=True) class RENDER_PT_bake(RenderButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index b7218e4ba47..7879f15270a 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -54,6 +54,7 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): layout = self.layout scene = context.scene rd = context.scene.render + ffmpeg = rd.ffmpeg layout.prop(scene, "audio_volume") layout.operator("sound.bake_animation") @@ -68,8 +69,8 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): col = split.column() col.label("Format:") - col.prop(rd, "ffmpeg_audio_channels", text="") - col.prop(rd, "ffmpeg_audio_mixrate", text="Rate") + col.prop(ffmpeg, "audio_channels", text="") + col.prop(ffmpeg, "audio_mixrate", text="Rate") layout.operator("sound.mixdown") diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index c7f94bb4a3d..6e54bdde024 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -19,6 +19,14 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel + +from bpy.types import (Brush, + Lamp, + Material, + ParticleSettings, + Texture, + World) + from rna_prop_ui import PropertyPanel @@ -91,7 +99,7 @@ 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, bpy.types.ParticleSettings)) + 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): @@ -103,14 +111,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): idblock = context_tex_datablock(context) pin_id = space.pin_id - if space.use_pin_id and not isinstance(pin_id, bpy.types.Texture): + if space.use_pin_id and not isinstance(pin_id, Texture): idblock = pin_id pin_id = None if not space.use_pin_id: layout.prop(space, "texture_context", expand=True) - tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, bpy.types.Brush)) + tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, Brush)) if tex_collection: row = layout.row() @@ -413,7 +421,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): col = split.column() #Only for Material based textures, not for Lamp/World... - if slot and isinstance(idblock, bpy.types.Material): + if slot and isinstance(idblock, Material): col.prop(tex, "use_normal_map") row = col.row() row.active = tex.use_normal_map @@ -801,7 +809,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): @classmethod def poll(cls, context): idblock = context_tex_datablock(context) - if isinstance(idblock, bpy.types.Brush) and not context.sculpt_object: + if isinstance(idblock, Brush) and not context.sculpt_object: return False if not getattr(context, "texture_slot", None): @@ -818,7 +826,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): tex = context.texture_slot # textype = context.texture - if not isinstance(idblock, bpy.types.Brush): + if not isinstance(idblock, Brush): split = layout.split(percentage=0.3) col = split.column() col.label(text="Coordinates:") @@ -847,7 +855,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): split.label(text="Object:") split.prop(tex, "object", text="") - if isinstance(idblock, bpy.types.Brush): + if isinstance(idblock, Brush): if context.sculpt_object: layout.label(text="Brush Mapping:") layout.prop(tex, "map_mode", expand=True) @@ -856,7 +864,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): row.active = tex.map_mode in {'FIXED', 'TILED'} row.prop(tex, "angle") else: - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): split = layout.split(percentage=0.3) split.label(text="Projection:") split.prop(tex, "mapping", text="") @@ -889,7 +897,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): @classmethod def poll(cls, context): idblock = context_tex_datablock(context) - if isinstance(idblock, bpy.types.Brush): + if isinstance(idblock, Brush): return False if not getattr(context, "texture_slot", None): @@ -915,7 +923,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): sub.prop(tex, factor, text=name, slider=True) return sub # XXX, temp. use_map_normal needs to override. - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): if idblock.type in {'SURFACE', 'WIRE'}: split = layout.split() @@ -978,7 +986,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color") factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color") - elif isinstance(idblock, bpy.types.Lamp): + elif isinstance(idblock, Lamp): split = layout.split() col = split.column() @@ -987,7 +995,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col = split.column() factor_but(col, "use_map_shadow", "shadow_factor", "Shadow") - elif isinstance(idblock, bpy.types.World): + elif isinstance(idblock, World): split = layout.split() col = split.column() @@ -997,7 +1005,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col = split.column() factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up") factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down") - elif isinstance(idblock, bpy.types.ParticleSettings): + elif isinstance(idblock, ParticleSettings): split = layout.split() col = split.column() @@ -1028,7 +1036,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): layout.separator() - if not isinstance(idblock, bpy.types.ParticleSettings): + if not isinstance(idblock, ParticleSettings): split = layout.split() col = split.column() @@ -1041,10 +1049,10 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col.prop(tex, "invert", text="Negative") col.prop(tex, "use_stencil") - if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World): + if isinstance(idblock, Material) or isinstance(idblock, World): col.prop(tex, "default_value", text="DVar", slider=True) - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): layout.label(text="Bump Mapping:") # only show bump settings if activated but not for normal-map images @@ -1063,7 +1071,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} _context_path = "texture" - _property_type = bpy.types.Texture + _property_type = Texture if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 0da022dd8db..c879609de95 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -117,7 +117,7 @@ class CLIP_PT_tools_marker(Panel): if settings.show_default_expanded: col = box.column() row = col.row(align=True) - label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label + label = CLIP_MT_tracking_settings_presets.bl_label row.menu('CLIP_MT_tracking_settings_presets', text=label) row.operator("clip.tracking_settings_preset_add", text="", icon='ZOOMIN') @@ -127,6 +127,13 @@ class CLIP_PT_tools_marker(Panel): col.separator() + row = col.row(align=True) + row.prop(settings, "use_default_red_channel", text="R", toggle=True) + row.prop(settings, "use_default_green_channel", text="G", toggle=True) + row.prop(settings, "use_default_blue_channel", text="B", toggle=True) + + col.separator() + sub = col.column(align=True) sub.prop(settings, "default_pattern_size") sub.prop(settings, "default_search_size") @@ -147,6 +154,9 @@ class CLIP_PT_tools_marker(Panel): col.label(text="Match:") col.prop(settings, "default_pattern_match", text="") + col.separator() + col.operator('clip.track_settings_as_default', text="Copy From Active Track") + class CLIP_PT_tools_tracking(Panel): bl_space_type = 'CLIP_EDITOR' @@ -162,17 +172,17 @@ class CLIP_PT_tools_tracking(Panel): def draw(self, context): layout = self.layout - # clip = context.space_data.clip # UNUSED row = layout.row(align=True) props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') props.backwards = True props = row.operator("clip.track_markers", text="", - icon='PLAY_REVERSE') + icon='PLAY_REVERSE') props.backwards = True props.sequence = True props = row.operator("clip.track_markers", text="", icon='PLAY') + props.backwards = False props.sequence = True row.operator("clip.track_markers", text="", icon='FRAME_NEXT') @@ -182,9 +192,7 @@ class CLIP_PT_tools_tracking(Panel): props = col.operator("clip.clear_track_path", text="Clear Before") props.action = 'UPTO' - - props = col.operator("clip.clear_track_path", text="Clear") - props.action = 'ALL' + col.operator("clip.clear_track_path", text="Clear").action = 'ALL' layout.operator("clip.join_tracks", text="Join") @@ -317,9 +325,10 @@ class CLIP_PT_tools_object(Panel): return False def draw(self, context): + layout = self.layout + sc = context.space_data clip = sc.clip - layout = self.layout tracking_object = clip.tracking.objects.active settings = sc.clip.tracking.settings @@ -376,9 +385,9 @@ class CLIP_PT_objects(Panel): def draw(self, context): layout = self.layout + sc = context.space_data - clip = sc.clip - tracking = clip.tracking + tracking = sc.clip.tracking row = layout.row() row.template_list(tracking, "objects", @@ -521,6 +530,17 @@ class CLIP_PT_display(Panel): layout = self.layout sc = context.space_data + row = layout.row(align=True) + sub = row.row() + sub.prop(sc, "show_red_channel", text="R", toggle=True) + sub.prop(sc, "show_green_channel", text="G", toggle=True) + sub.prop(sc, "show_blue_channel", text="B", toggle=True) + + row.separator() + + sub = row.row() + sub.prop(sc, "use_grayscale_preview", text="B/W", toggle=True) + col = layout.column(align=True) col.prop(sc, "show_marker_pattern", text="Pattern") @@ -549,6 +569,9 @@ class CLIP_PT_display(Panel): col.prop(sc, "lock_selection") + if sc.view == 'GRAPH': + col.prop(sc, "lock_time_cursor") + clip = sc.clip if clip: col.label(text="Display Aspect Ratio:") @@ -697,17 +720,21 @@ class CLIP_PT_proxy(Panel): layout.active = clip.use_proxy - layout.label(text="Build Sizes:") + layout.label(text="Build Original:") - row = layout.row() - row.prop(clip.proxy, "build_25") - row.prop(clip.proxy, "build_50") + row = layout.row(align=True) + row.prop(clip.proxy, "build_25", toggle=True) + row.prop(clip.proxy, "build_50", toggle=True) + row.prop(clip.proxy, "build_75", toggle=True) + row.prop(clip.proxy, "build_100", toggle=True) - row = layout.row() - row.prop(clip.proxy, "build_75") - row.prop(clip.proxy, "build_100") + layout.label(text="Build Undistorted:") - layout.prop(clip.proxy, "build_undistorted") + row = layout.row(align=True) + row.prop(clip.proxy, "build_undistorted_25", toggle=True) + row.prop(clip.proxy, "build_undistorted_50", toggle=True) + row.prop(clip.proxy, "build_undistorted_75", toggle=True) + row.prop(clip.proxy, "build_undistorted_100", toggle=True) layout.prop(clip.proxy, "quality") @@ -715,7 +742,7 @@ class CLIP_PT_proxy(Panel): if clip.use_proxy_custom_directory: layout.prop(clip.proxy, "directory") - layout.operator("clip.rebuild_proxy", text="Rebuild Proxy") + layout.operator("clip.rebuild_proxy", text="Build Proxy") if clip.source == 'MOVIE': col = layout.column() @@ -855,6 +882,10 @@ class CLIP_MT_track(Menu): layout.operator("clip.clean_tracks") layout.separator() + layout.operator("clip.copy_tracks") + layout.operator("clip.paste_tracks") + + layout.separator() props = layout.operator("clip.track_markers", text="Track Frame Backwards") props.backwards = True @@ -933,7 +964,8 @@ class CLIP_MT_select(Menu): layout.separator() - layout.operator("clip.select_all", text="Select/Deselect all") + props = layout.operator("clip.select_all", text="Select/Deselect all") + props.action = 'TOGGLE' layout.operator("clip.select_all", text="Inverse").action = 'INVERT' layout.menu("CLIP_MT_select_grouped") @@ -958,7 +990,8 @@ class CLIP_MT_tracking_specials(Menu): def draw(self, context): layout = self.layout - props = layout.operator("clip.disable_markers", text="Enable Markers") + props = layout.operator("clip.disable_markers", + text="Enable Markers") props.action = 'ENABLE' props = layout.operator("clip.disable_markers", text="Disable markers") @@ -984,7 +1017,7 @@ class CLIP_MT_camera_presets(Menu): bl_label = "Camera Presets" preset_subdir = "tracking_camera" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_track_color_presets(Menu): @@ -992,7 +1025,7 @@ class CLIP_MT_track_color_presets(Menu): bl_label = "Color Presets" preset_subdir = "tracking_track_color" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_tracking_settings_presets(Menu): @@ -1000,7 +1033,7 @@ class CLIP_MT_tracking_settings_presets(Menu): bl_label = "Tracking Presets" preset_subdir = "tracking_settings" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_track_color_specials(Menu): diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 106bbd85717..b7d69fb38b3 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -152,10 +152,7 @@ class DOPESHEET_MT_view(Menu): layout.prop(st, "use_auto_merge_keyframes") layout.prop(st, "use_marker_sync") - if st.show_seconds: - layout.operator("anim.time_toggle", text="Show Frames") - else: - layout.operator("anim.time_toggle", text="Show Seconds") + layout.prop(st, "show_seconds") layout.separator() layout.operator("anim.previewrange_set") @@ -179,11 +176,11 @@ class DOPESHEET_MT_select(Menu): layout = self.layout # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None - layout.operator("action.select_all_toggle") + layout.operator("action.select_all_toggle").invert = False layout.operator("action.select_all_toggle", text="Invert Selection").invert = True layout.separator() - layout.operator("action.select_border") + layout.operator("action.select_border").axis_range = False layout.operator("action.select_border", text="Border Axis Range").axis_range = True layout.separator() diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 5f7462ce44e..36ba5eeb92e 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -81,13 +81,13 @@ class GRAPH_MT_view(Menu): layout.prop(st, "use_beauty_drawing") layout.separator() - if st.show_handles: - layout.operator("graph.handles_view_toggle", icon='CHECKBOX_HLT', text="Show All Handles") - else: - layout.operator("graph.handles_view_toggle", icon='CHECKBOX_DEHLT', text="Show All Handles") + + layout.prop(st, "show_handles") + layout.prop(st, "use_only_selected_curves_handles") layout.prop(st, "use_only_selected_keyframe_handles") - layout.operator("anim.time_toggle") + + layout.prop(st, "show_seconds") layout.separator() layout.operator("anim.previewrange_set") @@ -111,7 +111,7 @@ class GRAPH_MT_select(Menu): layout = self.layout # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None - layout.operator("graph.select_all_toggle") + layout.operator("graph.select_all_toggle").invert = False layout.operator("graph.select_all_toggle", text="Invert Selection").invert = True layout.separator() diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 4ccdef747ce..a41ae92b4b6 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -19,6 +19,11 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from .properties_paint_common import UnifiedPaintPanel + +class ImagePaintPanel(UnifiedPaintPanel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' class BrushButtonsPanel(): @@ -52,7 +57,8 @@ class IMAGE_MT_view(Menu): layout.prop(sima, "use_realtime_update") if show_uvedit: layout.prop(toolsettings, "show_uv_local_view") - layout.prop(uv, "show_other_objects") + + layout.prop(uv, "show_other_objects") layout.separator() @@ -85,8 +91,8 @@ class IMAGE_MT_select(Menu): def draw(self, context): layout = self.layout - layout.operator("uv.select_border") - layout.operator("uv.select_border").pinned = True + layout.operator("uv.select_border").pinned = False + layout.operator("uv.select_border", text="Border Select Pinned").pinned = True layout.separator() @@ -143,12 +149,14 @@ class IMAGE_MT_image(Menu): # only for dirty && specific image types, perhaps # this could be done in operator poll too if ima.is_dirty: - if ima.source in {'FILE', 'GENERATED'} and ima.type != 'MULTILAYER': + if ima.source in {'FILE', 'GENERATED'} and ima.type != 'OPEN_EXR_MULTILAYER': layout.operator("image.pack", text="Pack As PNG").as_png = True - layout.separator() + if not context.tool_settings.use_uv_sculpt: + layout.separator() + layout.prop(sima, "use_image_paint") - layout.prop(sima, "use_image_paint") + layout.separator() class IMAGE_MT_image_invert(Menu): @@ -184,7 +192,7 @@ class IMAGE_MT_uvs_showhide(Menu): layout = self.layout layout.operator("uv.reveal") - layout.operator("uv.hide", text="Hide Selected") + layout.operator("uv.hide", text="Hide Selected").unselected = False layout.operator("uv.hide", text="Hide Unselected").unselected = True @@ -256,6 +264,10 @@ class IMAGE_MT_uvs(Menu): layout.separator() + layout.prop(toolsettings, "use_uv_sculpt") + + layout.separator() + layout.prop(uv, "use_live_unwrap") layout.operator("uv.unwrap") layout.operator("uv.pin", text="Unpin").clear = True @@ -267,6 +279,8 @@ class IMAGE_MT_uvs(Menu): layout.operator("uv.average_islands_scale") layout.operator("uv.minimize_stretch") layout.operator("uv.stitch") + layout.operator("uv.mark_seam") + layout.operator("uv.seams_from_islands") layout.operator("mesh.faces_mirror_uv") layout.separator() @@ -632,7 +646,7 @@ class IMAGE_PT_view_properties(Panel): sub.row().prop(uvedit, "draw_stretch_type", expand=True) -class IMAGE_PT_paint(Panel): +class IMAGE_PT_paint(Panel, ImagePaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' bl_label = "Paint" @@ -657,13 +671,13 @@ class IMAGE_PT_paint(Panel): col.prop(brush, "color", text="") row = col.row(align=True) - row.prop(brush, "size", slider=True) - row.prop(brush, "use_pressure_size", toggle=True, text="") + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + self.prop_unified_size(row, context, brush, "use_pressure_size") row = col.row(align=True) - row.prop(brush, "strength", slider=True) - row.prop(brush, "use_pressure_strength", toggle=True, text="") - + self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") + row = col.row(align=True) row.prop(brush, "jitter", slider=True) row.prop(brush, "use_pressure_jitter", toggle=True, text="") @@ -697,8 +711,8 @@ class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - settings = context.tool_settings.image_paint - brush = settings.brush + toolsettings = context.tool_settings.image_paint + brush = toolsettings.brush layout.prop(brush, "image_tool", text="") @@ -753,5 +767,80 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' + +class IMAGE_UV_sculpt_curve(Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + bl_label = "UV Sculpt Curve" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sima = context.space_data + toolsettings = context.tool_settings.image_paint + return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) + + def draw(self, context): + layout = self.layout + + toolsettings = context.tool_settings + uvsculpt = toolsettings.uv_sculpt + brush = uvsculpt.brush + + layout.template_curve_mapping(brush, "curve") + + row = layout.row(align=True) + row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH' + row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND' + row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT' + row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP' + row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE' + row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX' + + +class IMAGE_UV_sculpt(Panel, ImagePaintPanel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + bl_label = "UV Sculpt" + + @classmethod + def poll(cls, context): + sima = context.space_data + toolsettings = context.tool_settings.image_paint + return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) + + def draw(self, context): + layout = self.layout + + toolsettings = context.tool_settings + uvsculpt = toolsettings.uv_sculpt + brush = uvsculpt.brush + + if brush: + col = layout.column() + + row = col.row(align=True) + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + self.prop_unified_size(row, context, brush, "use_pressure_size") + + row = col.row(align=True) + self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") + + split = layout.split() + col = split.column() + + col.prop(toolsettings, "uv_sculpt_lock_borders") + col.prop(toolsettings, "uv_sculpt_all_islands") + + split = layout.split() + col = split.column() + + col.prop(toolsettings, "uv_sculpt_tool") + + if toolsettings.uv_sculpt_tool == 'RELAX': + col.prop(toolsettings, "uv_relax_method") + + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 56a48ad77b9..901f709fb5b 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -273,7 +273,9 @@ class INFO_MT_add(Menu): def draw(self, context): layout = self.layout - layout.operator_context = 'EXEC_SCREEN' + # note, dont use 'EXEC_SCREEN' or operators wont get the 'v3d' context. + + layout.operator_context = 'EXEC_AREA' #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH') layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH') @@ -296,7 +298,7 @@ class INFO_MT_add(Menu): layout.separator() layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA') - layout.operator_context = 'EXEC_SCREEN' + layout.operator_context = 'EXEC_AREA' layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP') layout.separator() diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 1fc58475ace..da6d1f72123 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -36,16 +36,39 @@ class LOGIC_PT_properties(Panel): ob = context.active_object game = ob.game + is_font = (ob.type == 'FONT') + + if is_font: + prop_index = game.properties.find("Text") + if prop_index != -1: + layout.operator("object.game_property_remove", text="Remove Text Game Property", icon='X').index = prop_index + row = layout.row() + sub = row.row() + sub.enabled = 0 + prop = game.properties[prop_index] + sub.prop(prop, "name", text="") + row.prop(prop, "type", text="") + # get the property from the body, not the game property + # note, don't do this - it's too slow and body can potentually be a really long string. + # row.prop(ob.data, "body", text="") + row.label("See Text Object") + else: + props = layout.operator("object.game_property_new", text="Add Text Game Property", icon='ZOOMIN') + props.name = 'Text' + props.type = 'STRING' layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN') for i, prop in enumerate(game.properties): + if is_font and i == prop_index: + continue + box = layout.box() row = box.row() row.prop(prop, "name", text="") row.prop(prop, "type", text="") - row.prop(prop, "value", text="", toggle=True) # we don't care about the type. rna will display correctly + row.prop(prop, "value", text="") row.prop(prop, "show_debug", text="", toggle=True, icon='INFO') row.operator("object.game_property_remove", text="", icon='X', emboss=False).index = i diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index 59057166ec4..18d32575bc2 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -62,7 +62,7 @@ class NLA_MT_view(Menu): layout.prop(st, "use_realtime_update") layout.prop(st, "show_frame_indicator") - layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds") + layout.prop(st, "show_seconds") layout.prop(st, "show_strip_curves") @@ -86,11 +86,11 @@ class NLA_MT_select(Menu): layout = self.layout # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None - layout.operator("nla.select_all_toggle") + layout.operator("nla.select_all_toggle").invert = False layout.operator("nla.select_all_toggle", text="Invert Selection").invert = True layout.separator() - layout.operator("nla.select_border") + layout.operator("nla.select_border").axis_range = False layout.operator("nla.select_border", text="Border Axis Range").axis_range = True layout.separator() @@ -165,7 +165,7 @@ class NLA_MT_add(Menu): layout.operator("nla.meta_remove") layout.separator() - layout.operator("nla.tracks_add") + layout.operator("nla.tracks_add").above_selected = False layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 11d732ee0a6..8b10556a8d7 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -28,6 +28,7 @@ class NODE_HT_header(Header): layout = self.layout scene = context.scene + ob = context.object snode = context.space_data snode_id = snode.id id_from = snode.id_from @@ -47,9 +48,19 @@ class NODE_HT_header(Header): if scene.render.use_shading_nodes: layout.prop(snode, "shader_type", text="", expand=True) - if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT': - if id_from: + if (not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT') and ob: + # Show material.new when no active ID/slot exists + if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}: + layout.template_ID(ob, "active_material", new="material.new") + # Material ID, but not for Lamps + if id_from and ob.type != 'LAMP': layout.template_ID(id_from, "active_material", new="material.new") + # Don't show "Use Nodes" Button when Engine is BI for Lamps + if snode_id and not (scene.render.use_shading_nodes == 0 and ob.type == 'LAMP'): + layout.prop(snode_id, "use_nodes") + + if snode.shader_type == 'WORLD': + layout.template_ID(scene, "world", new="world.new") if snode_id: layout.prop(snode_id, "use_nodes") diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 06f481d2993..09af7af0819 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -114,10 +114,7 @@ class SEQUENCER_MT_view(Menu): layout.operator("sequencer.view_selected") - if st.show_frames: - layout.operator("anim.time_toggle", text="Show Seconds") - else: - layout.operator("anim.time_toggle", text="Show Frames") + layout.prop(st, "show_seconds") layout.prop(st, "show_frame_indicator") if st.display_mode == 'IMAGE': @@ -148,8 +145,8 @@ class SEQUENCER_MT_select(Menu): layout.separator() layout.operator_menu_enum("object.select_grouped", "type", text="Grouped") layout.operator("sequencer.select_linked") - layout.operator("sequencer.select_all_toggle") - layout.operator("sequencer.select_inverse") + layout.operator("sequencer.select_all").action = 'TOGGLE' + layout.operator("sequencer.select_all").action = 'INVERT' class SEQUENCER_MT_marker(Menu): @@ -285,7 +282,7 @@ class SEQUENCER_MT_strip(Menu): layout.separator() layout.operator("sequencer.lock") layout.operator("sequencer.unlock") - layout.operator("sequencer.mute") + layout.operator("sequencer.mute").unselected = False layout.operator("sequencer.unmute") layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True @@ -625,6 +622,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): layout = self.layout strip = act_strip(context) + sound = strip.sound layout.template_ID(strip, "sound", open="sound.open") @@ -632,12 +630,12 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel): layout.prop(strip, "filepath", text="") row = layout.row() - if strip.sound.packed_file: + if sound.packed_file: row.operator("sound.unpack", icon='PACKAGE', text="Unpack") else: row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack") - row.prop(strip.sound, "use_memory_cache") + row.prop(sound, "use_memory_cache") layout.prop(strip, "waveform") layout.prop(strip, "volume") diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 72818dfc642..7720fddb084 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -28,7 +28,7 @@ class TIME_HT_header(Header): layout = self.layout scene = context.scene - tools = context.tool_settings + toolsettings = context.tool_settings screen = context.screen row = layout.row(align=True) @@ -61,7 +61,7 @@ class TIME_HT_header(Header): # if using JACK and A/V sync: # hide the play-reversed button # since JACK transport doesn't support reversed playback - if (context.user_preferences.system.audio_device == 'JACK' and scene.sync_mode == 'AUDIO_SYNC'): + if scene.sync_mode == 'AUDIO_SYNC' and context.user_preferences.system.audio_device == 'JACK': sub = row.row() sub.scale_x = 2.0 sub.operator("screen.animation_play", text="", icon='PLAY') @@ -80,11 +80,11 @@ class TIME_HT_header(Header): layout.separator() row = layout.row(align=True) - row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True) - row.prop(tools, "use_keyframe_insert_keyingset", text="", toggle=True) - if screen.is_animation_playing and tools.use_keyframe_insert_auto: + row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True) + row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True) + if screen.is_animation_playing and toolsettings.use_keyframe_insert_auto: subsub = row.row() - subsub.prop(tools, "use_record_with_nla", toggle=True) + subsub.prop(toolsettings, "use_record_with_nla", toggle=True) row = layout.row(align=True) row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", text="") @@ -109,7 +109,7 @@ class TIME_MT_view(Menu): st = context.space_data - layout.operator("anim.time_toggle") + layout.prop(st, "show_seconds") layout.operator("time.view_all") layout.separator() @@ -193,10 +193,10 @@ class TIME_MT_autokey(Menu): def draw(self, context): layout = self.layout - tools = context.tool_settings + toolsettings = context.tool_settings - layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS') - layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS') + layout.prop_enum(toolsettings, "auto_keying_mode", 'ADD_REPLACE_KEYS') + layout.prop_enum(toolsettings, "auto_keying_mode", 'REPLACE_KEYS') def marker_menu_generic(layout): diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 046026a3b6e..8a2dff8f050 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -96,8 +96,6 @@ class USERPREF_HT_header(Header): layout.menu("USERPREF_MT_addons_dev_guides") elif userpref.active_section == 'THEMES': layout.operator("ui.reset_default_theme") - layout.operator("wm.theme_import") - layout.operator("wm.theme_export") class USERPREF_PT_tabs(Panel): @@ -388,13 +386,9 @@ class USERPREF_PT_system(Panel): col.prop(system, "dpi") col.prop(system, "frame_server_port") col.prop(system, "scrollback", text="Console Scrollback") - col.prop(system, "author", text="Author") - col.prop(system, "use_scripts_auto_execute") - col.prop(system, "use_tabs_as_spaces") col.separator() col.separator() - col.separator() col.label(text="Sound:") col.row().prop(system, "audio_device", expand=True) @@ -408,14 +402,20 @@ class USERPREF_PT_system(Panel): col.separator() col.separator() - col.separator() col.label(text="Screencast:") col.prop(system, "screencast_fps") col.prop(system, "screencast_wait_time") + col.separator() col.separator() - col.separator() + + if hasattr(system, 'compute_device'): + col.label(text="Compute Device:") + col.row().prop(system, "compute_device_type", expand=True) + sub = col.row() + sub.active = system.compute_device_type != 'CPU' + sub.prop(system, "compute_device", text="") # 2. Column column = split.column() @@ -425,6 +425,7 @@ class USERPREF_PT_system(Panel): col.label(text="OpenGL:") col.prop(system, "gl_clip_alpha", slider=True) col.prop(system, "use_mipmaps") + col.prop(system, "use_16bit_textures") col.label(text="Anisotropic Filtering") col.prop(system, "anisotropic_filter", text="") col.prop(system, "use_vertex_buffer_objects") @@ -489,6 +490,15 @@ class USERPREF_PT_system(Panel): row.prop(system, "use_translate_tooltips", text="Tooltips") +class USERPREF_MT_interface_theme_presets(Menu): + bl_label = "Presets" + preset_subdir = "interface_theme" + preset_operator = "script.execute_preset" + preset_type = 'XML' + preset_xml_map = (("user_preferences.themes[0]", "Theme"), ) + draw = Menu.draw_preset + + class USERPREF_PT_theme(Panel): bl_space_type = 'USER_PREFERENCES' bl_label = "Themes" @@ -498,32 +508,40 @@ class USERPREF_PT_theme(Panel): @staticmethod def _theme_generic(split, themedata): - row = split.row() + col = split.column() + + def theme_generic_recurse(data): + col.label(data.rna_type.name) + row = col.row() + subsplit = row.split(percentage=0.95) - subsplit = row.split(percentage=0.95) + padding1 = subsplit.split(percentage=0.15) + padding1.column() - padding1 = subsplit.split(percentage=0.15) - padding1.column() + subsplit = row.split(percentage=0.85) - subsplit = row.split(percentage=0.85) + padding2 = subsplit.split(percentage=0.15) + padding2.column() - padding2 = subsplit.split(percentage=0.15) - padding2.column() + colsub_pair = padding1.column(), padding2.column() - colsub_pair = padding1.column(), padding2.column() + props_type = {} - props_type = {} + for i, prop in enumerate(data.rna_type.properties): + if prop.identifier == "rna_type": + continue - for i, prop in enumerate(themedata.rna_type.properties): - attr = prop.identifier - if attr == "rna_type": - continue + props_type.setdefault((prop.type, prop.subtype), []).append(prop) - props_type.setdefault((prop.type, prop.subtype), []).append(prop.identifier) + for props_type, props_ls in sorted(props_type.items()): + if props_type[0] == 'POINTER': + for i, prop in enumerate(props_ls): + theme_generic_recurse(getattr(data, prop.identifier)) + else: + for i, prop in enumerate(props_ls): + colsub_pair[i % 2].row().prop(data, prop.identifier) - for props_type, props_ls in sorted(props_type.items()): - for i, attr in enumerate(props_ls): - colsub_pair[i % 2].row().prop(themedata, attr) + theme_generic_recurse(themedata) @classmethod def poll(cls, context): @@ -536,7 +554,18 @@ class USERPREF_PT_theme(Panel): theme = context.user_preferences.themes[0] split_themes = layout.split(percentage=0.2) - split_themes.prop(theme, "theme_area", expand=True) + + sub = split_themes.column() + + sub.label(text="Presets:") + subrow = sub.row(align=True) + + subrow.menu("USERPREF_MT_interface_theme_presets", text=USERPREF_MT_interface_theme_presets.bl_label) + subrow.operator("wm.interface_theme_preset_add", text="", icon='ZOOMIN') + subrow.operator("wm.interface_theme_preset_add", text="", icon='ZOOMOUT').remove_active = True + sub.separator() + + sub.prop(theme, "theme_area", expand=True) split = layout.split(percentage=0.4) @@ -727,6 +756,7 @@ class USERPREF_PT_file(Panel): userpref = context.user_preferences paths = userpref.filepaths + system = userpref.system split = layout.split(percentage=0.7) @@ -762,6 +792,14 @@ class USERPREF_PT_file(Panel): subsplit.prop(paths, "animation_player_preset", text="") subsplit.prop(paths, "animation_player", text="") + col.separator() + col.separator() + + colsplit = col.split(percentage=0.95) + sub = colsplit.column() + sub.label(text="Author:") + sub.prop(system, "author", text="") + col = split.column() col.label(text="Save & Load:") col.prop(paths, "use_relative_paths") @@ -784,6 +822,13 @@ class USERPREF_PT_file(Panel): sub.active = paths.use_auto_save_temporary_files sub.prop(paths, "auto_save_time", text="Timer (mins)") + col.separator() + + col.label(text="Scripts:") + col.prop(system, "use_scripts_auto_execute") + col.prop(system, "use_tabs_as_spaces") + + from .space_userpref_keymap import InputKeyMapPanel diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 58816f8e8be..1dba79b34d7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -263,7 +263,7 @@ class VIEW3D_MT_uv_map(Menu): layout.separator() layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("uv.project_from_view") + layout.operator("uv.project_from_view").scale_to_bounds = False layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True layout.separator() @@ -421,8 +421,8 @@ class VIEW3D_MT_select_object(Menu): layout.separator() - layout.operator("object.select_all", text="Select/Deselect All") - layout.operator("object.select_inverse", text="Inverse") + layout.operator("object.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("object.select_all", text="Inverse").action = 'INVERT' layout.operator("object.select_random", text="Random") layout.operator("object.select_mirror", text="Mirror") layout.operator("object.select_by_layer", text="Select All by Layer") @@ -446,8 +446,8 @@ class VIEW3D_MT_select_pose(Menu): layout.separator() - layout.operator("pose.select_all", text="Select/Deselect All") - layout.operator("pose.select_inverse", text="Inverse") + layout.operator("pose.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("pose.select_all", text="Inverse").action = 'INVERT' layout.operator("pose.select_flip_active", text="Flip Active") layout.operator("pose.select_constraint_target", text="Constraint Target") layout.operator("pose.select_linked", text="Linked") @@ -483,9 +483,9 @@ class VIEW3D_MT_select_particle(Menu): layout.separator() - layout.operator("particle.select_all", text="Select/Deselect All") + layout.operator("particle.select_all", text="Select/Deselect All").action = 'TOGGLE' layout.operator("particle.select_linked") - layout.operator("particle.select_inverse") + layout.operator("particle.select_all").action = 'INVERT' layout.separator() @@ -509,8 +509,8 @@ class VIEW3D_MT_select_edit_mesh(Menu): layout.separator() - layout.operator("mesh.select_all", text="Select/Deselect All") - layout.operator("mesh.select_inverse", text="Inverse") + layout.operator("mesh.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("mesh.select_all", text="Inverse").action = 'INVERT' layout.separator() @@ -541,7 +541,7 @@ class VIEW3D_MT_select_edit_mesh(Menu): layout.operator("mesh.select_linked", text="Linked") layout.operator("mesh.select_vertex_path", text="Vertex Path") - layout.operator("mesh.loop_multi_select", text="Edge Loop") + layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True layout.separator() @@ -561,8 +561,8 @@ class VIEW3D_MT_select_edit_curve(Menu): layout.separator() - layout.operator("curve.select_all", text="Select/Deselect All") - layout.operator("curve.select_inverse") + layout.operator("curve.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("curve.select_all", text="Inverse").action = 'INVERT' layout.operator("curve.select_random") layout.operator("curve.select_nth", text="Every Nth Number of Points") @@ -590,8 +590,8 @@ class VIEW3D_MT_select_edit_surface(Menu): layout.separator() - layout.operator("curve.select_all", text="Select/Deselect All") - layout.operator("curve.select_inverse") + layout.operator("curve.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("curve.select_all", text="Inverse").action = 'INVERT' layout.operator("curve.select_random") layout.operator("curve.select_nth", text="Every Nth Number of Points") @@ -616,7 +616,7 @@ class VIEW3D_MT_select_edit_metaball(Menu): layout.separator() layout.operator("mball.select_all").action = 'TOGGLE' - layout.operator("mball.select_inverse_metaelems") + layout.operator("mball.select_all").action = 'INVERT' layout.separator() @@ -646,8 +646,8 @@ class VIEW3D_MT_select_edit_armature(Menu): layout.separator() - layout.operator("armature.select_all", text="Select/Deselect All") - layout.operator("armature.select_inverse", text="Inverse") + layout.operator("armature.select_all", text="Select/Deselect All").action = 'TOGGLE' + layout.operator("armature.select_all", text="Inverse").action = 'INVERT' layout.separator() @@ -865,12 +865,16 @@ class VIEW3D_MT_object_apply(Menu): def draw(self, context): layout = self.layout - layout.operator("object.transform_apply", text="Location").location = True - layout.operator("object.transform_apply", text="Rotation").rotation = True - layout.operator("object.transform_apply", text="Scale").scale = True + props = layout.operator("object.transform_apply", text="Location") + props.location, props.rotation, props.scale = True, False, False + + props = layout.operator("object.transform_apply", text="Rotation") + props.location, props.rotation, props.scale = False, True, False + + props = layout.operator("object.transform_apply", text="Scale") + props.location, props.rotation, props.scale = False, False, True props = layout.operator("object.transform_apply", text="Rotation & Scale") - props.scale = True - props.rotation = True + props.location, props.rotation, props.scale = False, True, True layout.separator() @@ -943,7 +947,7 @@ class VIEW3D_MT_object_showhide(Menu): layout = self.layout layout.operator("object.hide_view_clear", text="Show Hidden") - layout.operator("object.hide_view_set", text="Hide Selected") + layout.operator("object.hide_view_set", text="Hide Selected").unselected = False layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True @@ -1056,13 +1060,13 @@ class VIEW3D_MT_vertex_group(Menu): if ob.vertex_groups.active: layout.separator() layout.operator("object.vertex_group_assign", text="Assign to Active Group") - layout.operator("object.vertex_group_remove_from", text="Remove from Active Group") + layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").all = False layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True layout.separator() if ob.vertex_groups.active: layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group") - layout.operator("object.vertex_group_remove", text="Remove Active Group") + layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True # ********** Weight paint menu ********** @@ -1106,9 +1110,9 @@ class VIEW3D_MT_sculpt(Menu): def draw(self, context): layout = self.layout - tool_settings = context.tool_settings - sculpt = tool_settings.sculpt - brush = tool_settings.sculpt.brush + toolsettings = context.tool_settings + sculpt = toolsettings.sculpt + brush = toolsettings.sculpt.brush layout.operator("ed.undo") layout.operator("ed.redo") @@ -1144,8 +1148,8 @@ class VIEW3D_MT_sculpt(Menu): layout.prop(sculpt, "show_brush") # TODO, make available from paint menu! - layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size") - layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength") + layout.prop(toolsettings, "sculpt_paint_use_unified_size", text="Unify Size") + layout.prop(toolsettings, "sculpt_paint_use_unified_strength", text="Unify Strength") # ********** Particle menu ********** @@ -1311,7 +1315,7 @@ class VIEW3D_MT_pose_propagate(Menu): def draw(self, context): layout = self.layout - layout.operator("pose.propagate") + layout.operator("pose.propagate").mode = 'WHILE_HELD' layout.separator() @@ -1449,7 +1453,7 @@ class VIEW3D_MT_edit_mesh(Menu): def draw(self, context): layout = self.layout - settings = context.tool_settings + toolsettings = context.tool_settings layout.operator("ed.undo") layout.operator("ed.redo") @@ -1481,9 +1485,9 @@ class VIEW3D_MT_edit_mesh(Menu): layout.separator() - layout.prop(settings, "use_mesh_automerge") - layout.prop_menu_enum(settings, "proportional_edit") - layout.prop_menu_enum(settings, "proportional_edit_falloff") + layout.prop(toolsettings, "use_mesh_automerge") + layout.prop_menu_enum(toolsettings, "proportional_edit") + layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") layout.separator() @@ -1498,13 +1502,13 @@ class VIEW3D_MT_edit_mesh_specials(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("mesh.subdivide", text="Subdivide") + layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0 layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0 layout.operator("mesh.merge", text="Merge...") layout.operator("mesh.remove_doubles") layout.operator("mesh.hide", text="Hide") layout.operator("mesh.reveal", text="Reveal") - layout.operator("mesh.select_inverse") + layout.operator("mesh.select_all").action = 'INVERT' layout.operator("mesh.flip_normals") layout.operator("mesh.vertices_smooth", text="Smooth") # layout.operator("mesh.bevel", text="Bevel") @@ -1614,12 +1618,12 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.separator() - layout.operator("mesh.mark_seam") + layout.operator("mesh.mark_seam").clear = False layout.operator("mesh.mark_seam", text="Clear Seam").clear = True layout.separator() - layout.operator("mesh.mark_sharp") + layout.operator("mesh.mark_sharp").clear = False layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True layout.separator() @@ -1631,7 +1635,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.operator("TRANSFORM_OT_edge_slide") layout.operator("TRANSFORM_OT_edge_crease") - layout.operator("mesh.loop_multi_select", text="Edge Loop") + layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1); # uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0); @@ -1696,7 +1700,7 @@ class VIEW3D_MT_edit_mesh_normals(Menu): def draw(self, context): layout = self.layout - layout.operator("mesh.normals_make_consistent", text="Recalculate Outside") + layout.operator("mesh.normals_make_consistent", text="Recalculate Outside").inside = False layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True layout.separator() @@ -1714,7 +1718,7 @@ class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu): def draw_curve(self, context): layout = self.layout - settings = context.tool_settings + toolsettings = context.tool_settings layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_mirror") @@ -1736,8 +1740,8 @@ def draw_curve(self, context): layout.separator() - layout.prop_menu_enum(settings, "proportional_edit") - layout.prop_menu_enum(settings, "proportional_edit_falloff") + layout.prop_menu_enum(toolsettings, "proportional_edit") + layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") layout.separator() @@ -1866,7 +1870,7 @@ class VIEW3D_MT_edit_meta(Menu): def draw(self, context): layout = self.layout - settings = context.tool_settings + toolsettings = context.tool_settings layout.operator("ed.undo") layout.operator("ed.redo") @@ -1885,8 +1889,8 @@ class VIEW3D_MT_edit_meta(Menu): layout.separator() - layout.prop_menu_enum(settings, "proportional_edit") - layout.prop_menu_enum(settings, "proportional_edit_falloff") + layout.prop_menu_enum(toolsettings, "proportional_edit") + layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") layout.separator() @@ -1910,7 +1914,7 @@ class VIEW3D_MT_edit_lattice(Menu): def draw(self, context): layout = self.layout - settings = context.tool_settings + toolsettings = context.tool_settings layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_mirror") @@ -1922,8 +1926,8 @@ class VIEW3D_MT_edit_lattice(Menu): layout.separator() - layout.prop_menu_enum(settings, "proportional_edit") - layout.prop_menu_enum(settings, "proportional_edit_falloff") + layout.prop_menu_enum(toolsettings, "proportional_edit") + layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") class VIEW3D_MT_edit_armature(Menu): @@ -2369,13 +2373,14 @@ class VIEW3D_PT_transform_orientations(Panel): view = context.space_data orientation = view.current_orientation - col = layout.column() - col.prop(view, "transform_orientation") - col.operator("transform.create_orientation", text="Create") + row = layout.row(align=True) + row.prop(view, "transform_orientation", text="") + row.operator("transform.create_orientation", text="", icon='ZOOMIN') if orientation: - col.prop(orientation, "name") - col.operator("transform.delete_orientation", text="Delete") + row = layout.row(align=True) + row.prop(orientation, "name", text="") + row.operator("transform.delete_orientation", text="", icon="X") class VIEW3D_PT_etch_a_ton(Panel): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 25f81f2cde1..aa7cec0c01a 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel +from .properties_paint_common import UnifiedPaintPanel class View3DPanel(): @@ -155,7 +156,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): col = layout.column(align=True) col.label(text="UV Mapping:") col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map" - col.operator("mesh.mark_seam") + col.operator("mesh.mark_seam").clear = False col.operator("mesh.mark_seam", text="Clear Seam").clear = True col = layout.column(align=True) @@ -447,29 +448,12 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel): # ********** default tools for paint modes **************** -class PaintPanel(): +class View3DPaintPanel(UnifiedPaintPanel): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' - @staticmethod - def paint_settings(context): - ts = context.tool_settings - if context.sculpt_object: - return ts.sculpt - elif context.vertex_paint_object: - return ts.vertex_paint - elif context.weight_paint_object: - return ts.weight_paint - elif context.image_paint_object: - return ts.image_paint - elif context.particle_edit_object: - return ts.particle_edit - - return None - - -class VIEW3D_PT_tools_brush(PaintPanel, Panel): +class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): bl_label = "Brush" @classmethod @@ -479,6 +463,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): def draw(self, context): layout = self.layout + toolsettings = context.tool_settings settings = self.paint_settings(context) brush = settings.brush @@ -523,14 +508,16 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): row = col.row(align=True) - if brush.use_locked_size: - row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED') - row.prop(brush, "unprojected_radius", text="Radius", slider=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)): + 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: - row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED') - row.prop(brush, "size", slider=True) + self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED') + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") - row.prop(brush, "use_pressure_size", toggle=True, text="") + self.prop_unified_size(row, context, brush, "use_pressure_size") if tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}: col.separator() @@ -543,13 +530,13 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): else: row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED') - row.prop(brush, "strength", text="Strength", slider=True) - row.prop(brush, "use_pressure_strength", text="") + self.prop_unified_strength(row, context, brush, "strength", text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") if tool == 'ROTATE': row = col.row(align=True) - row.prop(brush, "strength", text="Strength", slider=True) - row.prop(brush, "use_pressure_strength", text="") + self.prop_unified_strength(row, context, brush, "strength", text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") if tool != 'SMOOTH': col.separator() @@ -636,12 +623,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): col.prop(brush, "color", text="") row = col.row(align=True) - row.prop(brush, "size", slider=True) - row.prop(brush, "use_pressure_size", toggle=True, text="") + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + self.prop_unified_size(row, context, brush, "use_pressure_size") row = col.row(align=True) - row.prop(brush, "strength", text="Strength", slider=True) - row.prop(brush, "use_pressure_strength", toggle=True, text="") + self.prop_unified_strength(row, context, brush, "strength", text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") row = col.row(align=True) row.prop(brush, "jitter", slider=True) @@ -655,19 +642,19 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): # Weight Paint Mode # elif context.weight_paint_object and brush: - layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True) - layout.prop(context.tool_settings, "use_auto_normalize", text="Auto Normalize") - layout.prop(context.tool_settings, "use_multipaint", text="Multi-Paint") + layout.prop(toolsettings, "vertex_group_weight", text="Weight", slider=True) + layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize") + layout.prop(toolsettings, "use_multipaint", text="Multi-Paint") col = layout.column() row = col.row(align=True) - row.prop(brush, "size", slider=True) - row.prop(brush, "use_pressure_size", toggle=True, text="") + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + self.prop_unified_size(row, context, brush, "use_pressure_size") row = col.row(align=True) - row.prop(brush, "strength", text="Strength", slider=True) - row.prop(brush, "use_pressure_strength", toggle=True, text="") + self.prop_unified_strength(row, context, brush, "strength", text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") row = col.row(align=True) row.prop(brush, "jitter", slider=True) @@ -680,12 +667,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): col.prop(brush, "color", text="") row = col.row(align=True) - row.prop(brush, "size", slider=True) - row.prop(brush, "use_pressure_size", toggle=True, text="") + self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + self.prop_unified_size(row, context, brush, "use_pressure_size") row = col.row(align=True) - row.prop(brush, "strength", text="Strength", slider=True) - row.prop(brush, "use_pressure_strength", toggle=True, text="") + self.prop_unified_strength(row, context, brush, "strength", text="Strength") + self.prop_unified_strength(row, context, brush, "use_pressure_strength") # XXX - TODO #row = col.row(align=True) @@ -693,7 +680,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): #row.prop(brush, "use_pressure_jitter", toggle=True, text="") -class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel): +class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): bl_label = "Texture" bl_options = {'DEFAULT_CLOSED'} @@ -772,7 +759,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel): sub.prop(brush, "texture_overlay_alpha", text="Alpha") -class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel): +class VIEW3D_PT_tools_brush_tool(Panel, View3DPaintPanel): bl_label = "Tool" bl_options = {'DEFAULT_CLOSED'} @@ -806,7 +793,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel): row.prop(brush, "use_paint_image", text="", icon='TPAINT_HLT') -class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): +class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): bl_label = "Stroke" bl_options = {'DEFAULT_CLOSED'} @@ -898,7 +885,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): # row.prop(brush, "use_pressure_spacing", toggle=True, text="") -class VIEW3D_PT_tools_brush_curve(PaintPanel, Panel): +class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel): bl_label = "Curve" bl_options = {'DEFAULT_CLOSED'} @@ -925,7 +912,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel, Panel): row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' -class VIEW3D_PT_sculpt_options(PaintPanel, Panel): +class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): bl_label = "Options" bl_options = {'DEFAULT_CLOSED'} @@ -936,8 +923,8 @@ class VIEW3D_PT_sculpt_options(PaintPanel, Panel): def draw(self, context): layout = self.layout - tool_settings = context.tool_settings - sculpt = tool_settings.sculpt + toolsettings = context.tool_settings + sculpt = toolsettings.sculpt layout.label(text="Lock:") row = layout.row(align=True) @@ -950,12 +937,10 @@ class VIEW3D_PT_sculpt_options(PaintPanel, Panel): layout.prop(sculpt, "show_brush") layout.prop(sculpt, "use_deform_only") - layout.label(text="Unified Settings:") - layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size") - layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength") + self.unified_paint_settings(layout, context) -class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel): +class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel): bl_label = "Symmetry" bl_options = {'DEFAULT_CLOSED'} @@ -979,17 +964,17 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel): layout.prop(sculpt, "use_symmetry_feather", text="Feather") -class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel): +class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel): bl_label = "Appearance" bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): - ts = context.tool_settings - return ((context.sculpt_object and ts.sculpt) or - (context.vertex_paint_object and ts.vertex_paint) or - (context.weight_paint_object and ts.weight_paint) or - (context.image_paint_object and ts.image_paint)) + toolsettings = context.tool_settings + return ((context.sculpt_object and toolsettings.sculpt) or + (context.vertex_paint_object and toolsettings.vertex_paint) or + (context.weight_paint_object and toolsettings.weight_paint) or + (context.image_paint_object and toolsettings.image_paint)) def draw(self, context): layout = self.layout @@ -1041,7 +1026,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel): col.operator("object.vertex_group_fix", text="Fix Deforms") -class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): +class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel): bl_context = "weightpaint" bl_label = "Options" @@ -1052,9 +1037,10 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): wpaint = tool_settings.weight_paint col = layout.column() - col.prop(wpaint, "use_all_faces") + col.prop(wpaint, "use_normal") col.prop(wpaint, "use_spray") + col.prop(wpaint, "use_group_restrict") obj = context.weight_paint_object if obj.type == 'MESH': @@ -1062,9 +1048,7 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): col.prop(mesh, "use_mirror_x") col.prop(mesh, "use_mirror_topology") - col.label(text="Unified Settings:") - col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size") - col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength") + self.unified_paint_settings(col, context) # Commented out because the Apply button isn't an operator yet, making these settings useless # col.label(text="Gamma:") @@ -1078,15 +1062,15 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel): # ********** default tools for vertex-paint **************** -class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel): +class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel): bl_context = "vertexpaint" bl_label = "Options" def draw(self, context): layout = self.layout - tool_settings = context.tool_settings - vpaint = tool_settings.vertex_paint + toolsettings = context.tool_settings + vpaint = toolsettings.vertex_paint col = layout.column() #col.prop(vpaint, "mode", text="") @@ -1094,9 +1078,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel): col.prop(vpaint, "use_normal") col.prop(vpaint, "use_spray") - col.label(text="Unified Settings:") - col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size") - col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength") + self.unified_paint_settings(col, context) # Commented out because the Apply button isn't an operator yet, making these settings useless # col.label(text="Gamma:") @@ -1126,8 +1108,9 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): ob = context.active_object mesh = ob.data - ipaint = context.tool_settings.image_paint - settings = context.tool_settings.image_paint + toolsettings = context.tool_settings + ipaint = toolsettings.image_paint + settings = toolsettings.image_paint use_projection = ipaint.use_projection col = layout.column() @@ -1173,7 +1156,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): col.operator("image.save_dirty", text="Save All Edited") -class VIEW3D_PT_imagepaint_options(PaintPanel): +class VIEW3D_PT_imagepaint_options(View3DPaintPanel): bl_label = "Options" bl_options = {'DEFAULT_CLOSED'} @@ -1184,12 +1167,8 @@ class VIEW3D_PT_imagepaint_options(PaintPanel): def draw(self, context): layout = self.layout - tool_settings = context.tool_settings - col = layout.column() - col.label(text="Unified Settings:") - col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size") - col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength") + self.unified_paint_settings(col, context) class VIEW3D_MT_tools_projectpaint_clone(Menu): diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py index 833ac600995..1fc74ff7348 100644 --- a/release/scripts/templates/addon_add_object.py +++ b/release/scripts/templates/addon_add_object.py @@ -3,7 +3,6 @@ bl_info = { "author": "YourNameHere", "version": (1, 0), "blender": (2, 5, 5), - "api": 33333, "location": "View3D > Add > Mesh > New Object", "description": "Adds a new Mesh Object", "warning": "", |