code: def average_onto_vertex(mesh, per_face_attrib):
      """Average per-face attribute onto vertices."""
      assert per_face_attrib.shape[0] == mesh.faces.shape[0]
      assert len(per_face_attrib.shape) == 1
      c = np.concatenate([[0], per_face_attrib], axis=0)
      v2f_orig = mesh.vertex_faces.copy()
      v2f = v2f_orig.copy()
      v2f += 1
      per_vert_sum = np.sum(c[v2f], axis=1)
      per_vert_count = np.sum(np.logical_not(v2f == 0), axis=1)
      per_vert_attrib = per_vert_sum / per_vert_count
      return per_vert_attrib
  
imports: import numpy
  from scipy import sparse
  from scipy import spatial
  import trimesh
label_desc: Use image node_id 2 for calling a global function with example usage: average_onto_vertex(mesh, per_face_attrib) and returns: per_vert_attrib