CreateAndBindMdlMaterialFromLibrary#
- class omni.kit.material.library.CreateAndBindMdlMaterialFromLibrary(
- mdl_name: str,
- mtl_name: str = '',
- mtl_created_list: list = None,
- bind_selected_prims: list = False,
- select_new_prim: bool = True,
- prim_name: str = '',
- on_created_fn: callable = None,
Bases:
Command
Creates material prim from Core MDL Library.
Methods
__init__
(mdl_name[, mtl_name, ...])Creates material prim from Core MDL Library, and bind to provided prim list.
do
()undo
()- __init__(
- mdl_name: str,
- mtl_name: str = '',
- mtl_created_list: list = None,
- bind_selected_prims: list = False,
- select_new_prim: bool = True,
- prim_name: str = '',
- on_created_fn: callable = None,
Creates material prim from Core MDL Library, 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.
mtl_created_list (list) – Created prims with get added to this list.
bind_selected_prims (List[Sdf.Path]) – Prims to be bound to the newly created material prim.
select_new_prim – If it’s to select the newly 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