4
4
mirror of https://github.com/H-uru/korman.git synced 2025-07-14 22:36:52 +00:00

Allow user to opt-out of vertex shading

This commit is contained in:
2015-07-17 15:18:32 -04:00
parent 1b726330e2
commit fe685f57f1
2 changed files with 10 additions and 1 deletions

View File

@ -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):

View File

@ -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)