get_sdr_shader_node_for_prim

omni.kit.property.material.scripts.widgets.usdshade.get_sdr_shader_node_for_prim(prim: Prim, source_type_priority: Optional[List[str]] = None, warn_on_substitution: bool = False) Optional[ShaderNode]

Finds and returns the Sdr.ShaderNode used to define the corresponding UsdShade.Shader prim.

Parameters
  • prim (Usd.Prim) – The USD primitive to find the shader node for.

  • source_type_priority (Optional[List[str]]) – A list of source type priorities to consider when finding the shader node.

  • warn_on_substitution (bool) – UsdMdl.RegistryUtils.FindShaderNodeForPrim will first try and find the Sdr.ShaderNode using the subidentifier on the prim. If it is not able to do so it attempts to find one by decuction. If a suitable match was found this flag is used to indicate whether or not a warning should be issued.

Returns

The found Sdr.ShaderNode, or None if not found.

Return type

Union[Sdr.ShaderNode, None]