Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes unchecked access of primitives.targets #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cneumann
Copy link

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