PixarAnimationStudios / OpenUSD

Universal Scene Description

Home Page:http://www.openusd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Global Variables & String Substitution feature suggestion

BSalem opened this issue · comments

This is not actually an issue, but a feature suggestion...

I wish if I can set global variables/properties on the stage level (or probably under 'globals' namespace, and to have the option to use them as variables in the file paths of usd references and texture paths.... etc, then these paths to be resolved on usd stage load.

Then when we can have the option to import global variables override usd, that overrides the global variables and accordingly overrides the paths to everything else referenced based on these global variables.

Examples of use:

  • In usdview for instance, we can change the 'shot_no' global variable, then all loaded assets with shot_no variable in their path expression, will resolve and we can switch between shots.

  • We can switch between different 'looks' version, let's say the materials is referenced from leather_{globals:version=v001}.usd (which means version equals v001 by default), then we can set the global variable 'version' to v002, 3 to switch between different looks and so on.

Hi @BSalem - good to hear from you again after a long while! Although you may need to tweak your thinking just a bit, I believe our USD Expression Variables feature provides what you're looking for, and a bit more (you can use variable expressions for variant selections, as well!). This feature was fully deployed in 23.11 (and mostly final in 23.08). Please have a read and try it out, and let us know here or on the forum.openusd.org if you have any questions.

Hi Sepastian @spiffmon
Wow, that's wonderful, super amazing! I regret that I didn't know about it till now.
Thanks

Filed as internal issue #USD-9597

Going to close, for now!