Post #2178: Ahh, okay. Many thanks! ![:slight_smile:](https://blenderartists.org/images/emoj

📋 Metadata

🏷️ Tags

macro python-scripting intermediate unsolved

  • Macro Editor
  • Python Scripting

💬 Content

Ahh, okay. Many thanks! :slight_smile:

I got this working for all scripts now except for this one:

import bmesh; d = C.object.data; b = bmesh.from_edit_mesh(d); ed = [e for e in b.edges if e.select]; c = b.edges.layers.crease.verify(); cv = [e[c] for e in ed]; scv = sum(cv) * 1.25; v = 0.8 if scv < len(ed) else 0; exec("for e in ed: e[c] = v"); [setattr(e, 'smooth', not v) for e in ed]; bmesh.update_edit_mesh(d)

Since it doesn’t have a bpy.ops line I don’t know how to add that True/Undo command.
Could you tell me how to fix the above script?


🔗 View on Blender Artists