diff options
author | Miika Hamalainen <blender@miikah.org> | 2012-06-26 21:51:25 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2012-06-26 21:51:25 +0400 |
commit | 7f0137ece17a375f1241643488cd344ae7d92384 (patch) | |
tree | 1613a38de7de64b67420d04c67a372a585d3b915 /release/scripts/startup/bl_operators | |
parent | 1a52abb04f83d402e5aded1486cca606a09a27e5 (diff) | |
parent | 200584e5c6e020dcb77038a0e399ddfebe91ce63 (diff) |
Merge with trunk r48317
Diffstat (limited to 'release/scripts/startup/bl_operators')
7 files changed, 23 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 5a428467f12..98bad276109 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -227,7 +227,7 @@ class BakeAction(Operator): self.frame_start = scene.frame_start self.frame_end = scene.frame_end self.bake_types = {'POSE'} if context.mode == 'POSE' else {'OBJECT'} - + wm = context.window_manager return wm.invoke_props_dialog(self) diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py index ff87f98658d..82a54077bdc 100644 --- a/release/scripts/startup/bl_operators/console.py +++ b/release/scripts/startup/bl_operators/console.py @@ -77,7 +77,7 @@ class ConsoleBanner(Operator): # default to python if not sc.language: - sc.language = 'python' + sc.language = "python" module = _lang_module_get(sc) banner = getattr(module, "banner", None) diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index fbf0e47f0c8..a2c632a0244 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -34,7 +34,8 @@ class SelectPattern(Operator): pattern = StringProperty( name="Pattern", - description="Name filter using '*', '?' and '[abc]' unix style wildcards", + description="Name filter using '*', '?' and " + "'[abc]' unix style wildcards", maxlen=64, default="*", ) @@ -130,8 +131,8 @@ class SelectCamera(Operator): class SelectHierarchy(Operator): - '''Select object relative to the active object's position ''' \ - '''in the hierarchy''' + """Select object relative to the active object's position """ + """in the hierarchy""" bl_idname = "object.select_hierarchy" bl_label = "Select Hierarchy" bl_options = {'REGISTER', 'UNDO'} @@ -277,8 +278,8 @@ class SubdivisionSet(Operator): class ShapeTransfer(Operator): - '''Copy another selected objects active shape to this one by ''' \ - '''applying the relative offsets''' + """Copy another selected objects active shape to this one by """ + """applying the relative offsets""" bl_idname = "object.shape_key_transfer" bl_label = "Transfer Shape Key" diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index cfd3d9acd0c..b08d8408011 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -174,6 +174,7 @@ class QuickExplode(Operator): if self.style == 'BLEND' and len(mesh_objects) != 2: self.report({'ERROR'}, "Select two mesh objects") + self.style = 'EXPLODE' return {'CANCELLED'} elif not mesh_objects: self.report({'ERROR'}, "Select at least one mesh object") @@ -241,10 +242,10 @@ class QuickExplode(Operator): if obj == to_obj: tex_slot.alpha_factor = -1.0 elem = tex.color_ramp.elements[1] - elem.color = mat.diffuse_color else: elem = tex.color_ramp.elements[0] - elem.color = mat.diffuse_color + # Keep already defined alpha! + elem.color[:3] = mat.diffuse_color else: tex_slot.use_map_color_diffuse = False diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 4171b8b3c2c..bf5a57fb39a 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8-80 compliant> +# <pep8 compliant> import bpy from bpy.types import Menu, Operator diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 1e18825a155..ac4aa96f655 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -107,7 +107,6 @@ def boundsEdgeLoop(edges): # print len(faces), minx, maxx, miny , maxy for ed in edges: for pt in ed: - print 'ass' x= pt[0] y= pt[1] if x<minx: x= minx @@ -502,7 +501,6 @@ def mergeUvIslands(islandList): It gives about 10% speedup with minimal errors. ''' - #print 'ass' # Move the test along its width + SMALL_NUM #boxLeft += sourceIsland[4] + SMALL_NUM boxLeft += sourceIsland[4] @@ -832,7 +830,7 @@ def main(context, USER_ONLY_SELECTED_FACES = False if not obList: - raise('error, no selected mesh objects') + raise Exception("error, no selected mesh objects") # Reuse variable if len(obList) == 1: diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 4d95c2d5d03..fc19a989032 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -138,7 +138,7 @@ def execute_context_assign(self, context): class BRUSH_OT_active_index_set(Operator): - '''Set active sculpt/paint brush from it's number''' + """Set active sculpt/paint brush from it's number""" bl_idname = "brush.active_index_set" bl_label = "Set Brush Number" @@ -371,8 +371,8 @@ class WM_OT_context_toggle_enum(Operator): class WM_OT_context_cycle_int(Operator): - '''Set a context value. Useful for cycling active material, ''' - '''vertex keys, groups' etc''' + """Set a context value. Useful for cycling active material, """ + """vertex keys, groups' etc""" bl_idname = "wm.context_cycle_int" bl_label = "Context Int Cycle" bl_options = {'UNDO', 'INTERNAL'} @@ -799,7 +799,6 @@ class WM_OT_path_open(Operator): return {'FINISHED'} - def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""): id_split = doc_id.split(".") url = rna = None @@ -832,7 +831,7 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""): url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" % (url_prefix, class_name, class_name, class_prop)) else: rna = ("bpy.types.%s.%s" % (class_name, class_prop)) - + return url if do_url else rna @@ -1061,7 +1060,7 @@ class WM_OT_properties_edit(Operator): prop_ui["soft_min"] = prop_ui["min"] = prop_type(self.min) prop_ui["soft_max"] = prop_ui["max"] = prop_type(self.max) - prop_ui['description'] = self.description + prop_ui["description"] = self.description # otherwise existing buttons which reference freed # memory may crash blender [#26510] @@ -1597,10 +1596,11 @@ class WM_OT_addon_disable(Operator): addon_utils.disable(self.module) return {'FINISHED'} + class WM_OT_theme_install(Operator): "Install a theme" bl_idname = "wm.theme_install" - bl_label = "Install Theme..." + bl_label = "Install Theme..." overwrite = BoolProperty( name="Overwrite", @@ -1624,10 +1624,10 @@ class WM_OT_theme_install(Operator): import os import shutil import traceback - + xmlfile = self.filepath - path_themes = bpy.utils.user_resource('SCRIPTS','presets/interface_theme',create=True) + path_themes = bpy.utils.user_resource('SCRIPTS', "presets/interface_theme", create=True) if not path_themes: self.report({'ERROR'}, "Failed to get themes path") @@ -1642,7 +1642,7 @@ class WM_OT_theme_install(Operator): try: shutil.copyfile(xmlfile, path_dest) - bpy.ops.script.execute_preset(filepath=path_dest,menu_idname="USERPREF_MT_interface_theme_presets") + bpy.ops.script.execute_preset(filepath=path_dest, menu_idname="USERPREF_MT_interface_theme_presets") except: traceback.print_exc() @@ -1650,7 +1650,6 @@ class WM_OT_theme_install(Operator): return {'FINISHED'} - def invoke(self, context, event): wm = context.window_manager wm.fileselect_add(self) |