Changeset View
Changeset View
Standalone View
Standalone View
add_mesh_BoltFactory/Boltfactory.py
| Context not available. | |||||
| obj.data[prm] = getattr(self, prm) | obj.data[prm] = getattr(self, prm) | ||||
| if bpy.context.mode == "EDIT_MESH": | if bpy.context.mode == "EDIT_MESH": | ||||
| active_object = context.active_object | obj = context.edit_object | ||||
| name_active_object = active_object.name | |||||
| bpy.ops.object.mode_set(mode='OBJECT') | |||||
| mesh = createMesh.Create_New_Mesh(self, context) | mesh = createMesh.Create_New_Mesh(self, context) | ||||
| obj = object_utils.object_data_add(context, mesh, operator=self) | |||||
| obj.select_set(True) | bm = bmesh.from_edit_mesh(obj.data) # Access edit mode's mesh data | ||||
| active_object.select_set(True) | bm.from_mesh(mesh) # Append new mesh data | ||||
| bpy.ops.object.join() | bmesh.update_edit_mesh(obj.data, True, True) # Flush changes (update edit mode's view) | ||||
| context.active_object.name = name_active_object | |||||
| bpy.ops.object.mode_set(mode='EDIT') | bpy.data.meshes.remove(mesh) # Remove temporary mesh | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| Context not available. | |||||