Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hays <jason_hays22@mymail.eku.edu>2011-08-19 21:15:30 +0400
committerJason Hays <jason_hays22@mymail.eku.edu>2011-08-19 21:15:30 +0400
commitc58fb76f1a043124debf2a71e6c56f2a478a0dde (patch)
tree393c06981022e6159df7c6b9efc3b5062ab7f6af /release
parentc57d64468bc9009a11cafdbf0cc66e83cdaa6841 (diff)
parent3a81f23e0975ea87ade780965462ad5b15b39d95 (diff)
Merged 39338-39558
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py10
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_smart_project.py49
-rw-r--r--release/scripts/startup/bl_operators/wm.py388
-rw-r--r--release/scripts/startup/bl_ui/properties_data_curve.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py2
-rw-r--r--release/scripts/startup/bl_ui/space_console.py13
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py25
-rw-r--r--release/scripts/startup/bl_ui/space_graph.py19
-rw-r--r--release/scripts/startup/bl_ui/space_image.py67
-rw-r--r--release/scripts/startup/bl_ui/space_info.py6
-rw-r--r--release/scripts/startup/bl_ui/space_logic.py12
-rw-r--r--release/scripts/startup/bl_ui/space_nla.py19
-rw-r--r--release/scripts/startup/bl_ui/space_node.py30
-rw-r--r--release/scripts/startup/bl_ui/space_outliner.py29
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py24
-rw-r--r--release/scripts/startup/bl_ui/space_text.py6
-rw-r--r--release/scripts/startup/bl_ui/space_time.py7
-rw-r--r--release/scripts/startup/bl_ui/space_userpref_keymap.py2
19 files changed, 405 insertions, 307 deletions
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index bb4e95c051f..6271c1f77b5 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -439,7 +439,7 @@ def path_reference_copy(copy_set, report=print):
shutil.copy(file_src, file_dst)
-def unique_name(key, name, name_dict, name_max=-1, clean_func=None):
+def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):
"""
Helper function for storing unique names which may have special characters
stripped and restricted to a maximum length.
@@ -456,6 +456,9 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None):
:type name_dict: dict
:arg clean_func: Function to call on *name* before creating a unique value.
:type clean_func: function
+ :arg sep: Separator to use when between the name and a number when a
+ duplicate name is found.
+ :type sep: string
"""
name_new = name_dict.get(key)
if name_new is None:
@@ -466,14 +469,15 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None):
if name_max == -1:
while name_new in name_dict_values:
- name_new = "%s.%03d" % (name_new_orig, count)
+ name_new = "%s%s%03d" % (name_new_orig, sep, count)
count += 1
else:
name_new = name_new[:name_max]
while name_new in name_dict_values:
count_str = "%03d" % count
- name_new = "%.*s.%s" % (name_max - (len(count_str) + 1),
+ name_new = "%.*s%s%s" % (name_max - (len(count_str) + 1),
name_new_orig,
+ sep,
count_str,
)
count += 1
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index 67c2f5d001b..8afd6c104e0 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -813,39 +813,26 @@ def main(context,
global RotMatStepRotation
main_consts()
- # TODO, all selected meshes
- '''
- # objects = context.selected_editable_objects
- objects = []
-
- # we can will tag them later.
- obList = [ob for ob in objects if ob.type == 'MESH']
-
- # Face select object may not be selected.
- ob = context.active_object
-
- if ob and (not ob.select) and ob.type == 'MESH':
- # Add to the list
- obList =[ob]
- del objects
- '''
+ # Create the variables.
+ USER_PROJECTION_LIMIT = projection_limit
+ USER_ONLY_SELECTED_FACES = True
+ USER_SHARE_SPACE = 1 # Only for hole filling.
+ USER_STRETCH_ASPECT = 1 # Only for hole filling.
+ USER_ISLAND_MARGIN = island_margin # Only for hole filling.
+ USER_FILL_HOLES = 0
+ USER_FILL_HOLES_QUALITY = 50 # Only for hole filling.
+ USER_VIEW_INIT = 0 # Only for hole filling.
- # quick workaround
- obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH']
+ is_editmode = (context.active_object.mode == 'EDIT')
+ if is_editmode:
+ obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH']
+ else:
+ obList = [ob for ob in context.selected_editable_objects if ob and ob.type == 'MESH']
+ USER_ONLY_SELECTED_FACES = False
if not obList:
raise('error, no selected mesh objects')
- # Create the variables.
- USER_PROJECTION_LIMIT = projection_limit
- USER_ONLY_SELECTED_FACES = (1)
- USER_SHARE_SPACE = (1) # Only for hole filling.
- USER_STRETCH_ASPECT = (1) # Only for hole filling.
- USER_ISLAND_MARGIN = island_margin # Only for hole filling.
- USER_FILL_HOLES = (0)
- USER_FILL_HOLES_QUALITY = (50) # Only for hole filling.
- USER_VIEW_INIT = (0) # Only for hole filling.
-
# Reuse variable
if len(obList) == 1:
ob = "Unwrap %i Selected Mesh"
@@ -906,8 +893,8 @@ def main(context,
if USER_ONLY_SELECTED_FACES:
meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces) if f.select]
- #else:
- # meshFaces = map(thickface, me.faces)
+ else:
+ meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces)]
if not meshFaces:
continue
@@ -922,7 +909,7 @@ def main(context,
# meshFaces = []
# meshFaces.sort( lambda a, b: cmp(b.area , a.area) ) # Biggest first.
- meshFaces.sort( key = lambda a: -a.area )
+ meshFaces.sort(key=lambda a: -a.area)
# remove all zero area faces
while meshFaces and meshFaces[-1].area <= SMALL_NUM:
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index fe75c54e60e..885d8cf2aed 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -20,8 +20,12 @@
import bpy
from bpy.types import Menu, Operator
-from bpy.props import StringProperty, BoolProperty, IntProperty, \
- FloatProperty, EnumProperty
+from bpy.props import (StringProperty,
+ BoolProperty,
+ IntProperty,
+ FloatProperty,
+ EnumProperty,
+ )
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
@@ -39,23 +43,30 @@ class MESH_OT_delete_edgeloop(Operator):
return {'CANCELLED'}
-rna_path_prop = StringProperty(name="Context Attributes",
- description="rna context string", maxlen=1024, default="")
+rna_path_prop = StringProperty(
+ name="Context Attributes",
+ description="rna context string",
+ maxlen=1024,
+ )
-rna_reverse_prop = BoolProperty(name="Reverse",
- description="Cycle backwards", default=False)
+rna_reverse_prop = BoolProperty(
+ name="Reverse",
+ description="Cycle backwards",
+ default=False,
+ )
-rna_relative_prop = BoolProperty(name="Relative",
+rna_relative_prop = BoolProperty(
+ name="Relative",
description="Apply relative to the current value (delta)",
- default=False)
+ default=False,
+ )
def context_path_validate(context, data_path):
- import sys
try:
value = eval("context.%s" % data_path) if data_path else Ellipsis
- except AttributeError:
- if "'NoneType'" in str(sys.exc_info()[1]):
+ except AttributeError as e:
+ if str(e).startswith("'NoneType'"):
# One of the items in the rna path is None, just ignore this
value = Ellipsis
else:
@@ -65,16 +76,65 @@ def context_path_validate(context, data_path):
return value
+def operator_value_is_undo(value):
+ if value in {None, Ellipsis}:
+ return False
+
+ # typical properties or objects
+ id_data = getattr(value, "id_data", Ellipsis)
+
+ if id_data is None:
+ return False
+ elif id_data is Ellipsis:
+ # handle mathutils types
+ id_data = getattr(getattr(value, "owner", None), "id_data", None)
+
+ if id_data is None:
+ return False
+
+ # return True if its a non window ID type
+ return (isinstance(id_data, bpy.types.ID) and
+ (not isinstance(id_data, (bpy.types.WindowManager,
+ bpy.types.Screen,
+ bpy.types.Scene,
+ bpy.types.Brush,
+ ))))
+
+
+def operator_path_is_undo(context, data_path):
+ # note that if we have data paths that use strings this could fail
+ # luckily we dont do this!
+ #
+ # When we cant find the data owner assume no undo is needed.
+ data_path_head, data_path_sep, data_path_tail = data_path.rpartition(".")
+
+ if not data_path_head:
+ return False
+
+ value = context_path_validate(context, data_path_head)
+
+ return operator_value_is_undo(value)
+
+
+def operator_path_undo_return(context, data_path):
+ return {'FINISHED'} if operator_path_is_undo(context, data_path) else {'CANCELLED'}
+
+
+def operator_value_undo_return(value):
+ return {'FINISHED'} if operator_value_is_undo(value) else {'CANCELLED'}
+
+
def execute_context_assign(self, context):
- if context_path_validate(context, self.data_path) is Ellipsis:
+ data_path = self.data_path
+ if context_path_validate(context, data_path) is Ellipsis:
return {'PASS_THROUGH'}
if getattr(self, "relative", False):
- exec("context.%s+=self.value" % self.data_path)
+ exec("context.%s += self.value" % data_path)
else:
- exec("context.%s=self.value" % self.data_path)
+ exec("context.%s = self.value" % data_path)
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class BRUSH_OT_active_index_set(Operator):
@@ -82,15 +142,21 @@ class BRUSH_OT_active_index_set(Operator):
bl_idname = "brush.active_index_set"
bl_label = "Set Brush Number"
- mode = StringProperty(name="mode",
- description="Paint mode to set brush for", maxlen=1024)
- index = IntProperty(name="number",
- description="Brush number")
+ mode = StringProperty(
+ name="mode",
+ description="Paint mode to set brush for",
+ maxlen=1024,
+ )
+ index = IntProperty(
+ name="number",
+ description="Brush number",
+ )
_attr_dict = {"sculpt": "use_paint_sculpt",
"vertex_paint": "use_paint_vertex",
"weight_paint": "use_paint_weight",
- "image_paint": "use_paint_image"}
+ "image_paint": "use_paint_image",
+ }
def execute(self, context):
attr = self._attr_dict.get(self.mode)
@@ -112,8 +178,11 @@ class WM_OT_context_set_boolean(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = BoolProperty(name="Value",
- description="Assignment value", default=True)
+ value = BoolProperty(
+ name="Value",
+ description="Assignment value",
+ default=True,
+ )
execute = execute_context_assign
@@ -125,7 +194,11 @@ class WM_OT_context_set_int(Operator): # same as enum
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = IntProperty(name="Value", description="Assign value", default=0)
+ value = IntProperty(
+ name="Value",
+ description="Assign value",
+ default=0,
+ )
relative = rna_relative_prop
execute = execute_context_assign
@@ -138,17 +211,23 @@ class WM_OT_context_scale_int(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = FloatProperty(name="Value", description="Assign value", default=1.0)
- always_step = BoolProperty(name="Always Step",
- description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
- default=True)
+ value = FloatProperty(
+ name="Value",
+ description="Assign value",
+ default=1.0,
+ )
+ always_step = BoolProperty(
+ name="Always Step",
+ description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
+ default=True,
+ )
def execute(self, context):
- if context_path_validate(context, self.data_path) is Ellipsis:
+ data_path = self.data_path
+ if context_path_validate(context, data_path) is Ellipsis:
return {'PASS_THROUGH'}
value = self.value
- data_path = self.data_path
if value == 1.0: # nothing to do
return {'CANCELLED'}
@@ -160,11 +239,12 @@ class WM_OT_context_scale_int(Operator):
else:
add = "-1"
func = "min"
- exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (data_path, func, data_path, data_path, add))
+ exec("context.%s = %s(round(context.%s * value), context.%s + %s)" %
+ (data_path, func, data_path, data_path, add))
else:
- exec("context.%s *= value" % self.data_path)
+ exec("context.%s *= value" % data_path)
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_set_float(Operator): # same as enum
@@ -174,8 +254,11 @@ class WM_OT_context_set_float(Operator): # same as enum
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = FloatProperty(name="Value",
- description="Assignment value", default=0.0)
+ value = FloatProperty(
+ name="Value",
+ description="Assignment value",
+ default=0.0,
+ )
relative = rna_relative_prop
execute = execute_context_assign
@@ -188,8 +271,11 @@ class WM_OT_context_set_string(Operator): # same as enum
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = StringProperty(name="Value",
- description="Assign value", maxlen=1024, default="")
+ value = StringProperty(
+ name="Value",
+ description="Assign value",
+ maxlen=1024,
+ )
execute = execute_context_assign
@@ -201,9 +287,11 @@ class WM_OT_context_set_enum(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = StringProperty(name="Value",
+ value = StringProperty(
+ name="Value",
description="Assignment value (as a string)",
- maxlen=1024, default="")
+ maxlen=1024,
+ )
execute = execute_context_assign
@@ -215,15 +303,18 @@ class WM_OT_context_set_value(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = StringProperty(name="Value",
+ value = StringProperty(
+ name="Value",
description="Assignment value (as a string)",
- maxlen=1024, default="")
+ maxlen=1024,
+ )
def execute(self, context):
- if context_path_validate(context, self.data_path) is Ellipsis:
+ data_path = self.data_path
+ if context_path_validate(context, data_path) is Ellipsis:
return {'PASS_THROUGH'}
- exec("context.%s=%s" % (self.data_path, self.value))
- return {'FINISHED'}
+ exec("context.%s = %s" % (data_path, self.value))
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_toggle(Operator):
@@ -235,14 +326,14 @@ class WM_OT_context_toggle(Operator):
data_path = rna_path_prop
def execute(self, context):
+ data_path = self.data_path
- if context_path_validate(context, self.data_path) is Ellipsis:
+ if context_path_validate(context, data_path) is Ellipsis:
return {'PASS_THROUGH'}
- exec("context.%s=not (context.%s)" %
- (self.data_path, self.data_path))
+ exec("context.%s = not (context.%s)" % (data_path, data_path))
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_toggle_enum(Operator):
@@ -252,23 +343,30 @@ class WM_OT_context_toggle_enum(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value_1 = StringProperty(name="Value", \
- description="Toggle enum", maxlen=1024, default="")
-
- value_2 = StringProperty(name="Value", \
- description="Toggle enum", maxlen=1024, default="")
+ value_1 = StringProperty(
+ name="Value",
+ description="Toggle enum",
+ maxlen=1024,
+ )
+ value_2 = StringProperty(
+ name="Value",
+ description="Toggle enum",
+ maxlen=1024,
+ )
def execute(self, context):
+ data_path = self.data_path
- if context_path_validate(context, self.data_path) is Ellipsis:
+ if context_path_validate(context, data_path) is Ellipsis:
return {'PASS_THROUGH'}
- exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
- (self.data_path, self.value_1,\
- self.value_2, self.data_path,
- self.value_2))
+ exec("context.%s = ('%s', '%s')[context.%s != '%s']" %
+ (data_path, self.value_1,
+ self.value_2, data_path,
+ self.value_2,
+ ))
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_cycle_int(Operator):
@@ -292,7 +390,7 @@ class WM_OT_context_cycle_int(Operator):
else:
value += 1
- exec("context.%s=value" % data_path)
+ exec("context.%s = value" % data_path)
if value != eval("context.%s" % data_path):
# relies on rna clamping int's out of the range
@@ -301,9 +399,9 @@ class WM_OT_context_cycle_int(Operator):
else:
value = -1 << 31
- exec("context.%s=value" % data_path)
+ exec("context.%s = value" % data_path)
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_cycle_enum(Operator):
@@ -316,15 +414,15 @@ class WM_OT_context_cycle_enum(Operator):
reverse = rna_reverse_prop
def execute(self, context):
-
- value = context_path_validate(context, self.data_path)
+ data_path = self.data_path
+ value = context_path_validate(context, data_path)
if value is Ellipsis:
return {'PASS_THROUGH'}
orig_value = value
# Have to get rna enum values
- rna_struct_str, rna_prop_str = self.data_path.rsplit('.', 1)
+ rna_struct_str, rna_prop_str = data_path.rsplit('.', 1)
i = rna_prop_str.find('[')
# just incse we get "context.foo.bar[0]"
@@ -354,8 +452,8 @@ class WM_OT_context_cycle_enum(Operator):
advance_enum = enums[orig_index + 1]
# set the new value
- exec("context.%s=advance_enum" % self.data_path)
- return {'FINISHED'}
+ exec("context.%s = advance_enum" % data_path)
+ return operator_path_undo_return(context, data_path)
class WM_OT_context_cycle_array(Operator):
@@ -381,9 +479,9 @@ class WM_OT_context_cycle_array(Operator):
array.append(array.pop(0))
return array
- exec("context.%s=cycle(context.%s[:])" % (data_path, data_path))
+ exec("context.%s = cycle(context.%s[:])" % (data_path, data_path))
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
class WM_MT_context_menu_enum(Menu):
@@ -426,8 +524,11 @@ class WM_OT_context_set_id(Operator):
bl_options = {'UNDO', 'INTERNAL'}
data_path = rna_path_prop
- value = StringProperty(name="Value",
- description="Assign value", maxlen=1024, default="")
+ value = StringProperty(
+ name="Value",
+ description="Assign value",
+ maxlen=1024,
+ )
def execute(self, context):
value = self.value
@@ -449,16 +550,23 @@ class WM_OT_context_set_id(Operator):
if id_iter:
value_id = getattr(bpy.data, id_iter).get(value)
- exec("context.%s=value_id" % data_path)
+ exec("context.%s = value_id" % data_path)
- return {'FINISHED'}
+ return operator_path_undo_return(context, data_path)
-doc_id = StringProperty(name="Doc ID",
- description="", maxlen=1024, default="", options={'HIDDEN'})
+doc_id = StringProperty(
+ name="Doc ID",
+ description="",
+ maxlen=1024,
+ options={'HIDDEN'},
+ )
-doc_new = StringProperty(name="Edit Description",
- description="", maxlen=1024, default="")
+doc_new = StringProperty(
+ name="Edit Description",
+ description="",
+ maxlen=1024,
+ )
data_path_iter = StringProperty(
description="The data path relative to the context, must point to an iterable.")
@@ -476,12 +584,13 @@ class WM_OT_context_collection_boolean_set(Operator):
data_path_iter = data_path_iter
data_path_item = data_path_item
- type = EnumProperty(items=(
- ('TOGGLE', "Toggle", ""),
- ('ENABLE', "Enable", ""),
- ('DISABLE', "Disable", ""),
- ),
- name="Type")
+ type = EnumProperty(
+ name="Type",
+ items=(('TOGGLE', "Toggle", ""),
+ ('ENABLE', "Enable", ""),
+ ('DISABLE', "Disable", ""),
+ ),
+ )
def execute(self, context):
data_path_iter = self.data_path_iter
@@ -507,6 +616,10 @@ class WM_OT_context_collection_boolean_set(Operator):
items_ok.append(item)
+ # avoid undo push when nothing to do
+ if not items_ok:
+ return {'CANCELLED'}
+
if self.type == 'ENABLE':
is_set = True
elif self.type == 'DISABLE':
@@ -518,20 +631,26 @@ class WM_OT_context_collection_boolean_set(Operator):
for item in items_ok:
exec(exec_str)
- return {'FINISHED'}
+ return operator_value_undo_return(item)
class WM_OT_context_modal_mouse(Operator):
'''Adjust arbitrary values with mouse input'''
bl_idname = "wm.context_modal_mouse"
bl_label = "Context Modal Mouse"
- bl_options = {'GRAB_POINTER', 'BLOCKING', 'INTERNAL'}
+ bl_options = {'GRAB_POINTER', 'BLOCKING', 'UNDO', 'INTERNAL'}
data_path_iter = data_path_iter
data_path_item = data_path_item
- input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta")
- invert = BoolProperty(default=False, description="Invert the mouse input")
+ input_scale = FloatProperty(
+ description="Scale the mouse movement by this value before applying the delta",
+ default=0.01,
+ )
+ invert = BoolProperty(
+ description="Invert the mouse input",
+ default=False,
+ )
initial_x = IntProperty(options={'HIDDEN'})
def _values_store(self, context):
@@ -584,12 +703,13 @@ class WM_OT_context_modal_mouse(Operator):
self._values_delta(delta)
elif 'LEFTMOUSE' == event_type:
+ item = next(iter(self._values.keys()))
self._values_clear()
- return {'FINISHED'}
+ return operator_value_undo_return(item)
elif event_type in {'RIGHTMOUSE', 'ESC'}:
self._values_restore()
- return {'FINISHED'}
+ return {'CANCELLED'}
return {'RUNNING_MODAL'}
@@ -613,7 +733,10 @@ class WM_OT_url_open(Operator):
bl_idname = "wm.url_open"
bl_label = ""
- url = StringProperty(name="URL", description="URL to open")
+ url = StringProperty(
+ name="URL",
+ description="URL to open",
+ )
def execute(self, context):
import webbrowser
@@ -627,7 +750,11 @@ class WM_OT_path_open(Operator):
bl_idname = "wm.path_open"
bl_label = ""
- filepath = StringProperty(name="File Path", maxlen=1024, subtype='FILE_PATH')
+ filepath = StringProperty(
+ name="File Path",
+ maxlen=1024,
+ subtype='FILE_PATH',
+ )
def execute(self, context):
import sys
@@ -662,9 +789,11 @@ class WM_OT_doc_view(Operator):
doc_id = doc_id
if bpy.app.version_cycle == "release":
- _prefix = "http://www.blender.org/documentation/blender_python_api_%s%s_release" % ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char)
+ _prefix = ("http://www.blender.org/documentation/blender_python_api_%s%s_release" %
+ ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char))
else:
- _prefix = "http://www.blender.org/documentation/blender_python_api_%s" % "_".join(str(v) for v in bpy.app.version)
+ _prefix = ("http://www.blender.org/documentation/blender_python_api_%s" %
+ "_".join(str(v) for v in bpy.app.version))
def _nested_class_string(self, class_string):
ls = []
@@ -682,8 +811,8 @@ class WM_OT_doc_view(Operator):
class_name, class_prop = id_split
if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop):
- url = '%s/bpy.ops.%s.html#bpy.ops.%s.%s' % \
- (self._prefix, class_name, class_name, class_prop)
+ url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
+ (self._prefix, class_name, class_name, class_prop))
else:
# detect if this is a inherited member and use that name instead
@@ -696,8 +825,8 @@ class WM_OT_doc_view(Operator):
# It so happens that epydoc nests these, not sphinx
# class_name_full = self._nested_class_string(class_name)
- url = '%s/bpy.types.%s.html#bpy.types.%s.%s' % \
- (self._prefix, class_name, class_name, class_prop)
+ url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" %
+ (self._prefix, class_name, class_name, class_prop))
else:
return {'PASS_THROUGH'}
@@ -780,17 +909,36 @@ class WM_OT_doc_edit(Operator):
return wm.invoke_props_dialog(self, width=600)
-rna_path = StringProperty(name="Property Edit",
- description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
+rna_path = StringProperty(
+ name="Property Edit",
+ description="Property data_path edit",
+ maxlen=1024,
+ options={'HIDDEN'},
+ )
+
+rna_value = StringProperty(
+ name="Property Value",
+ description="Property value edit",
+ maxlen=1024,
+ )
-rna_value = StringProperty(name="Property Value",
- description="Property value edit", maxlen=1024, default="")
+rna_property = StringProperty(
+ name="Property Name",
+ description="Property name edit",
+ maxlen=1024,
+ )
-rna_property = StringProperty(name="Property Name",
- description="Property name edit", maxlen=1024, default="")
+rna_min = FloatProperty(
+ name="Min",
+ default=0.0,
+ precision=3,
+ )
-rna_min = FloatProperty(name="Min", default=0.0, precision=3)
-rna_max = FloatProperty(name="Max", default=1.0, precision=3)
+rna_max = FloatProperty(
+ name="Max",
+ default=1.0,
+ precision=3,
+ )
class WM_OT_properties_edit(Operator):
@@ -804,7 +952,9 @@ class WM_OT_properties_edit(Operator):
value = rna_value
min = rna_min
max = rna_max
- description = StringProperty(name="Tip", default="")
+ description = StringProperty(
+ name="Tip",
+ )
def execute(self, context):
data_path = self.data_path
@@ -857,14 +1007,15 @@ class WM_OT_properties_edit(Operator):
return {'FINISHED'}
def invoke(self, context, event):
+ data_path = self.data_path
- if not self.data_path:
+ if not data_path:
self.report({'ERROR'}, "Data path not set")
return {'CANCELLED'}
self._last_prop = [self.property]
- item = eval("context.%s" % self.data_path)
+ item = eval("context.%s" % data_path)
# setup defaults
prop_ui = rna_idprop_ui_prop_get(item, self.property, False) # dont create
@@ -885,7 +1036,8 @@ class WM_OT_properties_add(Operator):
data_path = rna_path
def execute(self, context):
- item = eval("context.%s" % self.data_path)
+ data_path = self.data_path
+ item = eval("context.%s" % data_path)
def unique_name(names):
prop = 'prop'
@@ -908,10 +1060,13 @@ class WM_OT_properties_context_change(Operator):
bl_idname = "wm.properties_context_change"
bl_label = ""
- context = StringProperty(name="Context", maxlen=32)
+ context = StringProperty(
+ name="Context",
+ maxlen=32,
+ )
def execute(self, context):
- context.space_data.context = (self.context)
+ context.space_data.context = self.context
return {'FINISHED'}
@@ -924,7 +1079,8 @@ class WM_OT_properties_remove(Operator):
property = rna_property
def execute(self, context):
- item = eval("context.%s" % self.data_path)
+ data_path = self.data_path
+ item = eval("context.%s" % data_path)
del item[self.property]
return {'FINISHED'}
@@ -933,7 +1089,10 @@ class WM_OT_keyconfig_activate(Operator):
bl_idname = "wm.keyconfig_activate"
bl_label = "Activate Keyconfig"
- filepath = StringProperty(name="File Path", maxlen=1024)
+ filepath = StringProperty(
+ name="File Path",
+ maxlen=1024,
+ )
def execute(self, context):
bpy.utils.keyconfig_set(self.filepath)
@@ -961,7 +1120,10 @@ class WM_OT_appconfig_activate(Operator):
bl_idname = "wm.appconfig_activate"
bl_label = "Activate Application Configuration"
- filepath = StringProperty(name="File Path", maxlen=1024)
+ filepath = StringProperty(
+ name="File Path",
+ maxlen=1024,
+ )
def execute(self, context):
import os
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 7bc136c8ce0..6448b9a5229 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -109,7 +109,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
if (is_curve or is_text):
col.label(text="Fill:")
sub = col.column()
- sub.active = (curve.bevel_object is None)
+ sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
sub.prop(curve, "use_fill_front")
sub.prop(curve, "use_fill_back")
col.prop(curve, "use_fill_deform", text="Fill Deformed")
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 7503959480b..d824ec3d589 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -73,7 +73,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel):
ob = context.object
mesh = context.mesh
space = context.space_data
-
+ layout.prop(context.scene.tool_settings, "mesh_select_mode", index=0, text="Vertex")
if ob:
layout.template_ID(ob, "data")
elif mesh:
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index e4bbd7d7d7d..179921c3c85 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -577,13 +577,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
sub = col.column()
sub.active = bool(md.vertex_group)
sub.prop(md, "invert_vertex_group", text="Invert")
+ sub.prop(md, "thickness_vertex_group", text="Factor")
col.prop(md, "use_even_offset")
col.prop(md, "use_quality_normals")
col.prop(md, "use_rim")
sub = col.column()
- sub.label()
row = sub.split(align=True, percentage=0.4)
row.prop(md, "material_offset", text="")
row = row.row()
diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py
index 5064f0744af..d457a66def8 100644
--- a/release/scripts/startup/bl_ui/space_console.py
+++ b/release/scripts/startup/bl_ui/space_console.py
@@ -26,17 +26,14 @@ class CONSOLE_HT_header(Header):
bl_space_type = 'CONSOLE'
def draw(self, context):
- layout = self.layout
+ layout = self.layout.row(align=True)
- row = layout.row(align=True)
- row.template_header()
+ layout.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("CONSOLE_MT_console")
+ layout.menu("CONSOLE_MT_console")
- row = layout.row(align=True)
- row.operator("console.autocomplete", text="Autocomplete")
+ layout.operator("console.autocomplete", text="Autocomplete")
class CONSOLE_MT_console(Menu):
@@ -44,7 +41,7 @@ class CONSOLE_MT_console(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
+
layout.operator("console.clear")
layout.operator("console.copy")
layout.operator("console.paste")
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 73624b490bf..dfbd7b3ae14 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -97,21 +97,19 @@ class DOPESHEET_HT_header(Header):
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
-
- sub.menu("DOPESHEET_MT_view")
- sub.menu("DOPESHEET_MT_select")
- sub.menu("DOPESHEET_MT_marker")
+ row.menu("DOPESHEET_MT_view")
+ row.menu("DOPESHEET_MT_select")
+ row.menu("DOPESHEET_MT_marker")
if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
- sub.menu("DOPESHEET_MT_channel")
+ row.menu("DOPESHEET_MT_channel")
elif st.mode == 'GPENCIL':
- sub.menu("DOPESHEET_MT_gpencil_channel")
+ row.menu("DOPESHEET_MT_gpencil_channel")
if st.mode != 'GPENCIL':
- sub.menu("DOPESHEET_MT_key")
+ row.menu("DOPESHEET_MT_key")
else:
- sub.menu("DOPESHEET_MT_gpencil_frame")
+ row.menu("DOPESHEET_MT_gpencil_frame")
layout.prop(st, "mode", text="")
layout.prop(st.dopesheet, "show_summary", text="Summary")
@@ -143,8 +141,6 @@ class DOPESHEET_MT_view(Menu):
st = context.space_data
- layout.column()
-
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_frame_indicator")
layout.prop(st, "show_sliders")
@@ -177,7 +173,6 @@ class DOPESHEET_MT_select(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("action.select_all_toggle")
layout.operator("action.select_all_toggle", text="Invert Selection").invert = True
@@ -217,7 +212,6 @@ class DOPESHEET_MT_marker(Menu):
#layout.operator_context = 'EXEC_REGION_WIN'
- layout.column()
layout.operator("marker.add", "Add Marker")
layout.operator("marker.duplicate", text="Duplicate Marker")
layout.operator("marker.delete", text="Delete Marker")
@@ -246,7 +240,6 @@ class DOPESHEET_MT_channel(Menu):
layout.operator_context = 'INVOKE_REGION_CHANNELS'
- layout.column()
layout.operator("anim.channels_delete")
layout.separator()
@@ -275,7 +268,6 @@ class DOPESHEET_MT_key(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.menu("DOPESHEET_MT_key_transform", text="Transform")
layout.operator_menu_enum("action.snap", "type", text="Snap")
@@ -308,7 +300,6 @@ class DOPESHEET_MT_key_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.operator("transform.transform", text="Grab/Move").mode = 'TIME_TRANSLATE'
layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE'
@@ -326,7 +317,6 @@ class DOPESHEET_MT_gpencil_channel(Menu):
layout.operator_context = 'INVOKE_REGION_CHANNELS'
- layout.column()
layout.operator("anim.channels_delete")
layout.separator()
@@ -352,7 +342,6 @@ class DOPESHEET_MT_gpencil_frame(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.menu("DOPESHEET_MT_key_transform", text="Transform")
#layout.operator_menu_enum("action.snap", "type", text="Snap")
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py
index f6ba6ed7942..c379ea95ea2 100644
--- a/release/scripts/startup/bl_ui/space_graph.py
+++ b/release/scripts/startup/bl_ui/space_graph.py
@@ -36,13 +36,11 @@ class GRAPH_HT_header(Header):
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
-
- sub.menu("GRAPH_MT_view")
- sub.menu("GRAPH_MT_select")
- sub.menu("GRAPH_MT_marker")
- sub.menu("GRAPH_MT_channel")
- sub.menu("GRAPH_MT_key")
+ row.menu("GRAPH_MT_view")
+ row.menu("GRAPH_MT_select")
+ row.menu("GRAPH_MT_marker")
+ row.menu("GRAPH_MT_channel")
+ row.menu("GRAPH_MT_key")
layout.prop(st, "mode", text="")
@@ -70,8 +68,6 @@ class GRAPH_MT_view(Menu):
st = context.space_data
- layout.column()
-
layout.operator("graph.properties", icon='MENU_PANEL')
layout.separator()
@@ -114,7 +110,6 @@ class GRAPH_MT_select(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("graph.select_all_toggle")
layout.operator("graph.select_all_toggle", text="Invert Selection").invert = True
@@ -151,7 +146,6 @@ class GRAPH_MT_marker(Menu):
#layout.operator_context = 'EXEC_REGION_WIN'
- layout.column()
layout.operator("marker.add", "Add Marker")
layout.operator("marker.duplicate", text="Duplicate Marker")
layout.operator("marker.delete", text="Delete Marker")
@@ -172,7 +166,6 @@ class GRAPH_MT_channel(Menu):
layout.operator_context = 'INVOKE_REGION_CHANNELS'
- layout.column()
layout.operator("anim.channels_delete")
layout.separator()
@@ -202,7 +195,6 @@ class GRAPH_MT_key(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.menu("GRAPH_MT_key_transform", text="Transform")
layout.operator_menu_enum("graph.snap", "type", text="Snap")
@@ -241,7 +233,6 @@ class GRAPH_MT_key_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.operator("transform.translate", text="Grab/Move")
layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
layout.operator("transform.rotate", text="Rotate")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 0278863ca27..2042fa1729d 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -387,7 +387,7 @@ class IMAGE_HT_header(Header):
row = layout.row(align=True)
row.prop(toolsettings, "use_snap", text="")
- row.prop(toolsettings, "snap_element", text="", icon_only=True)
+ row.prop(toolsettings, "snap_target", text="")
mesh = context.edit_object.data
layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="")
@@ -452,15 +452,13 @@ class IMAGE_PT_game_properties(Panel):
split = layout.split()
col = split.column()
-
+
+ col.prop(ima, "use_animation")
sub = col.column(align=True)
- sub.prop(ima, "use_animation")
-
- subsub = sub.column()
- subsub.active = ima.use_animation
- subsub.prop(ima, "frame_start", text="Start")
- subsub.prop(ima, "frame_end", text="End")
- subsub.prop(ima, "fps", text="Speed")
+ sub.active = ima.use_animation
+ sub.prop(ima, "frame_start", text="Start")
+ sub.prop(ima, "frame_end", text="End")
+ sub.prop(ima, "fps", text="Speed")
col.prop(ima, "use_tiles")
sub = col.column(align=True)
@@ -509,10 +507,11 @@ class IMAGE_PT_view_waveform(Panel):
layout = self.layout
sima = context.space_data
+
layout.template_waveform(sima, "scopes")
- sub = layout.row().split(percentage=0.75)
- sub.prop(sima.scopes, "waveform_alpha")
- sub.prop(sima.scopes, "waveform_mode", text="", icon_only=True)
+ row = layout.split(percentage=0.75)
+ row.prop(sima.scopes, "waveform_alpha")
+ row.prop(sima.scopes, "waveform_mode", text="", icon_only=True)
class IMAGE_PT_view_vectorscope(Panel):
@@ -545,8 +544,10 @@ class IMAGE_PT_sample_line(Panel):
def draw(self, context):
layout = self.layout
- layout.operator("image.sample_line")
+
sima = context.space_data
+
+ layout.operator("image.sample_line")
layout.template_histogram(sima, "sample_histogram")
layout.prop(sima.sample_histogram, "mode")
@@ -563,13 +564,14 @@ class IMAGE_PT_scope_sample(Panel):
def draw(self, context):
layout = self.layout
+
sima = context.space_data
- split = layout.split()
- row = split.row()
+
+ row = layout.row()
row.prop(sima.scopes, "use_full_resolution")
- row = split.row()
- row.active = not sima.scopes.use_full_resolution
- row.prop(sima.scopes, "accuracy")
+ sub = row.row()
+ sub.active = not sima.scopes.use_full_resolution
+ sub.prop(sima.scopes, "accuracy")
class IMAGE_PT_view_properties(Panel):
@@ -609,16 +611,16 @@ class IMAGE_PT_view_properties(Panel):
if show_uvedit:
col = layout.column()
- col.label("Cursor Location")
- row = col.row()
- row.prop(uvedit, "cursor_location", text="")
-
- col = layout.column()
+ col.label("Cursor Location:")
+ col.row().prop(uvedit, "cursor_location", text="")
+
+ col.separator()
+
col.label(text="UVs:")
- row = col.row()
- row.prop(uvedit, "edge_draw_type", expand=True)
+ col.row().prop(uvedit, "edge_draw_type", expand=True)
split = layout.split()
+
col = split.column()
col.prop(uvedit, "show_faces")
col.prop(uvedit, "show_smooth_edges", text="Smooth")
@@ -647,9 +649,8 @@ class IMAGE_PT_paint(Panel):
toolsettings = context.tool_settings.image_paint
brush = toolsettings.brush
- col = layout.split().column()
- row = col.row()
- col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=3, cols=8)
+ col = layout.column()
+ col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=2, cols=6)
if brush:
col = layout.column()
@@ -700,9 +701,7 @@ class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
settings = context.tool_settings.image_paint
brush = settings.brush
- col = layout.column(align=True)
-
- col.prop(brush, "image_tool", expand=False, text="")
+ layout.prop(brush, "image_tool", text="")
row = layout.row(align=True)
row.prop(brush, "use_paint_sculpt", text="", icon='SCULPTMODE_HLT')
@@ -722,9 +721,9 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
brush = toolsettings.brush
layout.prop(brush, "use_airbrush")
- col = layout.column()
- col.active = brush.use_airbrush
- col.prop(brush, "rate", slider=True)
+ row = layout.row()
+ row.active = brush.use_airbrush
+ row.prop(brush, "rate", slider=True)
layout.prop(brush, "use_space")
row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 12873743a23..38c1e24f27e 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -92,7 +92,7 @@ class INFO_MT_report(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
+
layout.operator("console.select_all_toggle")
layout.operator("console.select_border")
layout.operator("console.report_delete")
@@ -194,6 +194,7 @@ class INFO_MT_mesh_add(Menu):
def draw(self, context):
layout = self.layout
+
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
@@ -214,6 +215,7 @@ class INFO_MT_curve_add(Menu):
def draw(self, context):
layout = self.layout
+
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
@@ -244,6 +246,7 @@ class INFO_MT_surface_add(Menu):
def draw(self, context):
layout = self.layout
+
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
@@ -259,6 +262,7 @@ class INFO_MT_armature_add(Menu):
def draw(self, context):
layout = self.layout
+
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py
index 1b774539d0f..869a91124d3 100644
--- a/release/scripts/startup/bl_ui/space_logic.py
+++ b/release/scripts/startup/bl_ui/space_logic.py
@@ -65,16 +65,12 @@ class LOGIC_HT_header(Header):
bl_space_type = 'LOGIC_EDITOR'
def draw(self, context):
- layout = self.layout
+ layout = self.layout.row(align=True)
- row = layout.row(align=True)
- row.template_header()
+ layout.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("LOGIC_MT_view")
- #sub.menu("LOGIC_MT_select")
- #sub.menu("LOGIC_MT_add")
+ layout.menu("LOGIC_MT_view")
class LOGIC_MT_view(Menu):
@@ -83,8 +79,6 @@ class LOGIC_MT_view(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
-
layout.operator("logic.properties", icon='MENU_PANEL')
if __name__ == "__main__": # only for live edit.
diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py
index 55f2dabba74..c69af2c9a60 100644
--- a/release/scripts/startup/bl_ui/space_nla.py
+++ b/release/scripts/startup/bl_ui/space_nla.py
@@ -36,13 +36,11 @@ class NLA_HT_header(Header):
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
-
- sub.menu("NLA_MT_view")
- sub.menu("NLA_MT_select")
- sub.menu("NLA_MT_marker")
- sub.menu("NLA_MT_edit")
- sub.menu("NLA_MT_add")
+ row.menu("NLA_MT_view")
+ row.menu("NLA_MT_select")
+ row.menu("NLA_MT_marker")
+ row.menu("NLA_MT_edit")
+ row.menu("NLA_MT_add")
dopesheet_filter(layout, context)
@@ -57,8 +55,6 @@ class NLA_MT_view(Menu):
st = context.space_data
- layout.column()
-
layout.operator("nla.properties", icon='MENU_PANEL')
layout.separator()
@@ -85,7 +81,6 @@ class NLA_MT_select(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("nla.select_all_toggle")
layout.operator("nla.select_all_toggle", text="Invert Selection").invert = True
@@ -107,7 +102,6 @@ class NLA_MT_marker(Menu):
#layout.operator_context = 'EXEC_REGION_WIN'
- layout.column()
layout.operator("marker.add", "Add Marker")
layout.operator("marker.duplicate", text="Duplicate Marker")
layout.operator("marker.delete", text="Delete Marker")
@@ -126,7 +120,6 @@ class NLA_MT_edit(Menu):
scene = context.scene
- layout.column()
layout.menu("NLA_MT_edit_transform", text="Transform")
layout.operator_menu_enum("nla.snap", "type", text="Snap")
@@ -167,7 +160,6 @@ class NLA_MT_add(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.operator("nla.actionclip_add")
layout.operator("nla.transition_add")
@@ -186,7 +178,6 @@ class NLA_MT_edit_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.operator("transform.translate", text="Grab/Move")
layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index b0a54004765..708017ba749 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -28,33 +28,29 @@ class NODE_HT_header(Header):
layout = self.layout
snode = context.space_data
+ snode_id = snode.id
+ id_from = snode.id_from
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("NODE_MT_view")
- sub.menu("NODE_MT_select")
- sub.menu("NODE_MT_add")
- sub.menu("NODE_MT_node")
+ row.menu("NODE_MT_view")
+ row.menu("NODE_MT_select")
+ row.menu("NODE_MT_add")
+ row.menu("NODE_MT_node")
- row = layout.row()
- row.prop(snode, "tree_type", text="", expand=True)
+ layout.prop(snode, "tree_type", text="", expand=True)
if snode.tree_type == 'MATERIAL':
- ob = snode.id_from
- snode_id = snode.id
- if ob:
- layout.template_ID(ob, "active_material", new="material.new")
+ if id_from:
+ layout.template_ID(id_from, "active_material", new="material.new")
if snode_id:
layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'TEXTURE':
- row.prop(snode, "texture_type", text="", expand=True)
+ layout.prop(snode, "texture_type", text="", expand=True)
- snode_id = snode.id
- id_from = snode.id_from
if id_from:
if snode.texture_type == 'BRUSH':
layout.template_ID(id_from, "texture", new="texture.new")
@@ -64,10 +60,8 @@ class NODE_HT_header(Header):
layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'COMPOSITING':
- scene = snode.id
-
- layout.prop(scene, "use_nodes")
- layout.prop(scene.render, "use_free_unused_nodes", text="Free Unused")
+ layout.prop(snode_id, "use_nodes")
+ layout.prop(snode_id.render, "use_free_unused_nodes", text="Free Unused")
layout.prop(snode, "show_backdrop")
if snode.show_backdrop:
row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 004a913a463..b1e6eaf3245 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -72,14 +72,13 @@ class OUTLINER_MT_view(Menu):
space = context.space_data
- col = layout.column()
if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'}:
- col.prop(space, "show_restrict_columns")
- col.separator()
- col.operator("outliner.show_active")
+ layout.prop(space, "show_restrict_columns")
+ layout.separator()
+ layout.operator("outliner.show_active")
- col.operator("outliner.show_one_level")
- col.operator("outliner.show_hierarchy")
+ layout.operator("outliner.show_one_level")
+ layout.operator("outliner.show_hierarchy")
layout.separator()
@@ -95,10 +94,8 @@ class OUTLINER_MT_search(Menu):
space = context.space_data
- col = layout.column()
-
- col.prop(space, "use_filter_case_sensitive")
- col.prop(space, "use_filter_complete")
+ layout.prop(space, "use_filter_case_sensitive")
+ layout.prop(space, "use_filter_complete")
class OUTLINER_MT_edit_datablocks(Menu):
@@ -107,15 +104,13 @@ class OUTLINER_MT_edit_datablocks(Menu):
def draw(self, context):
layout = self.layout
- col = layout.column()
-
- col.operator("outliner.keyingset_add_selected")
- col.operator("outliner.keyingset_remove_selected")
+ layout.operator("outliner.keyingset_add_selected")
+ layout.operator("outliner.keyingset_remove_selected")
- col.separator()
+ layout.separator()
- col.operator("outliner.drivers_add_selected")
- col.operator("outliner.drivers_delete_selected")
+ layout.operator("outliner.drivers_add_selected")
+ layout.operator("outliner.drivers_delete_selected")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index f58bd7c9150..84cc365425e 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -40,14 +40,13 @@ class SEQUENCER_HT_header(Header):
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("SEQUENCER_MT_view")
+ row.menu("SEQUENCER_MT_view")
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
- sub.menu("SEQUENCER_MT_select")
- sub.menu("SEQUENCER_MT_marker")
- sub.menu("SEQUENCER_MT_add")
- sub.menu("SEQUENCER_MT_strip")
+ row.menu("SEQUENCER_MT_select")
+ row.menu("SEQUENCER_MT_marker")
+ row.menu("SEQUENCER_MT_add")
+ row.menu("SEQUENCER_MT_strip")
layout.prop(st, "view_type", expand=True, text="")
@@ -96,8 +95,6 @@ class SEQUENCER_MT_view(Menu):
st = context.space_data
- layout.column()
-
layout.operator("sequencer.properties", icon='MENU_PANEL')
layout.separator()
@@ -136,7 +133,6 @@ class SEQUENCER_MT_select(Menu):
def draw(self, context):
layout = self.layout
- layout.column()
layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
layout.separator()
@@ -157,7 +153,6 @@ class SEQUENCER_MT_marker(Menu):
#layout.operator_context = 'EXEC_REGION_WIN'
- layout.column()
layout.operator("marker.add", "Add Marker")
layout.operator("marker.duplicate", text="Duplicate Marker")
layout.operator("marker.delete", text="Delete Marker")
@@ -190,7 +185,6 @@ class SEQUENCER_MT_add(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.column()
if len(bpy.data.scenes) > 10:
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("sequencer.scene_strip_add", text="Scene...")
@@ -211,7 +205,6 @@ class SEQUENCER_MT_add_effect(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.column()
layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
@@ -238,7 +231,6 @@ class SEQUENCER_MT_strip(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.column()
layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
# uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
@@ -247,6 +239,7 @@ class SEQUENCER_MT_strip(Menu):
layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
layout.operator("sequencer.images_separate")
+ layout.operator("sequencer.offset_clear")
layout.operator("sequencer.deinterlace_selected_movies")
layout.separator()
@@ -389,6 +382,8 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
if elem and elem.orig_width > 0 and elem.orig_height > 0:
col.label(text="Orig Dim: %dx%d" % (elem.orig_width, elem.orig_height))
+ else:
+ col.label(text="Orig Dim: None")
class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
@@ -573,6 +568,9 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
col = split.column()
col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
+ # also accessible from the menu
+ layout.operator("sequencer.change_path")
+
elif seq_type == 'MOVIE':
split = layout.split(percentage=0.2)
col = split.column()
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index f3b8b9ce221..300211a26bf 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -172,7 +172,6 @@ class TEXT_MT_text(Menu):
st = context.space_data
text = st.text
- layout.column()
layout.operator("text.new")
layout.operator("text.open")
@@ -189,11 +188,6 @@ class TEXT_MT_text(Menu):
layout.column()
layout.operator("text.run_script")
- #ifdef WITH_PYTHON
- # XXX if(BPY_is_pyconstraint(text))
- # XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
- #endif
-
class TEXT_MT_templates(Menu):
bl_label = "Templates"
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index 0b5aec7d5f2..db009fe43c2 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -35,10 +35,9 @@ class TIME_HT_header(Header):
row.template_header()
if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("TIME_MT_view")
- sub.menu("TIME_MT_frame")
- sub.menu("TIME_MT_playback")
+ row.menu("TIME_MT_view")
+ row.menu("TIME_MT_frame")
+ row.menu("TIME_MT_playback")
layout.prop(scene, "use_preview_range", text="", toggle=True)
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index d595b32c710..6a81ff5830e 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -18,7 +18,7 @@
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Operator
+from bpy.types import Menu, Operator, OperatorProperties
import os