This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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