MaterialX 1.38.9
Loading...
Searching...
No Matches
StringResolver Class Reference

A helper object for applying string modifiers to data values in the context of a specific element and geometry. More...

#include <Element.h>

Public Member Functions

File Prefix
void setFilePrefix (const string &filePrefix)
 Set the file prefix for this context.
 
const string & getFilePrefix () const
 Return the file prefix for this context.
 
Geom Prefix
void setGeomPrefix (const string &geomPrefix)
 Set the geom prefix for this context.
 
const string & getGeomPrefix () const
 Return the geom prefix for this context.
 
Filename Substitutions
void setUdimString (const string &udim)
 Set the UDIM substring substitution for filename data values. More...
 
void setUvTileString (const string &uvTile)
 Set the UV-tile substring substitution for filename data values. More...
 
void setFilenameSubstitution (const string &key, const string &value)
 Set an arbitrary substring substitution for filename data values.
 
void addTokenSubstitutions (ConstElementPtr element)
 Add filename token substitutions for a given element.
 
const StringMapgetFilenameSubstitutions () const
 Return the map of filename substring substitutions.
 
Geometry Name Substitutions
void setGeomNameSubstitution (const string &key, const string &value)
 Set an arbitrary substring substitution for geometry name data values.
 
const StringMapgetGeomNameSubstitutions () const
 Return the map of geometry name substring substitutions.
 

Static Public Member Functions

static StringResolverPtr create ()
 Create a new string resolver.
 

Protected Attributes

string _filePrefix
 
string _geomPrefix
 
StringMap _filenameMap
 
StringMap _geomNameMap
 

Resolution

static bool isResolvedType (const string &type)
 Return true if the given type may be resolved by this class.
 
virtual string resolve (const string &str, const string &type) const
 Given an input string and type, apply all appropriate modifiers and return the resulting string.
 

Detailed Description

A helper object for applying string modifiers to data values in the context of a specific element and geometry.

A StringResolver may be constructed through the Element::createStringResolver method, which initializes it in the context of a specific element, geometry, and material.

Calling the StringResolver::resolve method applies all modifiers to a particular string value.

Methods such as StringResolver::setFilePrefix may be used to edit the stored string modifiers before calling StringResolver::resolve.

Member Function Documentation

◆ setUdimString()

void setUdimString ( const string &  udim)

Set the UDIM substring substitution for filename data values.

This string will be used to replace the standard <UDIM> token.

◆ setUvTileString()

void setUvTileString ( const string &  uvTile)

Set the UV-tile substring substitution for filename data values.

This string will be used to replace the standard <UVTILE> token.


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