Fix T80465: [Add Mesh: Extra Objects] Adding mesh in EditMode removes modifiers

This commit is contained in:
Vladimir Spivak 2020-09-06 20:32:00 +03:00
parent d37be8f892
commit da2b17e46c
Notes: blender-bot 2023-02-14 18:48:57 +01:00
Referenced by issue #81433, Modifiers removed when creating Roundcube
Referenced by issue #80465, [Add Mesh: Extra Objects] Adding mesh in EditMode removes modifiers
14 changed files with 20 additions and 1 deletions

View File

@ -917,6 +917,7 @@ class add_mesh_wallb(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -26,7 +26,7 @@
bl_info = {
"name": "Extra Objects",
"author": "Multiple Authors",
"version": (0, 3, 6),
"version": (0, 3, 7),
"blender": (2, 80, 0),
"location": "View3D > Add > Mesh",
"description": "Add extra mesh object types",

View File

@ -792,6 +792,7 @@ class addBeam(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -737,6 +737,7 @@ class AddGear(Operator, object_utils.AddObjectHelper):
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -958,6 +959,7 @@ class AddWormGear(Operator, object_utils.AddObjectHelper):
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -332,6 +332,7 @@ class AddDiamond(Operator, object_utils.AddObjectHelper):
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -480,6 +481,7 @@ class AddGem(Operator, object_utils.AddObjectHelper):
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -314,6 +314,7 @@ class add_mesh_honeycomb(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -259,6 +259,7 @@ class AddElbowJoint(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -524,6 +525,7 @@ class AddTeeJoint(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -806,6 +808,7 @@ class AddWyeJoint(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -1152,6 +1155,7 @@ class AddCrossJoint(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')
@ -1393,6 +1397,7 @@ class AddNJoint(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -194,6 +194,7 @@ class AddPyramid(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -465,6 +465,7 @@ class MESH_OT_primitive_brilliant_add(Operator, object_utils.AddObjectHelper):
)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -441,6 +441,7 @@ class AddRoundCube(Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -256,6 +256,7 @@ class AddStar(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -274,6 +274,7 @@ class add_supertoroid(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -177,6 +177,7 @@ class AddTorusKnot(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

View File

@ -287,6 +287,7 @@ class AddTwistedTorus(bpy.types.Operator, object_utils.AddObjectHelper):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')