fix own bug [#29875] Due to operators now reusing there last-used settings, some UI options are more or less broken (esp. in shortcuts and menu entries)

also prefer *.select_all rather then *.select_inverse operators, since this is an option for select_all.
This commit is contained in:
Campbell Barton
2012-01-14 06:30:27 +00:00
parent 75f8d5fc66
commit 93cf1531d0
12 changed files with 60 additions and 64 deletions

View File

@@ -1178,7 +1178,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"

View File

@@ -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()

View File

@@ -551,7 +551,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
layout.separator()
# Audio:
if ffmpeg.format not in {'MP3'}:
if ffmpeg.format != 'MP3':
layout.prop(ffmpeg, "audio_codec", text="Audio Codec")
row = layout.row()

View File

@@ -166,25 +166,19 @@ class CLIP_PT_tools_tracking(Panel):
row = layout.row(align=True)
props = row.operator("clip.track_markers", text="", icon='FRAME_PREV')
props.backwards = True
row.operator("clip.track_markers", text="", icon='FRAME_PREV').backwards = True
props = row.operator("clip.track_markers", text="",
icon='PLAY_REVERSE')
icon='PLAY_REVERSE')
props.backwards = True
props.sequence = True
props = row.operator("clip.track_markers", text="", icon='PLAY')
props.sequence = True
row.operator("clip.track_markers", text="", icon='PLAY').sequence = True
row.operator("clip.track_markers", text="", icon='FRAME_NEXT')
col = layout.column(align=True)
props = col.operator("clip.clear_track_path", text="Clear After")
props.action = 'REMAINED'
col.operator("clip.clear_track_path", text="Clear After").action = 'REMAINED'
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 Before").action = 'UPTO'
col.operator("clip.clear_track_path", text="Clear").action = 'ALL'
layout.operator("clip.join_tracks", text="Join")
@@ -484,8 +478,7 @@ class CLIP_PT_tracking_camera(Panel):
label = bpy.types.CLIP_MT_camera_presets.bl_label
row.menu('CLIP_MT_camera_presets', text=label)
row.operator("clip.camera_preset_add", text="", icon='ZOOMIN')
props = row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT')
props.remove_active = True
row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT').remove_active = True
row = layout.row(align=True)
sub = row.split(percentage=0.65)
@@ -938,7 +931,7 @@ class CLIP_MT_select(Menu):
layout.separator()
layout.operator("clip.select_all", text="Select/Deselect all")
layout.operator("clip.select_all", text="Select/Deselect all").action = 'TOGGLE'
layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
layout.menu("CLIP_MT_select_grouped")
@@ -963,11 +956,8 @@ class CLIP_MT_tracking_specials(Menu):
def draw(self, context):
layout = self.layout
props = layout.operator("clip.disable_markers", text="Enable Markers")
props.action = 'ENABLE'
props = layout.operator("clip.disable_markers", text="Disable markers")
props.action = 'DISABLE'
layout.operator("clip.disable_markers", text="Enable Markers").action = 'ENABLE'
layout.operator("clip.disable_markers", text="Disable markers").action = 'DISABLE'
layout.separator()
layout.operator("clip.set_origin")

View File

@@ -179,11 +179,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()

View File

@@ -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()

View File

@@ -85,7 +85,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()
@@ -184,7 +184,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

View File

@@ -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

View File

@@ -285,7 +285,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 +625,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 +633,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")

View File

@@ -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')

View File

@@ -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,7 +483,7 @@ 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")
@@ -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()
@@ -761,7 +761,7 @@ class VIEW3D_MT_object_clear(Menu):
layout.operator("object.location_clear", text="Location")
layout.operator("object.rotation_clear", text="Rotation")
layout.operator("object.scale_clear", text="Scale")
layout.operator("object.origin_clear", text="Origin")
layout ("object.origin_clear", text="Origin")
class VIEW3D_MT_object_specials(Menu):
@@ -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 **********
@@ -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()
@@ -1498,7 +1502,7 @@ 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")
@@ -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()

View File

@@ -155,7 +155,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)