pep/style edits & quiet some warnings
authorCampbell Barton <ideasman42@gmail.com>
Fri, 11 Nov 2011 03:28:46 +0000 (03:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 11 Nov 2011 03:28:46 +0000 (03:28 +0000)
25 files changed:
release/scripts/startup/bl_operators/uvcalc_follow_active.py
release/scripts/startup/bl_operators/uvcalc_lightmap.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_speaker.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_cloth.py
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_physics_smoke.py
release/scripts/startup/bl_ui/properties_physics_softbody.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_graph.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_time.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/pointcache.c
source/blender/editors/object/object_constraint.c

index 324414b8bcbded61b9b9739359bae35759194913..919677fff8b53369ec8fcb7e7626c58df5fd25b4 100644 (file)
@@ -233,10 +233,13 @@ class FollowActiveQuads(Operator):
     bl_label = "Follow Active Quads"
     bl_options = {'REGISTER', 'UNDO'}
 
-    mode = bpy.props.EnumProperty(items=(("EVEN", "Even", "Space all UVs evently"), ("LENGTH", "Length", "Average space UVs edge length of each loop")),
-                        name="Edge Length Mode",
-                        description="Method to space UV edge loops",
-                        default="LENGTH")
+    mode = bpy.props.EnumProperty(
+            name="Edge Length Mode",
+            description="Method to space UV edge loops",
+            items=(('EVEN', "Even", "Space all UVs evently"),
+                   ('LENGTH', "Length", "Average space UVs edge length of each loop")),
+            default='LENGTH',
+            )
 
     @classmethod
     def poll(cls, context):
index 525488176207efb24ed8ec9d6e756818779f2963..ae4add72a084454175208470abf48433324fbbd3 100644 (file)
@@ -552,9 +552,9 @@ class LightMapPack(Operator):
 
     PREF_CONTEXT = bpy.props.EnumProperty(
             name="Selection",
-            items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"),
-                   ("ALL_FACES", "All Faces", "Average space UVs edge length of each loop"),
-                   ("ALL_OBJECTS", "Selected Mesh Object", "Average space UVs edge length of each loop")
+            items=(('SEL_FACES', "Selected Faces", "Space all UVs evently"),
+                   ('ALL_FACES', "All Faces", "Average space UVs edge length of each loop"),
+                   ('ALL_OBJECTS', "Selected Mesh Object", "Average space UVs edge length of each loop")
                    ),
             )
 
index 5dadcba262160f659c6c35a6bf0faa377c282db2..d1bc0694a89104d7acea2a230f351dc91f70eb27 100644 (file)
@@ -71,7 +71,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
         flow.prop(arm, "use_deform_envelopes", text="Envelopes")
         flow.prop(arm, "use_deform_preserve_volume", text="Quaternion")
 
-        if context.scene.render.engine == "BLENDER_GAME":
+        if context.scene.render.engine == 'BLENDER_GAME':
             layout.row().prop(arm, "deform_method", expand=True)
 
 
@@ -289,7 +289,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
                 row.prop(itasc, "damping_max", text="Damp", slider=True)
                 row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
 
-from bl_ui.properties_animviz import (
+from .properties_animviz import (
     MotionPathButtonsPanel,
     OnionSkinButtonsPanel,
     )
index 1a0fb0ef4ac3efe3e3590654ad3b8de76ee0f3e7..1d7559b2cebae2222edab18a5b23de452f240adb 100644 (file)
@@ -18,7 +18,7 @@
 
 # <pep8 compliant>
 import bpy
-from bpy.types import Panel
+from bpy.types import Panel, Menu
 from rna_prop_ui import PropertyPanel
 
 
@@ -33,12 +33,12 @@ class CameraButtonsPanel():
         return context.camera and (engine in cls.COMPAT_ENGINES)
 
 
-class CAMERA_MT_presets(bpy.types.Menu):
+class CAMERA_MT_presets(Menu):
     bl_label = "Camera Presets"
     preset_subdir = "camera"
     preset_operator = "script.execute_preset"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class DATA_PT_context_camera(CameraButtonsPanel, Panel):
index a1b86b51f5ff2a1942b569feff12c1010e98b102..853c11c96c6384c29e92d80fc1a6d68eaeb7a744 100644 (file)
@@ -18,6 +18,7 @@
 
 # <pep8 compliant>
 import bpy
+from bpy.types import Panel
 from rna_prop_ui import PropertyPanel
 
 
@@ -32,7 +33,7 @@ class DataButtonsPanel():
         return context.speaker and (engine in cls.COMPAT_ENGINES)
 
 
-class DATA_PT_context_speaker(DataButtonsPanel, bpy.types.Panel):
+class DATA_PT_context_speaker(DataButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -52,7 +53,7 @@ class DATA_PT_context_speaker(DataButtonsPanel, bpy.types.Panel):
             split.template_ID(space, "pin_id")
 
 
-class DATA_PT_speaker(DataButtonsPanel, bpy.types.Panel):
+class DATA_PT_speaker(DataButtonsPanel, Panel):
     bl_label = "Sound"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -71,7 +72,7 @@ class DATA_PT_speaker(DataButtonsPanel, bpy.types.Panel):
         row.prop(speaker, "pitch")
 
 
-class DATA_PT_distance(DataButtonsPanel, bpy.types.Panel):
+class DATA_PT_distance(DataButtonsPanel, Panel):
     bl_label = "Distance"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -94,7 +95,7 @@ class DATA_PT_distance(DataButtonsPanel, bpy.types.Panel):
         col.prop(speaker, "distance_reference", text="Reference")
 
 
-class DATA_PT_cone(DataButtonsPanel, bpy.types.Panel):
+class DATA_PT_cone(DataButtonsPanel, Panel):
     bl_label = "Cone"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -116,7 +117,7 @@ class DATA_PT_cone(DataButtonsPanel, bpy.types.Panel):
         col.prop(speaker, "cone_volume_outer", text="Outer")
 
 
-class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
+class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
     _context_path = "object.data"
     _property_type = bpy.types.Speaker
index ba9bb4a624d63db3d172c69e1cc73e39d8b8372c..877b6c0893d9423b243683696a3255cf3be67644 100644 (file)
@@ -406,7 +406,7 @@ class SceneButtonsPanel():
     bl_context = "scene"
 
 
-class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel):
+class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
     bl_label = "Navigation mesh"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_GAME'}
index f5a95016baaa26eca56c964311c32f616e7b6315..6e66bd0d98bf2f5e6842be8dbf8c0e6a82afdb21 100644 (file)
@@ -612,7 +612,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
         col.prop(halo, "flare_subflare_size", text="Subsize")
 
 
-class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
+class MATERIAL_PT_game_settings(MaterialButtonsPanel, Panel):
     bl_label = "Game Settings"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -637,7 +637,7 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
         row.prop(game, "face_orientation", text="")
 
 
-class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
+class MATERIAL_PT_physics(MaterialButtonsPanel, Panel):
     bl_label = "Physics"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
index 36b8129ad8a6692ad0577cb4d597c36aea6fa6f7..27b6aa721a4d6a81b4fe7a2274265b48c5f81b2e 100644 (file)
@@ -280,7 +280,7 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
         row.prop(ob, "slow_parent_offset", text="Offset")
 
 
-from bl_ui.properties_animviz import (
+from .properties_animviz import (
     MotionPathButtonsPanel,
     OnionSkinButtonsPanel,
     )
index c493124c5bbfc1797d0e9fc024eb2adbb60f09b2..508818b62dc63d41d837ca72e5f4ee7a3a22bfbd 100644 (file)
@@ -131,7 +131,7 @@ class ConstraintButtonsPanel():
         self.space_template(layout, con)
 
     def IK(self, context, layout, con):
-        if context.object.pose.ik_solver == "ITASC":
+        if context.object.pose.ik_solver == 'ITASC':
             layout.prop(con, "ik_type")
             getattr(self, 'IK_' + con.ik_type)(context, layout, con)
         else:
index 2216d2b2170cba4ed55cad9b04d7bb8f369cd336..a541f43be66a52fa26a038d53c626b641b5616b1 100644 (file)
@@ -21,7 +21,7 @@ import bpy
 from bpy.types import Panel
 from rna_prop_ui import PropertyPanel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     point_cache_ui,
     effector_weights_ui,
     basic_force_field_settings_ui,
@@ -76,21 +76,15 @@ class ParticleButtonsPanel():
 class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     @classmethod
     def poll(cls, context):
         engine = context.scene.render.engine
-        return (context.particle_system or context.object or context.space_data.pin_id)# and (engine in cls.COMPAT_ENGINES)
+        return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
-        
-        if context.scene.render.engine == "BLENDER_GAME":
-            layout.label("The Blender particle system is")
-            layout.label("not available for use in the")
-            layout.label("Blender Game Engine")
-            return
 
         ob = context.object
         psys = context.particle_system
index 490b510587d8d411eecd8b82bef6dd2c7c6afff6..32b9450452573e4d21fa36fc52d3eb1c09f1824c 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from bpy.types import Menu, Panel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     point_cache_ui,
     effector_weights_ui,
     )
index f4bea3b4a52312912007523f6f4f7a2c08f6b1cd..f03d4793be0da166db168d57e548db02863e3dcd 100644 (file)
 # ##### END GPL LICENSE BLOCK #####
 
 # <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     point_cache_ui,
     effector_weights_ui,
     )
 
+
 class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -33,10 +36,10 @@ class PhysicButtonsPanel():
     def poll(cls, context):
         ob = context.object
         rd = context.scene.render
-        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.dynamic_paint)
+        return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and context.dynamic_paint
 
 
-class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
+class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint"
 
     def draw(self, context):
@@ -47,14 +50,14 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
 
         layout.prop(md, "ui_type", expand=True)
 
-        if (md.ui_type == "CANVAS"):
+        if md.ui_type == 'CANVAS':
             canvas = md.canvas_settings
-            
-            if (not canvas):
+
+            if canvas is None:
                 layout.operator("dpaint.type_toggle", text="Add Canvas").type = 'CANVAS'
             else:
                 layout.operator("dpaint.type_toggle", text="Remove Canvas", icon='X').type = 'CANVAS'
-                
+
                 surface = canvas.canvas_surfaces.active
 
                 row = layout.row()
@@ -63,32 +66,32 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
                 col = row.column(align=True)
                 col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")
                 col.operator("dpaint.surface_slot_remove", icon='ZOOMOUT', text="")
-                
+
                 if surface:
                     layout.prop(surface, "name")
                     layout.prop(surface, "surface_format")
-                    
+
                     col = layout.column()
-                    if surface.surface_format != "VERTEX":
+                    if surface.surface_format != 'VERTEX':
                         col.label(text="Quality:")
                         col.prop(surface, "image_resolution")
                     col.prop(surface, "use_antialiasing")
-                
+
                     col = layout.column()
                     col.label(text="Frames:")
                     split = col.split()
-                
+
                     col = split.column(align=True)
                     col.prop(surface, "frame_start", text="Start")
                     col.prop(surface, "frame_end", text="End")
-                
+
                     split.prop(surface, "frame_substeps")
 
-        elif (md.ui_type == "BRUSH"):
+        elif md.ui_type == 'BRUSH':
             brush = md.brush_settings
             engine = context.scene.render.engine
-            
-            if (not brush):
+
+            if brush is None:
                 layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH'
             else:
                 layout.operator("dpaint.type_toggle", text="Remove Brush", icon='X').type = 'BRUSH'
@@ -99,13 +102,13 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
                 col.prop(brush, "absolute_alpha")
                 col.prop(brush, "paint_erase")
                 col.prop(brush, "paint_wetness", text="Wetness")
-            
+
                 col = split.column()
-                if (engine == 'BLENDER_RENDER'):
+                if engine == 'BLENDER_RENDER':
                     sub = col.column()
-                    sub.active = (brush.paint_source != "PARTICLE_SYSTEM");
+                    sub.active = (brush.paint_source != 'PARTICLE_SYSTEM')
                     sub.prop(brush, "use_material")
-                if brush.use_material and brush.paint_source != "PARTICLE_SYSTEM" and (engine == 'BLENDER_RENDER'):
+                if brush.use_material and brush.paint_source != 'PARTICLE_SYSTEM' and engine == 'BLENDER_RENDER':
                     col.prop(brush, "material", text="")
                     col.prop(brush, "paint_alpha", text="Alpha Factor")
                 else:
@@ -113,13 +116,13 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, bpy.types.Panel):
                     col.prop(brush, "paint_alpha", text="Alpha")
 
 
-class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
+class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Advanced"
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.ui_type == "CANVAS") and (md.canvas_settings) and (md.canvas_settings.canvas_surfaces.active)
+        return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active
 
     def draw(self, context):
         layout = self.layout
@@ -128,23 +131,25 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
         surface = canvas.canvas_surfaces.active
         ob = context.object
 
+        surface_type = surface.surface_type
+
         layout.prop(surface, "surface_type")
         layout.separator()
 
         # dissolve
-        if (surface.surface_type == "PAINT"):
+        if surface_type == 'PAINT':
             split = layout.split(percentage=0.35)
             split.label(text="Wetmap drying:")
-            
+
             col = split.column()
             split = col.split(percentage=0.7)
             split.prop(surface, "dry_speed", text="Time")
             split.prop(surface, "use_dry_log", text="Slow")
-            
-        if (surface.surface_type != "WAVE"):
+
+        if surface_type != 'WAVE':
             split = layout.split(percentage=0.35)
             col = split.column()
-            if (surface.surface_type == "WEIGHT"):
+            if surface_type == 'WEIGHT':
                 col.prop(surface, "use_dissolve", text="Fade:")
             else:
                 col.prop(surface, "use_dissolve", text="Dissolve:")
@@ -153,42 +158,43 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, bpy.types.Panel):
             split = col.split(percentage=0.7)
             split.prop(surface, "dissolve_speed", text="Time")
             split.prop(surface, "use_dissolve_log", text="Slow")
-        
+
         # per type settings
-        if (surface.surface_type == "DISPLACE"):
+        if surface_type == 'DISPLACE':
             layout.prop(surface, "use_incremental_displace")
-            if (surface.surface_format == "VERTEX"):
+            if surface.surface_format == 'VERTEX':
                 row = layout.row()
                 row.prop(surface, "depth_clamp")
                 row.prop(surface, "displace_factor")
-            
-        if (surface.surface_type == "WAVE"):
+
+        elif surface_type == 'WAVE':
             layout.prop(surface, "wave_open_borders")
-            
+
             split = layout.split()
-            
+
             col = split.column(align=True)
             col.prop(surface, "wave_timescale")
             col.prop(surface, "wave_speed")
-            
+
             col = split.column(align=True)
             col.prop(surface, "wave_damping")
             col.prop(surface, "wave_spring")
-            
+
         layout.separator()
         layout.prop(surface, "brush_group", text="Brush Group")
 
-class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
+
+class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Output"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))):
+        if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
             return 0
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
-        return (surface and not (surface.surface_format=="VERTEX" and (surface.surface_type=="DISPLACE" or surface.surface_type=="WAVE")))
+        return surface and not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))
 
     def draw(self, context):
         layout = self.layout
@@ -196,37 +202,39 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
         canvas = context.dynamic_paint.canvas_settings
         surface = canvas.canvas_surfaces.active
         ob = context.object
-        
+
+        surface_type = surface.surface_type
+
         # vertex format outputs
-        if (surface.surface_format == "VERTEX"):
-            if (surface.surface_type == "PAINT"):
+        if surface.surface_format == 'VERTEX':
+            if surface_type == 'PAINT':
                  # toggle active preview
                 layout.prop(surface, "preview_id")
-                
+
                 # paintmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name", ob.data, "vertex_colors", text="Paintmap layer: ")
-                if (surface.output_exists(object=ob, index=0)):
+                if surface.output_exists(object=ob, index=0):
                     ic = 'ZOOMOUT'
                 else:
                     ic = 'ZOOMIN'
-                
+
                 row.operator("dpaint.output_toggle", icon=ic, text="").index = 0
-                
+
                 # wetmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name2", ob.data, "vertex_colors", text="Wetmap layer: ")
-                if (surface.output_exists(object=ob, index=1)):
+                if surface.output_exists(object=ob, index=1):
                     ic = 'ZOOMOUT'
                 else:
                     ic = 'ZOOMIN'
+
                 row.operator("dpaint.output_toggle", icon=ic, text="").index = 1
-                
-            elif (surface.surface_type == "WEIGHT"):
+
+            elif surface_type == 'WEIGHT':
                 row = layout.row()
                 row.prop_search(surface, "output_name", ob, "vertex_groups", text="Vertex Group: ")
-                if (surface.output_exists(object=ob, index=0)):
+                if surface.output_exists(object=ob, index=0):
                     ic = 'ZOOMOUT'
                 else:
                     ic = 'ZOOMIN'
@@ -234,23 +242,23 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
                 row.operator("dpaint.output_toggle", icon=ic, text="").index = 0
 
         # image format outputs
-        if (surface.surface_format == "IMAGE"):
+        if surface.surface_format == 'IMAGE':
             layout.operator("dpaint.bake", text="Bake Image Sequence", icon='MOD_DYNAMICPAINT')
             layout.prop_search(surface, "uv_layer", ob.data, "uv_textures", text="UV layer:")
             layout.separator()
-            
+
             layout.prop(surface, "image_output_path", text="")
             row = layout.row()
             row.prop(surface, "image_fileformat", text="")
             row.prop(surface, "premultiply", text="Premultiply alpha")
-            
-            if (surface.surface_type == "PAINT"):
+
+            if surface_type == 'PAINT':
                 split = layout.split(percentage=0.4)
                 split.prop(surface, "do_output1", text="Paintmaps:")
                 sub = split.row()
                 sub.active = surface.do_output1
                 sub.prop(surface, "output_name", text="")
-                
+
                 split = layout.split(percentage=0.4)
                 split.prop(surface, "do_output2", text="Wetmaps:")
                 sub = split.row()
@@ -259,23 +267,24 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, bpy.types.Panel):
             else:
                 col = layout.column()
                 col.prop(surface, "output_name", text="Filename: ")
-                if (surface.surface_type == "DISPLACE"):
+                if surface_type == 'DISPLACE':
                     col.prop(surface, "displace_type", text="Displace Type")
                     col.prop(surface, "depth_clamp")
-                elif (surface.surface_type == "WAVE"):
+                elif surface_type == 'WAVE':
                     col.prop(surface, "depth_clamp", text="Wave Clamp")
 
-class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
+
+class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Initial Color"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))):
+        if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
             return 0
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
-        return (surface and surface.surface_type=="PAINT")
+        return (surface and surface.surface_type == 'PAINT')
 
     def draw(self, context):
         layout = self.layout
@@ -288,27 +297,28 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, bpy.types.Panel):
         layout.separator()
 
         # dissolve
-        if (surface.init_color_type == "COLOR"):
+        if surface.init_color_type == 'COLOR':
             layout.prop(surface, "init_color")
-            
-        elif (surface.init_color_type == "TEXTURE"):
+
+        elif surface.init_color_type == 'TEXTURE':
             layout.prop(surface, "init_texture")
             layout.prop_search(surface, "init_layername", ob.data, "uv_textures", text="UV Layer:")
-        
-        elif (surface.init_color_type == "VERTEX_COLOR"):
+
+        elif surface.init_color_type == 'VERTEX_COLOR':
             layout.prop_search(surface, "init_layername", ob.data, "vertex_colors", text="Color Layer: ")
 
-class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
+
+class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Effects"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        if (not (md and (md.ui_type == "CANVAS") and (md.canvas_settings))):
-            return False;
+        if not (md and md.ui_type == 'CANVAS' and md.canvas_settings):
+            return False
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
-        return surface and (surface.surface_type == "PAINT")
+        return (surface and surface.surface_type == 'PAINT')
 
     def draw(self, context):
         layout = self.layout
@@ -318,17 +328,17 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
 
         layout.prop(surface, "effect_ui", expand=True)
 
-        if surface.effect_ui == "SPREAD":
+        if surface.effect_ui == 'SPREAD':
             layout.prop(surface, "use_spread")
-            
+
             row = layout.row()
             row.active = surface.use_spread
             row.prop(surface, "spread_speed")
             row.prop(surface, "color_spread_speed")
 
-        elif surface.effect_ui == "DRIP":
+        elif surface.effect_ui == 'DRIP':
             layout.prop(surface, "use_drip")
-            
+
             col = layout.column()
             col.active = surface.use_drip
             effector_weights_ui(self, context, surface.effector_weights)
@@ -338,52 +348,55 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, bpy.types.Panel):
             row.prop(surface, "drip_velocity", slider=True)
             row.prop(surface, "drip_acceleration", slider=True)
 
-        elif surface.effect_ui == "SHRINK":
+        elif surface.effect_ui == 'SHRINK':
             layout.prop(surface, "use_shrink")
-            
+
             row = layout.row()
             row.active = surface.use_shrink
             row.prop(surface, "shrink_speed")
-                       
 
-class PHYSICS_PT_dp_cache(PhysicButtonsPanel, bpy.types.Panel):
+
+class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Cache"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.ui_type == "CANVAS") and (md.canvas_settings) and \
-        (md.canvas_settings.canvas_surfaces.active) and (md.canvas_settings.canvas_surfaces.active.uses_cache)
+        return (md and
+                md.ui_type == 'CANVAS' and
+                md.canvas_settings and
+                md.canvas_settings.canvas_surfaces.active and
+                md.canvas_settings.canvas_surfaces.active.uses_cache)
 
     def draw(self, context):
         layout = self.layout
 
         surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
         cache = surface.point_cache
-        
+
         point_cache_ui(self, context, cache, (cache.is_baked is False), 'DYNAMIC_PAINT')
 
 
-class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel):
+class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Source"
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.ui_type == "BRUSH") and (md.brush_settings)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings
 
     def draw(self, context):
         layout = self.layout
 
         brush = context.dynamic_paint.brush_settings
         ob = context.object
-               
+
         split = layout.split()
         col = split.column()
         col.prop(brush, "paint_source")
 
-        if brush.paint_source == "PARTICLE_SYSTEM":
+        if brush.paint_source == 'PARTICLE_SYSTEM':
             col.prop_search(brush, "particle_system", ob, "particle_systems", text="")
             if brush.particle_system:
                 col.label(text="Particle effect:")
@@ -392,84 +405,87 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, bpy.types.Panel):
                 sub.prop(brush, "solid_radius", text="Solid Radius")
                 col.prop(brush, "use_particle_radius", text="Use Particle's Radius")
                 col.prop(brush, "smooth_radius", text="Smooth radius")
-                
+
         if brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'}:
             col.prop(brush, "paint_distance", text="Paint Distance")
             split = layout.row().split(percentage=0.4)
             sub = split.column()
             if brush.paint_source == 'DISTANCE':
                 sub.prop(brush, "proximity_project")
-            elif brush.paint_source == "VOLUME_DISTANCE":
+            elif brush.paint_source == 'VOLUME_DISTANCE':
                 sub.prop(brush, "proximity_inverse")
-                
+
             sub = split.column()
             if brush.paint_source == 'DISTANCE':
                 column = sub.column()
                 column.active = brush.proximity_project
                 column.prop(brush, "ray_direction")
             sub.prop(brush, "proximity_falloff")
-            if brush.proximity_falloff == "RAMP":
+            if brush.proximity_falloff == 'RAMP':
                 col = layout.row().column()
                 col.separator()
                 col.prop(brush, "proximity_ramp_alpha", text="Only Use Alpha")
                 col.template_color_ramp(brush, "paint_ramp", expand=True)
-                
-class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, bpy.types.Panel):
+
+
+class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Velocity"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.ui_type == "BRUSH") and (md.brush_settings)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings
 
     def draw(self, context):
         layout = self.layout
 
         brush = context.dynamic_paint.brush_settings
         ob = context.object
-               
+
         split = layout.split()
-        
+
         col = split.column()
         col.prop(brush, "velocity_alpha")
         col.prop(brush, "velocity_color")
-        
+
         split.prop(brush, "velocity_depth")
-        
+
         col = layout.column()
         col.active = (brush.velocity_alpha or brush.velocity_color or brush.velocity_depth)
         col.prop(brush, "max_velocity")
         col.template_color_ramp(brush, "velocity_ramp", expand=True)
         layout.separator()
-        
+
         row = layout.row()
         row.prop(brush, "do_smudge")
         sub = row.row()
         sub.active = brush.do_smudge
         sub.prop(brush, "smudge_strength")
-        
-class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, bpy.types.Panel):
+
+
+class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
     bl_label = "Dynamic Paint Waves"
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
         md = context.dynamic_paint
-        return md and (md.ui_type == "BRUSH") and (md.brush_settings)
+        return md and md.ui_type == 'BRUSH' and md.brush_settings
 
     def draw(self, context):
         layout = self.layout
 
         brush = context.dynamic_paint.brush_settings
         ob = context.object
-               
+
         layout.prop(brush, "wave_type")
-        if (brush.wave_type != "REFLECT"):
+        if brush.wave_type != 'REFLECT':
             row = layout.row()
             row.prop(brush, "wave_factor")
             row.prop(brush, "wave_clamp")
 
+
 def register():
     bpy.utils.register_module(__name__)
 
index 2229b9dc3dab244bc5f8ec0656eebb8d99541724..bc7f330a546c6019b2f5c3ccbd2c11f0b89c6b13 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from bpy.types import Panel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     basic_force_field_settings_ui,
     basic_force_field_falloff_ui,
     )
index 9f760f2f0243c5cd1afa71ed457f2bcd81b25ae4..4c413647210a5e53eac8ccc8fd42edc04feee1ea 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from bpy.types import Panel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     point_cache_ui,
     effector_weights_ui,
     )
index ea4180c891f2fa7529015788ddbfd840e731e7f6..78c74a7e1d314037e1e5cc7fbd58ac8ecf48f256 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from bpy.types import Panel
 
-from bl_ui.properties_physics_common import (
+from .properties_physics_common import (
     point_cache_ui,
     effector_weights_ui,
     )
index 73947c21a80f85aa03430582e860c1b42d0f6a68..9ba0309aacd42a1a88e70bd13f7c6fa0bdb9b5c5 100644 (file)
@@ -44,7 +44,7 @@ class TEXTURE_MT_envmap_specials(Menu):
         layout.operator("texture.envmap_clear", icon='FILE_REFRESH')
         layout.operator("texture.envmap_clear_all", icon='FILE_REFRESH')
 
-from bl_ui.properties_material import active_node_mat
+from .properties_material import active_node_mat
 
 
 def context_tex_datablock(context):
@@ -726,7 +726,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
         col.prop(pd, "falloff", text="")
         if pd.falloff == 'SOFT':
             col.prop(pd, "falloff_soft")
-        if pd.falloff == "PARTICLE_VELOCITY":
+        if pd.falloff == 'PARTICLE_VELOCITY':
             col.prop(pd, "falloff_speed_scale")
 
         col.prop(pd, "use_falloff_curve")
index b57d421dfaf44d36c0c9b26d787f9aff6ea64982..5f7462ce44eb96d5e11ea3ae8780a76a7ae3a0be 100644 (file)
@@ -26,7 +26,7 @@ class GRAPH_HT_header(Header):
     bl_space_type = 'GRAPH_EDITOR'
 
     def draw(self, context):
-        from bl_ui.space_dopesheet import dopesheet_filter
+        from .space_dopesheet import dopesheet_filter
 
         layout = self.layout
 
index 170ba3ccd0ed85b73ae136dd8fc276bab222eb5d..81526797109e4d2526a31a78ac22cdc424724d71 100644 (file)
@@ -312,19 +312,19 @@ class IMAGE_MT_uvs_select_mode(Menu):
 
         else:
             prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
-            prop.value = "VERTEX"
+            prop.value = 'VERTEX'
             prop.data_path = "tool_settings.uv_select_mode"
 
             prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
-            prop.value = "EDGE"
+            prop.value = 'EDGE'
             prop.data_path = "tool_settings.uv_select_mode"
 
             prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
-            prop.value = "FACE"
+            prop.value = 'FACE'
             prop.data_path = "tool_settings.uv_select_mode"
 
             prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
-            prop.value = "ISLAND"
+            prop.value = 'ISLAND'
             prop.data_path = "tool_settings.uv_select_mode"
 
 
index c878c20c8a71413eb41042e04894413e999cba75..59057166ec4e6f069df4aa88abce0197831087c8 100644 (file)
@@ -26,7 +26,7 @@ class NLA_HT_header(Header):
     bl_space_type = 'NLA_EDITOR'
 
     def draw(self, context):
-        from bl_ui.space_dopesheet import dopesheet_filter
+        from .space_dopesheet import dopesheet_filter
 
         layout = self.layout
 
index a4dcf64b679f1db3524aba084d4b24a4ea1b26a9..c1c9bc12b2df04c4d1ca249e37faa6c849ffd4e8 100644 (file)
@@ -456,7 +456,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         elif strip.type == 'TRANSFORM':
             self.draw_panel_transform(strip)
 
-        elif strip.type == "MULTICAM":
+        elif strip.type == 'MULTICAM':
             layout.prop(strip, "multicam_source")
 
             row = layout.row(align=True)
index 0ce2df0e47e2199bbb8a948e02e2a0b4509df12f..72818dfc64217ef6a4954d7d71a8b54217f5e0ed 100644 (file)
@@ -92,7 +92,7 @@ class TIME_HT_header(Header):
         row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
 
 
-class TIME_MT_marker(bpy.types.Menu):
+class TIME_MT_marker(Menu):
     bl_label = "Marker"
 
     def draw(self, context):
index a2ede26ecc628d1e499b985acd2cb0504e66654a..51f55fe019ca087a57177c9d195d963247b1d81b 100644 (file)
@@ -743,7 +743,7 @@ class USERPREF_PT_file(Panel):
         sub.active = paths.use_auto_save_temporary_files
         sub.prop(paths, "auto_save_time", text="Timer (mins)")
 
-from bl_ui.space_userpref_keymap import InputKeyMapPanel
+from .space_userpref_keymap import InputKeyMapPanel
 
 
 class USERPREF_MT_ndof_settings(Menu):
index 2d3be2015d76ca37aa1f0429f318e307b7a92166..9ca542103ad952a91662e869c264818643fff084 100644 (file)
@@ -1537,10 +1537,10 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
     bl_label = "Extrude"
 
     _extrude_funcs = {
-        "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
-        "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
-        "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
-        "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
+        'VERT': lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
+        'EDGE': lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
+        'FACE': lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
+        'REGION': lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
     }
 
     @staticmethod
@@ -1550,11 +1550,11 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
 
         menu = []
         if mesh.total_face_sel:
-            menu += ["REGION", "FACE"]
+            menu += ['REGION', 'FACE']
         if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
-            menu += ["EDGE"]
+            menu += ['EDGE']
         if mesh.total_vert_sel and select_mode[0]:
-            menu += ["VERT"]
+            menu += ['VERT']
 
         # should never get here
         return menu
index 9b094d7f1f6112dd24172d5e4e5d25c82126643f..a9aeb37e478fd1881b23862777d58ddc72c19760 100644 (file)
@@ -656,7 +656,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
        return 1;
 }
 #else // WITH_SMOKE
-static int  ptcache_smoke_totpoint(void *UNUSED(smoke_v), int UNUSED(cfra)) { return 0; };
+static int  ptcache_smoke_totpoint(void *UNUSED(smoke_v), int UNUSED(cfra)) { return 0; }
 static int  ptcache_smoke_read(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) { return 0; }
 static int  ptcache_smoke_write(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) { return 0; }
 #endif // WITH_SMOKE
@@ -677,7 +677,7 @@ static int  ptcache_dynamicpaint_write(PTCacheFile *pf, void *dp_v)
        int cache_compress = 1;
 
        /* version header */
-       ptcache_file_write(pf, (void *)DPAINT_CACHE_VERSION, 1, sizeof(char)*4);
+       ptcache_file_write(pf, DPAINT_CACHE_VERSION, 1, sizeof(char)*4);
 
        if(surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
                int total_points=surface->data->total_points;
index 991ed0ebd5135330c89d6e20822a1cf4bae6bdc5..0fbf5a8bd92a495864d25d2856d0a95539b39745 100644 (file)
@@ -736,7 +736,7 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op)
                where_is_pose(scene, ob);
        }
        else if (ob) {
-               Object workob = {0};
+               Object workob = {{0}};
                
                /* use what_does_parent to find inverse - just like for normal parenting */
                what_does_parent(scene, ob, &workob);