Hi there,
inside my script i am using the knife_cut function given by blender (bpy.ops.mesh.knife_cut). After cutting the mesh, all newly generated vertices are selected, but still not in the meshes vertice list.
e.g. i cut the default cube through the middle, using following code inside the console:
It would be fine to update the vertice list of the mesh just by toggling out of editmode and back inside again, but this works only inside the console, inside a running script the script would finish first even with toggling between object and editmode, after finishing the script the vertice list would be updated.
As i need the list of newly generated vertices, i looked around for a function that really updates the list of vertices a mesh is holding or a function which gives me a list of all selected vertices (the knife cut tool unselects all old vertices and selects the generated ones), so that i could get the generated vertices just by looping through all selected verts.
Anybody has a function for updating the verts hold by a mesh or a function for getting the selected verts? Would be fine
The script doesn’t finish before the mesh is updated. The mesh data is updated as you go from edit-mode to object-mode (second time you toggle edit-mode).
No, won’t work anyway
My script is very long and has to do several cuts, at least also the mesh will be deleted after i get all vertices and use them for some calculations, i am working with copies of objects so that the original mesh won’t change (it is faster copying the whole mesh and generating a new object for just one cut each time that cutting several times through the same mesh, the amount of generated vertices keep small)
I think trying to update the list with toggling between object mode and edit mode won’t help me at least.
@Darknet
thanks, but this doesn’t work either. For checking if the verts are selected, i have to access to the vertices, but if they aren’t inside the list, i will only get a traceback that the vertex doesn’t exist (even if it is there^^)