OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Warning when creating `foo` and `foo:includes` collections

Open johnhaddon opened this issue 5 months ago • 1 comments

As discussed in https://forum.aousd.org/t/guidance-for-api-schema-instance-names/1498, USD issues a warning if both foo and foo:includes collections are authored on the same prim. This can be seen by executing the following example code :

stage = Usd.Stage.CreateInMemory( "test" )
prim = stage.DefinePrim( "/Test" )
Usd.CollectionAPI.Apply( prim, "foo" )
Usd.CollectionAPI.Apply( prim, "foo:includes" )
Usd.CollectionAPI.GetAllCollections( prim )

Which yields the following warning :

Warning: in _PropertyTypesMatch at line 257 of /.../primDefinition.cpp -- Cannot compose schema specs: Schema relationship spec at path '/CollectionAPI.collection:__INSTANCE_NAME__:includes' in layer 'anon:0x7f4f19446080' is a different spec type than schema attribute spec at path '/CollectionAPI.collection:__INSTANCE_NAME__' in layer 'anon:0x7f4f19446080'.

It would be great if this restriction could be removed.

johnhaddon avatar Aug 27 '24 09:08 johnhaddon