Browse Source

Replace a slow string search with `isinstance`

pull/121/head
Adam Johnson 6 years ago
parent
commit
2b48c6dcc2
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 3
      korman/exporter/mesh.py

3
korman/exporter/mesh.py

@ -136,8 +136,9 @@ class _MeshManager:
# lightmap generation. The Blender Internal renderer does not seem to be smart enough to
# take this into account. Thus, we temporarily apply modifiers to ALL meshes (even ones that
# are not exported) such that we can generate proper lighting.
mesh_type = bpy.types.Mesh
for i in scene.objects:
if i.type == "MESH" and i.is_modified(scene, "RENDER"):
if isinstance(i.data, mesh_type) and i.is_modified(scene, "RENDER"):
# Remember, storing actual pointers to the Blender objects can cause bad things to
# happen because Blender's memory management SUCKS!
self._overrides[i.name] = { "mesh": i.data.name, "modifiers": [] }

Loading…
Cancel
Save