From fe685f57f15864090a24a6d27621b3f64f357f0c Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 17 Jul 2015 15:18:32 -0400 Subject: [PATCH] Allow user to opt-out of vertex shading --- korman/operators/op_export.py | 5 +++++ korman/operators/op_lightmap.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/korman/operators/op_export.py b/korman/operators/op_export.py index 024f913..9b8df8f 100644 --- a/korman/operators/op_export.py +++ b/korman/operators/op_export.py @@ -41,6 +41,10 @@ class ExportOperator(bpy.types.Operator): "description": "(Re-)Bake all lightmaps on export", "default": True}), + "regenerate_shading": (BoolProperty, {"name": "Regenerate Vertex Shading", + "description": "(Re-)Bake all vertex shading on export", + "default": True}), + "version": (EnumProperty, {"name": "Version", "description": "Version of the Plasma Engine to target", "default": "pvPots", # This should be changed when moul is easier to target! @@ -57,6 +61,7 @@ class ExportOperator(bpy.types.Operator): # The crazy mess we're doing with props on the fly means we have to explicitly draw them :( layout.prop(age, "version") layout.prop(age, "regenerate_lightmaps") + layout.prop(age, "regenerate_shading") layout.prop(age, "profile_export") def __getattr__(self, attr): diff --git a/korman/operators/op_lightmap.py b/korman/operators/op_lightmap.py index ca729d5..8902720 100644 --- a/korman/operators/op_lightmap.py +++ b/korman/operators/op_lightmap.py @@ -242,7 +242,11 @@ class VertexColorLightingOperator(_LightingOperator, bpy.types.Operator): # old copy of the autocolor layer on the mesh. Nuke it. autocolor = vcols.get("autocolor") if autocolor is not None: - vcols.remove(autocolor) + if context.scene.world.plasma_age.regenerate_shading: + vcols.remove(autocolor) + else: + # we have autocolor already, don't regenerate it because they don't want it + return {"CANCELLED"} autocolor = vcols.new("autocolor") toggle.track(vcols, "active", autocolor)