enter image description here I want to use mean crease in my python script, but i cant access its code via "edit source". I need a button which clears all creases on selected edges with single click, and put it in my custom pie menu. I've found some info on it : mean crease function is scripted with C. Any ideas how to get "mean crease" in python?

  • $\begingroup$ In object mode you find it in obj.data.edges.crease. While in edit mode you would need to use bmesh.from_edit_mesh() and get the edge crease from the custom data layers. $\endgroup$
    – sambler
    Commented Apr 11, 2017 at 4:58

1 Answer 1


Here is the line you need


import bpy

class UIPanel(bpy.types.Panel):
    bl_label = "Crease Clear"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def poll(cls, context):
        return (context.active_object is not None) and (context.mode == "EDIT_MESH")

    def draw(self, context):
        self.layout.operator("crease.clear", text='Crease Clear')

class OBJECT_OT_HelloButton(bpy.types.Operator):
    bl_idname = "crease.clear"
    bl_label = "Crease Clear"
    country = bpy.props.StringProperty()

    def execute(self, context):


enter image description here

Если ты хочешь чтобы кнопка осталась в системе, после перезапуска блендера, сохрани текст в файл с форматом .py и нажми последовательно эти кнопки

If you want the button to remain in the system, after restarting the blender, save the text in a file with the format .py and click these buttons sequentially

enter image description here

  • $\begingroup$ Thx alot. This code works for pie menu's too. Thats what i was looking for. $\endgroup$ Commented May 9, 2017 at 15:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .