mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-06 23:32:30 +08:00
fix: issue 88 make texture voxel query deterministic
This commit is contained in:
parent
7b95f7c4b0
commit
55997759d8
@ -117,7 +117,7 @@ def paint_mesh_with_voxels(mesh, voxel_coords, voxel_colors, resolution):
|
|||||||
tree = scipy.spatial.cKDTree(voxel_pos_np)
|
tree = scipy.spatial.cKDTree(voxel_pos_np)
|
||||||
|
|
||||||
# nearest neighbour k=1
|
# nearest neighbour k=1
|
||||||
_, nearest_idx_np = tree.query(verts_np, k=1, workers=-1)
|
_, nearest_idx_np = tree.query(verts_np, k=1, workers=1)
|
||||||
|
|
||||||
nearest_idx = torch.from_numpy(nearest_idx_np).long()
|
nearest_idx = torch.from_numpy(nearest_idx_np).long()
|
||||||
v_colors = voxel_colors[nearest_idx]
|
v_colors = voxel_colors[nearest_idx]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user