From 70ed7abeb5d4201965570bbc88ee53e68587c4d2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 7 May 2021 15:13:50 +0200 Subject: [PATCH] added projectmanager to openpype cli commands --- openpype/cli.py | 5 +++++ openpype/pype_commands.py | 6 ++++++ tools/run_project_manager.ps1 | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tools/run_project_manager.ps1 diff --git a/openpype/cli.py b/openpype/cli.py index 9c49825721..df38c74a21 100644 --- a/openpype/cli.py +++ b/openpype/cli.py @@ -224,6 +224,11 @@ def launch(app, project, asset, task, PypeCommands().run_application(app, project, asset, task, tools, arguments) +@main.command(context_settings={"ignore_unknown_options": True}) +def projectmanager(): + PypeCommands().launch_project_manager() + + @main.command( context_settings=dict( ignore_unknown_options=True, diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index 981cca82dc..326ca8349a 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -110,6 +110,12 @@ class PypeCommands: with open(output_json_path, "w") as file_stream: json.dump(env, file_stream, indent=4) + @staticmethod + def launch_project_manager(): + from openpype.tools import project_manager + + project_manager.main() + def texture_copy(self, project, asset, path): pass diff --git a/tools/run_project_manager.ps1 b/tools/run_project_manager.ps1 new file mode 100644 index 0000000000..78dce19df1 --- /dev/null +++ b/tools/run_project_manager.ps1 @@ -0,0 +1,18 @@ +<# +.SYNOPSIS + Helper script OpenPype Tray. + +.DESCRIPTION + + +.EXAMPLE + +PS> .\run_tray.ps1 + +#> +$current_dir = Get-Location +$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent +$openpype_root = (Get-Item $script_dir).parent.FullName +Set-Location -Path $openpype_root +& poetry run python "$($openpype_root)\start.py" projectmanager +Set-Location -Path $current_dir