Skip to content

Fixes unchecked access of primitives.targets#227

Open
cneumann wants to merge 1 commit into
Siccity:masterfrom
cneumann:fix-unchecked-targets-access
Open

Fixes unchecked access of primitives.targets#227
cneumann wants to merge 1 commit into
Siccity:masterfrom
cneumann:fix-unchecked-targets-access

Conversation

@cneumann

Copy link
Copy Markdown

Exporting models from Maya I get meshes that look like (omitting attribute details for brevity):

{
  "name": "Blob1Shape",
  "extras": {
    "targetNames": []
  },
  "primitives": [
    {
      "attributes": { /*...*/ },
      "indices": 0,
      "mode": 4,
      "material": 0
    }
  ]
}

Note that there is no targets property on the primitive and the targetNames extra is an empty array. The empty targetNames array makes hasTargetNames (Assets/GLTFUtility/Scripts/Spec/GLTFMesh.cs:200) true causing a check for matching array lengths. The latter previously unconditionally accessed GLTFPrimitive.targets which is null for this mesh, causing the mesh to not be imported.

@Siccity Siccity added the bug Something isn't working label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants