Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-22 17:11:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-22 17:11:08 +0400
commit181205be601a7192ba4d936386c1a08e61e4d609 (patch)
treec8acbe8f84530f8d5dc12b3ceef2739e65ff2cdb /add_mesh_ant_landscape.py
parent72e2f73b37ab33a09345dec21035c46bd8c7f898 (diff)
fix for errors adding landscape and bolt objects in editmode
Diffstat (limited to 'add_mesh_ant_landscape.py')
-rw-r--r--add_mesh_ant_landscape.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/add_mesh_ant_landscape.py b/add_mesh_ant_landscape.py
index d7ca08d0..19e680bb 100644
--- a/add_mesh_ant_landscape.py
+++ b/add_mesh_ant_landscape.py
@@ -737,8 +737,9 @@ class landscape_add(bpy.types.Operator):
undo = bpy.context.user_preferences.edit.use_global_undo
bpy.context.user_preferences.edit.use_global_undo = False
- # deselect all objects
- bpy.ops.object.select_all(action='DESELECT')
+ # deselect all objects when in object mode
+ if bpy.ops.object.select_all.poll():
+ bpy.ops.object.select_all(action='DESELECT')
# options
options = [
@@ -787,7 +788,10 @@ class landscape_add(bpy.types.Operator):
# Shade smooth
if self.SmoothMesh !=0:
- bpy.ops.object.shade_smooth()
+ if bpy.ops.object.shade_smooth.poll():
+ bpy.ops.object.shade_smooth()
+ else: # edit mode
+ bpy.ops.mesh.faces_shade_smooth()
# restore pre operator undo state
bpy.context.user_preferences.edit.use_global_undo = undo