PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.14k stars 1.22k forks source link

Call `UpdateAssetInfo` after layer is saved #3402

Open roggiezhang-nv opened 1 week ago

roggiezhang-nv commented 1 week ago

Description of Issue

Is there any reason why UpdateAssetInfo is not called after layer is saved? Forgetting that may cause out of sync issue for layer's version info if any customized resolver has valid version info needs to be updated.

Steps to Reproduce

from pxr import Usd, Sdf

stage = Usd.Stage.Open("xxxx") 
stage.Save()
print(stage.GetRootLayer().version)
stage.DefinePrim("/test")
stage.Save()
print(stage.GetRootLayer().version)
stage.GetRootLayer().UpdateAssetInfo()
print(stage.GetRootLayer().version)

This snippet may not print valid information for stock USD. You can reproduce it with any resolver that has valid version information for a layer (like Omniverse Composer).

System Information (OS, Hardware)

Package Versions

Build Flags

roggiezhang-nv commented 1 week ago

@nvmkuruc

jesschimein commented 1 week ago

Filed as internal issue #USD-10404