0
$\begingroup$

I am trying to export a JSON file from Blender and need split normals as data on vertices. I have exported a custom attribute named "norm" using geometry nodes. However, I am struggling to evaluate the graph while looping over the primitives of the geometry and appending that in normal list.

Here is my for loop block:

    h_index_to_out = {}

indices = []
positions = []
normals = []
colors = []

index = 0
for prim in bmesh_car.faces:
    for vert in prim.verts:
        h_index = vert.index
        if h_index not in h_index_to_out:
            h_index_to_out[h_index] = index
            index = index + 1
            pos = vert.co
            positions.append(pos.x)
            positions.append(pos.y)
            positions.append(pos.z)
            **#At this point I need to write that custom exported attribute on vertices**
            normal = vert.normal
            normals.append(normal.x)
            normals.append(normal.y)
            normals.append(normal.z)
    
            colors.append(1.0)
            colors.append(1.0)
            colors.append(1.0)
            
        out_index = h_index_to_out[h_index]
        indices.append(out_index)

How can I properly evaluate the geometry nodes graph to access the custom attribute "norm" and correctly export the split normals along with the vertices?

Any guidance or examples would be greatly appreciated!

$\endgroup$
1

0

You must log in to answer this question.

Browse other questions tagged .