Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ public bool UploadData(HEU_SessionBase session, HAPI_NodeId inputNodeID, HEU_Inp
{
Vector3[] meshVertices = inputDataMeshes._inputMeshes[i]._mesh.vertices;
Matrix4x4 localToWorld = rootInvertTransformMatrix * inputDataMeshes._inputMeshes[i]._transform.localToWorldMatrix;
Matrix4x4 worldToLocalTransposed = localToWorld.inverse.transpose;

List<Vector3> uniqueVertices = new List<Vector3>();

Expand Down Expand Up @@ -366,7 +367,11 @@ public bool UploadData(HEU_SessionBase session, HAPI_NodeId inputNodeID, HEU_Inp

if (meshNormals != null && (originalIndex < meshNormals.Length))
{
normals.Add(meshNormals[originalIndex]);
Vector3 normalLocalSpace = meshNormals[originalIndex];
Vector3 normalWorldSpace = worldToLocalTransposed * normalLocalSpace;
if (normalWorldSpace.sqrMagnitude > 0f)
normalWorldSpace.Normalize();
normals.Add(normalWorldSpace);
}

for (int u = 0; u < NumUVSets; ++u)
Expand Down