kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
263 stars 39 forks source link

Struct error when converting... not sure what's going on. #128

Closed enzyme69 closed 5 years ago

enzyme69 commented 5 years ago
Traceback (most recent call last):
  File "gltf2usd.py", line 822, in <module>
    convert_to_usd(os.path.expanduser(args.gltf_file), os.path.abspath(os.path.expanduser(args.usd_file)), args.fps, args.scale, args.arkit, args.verbose, args.use_euler_rotation, args.optimize_textures)
  File "gltf2usd.py", line 770, in convert_to_usd
    usd = GLTF2USD(gltf_file=gltf_file, usd_file=usd_file, fps=fps, scale=scale, verbose=verbose, use_euler_rotation=use_euler_rotation, optimize_textures=optimize_textures)
  File "gltf2usd.py", line 55, in __init__
    self.gltf_loader = GLTF2Loader(gltf_file, optimize_textures)
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2loader.py", line 116, in __init__
    self._initialize()
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2loader.py", line 123, in _initialize
    self._initialize_meshes()
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2loader.py", line 204, in _initialize_meshes
    mesh = Mesh(mesh_entry, i, self)
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2/Mesh.py", line 122, in __init__
    primitive = Primitive(primitive_entry, i, self, gltf_loader)
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2/Mesh.py", line 67, in __init__
    data = gltf_loader.get_data(accessor)
  File "/Users/jimmygunawan/Desktop/USDZ_HeadSkin/_gltf2usd/gltf2loader.py", line 293, in get_data
    entries.append((struct.unpack(data_type, window)[0])/normalize_divisor)
struct.error: unpack requires a string argument of length 4
enzyme69 commented 5 years ago

Ok, perhaps the above error print out is not quite clear on what actually causing them.

But basically it might be something to do with Modifier or Skinned Mesh Vertex Group without bones.

kcoley commented 5 years ago

@enzyme69 do you have a sample glTF file?

kcoley commented 5 years ago

@enzyme69 closing for now. If you have a sample file, feel free to reopen