Loading...
Searching...
No Matches
udimUtils.h
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_USD_SHADE_UDIM_UTILS_H
8#define PXR_USD_USD_SHADE_UDIM_UTILS_H
9
10#include "pxr/pxr.h"
12#include "pxr/usd/usdShade/api.h"
13
14#include <string>
15#include <utility>
16#include <vector>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20SDF_DECLARE_HANDLES(SdfLayer);
21
28public:
29
33 using ResolvedPathAndTile = std::pair<std::string, std::string>;
34
38 USDSHADE_API
39 static bool IsUdimIdentifier(const std::string &identifier);
40
43 USDSHADE_API
44 static std::string ReplaceUdimPattern(
45 const std::string &identifierWithPattern,
46 const std::string &replacement);
47
53 USDSHADE_API
54 static std::string ResolveUdimPath(
55 const std::string &udimPath,
56 const SdfLayerHandle &layer);
57
62 USDSHADE_API
63 static std::vector<ResolvedPathAndTile> ResolveUdimTilePaths(
64 const std::string &udimPath,
65 const SdfLayerHandle &layer);
66};
67
68PXR_NAMESPACE_CLOSE_SCOPE
69
70#endif
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
This class contains a set of utility functions used for working with Udim texture paths.
Definition: udimUtils.h:27
std::pair< std::string, std::string > ResolvedPathAndTile
Pair representing a resolved UDIM path.
Definition: udimUtils.h:33
static USDSHADE_API bool IsUdimIdentifier(const std::string &identifier)
Checks if identifier contains a UDIM token.
static USDSHADE_API std::string ReplaceUdimPattern(const std::string &identifierWithPattern, const std::string &replacement)
Replaces the UDIM pattern contained in identifierWithPattern with replacement.
static USDSHADE_API std::vector< ResolvedPathAndTile > ResolveUdimTilePaths(const std::string &udimPath, const SdfLayerHandle &layer)
Attempts to resolve all paths which match a path containing a UDIM pattern.
static USDSHADE_API std::string ResolveUdimPath(const std::string &udimPath, const SdfLayerHandle &layer)
Resolves a udimPath containing a UDIM token.