fix T53624: A.N.T. Landscape should not be operating in edit mode

This commit is contained in:
Philipp Oeser 2018-01-26 18:27:29 +01:00
parent dc6704ab42
commit 87579bd164
Notes: blender-bot 2023-02-14 19:32:11 +01:00
Referenced by commit 4aa080a1: A.N.T. Landscape: prevent entering editmode
Referenced by commit 4aa080a1, A.N.T. Landscape: prevent entering editmode
Referenced by issue #55050, cant open the add mesh A.N.T landscape
Referenced by issue #55087, A.N.T landscape not working
Referenced by issue #53624, ANT Landscape report error traceback
Referenced by issue #53684, 2.79a release - addons
2 changed files with 12 additions and 1 deletions

View File

@ -586,6 +586,14 @@ class AntAddLandscape(bpy.types.Operator):
description="Automatic refresh"
)
@classmethod
def poll(self, context):
ob = context.object
if ob is not None:
if ob.mode == 'EDIT':
return False
return True
def draw(self, context):
draw_ant_refresh(self, context)
draw_ant_main(self, context, generate=True)

View File

@ -193,7 +193,10 @@ class AntLandscapeRegenerate(bpy.types.Operator):
@classmethod
def poll(cls, context):
return bpy.context.active_object.ant_landscape
ob = bpy.context.active_object
if ob.mode == 'EDIT':
return False
return ob.ant_landscape
def execute(self, context):