Browse Source

Nuke old "autocolor" layers

Old autocolor layers appear to cause some very terrible problems during
export for some reason...
pull/8/head
Adam Johnson 10 years ago
parent
commit
c21b90f83c
  1. 14
      korman/operators/op_lightmap.py

14
korman/operators/op_lightmap.py

@ -210,12 +210,16 @@ class VertexColorLightingOperator(_LightingOperator, bpy.types.Operator):
def execute(self, context):
with GoodNeighbor() as toggle:
mesh = context.active_object.data
vcols = mesh.vertex_colors
# Find the "autocolor" vertex color layer
autocolor = mesh.vertex_colors.get("autocolor")
if autocolor is None:
mesh.vertex_colors.new("autocolor")
toggle.track(mesh.vertex_colors, "active", autocolor)
# I have heard tale of some moar "No valid image to bake to" boogs if there is a really
# old copy of the autocolor layer on the mesh. Nuke it.
autocolor = vcols.get("autocolor")
if autocolor is not None:
vcols.remove(autocolor)
autocolor = vcols.new("autocolor")
toggle.track(vcols, "active", autocolor)
# Mark "autocolor" as our active render layer
for vcol_layer in mesh.vertex_colors:

Loading…
Cancel
Save