Cleanup: tabs to spaces

This commit is contained in:
Campbell Barton 2016-05-01 13:27:59 +10:00
parent 59ea4fc9f1
commit 1b1aaf3e25
5 changed files with 46 additions and 45 deletions

View File

@ -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)

View File

@ -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

View File

@ -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()
}
}

View File

@ -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)
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():
bpy.ops.wm.append(
filepath=opath,
filename=obname,
directory=dpath,
filemode=1,
link=False,
autoselect=True,
active_layer=True,
instance_groups=True)
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)
for ob in bpy.context.selected_objects:
ob.location = bpy.context.scene.cursor_location
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):

View File

@ -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: