PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.45k stars 1.13k forks source link

OpenUSD allows whitespace in applied schema instance names #3067

Open nvmkuruc opened 2 weeks ago

nvmkuruc commented 2 weeks ago

Description of Issue

OpenUSD allows whitespace in applied schema instance names. As whitespace is not allowed in OpenUSD property names, a schema may fail to create properties that include the instance name.

It's been requested that instance names are restricted to only be valid property identifiers to avoid this issue.

https://forum.aousd.org/t/guidance-for-api-schema-instance-names/1498

Steps to Reproduce

from pxr import Usd
s = Usd.Stage.CreateInMemory()
p = s.DefinePrim("/root")
c = Usd.CollectionAPI.Apply(p, 'name with spaces')
print(s.GetRootLayer().ExportToString())
c.CreateIncludesRel()

should produce this exception.

'Cannot create a relationship on /root with invalid name: collection:name with spaces:includes'

System Information (OS, Hardware)

Package Versions

Build Flags

jesschimein commented 1 week ago

Filed as internal issue #USD-9620