CreateShaderPrimFromSdrCommand
- class omni.usd.commands.CreateShaderPrimFromSdrCommand(parent_path: str, identifier: str, name: Optional[str] = None, select_new_prim: bool = False, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)
Bases:
Command
Load the shader specified by ‘identifier’ from the SDR registry and create a shader prim under the specified parent. The parent must be of type UsdShade.Material or UsdShade.NodeGraph.
Methods
__init__
(parent_path, identifier[, name, ...])Constructor.
do
()undo
()- __init__(parent_path: str, identifier: str, name: Optional[str] = None, select_new_prim: bool = False, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)
Constructor.
- Parameters
parent_path (str) – The path of the parent UsdShade.Material or UsdShade.NodeGraph
identifier (str) – The identifer of the node Sdr registry which will be used to define the shader.
name (str, optional) – The name of the UsdShade.Shader prim to be created. If it’s None, identifier will be used. Default is None.
select_new_prim (bool, optional) – If to select new created prim. Default is False.
stage_or_context – (Union[str, Usd.Stage, omni.usd.UsdContext]): Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext.