|
MaterialXWeb 1.39.4
Utilities for using MaterialX Packages with Web clients
|
Public Member Functions | |
| constructor () | |
| Class to load materials from the AmbientCG site. | |
| loadMaterialsFromCache () | |
| setDebugging (debug=true) | |
| getMaterialNames (key='assetId') | |
| writeMaterialList (materialList, filename) | |
| buildDownloadAttribute (imageFormat='PNG', imageResolution='1') | |
| splitDownloadAttribute (downloadAttribute) | |
| 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 12 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 352 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 83 of file JsAmbientCGLoader.js.
| AmbientCGLoader::clearDownloadMaterial | ( | ) |
Clear any cached current material asset.
Definition at line 114 of file JsAmbientCGLoader.js.
| AmbientCGLoader::constructor | ( | ) |
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 19 of file JsAmbientCGLoader.js.
| async AmbientCGLoader::downloadAssetDatabase | ( | ) |
Download the asset database for materials from the ambientCG site.
Definition at line 286 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 140 of file JsAmbientCGLoader.js.
| async AmbientCGLoader::downloadMaterialsList | ( | ) |
Download the list of materials from the ambientCG site.
Definition at line 218 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 194 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDataBase | ( | ) |
Get asset database.
Definition at line 270 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDataBaseMaterialList | ( | ) |
Get asset database material list.
Definition at line 278 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getDownloadedMaterialInformation | ( | ) |
Get the current downloaded material information.
Definition at line 103 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 58 of file JsAmbientCGLoader.js.
| AmbientCGLoader::getMaterialXString | ( | doc | ) |
Convert the MaterialX document to a string.
| {Object} | doc - The MaterialX document to convert. |
Definition at line 362 of file JsAmbientCGLoader.js.
| AmbientCGLoader::loadMaterialsFromCache | ( | ) |
Definition at line 37 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 207 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 50 of file JsAmbientCGLoader.js.
| AmbientCGLoader::splitDownloadAttribute | ( | downloadAttribute | ) |
Split the download attribute into image format and resolution.
| {string} | downloadAttribute - The download attribute string. |
Definition at line 93 of file JsAmbientCGLoader.js.
| AmbientCGLoader::validateMaterialXDocument | ( | doc | ) |
Validate the MaterialX document.
| {Object} | doc - The MaterialX document to validate. |
Definition at line 332 of file JsAmbientCGLoader.js.
| AmbientCGLoader::writeDatabaseToFile | ( | filename | ) |
Write the database file.
| {string} | filename - The filename to write the JSON file to. |
Definition at line 317 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 124 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 73 of file JsAmbientCGLoader.js.