From 1b1aaf3e250e61768c8f7e8695392bbd3d86933e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 May 2016 13:27:59 +1000 Subject: Cleanup: tabs to spaces --- add_mesh_extra_objects/add_mesh_supertoroid.py | 5 ++- io_mesh_pdb/import_pdb.py | 2 +- netrender/balancing.py | 15 ++++--- object_fracture/fracture_ops.py | 60 +++++++++++++------------- space_view3d_materials_utils.py | 13 +++--- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/add_mesh_extra_objects/add_mesh_supertoroid.py b/add_mesh_extra_objects/add_mesh_supertoroid.py index 895281e1..4728acec 100644 --- a/add_mesh_extra_objects/add_mesh_supertoroid.py +++ b/add_mesh_extra_objects/add_mesh_supertoroid.py @@ -23,7 +23,7 @@ def create_mesh_object(context, verts, edges, faces, name): from bpy_extras import object_utils return object_utils.object_data_add(context, mesh, operator=None) - + # A very simple "bridge" tool. def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): @@ -80,7 +80,8 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): faces.append(face) return faces - + + def power(a,b): if a < 0: return -((-a)**b) diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py index 5fb5890a..3ca3b51f 100644 --- a/io_mesh_pdb/import_pdb.py +++ b/io_mesh_pdb/import_pdb.py @@ -1036,7 +1036,7 @@ def draw_sticks_normal(all_atoms, list_group_sub = [] counter = 0 for stick in all_sticks: - + # The vectors of the two atoms atom1 = all_atoms[stick.atom1-1].location-center atom2 = all_atoms[stick.atom2-1].location-center diff --git a/netrender/balancing.py b/netrender/balancing.py index ee347452..b6531604 100644 --- a/netrender/balancing.py +++ b/netrender/balancing.py @@ -125,7 +125,8 @@ class RatingUsage(RatingRule): "descritpiton":str(self), "limit":"", "id":self.id() - } + } + class RatingUsageByCategory(RatingRule): def __init__(self, get_jobs): @@ -149,7 +150,7 @@ class RatingUsageByCategory(RatingRule): "descritpiton":str(self), "limit":"", "id":self.id() - } + } class NewJobPriority(PriorityRule): @@ -176,7 +177,7 @@ class NewJobPriority(PriorityRule): "limit": self.limit, "limit_str":self.str_limit(), "id":self.id() - } + } class MinimumTimeBetweenDispatchPriority(PriorityRule): def __init__(self, limit = 10): @@ -203,8 +204,7 @@ class MinimumTimeBetweenDispatchPriority(PriorityRule): "limit": self.limit, "limit_str":self.str_limit(), "id":self.id() - - } + } class ExcludeQueuedEmptyJob(ExclusionRule): def __init__(self): @@ -224,7 +224,8 @@ class ExcludeQueuedEmptyJob(ExclusionRule): "limit": "", "limit_str":"", "id":self.id() - } + } + class ExcludeSlavesLimit(ExclusionRule): def __init__(self, count_jobs, count_slaves, limit = 0.75): @@ -253,4 +254,4 @@ class ExcludeSlavesLimit(ExclusionRule): "limit": self.limit, "limit_str":self.str_limit(), "id":self.id() - } + } diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 69ec3202..f5687e3a 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -437,36 +437,36 @@ class FractureGroup(bpy.types.Operator): # Import Functions def import_object(obname): - opath = "//data.blend\\Object\\" + obname - s = os.sep - #dpath = bpy.utils.script_paths()[0] + \ - # '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) - dpath='' - fpath='' - for p in bpy.utils.script_paths(): - - testfname= p + '%saddons%sobject_fracture%sdata.blend' % (s,s,s) - print(testfname) - if os.path.isfile(testfname): - fname=testfname - dpath = p + \ - '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) - break - # DEBUG - #print('import_object: ' + opath) - - bpy.ops.wm.append( - filepath=opath, - filename=obname, - directory=dpath, - filemode=1, - link=False, - autoselect=True, - active_layer=True, - instance_groups=True) - - for ob in bpy.context.selected_objects: - ob.location = bpy.context.scene.cursor_location + opath = "//data.blend\\Object\\" + obname + s = os.sep + #dpath = bpy.utils.script_paths()[0] + \ + # '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) + dpath='' + fpath='' + for p in bpy.utils.script_paths(): + + testfname= p + '%saddons%sobject_fracture%sdata.blend' % (s,s,s) + print(testfname) + if os.path.isfile(testfname): + fname=testfname + dpath = p + \ + '%saddons%sobject_fracture%sdata.blend\\Object\\' % (s, s, s) + break + # DEBUG + #print('import_object: ' + opath) + + bpy.ops.wm.append( + filepath=opath, + filename=obname, + directory=dpath, + filemode=1, + link=False, + autoselect=True, + active_layer=True, + instance_groups=True) + + for ob in bpy.context.selected_objects: + ob.location = bpy.context.scene.cursor_location class ImportFractureRecorder(bpy.types.Operator): diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py index 06dc6826..0e80e9f9 100644 --- a/space_view3d_materials_utils.py +++ b/space_view3d_materials_utils.py @@ -544,14 +544,13 @@ def texface_to_mat(): bpy.ops.object.mode_set(mode='EDIT') def remove_materials(): + for ob in bpy.data.objects: + try: + bpy.ops.object.material_slot_remove() + print ("removed material from " + ob.name) + except: + print (ob.name + " does not have materials.") - for ob in bpy.data.objects: - print (ob.name) - try: - bpy.ops.object.material_slot_remove() - print ("removed material from " + ob.name) - except: - print (ob.name + " does not have materials.") # ----------------------------------------------------------------------------- # operator classes: -- cgit v1.2.3