Post #3223: ![](https://blenderartists.org/user_avatar/blenderartists.org/metin_seven/48/142

📋 Metadata

🏷️ Tags

macro intermediate solved

  • Macro Editor
  • Python Scripting

💬 Content

Metin_Seven:

I want to create a macro operator that does the following:

  1. In Object Mode, add a Single Vertex (from the Mesh: Extra Objects add-on), or add a Plane, switch to Edit Mode and Merge the vertices to the center.
  2. Add a Skin modifier.
  3. Switch off the X Symmetry in the Skin modifier.
  4. Add a Subdivision modifier.
  5. Set the Subdivision modifier Viewport subdivisions to 2.
  6. Set the Subdivision modifier Quality to 6.

Try to add these slots:

  1. bpy.ops.mesh.primitive_vert_add('EXEC_DEFAULT', True)
  2. bpy.ops.object.modifier_add('EXEC_DEFAULT', True, type='SKIN')
  3. C.object.modifiers[-1].use_x_symmetry = False
  4. bpy.ops.object.modifier_add('EXEC_DEFAULT', True, type='SUBSURF')
  5. C.object.modifiers[-1].levels = 2
  6. C.object.modifiers[-1].quality = 6

Adding 'EXEC_DEFAULT', True allows to skip context checking for context sensitive operators.


❤️ 4 likes


🔗 View on Blender Artists