Multi-apply schema naming limitations

I would like to have a multi apply schema that has an attribute that takes the following form.

domain:schema:__INSTANCE_NAME__

I can’t quite seem to make this work given the restrictions of schema gen.

I can’t include the namespace token in propertyNamespacePrefix, as it tries to make it a private token without camel casing it. So I can’t set propertyNamespacePrefix to domain:schema.

The best I can do is set propertyNamespacePrefix to domain and either

  • Change the order so the property name is domain:__INSTANCE_NAME__:schema
  • Drop schema from the property name so it’s just domain:__INSTANCE_NAME__
  • Include schema in propertyNamespacePrefix via camelcase (ie. domainSchema).

Are the restrictions by design or should propertyNamespacePrefix be more flexible? Thanks!

This is just a bug in the schema gen code that we hadn’t hit ye in practice. If it were an intentional restriction, usdGenSchema would’ve reported an error and failed to generate anything.

The generatedSchema.usda that is created is perfectly valid and the prefix token is correctly generated in the library’s token.h file. The bug is that the schema class cpp generation should be using the publicly generated prefix token instead of declaring its own incorrect private token.

Thanks Cory. Would you like a PR with a proposed fix?