Fabric API

GetFabricCount

	@fn GetFabricCount()
	@brief Get the number of fabrics
	@return the number of fabric in object browser for the current project.

GetCurrentFabricIndex

	@fn GetCurrentFabricIndex()
	@brief Get the index of the selected Fabric
	@return the index of selected fabric in object browser for the current project..

ExportZFab

	@fn ExportZFab()
	@brief Export ZFab which cotains the fabric data selected in the object browser
	@return Output file path;output files will be created in CLO temporary folder. If an error occurs, return empty string.

ExportZFabW

	@fn ExportZFabW(const wstring& filePath, const int& index)
	@brief Export ZFab file which cotains the fabric data in the index of the object browser
	@param filePath: output file path
	@param index: target fabric index on the object browser to export
	@return Output file path. If an error occurs, return empty string. 

ExportFabric

	@fn ExportFabric(const string& filePath)
	@brief Export the selected fabric to the file(.jfab or .zfab)		
	@param filePath: output file path		
	@return Output file path. If an error occurs, return empty string.

ExportFabricW

	@fn ExportFabricW(const wstring& filePath, const int& index)
	@brief Export the selected fabric to the file(.jfab or .zfab)		
	@param filePath: output file path		
	@param index: target fabric index on the object browser to export
	@return Output file path. If an error occurs, return empty string.

AddFabric

	@fn AddFabric(const string& inputFilePath)
	@brief Add Fabric into the Object Browser
	@param inputFilePath: 'zfab'(clo file) path or 'jfab'(json) path
	@return the index of added fabric in object browser for the current project. .

AddFabricW

	@fn AddFabricW(const wstring& inputFilePath)
	@brief Add Fabric into the Object Browser
	@param inputFilePath: 'zfab'(clo file) path or 'jfab'(json) path
	@return the index of added fabric in object browser for the current project. .

GetFirstFabricTextureName

	@fn GetFirstFabricTextureName()
	@brief Get the main image file name for the first fabric in the object browser for the current colorway index
	@return the name of the image file name without folder path and extension.

GetFirstFabricTextureNameW

	@fn GetFirstFabricTextureNameW()
	@brief Get the main image file name for the first fabric in the object browser for the current colorway index
	@return the name of the image file name without folder path and extension.

ChangeFabricWithJson

	@fn ChangeFabricWithJson(unsigned int fabricIndex, const string& inputJsonFilePath)
	@brief Overwrite all the properties of a fabric with json file(.jfab) 
	@param fabricIndex: target fabric index in the object browser
	@param inputJsonFilePath: the jfab file path to load on to the fabric in the fabricIndex
	@return if it succeeds, return true.

ChangeFabricWithJsonW

	@fn ChangeFabricWithJsonW(unsigned int fabricIndex, const wstring& inputJsonFilePath)
	@brief Overwrite all the properties of a fabric with json file(.jfab) 
	@param fabricIndex: target fabric index in the object browser
	@param inputJsonFilePath: the jfab file path to load on to the fabric in the fabricIndex
	@return if it succeeds, return true.

AssignFabricToPattern

	@fn AssignFabricToPattern(unsigned int fabricIndex, unsigned int patternIndex)
	@brief Assign a fabric to a pattern. 
	@param fabricIndex: the source fabric index in the object browser to apply to the target pattern
	@param patternIndex: the tagert pattern index to apply the fabric in the fabricIndex
	@return if it succeeds, return true.

ImportXtexFile

	@fn ImportXtexFile(unsigned int fabricIndex, const string& xTexFilePath)		
	@brief Import xtex to a fabric. Overwrite all the values described in the xtex file into the Fabric
	@parm fabricIndex: the target fabric index in the object browser to import xTex file onto
	@parm xTexFilePath: the xTex file path to import
	@return if it succeeds, return true.

ImportXtexFileW

	@fn ImportXtexFileW(unsigned int fabricIndex, const wstring& xTexFilePath)
	@brief Import xtex to a fabric. Overwrite all the values described in the xtex file into the Fabric
	@parm fabricIndex: the target fabric index in the object browser to import xTex file onto
	@parm xTexFilePath: the xTex file path to import
	@return if it succeeds, return true.

ApplyXtexFile

	@fn ApplyXtexFile(unsigned int fabricIndex, const string& xTexFilePath)
	@brief Apply xtex to a fabric. Only set the values described in the xtex file into the Fabric.
	@parm fabricIndex: the target fabric index in the object browser to apply xTex file onto
	@parm xTexFilePath: the xTex file path to apply
	@return if it succeeds, return true.

ApplyXtexFileW

	@fn ApplyXtexFile(unsigned int fabricIndex, const string& xTexFilePath)
	@brief Apply xtex to a fabric. Only set the values described in the xtex file into the Fabric.
	@parm fabricIndex: the target fabric index in the object browser to apply xTex file onto
	@parm xTexFilePath: the xTex file path to apply
	@return if it succeeds, return true.

DeleteFabric

	@fn DeleteFabric(unsigned int fabricIndex)
	@brief Delete a fabric. If the fabric was assigned on Patterns, the patterns will have the default fabric
	@return if it succeeds, return true.

GetAPIMetaData

	@fn GetAPIMetaData(unsigned int fabricIndex)
	@brief Get API meta data for the fabric
	@parm fabricIndex: target fabric index on the Object Browser
	@return json string for meta data [key - value] list

GetAPIMetaDataW

	@fn GetAPIMetaDataW(unsigned int fabricIndex)
	@brief Get API meta data for the fabric
	@parm fabricIndex: target fabric index on the Object Browser
	@return json string for meta data [key - value] list

SetAPIMetaData

	@fn SetAPIMetaData(unsigned int fabricIndex, string jsonStr)
	@brief Set API meta data for the fabric
	@param fabricIndex: target fabric index on the Object Browser
	@param jsonStr: api meta data in string format 
	@return if it succeeds, return true

SetAPIMetaDataW

	@fn SetAPIMetaData(unsigned int fabricIndex, string jsonStr)
	@brief Set API meta data for the fabric
	@param fabricIndex: target fabric index on the Object Browser
	@param jsonStr: api meta data in string format 
	@return if it succeeds, return true

ChangeMetaDataValueForFabric

	@fn ChangeMetaDataValueForFabric(unsigned int fabricIndex, const string& metaDataKey, const string& metaDataValue)
	@brief Change or add Meta Data Value for the fabric with the index
	@param fabricIndex: target Fabric 
	@param metaDataKey: target Key
	@param metaDataValue: the new value for the key

GetFabricSize

	@fn GetFabricSize()
	@brief Get the number of fabrics on the Object Browser
	@return return the number of fabrics on the object browser

GetFabricIndexForPattern

	@fn GetFabricIndexForPattern(int patternIndex)
	@brief Get the fabric index which is assigned on the pattern with the pattern index
	@param patternIndex: the input pattern index to get the fabric index
	@return fabric index on the object browser for the pattern with the pattern index

GetFabricIndex

	@fn GetFabricIndex(const string& fabricName)
	@brief Get the fabric index which is using the fabric name
	@param fabricName: the fabric name to get the fabric index
	@return fabric index

GetFabricIndexW

	@fn GetFabricIndexW(const wstring& fabricName)
	@brief Get the fabric index which is using the fabric name
	@param fabricName: the fabric name to get the fabric index
	@return fabric index

GetFabricName

	@fn GetFabricName(int fabricIndex)
	@brief Get the fabric name of the fabric in the fabricIndex on the object browser
	@parm fabricIndex: the fabric index to get the name
	@return fabric name

GetFabricNameW

	@fn GetFabricNameW(int fabricIndex)
	@brief Get the fabric name of the fabric in the fabricIndex on the object browser
	@parm fabricIndex: the fabric index to get the name
	@return fabric name

GetColorwayFabricInfo

	@fn GetColorwayFabricInfo(int colorwayIndex, int fabricIndex)
	@brief Get a fabric information for a colorway
	@param colorwayIndex: the colorway index for the fabric to get the fabric info
	@param fabricIndex: the fabricIndex for the fabric to get the fabric info
	@return json string for fabric information

GetColorwayFabricInfoW

	@fn GetColorwayFabricInfoW(int colorwayIndex, int fabricIndex)
	@brief Get a fabric information for a colorway
	@param colorwayIndex: the colorway index for the fabric to get the fabric info
	@param fabricIndex: the fabricIndex for the fabric to get the fabric info
	@return json string for fabric information

GetAPIMetaDataFromFile

	@fn GetAPIMetaDataFromFile(const string& filePath)
	@brief Get API meta data for the fabric
	@param filePath: filepath (.zfab / .jfab)
	@return json string for meta data [key - value] list

GetAPIMetaDataFromFileW

	@fn GetAPIMetaDataFromFileW(const wstring& filePath)
	@brief Get API meta data for the fabric
	@param filePath: filepath (.zfab / .jfab)
	@return json string for meta data [key - value] list

SetFabricInformation

	@fn SetFabricInformation(int _fabricIndex, const std::map<string, string> _infoMap)
	@brief Set Fabric Information to fabric
	@param _fabricIndex: the fabricIndex for the fabric to set the fabric info
	@param _infoMap: Fabric Information (etc. Classification, Content, SupplierName, Owner)

SetFabricInformationW

	@fn SetFabricInformationW(int _fabricIndex, const std::map<wstring, wstring> _infoMap)
	@brief Set Fabric Information to fabric
	@param _fabricIndex: the fabricIndex for the fabric to set the fabric info
	@param _infoMap: Fabric Information (etc. Classification, Content, SupplierName, Owner)

GetFabricInformation

	@fn GetFabricInformation(int _fabricIndex)
	@brief Get Fabric Information for fabric
	@param _fabricIndex: the fabricIndex for the fabric to get the fabric info
	@return Fabric Information

GetFabricInformationW

	@fn GetFabricInformationW(int _fabricIndex)
	@brief Get Fabric Information for fabric
	@param _fabricIndex: the fabricIndex for the fabric to get the fabric info
	@return Fabric Information

SetCustomImage

	@fn SetCustomImage(int _fabricIndex, const string& _filePath)
	@brief Set Custom Image to fabric
	@param _fabricIndex: the fabricIndex for the fabric
	@param _filePath: filepath  (.png / .jpeg)

SetCustomImageW

	@fn SetCustomImageW(int _fabricIndex, const wstring& _filePath)
	@brief Set Custom Image to fabric
	@param _fabricIndex: the fabricIndex for the fabric
	@param _filePath: filepath  (.png / .jpeg)

GetPrimaryFabric

	@fn GetPrimaryFabric()
	@brief Return the fabric index used for a major number of the patterns

SetFabricName

	@fn SetFabricName(unsigned int index, const string& str)
	@brief Change fabric name
	@param index: the target fabric index to change the name
	@param str: new name for the fabric

SetFabricNameW

	@fn SetColorwayNameW(unsigned int index, const wstring& wstr)
	@brief Change fabric name
	@param index: the target fabric index to change the name
	@param str: new name for the fabric