Changeset View
Changeset View
Standalone View
Standalone View
mesh_looptools.py
| Show First 20 Lines • Show All 825 Lines • ▼ Show 20 Lines | for key in keys: | ||||
| setattr(lt, tool + "_" + key, getattr(self, key)) | setattr(lt, tool + "_" + key, getattr(self, key)) | ||||
| # clean up and set settings back to original state | # clean up and set settings back to original state | ||||
| def terminate(global_undo): | def terminate(global_undo): | ||||
| # update editmesh cached data | # update editmesh cached data | ||||
| obj = bpy.context.active_object | obj = bpy.context.active_object | ||||
| if obj.mode == 'EDIT': | if obj.mode == 'EDIT': | ||||
| bmesh.update_edit_mesh(obj.data, tessface=True, destructive=True) | bmesh.update_edit_mesh(obj.data, loop_triangles=True, destructive=True) | ||||
| bpy.context.user_preferences.edit.use_global_undo = global_undo | bpy.context.user_preferences.edit.use_global_undo = global_undo | ||||
| # ######################################## | # ######################################## | ||||
| # ##### Bridge functions ################# | # ##### Bridge functions ################# | ||||
| # ######################################## | # ######################################## | ||||
| ▲ Show 20 Lines • Show All 2,519 Lines • ▼ Show 20 Lines | def execute(self, context): | ||||
| bridge_select_new_faces(new_faces, smooth) | bridge_select_new_faces(new_faces, smooth) | ||||
| # edge-data could have changed, can't use cache next run | # edge-data could have changed, can't use cache next run | ||||
| if faces and not vertices: | if faces and not vertices: | ||||
| cache_delete("Bridge") | cache_delete("Bridge") | ||||
| # delete internal faces | # delete internal faces | ||||
| if self.remove_faces and old_selected_faces: | if self.remove_faces and old_selected_faces: | ||||
| bridge_remove_internal_faces(bm, old_selected_faces) | bridge_remove_internal_faces(bm, old_selected_faces) | ||||
| # make sure normals are facing outside | # make sure normals are facing outside | ||||
| bmesh.update_edit_mesh(object.data, tessface=False, | bmesh.update_edit_mesh(object.data, loop_triangles=False, | ||||
| destructive=True) | destructive=True) | ||||
| bpy.ops.mesh.normals_make_consistent() | bpy.ops.mesh.normals_make_consistent() | ||||
| # cleaning up | # cleaning up | ||||
| terminate(global_undo) | terminate(global_undo) | ||||
| return{'FINISHED'} | return{'FINISHED'} | ||||
| ▲ Show 20 Lines • Show All 702 Lines • ▼ Show 20 Lines | def execute(self, context): | ||||
| break | break | ||||
| gstretch_erase_stroke(stroke, context) | gstretch_erase_stroke(stroke, context) | ||||
| # move vertices to new locations | # move vertices to new locations | ||||
| if self.lock_x or self.lock_y or self.lock_z: | if self.lock_x or self.lock_y or self.lock_z: | ||||
| lock = [self.lock_x, self.lock_y, self.lock_z] | lock = [self.lock_x, self.lock_y, self.lock_z] | ||||
| else: | else: | ||||
| lock = False | lock = False | ||||
| bmesh.update_edit_mesh(object.data, tessface=True, destructive=True) | bmesh.update_edit_mesh(object.data, loop_triangles=True, destructive=True) | ||||
| move_verts(object, bm, mapping, move, lock, self.influence) | move_verts(object, bm, mapping, move, lock, self.influence) | ||||
| # cleaning up | # cleaning up | ||||
| if derived: | if derived: | ||||
| bm_mod.free() | bm_mod.free() | ||||
| terminate(global_undo) | terminate(global_undo) | ||||
| return{'FINISHED'} | return{'FINISHED'} | ||||
| ▲ Show 20 Lines • Show All 1,043 Lines • Show Last 20 Lines | |||||