Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-02-01 08:27:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-02-01 08:27:49 +0300
commit58178763075a5a3e91c4d7ba53c4a1fceb5789b1 (patch)
treea40a4373720f4fa05f307fbeba045b1be38ce9d9 /release
parent8bc234cbff31ed1dfb8c4761e0be2226b9654fbf (diff)
fixed nieve use of type()..
type(foo) == type(list()) can be done as type(foo) == list:
Diffstat (limited to 'release')
-rw-r--r--release/scripts/bpymodules/BPyMesh.py15
-rw-r--r--release/scripts/lightwave_import.py6
2 files changed, 8 insertions, 13 deletions
diff --git a/release/scripts/bpymodules/BPyMesh.py b/release/scripts/bpymodules/BPyMesh.py
index 7eee04ecb35..91f0348549d 100644
--- a/release/scripts/bpymodules/BPyMesh.py
+++ b/release/scripts/bpymodules/BPyMesh.py
@@ -392,10 +392,10 @@ def getMeshFromObject(ob, container_mesh=None, apply_modifiers=True, vgroups=Tru
mesh.verts= None
- type = ob.type
+ ob_type = ob.type
dataname = ob.getData(1)
tempob= None
- if apply_modifiers or type != 'Mesh':
+ if apply_modifiers or ob_type != 'Mesh':
try:
mesh.getFromObject(ob)
except:
@@ -410,10 +410,11 @@ def getMeshFromObject(ob, container_mesh=None, apply_modifiers=True, vgroups=Tru
mesh.getFromObject(tempob)
scn.objects.unlink(tempob)
- if type == 'Mesh':
+ if ob_type == 'Mesh':
if vgroups:
if tempob==None:
tempob= Blender.Object.New('Mesh')
+
tempob.link(mesh)
try:
# Copy the influences if possible.
@@ -784,10 +785,6 @@ def getUvPixelLoc(face, pxLoc, img_size = None, uvArea = None):
return None
-type_tuple= type( (0,) )
-type_list= type( [] )
-
-
# Used for debugging ngon
"""
def draw_loops(loops):
@@ -867,7 +864,7 @@ def ngon(from_data, indices, PREF_FIX_LOOPS= True):
'''
Normal single concave loop filling
'''
- if type(from_data) in (type_tuple, type_list):
+ if type(from_data) in (tuple, list):
verts= [Vector(from_data[i]) for ii, i in enumerate(indices)]
else:
verts= [from_data.verts[i].co for ii, i in enumerate(indices)]
@@ -884,7 +881,7 @@ def ngon(from_data, indices, PREF_FIX_LOOPS= True):
This is used by lightwave LWO files a lot
'''
- if type(from_data) in (type_tuple, type_list):
+ if type(from_data) in (tuple, list):
verts= [vert_treplet(Vector(from_data[i]), ii) for ii, i in enumerate(indices)]
else:
verts= [vert_treplet(from_data.verts[i].co, ii) for ii, i in enumerate(indices)]
diff --git a/release/scripts/lightwave_import.py b/release/scripts/lightwave_import.py
index 0cf544e1744..b86ee2f732c 100644
--- a/release/scripts/lightwave_import.py
+++ b/release/scripts/lightwave_import.py
@@ -106,8 +106,6 @@ except:
# ===========================================================
textname = None
-type_list = type(list())
-type_dict = type(dict())
#uncomment the following line to enable logging facility to the named text object
#textname = "lwo_log"
@@ -187,9 +185,9 @@ class dotext:
def pprint(self, parg, where = _NO):
if parg == None:
self.pstring("_None_", where)
- elif type(parg) == type_list:
+ elif type(parg) == list:
self.plist(parg, where)
- elif type(parg) == type_dict:
+ elif type(parg) == dict:
self.pdict(parg, where)
else:
self.pstring(safestring(str(parg)), where)