and now it happens again. so it does not always happen !
Operating System Windows 10 // Ubuntu 20.04
GPU / GPU Driver Quadro P600 / 526.67 // RTX 2060
Application(s) Used / Version Number Create 2022.3.3
Full log file (if applicable)
Steps
Create a a Cube (Mash or Shape doens’t matter)
Select one of the created
Open the Script editor
Paste the two lines of code from above and hit “Run”
Still no luck for me in reproducing it. If you can attach the log files, we can at least look through the logs to hopefully understand why/when it happens.
Oh, that’s helpful. There are other errors in there about using an invalid stage. I think the problem may be somewhere else in your code. That you’re using omni.usd.get_context().get_stage() to get the UsdStage object that you’re using. This is typically the Stage that is open in the app and the one you want to interact with.
It actually looks like during the start phase of omniverse there is no stage for the extension and therefor got that error wenn accessing it in the init phase.
I have put the get_stage infront of any access. Works but just does not look nice in the code. @mati-nvidia thanks keep looking at it
Hi @volker.kuehn. Yes, it’s expected that the default stage may not be loaded when your extension starts. Another case that you want to watch out for is that user can close and open a new stage since your extension started, so it’s on the developer to get the current stage and make sure that it’s valid throughout. You can use StageEvents for that: Omni.USD — omni.kit.usd_docs 1.1.1 documentation
that’s a really valuable hint !
The code does look a bit different from what you usually see in the documentation and I have to admit I don’t understand everything right now, I’ll keep it in the belt for once I have more knowledge.