Fix: Set Mesh Normal "Tangent" mode fails with free normals

If free normals already exist, the `custom_normal` attribute already
exists with a different type, so the attribute writer is not created
properly in `mesh_set_custom_normals` and the process fails. Instead,
setting tangent space custom normals should clear existing free normals.

Pull Request: https://projects.blender.org/blender/blender/pulls/142961
This commit is contained in:
Hans Goudey
2025-07-24 15:50:40 +02:00
committed by Hans Goudey
parent 264669fc03
commit 623d3c04e2

View File

@@ -151,6 +151,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Array<float3> corner_normals(mesh->corners_num);
evaluator.add_with_destination<float3>(custom_normal, corner_normals);
evaluator.evaluate();
mesh->attributes_for_write().remove("custom_normal");
bke::mesh_set_custom_normals(*mesh, corner_normals);
}
});