plugins#

  • 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 omni.flux.validator.factory.plugins.interface_base.IBase#

Bases: PluginBase, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: BaseModel, ABC

abstract property data_flow_compatible_name: list[str] | None#
abstract classmethod sanitize_uuid(v: str | None) str | None#
abstract async build_ui(schema_data: Any) Any#

Build the UI of a plugin

Parameters:

schema_data – the data of the plugin from the schema

Returns:

Anything from the implementation

abstract property data_type: type[pydantic.BaseModel]#
abstract property display_name: str | None#
abstract get_global_progress() float#

The value of the global progression of the validation

abstract get_progress() tuple[float, str, bool]#
abstract mass_build_queue_action_ui(
schema_data: Any,
default_actions: list[Callable[[], Any]],
callback: Callable[[str], Any],
) Any#

Default exposed action for Mass validation. The UI will be built into the delegate of the mass queue. Please implement your code using _mass_build_queue_action_ui()

abstract async mass_build_ui(schema_data: Any) Any#

Build the mass UI of a plugin. This function should not be overridden. Please implement your code using _mass_build_ui()

Parameters:

schema_data – the data of the plugin from the schema

Returns:

Anything from the implementation

abstract async mass_cook_template(
schema_data_template: Any,
) tuple[bool, str | None, list[Data]]#

Take a template as an input and the (previous) result, and edit the result for mass processing. For example, receive 1 template that has a context plugin with a list of files, and generate multiple schema from the template, with 1 input file for each template. Please implement your code using _mass_cook_template()

Parameters:

schema_data_template – the data of the plugin from the schema

Returns:

A tuple of the shape (TemplateCookingSuccess, ErrorMessage, CookingData)

abstract async on_crash(schema_data: Any, data: Any) None#

Function that will be called when a plugin crash

Parameters:
  • schema_data – the data of the plugin from the schema

  • data – any random data we want to pass

abstract on_mass_cook_template(
success: bool,
message: str,
data: Any,
)#

Return the object that will automatically unsubscribe when destroyed.

abstract on_progress(progress: float, message: str, result: bool)#

Set the progression of the plugin. Setting the attribute will fire self.__on_progress

abstract set_global_progress(value: float)#

The value of the global progression of the validation

abstract set_parent_schema(
schema: IBaseSchema,
)#

Set the schema

Parameters:

schema – the schema to set

abstract show(value: bool, schema_data: Any)#

Called whenever the plugin is show or hidden in the UI.

abstract subscribe_build_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

abstract subscribe_enable_validation(
callback: Callable[[bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

abstract subscribe_global_progress(
callback: Callable[[float], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

Parameters:

callback – function that should be called during the progress. float: the progress between 0.0 and 1.0 str: the message of the progress bool: the result of the plugin. At 1.0, it can be True or False.

abstract subscribe_mass_build_queue_action_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

abstract subscribe_mass_build_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

abstract subscribe_mass_cook_template(
callback: Callable[[tuple[bool, str | None, Any]], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

abstract subscribe_on_validation_is_ready_to_run(
callback: Callable[[int, bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

abstract subscribe_progress(
callback: Callable[[float, str, bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

Parameters:

callback – function that should be called during the progress. float: the progress between 0.0 and 1.0 str: the message of the progress bool: the result of the plugin. At 1.0, it can be True or False.

abstract subscribe_validator_run(
callback: Callable[[list[IBase], Enum, bool | None], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

abstract property tooltip: str#
class omni.flux.validator.factory.plugins.interface_base.IBaseSchema(*args: Any, **kwargs: Any)#

Bases: BaseModel, ABC

abstract destroy()#
abstract property instance: Any#
abstract classmethod is_registered(v: str) str#
  • 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 omni.flux.validator.factory.plugins.plugin_base.Base#

Bases: IBase, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: Data

class Config#

Bases: object

underscore_attrs_are_private = True#
validate_assignment = True#
channel: str = 'Default'#
cook_mass_template: bool = False#
property data_flow_compatible_name#
data_flows: list[_DataFlow] | None = None#
display_name_mass_template: str = None#
display_name_mass_template_tooltip: str = None#
expose_mass_queue_action_ui: bool = False#
expose_mass_ui: bool = False#
global_progress_value: float | None = 0.0#
progress: tuple[float, str, bool] | None = (0.0, 'Initializing', True)#
sanitize_uuid(v)#
uuid: str | None = None#
__init__()#
async build_ui(schema_data: Any) Any#

Build the UI of a plugin

Parameters:

schema_data – the data of the plugin from the schema

Returns:

Anything from the implementation

destroy()#
display_name: str | None = None#
get_global_progress() float#

The value of the global progression of the validation

get_progress() Tuple[float, str, bool]#
mass_build_queue_action_ui(
schema_data: Any,
default_actions: List[Callable[[], Any]],
callback: Callable[[str], Any],
) Any#

Default exposed action for Mass validation. The UI will be built into the delegate of the mass queue. Please implement your code using _mass_build_queue_action_ui()

async mass_build_ui(schema_data: Any) Any#

Build the mass UI of a plugin. This function should not be overridden. Please implement your code using _mass_build_ui()

Parameters:

schema_data – the data of the plugin from the schema

Returns:

Anything from the implementation

async mass_cook_template(
schema_data_template: Any,
) Tuple[bool, str | None, List[Data]]#

Take a template as an input and the (previous) result, and edit the result for mass processing. For example, receive 1 template that has a context plugin with a list of files, and generate multiple schema from the template, with 1 input file for each template. Please implement your code using _mass_cook_template()

Parameters:

schema_data_template – the data of the plugin from the schema

Returns:

A tuple of the shape (TemplateCookingSuccess, ErrorMessage, CookingData)

async on_crash(schema_data: Any, data: Any) None#

Function that will be called when a plugin crash

Parameters:
  • schema_data – the data of the plugin from the schema

  • data – any random data we want to pass

on_mass_cook_template(success, message, data)#

Return the object that will automatically unsubscribe when destroyed.

on_progress(progress: float, message: str, result: bool)#

Set the progression of the plugin. Setting the attribute will fire self.__on_progress

set_global_progress(value: float)#

The value of the global progression of the validation

set_parent_schema(
schema: IBaseSchema,
)#

Set the schema

Parameters:

schema – the schema to set

show(value: bool, schema_data: Any)#

Called whenever the plugin is show or hidden in the UI.

subscribe_build_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_enable_validation(
callback: Callable[[bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

subscribe_global_progress(
callback: Callable[[float], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

Parameters:

callback – function that should be called during the progress. float: the progress between 0.0 and 1.0 str: the message of the progress bool: the result of the plugin. At 1.0, it can be True or False.

subscribe_mass_build_queue_action_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_mass_build_ui(
callback: Callable[[Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_mass_cook_template(
callback: Callable[[Tuple[bool, str | None, Any]], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_on_validation_is_ready_to_run(
callback: Callable[[int, bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

subscribe_progress(
callback: Callable[[float, str, bool], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

Parameters:

callback – function that should be called during the progress. float: the progress between 0.0 and 1.0 str: the message of the progress bool: the result of the plugin. At 1.0, it can be True or False.

subscribe_validator_run(
callback: Callable[[List[Base], ValidatorRunMode, bool | None], Any],
)#

Return the object that will automatically unsubscribe when destroyed. Subscription that will let the plugin re-run a validation by itself.

class omni.flux.validator.factory.plugins.plugin_base.ValidatorRunMode(value)#

Bases: Enum

An enumeration.

BASE_ALL = 'base_all'#
BASE_ONLY_SELECTED = 'base_only_selected'#
BASE_SELF_TO_END = 'base_self_to_end'#
  • 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 omni.flux.validator.factory.plugins.schema_base.BaseSchema(*args: Any, **kwargs: Any)#

Bases: IBaseSchema

class Config#

Bases: object

__init__(**data)#
data: _IBase.Data#
destroy()#
enabled: bool = True#
property instance#
is_registered(v)#
name: str#
  • 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 omni.flux.validator.factory.plugins.check_base.CheckBase#

Bases: Base, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: Data

last_check_message: str | None = None#
last_check_result: bool | None = None#
last_check_timing: float | None = None#
last_fix_message: str | None = None#
last_fix_result: bool | None = None#
last_fix_timing: float | None = None#
__init__()#
async check(
schema_data: Data,
context_plugin_data: SetupDataTypeVar,
selector_plugin_data: Any,
) Tuple[bool, str, Any]#

Function that will be called to check the data

Parameters:
  • schema_data – the data from the schema.

  • context_plugin_data – the data from the context plugin

  • selector_plugin_data – the data from the selector plugin

Returns:

True if the check passed, False if not. If the check is True, it will NOT run the fix str: the message you want to show, like “Succeeded to check this” any: data that you want to pass. For now this is used no where. So you can pass whatever you want (None)

Return type:

bool

async fix(
schema_data: Data,
context_plugin_data: SetupDataTypeVar,
selector_plugin_data: Any,
) Tuple[bool, str, Any]#

Function that will be called to fix the data if the fix function return False

Parameters:
  • schema_data – the data from the schema.

  • context_plugin_data – the data from the context plugin

  • selector_plugin_data – the data from the selector plugin

Returns:

True if the fix passed, False if not. str: the message you want to show, like “Succeeded to fix this” any: data that you want to pass. For now this is used no where. So you can pass whatever you want (None)

Return type:

bool

subscribe_check(
callback: Callable[[Any, str, Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_fix(
callback: Callable[[Any, str, Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

class omni.flux.validator.factory.plugins.check_base.Schema(*args: Any, **kwargs: Any)#

Bases: BaseSchema

at_least_one(v)#

Check that we have at least 1 selector plugin

context_plugin: Schema#
pause_if_fix_failed: bool = True#
resultor_plugins: List[Schema] | None#
selector_plugins: List[Schema]#
stop_if_fix_failed: bool = False#
  • 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 omni.flux.validator.factory.plugins.context_base.ContextBase#

Bases: Base, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: Data

hide_context_ui: bool = False#
last_check_message: str | None = None#
last_check_result: bool | None = None#
last_check_timing: float | None = None#
last_on_exit_message: str | None = None#
last_on_exit_result: bool | None = None#
last_on_exit_timing: float | None = None#
last_set_message: str | None = None#
last_set_result: bool | None = None#
last_set_timing: float | None = None#
__init__()#
async check(
schema_data: Data,
parent_context: SetupDataTypeVar,
) Tuple[bool, str]#

Function that will be called to check the data. For example, check that a USD stage is open, or a USD file path exist

Parameters:
  • schema_data – the data that should be checked

  • parent_context – context data from the parent context

Returns:

True if the check passed, False if not. str: the message you want to show, like “Succeeded to check this context”

Return type:

bool

async on_exit(
schema_data: Data,
parent_context: SetupDataTypeVar,
) Tuple[bool, str]#

Function that will be called to after the check of the data. For example, save the input USD stage

Parameters:
  • schema_data – the data that should be checked

  • parent_context – context data from the parent context

Returns:

True if the on exit passed, False if not. str: the message you want to show, like “Succeeded to exit this context”

Return type:

bool

async setup(
schema_data: Data,
run_callback: Callable[[SetupDataTypeVar], Awaitable[None]],
parent_context: SetupDataTypeVar,
) Tuple[bool, str, SetupDataTypeVar]#

Function that will be called to set the data. For a context plugin, it will grab the data that we want to pass them to check plugin. From example, open a USD file and grab the prims. Or grab prims from an opened stage.

Parameters:
  • schema_data – the data that should set. Same data than check()

  • run_callback – the validation that will be run in the context of this setup

  • parent_context – context data from the parent context

Returns:

True if the setup passed, False if not. str: the message you want to show, like “Succeeded to setup this” any: data that you want to pass. Those data will be passed and used by the selector(s) and check(s) plugins. Like a USD stage.

Return type:

bool

subscribe_check(
callback: Callable[[bool, str], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_on_exit(
callback: Callable[[bool, str], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

subscribe_set(
callback: Callable[[bool, str, SetupDataTypeVar], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

class omni.flux.validator.factory.plugins.context_base.Schema(*args: Any, **kwargs: Any)#

Bases: BaseSchema

resultor_plugins: List[Schema] | None#
  • 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 omni.flux.validator.factory.plugins.resultor_base.ResultorBase#

Bases: Base, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: Data

last_resultor_message: str | None = None#
last_resultor_result: bool | None = None#
last_resultor_timing: float | None = None#
__init__()#
async result(
schema_data: Data,
schema: pydantic.BaseModel,
) tuple[bool, str]#

Function that will be called to work on the result

Parameters:
  • schema_data – the data from the schema.

  • schema – the whole schema ran by the manager

Returns:

True if the result passed, False if not. str: the message you want to show, like “Succeeded to write the result here”

Return type:

bool

subscribe_result(
callback: Callable[[bool, str], Any],
)#

Return the object that will automatically unsubscribe when destroyed.

class omni.flux.validator.factory.plugins.resultor_base.Schema(*args: Any, **kwargs: Any)#

Bases: BaseSchema

  • 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 omni.flux.validator.factory.plugins.selector_base.Schema(*args: Any, **kwargs: Any)#

Bases: BaseSchema

class omni.flux.validator.factory.plugins.selector_base.SelectorBase#

Bases: Base, ABC

class Data(*args: Any, **kwargs: Any)#

Bases: Data

last_select_message: str | None = None#
last_select_result: bool | None = None#
last_select_timing: float | None = None#
__init__()#
async select(
schema_data: Data,
context_plugin_data: SetupDataTypeVar,
selector_plugin_data: Any,
) Tuple[bool, str, Any]#

Function that will be called to select the data

Parameters:
  • schema_data – the data from the schema.

  • context_plugin_data – the data from the context plugin

  • selector_plugin_data – the data from the previous selector plugin

Returns:

True if the selector passed, False if not. str: the message you want to show, like “Succeeded to select this” any: data that you want to pass. Those data will be passed and used by the check(s) plugins. Like a list of USD prims.

Return type:

bool

subscribe_select(
callback: Callable[[bool, str, Any], Any],
)#

Return the object that will automatically unsubscribe when destroyed.