Hi,
I would like to get faces pass, similarly to UV pass but with face index.
Currently, it is not implemented and I want to get it through the UV pass.
For that, I need to convert UV coordinate to face index.
I found the opposite (from face index to UV) by:
> for poly in me.polygons:
> print("Polygon index: %d, length: %d" % (poly.index, poly.loop_total))
> # range is used here to show how the polygons reference loops,
> # for convenience 'poly.loop_indices' can be used instead.
> for loop_index in range(poly.loop_start, poly.loop_start + poly.loop_total):
> print(" Vertex: %d" % me.loops[loop_index].vertex_index)
> print(" UV: %r" % uv_layer[loop_index].uv)
I thought to use kdtree and find the nearest neighbour and then I can find the closest vertex.
However, I would like to find the face.
Does anyone have an idea how to find it?
Alternatively, is there an existed concept of face pass?