MaterialXLab API  0.0.1
APIs For MaterialXLab Libraries
Loading...
Searching...
No Matches
MxNodeEditorPreferences Class Reference

Class to store preferences for the node editor. More...

Public Member Functions

 constructor ()
 
 getDefaultGeometryFile ()
 Method to return the default geometry file.
 
 getDefaultMaterialFile ()
 Method to return the default material file.
 
 getPreferences ()
 Method to return the preferences object.
 
 getExamples ()
 Return material examples structure.
 
 getIconMap ()
 Return icon map structure.
 

Detailed Description

Class to store preferences for the node editor.

  • preferences - Object containing preferences for the node editor
  • preferences.icon_map - Object containing mapping of file extensions to icons
  • preferences.examples - Object containing example materials Note that all material and icon file references are relative to the root of the deployment folder. while geometry is referenced by name only.

Definition at line 10 of file node_editor_preferences.js.

Member Function Documentation

◆ constructor()

MxNodeEditorPreferences::constructor ( )

Definition at line 12 of file node_editor_preferences.js.

12 {
13 this._preferences = {};
14
15 this._preferences.default_material_file = "Materials/Examples/Custom/marbley.mtlx";
16 this._preferences.default_geometry_file = "sphere";
17
18 this._preferences.icon_map = {
19 "gltf": "./Icons/gltf_logo.webp",
20 "usd": "./Icons/openusd_logo.webp",
21 "open_pbr": "./Icons/openpbr_logo.svg", // TODO: Use official logo when available.
22 "houdini": "./Icons/houdini_icon.webp",
23 "maya": "./Icons/maya_surfaces.webp",
24 };
25
26 this._preferences.examples = {
27 "Default Materials": {
28 "Unlit": "Materials/Examples/Custom/default_unlit.mtlx",
29 "OpenPBR": "Materials/Examples/OpenPBR/open_pbr_default.mtlx",
30 "glTF PBR": "Materials/Examples/GltfPbr/gltf_pbr_default.mtlx",
31 "Standard Surface": "Materials/Examples/StandardSurface/standard_surface_default.mtlx",
32 "Usd Preview Surface": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.mtlx",
33 },
34 "Sample Graphs": {
35 "Patterns": {
36 "Gooch": "Materials/Examples/Custom/gooch_shade.mtlx",
37 "Simple Checkerboard": "Materials/Examples/Custom/simple_checkerboard_graph.mtlx",
38 "Hatch": "Materials/Examples/Custom/pseudo_hatching_publish.mtlx",
39 "Patterned Shaders": "Materials/Examples/Custom/compound_graph_example.mtlx",
40 },
41 "Materials": {
42 "glTF Boombox": "Materials/Examples/Custom/gltf_boombox_graph.mtlx",
43 "OpenPBR Pattern": "Materials/Examples/Custom/marbley.mtlx",
44 "Custom Shader Definition": "Materials/Examples/Custom/MayaLambert_embedded_def.mtlx",
45 },
46 "Images": {
47 "File Lookup": "Materials/Examples/Custom/simple_file_texture.mtlx",
48 },
49 },
50 "Preset Materials": {
51 "glTF": {
52 "Car Paint": "Materials/Examples/GltfPbr/gltf_pbr_carpaint.mtlx",
53 "Glass": "Materials/Examples/GltfPbr/gltf_pbr_glass.mtlx",
54 "Gold": "Materials/Examples/GltfPbr/gltf_pbr_gold.mtlx",
55 "Plastic": "Materials/Examples/GltfPbr/gltf_pbr_plastic.mtlx"
56 },
57 "OpenPBR": {
58 "Aluminum": "Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx",
59 "Car Paint": "Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx",
60 "Glass": "Materials/Examples/OpenPBR/open_pbr_glass.mtlx",
61 "Honey": "Materials/Examples/OpenPBR/open_pbr_honey.mtlx",
62 "Ketchup": "Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx",
63 "Light Bulb": "Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx",
64 "Pearl": "Materials/Examples/OpenPBR/open_pbr_pearl.mtlx",
65 "Soap Bubble": "Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx",
66 "Velvet": "Materials/Examples/OpenPBR/open_pbr_velvet.mtlx"
67 },
68 "Standard Surface": {
69 "Brass": "Materials/Examples/StandardSurface/standard_surface_brass_tiled.mtlx",
70 "Brick": "Materials/Examples/StandardSurface/standard_surface_brick_procedural.mtlx",
71 "Car Paint": "Materials/Examples/StandardSurface/standard_surface_carpaint.mtlx",
72 "Chess Set": "Materials/Examples/StandardSurface/standard_surface_chess_set.mtlx",
73 "Chrome": "Materials/Examples/standard_surface_chrome.mtlx",
74 "Copper": "Materials/Examples/StandardSurface/standard_surface_copper.mtlx",
75 "Glass": "Materials/Examples/StandardSurface/standard_surface_glass.mtlx",
76 "Tinted Glass": "Materials/Examples/StandardSurface/standard_surface_glass_tinted.mtlx",
77 "Gold": "Materials/Examples/StandardSurface/standard_surface_gold.mtlx",
78 "Grey": "Materials/Examples/StandardSurface/standard_surface_greysphere.mtlx",
79 "Calibration": "Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.mtlx",
80 "Jade": "Materials/Examples/StandardSurface/standard_surface_jade.mtlx",
81 "Marble": "Materials/Examples/StandardSurface/standard_surface_marble_solid.mtlx",
82 "Brushed Metal": "Materials/Examples/StandardSurface/standard_surface_metal_brushed.mtlx",
83 "Plastic": "Materials/Examples/StandardSurface/standard_surface_plastic.mtlx",
84 "Thin Film": "Materials/Examples/StandardSurface/standard_surface_thin_film.mtlx",
85 "Velvet": "Materials/Examples/StandardSurface/standard_surface_velvet.mtlx",
86 "Tiled Wood": "Materials/Examples/StandardSurface/standard_surface_wood_tiled.mtlx",
87 },
88 "UsdPreviewSurface": {
89 "Brass": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.mtlx",
90 "Car Paint": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.mtlx",
91 "Glass": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.mtlx",
92 "Gold": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.mtlx",
93 "Plastic": "Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.mtlx",
94 },
95 "GPUOpen": {
96 "Motley Patchwork Rug": "Materials/Examples/Custom/AMD/Motley_Patchwork_Rug.mtlx",
97 "Black Upholstery": "Materials/Examples/Custom/AMD/Black_Uphostery.mtlx",
98 "Old Copper": "Materials/Examples/Custom/AMD/Copper_Old.mtlx"
99 },
100 "PhysicallyBased": {
101 "glTF": "https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_GLTF.mtlx",
102 "OpenPBR": "https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_OPBR.mtlx",
103 "Standard Surface": "https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_SS.mtlx"
104 }
105 }
106 }
107 }

◆ getDefaultGeometryFile()

MxNodeEditorPreferences::getDefaultGeometryFile ( )

Method to return the default geometry file.

Returns
{String} - Default geometry file path

Definition at line 114 of file node_editor_preferences.js.

114 {
115 return this._preferences.default_geometry_file;
116 }

◆ getDefaultMaterialFile()

MxNodeEditorPreferences::getDefaultMaterialFile ( )

Method to return the default material file.

Returns
{String} - Default material file path

Definition at line 122 of file node_editor_preferences.js.

122 {
123 return this._preferences.default_material_file;
124 }

◆ getExamples()

MxNodeEditorPreferences::getExamples ( )

Return material examples structure.

Returns
{Object} - Object containing example materials

Definition at line 138 of file node_editor_preferences.js.

138 {
139 // Add PhysicallyBased Materials dynamically here
140 return this._preferences.examples;
141 }

◆ getIconMap()

MxNodeEditorPreferences::getIconMap ( )

Return icon map structure.

Returns
{Object} - Object containing mapping of semantic categories to icons

Definition at line 147 of file node_editor_preferences.js.

147 {
148 return this._preferences.icon_map;
149 }

◆ getPreferences()

MxNodeEditorPreferences::getPreferences ( )

Method to return the preferences object.

Returns
{Object} - Object containing preferences for the node editor

Definition at line 130 of file node_editor_preferences.js.

130 {
131 return this._preferences;
132 }

The documentation for this class was generated from the following file: