2
$\begingroup$

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)
$\endgroup$
  • $\begingroup$ Could you clarify what your question is. Preferably with a question sentence (with a question mark) at the start or end of the post? $\endgroup$ – Leander Oct 11 '18 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.