Closed ghost closed 5 years ago
@sayduck-daniel I made an update to include square brackets in the regex. Does that work for you?
I'm gonna give it a try. I let you know.
I would actually remove everything that is not a-zA-Z0-9_-
to be on the safe side.
Getting this error now:
converted usd file extension from .usdz to .usdc: /var/app/current/tmp/ad09871fbfc6fca0cdd8c8c20720525517c4de2b874c50924d0b51b19c9f3842/usdz/dist.usdc
Warning: in _InitWithString at line 106 of /usr/local/src/USD-18.09/pxr/usd/lib/sdf/path.cpp -- Ill-formed SdfPath </Materials/Red rust standard 10>: syntax error
Traceback (most recent call last):
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 835, 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)
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 779, 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, generate_texture_transform_texture=generate_texture_transform_texture)
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 74, in __init__
self.convert()
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 749, in convert
self._convert_materials_to_preview_surface_new()
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 458, in _convert_materials_to_preview_surface_new
usd_material = USDMaterial(self.stage, material.get_name(), scope, i, self.gltf_loader)
File "/usr/local/gltf2usd/Source/_gltf2usd/usd_material.py", line 15, in __init__
self._usd_material = UsdShade.Material.Define(stage, self._material_path)
pxr.Tf.ErrorException:
Error in 'pxrInternal_v0_18__pxrReserved__::UsdStage::_IsValidPathForCreatingPrim' at line 3096 in file /usr/local/src/USD-18.09/pxr/usd/lib/usd/stage.cpp : 'Path must be an absolute path: <>'
@sayduck-daniel does this branch work for you?: https://github.com/kcoley/gltf2usd/tree/materialNameTest
Sill not working. I sent you privately on twitter the glTF we using.
The error we got:
converted usd file extension from .usdz to .usdc: /var/app/current/tmp/12dad0a75392660b12fc01f41beb293b4987a6cb0aeac21889872991404bd4f7/usdz/dist.usdc
Warning: in AppendChild at line 607 of /usr/local/src/USD-18.09/pxr/usd/lib/sdf/path.cpp -- Invalid prim name '028'
Traceback (most recent call last):
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 835, 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)
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 779, 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, generate_texture_transform_texture=generate_texture_transform_texture)
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 74, in __init__
self.convert()
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 749, in convert
self._convert_materials_to_preview_surface_new()
File "/usr/local/gltf2usd/Source/gltf2usd.py", line 459, in _convert_materials_to_preview_surface_new
usd_material.convert_material_to_usd_preview_surface(material, self.output_dir)
File "/usr/local/gltf2usd/Source/_gltf2usd/usd_material.py", line 21, in convert_material_to_usd_preview_surface
usd_preview_surface = USDPreviewSurface(self._stage, gltf_material, self, output_directory)
File "/usr/local/gltf2usd/Source/_gltf2usd/usd_material.py", line 38, in __init__
material = UsdShade.Shader.Define(self._stage, material_path.AppendChild(gltf_material.get_name()))
pxr.Tf.ErrorException:
Error in 'pxrInternal_v0_18__pxrReserved__::UsdStage::_IsValidPathForCreatingPrim' at line 3096 in file /usr/local/src/USD-18.09/pxr/usd/lib/usd/stage.cpp : 'Path must be an absolute path: <>'
It says Warning: in AppendChild at line 607 of /usr/local/src/USD-18.09/pxr/usd/lib/sdf/path.cpp -- Invalid prim name '028'
and our material name is 028
Let me know if you have something for us to test.
@sayduck-daniel I just merged an update with more special characters detected: https://github.com/kcoley/gltf2usd/pull/148
Hi,
It seems we have some exceptions coming up on our gltf2usd server when we use some special characters on the node or accessors names in the gltf file.
I get this exception
Below a sample of glTF file.