diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 10:11:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 10:11:56 +0400 |
commit | a7c1e339cfdf689d48c92eff46635748b33f9a4f (patch) | |
tree | 631f309c6a49be4b1a679445645e2a3458a7c6f4 /release | |
parent | 259b68f5c7455f57c67d6db50e727d0f02330c0c (diff) |
picky cleanup to use of bpy.types
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_texture.py | 42 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 2 |
5 files changed, 32 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 6aa08a7f50d..84049e9f1fe 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -86,7 +86,7 @@ def register(): # space_userprefs.py from bpy.props import StringProperty, EnumProperty - WindowManager = bpy.types.WindowManager + from bpy.types import WindowManager def addon_filter_items(self, context): import addon_utils diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 9f2b3367feb..ee5702e324e 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -244,7 +244,7 @@ class RenderButtonsPanel(): return (rd.engine in cls.COMPAT_ENGINES) -class RENDER_PT_embedded(RenderButtonsPanel, bpy.types.Panel): +class RENDER_PT_embedded(RenderButtonsPanel, Panel): bl_label = "Embedded Player" COMPAT_ENGINES = {'BLENDER_GAME'} diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index c7f94bb4a3d..6e54bdde024 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -19,6 +19,14 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel + +from bpy.types import (Brush, + Lamp, + Material, + ParticleSettings, + Texture, + World) + from rna_prop_ui import PropertyPanel @@ -91,7 +99,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): engine = context.scene.render.engine if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")): return False - return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, bpy.types.ParticleSettings)) + return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings)) and (engine in cls.COMPAT_ENGINES)) def draw(self, context): @@ -103,14 +111,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): idblock = context_tex_datablock(context) pin_id = space.pin_id - if space.use_pin_id and not isinstance(pin_id, bpy.types.Texture): + if space.use_pin_id and not isinstance(pin_id, Texture): idblock = pin_id pin_id = None if not space.use_pin_id: layout.prop(space, "texture_context", expand=True) - tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, bpy.types.Brush)) + tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, Brush)) if tex_collection: row = layout.row() @@ -413,7 +421,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): col = split.column() #Only for Material based textures, not for Lamp/World... - if slot and isinstance(idblock, bpy.types.Material): + if slot and isinstance(idblock, Material): col.prop(tex, "use_normal_map") row = col.row() row.active = tex.use_normal_map @@ -801,7 +809,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): @classmethod def poll(cls, context): idblock = context_tex_datablock(context) - if isinstance(idblock, bpy.types.Brush) and not context.sculpt_object: + if isinstance(idblock, Brush) and not context.sculpt_object: return False if not getattr(context, "texture_slot", None): @@ -818,7 +826,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): tex = context.texture_slot # textype = context.texture - if not isinstance(idblock, bpy.types.Brush): + if not isinstance(idblock, Brush): split = layout.split(percentage=0.3) col = split.column() col.label(text="Coordinates:") @@ -847,7 +855,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): split.label(text="Object:") split.prop(tex, "object", text="") - if isinstance(idblock, bpy.types.Brush): + if isinstance(idblock, Brush): if context.sculpt_object: layout.label(text="Brush Mapping:") layout.prop(tex, "map_mode", expand=True) @@ -856,7 +864,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): row.active = tex.map_mode in {'FIXED', 'TILED'} row.prop(tex, "angle") else: - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): split = layout.split(percentage=0.3) split.label(text="Projection:") split.prop(tex, "mapping", text="") @@ -889,7 +897,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): @classmethod def poll(cls, context): idblock = context_tex_datablock(context) - if isinstance(idblock, bpy.types.Brush): + if isinstance(idblock, Brush): return False if not getattr(context, "texture_slot", None): @@ -915,7 +923,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): sub.prop(tex, factor, text=name, slider=True) return sub # XXX, temp. use_map_normal needs to override. - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): if idblock.type in {'SURFACE', 'WIRE'}: split = layout.split() @@ -978,7 +986,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color") factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color") - elif isinstance(idblock, bpy.types.Lamp): + elif isinstance(idblock, Lamp): split = layout.split() col = split.column() @@ -987,7 +995,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col = split.column() factor_but(col, "use_map_shadow", "shadow_factor", "Shadow") - elif isinstance(idblock, bpy.types.World): + elif isinstance(idblock, World): split = layout.split() col = split.column() @@ -997,7 +1005,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col = split.column() factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up") factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down") - elif isinstance(idblock, bpy.types.ParticleSettings): + elif isinstance(idblock, ParticleSettings): split = layout.split() col = split.column() @@ -1028,7 +1036,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): layout.separator() - if not isinstance(idblock, bpy.types.ParticleSettings): + if not isinstance(idblock, ParticleSettings): split = layout.split() col = split.column() @@ -1041,10 +1049,10 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col.prop(tex, "invert", text="Negative") col.prop(tex, "use_stencil") - if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World): + if isinstance(idblock, Material) or isinstance(idblock, World): col.prop(tex, "default_value", text="DVar", slider=True) - if isinstance(idblock, bpy.types.Material): + if isinstance(idblock, Material): layout.label(text="Bump Mapping:") # only show bump settings if activated but not for normal-map images @@ -1063,7 +1071,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} _context_path = "texture" - _property_type = bpy.types.Texture + _property_type = Texture if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index b5e23f146b1..55c10a56015 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -117,7 +117,7 @@ class CLIP_PT_tools_marker(Panel): if settings.show_default_expanded: col = box.column() row = col.row(align=True) - label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label + label = CLIP_MT_tracking_settings_presets.bl_label row.menu('CLIP_MT_tracking_settings_presets', text=label) row.operator("clip.tracking_settings_preset_add", text="", icon='ZOOMIN') @@ -999,7 +999,7 @@ class CLIP_MT_camera_presets(Menu): bl_label = "Camera Presets" preset_subdir = "tracking_camera" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_track_color_presets(Menu): @@ -1007,7 +1007,7 @@ class CLIP_MT_track_color_presets(Menu): bl_label = "Color Presets" preset_subdir = "tracking_track_color" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_tracking_settings_presets(Menu): @@ -1015,7 +1015,7 @@ class CLIP_MT_tracking_settings_presets(Menu): bl_label = "Tracking Presets" preset_subdir = "tracking_settings" preset_operator = "script.execute_preset" - draw = bpy.types.Menu.draw_preset + draw = Menu.draw_preset class CLIP_MT_track_color_specials(Menu): diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 8d9b36a7f87..409494b5cbb 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -768,7 +768,7 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' -class IMAGE_UV_sculpt_curve(bpy.types.Panel): +class IMAGE_UV_sculpt_curve(Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' bl_label = "UV Sculpt Curve" |