I have been looking for a way to do this for a long time (mark_seam (True\False) and mark_sharp (True\False)) with one button in my pie menu. I managed to achieve some kind of result. I found how to do one button bevel and crease.

How to determine if the seam is on only selected edges?

import bpy
import bmesh

obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me) 
bw = bm.edges.layers.bevel_weight.verify()
cr = bm.edges.layers.crease.verify()
#se = bm.edges.layers.seam.verify()           ???
selected = [e for e in bm.edges if e.select]

if any(e[bw] == True for e in selected):

    bpy.ops.transform.edge_bevelweight(value=-1)

else:

    bpy.ops.transform.edge_bevelweight(value=1)

bmesh.update_edit_mesh(me, True)
New contributor
Alexandr is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Could you clarify what your question is. Preferably with a question sentence (with a question mark) at the start or end of the post? – Leander Oct 11 at 17:16

Your Answer

Alexandr is a new contributor. Be nice, and check out our Code of Conduct.
 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.