MaterialXLab API
0.0.1
APIs For MaterialXLab Libraries
|
Javascript class for querying materials from the Physically Based database and creating MaterialX materials. More...
Public Member Functions | |
constructor (mtlx_module=null, mtlx_stdlib=null) | |
Constructor for the PhysicallyBasedMaterialLoader. | |
getJSON () | |
Get the Physically Based Materials as JSON. | |
getJSONMaterialNames () | |
Get list of the Physically Based Material names. | |
getMaterialXDocument () | |
Get the MaterialX document. | |
validateDocument () | |
Validate the MaterialX document. | |
getInputRemapping (shadingModel) | |
Get the remapping keys for a given shading model. | |
initializeInputRemapping () | |
Initialize the input remapping for different shading models. | |
loadMaterialX () | |
Load the MaterialX module. | |
async | getPhysicallyBasedMaterials () |
Get the Physically Based Materials from the API. | |
loadStandardLibraries () | |
Load the MaterialX standard libraries. | |
skipLibraryElement (element) | |
Predicate to skip library elements. | |
getMaterialXString () | |
Get the MaterialX document as a string. | |
addComment (doc, commentString) | |
Add a comment to the MaterialX document. | |
convertToMaterialX (shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='') | |
Convert the Physically Based Materials to MaterialX. | |
Public Attributes | |
url = '' | |
URL to fetch the Physically Based Materials. | |
headers = {} | |
Headers for the fetch operation. | |
materials = null | |
List of Physically Based Materials. | |
materialNames = [] | |
List of Physically Based Material names. | |
mxMaterialNames = [] | |
List of MaterialX Material names. | |
mx = null | |
MaterialX module. | |
doc = null | |
Working MaterialX document. | |
stdlib = null | |
MaterialX standard libraries. | |
remapMap = {} | |
Remap keys for input values for different shading models. | |
Javascript class for querying materials from the Physically Based database and creating MaterialX materials.
Definition at line 8 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::addComment | ( | doc, | |
commentString ) |
Add a comment to the MaterialX document.
doc | - MaterialX document |
commentString | - Comment string to add |
Definition at line 298 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::constructor | ( | mtlx_module = null, | |
mtlx_stdlib = null ) |
Constructor for the PhysicallyBasedMaterialLoader.
Definition at line 60 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::convertToMaterialX | ( | shaderCategory, | |
addAllInputs = false, | |||
materialNames = [], | |||
remapKeys = {}, | |||
shaderPreFix = '' ) |
Convert the Physically Based Materials to MaterialX.
shaderCategory | - MaterialX shader category |
addAllInputs | - Add all inputs from node definitions |
materialNames | - List of material names to convert. If empty all materials are converted |
remapKeys | - Remap keys to MaterialX shader inputs. If not specified the default remap keys are used if any. |
shaderPreFix | - Prefix for the shader name. Default is empty |
Definition at line 314 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::getInputRemapping | ( | shadingModel | ) |
Get the remapping keys for a given shading model.
shadingModel | - Shading model to get the remapping keys |
Definition at line 130 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::getJSON | ( | ) |
Get the Physically Based Materials as JSON.
Definition at line 86 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::getJSONMaterialNames | ( | ) |
Get list of the Physically Based Material names.
Definition at line 94 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::getMaterialXDocument | ( | ) |
Get the MaterialX document.
Definition at line 102 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::getMaterialXString | ( | ) |
Get the MaterialX document as a string.
Definition at line 275 of file JsMaterialXPhysicallyBased.js.
async JsPhysicallyBasedMaterialLoader::getPhysicallyBasedMaterials | ( | ) |
Get the Physically Based Materials from the API.
Definition at line 208 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::initializeInputRemapping | ( | ) |
Initialize the input remapping for different shading models.
Definition at line 142 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::loadMaterialX | ( | ) |
Load the MaterialX module.
Definition at line 192 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::loadStandardLibraries | ( | ) |
Load the MaterialX standard libraries.
Definition at line 239 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::skipLibraryElement | ( | element | ) |
Predicate to skip library elements.
element | - MaterialX element |
Definition at line 266 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::validateDocument | ( | ) |
Validate the MaterialX document.
Definition at line 111 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::doc = null |
Working MaterialX document.
Definition at line 43 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::headers = {} |
JsPhysicallyBasedMaterialLoader::materialNames = [] |
List of Physically Based Material names.
Definition at line 28 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::materials = null |
List of Physically Based Materials.
Definition at line 23 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::mx = null |
MaterialX module.
Definition at line 38 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::mxMaterialNames = [] |
List of MaterialX Material names.
Definition at line 33 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::remapMap = {} |
Remap keys for input values for different shading models.
Definition at line 53 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::stdlib = null |
MaterialX standard libraries.
Definition at line 48 of file JsMaterialXPhysicallyBased.js.
JsPhysicallyBasedMaterialLoader::url = '' |
URL to fetch the Physically Based Materials.
Definition at line 13 of file JsMaterialXPhysicallyBased.js.