|
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
|
Public Member Functions | |
| constructor (mxModule, mxStdlib=null) | |
| Class to load materials from the AmbientCG site. | |
| setDebugging (debug=true) | |
| getMaterialNames (key='assetId') | |
| writeMaterialList (materialList, filename) | |
| buildDownloadAttribute (imageFormat='PNG', imageResolution='1') | |
| getDownloadedMaterialInformation () | |
| clearDownloadMaterial () | |
| writeDownloadedMaterialToFile (path='') | |
| async | downloadMaterialAsset (assetId, imageFormat='PNG', imageResolution='1', downloadAttributeKey='downloadAttribute', downloadLinkKey='downloadLink') |
| findMaterial (assetId, key='assetId') | |
| loadMaterialsList (fileName) | |
| async | downloadMaterialsList () |
| getDataBase () | |
| getDataBaseMaterialList () | |
| async | downloadAssetDatabase () |
| writeDatabaseToFile (filename) | |
| validateMaterialXDocument (doc) | |
| addComment (doc, commentString) | |
| getMaterialXString (doc) | |
Definition at line 7 of file JsAmbientCGLoader.js.
| AmbientCGLoader::addComment | ( | doc, | |
| commentString ) |
Add a comment to the MaterialX document.
| {Object} | doc - The MaterialX document to add the comment to. |
| {string} | commentString - The comment string to add. |
Definition at line 311 of file JsAmbientCGLoader.js.
| AmbientCGLoader::buildDownloadAttribute | ( | imageFormat = 'PNG', | |
| imageResolution = '1' ) |
Build the download attribute string for a given image format and resolution.
| {string} | imageFormat - The image format to download. |
| {string} | imageResolution - The image resolution to download. |
Definition at line 81 of file JsAmbientCGLoader.js.
| AmbientCGLoader::clearDownloadMaterial | ( | ) |
Clear any cached current material asset.
Definition at line 102 of file JsAmbientCGLoader.js.
| AmbientCGLoader::constructor | ( | mxModule, | |
| mxStdlib = null ) |
Class to load materials from the AmbientCG site.
The class can convert the materials to MaterialX format for given target shading models.
| {Object} | mxModule - The MaterialX module. Required. |
| {Object} | mxStdlib - The MaterialX standard library. Optional. |
Definition at line 14 of file JsAmbientCGLoader.js.
| async AmbientCGLoader::downloadAssetDatabase | ( | ) |
Download the asset database for materials from the ambientCG site.
Definition at line 245 of file JsAmbientCGLoader.js.
| async AmbientCGLoader::downloadMaterialAsset | ( | assetId, | |
| imageFormat = 'PNG', | |||
| imageResolution = '1', | |||
| downloadAttributeKey = 'downloadAttribute', | |||
| downloadLinkKey = 'downloadLink' ) |
Download a material with a given id and format + resolution for images.
| {string} | assetId - The string id of the material. |
| {string} | imageFormat - The image format to download. Default is PNG. |
| {string} | imageResolution - The image resolution to download. Default is 1. |
| {string} | downloadAttributeKey - The download attribute key. Default is 'downloadAttribute'. |
| {string} | downloadLinkKey - The download link key. Default is 'downloadLink'. |
Definition at line 128 of file JsAmbientCGLoader.js.
| async AmbientCGLoader::downloadMaterialsList | ( | ) |
Download the list of materials from the ambientCG site.
Definition at line 196 of file JsAmbientCGLoader.js.
| AmbientCGLoader::findMaterial | ( | assetId, | |
| key = 'assetId' ) |
Get the list of materials matching a material identifier.
| {string} | assetId - Material string identifier. |
| {string} | key - The key to lookup asset identifiers. Default is 'assetId'. |
Definition at line 172 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDataBase | ( | ) |
Get asset database.
Definition at line 229 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDataBaseMaterialList | ( | ) |
Get asset database material list.
Definition at line 237 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDownloadedMaterialInformation | ( | ) |
Get the current downloaded material information.
Definition at line 91 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getMaterialNames | ( | key = 'assetId' | ) |
Get the list of material names.
| {string} | key - The key to use for the material name. Default is 'assetId'. |
Definition at line 56 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getMaterialXString | ( | doc | ) |
Convert the MaterialX document to a string.
| {Object} | doc - The MaterialX document to convert. |
Definition at line 321 of file JsAmbientCGLoader.js.
| AmbientCGLoader::loadMaterialsList | ( | fileName | ) |
Load in the list of downloadable materials from file.
| {string} | fileName - Name of JSON containing list. |
Definition at line 185 of file JsAmbientCGLoader.js.
| AmbientCGLoader::setDebugging | ( | debug = true | ) |
Set the debugging level for the logger.
| {boolean} | debug - True to set the logger to debug level, otherwise False. |
Definition at line 48 of file JsAmbientCGLoader.js.
| AmbientCGLoader::validateMaterialXDocument | ( | doc | ) |
Validate the MaterialX document.
| {Object} | doc - The MaterialX document to validate. |
Definition at line 291 of file JsAmbientCGLoader.js.
| AmbientCGLoader::writeDatabaseToFile | ( | filename | ) |
Write the database file.
| {string} | filename - The filename to write the JSON file to. |
Definition at line 276 of file JsAmbientCGLoader.js.
| AmbientCGLoader::writeDownloadedMaterialToFile | ( | path = '' | ) |
Write the currently downloaded file to file.
| {string} | path - The output path for the material. Default is empty. |
Definition at line 112 of file JsAmbientCGLoader.js.
| AmbientCGLoader::writeMaterialList | ( | materialList, | |
| filename ) |
Write the material list in JSON format to a file.
| {Array} | materialList - The list of materials to write. |
| {string} | filename - The file path to write the list to. |
Definition at line 71 of file JsAmbientCGLoader.js.