lightspeed.trex.project_wizard.core#
SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- class lightspeed.trex.project_wizard.core.ProjectWizardCore#
Bases:
object
- CONTEXT_NAME = 'ProjectWizard'#
- need_deps_directory_symlink(
- model: ProjectWizardSchema | None = None,
- schema: Dict | None = None,
- need_project_directory_symlink(
- model: ProjectWizardSchema | None = None,
- schema: Dict | None = None,
- setup_project(
- schema: Dict,
- dry_run: bool = False,
Run the project setup using the given schema.
- Parameters:
schema – the schema to use for the project creation. Please see the documentation.
dry_run – whether a dry run or a “real” run should be performed.
Examples
>>> ProjectWizardCore( >>> { >>> "existing_project": False, >>> "project_path": Path("R:\Remix\projects\MyProject\my_project.usda") >>> "remix_directory": Path("R:\Remix\rtx-remix"), >>> "mod_file": Path("R:\Remix\rtx-remix\mods\ExistingMod1\existing_mod_1.usda"), >>> "existing_mods": [ >>> Path("R:\Remix\rtx-remix\mods\ExistingMod1\existing_mod_1.usda") >>> ], >>> "capture_file": Path("R:\Remix\rtx-remix\captures\capture_1.usda"), >>> } >>>)
- async setup_project_async(
- schema: Dict,
- dry_run: bool = False,
Asynchronous implementation of setup_project
- async setup_project_async_with_exceptions(
- schema: Dict,
- dry_run: bool = False,
Asynchronous implementation of setup_project, but async without error handling. This is meant for testing.
- subscribe_log_error(
- callback: Callable[[str], Any],
Return the object that will automatically unsubscribe when destroyed.
- subscribe_log_info(
- callback: Callable[[str], Any],
Return the object that will automatically unsubscribe when destroyed.
- subscribe_run_finished(
- callback: partial | Callable[[bool, str | None], Any],
Return the object that will automatically unsubscribe when destroyed.
- subscribe_run_progress(
- callback: Callable[[float], Any],
Return the object that will automatically unsubscribe when destroyed.
- class lightspeed.trex.project_wizard.core.ProjectWizardKeys(value)#
Bases:
Enum
An enumeration.
- CAPTURE_FILE = 'capture_file'#
- EXISTING_MODS = 'existing_mods'#
- EXISTING_PROJECT = 'existing_project'#
- MOD_FILE = 'mod_file'#
- PROJECT_FILE = 'project_file'#
- REMIX_DIRECTORY = 'remix_directory'#
- pydantic model lightspeed.trex.project_wizard.core.ProjectWizardSchema#
Bases:
BaseModel
Show JSON schema
{ "title": "ProjectWizardSchema", "type": "object", "properties": { "existing_project": { "title": "Existing Project", "type": "boolean" }, "project_file": { "format": "path", "title": "Project File", "type": "string" }, "remix_directory": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Remix Directory" }, "existing_mods": { "anyOf": [ { "items": { "format": "path", "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Existing Mods" }, "mod_file": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Mod File" }, "capture_file": { "anyOf": [ { "format": "path", "type": "string" }, { "type": "null" } ], "default": null, "title": "Capture File" } }, "required": [ "existing_project", "project_file" ] }
- Fields:
capture_file (pathlib.Path | None)
existing_mods (List[pathlib.Path] | None)
existing_project (bool)
mod_file (pathlib.Path | None)
project_file (pathlib.Path)
remix_directory (pathlib.Path | None)
- Validators:
_are_all_mod_files_valid
»existing_mods
_is_capture_file_valid
»capture_file
_is_mod_file_valid
»mod_file
_is_project_file_valid
»project_file
_is_remix_directory_valid
»remix_directory
- field capture_file: Path | None = None#
- Validated by:
_is_capture_file_valid
- field existing_mods: List[Path] | None = None#
- Validated by:
_are_all_mod_files_valid
- field existing_project: bool [Required]#
- field mod_file: Path | None = None#
- Validated by:
_is_mod_file_valid
- field project_file: Path [Required]#
- Validated by:
_is_project_file_valid
- field remix_directory: Path | None = None#
- Validated by:
_is_remix_directory_valid
- classmethod are_all_mod_files_valid(v, values: dict)#
Check that the paths are valid mod layers
- classmethod are_project_symlinks_valid(
- project_path: Path,
- classmethod is_capture_file_valid(v, values: dict)#
Check that the file is a valid capture file or None
- classmethod is_mod_file_valid(v, values: dict)#
Check that the file is a valid mod file or None
- classmethod is_project_file_valid(v, values: dict)#
Check that the path is a valid project file
- classmethod is_remix_directory_valid(v, values: dict)#
Check that the path is a valid capture directory