Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug: Unable to parse gltf file when extras is array #5253

Open
rwang15 opened this issue Sep 26, 2023 · 3 comments
Open

Bug: Unable to parse gltf file when extras is array #5253

rwang15 opened this issue Sep 26, 2023 · 3 comments
Labels
Bug Global flag to mark a deviation from expected behaviour glTF1.0 Bugs related to the glTF1.0 format. glTF2.0 Bugs related to the glTF2.0 format

Comments

@rwang15
Copy link

rwang15 commented Sep 26, 2023

Describe the bug
Unable to parse gltf file when extras is array:

import FAILED: Member "extras" was not of type "object" when reading nodes[1] (basepart#328)

To Reproduce
load gltf file with nodes containing extras as array.

Expected behavior
load gltf file correctly without error

Screenshots
image

Platform (please complete the following information):

  • OS: Windows
@rwang15 rwang15 added the Bug Global flag to mark a deviation from expected behaviour label Sep 26, 2023
@tellypresence
Copy link
Contributor

Please attach sample model file to this ticket to allow reproducing the problem

@kimkulling kimkulling added glTF2.0 Bugs related to the glTF2.0 format glTF1.0 Bugs related to the glTF1.0 format. labels Oct 7, 2023
@stephengold
Copy link
Contributor

I reproduced this issue using a hand-modified version of the glTF 2.0 "TriangleWithoutIndices" test model from glTF-Sample-Models. Here it is in full:

{
  "scene" : 0,
  "scenes" : [
    {
      "nodes" : [ 0 ]
    }
  ],
  
  "nodes" : [
    {
      "mesh" : 0,
      "extras" : [ {
         "key" : "value",
         "key2" : "value2"
      } ]
    }
  ],

  "meshes" : [
    {
      "primitives" : [ {
        "attributes" : {
          "POSITION" : 0
        }
      } ]
    }
  ],

  "buffers" : [
    {
      "uri" : "triangleWithoutIndices.bin",
      "byteLength" : 36
    }
  ],
  "bufferViews" : [
    {
      "buffer" : 0,
      "byteOffset" : 0,
      "byteLength" : 36,
      "target" : 34962
    }
  ],
  "accessors" : [
    {
      "bufferView" : 0,
      "byteOffset" : 0,
      "componentType" : 5126,
      "count" : 3,
      "type" : "VEC3",
      "max" : [ 1.0, 1.0, 0.0 ],
      "min" : [ 0.0, 0.0, 0.0 ]
    }
  ],
  
  "asset" : {
    "version" : "2.0"
  }
}

Aside from for the missing .bin file, this model passes the glTF validator at https://github.khronos.org/glTF-Validator

Running the assimp command on it, I get:

$ bin/assimp info issue5253.gltf
Launching asset import ...           OK
Validating postprocessing flags ...  OK
50 %ERROR: Failed to load file: Member "extras" was not of type "object" when reading nodes[0] (nodes[0])
assimp info: Unable to load input file issue5253.gltf
$

@stephengold
Copy link
Contributor

I suspect this is a duplicate of #4030.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Global flag to mark a deviation from expected behaviour glTF1.0 Bugs related to the glTF1.0 format. glTF2.0 Bugs related to the glTF2.0 format
Projects
Status: No status
Development

No branches or pull requests

4 participants