Accessing custom vertex properties created using bmesh

In Blender when assigning custom properties to vertices using the bmesh layer system, this data can then be accessed directly from the object, through its attributes.

As an example, let’s assign a custom property of the integer type to the vertices of the currently active object.

Load the active mesh data into bmesh. And use bmesh to create an int-type layer for the vertices. Set each vertex on this layer to a random value of 0 or 1 and dump the data back to the object.

If we look at the object’s attribute list, we will see a new attribute named “vert_layer”. This is exactly the name we used when creating the bmesh layer.

We can get custom vertices values set through the bmesh layer using this attribute.

Let’s select vertices for which our custom property is set to 1.

We will get the following result:

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments