get_num_viewports

omni.kit.viewport.utility.get_num_viewports(usd_context_name: Optional[str] = None)

Returns the number of active viewports within an optional USD context.

Parameters

usd_context_name (str, optional) – The name of the USD context for which to count the viewports. If None, all viewports across all USD contexts are counted. Defaults to None.

Returns

The number of active viewports.

Return type

int