Skip to content

Value Error('unknown file extension:') error for some gltf files #175

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

Open
shyam98 opened this issue Sep 17, 2019 · 2 comments
Open

Value Error('unknown file extension:') error for some gltf files #175

shyam98 opened this issue Sep 17, 2019 · 2 comments

Comments

@shyam98
Copy link

shyam98 commented Sep 17, 2019

I export fbx or obj files from Solidworks visualize then using blender to convert them to gltf. When taking those gltf files and running them through gltf2usd I get this error. Let me know if here is anything I can do to fix this, thanks! (The glTF files look perfectly fine and have textures as well)

Traceback (most recent call last): File "gltf2usd.py", line 923, 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, args.generate_texture_transform_texture, args.scale_texture) File "gltf2usd.py", line 832, in convert_to_usd usd = GLTF2USD(gltf_file=gltf_file, usd_file=temp_usd_file, fps=fps, scale=scale, verbose=verbose, use_euler_rotation=use_euler_rotation, optimize_textures=optimize_textures, generate_texture_transform_texture=generate_texture_transform_texture, scale_texture=scale_texture) File "gltf2usd.py", line 56, in __init__ self.gltf_loader = GLTF2Loader(gltf_file, optimize_textures, generate_texture_transform_texture) File "/home/centos/gltf2usd/Source/_gltf2usd/gltf2loader.py", line 117, in __init__ self._initialize() File "/home/centos/gltf2usd/Source/_gltf2usd/gltf2loader.py", line 123, in _initialize self._initialize_images() File "/home/centos/gltf2usd/Source/_gltf2usd/gltf2loader.py", line 142, in _initialize_images self._images.append(GLTFImage.GLTFImage(image_entry, i, self, self._optimize_textures, self._generate_texture_transform_texture)) File "/home/centos/gltf2usd/Source/_gltf2usd/gltf2/GLTFImage.py", line 46, in __init__ img.save(self._image_path, optimize=self._optimize_textures) File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 1932, in save raise ValueError('unknown file extension: {}'.format(ext)) ValueError: unknown file extension:

@Plscall922
Copy link

Have same issue here with blender 2.8 gltf files

Traceback (most recent call last):
File "C:\gltf2usd-master\Source\gltf2usd.py", line 923, in
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, args.generate_texture_transform_texture, args.scale_texture)
File "C:\gltf2usd-master\Source\gltf2usd.py", line 832, in convert_to_usd
usd = GLTF2USD(gltf_file=gltf_file, usd_file=temp_usd_file, fps=fps, scale=scale, verbose=verbose, use_euler_rotation=use_euler_rotation, optimize_textures=optimize_textures, generate_texture_transform_texture=generate_texture_transform_texture, scale_texture=scale_texture)
File "C:\gltf2usd-master\Source\gltf2usd.py", line 56, in init
self.gltf_loader = GLTF2Loader(gltf_file, optimize_textures, generate_texture_transform_texture)
File "C:\gltf2usd-master\Source_gltf2usd\gltf2loader.py", line 117, in init
self._initialize()
File "C:\gltf2usd-master\Source_gltf2usd\gltf2loader.py", line 123, in _initialize
self._initialize_images()
File "C:\gltf2usd-master\Source_gltf2usd\gltf2loader.py", line 142, in _initialize_images
self._images.append(GLTFImage.GLTFImage(image_entry, i, self, self._optimize_textures, self._generate_texture_transform_texture))
File "C:\gltf2usd-master\Source_gltf2usd\gltf2\GLTFImage.py", line 37, in init
img.save(self._image_path, optimize=self._optimize_textures)
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1932, in save
raise ValueError('unknown file extension: {}'.format(ext))
ValueError: unknown file extension:

@Plscall922
Copy link

So I found solution that works for me!

When export from blender to gltf You need to choose Format: glTF Separate(.gltf + .bin + textures)

Then gltf2usd sript will work as it should!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants