Skip to content

Commit

Permalink
Alpha Vertex Color Toggle
Browse files Browse the repository at this point in the history
Adds a per-layer toggle to use the Alpha VCol values and blend the texture
  • Loading branch information
DoobesURU committed Aug 4, 2021
1 parent 6f83192 commit 18b6419
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions korman/exporter/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ def export_texture_slot(self, bo, bm, hsgmat, slot, idx, name=None, blend_flags=
layer.opacity = layer_props.opacity / 100
if layer_props.opacity < 100 and not state.blendFlags & hsGMatState.kBlendMask:
state.blendFlags |= hsGMatState.kBlendAlpha
if layer_props.use_alpha_vcol:
state.blendFlags |= hsGMatState.kBlendAlpha
if layer_props.alpha_halo:
state.blendFlags |= hsGMatState.kBlendAlphaTestHigh
if layer_props.z_bias:
Expand Down
3 changes: 3 additions & 0 deletions korman/properties/prop_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class PlasmaLayer(bpy.types.PropertyGroup):
description="Opacity of the texture",
default=100.0, min=0.0, max=100.0,
precision=0, subtype="PERCENTAGE")
use_alpha_vcol = BoolProperty(name="Use Alpha VCol",
description="Texture uses the Alpha vertex color values",
default=False)
alpha_halo = BoolProperty(name="High Alpha Test",
description="Fixes halos seen around semitransparent objects resulting from sorting errors",
default=False)
Expand Down
1 change: 1 addition & 0 deletions korman/ui/ui_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def draw(self, context):
col.label("Miscellaneous:")
col.active = not use_stencil
col.prop(layer_props, "opacity", text="Opacity")
col.prop(layer_props, "use_alpha_vcol", text="Use Alpha VCol")
col.separator()

col = col.column()
Expand Down

0 comments on commit 18b6419

Please sign in to comment.