From 2b48c6dcc232d2cb130ef6d9c7dfcf8fff9ba301 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 2 Sep 2018 21:34:42 -0400 Subject: [PATCH] Replace a slow string search with `isinstance` --- korman/exporter/mesh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/korman/exporter/mesh.py b/korman/exporter/mesh.py index df7752c..b3ea7b9 100644 --- a/korman/exporter/mesh.py +++ b/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": [] }