Skip to content

Commit 567f3b3

Browse files
committed
Alpha Vertex Color Toggle
Adds a per-layer toggle to use the Alpha VCol values and blend the texture
1 parent d9abf79 commit 567f3b3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

korman/exporter/material.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ def export_texture_slot(self, bo, bm, hsgmat, slot, idx, name=None, blend_flags=
509509
else:
510510
layer_props = texture.plasma_layer
511511
layer.opacity = layer_props.opacity / 100
512-
self._handle_layer_opacity(layer, layer_props.opacity)
512+
if layer_props.opacity < 100 and not state.blendFlags & hsGMatState.kBlendMask:
513+
state.blendFlags |= hsGMatState.kBlendAlpha
514+
if layer_props.use_alpha_vcol:
515+
state.blendFlags |= hsGMatState.kBlendAlpha
513516
if layer_props.alpha_halo:
514517
state.blendFlags |= hsGMatState.kBlendAlphaTestHigh
515518
if layer_props.z_bias:

korman/properties/prop_texture.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class PlasmaLayer(bpy.types.PropertyGroup):
3838
description="Opacity of the texture",
3939
default=100.0, min=0.0, max=100.0,
4040
precision=0, subtype="PERCENTAGE")
41+
use_alpha_vcol = BoolProperty(name="Use Alpha VCol",
42+
description="Texture uses the Alpha vertex color values",
43+
default=False)
4144
alpha_halo = BoolProperty(name="High Alpha Test",
4245
description="Fixes halos seen around semitransparent objects resulting from sorting errors",
4346
default=False)

0 commit comments

Comments
 (0)