Post #692:
Wa
📋 Metadata
- Author: roaoao
- Date: 2017-05-24 07:36:27
- Type:
answer - Quality Score: 7/10
- Reply to: post_00691
- Replies (2): post_00693, post_00694
🏷️ Tags
pie-menu macro scripting intermediate solved
⚙️ Related PME Features
- Pie Menu Editor
- Macro Editor
- Python Scripting
💬 Content
Way2Close:
Heya, does anyone know how to switch between an operator and a pie menu based on a bool’s value?
Thanks in advance guys
Hi, use this code in Command tab:
bpy.ops.ed.redo() if bpy.context.scene.mybool == True else open_menu("My Pie Menu")
Leafar:
Trying to make a script to make a “handmade” cartoon style
The idea is: duplicate mesh → fatten 0.25 → flip normals. Nothing complicated but not working.
Edit:
Now it is working nice with basic meshes with this code (I think that it is exactly the same code… ¬¬):
bpy.ops.mesh.duplicate_move(MESH_OT_duplicate={"mode":1}, TRANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False}); bpy.ops.transform.shrink_fatten(value=-0.25, use_even_offset=True, mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.0); bpy.ops.mesh.normals_make_consistent(inside=True)But not working at all with Suzzanne for example:
Try this value use_even_offset =False
