Post #3723: If you’re looking to only trigger loopcut in edit mode you don’t really need a m
📋 Metadata
- Author: Motiomancer
- Date: 2021-01-01 04:35:40
- Type:
answer - Quality Score: 9/10
- Reply to: post_03714
- Replies (1): post_03724
🏷️ Tags
macro pie-menu hotkeys advanced solved
⚙️ Related PME Features
- Macro Editor
- Pie Menu Editor
- Python Scripting
💬 Content
If you’re looking to only trigger loopcut in edit mode you don’t really need a macro, try this in the command tab
bpy.ops.object.mode_set(mode='EDIT'); bpy.ops.mesh.loopcut_slide('INVOKE_DEFAULT', True)
Now, if you want to hover over edges and trigger the loopcut like in the video, then you would need a macro:
4 item macro:
bpy.ops.object.mode_set(mode='EDIT'); bpy.context.tool_settings.mesh_select_mode = (False, True, False)
bpy.ops.view3d.select(extend=False, deselect_all=True)
import bmesh; bm = bmesh.from_edit_mesh(C.object.data); U.edg = [e for e in bm.edges if e.select][-1].index; U.leng = len([e for e in bm.edges if e.select])
bpy.ops.mesh.loopcut_slide('EXEC_DEFAULT', True, MESH_OT_loopcut={'edge_index': U.edg, 'object_index': 0}) if U.leng == 1 else None
❤️ 1 likes