1

Add sub-project support

This commit is contained in:
Evan Pratten 2023-10-11 23:39:16 -04:00
parent 24353dd425
commit 7dddef47e8

@ -44,6 +44,13 @@ def main() -> int:
type=str,
required=True,
)
ap.add_argument(
"--sub-project",
"--sp",
help="Name of the sub-project to open",
type=str,
default=None,
)
ap.add_argument(
"--hou-version",
help="Houdini version to use. Defaults to latest",
@ -72,11 +79,14 @@ def main() -> int:
# Determine the project path
project_path = prepend_if_relative(HOUDINI_PROJECTS_DIR, Path(args.project))
project_save_file = project_path / f"{project_path.name}.hip"
project_save_file = project_path / (
f"{args.sub_project}.hip" if args.sub_project else f"{project_path.name}.hip"
)
logger.info(f"Opening project from: {project_path}")
# If the directory does not exist, create
project_path.mkdir(parents=True, exist_ok=True)
(project_path / "render").mkdir(parents=True, exist_ok=True)
# If allowed, set up env vars
hou_env_settings = {}