Custom Properties for Vertices

I would like to add a custom property to a vertice to hold data from a simulation. The data is a vector of three values.

I know that for an object I can make a custom property like:

bpy.types.Object.Velocity = bpy.props.FloatVectorProperty(name="Velocity", subtype="VELOCITY")
myObject.Velocity = [1.0, 2.0, 3.0]

However, for a meshVertex, it doesn’t seem to work. If I do:

bpy.types.MeshVertex.Velocity = bpy.props.FloatVectorProperty(name="Velocity", subtype="VELOCITY")
myVertex =['Cube'].vertices[0]
myVertex.Velocity = [1.0, 2.0, 3.0]

I get the result:
AttributeError: ‘MeshVertex’ object attribute ‘Velocity’ is read-only.

It seems like blender is happy to create the custom property for the MeshVertex object, but it won’t let me change it. Any ideas on how to set it?


You can only add props to ID subclasses:

Hope this helps.

Thanks for the reply. That makes sense looking at the documentation.

Any ideas on how to associate data with a vertex?

bmesh custom data:

But you better test if it stays synced and survives blender restarts!