FormIt C++ API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt::MaterialProvider Namespace Reference

Description

Material Provider APIs.

Each function in this namespace takes the FormIt::LibraryType as a parameter, which identified the provider. Currently there are 2 providers : SKETCH and APPLICATION. SKETCH materials are those contained in the sketch. APPLICATION materials are default materials for users to choose from.

Functions

FORMIT_CORE_EXPORT size_t CreateMaterial (FormIt::LibraryType aType, const FormIt::Materials::MaterialData &data)
 Creates a new material from the given data.
 
FORMIT_CORE_EXPORT bool GetMaterialData (FormIt::LibraryType aType, size_t materialId, FormIt::Materials::MaterialData &data, bool excludeTextureData=false)
 Get the data for this material.
 
FORMIT_CORE_EXPORT bool SetMaterialData (FormIt::LibraryType aType, size_t materialId, const FormIt::Materials::MaterialData &data, bool excludeTextureData=false)
 Sets the material data If the optional excludeTextureData is true, no texture data will be changed and thus can be omitted in the data argument.
 
FORMIT_CORE_EXPORT ::vector< size_t > GetMaterials (FormIt::LibraryType aType)
 Returns all the available materials.
 
FORMIT_CORE_EXPORT bool DeleteMaterials (FormIt::LibraryType aType, const 1::vector< size_t > &aIDs)
 Deletes a list of material.
 
FORMIT_CORE_EXPORT bool IsValidMaterialName (FormIt::LibraryType aType, size_t aID, const 1::string &newName, 1::string &errorMsg)
 Check if the given name is valid for a material.
 
FORMIT_CORE_EXPORT ::string GetNewMaterialName (FormIt::LibraryType aType, const 1::string &baseName="")
 Returns a material name that is guaranteed not to exist.
 
FORMIT_CORE_EXPORT bool IsValidMaterial (FormIt::LibraryType aType, size_t aID)
 Check whether the material with the given id exists.
 
FORMIT_CORE_EXPORT bool CanModify (FormIt::LibraryType aType, size_t aID)
 Returns if a given material is modifiable (in some cases a material is marked as ReadOnly)
 
FORMIT_CORE_EXPORT bool GetMaterialPreviewImage (FormIt::LibraryType aType, size_t materialID, 1::vector< unsigned char > &previewImage, size_t &res)
 Get the preview image for the material.
 
FORMIT_CORE_EXPORT bool GetMaterialName (FormIt::LibraryType aType, size_t materialID, 1::string &materialName)
 Get the name of the material Returns true if the operation was successful.