Is there any form of validation for relationship attributes? And on that same note, even if USD itself doesn’t validate, is there a way to express the restrictions?
II think the answer is no to both, but I just wanted to check in case I missed something.
The kinds of restrictions I was thinking of are:
Type validation e.g I material binding should only point to Material prims etc…
Cycle checking to prevent cyclical relationships
It would also be good to know what we do when a cycle is encountered. Is that purely up to the consuming app/render delegate?
Isn’t it technically possible in USD to set up a binding to a material path that doesn’t actually exist? If so, at what level would you expect this type checking to occur? On the stage composing?
I had seen e.g. Render Settings with Render Product relationships being able to map a relationship target even to a Render Product does not exist anymore.
Also, I haven’t seen any typing around any UsdRelationship myself so I’m not sure if there’s even a registry that says they can only bind to material prims. (Aside of that, couldn’t they also bind to Collections?)
Yeah I was thinking it wouldn’t necessarily be at author/write time but could be some kind of utility function or option on an attribute writer. So you could still author dangling ones, but check resolution at different times
Keep an eye out for our proposal on a general validation framework. We don’t want to generally do alot of validation within the core authoring code… and cycles aren’t always a proscribed thing though that one might make sense as a “general warning”…