Skip to content

Commit

Permalink
fix #5067. Node Find UV Coord on Surface return incorrect data format…
Browse files Browse the repository at this point in the history
… on output socket Point On Mesh

convert result from vectors to list of coordinates
  • Loading branch information
satabol committed Nov 18, 2023
1 parent 1026c30 commit 90b2158
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nodes/object_nodes/points_from_uv_to_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,17 @@ def process(self):
if Pom.is_linked:
# resore UV to 3D
bvh = BVHTree.FromPolygons(UVMAPV, UVMAPP, all_triangles=False, epsilon=0.0)
pom = [] # result in 3D
lpom = [] # result in 3D
for Puv in PointUV:
loc, norm, ind, dist = bvh.find_nearest(Puv)
_found_poly = bm.faces[ind]
_p1, _p2, _p3 = [v.co for v in bm.faces[ind].verts[0:3] ]
_uv1, _uv2, _uv3 = [l[uv_layer].uv.to_3d() for l in _found_poly.loops[0:3] ]
_V = barycentric_transform(Puv, _uv1, _uv2, _uv3, _p1, _p2, _p3)
pom.append( obj_matrix @ Vector(_V[:]))
pom = obj_matrix @ Vector(_V[:])
lpom.append( list( pom ) )

POMs.append(pom)
POMs.append(lpom)
bm.clear()
UVMAPVs.append(UVMAPV)
UVMAPPs.append(UVMAPP)
Expand Down

0 comments on commit 90b2158

Please sign in to comment.