-
Notifications
You must be signed in to change notification settings - Fork 855
Add calls to AssetDatabase.StartAssetEditing and AssetDatabase.StopAs… #5786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add calls to AssetDatabase.StartAssetEditing and AssetDatabase.StopAs… #5786
Conversation
…setEditing around the loops which reimport all materials, significantly speeds up this process.
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP URP Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
Thanks for doing this PR. Could you add a changelog? (in hdrp and urp). |
note yamato is green error come from master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ock to be sure AssetDatabase.StopAssetEditing is called.
Yes, these calls exist back to 2018.4 (and beyond) so backporting should be fine: Have added changelog entries and also wrapped the calls with a try/finally block as suggested by latest docs on those functions. |
Waiting Felipe and urp qa approval. |
For QA: merging to be sure this optimization is in the official release of 21.2 |
…setEditing around the loops which reimport all materials, significantly speeds up this process.
Purpose of this PR
When upgrading HDRP/URP version a material reimport is triggered. This operation refreshes the asset database for each material. On larger projects this can take ~10 seconds each time we refresh, and with 100s or 1000s of materials this leads to a reimport time of maybe a couple of hours. By placing calls to AssetDatabase.StartAssetEditing and AssetDatabase.StopAssetEditing around the import loop we can avoid doing the refresh operation, cutting the import time from (in a real world case) 3 hours to 3 minutes. In the HDRP sample project the import time is roughly cut in half from 12 seconds to 6 seconds.
Testing status
Manually tested upgrading HDRP version with and without this change in the HDRP test project and a large real world project.