diff --git a/openpype/cli.py b/openpype/cli.py index 8438703bd3..512bd4663b 100644 --- a/openpype/cli.py +++ b/openpype/cli.py @@ -282,6 +282,34 @@ def projectmanager(): PypeCommands().launch_project_manager() +@main.command() +@click.argument("output_path") +@click.option("--project", help="Define project context") +@click.option("--asset", help="Define asset in project (project must be set)") +@click.option( + "--strict", + is_flag=True, + help="Full context must be set otherwise dialog can't be closed." +) +def contextselection( + output_path, + project, + asset, + strict +): + """Show Qt dialog to select context. + + Context is project name, asset name and task name. The result is stored + into json file which path is passed in first argument. + """ + PypeCommands.contextselection( + output_path, + project, + asset, + strict + ) + + @main.command( context_settings=dict( ignore_unknown_options=True, diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index e2869a956d..a850200abe 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -293,6 +293,12 @@ class PypeCommands: project_manager.main() + @staticmethod + def contextselection(output_path, project_name, asset_name, strict): + from openpype.tools.context_dialog import main + + main(output_path, project_name, asset_name, strict) + def texture_copy(self, project, asset, path): pass