24 #ifndef HD_DATA_SOURCE_MATERIAL_NETWORK_INTERFACE_H 25 #define HD_DATA_SOURCE_MATERIAL_NETWORK_INTERFACE_H 27 #include "pxr/usd/sdf/path.h" 28 #include "pxr/imaging/hd/containerDataSourceEditor.h" 29 #include "pxr/imaging/hd/materialNetworkInterface.h" 30 #include <unordered_map> 31 #include <unordered_set> 33 PXR_NAMESPACE_OPEN_SCOPE
48 const SdfPath &materialPrimPath,
49 const HdContainerDataSourceHandle &networkContainer)
50 : _materialPrimPath(materialPrimPath)
51 , _networkContainer(networkContainer)
52 , _containerEditor(networkContainer)
55 SdfPath GetMaterialPrimPath()
const override {
56 return _materialPrimPath;
73 const TfToken &nodeName)
const override;
78 const TfToken ¶mName)
const override;
82 const TfToken &nodeName)
const override;
87 const TfToken &inputName)
const override;
90 void DeleteNode(
const TfToken &nodeName)
override;
95 const TfToken &nodeType)
override;
98 void SetNodeParameterValue(
101 const VtValue &value)
override;
104 void DeleteNodeParameter(
106 const TfToken ¶mName)
override;
109 void SetNodeInputConnection(
115 void DeleteNodeInputConnection(
117 const TfToken &inputName)
override;
123 InputConnectionResult GetTerminalConnection(
124 const TfToken &terminalName)
const override;
128 const TfToken &terminalName)
override;
131 void SetTerminalConnection(
133 const InputConnection &connection)
override;
136 HdContainerDataSourceHandle Finish();
139 HdContainerDataSourceHandle _GetNodeTypeInfo(
140 const TfToken& nodeName)
const;
146 using _TokenSet = std::unordered_set<TfToken, TfHash>;
150 const HdDataSourceBaseHandle &ds);
153 HdContainerDataSourceHandle _networkContainer;
154 HdContainerDataSourceEditor _containerEditor;
155 _OverrideMap _existingOverrides;
156 _TokenSet _overriddenNodes;
157 _TokenSet _deletedNodes;
158 bool _terminalsOverridden =
false;
161 HdContainerDataSourceHandle _GetNode(
162 const TfToken &nodeName)
const;
163 HdContainerDataSourceHandle _GetNodeParameters(
164 const TfToken &nodeName)
const;
165 HdContainerDataSourceHandle _GetNodeConnections(
166 const TfToken &nodeName)
const;
168 mutable HdContainerDataSourceHandle _nodesContainer;
169 mutable TfToken _lastAccessedNodeName;
170 mutable HdContainerDataSourceHandle _lastAccessedNode;
171 mutable HdContainerDataSourceHandle _lastAccessedNodeParameters;
172 mutable HdContainerDataSourceHandle _lastAccessedNodeConnections;
175 PXR_NAMESPACE_CLOSE_SCOPE
177 #endif // HD_DATA_SOURCE_MATERIAL_NETWORK_INTERFACE_H Abstract interface for querying and mutating a material network.
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Implements HdMaterialNetworkInterface for reading from and overriding values within data sources.
A user-extensible hashing mechanism for use with runtime hash tables.
Token for efficient comparison, assignment, and hashing of known strings.
Represents an object that can identify the location of a data source.
std::vector< TfToken > TfTokenVector
Convenience types.
A path value used to locate objects in layers or scenegraphs.
HD_API TfTokenVector GetNodeTypeInfoKeys(const TfToken &nodeName) const override
Node type info is a collection of data related to the node type, often used to determine the node typ...
HD_API TfTokenVector GetTerminalNames() const override
Provides a container which may hold any type, and provides introspection and iteration over array typ...