first time poster.
I am currently starting a project where I would like to automate a set of tasks. It means exporting meshes from one programme and porting them over to Unreal, using Python outside of Unreal to start with before setting up the scene and carrying out other tasks within Unreal.
Initially I assumed that I could use subprocess / Popen to open up the project. I believe this can only be done from an exe.
I think the best way I can start this project off is by having a templated project which I can somehow open and within it have a python script ready to run on when it opens to carry out particular steps.
But to start this off - how can I open up a .uproject in python?
And secondly would anyone have any decent further literature on this subject - namely focusing around Unreal and Python - but accessing it’s features potentially from the outside.
Any information is truly appreciated.
Welcome! We’re SO excited to welcome you to the Unreal Engine community! There’s so much you can do here! Earn badges through participation! Explore the forums! Find out what’s new! Connect with fellow members! Here are our Community Guidelines on how to be a rockstar member. Thank you for being an important part of building a stronger community!
I have looked into the dilemma you are facing and have found a resource for you to check out. Please review our documentation on Scripting the Editor using Python here. Please let us know if you have additional questions.
Maybe a bit late, but for people having a similar question, I hope my post can still be useful.
Since Unreal can be run from the command line, subprocess can indeed be used to have Python start your Unreal environment programmatically.
You can run your game as a binary, but Running Unreal Engine | Unreal Engine 4.27 Documentation describes how to run your game via the UE4Editor by calling the .uproject file. You can either just open the file or already run it as a game using the “-game” tag.
You can then use this command as input in your subprocess function call.
In my case, I did the following, which works for me:
Hope it helps!