omni.kit.material.library

Material Library

Python API Reference

class omni.kit.material.library.CreateAndBindMdlMaterialFromLibrary(mdl_name: str, mtl_name: str = '', mtl_created_list: Optional[list] = None, bind_selected_prims: list = False, select_new_prim: bool = True, prim_name: str = '')

Creates material prim from Core MDL Libray, and bind to provided prim list.

Parameters
  • mdl_name (str) – MDL name from Core MDL Library.

  • mtl_name (str) – The material name from MDL. It’s also the sub-identifier to be used for the shader. If prim_name param is not specified, it will also be used as the prim_name. If mtl_name is empty, it will use file name of mdl_name (without extension) by default.

  • bind_selected_prims (List[Sdf.Path]) – Prims to be bound to the new created material prim.

  • select_new_prim – If it’s to select the new created material prim.

  • prim_name (str) – The prim name to be created. It will be created with path “/$RootPrimName/Looks/$prim_name”. If prim_name is not specified, it will use mtl_name instead.

do()
undo()
class omni.kit.material.library.CreateAndBindPreviewSurfaceFromLibrary(mtl_created_list: Optional[list] = None, bind_selected_prims: list = False)
do()
undo()
class omni.kit.material.library.CreateAndBindPreviewSurfaceTextureFromLibrary(mtl_created_list: Optional[list] = None, bind_selected_prims: list = False)
do()
undo()
class omni.kit.material.library.Enum(value)

Generic enumeration.

Derive from this class to define new enumerations.

name

The name of the Enum member.

value

The value of the Enum member.

class omni.kit.material.library.MDLSchema
on_menu_click_update_mdl_schema(value)
class omni.kit.material.library.MaterialLibraryExtension
class StaticDataModel
destroy()
class SubIDEntry(name: str, annotations: dict, is_material: bool)
replace(a, b)
create_material_and_assign(*_)
async get_subidentifier_from_material(prim: pxr.Usd.Prim, on_complete_fn: callable, use_functions: bool = False, show_alert: bool = False)
async get_subidentifier_from_mdl(mdl_file: str, on_complete_fn: Optional[callable] = None, use_functions: bool = False, show_alert: bool = False)
static on_create_custom_material(mtl_created_list=None, bind_selected_prims=True)
static on_create_mdl_material(mdl_name: str, mtl_name: str, mtl_created_list: Optional[list] = None, bind_selected_prims: list = False)
static on_create_preview_surface(mtl_created_list=None, bind_selected_prims=True)
static on_create_preview_surface_texture(mtl_created_list=None, bind_selected_prims=True)
static on_selected_mdl(filename: str, dirname: str, bind_prim_paths=[])
on_shutdown()
on_startup(ext_id)
async preload_base_material_subids()
async process_rtx_neuraylib(mdl_file: str, module_process_fn: callable)
remove_mdl_from_cache(shader_prim_path: str)
show_alert_message(message)
class omni.kit.material.library.MaterialUtils
add_cache_changed_fn(cache_changed_fn: callable)
add_materials_from_stage_filter_func(filter_fn: callable)
destroy()
flush_material_cache()
get_materials_from_stage()
get_materials_from_stage_async(update_func: callable, wait_frames: int)
is_valid_material(filter_funcs)
remove_cache_changed_fn(cache_changed_fn: callable)
remove_materials_from_stage_filter_func()
stop()

Stop traversing the stage

class omni.kit.material.library.PrimCaching(usd_type, stage, on_changed=None)
destroy()
get_cache_state()
get_stage()
set_cache_state(state)
class omni.kit.material.library.UpdateState(value)

An enumeration.

COMPLETE_LIST = 3
UPDATE = 1
UPDATE_COMPLETE = 2
omni.kit.material.library.add_cache_changed_fn(cache_changed_fn: callable)
omni.kit.material.library.add_material_list_item(name: str, on_call_fn: callable, refresh: bool = True)
omni.kit.material.library.add_material_list_refresh_callback(on_refresh_fn: callable)
omni.kit.material.library.add_materials_from_stage_filter_func(filter_fn: callable)
omni.kit.material.library.bind_material_to_selected_prims(material_prim_path: pxr.Sdf.Path, paths: list)
omni.kit.material.library.create_mdl_material(stage: pxr.Usd.Stage, mtl_url: str, mtl_name: str, on_create_fn: callable, mtl_real_name: str = '')
omni.kit.material.library.custom_material_dialog(mdl_path: str, on_complete_fn: Optional[callable] = None, bind_prim_paths: list = [])
omni.kit.material.library.deregister_actions(extension_id)
omni.kit.material.library.destroy_material_utils()
omni.kit.material.library.get_file_importer()omni.kit.window.file_importer.extension.FileImporterExtension

Returns the singleton file_importer extension.

omni.kit.material.library.get_instance()
omni.kit.material.library.get_material_filename_from_prim(prim: pxr.Usd.Prim)str
omni.kit.material.library.get_material_hidden_list()
omni.kit.material.library.get_material_list()
omni.kit.material.library.get_material_prim_path(material_prim_name: str)
omni.kit.material.library.get_materials_from_stage(none_string: str)
omni.kit.material.library.get_materials_from_stage_async(update_func: callable, wait_frames: int = 1)
omni.kit.material.library.get_mdl_lib_paths()
omni.kit.material.library.get_mdl_list(use_hidden=False)
async omni.kit.material.library.get_mdl_list_async(use_hidden=False)
async omni.kit.material.library.get_subidentifier_from_material(prim: pxr.Usd.Prim, on_complete_fn: callable, use_functions: bool = False, show_alert: bool = False)
async omni.kit.material.library.get_subidentifier_from_mdl(mdl_file: str, on_complete_fn: Optional[callable] = None, use_functions: bool = False, show_alert: bool = False)
omni.kit.material.library.initalize_material_utils()
omni.kit.material.library.material_list_refresh()
omni.kit.material.library.multi_descendents_dialog(prim_paths: list, on_click_fn: callable)
omni.kit.material.library.register_actions(extension_id, cls)
omni.kit.material.library.remove_cache_changed_fn(cache_changed_fn: callable)
omni.kit.material.library.remove_material_list_item(name: str, refresh: bool = True)
omni.kit.material.library.remove_material_list_refresh_callback(on_refresh_fn: callable)
omni.kit.material.library.remove_materials_from_stage_filter_func(filter_fn: callable)
omni.kit.material.library.remove_mdl_from_cache(mdl_file)