Blender 3.1 vertex crease values

How do I get the values of vertex crease using python?

Gave different crease values to the vertices and edges of the default cube.
I can get the crease value of the edges by

for e in[‘Cube’].edges:

I cannot find a similar method for vertices.

1 Like

found it:
obj = bpy.context.active_object

crease_data =[0]

for i in range(len([i].value # get crease data

you can write to it too.

1 Like

Fantastic! Thank you very much.

@brecht I’m not sure if this is bug - that we cant access new vert.crease in bmesh, but we can for edges.crease? Should I report this?

@KevinDietrich added the vertex creases.

Access to BMesh layers is apparently hard coded, I can quickly make a patch for it.

@KevinDietrich Please do. Also I found that there is no new() method in:
thus we cant set vert creases, like its shown in second post, - blender will error with :

Compare to vertex_colors where where have new() method:

But with bmesh custom crease data layer, I guess it wont matter (we will be able to create crease with right? )

The BMesh access was just committed, which does allow to create a new layer.

Creating a layer through mesh.vertex_creases is not possible yet, I can also make a patch for that.

1 Like

Awesome will test is ASAP. It would be great if, for consistency with vert color, you could add mesh.vert_crease. mesh.vert_creases has foreach_set, and get methods which may be usefull for fast crease access.