I have a .py script that runs at startup, it imports a camera, creates a levelsequence and renders it. When unreal executes the file at startup it gets stuck on the “Discovering Asset Data” window. Unreal 5.1.
I’ve removed the code piece by piece and this line seems to cause it to be stuck:
sel.append(unreal.EditorAssetLibrary.load_asset( LevelSequencePath )) could be causing the engine to become stuck if the path is incorrect or if the asset cannot be found. It’s also possible that this line of code is causing the engine to load a large number of assets, which can slow down the startup process and cause the editor to become unresponsive.
One possible solution is to remove this line of code and see if the issue persists. If the problem is caused by a large number of assets, you can try to optimize your script by only loading the assets that are necessary for the script to run.
Another solution would be to run your script after the editor has fully loaded and initialized, you can use a timer to wait for a few seconds after the editor starts, then execute the script.
It’s also possible that the problem is caused by the specific asset that you’re trying to load, in this case, you can try to load a different asset or a different path to see if the issue persists.
Other than this, I do not really know what could be the main cause.
I’ve removed the line of code and everything works, I found a workaround in my script so it now runs without using that piece of code, so luckily it’s not a problem for me anymore
The bug only happens when the scripts runs as a startup script, the number of assets in the “Discovering Asset Data” is changing from 1000+ assets to 600+ and 500+.
If I execute the file after a few seconds it executes without any issues. I did rename some of the folders that the unreal project folder lies in, so that might have caused some issues.