-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPH_basic_utils.py
More file actions
33 lines (27 loc) · 949 Bytes
/
MPH_basic_utils.py
File metadata and controls
33 lines (27 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import bpy
class MPH_OT_delete_faces(bpy.types.Operator):
"""Deletes selected faces"""
bl_idname = "mph.delete_faces"
bl_label = "Delete Faces"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
if not context.object:
return False
return True if context.object.mode == 'EDIT' else False
def execute(self, context):
bpy.ops.mesh.delete(type='FACE')
return {'FINISHED'}
class MPH_OT_prime_cursor(bpy.types.Operator):
"""Center the cursor on the selected objects"""
bl_idname = "mph.prime_cursor"
bl_label = "Prime Cursor"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
if not context.object:
return False
return True if context.object.mode == 'EDIT' else False
def execute(self, context):
bpy.ops.view3d.snap_cursor_to_selected()
return {'FINISHED'}