My script works in the Editor but fails when run from Cmdlet:
Command line:
"C:\Program Files\Epic Games\UE_4.21\Engine\Binaries\Win64\UE4Editor-Cmd.exe" "/path/to/my.uproject" -run=pythonscript -script="/path/to/select_assets.py"
The code:
import unreal as ue
toselect = [ '/Game/Path/To/MyAsset1', '/Game/Path/To/MyAsset2', ]
ue.EditorAssetLibrary.sync_browser_to_objects(toselect)
Running this from the Editor I would see the selected objects listed in the Content Browser’s main view.
However, other than a console window pops up (see screenshot), nothing happens in the Editor.
What am I missing?