@ -384,7 +384,7 @@ class MeshConverter(_MeshManager):
# Locate relevant vertex color layers now...
# Locate relevant vertex color layers now...
lm = bo . plasma_modifiers . lightmap
lm = bo . plasma_modifiers . lightmap
color = None if lm . bake_lightmap else self . _find_vtx_color_layer ( mesh . tessface_vertex_colors )
color = self . _find_vtx_color_layer ( mesh . tessface_vertex_colors , autocolor = not lm . bake_lightmap , manual = True )
alpha = self . _find_vtx_alpha_layer ( mesh . tessface_vertex_colors )
alpha = self . _find_vtx_alpha_layer ( mesh . tessface_vertex_colors )
# Convert Blender faces into things we can stuff into libHSPlasma
# Convert Blender faces into things we can stuff into libHSPlasma
@ -717,13 +717,15 @@ class MeshConverter(_MeshManager):
return alpha_layer . data
return alpha_layer . data
return None
return None
def _find_vtx_color_layer ( self , color_collection ) :
def _find_vtx_color_layer ( self , color_collection , autocolor : bool = True , manual : bool = True ) :
manual_layer = next ( ( i for i in color_collection if i . name . lower ( ) in _VERTEX_COLOR_LAYERS ) , None )
if manual :
if manual_layer is not None :
manual_layer = next ( ( i for i in color_collection if i . name . lower ( ) in _VERTEX_COLOR_LAYERS ) , None )
return manual_layer . data
if manual_layer is not None :
baked_layer = color_collection . get ( " autocolor " )
return manual_layer . data
if baked_layer is not None :
if autocolor :
return baked_layer . data
baked_layer = color_collection . get ( " autocolor " )
if baked_layer is not None :
return baked_layer . data
return None
return None
def is_nonpreshaded ( self , bo : bpy . types . Object , bm : bpy . types . Material ) - > bool :
def is_nonpreshaded ( self , bo : bpy . types . Object , bm : bpy . types . Material ) - > bool :