Skip to content

Commit 18b6419

Browse files
committed
Alpha Vertex Color Toggle
Adds a per-layer toggle to use the Alpha VCol values and blend the texture
1 parent 6f83192 commit 18b6419

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

korman/exporter/material.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ def export_texture_slot(self, bo, bm, hsgmat, slot, idx, name=None, blend_flags=
480480
layer.opacity = layer_props.opacity / 100
481481
if layer_props.opacity < 100 and not state.blendFlags & hsGMatState.kBlendMask:
482482
state.blendFlags |= hsGMatState.kBlendAlpha
483+
if layer_props.use_alpha_vcol:
484+
state.blendFlags |= hsGMatState.kBlendAlpha
483485
if layer_props.alpha_halo:
484486
state.blendFlags |= hsGMatState.kBlendAlphaTestHigh
485487
if layer_props.z_bias:

korman/properties/prop_texture.py

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

korman/ui/ui_texture.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def draw(self, context):
8282
col.label("Miscellaneous:")
8383
col.active = not use_stencil
8484
col.prop(layer_props, "opacity", text="Opacity")
85+
col.prop(layer_props, "use_alpha_vcol", text="Use Alpha VCol")
8586
col.separator()
8687

8788
col = col.column()

0 commit comments

Comments
 (0)