From 0b4da161ff3415a11a41fc08dd1a1d8be9777be4 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 8 Oct 2017 22:12:31 -0400 Subject: [PATCH] Only allow LM previews in Object mode Generating lightmap previews in edit mode is nonsense. Also, there is some issue in blender with changing the image assignment programatically while in edit mode, so it's best to just disallow this entirely. --- korman/operators/op_lightmap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/korman/operators/op_lightmap.py b/korman/operators/op_lightmap.py index e67e241..4cad03d 100644 --- a/korman/operators/op_lightmap.py +++ b/korman/operators/op_lightmap.py @@ -23,6 +23,8 @@ class _LightingOperator: @classmethod def poll(cls, context): + if context.mode != "OBJECT": + return False if context.object is not None: return context.scene.render.engine == "PLASMA_GAME"