Merging r43130 through r43500 from trunk into soc-2011-tomato
This commit is contained in:
@@ -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": "",
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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', [])
|
||||
]),
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -219,7 +219,7 @@ 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).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 +304,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')
|
||||
|
||||
@@ -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,7 +56,7 @@ 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)
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ def CLIP_camera_for_clip(context, clip):
|
||||
|
||||
return camera
|
||||
|
||||
|
||||
def CLIP_track_view_selected(sc, track):
|
||||
if track.select_anchor:
|
||||
return True
|
||||
@@ -118,7 +119,7 @@ class CLIP_OT_track_to_empty(Operator):
|
||||
constraint.track = track.name
|
||||
constraint.use_3d_position = False
|
||||
constraint.object = tracking_object.name
|
||||
constraint.camera = CLIP_camera_for_clip(context, clip);
|
||||
constraint.camera = CLIP_camera_for_clip(context, clip)
|
||||
|
||||
def execute(self, context):
|
||||
sc = context.space_data
|
||||
@@ -127,7 +128,7 @@ class CLIP_OT_track_to_empty(Operator):
|
||||
|
||||
for track in tracking_object.tracks:
|
||||
if CLIP_track_view_selected(sc, track):
|
||||
self._link_track(context, clip, tracking_object ,track)
|
||||
self._link_track(context, clip, tracking_object, track)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
@@ -529,7 +530,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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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")
|
||||
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")
|
||||
|
||||
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
|
||||
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")
|
||||
|
||||
file_preset.write("%s = %r\n" % (rna_path, value))
|
||||
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.close()
|
||||
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'}
|
||||
|
||||
|
||||
@@ -385,6 +415,14 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
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"
|
||||
|
||||
@@ -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'}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -778,6 +778,10 @@ class ConstraintButtonsPanel():
|
||||
|
||||
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):
|
||||
|
||||
61
release/scripts/startup/bl_ui/properties_paint_common.py
Normal file
61
release/scripts/startup/bl_ui/properties_paint_common.py
Normal file
@@ -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)
|
||||
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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__)
|
||||
|
||||
@@ -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')
|
||||
@@ -162,14 +162,13 @@ 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')
|
||||
@@ -182,9 +181,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 +314,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 +374,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 +519,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")
|
||||
@@ -854,6 +863,10 @@ class CLIP_MT_track(Menu):
|
||||
layout.separator()
|
||||
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")
|
||||
@@ -933,7 +946,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 +972,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 +999,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 +1007,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 +1015,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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,7 +91,7 @@ class IMAGE_MT_select(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("uv.select_border")
|
||||
layout.operator("uv.select_border").pinned = False
|
||||
layout.operator("uv.select_border").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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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__)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -36,11 +36,34 @@ 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="")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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,10 +48,15 @@ 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")
|
||||
if snode_id:
|
||||
# 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")
|
||||
|
||||
elif snode.tree_type == 'TEXTURE':
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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,11 +386,7 @@ 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()
|
||||
|
||||
@@ -406,16 +400,22 @@ class USERPREF_PT_system(Panel):
|
||||
sub.prop(system, "audio_sample_rate", text="Sample Rate")
|
||||
sub.prop(system, "audio_sample_format", text="Sample Format")
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
col.label(text="Screencast:")
|
||||
col.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()
|
||||
|
||||
subsplit = row.split(percentage=0.95)
|
||||
def theme_generic_recurse(data):
|
||||
col.label(data.rna_type.name)
|
||||
row = col.row()
|
||||
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(themedata.rna_type.properties):
|
||||
attr = prop.identifier
|
||||
if attr == "rna_type":
|
||||
continue
|
||||
for i, prop in enumerate(data.rna_type.properties):
|
||||
if prop.identifier == "rna_type":
|
||||
continue
|
||||
|
||||
props_type.setdefault((prop.type, prop.subtype), []).append(prop.identifier)
|
||||
props_type.setdefault((prop.type, prop.subtype), []).append(prop)
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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")
|
||||
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")
|
||||
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")
|
||||
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")
|
||||
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")
|
||||
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):
|
||||
|
||||
@@ -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": "",
|
||||
|
||||
Reference in New Issue
Block a user