Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active September 20, 2020 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/e2a832fb087f765e625665290388ead4 to your computer and use it in GitHub Desktop.
Save TomoG29/e2a832fb087f765e625665290388ead4 to your computer and use it in GitHub Desktop.
import bpy
import bmesh
bl_info = {
"name": "TomoG_Sample",
"author": "TomoG",
"version": (1, 0),
"blender": (2, 9, 0),
"location": "",
"description": "sample",
"warning": "",
"support": "TESTING",
"wiki_url": "",
"tracker_url": "",
"category": "Object"
}
class EdgeSplitTool(bpy.types.Operator):
bl_idname = "mesh.edgesplittool"
bl_label = "Edge Split Test Labl"
bl_description = "Edge Split Desc"
bl_options = {'REGISTER', 'UNDO'}
def execute(self,context):
bm = bmesh.from_edit_mesh(bpy.context.active_object.data)
for s in bm.select_history:
print(s)
print(s.index)
print("Test Completed")
return {'FINISHED'}
def menu_fn(self,context):
self.layout.separator()
self.layout.operator(EdgeSplitTool.bl_idname)
classes = [
EdgeSplitTool,
]
def register():
for c in classes:
bpy.utils.register_class(c)
bpy.types.VIEW3D_MT_edit_mesh_edges.append(menu_fn)
def unregister():
bpy.types.VIEW3D_MT_edit_mesh_edges.remove(menu_fn)
for c in classes:
bpy.utils.unregister_class(c)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment