20tab / UnrealEnginePython

Embed Python in Unreal Engine 4
MIT License
2.75k stars 746 forks source link

Command Line Switch "ExecutePythonScript" not working with UnrealEnginePython #432

Open c0ffymachyne opened 6 years ago

c0ffymachyne commented 6 years ago

I have to run some project assembly process from within the command line and this flag seems to only be working with UE4's native python. How can I use it with your extension ? Is there any other way to run python script right after project has been opened (from command line without any user interaction).

Thank you.

rdeioris commented 6 years ago

Hi, the plugin will automatically import Scripts/ue_site.py on boot. This is where you can put initialization/automatic code.

A more powerful alternative is the commandlet mode:

-run=PyCommandlet path_to_python_script.py

that will avoid apening the whole editor

c0ffymachyne commented 6 years ago

I am not sure when ue_site.py is being called but it gives me ImportError:

LogPython: Error: cannot import name PyFbxFactory LogPython: Error: ImportError: cannot import name PyFbxFactory

Is this because the plugin is installed as a part of the project and not the editor itself ?

PyCommandlet does not seem to run the file at all (still trying to get it to work).

Code is OK and running successfully from the editor.

c0ffymachyne commented 6 years ago

Hi @rdeioris ,

Thank you so much for help !

PyCommandlet is running the script. I believe it does not like dots in the middle of the filepath and does not seem to work with relative paths "/Game/Scripts/...".

unbit commented 6 years ago

Hi, you may want to check this:

https://github.com/20tab/UnrealEnginePython/issues/268

c0ffymachyne commented 6 years ago

Hi @unbit ,

Thanks, I will give this this a try.

Hi @rdeioris,

Running the same code via PyCommandlet and UEP Editor yields different results. PyCommandlet execution is not creating a Skeleton for SkeletalMesh in case of FBX import. I have tried default importUI settings but no luck. Do I have to create Skeleton manually and assign it to the mesh.Skeleton ?