diff options
author | Thomas Larsson <thomas_larsson_01@hotmail.com> | 2012-04-30 07:20:17 +0400 |
---|---|---|
committer | Thomas Larsson <thomas_larsson_01@hotmail.com> | 2012-04-30 07:20:17 +0400 |
commit | 34007f1431cadabee0400f6a80bdf3185d493de2 (patch) | |
tree | d32b65993fba6bf78ec43388748dc149cb5a879a /io_import_scene_mhx.py | |
parent | ea861fa5f4578f2104009af6bd77837fd5b578ff (diff) |
BMesh check made to work even if bpy.app.build_revision is unknown.
Diffstat (limited to 'io_import_scene_mhx.py')
-rw-r--r-- | io_import_scene_mhx.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py index 5c9b84de..c5497923 100644 --- a/io_import_scene_mhx.py +++ b/io_import_scene_mhx.py @@ -194,10 +194,9 @@ Plural = { # def readMhxFile(filePath): - global todo, nErrors, theScale, defaultScale, One, toggle, warnedVersion, BMeshAware, theMessage + global todo, nErrors, theScale, defaultScale, One, toggle, warnedVersion, theMessage print("Blender r%s" % bpy.app.build_revision) - BMeshAware = (int(bpy.app.build_revision) > 44136) defaultScale = theScale One = 1.0/theScale warnedVersion = False @@ -1191,7 +1190,7 @@ def unpackList(list_of_tuples): # def parseMesh (args, tokens): - global todo + global todo, BMeshAware if verbosity > 2: print( "Parsing mesh %s" % args ) @@ -1220,6 +1219,15 @@ def parseMesh (args, tokens): me.from_pydata(verts, edges, []) me.update() linkObject(ob, me) + + if faces: + try: + me.polygons + BMeshAware = True + print("Using BMesh") + except: + BMeshAware = False + print("Not using BMesh") mats = [] nuvlayers = 0 |