From cf4d4c2c82a53c683f69b6172edff7b3ddc730e6 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 9 Jul 2015 14:43:44 -0400 Subject: [PATCH] Fix issues with env maps and opacity --- korman/exporter/material.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/korman/exporter/material.py b/korman/exporter/material.py index 563151d..3c9b240 100644 --- a/korman/exporter/material.py +++ b/korman/exporter/material.py @@ -265,9 +265,13 @@ class MaterialConverter: elif slot.blend_type == "MULTIPLY": state.blendFlags |= hsGMatState.kBlendMult - # Apply custom layer properties texture = slot.texture - layer.opacity = texture.plasma_layer.opacity / 100 + + # Apply custom layer properties + layer_props = texture.plasma_layer + layer.opacity = layer_props.opacity / 100 + if layer_props.opacity < 100: + state.blendFlags |= hsGMatState.kBlendAlpha # Export the specific texture type self._tex_exporters[texture.type](bo, hsgmat, layer, slot) @@ -372,6 +376,7 @@ class MaterialConverter: # that create themselves when the explorer links in, so really... who cares about CEMs? self._exporter().report.warn("IMAGE EnvironmentMaps are not supported. '{}' will not be exported!".format(layer.key.name)) pl_env = None + layer.state.shadeFlags |= hsGMatState.kShadeEnvironMap layer.texture = pl_env def _export_dynamic_env(self, bo, hsgmat, layer, bl_env, pl_class):