TheFoundryVisionmongers / KatanaUsdPlugins

Katana USD Plugins Repo
Other
47 stars 20 forks source link

Unreliable instance sources #25

Open ainaerco opened 3 years ago

ainaerco commented 3 years ago

Porting the issue from usd github: https://github.com/PixarAnimationStudios/USD/issues/1034

Inside BuildInstanceMasterMapping function masters getting m0, m1, m2 names: https://github.com/TheFoundryVisionmongers/KatanaUsdPlugins/blob/20.08/lib/usdKatana/utils.cpp#L1731 Problem is masters order may change upon re-reading the stage. Therefore any modification inside Katana you do to 'm0' may suddenly become applied to wrong master. We workaround this by modifying plugin and constructing master names using asset info (or asset name).

radon199 commented 3 years ago

It should be noted there are many different reasons why the plugin will spin up multiple mN masters for a single USD filepath. One is time offsets. When two assets use the same time offset they will come in as multiple mN masters.

You should be able to set USD_ASSIGN_PROTOTYPES_DETERMINISTICALLY to tell USD to generate the masters in an explicit order, which should cause the masters to be found in a specific order if you do need to key off of specific mN locations.