Loading...
Searching...
No Matches
UsdviewqHydraObserver Class Reference

Abstracts pieces necessary for implementing a Hydra Scene Browser in a manner convenient for exposing to python. More...

#include <hydraObserver.h>

Classes

struct  NoticeEntry
 Aggregate of HdSceneIndexObserver entry types for easier binding to python. More...
 

Public Types

using IndexList = std::vector< size_t >
 
using NoticeEntryVector = std::vector< NoticeEntry >
 

Public Member Functions

USDVIEWQ_API bool TargetToNamedSceneIndex (const std::string &name)
 Target this observer to a scene index with the given name previously registered via HdSceneIndexNameRegistry.
 
USDVIEWQ_API bool TargetToInputSceneIndex (const IndexList &inputIndices)
 Starting from the currently targeted HdSceneIndex, each value in the inputIndices is treated as an index into the result of HdFilteringSceneIndexBase::GetInputScenes.
 
USDVIEWQ_API std::string GetDisplayName ()
 Returns the display name of the actively targeted scene index.
 
USDVIEWQ_API std::vector< std::string > GetInputDisplayNames (const IndexList &inputIndices)
 Starting from the currently targeted HdSceneIndex, each value in the inputIndices is treated as an index into the result of HdFilteringSceneIndexBase::GetInputScenes.
 
USDVIEWQ_API SdfPathVector GetChildPrimPaths (const SdfPath &primPath)
 Returns the paths of the immediate children of the specified primPath for the actively observer scene index.
 
USDVIEWQ_API HdSceneIndexPrim GetPrim (const SdfPath &primPath)
 Returns the prim type and data source for the specified primPath for the actively observer scene index.
 
USDVIEWQ_API bool HasPendingNotices ()
 Returns true if there are pending scene change notices.
 
USDVIEWQ_API NoticeEntryVector GetPendingNotices ()
 Returns (and clears) any accumulated scene change notices.
 
USDVIEWQ_API void ClearPendingNotices ()
 Clears any accumulated scene change notices.
 

Static Public Member Functions

static USDVIEWQ_API std::vector< std::string > GetRegisteredSceneIndexNames ()
 Returns the names of scene indices previously registered with HdSceneIndexNameRegistry.
 

Detailed Description

Abstracts pieces necessary for implementing a Hydra Scene Browser in a manner convenient for exposing to python.

For C++ code, this offers no benefits over directly implementing an HdSceneIndexObserver. It exists solely in service of the python implementation of Hydra Scene Browser present in usdview.

See extras/imaging/examples/hdui for an example of a C++ direct implementation.

Definition at line 45 of file hydraObserver.h.

Member Typedef Documentation

◆ IndexList

using IndexList = std::vector<size_t>

Definition at line 68 of file hydraObserver.h.

◆ NoticeEntryVector

using NoticeEntryVector = std::vector<NoticeEntry>

Definition at line 129 of file hydraObserver.h.

Member Function Documentation

◆ ClearPendingNotices()

USDVIEWQ_API void ClearPendingNotices ( )

Clears any accumulated scene change notices.

◆ GetChildPrimPaths()

USDVIEWQ_API SdfPathVector GetChildPrimPaths ( const SdfPath primPath)

Returns the paths of the immediate children of the specified primPath for the actively observer scene index.

◆ GetDisplayName()

USDVIEWQ_API std::string GetDisplayName ( )

Returns the display name of the actively targeted scene index.

This display name is currently derived from the C++ typename.

◆ GetInputDisplayNames()

USDVIEWQ_API std::vector< std::string > GetInputDisplayNames ( const IndexList &  inputIndices)

Starting from the currently targeted HdSceneIndex, each value in the inputIndices is treated as an index into the result of HdFilteringSceneIndexBase::GetInputScenes.

If the scene index reached is a subclass of HdFilteringSceneIndexBase, the display names of the return value of GetInputScenes is returned. Otherwise, the return value is empty.

◆ GetPendingNotices()

USDVIEWQ_API NoticeEntryVector GetPendingNotices ( )

Returns (and clears) any accumulated scene change notices.

Consumers of this follow a polling rather than callback pattern.

◆ GetPrim()

USDVIEWQ_API HdSceneIndexPrim GetPrim ( const SdfPath primPath)

Returns the prim type and data source for the specified primPath for the actively observer scene index.

◆ GetRegisteredSceneIndexNames()

static USDVIEWQ_API std::vector< std::string > GetRegisteredSceneIndexNames ( )
static

Returns the names of scene indices previously registered with HdSceneIndexNameRegistry.

It allows a browser to retrieve available instances without direct interaction with the application.

◆ HasPendingNotices()

USDVIEWQ_API bool HasPendingNotices ( )

Returns true if there are pending scene change notices.

Consumers of this follow a polling rather than callback pattern.

◆ TargetToInputSceneIndex()

USDVIEWQ_API bool TargetToInputSceneIndex ( const IndexList &  inputIndices)

Starting from the currently targeted HdSceneIndex, each value in the inputIndices is treated as an index into the result of HdFilteringSceneIndexBase::GetInputScenes.

Returns true if each followed index maps to a valid index into the input scenes of the previous.

◆ TargetToNamedSceneIndex()

USDVIEWQ_API bool TargetToNamedSceneIndex ( const std::string &  name)

Target this observer to a scene index with the given name previously registered via HdSceneIndexNameRegistry.


The documentation for this class was generated from the following file: