PrimCaching

class omni.usd.PrimCaching(usd_type: Any, stage: Stage, on_changed: Optional[Callable[[], None]] = None)

Bases: object

Internal. Utility class that monitors changes from specific prim type.

Methods

__init__(usd_type, stage[, on_changed])

Constructor.

destroy()

get_cache_state()

Gets cache state.

get_stage()

Gets listened stage handle.

set_cache_state(state)

Sets cache state.

__init__(usd_type: Any, stage: Stage, on_changed: Optional[Callable[[], None]] = None)

Constructor.

Parameters
  • usd_type (Any) – Usd prim type, like UsdShade.Material, UsdShade.Shader, etc.

  • stage (Usd.Stage) – The stage to listen.

  • on_changed (Callable[[], None], optional) – The callback to invoke when interested prims are changed or any prims are removed. Defaults to None.

get_cache_state() bool

Gets cache state.

Returns

True if cached, or False otherwise.

Return type

bool

get_stage() Optional[Stage]

Gets listened stage handle.

Returns

Stage handle or None.

Return type

Optional[Usd.Stage]

set_cache_state(state: bool)

Sets cache state.

Parameters

state (bool) – True for cached, and False for non-cached.