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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-29 18:19:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-29 18:19:19 +0300
commite85a0234803b773e165222c4eacfd4077afdb7a9 (patch)
tree6323c9859a5666e4810b5eb2ceb322a371ba4f19 /release/scripts/op
parente28e6ac5c78d6f02e43132f9f5d23288f151be12 (diff)
bugfix [#19681] adjusting the settings of the 'add torus' tool in edit mode
Diffstat (limited to 'release/scripts/op')
-rw-r--r--release/scripts/op/add_mesh_torus.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py
index 2d482108ab0..4a31a275a4d 100644
--- a/release/scripts/op/add_mesh_torus.py
+++ b/release/scripts/op/add_mesh_torus.py
@@ -130,13 +130,30 @@ class AddTorus(bpy.types.Operator):
ob_new = bpy.data.objects.new("Torus", 'MESH')
ob_new.data = mesh
scene.objects.link(ob_new)
- scene.objects.active = ob_new
ob_new.selected = True
- ob_new.location = tuple(context.scene.cursor_location)
+ ob_new.location = scene.cursor_location
+
+ obj_act = scene.objects.active
+
+ if obj_act and obj_act.mode == 'EDIT':
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ obj_act.selected = True
+ scene.update() # apply location
+ #scene.objects.active = ob_new
+
+ bpy.ops.object.join() # join into the active.
+
+ bpy.ops.object.mode_set(mode='EDIT')
+ else:
+ scene.objects.active = ob_new
+ if context.user_preferences.edit.enter_edit_mode:
+ bpy.ops.object.mode_set(mode='EDIT')
return {'FINISHED'}
+
# Register the operator
bpy.types.register(AddTorus)