mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #5066 from ynput/bugfix/OP-6078-unreal-commandlet_project_permissions
This commit is contained in:
commit
4a81b5a87a
2 changed files with 17 additions and 2 deletions
|
|
@ -6,6 +6,8 @@ import subprocess
|
|||
from distutils import dir_util
|
||||
from pathlib import Path
|
||||
from typing import List, Union
|
||||
import tempfile
|
||||
from distutils.dir_util import copy_tree
|
||||
|
||||
import openpype.hosts.unreal.lib as ue_lib
|
||||
|
||||
|
|
@ -90,9 +92,20 @@ class UEProjectGenerationWorker(QtCore.QObject):
|
|||
("Generating a new UE project ... 1 out of "
|
||||
f"{stage_count}"))
|
||||
|
||||
# Need to copy the commandlet project to a temporary folder where
|
||||
# users don't need admin rights to write to.
|
||||
cmdlet_tmp = tempfile.TemporaryDirectory()
|
||||
cmdlet_filename = cmdlet_project.name
|
||||
cmdlet_dir = cmdlet_project.parent.as_posix()
|
||||
cmdlet_tmp_name = Path(cmdlet_tmp.name)
|
||||
cmdlet_tmp_file = cmdlet_tmp_name.joinpath(cmdlet_filename)
|
||||
copy_tree(
|
||||
cmdlet_dir,
|
||||
cmdlet_tmp_name.as_posix())
|
||||
|
||||
commandlet_cmd = [
|
||||
f"{ue_editor_exe.as_posix()}",
|
||||
f"{cmdlet_project.as_posix()}",
|
||||
f"{cmdlet_tmp_file.as_posix()}",
|
||||
"-run=AyonGenerateProject",
|
||||
f"{project_file.resolve().as_posix()}",
|
||||
]
|
||||
|
|
@ -111,6 +124,8 @@ class UEProjectGenerationWorker(QtCore.QObject):
|
|||
gen_process.stdout.close()
|
||||
return_code = gen_process.wait()
|
||||
|
||||
cmdlet_tmp.cleanup()
|
||||
|
||||
if return_code and return_code != 0:
|
||||
msg = (
|
||||
f"Failed to generate {self.project_name} "
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@
|
|||
"preroll_frames": 0,
|
||||
"render_format": "png",
|
||||
"project_setup": {
|
||||
"dev_mode": true
|
||||
"dev_mode": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue