I am looking at how to use python and make a code that automatically detects an empty on a vertex point and hooks them together. How can I do this and add it to the code I already have?
import bpy
from bpy import context
i = 0
c = 8
obj = context.active_object
while not i == c:
v = obj.data.vertices[i]
co_final = obj.matrix_world @ v.co
obj_empty = bpy.data.objects.new("Point", None)
context.collection.objects.link(obj_empty)
obj_empty.location = v.co
obj_empty.parent = obj
i += 1
while i < c:is more readable. However would not do it this way since can iterate vertices and get there index from property. – batFINGER Jan 24 '21 at 02:46