Script to fix
To make the parent relation directly to the vertex, so editing will reflect position, run script below. Zeros the location of the empty and clears the parent inverse.
When setting origin to geometry of mesh both the location and parent inverse of the empties are changed, reflecting the translation of the origin location. (The (0.18, -0.06, -0.41) part of the matrix shown in comment above).
Select the mesh object (make active) and run the script.
import bpy
from mathutils import Matrix
from bpy import context
scene = context.scene
mesh_ob = context.object
empties = [e for e in scene.objects if e.parent == mesh_ob]
for e in empties:
e.matrix_parent_inverse = Matrix()
e.location = (0, 0, 0)
The UI equivalent would be select all empties, AltG clear location and AltP clear parent inverse.
Script to add empties at each vertex
Since I have touched on scripting, feel it is a good idea to include a script to add empties to each vertex of a mesh object.
Have named them "Vert<i>" where i is the index of the vert, given them circle display and 0.2 empty scale.
import bpy
from bpy import context
ob = context.object
coll = context.collection
for v in ob.data.vertices:
mt = bpy.data.objects.new(
f"Vert{v.index}",
None,
)
mt.empty_display_type = 'CIRCLE'
mt.empty_display_size = 0.2
mt.parent = ob
mt.parent_type = 'VERTEX'
mt.parent_vertices = [v.index] * 3
coll.objects.link(mt)
C.object.matrix_parent_inverse? If it is not Identity ( all ones and zeros), this is the issue. – batFINGER Nov 02 '20 at 17:22Although my question was answered, now, why do my empties won't follow the parent ? batFINGER's answer is probably a good hint as my matrix is set as this : Matrix(((1.0, -0.0, 0.0, 0.18431678414344788), (-0.0, 1.0, -0.0, -0.06000000238418579), (0.0, 0.0, 1.0, -0.4116193950176239), (-0.0, 0.0, -0.0, 1.0)))
– Pdhm Nov 02 '20 at 17:28