omni.flux.utils.material_converter

This is a simple utility to convert materials from a given shader to another shader.

  • 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.utils.material_converter.MaterialConverterCore

Bases: object

async static convert(context_name: str, converter: ConverterBase) Tuple[bool, Optional[str], bool]

Convert the material

Parameters
  • context_name – the context to use

  • converter – the converter to use

Returns

Success, message, skipped or not

async static find_matching_supported_material(input_shader_prim: Usd.Prim) Tuple[Optional[ConverterBase], Optional[_SupportedShaderInputs]]

Find the matching supported material from all inputs. It can happen that inside a MDL, a supported MDL is imported and some attributes are set. But the MDL is not supported. So to check if this is really supported, we check if the attributes are matching with a supported MDL

class omni.flux.utils.material_converter.NoneToAperturePBRConverterBuilder

Bases: omni.flux.utils.material_converter.base.converter_builder_base.ConverterBuilderBase

build(input_material_prim: Usd.Prim, output_mdl_subidentifier: str) omni.flux.utils.material_converter.base.converter_base.ConverterBase
class omni.flux.utils.material_converter.OmniGlassToAperturePBRConverterBuilder

Bases: omni.flux.utils.material_converter.base.converter_builder_base.ConverterBuilderBase

build(input_material_prim: Usd.Prim, output_mdl_subidentifier: str) omni.flux.utils.material_converter.base.converter_base.ConverterBase
class omni.flux.utils.material_converter.OmniPBRToAperturePBRConverterBuilder

Bases: omni.flux.utils.material_converter.base.converter_builder_base.ConverterBuilderBase

build(input_material_prim: Usd.Prim, output_mdl_subidentifier: str) omni.flux.utils.material_converter.base.converter_base.ConverterBase
class omni.flux.utils.material_converter.USDPreviewSurfaceToAperturePBRConverterBuilder

Bases: omni.flux.utils.material_converter.base.converter_builder_base.ConverterBuilderBase

build(input_material_prim: Usd.Prim, output_mdl_subidentifier: str) omni.flux.utils.material_converter.base.converter_base.ConverterBase