diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2012-08-06 13:59:24 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2012-08-06 13:59:24 +0400 |
commit | b8905ba0a6731d2aba6f3487be58b338f35df5f7 (patch) | |
tree | e3dc4fc0ac799aec6d7f28dcfb16d87c53ec5506 /release/scripts/startup | |
parent | 79f638791d5a0ab6c07cd21c82decdc24329d825 (diff) | |
parent | 3b743582ec282cfffc84c5e235f58fe2745327c9 (diff) |
Merge from trunk r49109-r49601
Diffstat (limited to 'release/scripts/startup')
25 files changed, 554 insertions, 359 deletions
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index a30502b454e..c45d2f2e702 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -90,14 +90,17 @@ def CLIP_track_view_selected(sc, track): return False -def CLIP_default_settings_from_track(clip, track): +def CLIP_default_settings_from_track(clip, track, framenr): settings = clip.tracking.settings width = clip.size[0] height = clip.size[1] - pattern = track.pattern_max - track.pattern_min - search = track.search_max - track.search_min + marker = track.markers.find_frame(framenr, False) + pattern_bb = marker.pattern_bound_box + + pattern = Vector(pattern_bb[1]) - Vector(pattern_bb[0]) + search = marker.search_max - marker.search_min pattern[0] = pattern[0] * width pattern[1] = pattern[1] * height @@ -111,6 +114,10 @@ def CLIP_default_settings_from_track(clip, track): settings.default_frames_limit = track.frames_limit settings.default_pattern_match = track.pattern_match settings.default_margin = track.margin + settings.default_motion_model = track.motion_model + settings.use_default_brute = track.use_brute + settings.use_default_normalization = track.use_normalization + settings.use_default_mask = track.use_mask settings.use_default_red_channel = track.use_red_channel settings.use_default_green_channel = track.use_green_channel settings.use_default_blue_channel = track.use_blue_channel @@ -862,6 +869,9 @@ class CLIP_OT_track_settings_as_default(Operator): sc = context.space_data clip = sc.clip - CLIP_default_settings_from_track(clip, clip.tracking.tracks.active) + track = clip.tracking.tracks.active + framenr = context.scene.frame_current - clip.frame_start + 1 + + CLIP_default_settings_from_track(clip, track, framenr) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 05f76208a5f..db492450e28 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -436,15 +436,19 @@ class AddPresetTrackingSettings(AddPresetBase, Operator): ] preset_values = [ - "settings.default_correlation_min", - "settings.default_pattern_size", - "settings.default_search_size", - "settings.default_frames_limit", - "settings.default_pattern_match", - "settings.default_margin", - "settings.use_default_red_channel", - "settings.use_default_green_channel", - "settings.use_default_blue_channel" + "default_correlation_min", + "default_pattern_size", + "default_search_size", + "default_frames_limit", + "default_pattern_match", + "default_margin", + "default_motion_model", + "use_default_brute", + "use_default_normalization", + "use_default_mask", + "use_default_red_channel", + "use_default_green_channel", + "use_default_blue_channel" ] preset_subdir = "tracking_settings" diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 18450ebe316..a81733fe59c 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -101,7 +101,6 @@ def operator_value_is_undo(value): return (isinstance(id_data, bpy.types.ID) and (not isinstance(id_data, (bpy.types.WindowManager, bpy.types.Screen, - bpy.types.Scene, bpy.types.Brush, )))) diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 84049e9f1fe..847807029fa 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -38,6 +38,7 @@ _modules = ( "properties_data_modifier", "properties_data_speaker", "properties_game", + "properties_mask_common", "properties_material", "properties_object_constraint", "properties_object", diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 03aa41bb9aa..e194d7a1370 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -323,6 +323,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from def draw(self, context): ob = context.object + self.draw_settings(context, ob.pose.animation_visualization, bones=True) diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 4f3be914e66..5f21f78a375 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -148,7 +148,7 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): col = row.column(align=True) col.operator("object.vertex_group_add", icon='ZOOMIN', text="") - col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="") + col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="").all = False col.menu("MESH_MT_vertex_group_specials", icon='DOWNARROW_HLT', text="") if group: col.separator() diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 853c11c96c6..ca922dfb544 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -105,14 +105,13 @@ class DATA_PT_cone(DataButtonsPanel, Panel): speaker = context.speaker split = layout.split() - col = split.column() + col = split.column() col.label("Angle:") col.prop(speaker, "cone_angle_outer", text="Outer") col.prop(speaker, "cone_angle_inner", text="Inner") col = split.column() - col.label("Volume:") col.prop(speaker, "cone_volume_outer", text="Outer") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index c25c0c7d40d..5ff49a7d369 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -337,7 +337,6 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): if dome_type in {'FISHEYE', 'TRUNCATED_REAR', 'TRUNCATED_FRONT'}: col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col.prop(gs, "dome_angle", slider=True) @@ -347,14 +346,13 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): elif dome_type == 'PANORAM_SPH': col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col = split.column() col.prop(gs, "dome_tessellation", text="Tessellation") else: # cube map col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col = split.column() @@ -396,6 +394,7 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel): layout = self.layout gs = context.scene.game_settings + row = layout.row() row.prop(gs, "use_frame_rate") row.prop(gs, "restrict_animation_updates") @@ -415,10 +414,10 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout - row = layout.row() - row.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False) - gs = context.scene.game_settings + + layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False) + flow = layout.column_flow() flow.prop(gs, "show_debug_properties", text="Debug Properties") flow.prop(gs, "show_framerate_profile", text="Framerate and Profile") @@ -582,14 +581,14 @@ class WORLD_PT_game_mist(WorldButtonsPanel, Panel): world = context.world layout.active = world.mist_settings.use_mist - row = layout.row() - row.prop(world.mist_settings, "falloff") + + layout.prop(world.mist_settings, "falloff") row = layout.row(align=True) row.prop(world.mist_settings, "start") row.prop(world.mist_settings, "depth") - row = layout.row() - row.prop(world.mist_settings, "intensity", text="Minimum Intensity") + + layout.prop(world.mist_settings, "intensity", text="Minimum Intensity") class WORLD_PT_game_physics(WorldButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py new file mode 100644 index 00000000000..e40b46fda70 --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -0,0 +1,317 @@ +# ##### 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-80 compliant> + +# panels get subclassed (not registered directly) +# menus are referenced `as is` + +import bpy +from bpy.types import Menu + + +class MASK_PT_mask: + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'UI' + bl_label = "Mask Settings" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mask and space_data.mode == 'MASK' + + def draw(self, context): + layout = self.layout + + sc = context.space_data + mask = sc.mask + + col = layout.column(align=True) + col.prop(mask, "frame_start") + col.prop(mask, "frame_end") + + +class MASK_PT_layers: + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'UI' + bl_label = "Mask Layers" + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mask and space_data.mode == 'MASK' + + def draw(self, context): + layout = self.layout + + sc = context.space_data + mask = sc.mask + active_layer = mask.layers.active + + rows = 5 if active_layer else 2 + + row = layout.row() + row.template_list(mask, "layers", + mask, "active_layer_index", rows=rows) + + sub = row.column(align=True) + + sub.operator("mask.layer_new", icon='ZOOMIN', text="") + sub.operator("mask.layer_remove", icon='ZOOMOUT', text="") + + if active_layer: + sub.separator() + + props = sub.operator("mask.layer_move", icon='TRIA_UP', text="") + props.direction = 'UP' + + props = sub.operator("mask.layer_move", icon='TRIA_DOWN', text="") + props.direction = 'DOWN' + + layout.prop(active_layer, "name") + + # blending + row = layout.row(align=True) + row.prop(active_layer, "alpha") + row.prop(active_layer, "invert", text="", icon='IMAGE_ALPHA') + + layout.prop(active_layer, "blend") + layout.prop(active_layer, "falloff") + + +class MASK_PT_spline(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'UI' + bl_label = "Active Spline" + + @classmethod + def poll(cls, context): + sc = context.space_data + mask = sc.mask + + if mask and sc.mode == 'MASK': + return mask.layers.active and mask.layers.active.splines.active + + return False + + def draw(self, context): + layout = self.layout + + sc = context.space_data + mask = sc.mask + spline = mask.layers.active.splines.active + + col = layout.column() + col.prop(spline, "weight_interpolation") + + row = col.row() + row.prop(spline, "use_cyclic") + row.prop(spline, "use_fill") + + +class MASK_PT_point(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'UI' + bl_label = "Active Point" + + @classmethod + def poll(cls, context): + sc = context.space_data + mask = sc.mask + + if mask and sc.mode == 'MASK': + mask_layer_active = mask.layers.active + return (mask_layer_active and + mask_layer_active.splines.active_point) + + return False + + def draw(self, context): + layout = self.layout + + sc = context.space_data + mask = sc.mask + point = mask.layers.active.splines.active_point + parent = point.parent + + col = layout.column() + col.prop(point, "handle_type") + + col = layout.column() + # Currently only parenting yo movie clip is allowed, so do not + # ver-oplicate things for now and use single template_ID + #col.template_any_ID(parent, "id", "id_type", text="") + + col.label("Parent:") + col.prop(parent, "id", text="") + + if parent.id_type == 'MOVIECLIP' and parent.id: + clip = parent.id + tracking = clip.tracking + + col.prop_search(parent, "parent", tracking, + "objects", icon='OBJECT_DATA', text="Object:") + + if parent.parent in tracking.objects: + object = tracking.objects[parent.parent] + col.prop_search(parent, "sub_parent", object, + "tracks", icon='ANIM_DATA', text="Track:") + else: + col.prop_search(parent, "sub_parent", tracking, + "tracks", icon='ANIM_DATA', text="Track:") + + +class MASK_PT_display(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'UI' + bl_label = "Mask Display" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mask and space_data.mode == 'MASK' + + def draw(self, context): + layout = self.layout + + space_data = context.space_data + + layout.prop(space_data, "mask_draw_type", text="") + layout.prop(space_data, "show_mask_smooth") + + +class MASK_PT_tools(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'TOOLS' + bl_label = "Mask Tools" + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mask and space_data.mode == 'MASK' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + col.label(text="Transform:") + col.operator("transform.translate") + col.operator("transform.rotate") + col.operator("transform.resize", text="Scale") + props = col.operator("transform.transform", text="Shrink/Fatten") + props.mode = 'MASK_SHRINKFATTEN' + + col = layout.column(align=True) + col.label(text="Spline:") + col.operator("mask.delete") + col.operator("mask.cyclic_toggle") + col.operator("mask.switch_direction") + + col = layout.column(align=True) + col.label(text="Parenting:") + col.operator("mask.parent_set") + col.operator("mask.parent_clear") + + +class MASK_MT_mask(Menu): + bl_label = "Mask" + + def draw(self, context): + layout = self.layout + + layout.operator("mask.delete") + + layout.separator() + layout.operator("mask.cyclic_toggle") + layout.operator("mask.switch_direction") + layout.operator("mask.normals_make_consistent") + layout.operator("mask.feather_weight_clear") # TODO, better place? + + layout.separator() + layout.operator("mask.parent_clear") + layout.operator("mask.parent_set") + + layout.separator() + layout.menu("MASK_MT_visibility") + layout.menu("MASK_MT_transform") + layout.menu("MASK_MT_animation") + + +class MASK_MT_visibility(Menu): + bl_label = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.operator("mask.hide_view_clear", text="Show Hidden") + layout.operator("mask.hide_view_set", text="Hide Selected") + + props = layout.operator("mask.hide_view_set", text="Hide Unselected") + props.unselected = True + + +class MASK_MT_transform(Menu): + bl_label = "Transform" + + def draw(self, context): + layout = self.layout + + layout.operator("transform.translate") + layout.operator("transform.rotate") + layout.operator("transform.resize") + props = layout.operator("transform.transform", text="Shrink/Fatten") + props.mode = 'MASK_SHRINKFATTEN' + + +class MASK_MT_animation(Menu): + bl_label = "Animation" + + def draw(self, context): + layout = self.layout + + layout.operator("mask.shape_key_clear") + layout.operator("mask.shape_key_insert") + layout.operator("mask.shape_key_feather_reset") + layout.operator("mask.shape_key_rekey") + + +class MASK_MT_select(Menu): + bl_label = "Select" + + def draw(self, context): + layout = self.layout + sc = context.space_data + + layout.operator("mask.select_border") + layout.operator("mask.select_circle") + + layout.separator() + + layout.operator("mask.select_all").action = 'TOGGLE' + layout.operator("mask.select_all", text="Inverse").action = 'INVERT' + +if __name__ == "__main__": # only for live edit. + bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 6e66bd0d98b..dfc75168d2b 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -350,7 +350,6 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, Panel): class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): bl_label = "Transparency" - # bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER'} @classmethod diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 68b261cc1d5..275cb8fab65 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -259,7 +259,6 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation") elif ob.dupli_type == 'FACES': - row = layout.row() row.prop(ob, "use_dupli_faces_scale", text="Scale") row.prop(ob, "dupli_faces_scale", text="Inherit Scale") diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 4db056e77a2..7f824d94431 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -186,11 +186,8 @@ def effector_weights_ui(self, context, weights): split = layout.split() - col = split.column() - col.prop(weights, "gravity", slider=True) - - col = split.column() - col.prop(weights, "all", slider=True) + split.prop(weights, "gravity", slider=True) + split.prop(weights, "all", slider=True) layout.separator() diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index 65603c65041..70499b18f41 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -168,7 +168,6 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): bl_label = "Collision" - #bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index c9c9c36217b..8449d26f6e6 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -39,6 +39,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout + scene = context.scene layout.prop(scene, "camera") @@ -52,6 +53,7 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout + scene = context.scene rd = context.scene.render ffmpeg = rd.ffmpeg @@ -81,6 +83,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout + unit = context.scene.unit_settings col = layout.column() diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 5bde9538e54..46a17675c91 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -116,6 +116,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): def draw(self, context): layout = self.layout + slot = getattr(context, "texture_slot", None) node = getattr(context, "texture_node", None) space = context.space_data diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 76d70aafc2e..0b8d8a45a08 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -82,6 +82,7 @@ class WORLD_PT_world(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + world = context.world row = layout.row() @@ -111,6 +112,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + light = context.world.light_settings layout.active = light.use_ambient_occlusion @@ -130,6 +132,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + light = context.world.light_settings layout.active = light.use_environment_light @@ -149,6 +152,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + light = context.world.light_settings layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE' @@ -167,6 +171,7 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + light = context.world.light_settings layout.active = light.use_ambient_occlusion or light.use_environment_light or light.use_indirect_light @@ -221,6 +226,7 @@ class WORLD_PT_mist(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + world = context.world layout.active = world.mist_settings.use_mist @@ -250,6 +256,7 @@ class WORLD_PT_stars(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout + world = context.world layout.active = world.star_settings.use_stars diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index ac724518e85..efac7a66086 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -115,11 +115,11 @@ class CLIP_HT_header(Header): sub.menu("CLIP_MT_view") if clip: - sub.menu("CLIP_MT_select") - sub.menu("CLIP_MT_clip") - sub.menu("CLIP_MT_mask") + sub.menu("MASK_MT_select") + sub.menu("CLIP_MT_clip") # XXX - remove? + sub.menu("MASK_MT_mask") else: - sub.menu("CLIP_MT_clip") + sub.menu("CLIP_MT_clip") # XXX - remove? row = layout.row() row.template_ID(sc, "clip", open="clip.open") @@ -161,16 +161,6 @@ class CLIP_PT_clip_view_panel: return clip and sc.view == 'CLIP' -class CLIP_PT_mask_view_panel: - - @classmethod - def poll(cls, context): - sc = context.space_data - clip = sc.clip - - return clip and sc.view == 'CLIP' and sc.mode == 'MASKEDIT' - - class CLIP_PT_tracking_panel: @classmethod @@ -197,10 +187,11 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): bl_label = "Marker" def draw(self, context): + layout = self.layout + sc = context.space_data clip = sc.clip settings = clip.tracking.settings - layout = self.layout col = layout.column(align=True) col.operator("clip.add_marker_move") @@ -241,9 +232,9 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): col.label(text="Tracker:") col.prop(settings, "default_motion_model") - col.prop(settings, "default_use_brute") - col.prop(settings, "default_use_normalization") - col.prop(settings, "default_use_mask") + col.prop(settings, "use_default_brute") + col.prop(settings, "use_default_normalization") + col.prop(settings, "use_default_mask") col.prop(settings, "default_correlation_min") col.separator() @@ -302,6 +293,7 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout + clip = context.space_data.clip tracking = clip.tracking settings = tracking.settings @@ -422,34 +414,6 @@ class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel): col.prop(settings, "object_distance") -class CLIP_PT_tools_mask(CLIP_PT_mask_view_panel, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'TOOLS' - bl_label = "Mask Tools" - - def draw(self, context): - layout = self.layout - - col = layout.column(align=True) - col.label(text="Transform:") - col.operator("transform.translate") - col.operator("transform.rotate") - col.operator("transform.resize", text="Scale") - props = col.operator("transform.transform", text="Shrink/Fatten") - props.mode = 'MASK_SHRINKFATTEN' - - col = layout.column(align=True) - col.label(text="Spline:") - col.operator("mask.delete") - col.operator("mask.cyclic_toggle") - col.operator("mask.switch_direction") - - col = layout.column(align=True) - col.label(text="Parenting:") - col.operator("mask.parent_set") - col.operator("mask.parent_clear") - - class CLIP_PT_tools_grease_pencil(Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' @@ -465,7 +429,7 @@ class CLIP_PT_tools_grease_pencil(Panel): if sc.mode == 'DISTORTION': return sc.view == 'CLIP' - elif sc.mode == 'MASKEDIT': + elif sc.mode == 'MASK': return True return False @@ -520,6 +484,7 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout + sc = context.space_data clip = context.space_data.clip act_track = clip.tracking.tracks.active @@ -586,6 +551,7 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout + clip = context.space_data.clip settings = clip.tracking.settings @@ -661,136 +627,6 @@ class CLIP_PT_tracking_camera(Panel): col.prop(clip.tracking.camera, "k3") -class CLIP_PT_mask_layers(Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - bl_label = "Mask Layers" - - @classmethod - def poll(cls, context): - sc = context.space_data - - return sc.mask and sc.mode == 'MASKEDIT' - - def draw(self, context): - layout = self.layout - - sc = context.space_data - mask = sc.mask - active_layer = mask.layers.active - - rows = 5 if active_layer else 2 - - row = layout.row() - row.template_list(mask, "layers", - mask, "active_layer_index", rows=rows) - - sub = row.column(align=True) - - sub.operator("mask.layer_new", icon='ZOOMIN', text="") - sub.operator("mask.layer_remove", icon='ZOOMOUT', text="") - - if active_layer: - sub.separator() - - props = sub.operator("mask.layer_move", icon='TRIA_UP', text="") - props.direction = 'UP' - - props = sub.operator("mask.layer_move", icon='TRIA_DOWN', text="") - props.direction = 'DOWN' - - layout.prop(active_layer, "name") - - # blending - row = layout.row(align=True) - row.prop(active_layer, "alpha") - row.prop(active_layer, "invert", text="", icon='IMAGE_ALPHA') - - layout.prop(active_layer, "blend") - layout.prop(active_layer, "falloff") - - -class CLIP_PT_active_mask_spline(Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - bl_label = "Active Spline" - - @classmethod - def poll(cls, context): - sc = context.space_data - mask = sc.mask - - if mask and sc.mode == 'MASKEDIT': - return mask.layers.active and mask.layers.active.splines.active - - return False - - def draw(self, context): - layout = self.layout - - sc = context.space_data - mask = sc.mask - spline = mask.layers.active.splines.active - - col = layout.column() - col.prop(spline, "weight_interpolation") - rowsub = col.row() - rowsub.prop(spline, "use_cyclic") - rowsub.prop(spline, "use_fill") - - -class CLIP_PT_active_mask_point(Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - bl_label = "Active Point" - - @classmethod - def poll(cls, context): - sc = context.space_data - mask = sc.mask - - if mask and sc.mode == 'MASKEDIT': - mask_layer_active = mask.layers.active - return (mask_layer_active and - mask_layer_active.splines.active_point) - - return False - - def draw(self, context): - layout = self.layout - - sc = context.space_data - mask = sc.mask - point = mask.layers.active.splines.active_point - parent = point.parent - - col = layout.column() - col.prop(point, "handle_type") - - col = layout.column() - # Currently only parenting yo movie clip is allowed, so do not - # ver-oplicate things for now and use single template_ID - #col.template_any_ID(parent, "id", "id_type", text="") - - col.label("Parent:") - col.prop(parent, "id", text="") - - if parent.id_type == 'MOVIECLIP' and parent.id: - clip = parent.id - tracking = clip.tracking - - col.prop_search(parent, "parent", tracking, - "objects", icon='OBJECT_DATA', text="Object:") - - if parent.parent in tracking.objects: - object = tracking.objects[parent.parent] - col.prop_search(parent, "sub_parent", object, - "tracks", icon='ANIM_DATA', text="Track:") - else: - col.prop_search(parent, "sub_parent", tracking, - "tracks", icon='ANIM_DATA', text="Track:") - - class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'UI' @@ -835,29 +671,6 @@ class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel): row = col.row() row.prop(clip, "display_aspect", text="") - if sc.mode == 'MASKEDIT': - col = layout.column() - col.prop(sc, "mask_draw_type", text="") - col.prop(sc, "show_mask_smooth") - - -# TODO, move into its own file -class CLIP_PT_mask(CLIP_PT_mask_view_panel, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - bl_label = "Mask Settings" - bl_options = {'DEFAULT_CLOSED'} - - def draw(self, context): - layout = self.layout - - sc = context.space_data - mask = sc.mask - - col = layout.column(align=True) - col.prop(mask, "frame_start") - col.prop(mask, "frame_end") - class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel): bl_space_type = 'CLIP_EDITOR' @@ -868,7 +681,7 @@ class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel): def poll(cls, context): sc = context.space_data - return sc.mode != 'MASKEDIT' + return sc.mode != 'MASK' def draw(self, context): layout = self.layout @@ -973,6 +786,7 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel): def draw(self, context): layout = self.layout + sc = context.space_data clip = sc.clip @@ -1029,7 +843,7 @@ class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel): col = layout.column() col.template_movieclip(sc, "clip", compact=True) - col.prop(clip, "start_frame") + col.prop(clip, "frame_start") col.prop(clip, "frame_offset") @@ -1050,6 +864,7 @@ class CLIP_MT_view(Menu): def draw(self, context): layout = self.layout + sc = context.space_data if sc.view == 'CLIP': @@ -1213,30 +1028,18 @@ class CLIP_MT_select(Menu): def draw(self, context): layout = self.layout - sc = context.space_data - - if sc.mode == 'MASKEDIT': - layout.operator("mask.select_border") - layout.operator("mask.select_circle") - - layout.separator() - layout.operator("mask.select_all" - ).action = 'TOGGLE' - layout.operator("mask.select_all", - text="Inverse").action = 'INVERT' - else: - layout.operator("clip.select_border") - layout.operator("clip.select_circle") + layout.operator("clip.select_border") + layout.operator("clip.select_circle") - layout.separator() + layout.separator() - layout.operator("clip.select_all" - ).action = 'TOGGLE' - layout.operator("clip.select_all", - text="Inverse").action = 'INVERT' + layout.operator("clip.select_all" + ).action = 'TOGGLE' + layout.operator("clip.select_all", + text="Inverse").action = 'INVERT' - layout.menu("CLIP_MT_select_grouped") + layout.menu("CLIP_MT_select_grouped") class CLIP_MT_select_grouped(Menu): @@ -1280,30 +1083,6 @@ class CLIP_MT_tracking_specials(Menu): props.action = 'UNLOCK' -class CLIP_MT_mask(Menu): - bl_label = "Mask" - - def draw(self, context): - layout = self.layout - - layout.operator("mask.delete") - - layout.separator() - layout.operator("mask.cyclic_toggle") - layout.operator("mask.switch_direction") - layout.operator("mask.normals_make_consistent") - layout.operator("mask.feather_weight_clear") # TODO, better place? - - layout.separator() - layout.operator("mask.parent_clear") - layout.operator("mask.parent_set") - - layout.separator() - layout.menu("CLIP_MT_mask_visibility") - layout.menu("CLIP_MT_mask_transform") - layout.menu("CLIP_MT_mask_animation") - - class CLIP_MT_select_mode(Menu): bl_label = "Select Mode" @@ -1315,44 +1094,6 @@ class CLIP_MT_select_mode(Menu): layout.operator_enum("clip.mode_set", "mode") -class CLIP_MT_mask_visibility(Menu): - bl_label = "Show/Hide" - - def draw(self, context): - layout = self.layout - - layout.operator("mask.hide_view_clear", text="Show Hidden") - layout.operator("mask.hide_view_set", text="Hide Selected") - - props = layout.operator("mask.hide_view_set", text="Hide Unselected") - props.unselected = True - - -class CLIP_MT_mask_transform(Menu): - bl_label = "Transform" - - def draw(self, context): - layout = self.layout - - layout.operator("transform.translate") - layout.operator("transform.rotate") - layout.operator("transform.resize") - props = layout.operator("transform.transform", text="Shrink/Fatten") - props.mode = 'MASK_SHRINKFATTEN' - - -class CLIP_MT_mask_animation(Menu): - bl_label = "Animation" - - def draw(self, context): - layout = self.layout - - layout.operator("mask.shape_key_clear") - layout.operator("mask.shape_key_insert") - layout.operator("mask.shape_key_feather_reset") - layout.operator("mask.shape_key_rekey") - - class CLIP_MT_camera_presets(Menu): """Predefined tracking camera intrinsics""" bl_label = "Camera Presets" @@ -1394,5 +1135,49 @@ class CLIP_MT_stabilize_2d_specials(Menu): layout.operator("clip.stabilize_2d_select") + +# ----------------------------------------------------------------------------- +# Mask (similar code in space_image.py, keep in sync) + + +from bl_ui.properties_mask_common import (MASK_PT_mask, + MASK_PT_layers, + MASK_PT_spline, + MASK_PT_point, + MASK_PT_display, + MASK_PT_tools) + + +class CLIP_PT_mask(MASK_PT_mask, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_mask_layers(MASK_PT_layers, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_mask_display(MASK_PT_display, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_active_mask_spline(MASK_PT_spline, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_active_mask_point(MASK_PT_point, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_tools_mask(MASK_PT_tools, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + +# --- end mask --- + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index cfe5d66740c..af39ce3437a 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -27,7 +27,7 @@ class ImagePaintPanel(UnifiedPaintPanel): bl_region_type = 'UI' -class BrushButtonsPanel(): +class BrushButtonsPanel: bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' @@ -153,10 +153,6 @@ class IMAGE_MT_image(Menu): if ima.source in {'FILE', 'GENERATED'} and ima.type != 'OPEN_EXR_MULTILAYER': layout.operator("image.pack", text="Pack As PNG").as_png = True - if not context.tool_settings.use_uv_sculpt: - layout.separator() - layout.prop(sima, "use_image_paint") - layout.separator() @@ -217,6 +213,7 @@ class IMAGE_MT_uvs_snap(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'EXEC_REGION_WIN' layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS' @@ -234,6 +231,7 @@ class IMAGE_MT_uvs_mirror(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'EXEC_REGION_WIN' layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True @@ -353,10 +351,12 @@ class IMAGE_HT_header(Header): ima = sima.image iuser = sima.image_user toolsettings = context.tool_settings + mode = sima.mode show_render = sima.show_render # show_paint = sima.show_paint show_uvedit = sima.show_uvedit + show_maskedit = sima.show_maskedit row = layout.row(align=True) row.template_header() @@ -381,6 +381,8 @@ class IMAGE_HT_header(Header): if not show_render: layout.prop(sima, "use_image_pin", text="") + layout.prop(sima, "mode", text="") + # uv editing if show_uvedit: uvedit = sima.uv_editor @@ -406,13 +408,18 @@ class IMAGE_HT_header(Header): mesh = context.edit_object.data layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="") + if show_maskedit: + row = layout.row() + row.template_ID(sima, "mask", new="mask.new") + + # reused for mask + uvedit = sima.uv_editor + layout.prop(uvedit, "pivot_point", text="", icon_only=True) + if ima: # layers layout.template_image_layers(ima, iuser) - # painting - layout.prop(sima, "use_image_paint", text="") - # draw options row = layout.row(align=True) row.prop(sima, "draw_channels", text="", expand=True) @@ -423,7 +430,7 @@ class IMAGE_HT_header(Header): if ima.type == 'COMPOSITE' and ima.source in {'MOVIE', 'SEQUENCE'}: row.operator("image.play_composite", icon='PLAY') - if show_uvedit or sima.use_image_paint: + if show_uvedit or show_maskedit or mode == 'PAINT': layout.prop(sima, "use_realtime_update", text="", icon_only=True, icon='LOCKED') @@ -834,20 +841,57 @@ class IMAGE_UV_sculpt(Panel, ImagePaintPanel): self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") self.prop_unified_strength(row, context, brush, "use_pressure_strength") - split = layout.split() - col = split.column() - + col = layout.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") +# ----------------------------------------------------------------------------- +# Mask (similar code in space_clip.py, keep in sync) +# note! - panel placement does _not_ fit well with image panels... need to fix + +from bl_ui.properties_mask_common import (MASK_PT_mask, + MASK_PT_layers, + MASK_PT_spline, + MASK_PT_point, + MASK_PT_display, + MASK_PT_tools) + + +class IMAGE_PT_mask(MASK_PT_mask, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'PREVIEW' + + +class IMAGE_PT_mask_layers(MASK_PT_layers, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'PREVIEW' + + +class IMAGE_PT_mask_display(MASK_PT_display, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'PREVIEW' + + +class IMAGE_PT_active_mask_spline(MASK_PT_spline, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'PREVIEW' + + +class IMAGE_PT_active_mask_point(MASK_PT_point, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'PREVIEW' + + +class IMAGE_PT_tools_mask(MASK_PT_tools, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' # is 'TOOLS' in the clip editor + +# --- end mask --- + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 40c7b632247..adcf5a9e9df 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -94,6 +94,10 @@ class NODE_HT_header(Header): if toolsettings.snap_node_element != 'INCREMENT': row.prop(toolsettings, "snap_target", text="") + row = layout.row(align=True) + row.operator("node.clipboard_copy", text="", icon='COPYDOWN') + row.operator("node.clipboard_paste", text="", icon='PASTEDOWN') + layout.template_running_jobs() @@ -135,7 +139,8 @@ class NODE_MT_select(Menu): layout.operator("node.select_border") layout.separator() - layout.operator("node.select_all") + layout.operator("node.select_all").action = 'TOGGLE' + layout.operator("node.select_all", text="Inverse").action = 'INVERT' layout.operator("node.select_linked_from") layout.operator("node.select_linked_to") layout.operator("node.select_same_type") @@ -226,16 +231,21 @@ class NODE_PT_quality(bpy.types.Panel): def draw(self, context): layout = self.layout + snode = context.space_data tree = snode.node_tree - layout.prop(tree, "render_quality", text="Render") - layout.prop(tree, "edit_quality", text="Edit") - layout.prop(tree, "chunk_size") - layout.prop(tree, "use_opencl") - layout.prop(tree, "two_pass") - layout.prop(snode, "show_highlight") - + col = layout.column() + col.prop(tree, "render_quality", text="Render") + col.prop(tree, "edit_quality", text="Edit") + col.prop(tree, "chunk_size") + + col = layout.column() + col.prop(tree, "use_opencl") + col.prop(tree, "two_pass") + col.prop(snode, "show_highlight") + col.prop(snode, "use_hidden_preview") + class NODE_MT_node_color_presets(Menu): """Predefined node color""" diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index a71a2870bee..d099db1645b 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -184,6 +184,7 @@ class SEQUENCER_MT_add(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' if len(bpy.data.scenes) > 10: @@ -216,6 +217,7 @@ class SEQUENCER_MT_add_effect(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD' @@ -834,6 +836,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): def draw(self, context): layout = self.layout + render = context.scene.render col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 9c24e48300a..eca9bc22db9 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -302,6 +302,7 @@ class TEXT_MT_toolbox(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'INVOKE_DEFAULT' layout.operator("text.cut") diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 0f573c46d69..ed1d2a0ae24 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -160,8 +160,7 @@ class TIME_MT_frame(Menu): layout.separator() - sub = layout.row() - sub.menu("TIME_MT_autokey") + layout.menu("TIME_MT_autokey") class TIME_MT_playback(Menu): diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 66382e72a4d..e443c7804a6 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -79,6 +79,7 @@ class USERPREF_HT_header(Header): def draw(self, context): layout = self.layout + layout.template_header(menus=False) userpref = context.user_preferences @@ -137,6 +138,7 @@ class USERPREF_MT_splash(Menu): def draw(self, context): layout = self.layout + split = layout.split() row = split.row() row.label("") @@ -850,6 +852,7 @@ class USERPREF_MT_ndof_settings(Menu): def draw(self, context): layout = self.layout + input_prefs = context.user_preferences.inputs layout.separator() @@ -979,6 +982,7 @@ class USERPREF_MT_addons_dev_guides(Menu): # menu to open web-pages with addons development guides def draw(self, context): layout = self.layout + layout.operator("wm.url_open", text="API Concepts", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro" layout.operator("wm.url_open", text="Addon Guidelines", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons" layout.operator("wm.url_open", text="How to share your addon", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Py/Sharing" @@ -1004,10 +1008,10 @@ class USERPREF_PT_addons(Panel): @staticmethod def is_user_addon(mod, user_addon_paths): if not user_addon_paths: - user_script_path = bpy.utils.user_script_path() - if user_script_path is not None: - user_addon_paths.append(os.path.join(user_script_path, "addons")) - user_addon_paths.append(os.path.join(bpy.utils.resource_path('USER'), "scripts", "addons")) + for path in (bpy.utils.script_path_user(), + bpy.utils.script_path_pref()): + if path is not None: + user_addon_paths.append(os.path.join(path, "addons")) for path in user_addon_paths: if bpy.path.is_subdir(mod.__file__, path): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a876c607cd3..2d9c9467a01 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -64,28 +64,29 @@ class VIEW3D_HT_header(Header): layout.template_header_3D() if obj: + mode = obj.mode # Particle edit - if obj.mode == 'PARTICLE_EDIT': + if mode == 'PARTICLE_EDIT': row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True) # Occlude geometry - if view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')): + if view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH')): row.prop(view, "use_occlude_geometry", text="") # Proportional editing - if obj.mode in {'EDIT', 'PARTICLE_EDIT'}: + if mode in {'EDIT', 'PARTICLE_EDIT'}: row = layout.row(align=True) row.prop(toolsettings, "proportional_edit", text="", icon_only=True) if toolsettings.proportional_edit != 'DISABLED': row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True) - elif obj.mode == 'OBJECT': + elif mode == 'OBJECT': row = layout.row(align=True) row.prop(toolsettings, "use_proportional_edit_objects", text="", icon_only=True) if toolsettings.use_proportional_edit_objects: row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True) # Snap - if not obj or obj.mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: + if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: snap_element = toolsettings.snap_element row = layout.row(align=True) row.prop(toolsettings, "use_snap", text="") @@ -93,9 +94,9 @@ class VIEW3D_HT_header(Header): if snap_element != 'INCREMENT': row.prop(toolsettings, "snap_target", text="") if obj: - if obj.mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME': + if mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME': row.prop(toolsettings, "use_snap_align_rotation", text="") - elif obj.mode == 'EDIT': + elif mode == 'EDIT': row.prop(toolsettings, "use_snap_self", text="") if snap_element == 'VOLUME': @@ -110,7 +111,7 @@ class VIEW3D_HT_header(Header): props.animation = True # Pose - if obj and obj.mode == 'POSE': + if obj and mode == 'POSE': row = layout.row(align=True) row.operator("pose.copy", text="", icon='COPYDOWN') row.operator("pose.paste", text="", icon='PASTEDOWN') @@ -176,11 +177,12 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base): # Object-specific extensions to Transform menu class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): def draw(self, context): + layout = self.layout + # base menu VIEW3D_MT_transform_base.draw(self, context) # object-specific option follow... - layout = self.layout layout.separator() layout.operator("transform.translate", text="Move Texture Space").texture_space = True @@ -212,11 +214,12 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): # Armature EditMode extensions to Transform menu class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): def draw(self, context): + layout = self.layout + # base menu VIEW3D_MT_transform_base.draw(self, context) # armature specific extensions follow... - layout = self.layout layout.separator() obj = context.object @@ -429,18 +432,23 @@ class VIEW3D_MT_view_align_selected(Menu): props = layout.operator("view3d.viewnumpad", text="Top") props.align_active = True props.type = 'TOP' + props = layout.operator("view3d.viewnumpad", text="Bottom") props.align_active = True props.type = 'BOTTOM' + props = layout.operator("view3d.viewnumpad", text="Front") props.align_active = True props.type = 'FRONT' + props = layout.operator("view3d.viewnumpad", text="Back") props.align_active = True props.type = 'BACK' + props = layout.operator("view3d.viewnumpad", text="Right") props.align_active = True props.type = 'RIGHT' + props = layout.operator("view3d.viewnumpad", text="Left") props.align_active = True props.type = 'LEFT' @@ -1191,6 +1199,7 @@ class VIEW3D_MT_vertex_group(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'EXEC_AREA' layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True @@ -1349,6 +1358,7 @@ class VIEW3D_MT_particle_specials(Menu): def draw(self, context): layout = self.layout + particle_edit = context.tool_settings.particle_edit layout.operator("particle.rekey") @@ -1792,6 +1802,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.edge_face_add") @@ -1839,6 +1850,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu): def draw(self, context): layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.flip_normals") @@ -2632,6 +2644,7 @@ class VIEW3D_PT_etch_a_ton(Panel): def draw(self, context): layout = self.layout + toolsettings = context.scene.tool_settings col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index f3365da6ad6..ac962ab5097 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1124,6 +1124,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu): def draw(self, context): layout = self.layout + for i, tex in enumerate(context.active_object.data.uv_textures): props = layout.operator("wm.context_set_int", text=tex.name) props.data_path = "active_object.data.uv_texture_clone_index" |