Merge pull request #746 from pypeclub/bugfix/unreal-4.26-basic-support

Unreal: add 4.26 support
This commit is contained in:
Milan Kolar 2020-12-02 14:34:10 +01:00 committed by GitHub
commit 806ffa74b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View file

@ -246,15 +246,18 @@ def create_unreal_project(project_name: str,
with open(project_file, mode="w") as pf:
json.dump(data, pf, indent=4)
# ensure we have PySide installed in engine
# TODO: make it work for other platforms 🍎 🐧
if platform.system().lower() == "windows":
python_path = os.path.join(engine_path, "Engine", "Binaries",
"ThirdParty", "Python", "Win64",
"python.exe")
# UE < 4.26 have Python2 by default, so we need PySide
# but we will not need it in 4.26 and up
if int(ue_version.split(".")[1]) < 26:
# ensure we have PySide installed in engine
# TODO: make it work for other platforms 🍎 🐧
if platform.system().lower() == "windows":
python_path = os.path.join(engine_path, "Engine", "Binaries",
"ThirdParty", "Python", "Win64",
"python.exe")
subprocess.run([python_path, "-m",
"pip", "install", "pyside"])
subprocess.run([python_path, "-m",
"pip", "install", "pyside"])
if dev_mode or preset["dev_mode"]:
_prepare_cpp_project(project_file, engine_path)

View file

@ -55,7 +55,7 @@ def execute_hook(hook, *args, **kwargs):
module.__file__ = abspath
try:
with open(abspath) as f:
with open(abspath, errors='ignore') as f:
six.exec_(f.read(), module.__dict__)
sys.modules[abspath] = module