Browse Source

Only hide meshes (not lamps -- OOPS!)

pull/38/head
Adam Johnson 9 years ago
parent
commit
f54bba5a7c
  1. 9
      korman/exporter/etlight.py

9
korman/exporter/etlight.py

@ -163,10 +163,7 @@ class LightBaker:
return None return None
def _has_valid_material(self, bo): def _has_valid_material(self, bo):
data = bo.data for material in bo.data.materials:
if data is None or not isinstance(data, bpy.types.Mesh):
return False
for material in data.materials:
if material is not None: if material is not None:
return True return True
return False return False
@ -321,14 +318,14 @@ class LightBaker:
toggle.track(objs, "hide_render", False) toggle.track(objs, "hide_render", False)
for i in bpy.data.objects: for i in bpy.data.objects:
i.select = i == objs 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) toggle.track(i, "hide_render", True)
else: else:
for i in bpy.data.objects: for i in bpy.data.objects:
value = i in objs value = i in objs
if value: if value:
toggle.track(i, "hide_render", False) 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) toggle.track(i, "hide_render", True)
i.select = value i.select = value

Loading…
Cancel
Save