Post #692: Wa

📋 Metadata

🏷️ Tags

pie-menu macro scripting intermediate solved

  • 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 :slight_smile:

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


🔗 View on Blender Artists