MaterialXWeb 0.0.2
Utilities for using MaterialX Packages with Web clients
|
Public Member Functions | |
constructor () | |
Class to load materials from the AmbientCG site. | |
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 6 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 319 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 64 of file JsAmbientCGLoader.js.
AmbientCGLoader::clearDownloadMaterial | ( | ) |
Clear any cached current material asset.
Definition at line 95 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 13 of file JsAmbientCGLoader.js.
async AmbientCGLoader::downloadAssetDatabase | ( | ) |
Download the asset database for materials from the ambientCG site.
Definition at line 253 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 121 of file JsAmbientCGLoader.js.
async AmbientCGLoader::downloadMaterialsList | ( | ) |
Download the list of materials from the ambientCG site.
Definition at line 199 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 175 of file JsAmbientCGLoader.js.
AmbientCGLoader::getDataBase | ( | ) |
Get asset database.
Definition at line 237 of file JsAmbientCGLoader.js.
AmbientCGLoader::getDataBaseMaterialList | ( | ) |
Get asset database material list.
Definition at line 245 of file JsAmbientCGLoader.js.
AmbientCGLoader::getDownloadedMaterialInformation | ( | ) |
Get the current downloaded material information.
Definition at line 84 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 39 of file JsAmbientCGLoader.js.
AmbientCGLoader::getMaterialXString | ( | doc | ) |
Convert the MaterialX document to a string.
{Object} | doc - The MaterialX document to convert. |
Definition at line 329 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 188 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 31 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 74 of file JsAmbientCGLoader.js.
AmbientCGLoader::validateMaterialXDocument | ( | doc | ) |
Validate the MaterialX document.
{Object} | doc - The MaterialX document to validate. |
Definition at line 299 of file JsAmbientCGLoader.js.
AmbientCGLoader::writeDatabaseToFile | ( | filename | ) |
Write the database file.
{string} | filename - The filename to write the JSON file to. |
Definition at line 284 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 105 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 54 of file JsAmbientCGLoader.js.