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 = '', on_created_fn: Optional[callable] = None)
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.
on_created_fn (callable) – function called when material prim is created & attributes are loaded
- 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.MaterialExtensions
- bind_material_to_prims_dialog(stage: Stage, prims: list) None
- static create_material_and_assign(objects: dict, create_fn: Callable, blocking: bool = True) None
create material and bind to prims
- Parameters
create_fn – create material function
blocking – block and call create_fn
- Returns
None
- 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: 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)
- async static on_create_mdl_material(mdl_url: str, 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(on_complete_fn: Optional[callable] = None, only_preload: str = '', spreadload: bool = False)
- 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(filter_fn: callable)
- 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_prims_dialog(stage: Stage, prims: list) None
- omni.kit.material.library.bind_material_to_selected_prims(material_prim_path: Path, paths: list)
- omni.kit.material.library.build_material_combobox_ui(enable_drag_and_drop: bool = False, material_path: Optional[str] = None, material_path_changed_fn: Optional[callable] = None, search_widget_flags: Optional[int] = None)
- omni.kit.material.library.create_mdl_material(stage: 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 = [])
- async omni.kit.material.library.delayed_material_list_refresh()
- omni.kit.material.library.deregister_actions(extension_id)
- omni.kit.material.library.destroy_material_utils()
- omni.kit.material.library.drop_material(prim_path, model_path, apply_material_fn: callable)
- omni.kit.material.library.get_file_importer() FileImporterExtension
Returns the singleton file_importer extension instance
- omni.kit.material.library.get_instance()
- omni.kit.material.library.get_material_enums()
- omni.kit.material.library.get_material_filename_from_prim(prim: 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)
- omni.kit.material.library.get_prim_children_paths(prim_path: Path)
- async omni.kit.material.library.get_subidentifier_from_material(prim: 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)