API#
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 omni.flux.asset_importer.core.AssetImporterModel(*args: Any, **kwargs: Any)#
Bases:
BaseModel
- at_least_one(v)#
Check if there is at least 1 asset
- data: List[pydantic.create_model]#
- class omni.flux.asset_importer.core.ImporterCore#
Bases:
object
- __init__()#
Importer that can convert batches of mesh files (i.e. fbx, obj, etc) to usd files.
- import_batch( )#
Function to convert batches of mesh files to usd.
Note
The config should conform to this format#{ "data": { "input_path": "filename.fbx", // the filename to be imported "output_path": "./output/file.usd", // the path to save the generated .usd file to. "output_usd_extension": "usd" // the extension to use for the USD file. // Only used if using 'default_output_folder' // any properties from omni.kit.asset_converter's AssetConverterContext object can be set here. } }
- Parameters:
batch_config – can be a json file path or a dictionary.
default_output_folder – the folder to place outputs in. Overridden by “output_path” in batch_config.
- async import_batch_async( )#
As import_batch, but async.
- async import_batch_async_with_error( )#
As import_batch, but async without error handling. This is meant for testing.
- subscribe_batch_finished(
- callback: Callable[[bool], Any],
Return the object that will automatically unsubscribe when destroyed.
- subscribe_batch_progress(
- callback: Callable[[float], Any],
Return the object that will automatically unsubscribe when destroyed.
- omni.flux.asset_importer.core.destroy_scanner_dialog()#
- omni.flux.asset_importer.core.determine_ideal_types(
- paths: List[str],
- pref_normal_conv: TextureTypes | None = None,
Will try to determine the TextureType based on the filename. If no TextureType can be found, no entry will be added to the returned dictionary.
- omni.flux.asset_importer.core.get_texture_sets(
- paths: List[str],
From a list of paths, return a list of set of textures
- Parameters:
paths – the texture paths
- Returns:
Set of textures
- omni.flux.asset_importer.core.get_texture_type_from_filename(
- filename: str,
- omni.flux.asset_importer.core.parse_texture_paths(paths_to_parse, required_ext='dds')#
From a list of paths, return a dictionary with the paths broken up by _-. or capital letter
- Parameters:
paths_to_parse – the texture paths
required_ext – the texture extension
- Returns:
dictionary of parsed textures
- omni.flux.asset_importer.core.scan_folder()#
- omni.flux.asset_importer.core.setup_scanner_dialog(callback: dict[str, Callable])#