HDK
|
#include "pxr/pxr.h"
#include "pxr/usd/usdMtlx/api.h"
#include "pxr/usd/ndr/declare.h"
#include "pxr/usd/sdf/valueTypeName.h"
#include "pxr/base/tf/staticTokens.h"
#include "pxr/base/vt/value.h"
#include <MaterialXCore/Document.h>
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
struct | UsdMtlxUsdTypeInfo |
Result of UsdMtlxGetUsdType() . More... | |
Macros | |
#define | USD_MTLX_TOKENS ((DefaultOutputName, "out")) |
TF_DECLARE_PUBLIC_TOKENS | ( | UsdMtlxTokens | , |
USDMTLX_API | , | ||
USD_MTLX_TOKENS | |||
) |
USDMTLX_API const NdrStringVec& UsdMtlxCustomSearchPaths | ( | ) |
Return the paths to directories containing custom MaterialX files, set in the environment variable 'PXR_MTLX_PLUGIN_SEARCH_PATHS'
USDMTLX_API MaterialX::ConstDocumentPtr UsdMtlxGetDocument | ( | const std::string & | resolvedUri | ) |
Return the (possibly cached) MaterialX document at resolvedUri
. Return null if the document could not be read and report a warning (once per uri). resolvedUri
may be empty to indicate the MaterialX standard library documents all rolled into one.
USDMTLX_API MaterialX::ConstDocumentPtr UsdMtlxGetDocumentFromString | ( | const std::string & | mtlxXml | ) |
Returns the (possibly cached) MaterialX document created from the given string containing the source MaterialX XML.
USDMTLX_API std::vector<VtValue> UsdMtlxGetPackedUsdValues | ( | const std::string & | values, |
const std::string & | type | ||
) |
Return the MaterialX values in values
assuming it contains an array of values of MaterialX type type
as a vector of VtValue.
USDMTLX_API const std::string& UsdMtlxGetSourceURI | ( | const MaterialX::ConstElementPtr & | element | ) |
Return the source URI for a MaterialX element. If the element doesn't have a non-empty URI then return the source URI of the closest element up the element hierarchy that does have one. Return the empty string if no element has a source URI.
USDMTLX_API UsdMtlxUsdTypeInfo UsdMtlxGetUsdType | ( | const std::string & | mtlxTypeName | ) |
Convert a (standard) MaterialX type name.
USDMTLX_API VtValue UsdMtlxGetUsdValue | ( | const MaterialX::ConstElementPtr & | mtlx, |
bool | getDefaultValue = false |
||
) |
USDMTLX_API NdrVersion UsdMtlxGetVersion | ( | const MaterialX::ConstInterfaceElementPtr & | mtlx, |
bool * | implicitDefault = nullptr |
||
) |
USDMTLX_API MaterialX::DocumentPtr UsdMtlxReadDocument | ( | const std::string & | resolvedPath | ) |
Return the MaterialX document at resolvedPath
. Return null if the document could not be read and report a runtime error.
Unlike UsdMtlxGetDocument, this function does not implement any caching or special behavior for MaterialX standard library documents.
USDMTLX_API const NdrStringVec& UsdMtlxSearchPaths | ( | ) |
Return the MaterialX search paths. In order, this includes:
USDMTLX_API std::vector<std::string> UsdMtlxSplitStringArray | ( | const std::string & | s | ) |
Split a MaterialX string array into a vector of strings.
The MaterialX specification says:
Individual string values within stringarrays may not contain commas or semicolons, and any leading and trailing whitespace characters in them is ignored.
These restrictions do not apply to the string type.
USDMTLX_API NdrStringVec UsdMtlxStandardFileExtensions | ( | ) |
Return the MaterialX standard file extensions.
USDMTLX_API const NdrStringVec& UsdMtlxStandardLibraryPaths | ( | ) |
Return the MaterialX standard library paths. All standard library files (and only standard library files) should be found on these paths.