Loading...
Searching...
No Matches
matfiltResolveVstructs.h
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H
8#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/material.h"
12#include "pxr/imaging/hd/materialNetworkInterface.h"
13
14#if PXR_VERSION >= 2505
15#include "pxr/usd/sdr/declare.h"
16#else
17#include "pxr/usd/ndr/declare.h"
18#endif
19
20#include <memory>
21
22PXR_NAMESPACE_OPEN_SCOPE
23
24#if PXR_VERSION < 2505
25using SdrTokenVec = NdrTokenVec;
26#endif
27
30void MatfiltResolveVstructs(
31 HdMaterialNetworkInterface *networkInterface,
32 bool enableConditions = true);
33
34class MatfiltVstructConditionalEvaluatorImpl;
35
42{
43public:
44 typedef std::shared_ptr<MatfiltVstructConditionalEvaluator> Ptr;
45
47
48 static Ptr Parse(const std::string &inputExpr);
49
58 const TfToken &nodeId,
59 const TfToken &nodeInputId,
60 const TfToken &upstreamNodeId,
61 const TfToken &upstreamNodeOutput,
62 const SdrTokenVec &shaderTypePriority,
63 HdMaterialNetworkInterface *networkInterface) const;
64private:
66
67 MatfiltVstructConditionalEvaluatorImpl *_impl = nullptr;
68};
69
70PXR_NAMESPACE_CLOSE_SCOPE
71
72#endif // EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MATFILT_RESOLVE_VSTRUCTS_H
Abstract interface for querying and mutating a material network.
Parses and evaluates a single expression of "virtual struct conditional grammar".
void Evaluate(const TfToken &nodeId, const TfToken &nodeInputId, const TfToken &upstreamNodeId, const TfToken &upstreamNodeOutput, const SdrTokenVec &shaderTypePriority, HdMaterialNetworkInterface *networkInterface) const
Runs the conditional actions specified by the parsed inputExpr.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71