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

Sanitise node names #182

Closed
ghost opened this issue Dec 4, 2019 · 5 comments
Closed

Sanitise node names #182

ghost opened this issue Dec 4, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 4, 2019

This glTF does not convert and trow this error:

Warning: in SdfPath at line 97 of /tmp/USD-19.11/pxr/usd/lib/sdf/path.cpp -- Ill-formed SdfPath </root/Hay_+undefined__101>: syntax error
Traceback (most recent call last):
  File "/usr/local/gltf2usd/Source/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 "/usr/local/gltf2usd/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 "/usr/local/gltf2usd/Source/gltf2usd.py", line 75, in __init__
    self.convert()
  File "/usr/local/gltf2usd/Source/gltf2usd.py", line 801, in convert
    self.convert_nodes_to_xform()
  File "/usr/local/gltf2usd/Source/gltf2usd.py", line 91, in convert_nodes_to_xform
    self._convert_node_to_xform(node, parent_transform)
  File "/usr/local/gltf2usd/Source/gltf2usd.py", line 102, in _convert_node_to_xform
    xformPrim = UsdGeom.Xform.Define(self.stage, '{0}/{1}'.format(usd_xform.GetPath(), GLTF2USDUtils.convert_to_usd_friendly_node_name(node.name)))
pxr.Tf.ErrorException: 
    Error in 'pxrInternal_v0_19__pxrReserved__::UsdStage::_IsValidPathForCreatingPrim' at line 3019 in file /tmp/USD-19.11/pxr/usd/lib/usd/stage.cpp : 'Path must be an absolute path: <>'

It appears to be related to the node name "Hay-+undefined-". The + sign seems to break it and it shouldn't because it is valid for the glTF spec.

@ephb
Copy link

ephb commented Dec 4, 2019

The same is true for the the exclamation mark ! and underscore _ sign as well as any umlauts like"äöü".

@ghost
Copy link
Author

ghost commented Dec 5, 2019

This is quote blocking for us, any chance you could look at it @kcoley :) ?

@ephb
Copy link

ephb commented Dec 5, 2019

@sayduck-daniel can't you change your node names? This is the way I currently work around this.

@kcoley
Copy link
Owner

kcoley commented Dec 7, 2019

The issue here is that the USD API has more restrictions on supported characters than glTF. It may be better in this case to try to change your node names

@ghost
Copy link
Author

ghost commented Dec 10, 2019

We did it on our side. But I still think the gltf2usd should always work when we give him a valid glTF, specially when this glTF could come from a user and pass a glTF validator test.

@ghost ghost closed this as completed Dec 10, 2019
This issue was closed.
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