diff --git a/korman/exporter/material.py b/korman/exporter/material.py index 7304b4b..41bb0b7 100644 --- a/korman/exporter/material.py +++ b/korman/exporter/material.py @@ -405,6 +405,10 @@ class MaterialConverter: if layer_props.skip_depth_write: state.ZFlags |= hsGMatState.kZNoZWrite + if bo.plasma_modifiers.decal_material.enabled: + hsgmat.compFlags |= hsGMaterial.kCompDecal + state.ZFlags |= hsGMatState.kZIncLayer | hsGMatState.kZNoZWrite + # Export the specific texture type self._tex_exporters[texture.type](bo, layer, slot) @@ -1138,6 +1142,8 @@ class MaterialConverter: return True if modifiers.water_basic.enabled: return True + if modifiers.decal_material.enabled: + return True return False def _test_image_alpha(self, image): diff --git a/korman/properties/modifiers/render.py b/korman/properties/modifiers/render.py index befec0d..7bb329e 100644 --- a/korman/properties/modifiers/render.py +++ b/korman/properties/modifiers/render.py @@ -564,3 +564,15 @@ class PlasmaVisibilitySet(PlasmaModifierProperties): if not region.control_region: raise ExportError("{}: Not all Visibility Controls are set up properly in Visibility Set".format(bo.name)) addRegion(exporter.mgr.find_create_key(plVisRegion, bl=region.control_region)) + + +class PlasmaDecalMod(PlasmaModifierProperties): + pl_id = "decal_material" + + bl_category = "Render" + bl_label = "Decal Object" + bl_description = "Exports this object as a decal to its parent" + + def export(self, exporter, bo, so): + if not bo.parent: + raise ExportError("{}: Decal object must have a parent".format(bo.name))