6 #ifndef MATERIALX_TEXTUREBAKER
7 #define MATERIALX_TEXTUREBAKER
63 _colorSpace = colorSpace;
75 _distanceUnit = unitSpace;
93 return _averageImages;
99 _optimizeConstants =
enable;
105 return _optimizeConstants;
112 _outputImagePath = outputImagePath;
118 return _outputImagePath;
124 _bakedGraphName=
name;
130 return _bakedGraphName;
136 _bakedGeomInfoName =
name;
142 return _bakedGeomInfoName;
148 return _textureFilenameTemplate;
154 _textureFilenameTemplate = (filenameTemplate.find(
"$EXTENSION") == string::npos) ?
155 filenameTemplate +
".$EXTENSION" : filenameTemplate;
161 if (_permittedOverrides.count(key))
163 _texTemplateOverrides[key] =
value;
170 _outputStream = outputStream;
176 return _outputStream;
190 return _hashImageNames;
196 _textureSpaceMin =
min;
202 return _textureSpaceMin;
208 _textureSpaceMax =
max;
214 return _textureSpaceMax;
243 bool isUniform =
false;
249 bool isDefault =
false;
262 size_t findVarInTemplate(
const string&
filename,
const string& var,
size_t start = 0);
shared_ptr< Output > OutputPtr
A shared pointer to an Output.
void setOptimizeConstants(bool enable)
Set whether uniform textures should be stored as constants. Defaults to true.
std::ostream * getOutputStream() const
Return the output stream for reporting progress and warnings.
GT_API const UT_StringHolder filename
FilePath _outputImagePath
shared_ptr< class TextureBaker > TextureBakerPtr
A shared pointer to a TextureBaker.
std::unordered_map< string, NodePtr > _worldSpaceNodes
const FilePath & getOutputImagePath()
Get the current output location for baked texture images.
void setAverageImages(bool enable)
Set whether images should be averaged to generate constants. Defaults to false.
#define MATERIALX_NAMESPACE_BEGIN
void setTextureSpaceMax(const Vector2 &max)
Set the maximum texcoords used in texture baking. Defaults to 1, 1.
vector< string > StringVec
A vector of strings.
std::ostream * _outputStream
GLenum GLenum GLenum input
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
GLenum GLsizei GLenum GLenum const void * image
shared_ptr< const Node > ConstNodePtr
A shared pointer to a const Node.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool getAverageImages() const
Return whether images should be averaged to generate constants.
void setHashImageNames(bool enable)
GLuint const GLchar * name
void setTextureSpaceMin(const Vector2 &min)
Set the minimum texcoords used in texture baking. Defaults to 0, 0.
std::vector< std::pair< std::string, DocumentPtr >> BakedDocumentVec
A vector of baked documents with their associated names.
void setExtension(const string &extension)
Set the file extension for baked textures.
const string & getExtension() const
Return the file extension for baked textures.
Vector2 getTextureSpaceMin() const
Return the minimum texcoords used in texture baking.
void setFilenameTemplateVarOverride(const string &key, const string &value)
Set texFilenameOverrides if template variable exists.
BakedConstantMap _bakedConstantMap
const string & getDistanceUnit() const
Return the distance unit to which textures are baked.
GLsizei const GLchar *const * string
void setOutputImagePath(const FilePath &outputImagePath)
BakedImageMap _bakedImageMap
void setColorSpace(const string &colorSpace)
vector< BakedImage > BakedImageVec
const string & getBakedGraphName() const
Return the name of the baked graph element.
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
string _textureFilenameTemplate
#define MX_RENDERGLSL_API
shared_ptr< Input > InputPtr
A shared pointer to an Input.
GLint GLsizei GLsizei height
Vector2 getTextureSpaceMax() const
Return the maximum texcoords used in texture baking.
void setBakedGeomInfoName(const string &name)
Set the name of the baked geometry info element.
const string & getTextureFilenameTemplate() const
Get the texture filename template.
const string & getColorSpace() const
Return the color space in which color textures are encoded.
bool getHashImageNames() const
Return whether automatic baked texture resolution is set.
StringMap _texTemplateOverrides
ImagePtr _frameCaptureImage
std::unordered_map< OutputPtr, BakedConstant > BakedConstantMap
void setOutputStream(std::ostream *outputStream)
Set the output stream for reporting progress and warnings. Defaults to std::cout. ...
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLsizei const GLfloat * value
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
StringSet _permittedOverrides
std::unordered_map< OutputPtr, BakedImageVec > BakedImageMap
void setDistanceUnit(const string &unitSpace)
Set the distance unit to which textures are baked. Defaults to meters.
std::set< string > StringSet
A set of strings.
#define MATERIALX_NAMESPACE_END
shared_ptr< Image > ImagePtr
A shared pointer to an image.
static TextureBakerPtr create(unsigned int width=1024, unsigned int height=1024, Image::BaseType baseType=Image::BaseType::UINT8)
void setTextureFilenameTemplate(const string &filenameTemplate)
Set the texture filename template.
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
string _bakedGeomInfoName
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept
ShaderGeneratorPtr _generator
bool getOptimizeConstants() const
Return whether uniform textures should be stored as constants.
void setBakedGraphName(const string &name)
Set the name of the baked graph element.
shared_ptr< Node > NodePtr
A shared pointer to a Node.
const string & getBakedGeomInfoName() const
Return the name of the baked geometry info element.