Browse Source

Remove manual stack walking for bottom layers.

pull/277/head
Adam Johnson 3 years ago
parent
commit
014a21b295
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 4
      korman/exporter/material.py
  2. 8
      korman/exporter/mesh.py

4
korman/exporter/material.py

@ -1192,9 +1192,7 @@ class MaterialConverter:
except IndexError: except IndexError:
return None return None
else: else:
while layer.underLay is not None: return layer.bottomOfStack.object
layer = layer.underLay.object
return layer
def get_bump_layer(self, bo): def get_bump_layer(self, bo):
return self._bump_mats.get(bo, None) return self._bump_mats.get(bo, None)

8
korman/exporter/mesh.py

@ -41,18 +41,12 @@ class _GeoSpan:
"""Determines the color all vertex colors should be multipled by in this span.""" """Determines the color all vertex colors should be multipled by in this span."""
if self.geospan.props & plGeometrySpan.kDiffuseFoldedIn: if self.geospan.props & plGeometrySpan.kDiffuseFoldedIn:
color = bm.diffuse_color color = bm.diffuse_color
base_layer = self._find_bottom_of_stack() base_layer = self.geospan.material.object.layers[0].object.bottomOfStack.object
return (color.r, color.b, color.g, base_layer.opacity) return (color.r, color.b, color.g, base_layer.opacity)
if not bo.plasma_modifiers.lighting.preshade: if not bo.plasma_modifiers.lighting.preshade:
return (0.0, 0.0, 0.0, 0.0) return (0.0, 0.0, 0.0, 0.0)
return (1.0, 1.0, 1.0, 1.0) return (1.0, 1.0, 1.0, 1.0)
def _find_bottom_of_stack(self) -> plLayerInterface:
base_layer = self.geospan.material.object.layers[0].object
while base_layer.underLay is not None:
base_layer = base_layer.underLay.object
return base_layer
class _RenderLevel: class _RenderLevel:
MAJOR_OPAQUE = 0 MAJOR_OPAQUE = 0

Loading…
Cancel
Save