From f54bba5a7c60c9bde077521ddff9933ac69807d8 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 20 Jun 2016 19:52:32 -0400 Subject: [PATCH] Only hide meshes (not lamps -- OOPS!) --- korman/exporter/etlight.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/korman/exporter/etlight.py b/korman/exporter/etlight.py index 678c0fe..34d76d3 100644 --- a/korman/exporter/etlight.py +++ b/korman/exporter/etlight.py @@ -163,10 +163,7 @@ class LightBaker: return None def _has_valid_material(self, bo): - data = bo.data - if data is None or not isinstance(data, bpy.types.Mesh): - return False - for material in data.materials: + for material in bo.data.materials: if material is not None: return True return False @@ -321,14 +318,14 @@ class LightBaker: toggle.track(objs, "hide_render", False) for i in bpy.data.objects: i.select = i == objs - if not self._has_valid_material(i): + if isinstance(i.data, bpy.types.Mesh) and not self._has_valid_material(i): toggle.track(i, "hide_render", True) else: for i in bpy.data.objects: value = i in objs if value: toggle.track(i, "hide_render", False) - elif not self._has_valid_material(i): + elif isinstance(i.data, bpy.types.Mesh) and not self._has_valid_material(i): toggle.track(i, "hide_render", True) i.select = value