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

  • https://www.apache.org/licenses/LICENSE-2.0

  • 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'#
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,
) tuple[bool, str | None]#

Asynchronous implementation of setup_project

async setup_project_async_with_exceptions(
schema: Dict,
dry_run: bool = False,
) tuple[bool, str | None]#

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'#
class lightspeed.trex.project_wizard.core.ProjectWizardSchema(*args: Any, **kwargs: Any)#

Bases: BaseModel

are_all_mod_files_valid(v, values)#

Check that the paths are valid mod layers

capture_file: Path | None#
existing_mods: List[Path] | None#
existing_project: bool#
is_capture_file_valid(v, values)#

Check that the file is a valid capture file or None

is_mod_file_valid(v, values)#

Check that the file is a valid mod file or None

is_project_file_valid(v, values)#

Check that the path is a valid project file

is_remix_directory_valid(v, values)#

Check that the path is a valid capture directory

mod_file: Path | None#
project_file: Path#
remix_directory: Path | None#