diff --git a/README.md b/README.md index 9bc74ae..0af1469 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ A `Jupyter` notebook demonstrates the direct usage of the Python library. The ou

Results

-The following are some samples which have been rendered using the `MaterialXView` utility which is part of the MaterialX binary distribution. +The following are some samples which have been rendered using the `MaterialXViewer` utility which is part of the MaterialX binary distribution. Details about some examples can be found in the Examples pages diff --git a/documents/html/____init_____8py_source.html b/documents/html/____init_____8py_source.html index da11770..9eeb4d4 100644 --- a/documents/html/____init_____8py_source.html +++ b/documents/html/____init_____8py_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: __init__.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,24 +85,30 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
__init__.py
+
__init__.py
-
1 __version__ = '0.0.1'
+
1__version__ = '0.0.1'
diff --git a/documents/html/____main_____8py_source.html b/documents/html/____main_____8py_source.html index 5ca7963..0ef3684 100644 --- a/documents/html/____main_____8py_source.html +++ b/documents/html/____main_____8py_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: __main__.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,57 +85,63 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
__main__.py
+
__main__.py
-
1 import sys, os
-
2 import subprocess
-
3 
-
4 def main() -> int:
-
5  '''
-
6  Main entry point for running commands in the package.
-
7  '''
-
8  argCount = len(sys.argv)
-
9  if argCount < 2:
-
10  print('No arguments provided. Use -h or --help for help.')
-
11  return 1
-
12  if sys.argv[1] == '-h' or sys.argv[1] == '--help':
-
13  print('Usage: python -m materialxMaterials <command> [options] where command is gpuopen or physbased')
-
14 
-
15  # Check if the command is valid
-
16  cmdArgs = sys.argv[1:]
-
17  if cmdArgs[0] == 'physbased':
-
18  cmdArgs[0] = 'physicallyBasedMaterialXCmd.py'
-
19  elif cmdArgs[0] == 'gpuopen':
-
20  cmdArgs[0] = 'GPUOpenLoaderCmd.py'
-
21  else:
-
22  print('Unknown command specified:', cmdArgs[0])
-
23  return 1
-
24 
-
25  # Build the command
-
26  cmd = ' '.join(cmdArgs)
-
27  packageLocation = os.path.dirname(__file__)
-
28  cmd = 'python ' + packageLocation + '/' + cmd
-
29 
-
30  # Run the command
-
31  return subprocess.call(cmd, shell=True)
-
32 
-
33 if __name__ == '__main__':
-
34  sys.exit(main())
+
1import sys, os
+
2import subprocess
+
3
+
4def main() -> int:
+
5 '''
+
6 Main entry point for running commands in the package.
+
7 '''
+
8 argCount = len(sys.argv)
+
9 if argCount < 2:
+
10 print('No arguments provided. Use -h or --help for help.')
+
11 return 1
+
12 if sys.argv[1] == '-h' or sys.argv[1] == '--help':
+
13 print('Usage: python -m materialxMaterials <command> [options] where command is gpuopen or physbased')
+
14
+
15 # Check if the command is valid
+
16 cmdArgs = sys.argv[1:]
+
17 if cmdArgs[0] == 'physbased':
+
18 cmdArgs[0] = 'physicallyBasedMaterialXCmd.py'
+
19 elif cmdArgs[0] == 'gpuopen':
+
20 cmdArgs[0] = 'GPUOpenLoaderCmd.py'
+
21 else:
+
22 print('Unknown command specified:', cmdArgs[0])
+
23 return 1
+
24
+
25 # Build the command
+
26 cmd = ' '.join(cmdArgs)
+
27 packageLocation = os.path.dirname(__file__)
+
28 cmd = 'python ' + packageLocation + '/' + cmd
+
29
+
30 # Run the command
+
31 return subprocess.call(cmd, shell=True)
+
32
+
33if __name__ == '__main__':
+
34 sys.exit(main())
diff --git a/documents/html/_g_p_u_open_loader_8py_source.html b/documents/html/_g_p_u_open_loader_8py_source.html index af7bcae..ebbeb4e 100644 --- a/documents/html/_g_p_u_open_loader_8py_source.html +++ b/documents/html/_g_p_u_open_loader_8py_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: GPUOpenLoader.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,358 +85,388 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
GPUOpenLoader.py
+
GPUOpenLoader.py
-
1 '''
-
2 @brief Utilities to extract materials from the GPUOpen material database. This is not a complete set of calls to extract out all material information but instead enough to find materials
-
3 and extract out specific packages from the list of available materials.
-
4 
-
5 See: https://api.matlib.gpuopen.com/api/swagger/ for information on available API calls.
-
6 '''
-
7 
-
8 import requests, json, os, io, re, zipfile, logging
-
9 from http import HTTPStatus
-
10 # Note: MaterialX is not currently a dependency since no MaterialX processing is required.
-
11 #import MaterialX as mx
-
12 
-
13 import io
-
14 import zipfile
-
15 from PIL import Image as pilImage
-
16 
- -
18  '''
-
19  This class is used to load materials from the GPUOpen material database.
-
20  See: https://api.matlib.gpuopen.com/api/swagger/ for API information.
-
21  '''
-
22  def __init__(self):
-
23  self.root_urlroot_url = 'https://api.matlib.gpuopen.com/api'
-
24  self.urlurl = self.root_urlroot_url + '/materials'
-
25  self.package_urlpackage_url = self.root_urlroot_url + '/packages'
-
26  self.materialsmaterials = None
-
27 
-
28  self.loggerlogger = logging.getLogger('GPUO')
-
29  logging.basicConfig(level=logging.INFO)
-
30 
-
31  def writePackageDataToFile(self, data, outputFolder, title, unzipFile=True) -> bool:
-
32  '''
-
33  Write a package data to a file.
-
34  @param data: The data to write.
-
35  @param outputFolder: The output folder to write the file to.
-
36  @param title: The title of the file.
-
37  @param unzipFile: If true, the file is unzipped to a folder with the same name
-
38  as the title.
-
39  @return: True if the package was written.
-
40  '''
-
41  if not data:
-
42  return False
-
43 
-
44  if not os.path.exists(outputFolder):
-
45  os.makedirs(outputFolder)
-
46 
-
47  if unzipFile:
-
48  # Assuming `data` is the binary data of the zip file and `title` and `outputFolder` are defined
-
49  unzipFolder = os.path.join(outputFolder, title)
-
50 
-
51  # Use BytesIO to handle the data in memory
-
52  with io.BytesIO(data) as data_io:
-
53  with zipfile.ZipFile(data_io, 'r') as zip_ref:
-
54  zip_ref.extractall(unzipFolder)
-
55 
-
56  self.loggerlogger.info(f'Unzipped to folder: "{unzipFolder}"')
-
57 
-
58  else:
-
59  outputFile = os.path.join(outputFolder, f"{title}.zip")
-
60  with open(outputFile, "wb") as f:
-
61  self.loggerlogger.info(f'Write package to file: "{outputFile}"')
-
62  f.write(data)
-
63 
-
64  return True
-
65 
-
66  def extractPackageData(self, data, pilImage):
-
67  '''
-
68  Extract the package data from a zip file.
-
69  @param data: The data to extract.
-
70  @param pilImage: The PIL image module.
-
71  @return: A list of extracted data of the form:
-
72  [ { 'file_name': file_name, 'data': data, 'type': type } ]
-
73  '''
-
74  if not pilImage:
-
75  self.loggerlogger.debug('Pillow (PIL) image module provided. Image data will not be extracted.')
-
76 
-
77  zip_object = io.BytesIO(data)
-
78 
-
79  extracted_data_list = []
-
80  with zipfile.ZipFile(zip_object, 'r') as zip_file:
-
81  # Iterate through the files in the zip archive
-
82  for file_name in zip_file.namelist():
-
83  # Extract each file into memory
-
84  extracted_data = zip_file.read(file_name)
-
85  if file_name.endswith('.mtlx'):
-
86  mtlx_string = extracted_data.decode('utf-8')
-
87  extracted_data_list.append( {'file_name': file_name, 'data': mtlx_string, 'type': 'mtlx'} )
-
88 
-
89  # If the data is a image, create a image in Python
-
90  elif file_name.endswith('.png'):
-
91  if pilImage:
-
92  image = pilImage.open(io.BytesIO(extracted_data))
-
93  else:
-
94  image = None
-
95  extracted_data_list.append( {'file_name': file_name, 'data': image, 'type': 'image'} )
-
96 
-
97  return extracted_data_list
-
98 
-
99  def downloadPackage(self, listNumber, materialNumber, packageId=0):
-
100  '''
-
101  Download a package for a given material from the GPUOpen material database.
-
102  @param listNumber: The list number of the material to download.
-
103  @param materialNumber: The material number to download.
-
104  @param packageId: The package ID to download.
-
105  Packages are numbered starting at 0. Default is 0.
-
106  with index 0 containing the smallest package (smallest resolution referenced textures).
-
107  '''
-
108  if self.materialsmaterials == None or len(self.materialsmaterials) == 0:
-
109  return [None, None]
-
110 
-
111  json_data = self.materialsmaterials[listNumber]
-
112  if not json_data:
-
113  return [None, None]
-
114 
-
115  jsonResults = None
-
116  jsonResult = None
-
117  if "results" in json_data:
-
118  jsonResults = json_data["results"]
-
119  if len(jsonResults) <= materialNumber:
-
120  return [None, None]
-
121  else:
-
122  jsonResult = jsonResults[materialNumber]
-
123 
-
124  if not jsonResult:
-
125  return [None, None]
-
126 
-
127  # Get the package ID
-
128  jsonPackages = None
-
129  if "packages" in jsonResult:
-
130  jsonPackages = jsonResult["packages"]
-
131  if not jsonPackages:
-
132  return [None, None]
-
133 
-
134  if len(jsonPackages) <= packageId:
-
135  return [None, None]
-
136  package_id = jsonPackages[packageId]
-
137 
-
138  if not package_id:
-
139  return [None, None]
-
140 
-
141  url = f"{self.package_url}/{package_id}/download"
-
142  data = requests.get(url).content
-
143 
-
144  title = jsonResult["title"]
-
145  return [data, title]
-
146 
-
147  def downloadPackageByExpression(self, searchExpr, packageId=0):
-
148  downloadList = []
-
149 
-
150  foundList = self.findMaterialsByNamefindMaterialsByName(searchExpr)
-
151  if len(foundList) > 0:
-
152  for found in foundList:
-
153  listNumber = found['listNumber']
-
154  materialNumber = found['materialNumber']
-
155  matName = found['title']
-
156  self.loggerlogger.info(f'> Download material: {matName} List: {listNumber}. Index: {materialNumber}')
-
157  result = [data, title] = self.downloadPackagedownloadPackage(listNumber, materialNumber, packageId)
-
158  downloadList.append(result)
-
159  return downloadList
-
160 
-
161  def findMaterialsByName(self, materialName) -> list:
-
162  '''
-
163  Find materials by name.
-
164  @param materialName: Regular expression to match the material name.
-
165  @return: A list of materials that match the regular expression of the form:
-
166  [ { 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': title } ]
-
167  '''
-
168  if (self.materialsmaterials == None):
-
169  return None
-
170 
-
171  materialsList = []
-
172  listNumber = 0
-
173  materialNumber = 0
-
174  for materialList in self.materialsmaterials:
-
175  for material in materialList['results']:
-
176  if re.match(materialName, material['title'], re.IGNORECASE):
-
177  materialsList.append({ 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': material['title'] })
-
178  materialNumber += 1
-
179  listNumber += 1
-
180 
-
181  return materialsList
-
182 
-
183  def getMaterialNames(self) -> list:
-
184  '''
-
185  Update the material names from the material lists.
-
186  @return: List of material names. If no materials are loaded, then an empty list is returned.
-
187  '''
-
188  self.materialNamesmaterialNames = []
-
189  if (self.materialsmaterials == None):
-
190  return []
-
191 
-
192  for materialList in self.materialsmaterials:
-
193  for material in materialList['results']:
-
194  self.materialNamesmaterialNames.append(material['title'])
-
195 
-
196  return self.materialNamesmaterialNames
-
197 
-
198  def getMaterials(self) -> list:
-
199  '''
-
200  Get the materials returned from the GPUOpen material database.
-
201  Will loop based on the linked-list of materials stored in the database.
-
202  Currently the batch size requested is 100 materials per batch.
-
203  @return: List of material lists
-
204  '''
-
205 
-
206  self.materialsmaterials = []
-
207  self.materialNamesmaterialNames = []
-
208 
-
209  url = self.urlurl
-
210  headers = {
-
211  'accept': 'application/json'
-
212  }
-
213 
-
214  # Get batches of materials. Start with the first 100.
-
215  # Can apply more filters to this as needed in the future.
-
216  # This will get every material in the database.
-
217  params = {
-
218  'limit': 100,
-
219  'offset': 0
-
220  }
-
221  haveMoreMaterials = True
-
222  while (haveMoreMaterials):
-
223 
-
224  response = requests.get(url, headers=headers, params=params)
-
225 
-
226  if response.status_code == HTTPStatus.OK:
-
227 
-
228  raw_response = response.text
-
229 
-
230  # Split the response text assuming the JSON objects are concatenated
-
231  json_strings = raw_response.split('}{')
-
232  #self.logger.info('Number of JSON strings:', len(json_strings))
-
233  json_result_string = json_strings[0]
-
234  jsonObject = json.loads(json_result_string)
-
235  self.materialsmaterials.append(jsonObject)
-
236 
-
237  # Scan for next batch of materials
-
238  nextQuery = jsonObject['next']
-
239  if (nextQuery):
-
240  # Get limit and offset from this: 'https://api.matlib.gpuopen.com/api/materials/?limit=100&offset=100"'
-
241  # Split the string by '?'
-
242  queryParts = nextQuery.split('?')
-
243  # Split the string by '&'
-
244  queryParts = queryParts[1].split('&')
-
245  # Split the string by '='
-
246  limitParts = queryParts[0].split('=')
-
247  offsetParts = queryParts[1].split('=')
-
248  params['limit'] = int(limitParts[1])
-
249  params['offset'] = int(offsetParts[1])
-
250  self.loggerlogger.info(f'Fetch set of materials: limit: {params["limit"]} offset: {params["offset"]}')
-
251  else:
-
252  haveMoreMaterials = False
-
253  break
-
254 
-
255  else:
-
256  self.loggerlogger.info(f'Error: {response.status_code}, {response.text}')
-
257 
-
258  return self.materialsmaterials
-
259 
-
260  def getMaterialsAsJsonString(self) -> list:
-
261  '''
-
262  Get the JSON strings for the materials
-
263  @return: List of JSON strings for the materials. One string per material batch.
-
264  '''
-
265  results = []
-
266 
-
267  if (self.materialsmaterials == None):
-
268  return 0
-
269  for material in self.materialsmaterials:
-
270  results.append(json.dumps(material, indent=4, sort_keys=True))
-
271  return results
-
272 
-
273  def readMaterialFiles(self, fileNames) -> list:
-
274  '''
-
275  Load the materials from a set of JSON files downloaded from
-
276  the GPUOpen material database.
-
277  '''
-
278  self.materialsmaterials = []
-
279  for fileName in fileNames:
-
280  with open(fileName) as f:
-
281  data = json.load(f)
-
282  self.materialsmaterials.append(data)
-
283 
-
284  def writeMaterialFiles(self, folder, rootFileName) -> int:
-
285  '''
-
286  Write the materials to a set of MaterialX files.
-
287  @param folder: The folder to write the files to.
-
288  @param rootFileName: The root file name to use for the files.
-
289  @return: The number of files written.
-
290  '''
-
291  if (self.materialsmaterials == None):
-
292  return 0
-
293 
-
294  i = 0
-
295  if (len(self.materialsmaterials) > 0):
-
296  os.makedirs(folder, exist_ok=True)
-
297  for material in self.materialsmaterials:
-
298  # Write JSON to file
-
299  fileName = rootFileName + '_' + str(i) + '.json'
-
300  materialFileName = os.path.join(folder, fileName)
-
301  self.loggerlogger.info(f'> Write material to file: "{materialFileName}"')
-
302  with open(materialFileName, 'w') as f:
-
303  json.dump(material, f, indent=4, sort_keys=True)
-
304  i += 1
-
305 
-
306  return i
-
307 
-
308  def writeMaterialNamesToFile(self, fileName, sort=True):
-
309  '''
-
310  Write sorted list of the material names to a file in JSON format
-
311  @param fileName: The file name to write the material names to.
-
312  @param sort: If true, sort the material names.
-
313  '''
-
314  if (self.materialNamesmaterialNames == None):
-
315  return
-
316 
-
317  with open(fileName, 'w') as f:
-
318  json.dump(self.materialNamesmaterialNames, f, indent=2, sort_keys=sort)
-
This class is used to load materials from the GPUOpen material database.
- -
list getMaterials(self)
Get the materials returned from the GPUOpen material database.
- - -
def downloadPackage(self, listNumber, materialNumber, packageId=0)
Download a package for a given material from the GPUOpen material database.
-
int writeMaterialFiles(self, folder, rootFileName)
Write the materials to a set of MaterialX files.
-
bool writePackageDataToFile(self, data, outputFolder, title, unzipFile=True)
Write a package data to a file.
- -
list findMaterialsByName(self, materialName)
Find materials by name.
-
list getMaterialsAsJsonString(self)
Get the JSON strings for the materials.
-
def extractPackageData(self, data, pilImage)
Extract the package data from a zip file.
-
def writeMaterialNamesToFile(self, fileName, sort=True)
Write sorted list of the material names to a file in JSON format.
- -
list getMaterialNames(self)
Update the material names from the material lists.
- -
list readMaterialFiles(self, fileNames)
Load the materials from a set of JSON files downloaded from the GPUOpen material database.
+
1'''
+
2@brief Utilities to extract materials from the GPUOpen material database. This is not a complete set of calls to extract out all material information but instead enough to find materials
+
3and extract out specific packages from the list of available materials.
+
4
+
5See: https://api.matlib.gpuopen.com/api/swagger/ for information on available API calls.
+
6'''
+
7
+
8import requests, json, os, io, re, zipfile, logging
+
9from http import HTTPStatus
+
10# Note: MaterialX is not currently a dependency since no MaterialX processing is required.
+
11#import MaterialX as mx
+
12
+
13import io
+
14import zipfile
+
15from PIL import Image as pilImage
+
16
+
+ +
18 '''
+
19 This class is used to load materials from the GPUOpen material database.
+
20 See: https://api.matlib.gpuopen.com/api/swagger/ for API information.
+
21 '''
+
22 def __init__(self):
+
23 self.root_url = 'https://api.matlib.gpuopen.com/api'
+
24 self.url = self.root_url + '/materials'
+
25 self.package_url = self.root_url + '/packages'
+ +
27
+
28 self.logger = logging.getLogger('GPUO')
+
29 logging.basicConfig(level=logging.INFO)
+
30
+
+
31 def writePackageDataToFile(self, data, outputFolder, title, unzipFile=True) -> bool:
+
32 '''
+
33 Write a package data to a file.
+
34 @param data: The data to write.
+
35 @param outputFolder: The output folder to write the file to.
+
36 @param title: The title of the file.
+
37 @param unzipFile: If true, the file is unzipped to a folder with the same name
+
38 as the title.
+
39 @return: True if the package was written.
+
40 '''
+
41 if not data:
+
42 return False
+
43
+
44 if not os.path.exists(outputFolder):
+
45 os.makedirs(outputFolder)
+
46
+
47 if unzipFile:
+
48 # Assuming `data` is the binary data of the zip file and `title` and `outputFolder` are defined
+
49 unzipFolder = os.path.join(outputFolder, title)
+
50
+
51 # Use BytesIO to handle the data in memory
+
52 with io.BytesIO(data) as data_io:
+
53 with zipfile.ZipFile(data_io, 'r') as zip_ref:
+
54 zip_ref.extractall(unzipFolder)
+
55
+
56 self.logger.info(f'Unzipped to folder: "{unzipFolder}"')
+
57
+
58 else:
+
59 outputFile = os.path.join(outputFolder, f"{title}.zip")
+
60 with open(outputFile, "wb") as f:
+
61 self.logger.info(f'Write package to file: "{outputFile}"')
+
62 f.write(data)
+
63
+
64 return True
+
65
+
+
+
66 def extractPackageData(self, data, pilImage):
+
67 '''
+
68 Extract the package data from a zip file.
+
69 @param data: The data to extract.
+
70 @param pilImage: The PIL image module.
+
71 @return: A list of extracted data of the form:
+
72 [ { 'file_name': file_name, 'data': data, 'type': type } ]
+
73 '''
+
74 if not pilImage:
+
75 self.logger.debug('Pillow (PIL) image module provided. Image data will not be extracted.')
+
76
+
77 zip_object = io.BytesIO(data)
+
78
+
79 extracted_data_list = []
+
80 with zipfile.ZipFile(zip_object, 'r') as zip_file:
+
81 # Iterate through the files in the zip archive
+
82 for file_name in zip_file.namelist():
+
83 # Extract each file into memory
+
84 extracted_data = zip_file.read(file_name)
+
85 if file_name.endswith('.mtlx'):
+
86 mtlx_string = extracted_data.decode('utf-8')
+
87 extracted_data_list.append( {'file_name': file_name, 'data': mtlx_string, 'type': 'mtlx'} )
+
88
+
89 # If the data is a image, create a image in Python
+
90 elif file_name.endswith('.png'):
+
91 if pilImage:
+
92 image = pilImage.open(io.BytesIO(extracted_data))
+
93 else:
+
94 image = None
+
95 extracted_data_list.append( {'file_name': file_name, 'data': image, 'type': 'image'} )
+
96
+
97 return extracted_data_list
+
98
+
+
+
99 def downloadPackage(self, listNumber, materialNumber, packageId=0):
+
100 '''
+
101 Download a package for a given material from the GPUOpen material database.
+
102 @param listNumber: The list number of the material to download.
+
103 @param materialNumber: The material number to download.
+
104 @param packageId: The package ID to download.
+
105 Packages are numbered starting at 0. Default is 0.
+
106 with index 0 containing the smallest package (smallest resolution referenced textures).
+
107 '''
+
108 if self.materialsmaterialsmaterials == None or len(self.materialsmaterialsmaterials) == 0:
+
109 return [None, None]
+
110
+
111 json_data = self.materialsmaterialsmaterials[listNumber]
+
112 if not json_data:
+
113 return [None, None]
+
114
+
115 jsonResults = None
+
116 jsonResult = None
+
117 if "results" in json_data:
+
118 jsonResults = json_data["results"]
+
119 if len(jsonResults) <= materialNumber:
+
120 return [None, None]
+
121 else:
+
122 jsonResult = jsonResults[materialNumber]
+
123
+
124 if not jsonResult:
+
125 return [None, None]
+
126
+
127 # Get the package ID
+
128 jsonPackages = None
+
129 if "packages" in jsonResult:
+
130 jsonPackages = jsonResult["packages"]
+
131 if not jsonPackages:
+
132 return [None, None]
+
133
+
134 if len(jsonPackages) <= packageId:
+
135 return [None, None]
+
136 package_id = jsonPackages[packageId]
+
137
+
138 if not package_id:
+
139 return [None, None]
+
140
+
141 url = f"{self.package_url}/{package_id}/download"
+
142 data = requests.get(url).content
+
143
+
144 title = jsonResult["title"]
+
145 return [data, title]
+
146
+
+
147 def downloadPackageByExpression(self, searchExpr, packageId=0):
+
148 downloadList = []
+
149
+
150 foundList = self.findMaterialsByName(searchExpr)
+
151 if len(foundList) > 0:
+
152 for found in foundList:
+
153 listNumber = found['listNumber']
+
154 materialNumber = found['materialNumber']
+
155 matName = found['title']
+
156 self.logger.info(f'> Download material: {matName} List: {listNumber}. Index: {materialNumber}')
+
157 result = [data, title] = self.downloadPackage(listNumber, materialNumber, packageId)
+
158 downloadList.append(result)
+
159 return downloadList
+
160
+
+
161 def findMaterialsByName(self, materialName) -> list:
+
162 '''
+
163 Find materials by name.
+
164 @param materialName: Regular expression to match the material name.
+
165 @return: A list of materials that match the regular expression of the form:
+
166 [ { 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': title } ]
+
167 '''
+
168 if (self.materialsmaterialsmaterials == None):
+
169 return None
+
170
+
171 materialsList = []
+
172 listNumber = 0
+
173 materialNumber = 0
+
174 for materialList in self.materialsmaterialsmaterials:
+
175 for material in materialList['results']:
+
176 if re.match(materialName, material['title'], re.IGNORECASE):
+
177 materialsList.append({ 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': material['title'] })
+
178 materialNumber += 1
+
179 listNumber += 1
+
180
+
181 return materialsList
+
182
+
+
+
183 def getMaterialNames(self) -> list:
+
184 '''
+
185 Update the material names from the material lists.
+
186 @return: List of material names. If no materials are loaded, then an empty list is returned.
+
187 '''
+
188 self.materialNames = []
+
189 if (self.materialsmaterialsmaterials == None):
+
190 return []
+
191
+
192 for materialList in self.materialsmaterialsmaterials:
+
193 for material in materialList['results']:
+
194 self.materialNames.append(material['title'])
+
195
+
196 return self.materialNames
+
197
+
+
+
198 def getMaterials(self) -> list:
+
199 '''
+
200 Get the materials returned from the GPUOpen material database.
+
201 Will loop based on the linked-list of materials stored in the database.
+
202 Currently the batch size requested is 100 materials per batch.
+
203 @return: List of material lists
+
204 '''
+
205
+ +
207 self.materialNames = []
+
208
+
209 url = self.url
+
210 headers = {
+
211 'accept': 'application/json'
+
212 }
+
213
+
214 # Get batches of materials. Start with the first 100.
+
215 # Can apply more filters to this as needed in the future.
+
216 # This will get every material in the database.
+
217 params = {
+
218 'limit': 100,
+
219 'offset': 0
+
220 }
+
221 haveMoreMaterials = True
+
222 while (haveMoreMaterials):
+
223
+
224 response = requests.get(url, headers=headers, params=params)
+
225
+
226 if response.status_code == HTTPStatus.OK:
+
227
+
228 raw_response = response.text
+
229
+
230 # Split the response text assuming the JSON objects are concatenated
+
231 json_strings = raw_response.split('}{')
+
232 #self.logger.info('Number of JSON strings:', len(json_strings))
+
233 json_result_string = json_strings[0]
+
234 jsonObject = json.loads(json_result_string)
+
235 self.materialsmaterialsmaterials.append(jsonObject)
+
236
+
237 # Scan for next batch of materials
+
238 nextQuery = jsonObject['next']
+
239 if (nextQuery):
+
240 # Get limit and offset from this: 'https://api.matlib.gpuopen.com/api/materials/?limit=100&offset=100"'
+
241 # Split the string by '?'
+
242 queryParts = nextQuery.split('?')
+
243 # Split the string by '&'
+
244 queryParts = queryParts[1].split('&')
+
245 # Split the string by '='
+
246 limitParts = queryParts[0].split('=')
+
247 offsetParts = queryParts[1].split('=')
+
248 params['limit'] = int(limitParts[1])
+
249 params['offset'] = int(offsetParts[1])
+
250 self.logger.info(f'Fetch set of materials: limit: {params["limit"]} offset: {params["offset"]}')
+
251 else:
+
252 haveMoreMaterials = False
+
253 break
+
254
+
255 else:
+
256 self.logger.info(f'Error: {response.status_code}, {response.text}')
+
257
+
258 return self.materialsmaterialsmaterials
+
259
+
+
+
260 def getMaterialsAsJsonString(self) -> list:
+
261 '''
+
262 Get the JSON strings for the materials
+
263 @return: List of JSON strings for the materials. One string per material batch.
+
264 '''
+
265 results = []
+
266
+
267 if (self.materialsmaterialsmaterials == None):
+
268 return 0
+
269 for material in self.materialsmaterialsmaterials:
+
270 results.append(json.dumps(material, indent=4, sort_keys=True))
+
271 return results
+
272
+
+
+
273 def readMaterialFiles(self, fileNames) -> list:
+
274 '''
+
275 Load the materials from a set of JSON files downloaded from
+
276 the GPUOpen material database.
+
277 '''
+ +
279 for fileName in fileNames:
+
280 with open(fileName) as f:
+
281 data = json.load(f)
+
282 self.materialsmaterialsmaterials.append(data)
+
283
+
+
+
284 def writeMaterialFiles(self, folder, rootFileName) -> int:
+
285 '''
+
286 Write the materials to a set of MaterialX files.
+
287 @param folder: The folder to write the files to.
+
288 @param rootFileName: The root file name to use for the files.
+
289 @return: The number of files written.
+
290 '''
+
291 if (self.materialsmaterialsmaterials == None):
+
292 return 0
+
293
+
294 i = 0
+
295 if (len(self.materialsmaterialsmaterials) > 0):
+
296 os.makedirs(folder, exist_ok=True)
+
297 for material in self.materialsmaterialsmaterials:
+
298 # Write JSON to file
+
299 fileName = rootFileName + '_' + str(i) + '.json'
+
300 materialFileName = os.path.join(folder, fileName)
+
301 self.logger.info(f'> Write material to file: "{materialFileName}"')
+
302 with open(materialFileName, 'w') as f:
+
303 json.dump(material, f, indent=4, sort_keys=True)
+
304 i += 1
+
305
+
306 return i
+
307
+
+
+
308 def writeMaterialNamesToFile(self, fileName, sort=True):
+
309 '''
+
310 Write sorted list of the material names to a file in JSON format
+
311 @param fileName: The file name to write the material names to.
+
312 @param sort: If true, sort the material names.
+
313 '''
+
314 if (self.materialNames == None):
+
315 return
+
316
+
317 with open(fileName, 'w') as f:
+
318 json.dump(self.materialNames, f, indent=2, sort_keys=sort)
+
+
+
This class is used to load materials from the GPUOpen material database.
+
writeMaterialNamesToFile(self, fileName, sort=True)
Write sorted list of the material names to a file in JSON format.
+ +
list getMaterials(self)
Get the materials returned from the GPUOpen material database.
+
int writeMaterialFiles(self, folder, rootFileName)
Write the materials to a set of MaterialX files.
+ + + +
bool writePackageDataToFile(self, data, outputFolder, title, unzipFile=True)
Write a package data to a file.
+ +
list findMaterialsByName(self, materialName)
Find materials by name.
+
downloadPackage(self, listNumber, materialNumber, packageId=0)
Download a package for a given material from the GPUOpen material database.
+ +
extractPackageData(self, data, pilImage)
Extract the package data from a zip file.
+
list getMaterialsAsJsonString(self)
Get the JSON strings for the materials.
+ +
list getMaterialNames(self)
Update the material names from the material lists.
+ +
list readMaterialFiles(self, fileNames)
Load the materials from a set of JSON files downloaded from the GPUOpen material database.
diff --git a/documents/html/_g_p_u_open_loader_cmd_8py_source.html b/documents/html/_g_p_u_open_loader_cmd_8py_source.html index 9627340..428d6dd 100644 --- a/documents/html/_g_p_u_open_loader_cmd_8py_source.html +++ b/documents/html/_g_p_u_open_loader_cmd_8py_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: GPUOpenLoaderCmd.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,116 +85,122 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
GPUOpenLoaderCmd.py
+
GPUOpenLoaderCmd.py
-
1 #/usr/bin/env python3
-
2 
-
3 import os, argparse, sys, logging
-
4 import GPUOpenLoader as gpuo
-
5 
-
6 def GPUOpenLoaderCmd():
-
7  '''
-
8  Utility to download and write GPUOpen materials
-
9  '''
-
10  logger = logging.getLogger('GPUO_CMD')
-
11  logging.basicConfig(level=logging.INFO)
-
12 
-
13  parser = argparse.ArgumentParser(description='Get materials information and material package from AMD GPUOpen.'
-
14  ' By default the materials will be downloaded and a named and index material'
-
15  ' package will be extracted.')
-
16  parser.add_argument('--materialNames', type=bool, default=None,
-
17  help='Return material names. Default is False')
-
18  #parser.add_argument('--loadMaterials', type=str, default='',
-
19  # help='Folder to load materials from. All JSON files with post-fix _#.json are loaded. Default is false'
-
20  # ' meaning to download materials')
-
21  parser.add_argument('--saveMaterials', type=bool, default=None,
-
22  help='Save material lists. Default is None.'
-
23  ' Has no effect if --loadMaterials is set')
-
24  parser.add_argument('--extractExpression', type=str, default='Oliana Blue Painted Wood',
-
25  help='Extract out a package for a materials which match a given expression. Default is a sample material'
-
26  ' Has no effect if --loadMaterials is set')
-
27  parser.add_argument('--extractIndices', type=str, default='0,1,0',
-
28  help='Extract out a package for a materials which match a given material list, material index, and package index.'
-
29  ' Default is 0,1,0 which is currently the "Emerald Peaks Wallpaper" material')
-
30  parser.add_argument('--output', type=str, default='',
-
31  help='Output folder for data files. Default location is GPUOpenMaterialX.'
-
32  ' Has no effect if --loadMaterials is set')
-
33  opts = parser.parse_args()
-
34 
-
35  loader = gpuo.GPUOpenMaterialLoader()
-
36 
-
37  # TODO: Add support for this
-
38  #if opts.loadMaterials:
-
39  # logger.info(f'> Load materials from folder: {opts.loadMaterials}')
-
40  # return
-
41 
-
42  outputFolder = 'GPUOpenMaterialX'
-
43  if opts.output:
-
44  if not os.path.exists(opts.output):
-
45  logger.error(f'Error: Output directory does not exist: {opts.output}')
-
46  sys.exit(1)
-
47  else:
-
48  outputFolder = opts.output
-
49 
-
50  # Download materials
-
51  materials = loader.getMaterials()
-
52  materialNames = loader.getMaterialNames()
-
53  materialCount = len(materialNames)
-
54  logger.info(f'Available number of materials: {materialCount}')
-
55  if opts.saveMaterials:
-
56  loader.writeMaterialFiles(outputFolder, 'GPUOpenMaterialX')
-
57 
-
58  # Create a test expression
-
59  searchExpr = ''
-
60  if opts.extractExpression:
-
61  searchExpr = opts.extractExpression
-
62  if len(searchExpr) == 0:
-
63  logger.info(f'> No search expression given.')
-
64  else:
-
65  dataItems = loader.downloadPackageByExpression(searchExpr, 0)
-
66  for dataItem in dataItems:
-
67  data = dataItem[0]
-
68  title = dataItem[1]
-
69  loader.writePackageDataToFile(data, outputFolder, title)
-
70 
-
71  extractIndices = opts.extractIndices
-
72  if len(extractIndices) > 0:
-
73  indices = extractIndices.split(',')
-
74  if len(indices) != 3:
-
75  logger.error(f'Error: Invalid indices given: {extractIndices}')
-
76  sys.exit(1)
-
77 
-
78  materialList = int(indices[0])
-
79  materialIndex = int(indices[1])
-
80  materialPackage = int(indices[2])
-
81  [data, title] = loader.downloadPackage(materialList, materialIndex, materialPackage)
-
82  logger.info(f'> Download material: {title} List: {materialList}. Index: {materialIndex}. Package: {materialPackage}')
-
83  if data:
-
84  loader.writePackageDataToFile(data, outputFolder, title)
-
85 
-
86  if opts.materialNames:
-
87  materialNamesFile = os.path.join(outputFolder, 'GPUOpenMaterialX_Names.json')
-
88  logger.info(f'> Save materials names to file: {materialNamesFile}')
-
89  sorted = True
-
90  loader.writeMaterialNamesToFile(materialNamesFile, sorted)
-
91 
-
92 if __name__ == '__main__':
-
93  GPUOpenLoaderCmd()
+
1#/usr/bin/env python3
+
2
+
3import os, argparse, sys, logging
+
4import GPUOpenLoader as gpuo
+
5
+
6def GPUOpenLoaderCmd():
+
7 '''
+
8 Utility to download and write GPUOpen materials
+
9 '''
+
10 logger = logging.getLogger('GPUO_CMD')
+
11 logging.basicConfig(level=logging.INFO)
+
12
+
13 parser = argparse.ArgumentParser(description='Get materials information and material package from AMD GPUOpen.'
+
14 ' By default the materials will be downloaded and a named and index material'
+
15 ' package will be extracted.')
+
16 parser.add_argument('--materialNames', type=bool, default=None,
+
17 help='Return material names. Default is False')
+
18 #parser.add_argument('--loadMaterials', type=str, default='',
+
19 # help='Folder to load materials from. All JSON files with post-fix _#.json are loaded. Default is false'
+
20 # ' meaning to download materials')
+
21 parser.add_argument('--saveMaterials', type=bool, default=None,
+
22 help='Save material lists. Default is None.'
+
23 ' Has no effect if --loadMaterials is set')
+
24 parser.add_argument('--extractExpression', type=str, default='Oliana Blue Painted Wood',
+
25 help='Extract out a package for a materials which match a given expression. Default is a sample material'
+
26 ' Has no effect if --loadMaterials is set')
+
27 parser.add_argument('--extractIndices', type=str, default='0,1,0',
+
28 help='Extract out a package for a materials which match a given material list, material index, and package index.'
+
29 ' Default is 0,1,0 which is currently the "Emerald Peaks Wallpaper" material')
+
30 parser.add_argument('--output', type=str, default='',
+
31 help='Output folder for data files. Default location is GPUOpenMaterialX.'
+
32 ' Has no effect if --loadMaterials is set')
+
33 opts = parser.parse_args()
+
34
+
35 loader = gpuo.GPUOpenMaterialLoader()
+
36
+
37 # TODO: Add support for this
+
38 #if opts.loadMaterials:
+
39 # logger.info(f'> Load materials from folder: {opts.loadMaterials}')
+
40 # return
+
41
+
42 outputFolder = 'GPUOpenMaterialX'
+
43 if opts.output:
+
44 if not os.path.exists(opts.output):
+
45 logger.error(f'Error: Output directory does not exist: {opts.output}')
+
46 sys.exit(1)
+
47 else:
+
48 outputFolder = opts.output
+
49
+
50 # Download materials
+
51 materials = loader.getMaterials()
+
52 materialNames = loader.getMaterialNames()
+
53 materialCount = len(materialNames)
+
54 logger.info(f'Available number of materials: {materialCount}')
+
55 if opts.saveMaterials:
+
56 loader.writeMaterialFiles(outputFolder, 'GPUOpenMaterialX')
+
57
+
58 # Create a test expression
+
59 searchExpr = ''
+
60 if opts.extractExpression:
+
61 searchExpr = opts.extractExpression
+
62 if len(searchExpr) == 0:
+
63 logger.info(f'> No search expression given.')
+
64 else:
+
65 dataItems = loader.downloadPackageByExpression(searchExpr, 0)
+
66 for dataItem in dataItems:
+
67 data = dataItem[0]
+
68 title = dataItem[1]
+
69 loader.writePackageDataToFile(data, outputFolder, title)
+
70
+
71 extractIndices = opts.extractIndices
+
72 if len(extractIndices) > 0:
+
73 indices = extractIndices.split(',')
+
74 if len(indices) != 3:
+
75 logger.error(f'Error: Invalid indices given: {extractIndices}')
+
76 sys.exit(1)
+
77
+
78 materialList = int(indices[0])
+
79 materialIndex = int(indices[1])
+
80 materialPackage = int(indices[2])
+
81 [data, title] = loader.downloadPackage(materialList, materialIndex, materialPackage)
+
82 logger.info(f'> Download material: {title} List: {materialList}. Index: {materialIndex}. Package: {materialPackage}')
+
83 if data:
+
84 loader.writePackageDataToFile(data, outputFolder, title)
+
85
+
86 if opts.materialNames:
+
87 materialNamesFile = os.path.join(outputFolder, 'GPUOpenMaterialX_Names.json')
+
88 logger.info(f'> Save materials names to file: {materialNamesFile}')
+
89 sorted = True
+
90 loader.writeMaterialNamesToFile(materialNamesFile, sorted)
+
91
+
92if __name__ == '__main__':
+
93 GPUOpenLoaderCmd()
diff --git a/documents/html/_js_material_x_physically_based_8js_source.html b/documents/html/_js_material_x_physically_based_8js_source.html index 88e0ba9..d2ca6d3 100644 --- a/documents/html/_js_material_x_physically_based_8js_source.html +++ b/documents/html/_js_material_x_physically_based_8js_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: JsMaterialXPhysicallyBased.js Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,405 +85,441 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
JsMaterialXPhysicallyBased.js
+
JsMaterialXPhysicallyBased.js
-
1 let MTLX_NODE_NAME_ATTRIBUTE = 'nodename';
-
2 
- -
13  url = '';
-
18  headers = {};
-
23  materials = null;
- - -
38  mx = null;
-
43  doc = null;
-
48  stdlib = null;
-
53  remapMap = {};
-
54 
-
60  constructor(mtlx_module = null, mtlx_stdlib = null)
-
61  {
-
62  this.url = 'https://api.physicallybased.info/materials';
-
63  this.headers = { 'Accept': 'application/json' };
-
64 
-
65  this.materials = null;
-
66  this.materialNames = [];
-
67 
-
68  this.mxMaterialNames = [];
-
69  this.mx = null;
-
70  if (mtlx_module) {
-
71  this.mx = mtlx_module;
-
72  }
-
73  this.stdlib = null;
-
74  if (mtlx_stdlib) {
-
75  this.stdlib = mtlx_stdlib;
-
76  }
-
77  this.doc = null;
-
78 
- -
80  }
-
81 
- -
87  {
-
88  return this.materials
-
89  }
-
90 
- -
95  {
-
96  return this.materialNames
-
97  }
-
98 
- -
103  {
-
104  return this.doc;
-
105  }
-
106 
- -
112  {
-
113  if (this.doc) {
-
114  let errors = {}
-
115  let errorString = ''
-
116  var valid = this.doc.validate(errors);
-
117  if (!valid) {
-
118  errorString = errors.message;
-
119  }
-
120  return [valid, errorString]
-
121  }
-
122  return [false, 'No MaterialX document'];
-
123  }
-
124 
-
130  getInputRemapping(shadingModel)
-
131  {
-
132  if (shadingModel in this.remapMap) {
-
133  return this.remapMap[shadingModel];
-
134  }
-
135  return {};
-
136  }
-
137 
- -
143  {
-
144  // Remap keys for Autodesk Standard Surface shader. How to verify this?
-
145  const standard_surface_remapKeys = {
-
146  'color': 'base_color',
-
147  'specularColor': 'specular_color',
-
148  'roughness': 'specular_roughness',
-
149  //'metalness': 'metalness',
-
150  'ior': 'specular_IOR',
-
151  //'transmission': 'transmission',
-
152  'transmission_color': 'transmission_color',
-
153  'thinFilmIor': 'thin_film_IOR',
-
154  'thinFilmThickness': 'thin_film_thickness',
-
155  'transmissionDispersion': 'transmission_dispersion',
-
156  }
-
157  // Remap keys for OpenPBR shading model.
-
158  const openpbr_remapKeys = {
-
159  'color': 'base_color',
-
160  'specularColor': 'specular_color',
-
161  'roughness': 'specular_roughness', // 'base_diffuse_roughness',
-
162  'metalness': 'base_metalness',
-
163  'ior': 'specular_ior',
-
164  'transmission': 'transmission_weight',
-
165  'transmission_color': 'transmission_color',
-
166  'subsurfaceRadius': 'subsurface_radius',
-
167  'thinFilmIor': 'thin_film_ior',
-
168  'thinFilmThickness': 'thin_film_thickness',
-
169  'transmissionDispersion': 'transmission_dispersion_scale',
-
170  }
-
171  // Remap keys for Khronos glTF shading model.
-
172  const gltf_remapKeys = {
-
173  'color': 'base_color',
-
174  'specularColor': 'specular_color',
-
175  'roughness': 'roughness',
-
176  'metalness': 'metallic',
-
177  'transmission_color': 'attenuation_color',
-
178  //'ior': 'ior',
-
179  //'transmission': 'transmission',
-
180  }
-
181 
-
182  this.remapMap = {}
-
183  this.remapMap['standard_surface'] = standard_surface_remapKeys;
-
184  this.remapMap['gltf_pbr'] = gltf_remapKeys;
-
185  this.remapMap['open_pbr_surface'] = openpbr_remapKeys;
-
186  }
-
187 
- -
193  {
-
194  return new Promise((resolve, reject) => {
-
195  MaterialX().then((mtlx) => {
-
196  this.mx = mtlx;
-
197  resolve();
-
198  }).catch((error) => {
-
199  reject(error);
-
200  });
-
201  });
-
202  }
-
203 
- -
209  {
-
210  try {
-
211  this.materials = null
-
212  this.materialNames = [];
-
213 
-
214  const response = await fetch(this.url, {
-
215  method: 'GET',
-
216  headers: this.headers
-
217  });
-
218 
-
219  if (!response.ok) {
-
220  throw new Error('Network response was not ok ' + response.statusText);
-
221  }
-
222 
-
223  this.materials = await response.json();
-
224  for (let i = 0; i < this.materials.length; i++) {
-
225  this.materialNames.push(this.materials[i]['name']);
-
226  }
-
227  return this.materials;
-
228  } catch (error) {
-
229  console.error('There has been a problem with your fetch operation:', error);
-
230  }
-
231 
-
232  return null;
-
233  }
-
234 
- -
240  {
-
241  if (!this.mx) {
-
242  // Call the asynchronous function and then perform additional logic
-
243  this.loadMaterialX().then(() => {
-
244 
-
245  this.esslgenerator = new this.mx.EsslShaderGenerator();
-
246  this.esslgenContext = new this.mx.GenContext(this.esslgenerator);
-
247  this.stdlib = this.mx.loadStandardLibraries(this.esslgenContext);
-
248  let children = this.stdlib.getChildren();
-
249  for (let i = 0; i < children.length; i++) {
-
250  let child = children[i];
-
251  child.setSourceUri('STDLIB_ELEMENT');
-
252  }
-
253 
-
254  console.log("MaterialX is loaded");
-
255  }).catch((error) => {
-
256  console.error("Error loading MaterialX:", error);
-
257  });
-
258  }
-
259  }
-
260 
- -
267  {
-
268  return !elem.hasSourceUri()
-
269  }
-
270 
- -
276  {
-
277  if (!this.doc) {
-
278  console.error('No MaterialX document to convert');
-
279  return '';
-
280  }
-
281 
-
282  // Create write options
-
283  const writeOptions = new this.mx.XmlWriteOptions();
-
284  writeOptions.writeXIncludeEnable = false;
-
285  //writeOptions.writeXIncludes = false;
-
286  writeOptions.elementPredicate = this.skipLibraryElement;
-
287 
-
288  // Convert the MaterialX document to a string
-
289  const mtlx = this.mx.writeToXmlString(this.doc, writeOptions);
-
290  return mtlx;
-
291  }
-
292 
-
298  addComment(doc, commentString)
-
299  {
-
300  let comment = doc.addChildOfCategory('comment')
-
301  comment.setDocString(commentString)
-
302  }
-
303 
-
304 
-
314  convertToMaterialX(shaderCategory, addAllInputs = false, materialNames = [], remapKeys = {}, shaderPreFix = '')
-
315  {
-
316  if (!this.mx) {
-
317  console.error('MaterialX module is not loaded');
-
318  return false;
-
319  }
-
320 
-
321  if (!this.materials) {
-
322  console.warn('No Physically Based Materials to convert');
-
323  return false;
-
324  }
-
325 
-
326  if (remapKeys.length == 0) {
-
327  remapKeys = this.getInputRemapping(shaderCategory);
-
328  }
-
329 
-
330  // Create a dummy doc with the surface shader with all inputs
-
331  // as reference
-
332  let refDoc = this.mx.createDocument();
-
333  refDoc.importLibrary(this.stdlib);
-
334  const refNode = refDoc.addNode(shaderCategory, 'refShader', this.mx.SURFACE_SHADER_TYPE_STRING);
-
335  //refNode.addInputsFromNodeDef() -- This is missing from the JS API.
-
336  this.doc = this.mx.createDocument();
-
337 
-
338  // Add header comments
-
339  this.addComment(this.doc, 'Physically Based Materials from https://api.physicallybased.info ');
-
340  this.addComment(this.doc, ' Processed via API and converted to MaterialX ');
-
341  this.addComment(this.doc, ' Target Shading Model: ' + shaderCategory);
-
342  this.addComment(this.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ');
-
343 
-
344  // Add properties to the material
-
345  for (let i = 0; i < this.materials.length; i++) {
-
346  const mat = this.materials[i];
-
347  let matName = mat['name'];
-
348 
-
349  // Filter by material name(s)
-
350  if (materialNames.length > 0 && !materialNames.includes(matName)) {
-
351  // Skip material
-
352  console.log('Skipping material:', matName);
-
353  continue;
-
354  }
-
355 
-
356 
-
357  if (shaderPreFix.length > 0) {
-
358  matName = shaderPreFix + '_' + matName;
-
359  }
-
360 
-
361  const shaderName = this.doc.createValidChildName('SPB_' + matName);
-
362  this.addComment(this.doc, ' Generated shader: ' + shaderName + ' ');
-
363  const shaderNode = this.doc.addNode(shaderCategory, shaderName, this.mx.SURFACE_SHADER_TYPE_STRING);
-
364  let docString = mat['description'];
-
365  const refString = mat['reference'];
-
366  if (refString.length > 0) {
-
367  if (docString.length > 0) {
-
368  docString += '. ';
-
369  }
-
370  docString += 'Reference: ' + refString[0];
-
371  }
-
372  if (docString.length > 0) {
-
373  shaderNode.setDocString(docString);
-
374  }
-
375 
-
376  // Create a new material
-
377  const materialName = this.doc.createValidChildName('MPB_' + matName);
-
378  this.addComment(this.doc, ' Generated material: ' + materialName + ' ');
-
379  const materialNode = this.doc.addNode(this.mx.SURFACE_MATERIAL_NODE_STRING, materialName, this.mx.MATERIAL_TYPE_STRING);
-
380  const shaderInput = materialNode.addInput(this.mx.SURFACE_SHADER_TYPE_STRING, this.mx.SURFACE_SHADER_TYPE_STRING);
-
381  shaderInput.setAttribute(MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName());
-
382 
-
383  // Warning this is a bit bespoke for remapping keys
-
384  // to Autodesk Standard Surface shader inputs
-
385  const skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"];
-
386 
-
387  let metallness = null;
-
388  let roughness = null;
-
389  let transmission_color = null;
-
390  let transmission = null;
-
391  Object.entries(mat).forEach(([key, value]) => {
-
392 
-
393  if (!skipKeys.includes(key)) {
-
394 
-
395  if (key == 'metalness') {
-
396  metallness = value;
-
397  //console.log('Metalness:', metallness);
-
398  }
-
399  if (key == 'roughness') {
-
400  roughness = value;
-
401  //console.log('Roughness:', roughness);
-
402  }
-
403  if (key == 'transmission') {
-
404  transmission = value;
-
405  //console.log('Transmission:', transmission);
-
406  }
-
407  if (key == 'color') {
-
408  transmission_color = value;
-
409  //console.log('Color:', color);
-
410  }
-
411 
-
412  if (remapKeys[key]) {
-
413  key = remapKeys[key];
-
414  }
-
415 
-
416  let refInput = refNode.getInput(key);
-
417  if (!refInput)
-
418  refInput = refNode.addInputFromNodeDef(key);
-
419  if (refInput) {
-
420  const input = shaderNode.addInput(key);
-
421  input.copyContentFrom(refInput);
-
422  if (input) {
-
423  // Convert number vector to string
-
424  if (Array.isArray(value)) {
-
425  value = value.join(',');
-
426  }
-
427  // Convert number to string
-
428  else if (typeof value === 'number') {
-
429  value = value.toString();
-
430  }
-
431  // Note: This API has side-effects as the
-
432  // type is set to "string" when the value is set. Thus
-
433  // we must explicitly set the type here.
-
434  input.setValueString(value, refInput.getType());
-
435  }
-
436  }
-
437  else {
-
438  //console.log('>>> Cannot create input:', key)
-
439  }
-
440  }
-
441  });
-
442 
-
443  if (transmission !== null && metallness !== null && roughness !== null && transmission_color !== null)
-
444  {
-
445  if (metallness == 0 && roughness == 0)
-
446  {
-
447  if (remapKeys['transmission_color']) {
-
448  let inputName = remapKeys['transmission_color'];
-
449  let input = shaderNode.addInput(inputName);
-
450  if (input) {
-
451  let value = transmission_color.join(',');
-
452  console.log(`Add "${inputName}": "${value}"`);
-
453  input.setValueString(value, 'color3');
-
454  }
-
455  }
-
456  }
-
457  };
-
458  }
-
459  return true;
-
460  }
-
461 
-
462 }
-
Javascript class for querying materials from the Physically Based database and creating MaterialX mat...
-
skipLibraryElement(element)
Predicate to skip library elements.
- -
getJSONMaterialNames()
Get list of the Physically Based Material names.
-
initializeInputRemapping()
Initialize the input remapping for different shading models.
-
getInputRemapping(shadingModel)
Get the remapping keys for a given shading model.
-
getJSON()
Get the Physically Based Materials as JSON.
-
getMaterialXDocument()
Get the MaterialX document.
-
remapMap
Remap keys for input values for different shading models.
-
materials
List of Physically Based Materials.
-
loadStandardLibraries()
Load the MaterialX standard libraries.
-
constructor(mtlx_module=null, mtlx_stdlib=null)
Constructor for the PhysicallyBasedMaterialLoader.
-
loadMaterialX()
Load the MaterialX module.
-
getMaterialXString()
Get the MaterialX document as a string.
-
async getPhysicallyBasedMaterials()
Get the Physically Based Materials from the API.
-
materialNames
List of Physically Based Material names.
- -
mxMaterialNames
List of MaterialX Material names.
-
headers
Headers for the fetch operation.
-
url
URL to fetch the Physically Based Materials.
- -
convertToMaterialX(shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='')
Convert the Physically Based Materials to MaterialX.
-
addComment(doc, commentString)
Add a comment to the MaterialX document.
-
validateDocument()
Validate the MaterialX document.
+
1let MTLX_NODE_NAME_ATTRIBUTE = 'nodename';
+
2
+
+ +
13 url = '';
+
18 headers = {};
+
23 materials = null;
+ + +
38 mx = null;
+
43 doc = null;
+
48 stdlib = null;
+ +
54
+
+
60 constructor(mtlx_module = null, mtlx_stdlib = null)
+
61 {
+
62 this.url = 'https://api.physicallybased.info/materials';
+
63 this.headers = { 'Accept': 'application/json' };
+
64
+
65 this.materials = null;
+
66 this.materialNames = [];
+
67
+
68 this.mxMaterialNames = [];
+
69 this.mx = null;
+
70 if (mtlx_module) {
+
71 this.mx = mtlx_module;
+
72 }
+
73 this.stdlib = null;
+
74 if (mtlx_stdlib) {
+
75 this.stdlib = mtlx_stdlib;
+
76 }
+
77 this.doc = null;
+
78
+ +
80 }
+
+
81
+
+ +
87 {
+
88 return this.materials
+
89 }
+
+
90
+
+ +
95 {
+
96 return this.materialNames
+
97 }
+
+
98
+
+ +
103 {
+
104 return this.doc;
+
105 }
+
+
106
+
+ +
112 {
+
113 if (this.doc) {
+
114 let errors = {}
+
115 let errorString = ''
+
116 var valid = this.doc.validate(errors);
+
117 if (!valid) {
+
118 errorString = errors.message;
+
119 }
+
120 return [valid, errorString]
+
121 }
+
122 return [false, 'No MaterialX document'];
+
123 }
+
+
124
+
+
130 getInputRemapping(shadingModel)
+
131 {
+
132 if (shadingModel in this.remapMap) {
+
133 return this.remapMap[shadingModel];
+
134 }
+
135 return {};
+
136 }
+
+
137
+
+ +
143 {
+
144 // Remap keys for Autodesk Standard Surface shader. How to verify this?
+
145 const standard_surface_remapKeys = {
+
146 'color': 'base_color',
+
147 'specularColor': 'specular_color',
+
148 'roughness': 'specular_roughness',
+
149 //'metalness': 'metalness',
+
150 'ior': 'specular_IOR',
+
151 //'transmission': 'transmission',
+
152 'transmission_color': 'transmission_color',
+
153 'thinFilmIor': 'thin_film_IOR',
+
154 'thinFilmThickness': 'thin_film_thickness',
+
155 'transmissionDispersion': 'transmission_dispersion',
+
156 }
+
157 // Remap keys for OpenPBR shading model.
+
158 const openpbr_remapKeys = {
+
159 'color': 'base_color',
+
160 'specularColor': 'specular_color',
+
161 'roughness': 'specular_roughness', // 'base_diffuse_roughness',
+
162 'metalness': 'base_metalness',
+
163 'ior': 'specular_ior',
+
164 'transmission': 'transmission_weight',
+
165 'transmission_color': 'transmission_color',
+
166 'subsurfaceRadius': 'subsurface_radius',
+
167 'thinFilmIor': 'thin_film_ior',
+
168 'thinFilmThickness': 'thin_film_thickness',
+
169 'transmissionDispersion': 'transmission_dispersion_scale',
+
170 }
+
171 // Remap keys for Khronos glTF shading model.
+
172 const gltf_remapKeys = {
+
173 'color': 'base_color',
+
174 'specularColor': 'specular_color',
+
175 'roughness': 'roughness',
+
176 'metalness': 'metallic',
+
177 'transmission_color': 'attenuation_color',
+
178 //'ior': 'ior',
+
179 //'transmission': 'transmission',
+
180 }
+
181
+
182 this.remapMap = {}
+
183 this.remapMap['standard_surface'] = standard_surface_remapKeys;
+
184 this.remapMap['gltf_pbr'] = gltf_remapKeys;
+
185 this.remapMap['open_pbr_surface'] = openpbr_remapKeys;
+
186 }
+
+
187
+
+ +
193 {
+
194 return new Promise((resolve, reject) => {
+
195 MaterialX().then((mtlx) => {
+
196 this.mx = mtlx;
+
197 resolve();
+
198 }).catch((error) => {
+
199 reject(error);
+
200 });
+
201 });
+
202 }
+
+
203
+
+ +
209 {
+
210 try {
+
211 this.materials = null
+
212 this.materialNames = [];
+
213
+
214 const response = await fetch(this.url, {
+
215 method: 'GET',
+
216 headers: this.headers
+
217 });
+
218
+
219 if (!response.ok) {
+
220 throw new Error('Network response was not ok ' + response.statusText);
+
221 }
+
222
+
223 this.materials = await response.json();
+
224 for (let i = 0; i < this.materials.length; i++) {
+
225 this.materialNames.push(this.materials[i]['name']);
+
226 }
+
227 return this.materials;
+
228 } catch (error) {
+
229 console.error('There has been a problem with your fetch operation:', error);
+
230 }
+
231
+
232 return null;
+
233 }
+
+
234
+
+ +
240 {
+
241 if (!this.mx) {
+
242 // Call the asynchronous function and then perform additional logic
+
243 this.loadMaterialX().then(() => {
+
244
+
245 this.esslgenerator = new this.mx.EsslShaderGenerator();
+
246 this.esslgenContext = new this.mx.GenContext(this.esslgenerator);
+
247 this.stdlib = this.mx.loadStandardLibraries(this.esslgenContext);
+
248 let children = this.stdlib.getChildren();
+
249 for (let i = 0; i < children.length; i++) {
+
250 let child = children[i];
+
251 child.setSourceUri('STDLIB_ELEMENT');
+
252 }
+
253
+
254 console.log("MaterialX is loaded");
+
255 }).catch((error) => {
+
256 console.error("Error loading MaterialX:", error);
+
257 });
+
258 }
+
259 }
+
+
260
+
+ +
267 {
+
268 return !elem.hasSourceUri()
+
269 }
+
+
270
+
+ +
276 {
+
277 if (!this.doc) {
+
278 console.error('No MaterialX document to convert');
+
279 return '';
+
280 }
+
281
+
282 // Create write options
+
283 const writeOptions = new this.mx.XmlWriteOptions();
+
284 writeOptions.writeXIncludeEnable = false;
+
285 //writeOptions.writeXIncludes = false;
+
286 writeOptions.elementPredicate = this.skipLibraryElement;
+
287
+
288 // Convert the MaterialX document to a string
+
289 const mtlx = this.mx.writeToXmlString(this.doc, writeOptions);
+
290 return mtlx;
+
291 }
+
+
292
+
+
298 addComment(doc, commentString)
+
299 {
+
300 let comment = doc.addChildOfCategory('comment')
+
301 comment.setDocString(commentString)
+
302 }
+
+
303
+
304
+
+
314 convertToMaterialX(shaderCategory, addAllInputs = false, materialNames = [], remapKeys = {}, shaderPreFix = '')
+
315 {
+
316 if (!this.mx) {
+
317 console.error('MaterialX module is not loaded');
+
318 return false;
+
319 }
+
320
+
321 if (!this.materials) {
+
322 console.warn('No Physically Based Materials to convert');
+
323 return false;
+
324 }
+
325
+
326 if (remapKeys.length == 0) {
+
327 remapKeys = this.getInputRemapping(shaderCategory);
+
328 }
+
329
+
330 // Create a dummy doc with the surface shader with all inputs
+
331 // as reference
+
332 let refDoc = this.mx.createDocument();
+
333 refDoc.importLibrary(this.stdlib);
+
334 const refNode = refDoc.addNode(shaderCategory, 'refShader', this.mx.SURFACE_SHADER_TYPE_STRING);
+
335 //refNode.addInputsFromNodeDef() -- This is missing from the JS API.
+
336 this.doc = this.mx.createDocument();
+
337
+
338 // Add header comments
+
339 this.addComment(this.doc, 'Physically Based Materials from https://api.physicallybased.info ');
+
340 this.addComment(this.doc, ' Processed via API and converted to MaterialX ');
+
341 this.addComment(this.doc, ' Target Shading Model: ' + shaderCategory);
+
342 this.addComment(this.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ');
+
343
+
344 // Add properties to the material
+
345 for (let i = 0; i < this.materials.length; i++) {
+
346 const mat = this.materials[i];
+
347 let matName = mat['name'];
+
348
+
349 // Filter by material name(s)
+
350 if (materialNames.length > 0 && !materialNames.includes(matName)) {
+
351 // Skip material
+
352 console.log('Skipping material:', matName);
+
353 continue;
+
354 }
+
355
+
356
+
357 if (shaderPreFix.length > 0) {
+
358 matName = shaderPreFix + '_' + matName;
+
359 }
+
360
+
361 const shaderName = this.doc.createValidChildName('SPB_' + matName);
+
362 this.addComment(this.doc, ' Generated shader: ' + shaderName + ' ');
+
363 const shaderNode = this.doc.addNode(shaderCategory, shaderName, this.mx.SURFACE_SHADER_TYPE_STRING);
+
364 let docString = mat['description'];
+
365 const refString = mat['reference'];
+
366 if (refString.length > 0) {
+
367 if (docString.length > 0) {
+
368 docString += '. ';
+
369 }
+
370 docString += 'Reference: ' + refString[0];
+
371 }
+
372 if (docString.length > 0) {
+
373 shaderNode.setDocString(docString);
+
374 }
+
375
+
376 // Create a new material
+
377 const materialName = this.doc.createValidChildName('MPB_' + matName);
+
378 this.addComment(this.doc, ' Generated material: ' + materialName + ' ');
+
379 const materialNode = this.doc.addNode(this.mx.SURFACE_MATERIAL_NODE_STRING, materialName, this.mx.MATERIAL_TYPE_STRING);
+
380 const shaderInput = materialNode.addInput(this.mx.SURFACE_SHADER_TYPE_STRING, this.mx.SURFACE_SHADER_TYPE_STRING);
+
381 shaderInput.setAttribute(MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName());
+
382
+
383 // Warning this is a bit bespoke for remapping keys
+
384 // to Autodesk Standard Surface shader inputs
+
385 const skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"];
+
386
+
387 let metallness = null;
+
388 let roughness = null;
+
389 let transmission_color = null;
+
390 let transmission = null;
+
391 Object.entries(mat).forEach(([key, value]) => {
+
392
+
393 if (!skipKeys.includes(key)) {
+
394
+
395 if (key == 'metalness') {
+
396 metallness = value;
+
397 //console.log('Metalness:', metallness);
+
398 }
+
399 if (key == 'roughness') {
+
400 roughness = value;
+
401 //console.log('Roughness:', roughness);
+
402 }
+
403 if (key == 'transmission') {
+
404 transmission = value;
+
405 //console.log('Transmission:', transmission);
+
406 }
+
407 if (key == 'color') {
+
408 transmission_color = value;
+
409 //console.log('Color:', color);
+
410 }
+
411
+
412 if (remapKeys[key]) {
+
413 key = remapKeys[key];
+
414 }
+
415
+
416 let refInput = refNode.getInput(key);
+
417 if (!refInput)
+
418 refInput = refNode.addInputFromNodeDef(key);
+
419 if (refInput) {
+
420 const input = shaderNode.addInput(key);
+
421 input.copyContentFrom(refInput);
+
422 if (input) {
+
423 // Convert number vector to string
+
424 if (Array.isArray(value)) {
+
425 value = value.join(',');
+
426 }
+
427 // Convert number to string
+
428 else if (typeof value === 'number') {
+
429 value = value.toString();
+
430 }
+
431 // Note: This API has side-effects as the
+
432 // type is set to "string" when the value is set. Thus
+
433 // we must explicitly set the type here.
+
434 input.setValueString(value, refInput.getType());
+
435 }
+
436 }
+
437 else {
+
438 //console.log('>>> Cannot create input:', key)
+
439 }
+
440 }
+
441 });
+
442
+
443 if (transmission !== null && metallness !== null && roughness !== null && transmission_color !== null)
+
444 {
+
445 if (metallness == 0 && roughness == 0)
+
446 {
+
447 if (remapKeys['transmission_color']) {
+
448 let inputName = remapKeys['transmission_color'];
+
449 let input = shaderNode.addInput(inputName);
+
450 if (input) {
+
451 let value = transmission_color.join(',');
+
452 console.log(`Add "${inputName}": "${value}"`);
+
453 input.setValueString(value, 'color3');
+
454 }
+
455 }
+
456 }
+
457 };
+
458 }
+
459 return true;
+
460 }
+
+
461
+
462}
+
+
Javascript class for querying materials from the Physically Based database and creating MaterialX mat...
+
skipLibraryElement(element)
Predicate to skip library elements.
+ +
getJSONMaterialNames()
Get list of the Physically Based Material names.
+
initializeInputRemapping()
Initialize the input remapping for different shading models.
+
getInputRemapping(shadingModel)
Get the remapping keys for a given shading model.
+
getJSON()
Get the Physically Based Materials as JSON.
+
getMaterialXDocument()
Get the MaterialX document.
+
remapMap
Remap keys for input values for different shading models.
+
materials
List of Physically Based Materials.
+
loadStandardLibraries()
Load the MaterialX standard libraries.
+
constructor(mtlx_module=null, mtlx_stdlib=null)
Constructor for the PhysicallyBasedMaterialLoader.
+ +
getMaterialXString()
Get the MaterialX document as a string.
+
async getPhysicallyBasedMaterials()
Get the Physically Based Materials from the API.
+
materialNames
List of Physically Based Material names.
+ +
mxMaterialNames
List of MaterialX Material names.
+
headers
Headers for the fetch operation.
+
url
URL to fetch the Physically Based Materials.
+ +
convertToMaterialX(shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='')
Convert the Physically Based Materials to MaterialX.
+
addComment(doc, commentString)
Add a comment to the MaterialX document.
+
validateDocument()
Validate the MaterialX document.
diff --git a/documents/html/annotated.html b/documents/html/annotated.html index f58398b..a40cce1 100644 --- a/documents/html/annotated.html +++ b/documents/html/annotated.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Class List + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,24 +85,30 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Class List
+
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 123]
- - +
[detail level 123]
 NmaterialxMaterials
 NGPUOpenLoaderUtilities to extract materials from the GPUOpen material database
+ + - + - +
 NmaterialxMaterials
 NGPUOpenLoaderUtilities to extract materials from the GPUOpen material database
 CGPUOpenMaterialLoaderThis class is used to load materials from the GPUOpen material database
 NphysicallyBasedMaterialXClass to load Physically Based Materials from the PhysicallyBased site
 NphysicallyBasedMaterialXClass to load Physically Based Materials from the PhysicallyBased site
 CPhysicallyBasedMaterialLoaderClass to load Physically Based Materials from the PhysicallyBased site
 CJsPhysicallyBasedMaterialLoaderJavascript class for querying materials from the Physically Based database and creating MaterialX materials
 CJsPhysicallyBasedMaterialLoaderJavascript class for querying materials from the Physically Based database and creating MaterialX materials
@@ -103,7 +116,7 @@ diff --git a/documents/html/class_js_physically_based_material_loader-members.html b/documents/html/class_js_physically_based_material_loader-members.html index 6af471c..5214b40 100644 --- a/documents/html/class_js_physically_based_material_loader-members.html +++ b/documents/html/class_js_physically_based_material_loader-members.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Member List + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,48 +85,54 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
JsPhysicallyBasedMaterialLoader Member List
+
JsPhysicallyBasedMaterialLoader Member List

This is the complete list of members for JsPhysicallyBasedMaterialLoader, including all inherited members.

- + - + - + - + - + - + - + - + - + - + - +
addComment(doc, commentString)JsPhysicallyBasedMaterialLoader
constructor(mtlx_module=null, mtlx_stdlib=null)JsPhysicallyBasedMaterialLoader
constructor(mtlx_module=null, mtlx_stdlib=null)JsPhysicallyBasedMaterialLoader
convertToMaterialX(shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='')JsPhysicallyBasedMaterialLoader
docJsPhysicallyBasedMaterialLoader
docJsPhysicallyBasedMaterialLoader
getInputRemapping(shadingModel)JsPhysicallyBasedMaterialLoader
getJSON()JsPhysicallyBasedMaterialLoader
getJSON()JsPhysicallyBasedMaterialLoader
getJSONMaterialNames()JsPhysicallyBasedMaterialLoader
getMaterialXDocument()JsPhysicallyBasedMaterialLoader
getMaterialXDocument()JsPhysicallyBasedMaterialLoader
getMaterialXString()JsPhysicallyBasedMaterialLoader
getPhysicallyBasedMaterials()JsPhysicallyBasedMaterialLoader
getPhysicallyBasedMaterials()JsPhysicallyBasedMaterialLoader
headersJsPhysicallyBasedMaterialLoader
initializeInputRemapping()JsPhysicallyBasedMaterialLoader
initializeInputRemapping()JsPhysicallyBasedMaterialLoader
loadMaterialX()JsPhysicallyBasedMaterialLoader
loadStandardLibraries()JsPhysicallyBasedMaterialLoader
loadStandardLibraries()JsPhysicallyBasedMaterialLoader
materialNamesJsPhysicallyBasedMaterialLoader
materialsJsPhysicallyBasedMaterialLoader
materialsJsPhysicallyBasedMaterialLoader
mxJsPhysicallyBasedMaterialLoader
mxMaterialNamesJsPhysicallyBasedMaterialLoader
mxMaterialNamesJsPhysicallyBasedMaterialLoader
remapMapJsPhysicallyBasedMaterialLoader
skipLibraryElement(element)JsPhysicallyBasedMaterialLoader
skipLibraryElement(element)JsPhysicallyBasedMaterialLoader
stdlibJsPhysicallyBasedMaterialLoader
urlJsPhysicallyBasedMaterialLoader
urlJsPhysicallyBasedMaterialLoader
validateDocument()JsPhysicallyBasedMaterialLoader
diff --git a/documents/html/class_js_physically_based_material_loader.html b/documents/html/class_js_physically_based_material_loader.html index ab65a70..74eff0a 100644 --- a/documents/html/class_js_physically_based_material_loader.html +++ b/documents/html/class_js_physically_based_material_loader.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: JsPhysicallyBasedMaterialLoader Class Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,9 +85,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -88,98 +102,86 @@ Public Member Functions | Public Attributes | List of all members
-
-
JsPhysicallyBasedMaterialLoader Class Reference
+
JsPhysicallyBasedMaterialLoader Class Reference

Javascript class for querying materials from the Physically Based database and creating MaterialX materials. - More...

+ More...

- - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +

+

Public Member Functions

 constructor (mtlx_module=null, mtlx_stdlib=null)
 Constructor for the PhysicallyBasedMaterialLoader. More...
 constructor (mtlx_module=null, mtlx_stdlib=null)
 Constructor for the PhysicallyBasedMaterialLoader.
 
 getJSON ()
 Get the Physically Based Materials as JSON. More...
 getJSON ()
 Get the Physically Based Materials as JSON.
 
getJSONMaterialNames ()
 Get list of the Physically Based Material names.
 getJSONMaterialNames ()
 Get list of the Physically Based Material names.
 
getMaterialXDocument ()
 Get the MaterialX document.
 getMaterialXDocument ()
 Get the MaterialX document.
 
 validateDocument ()
 Validate the MaterialX document. More...
 validateDocument ()
 Validate the MaterialX document.
 
 getInputRemapping (shadingModel)
 Get the remapping keys for a given shading model. More...
 getInputRemapping (shadingModel)
 Get the remapping keys for a given shading model.
 
 initializeInputRemapping ()
 Initialize the input remapping for different shading models. More...
 initializeInputRemapping ()
 Initialize the input remapping for different shading models.
 
 loadMaterialX ()
 Load the MaterialX module. More...
 loadMaterialX ()
 Load the MaterialX module.
 
async getPhysicallyBasedMaterials ()
 Get the Physically Based Materials from the API. More...
async getPhysicallyBasedMaterials ()
 Get the Physically Based Materials from the API.
 
 loadStandardLibraries ()
 Load the MaterialX standard libraries. More...
 loadStandardLibraries ()
 Load the MaterialX standard libraries.
 
 skipLibraryElement (element)
 Predicate to skip library elements. More...
 skipLibraryElement (element)
 Predicate to skip library elements.
 
 getMaterialXString ()
 Get the MaterialX document as a string. More...
 getMaterialXString ()
 Get the MaterialX document as a string.
 
 addComment (doc, commentString)
 Add a comment to the MaterialX document. More...
 addComment (doc, commentString)
 Add a comment to the MaterialX document.
 
 convertToMaterialX (shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='')
 Convert the Physically Based Materials to MaterialX. More...
 convertToMaterialX (shaderCategory, addAllInputs=false, materialNames=[], remapKeys={}, shaderPreFix='')
 Convert the Physically Based Materials to MaterialX.
 
- - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +

+

Public Attributes

url = ''
 URL to fetch the Physically Based Materials.
 url = ''
 URL to fetch the Physically Based Materials.
 
headers = {}
 Headers for the fetch operation.
 headers = {}
 Headers for the fetch operation.
 
materials = null
 List of Physically Based Materials.
 materials = null
 List of Physically Based Materials.
 
materialNames = []
 List of Physically Based Material names.
 materialNames = []
 List of Physically Based Material names.
 
mxMaterialNames = []
 List of MaterialX Material names.
 mxMaterialNames = []
 List of MaterialX Material names.
 
mx = null
 MaterialX module.
 mx = null
 MaterialX module.
 
doc = null
 Working MaterialX document.
 doc = null
 Working MaterialX document.
 
stdlib = null
 MaterialX standard libraries.
 stdlib = null
 MaterialX standard libraries.
 
remapMap = {}
 Remap keys for input values for different shading models.
 remapMap = {}
 Remap keys for input values for different shading models.
 

Detailed Description

@@ -187,8 +189,8 @@

Definition at line 8 of file JsMaterialXPhysicallyBased.js.

Member Function Documentation

- -

◆ addComment()

+ +

◆ addComment()

@@ -196,19 +198,12 @@

JsPhysicallyBasedMaterialLoader::addComment ( -   - doc, + doc, -   - commentString  - - - - ) - + commentString )

@@ -223,16 +218,16 @@

Definition at line 298 of file JsMaterialXPhysicallyBased.js.

-
299  {
-
300  let comment = doc.addChildOfCategory('comment')
-
301  comment.setDocString(commentString)
-
302  }
- +
299 {
+
300 let comment = doc.addChildOfCategory('comment')
+
301 comment.setDocString(commentString)
+
302 }
+

- -

◆ constructor()

+ +

◆ constructor()

@@ -261,39 +249,39 @@

Returns
{void}

Definition at line 60 of file JsMaterialXPhysicallyBased.js.

-
61  {
-
62  this.url = 'https://api.physicallybased.info/materials';
-
63  this.headers = { 'Accept': 'application/json' };
-
64 
-
65  this.materials = null;
-
66  this.materialNames = [];
-
67 
-
68  this.mxMaterialNames = [];
-
69  this.mx = null;
-
70  if (mtlx_module) {
-
71  this.mx = mtlx_module;
-
72  }
-
73  this.stdlib = null;
-
74  if (mtlx_stdlib) {
-
75  this.stdlib = mtlx_stdlib;
-
76  }
-
77  this.doc = null;
-
78 
- -
80  }
-
initializeInputRemapping()
Initialize the input remapping for different shading models.
-
materials
List of Physically Based Materials.
-
materialNames
List of Physically Based Material names.
- -
mxMaterialNames
List of MaterialX Material names.
-
headers
Headers for the fetch operation.
-
url
URL to fetch the Physically Based Materials.
- +
61 {
+
62 this.url = 'https://api.physicallybased.info/materials';
+
63 this.headers = { 'Accept': 'application/json' };
+
64
+
65 this.materials = null;
+
66 this.materialNames = [];
+
67
+
68 this.mxMaterialNames = [];
+
69 this.mx = null;
+
70 if (mtlx_module) {
+
71 this.mx = mtlx_module;
+
72 }
+
73 this.stdlib = null;
+
74 if (mtlx_stdlib) {
+
75 this.stdlib = mtlx_stdlib;
+
76 }
+
77 this.doc = null;
+
78
+ +
80 }
+
initializeInputRemapping()
Initialize the input remapping for different shading models.
+
materials
List of Physically Based Materials.
+
materialNames
List of Physically Based Material names.
+ +
mxMaterialNames
List of MaterialX Material names.
+
headers
Headers for the fetch operation.
+
url
URL to fetch the Physically Based Materials.
+

- -

◆ convertToMaterialX()

+ +

◆ convertToMaterialX()

@@ -350,160 +328,160 @@

Returns
True if the conversion is successful. False otherwise

Definition at line 314 of file JsMaterialXPhysicallyBased.js.

-
314  {}, shaderPreFix = '')
-
315  {
-
316  if (!this.mx) {
-
317  console.error('MaterialX module is not loaded');
-
318  return false;
-
319  }
-
320 
-
321  if (!this.materials) {
-
322  console.warn('No Physically Based Materials to convert');
-
323  return false;
-
324  }
-
325 
-
326  if (remapKeys.length == 0) {
-
327  remapKeys = this.getInputRemapping(shaderCategory);
-
328  }
-
329 
-
330  // Create a dummy doc with the surface shader with all inputs
-
331  // as reference
-
332  let refDoc = this.mx.createDocument();
-
333  refDoc.importLibrary(this.stdlib);
-
334  const refNode = refDoc.addNode(shaderCategory, 'refShader', this.mx.SURFACE_SHADER_TYPE_STRING);
-
335  //refNode.addInputsFromNodeDef() -- This is missing from the JS API.
-
336  this.doc = this.mx.createDocument();
-
337 
-
338  // Add header comments
-
339  this.addComment(this.doc, 'Physically Based Materials from https://api.physicallybased.info ');
-
340  this.addComment(this.doc, ' Processed via API and converted to MaterialX ');
-
341  this.addComment(this.doc, ' Target Shading Model: ' + shaderCategory);
-
342  this.addComment(this.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ');
-
343 
-
344  // Add properties to the material
-
345  for (let i = 0; i < this.materials.length; i++) {
-
346  const mat = this.materials[i];
-
347  let matName = mat['name'];
-
348 
-
349  // Filter by material name(s)
-
350  if (materialNames.length > 0 && !materialNames.includes(matName)) {
-
351  // Skip material
-
352  console.log('Skipping material:', matName);
-
353  continue;
-
354  }
-
355 
-
356 
-
357  if (shaderPreFix.length > 0) {
-
358  matName = shaderPreFix + '_' + matName;
-
359  }
-
360 
-
361  const shaderName = this.doc.createValidChildName('SPB_' + matName);
-
362  this.addComment(this.doc, ' Generated shader: ' + shaderName + ' ');
-
363  const shaderNode = this.doc.addNode(shaderCategory, shaderName, this.mx.SURFACE_SHADER_TYPE_STRING);
-
364  let docString = mat['description'];
-
365  const refString = mat['reference'];
-
366  if (refString.length > 0) {
-
367  if (docString.length > 0) {
-
368  docString += '. ';
-
369  }
-
370  docString += 'Reference: ' + refString[0];
-
371  }
-
372  if (docString.length > 0) {
-
373  shaderNode.setDocString(docString);
-
374  }
-
375 
-
376  // Create a new material
-
377  const materialName = this.doc.createValidChildName('MPB_' + matName);
-
378  this.addComment(this.doc, ' Generated material: ' + materialName + ' ');
-
379  const materialNode = this.doc.addNode(this.mx.SURFACE_MATERIAL_NODE_STRING, materialName, this.mx.MATERIAL_TYPE_STRING);
-
380  const shaderInput = materialNode.addInput(this.mx.SURFACE_SHADER_TYPE_STRING, this.mx.SURFACE_SHADER_TYPE_STRING);
-
381  shaderInput.setAttribute(MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName());
-
382 
-
383  // Warning this is a bit bespoke for remapping keys
-
384  // to Autodesk Standard Surface shader inputs
-
385  const skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"];
-
386 
-
387  let metallness = null;
-
388  let roughness = null;
-
389  let transmission_color = null;
-
390  let transmission = null;
-
391  Object.entries(mat).forEach(([key, value]) => {
-
392 
-
393  if (!skipKeys.includes(key)) {
-
394 
-
395  if (key == 'metalness') {
-
396  metallness = value;
-
397  //console.log('Metalness:', metallness);
-
398  }
-
399  if (key == 'roughness') {
-
400  roughness = value;
-
401  //console.log('Roughness:', roughness);
-
402  }
-
403  if (key == 'transmission') {
-
404  transmission = value;
-
405  //console.log('Transmission:', transmission);
-
406  }
-
407  if (key == 'color') {
-
408  transmission_color = value;
-
409  //console.log('Color:', color);
-
410  }
-
411 
-
412  if (remapKeys[key]) {
-
413  key = remapKeys[key];
-
414  }
-
415 
-
416  let refInput = refNode.getInput(key);
-
417  if (!refInput)
-
418  refInput = refNode.addInputFromNodeDef(key);
-
419  if (refInput) {
-
420  const input = shaderNode.addInput(key);
-
421  input.copyContentFrom(refInput);
-
422  if (input) {
-
423  // Convert number vector to string
-
424  if (Array.isArray(value)) {
-
425  value = value.join(',');
-
426  }
-
427  // Convert number to string
-
428  else if (typeof value === 'number') {
-
429  value = value.toString();
-
430  }
-
431  // Note: This API has side-effects as the
-
432  // type is set to "string" when the value is set. Thus
-
433  // we must explicitly set the type here.
-
434  input.setValueString(value, refInput.getType());
-
435  }
-
436  }
-
437  else {
-
438  //console.log('>>> Cannot create input:', key)
-
439  }
-
440  }
-
441  });
-
442 
-
443  if (transmission !== null && metallness !== null && roughness !== null && transmission_color !== null)
-
444  {
-
445  if (metallness == 0 && roughness == 0)
-
446  {
-
447  if (remapKeys['transmission_color']) {
-
448  let inputName = remapKeys['transmission_color'];
-
449  let input = shaderNode.addInput(inputName);
-
450  if (input) {
-
451  let value = transmission_color.join(',');
-
452  console.log(`Add "${inputName}": "${value}"`);
-
453  input.setValueString(value, 'color3');
-
454  }
-
455  }
-
456  }
-
457  };
-
458  }
-
459  return true;
-
460  }
-
getInputRemapping(shadingModel)
Get the remapping keys for a given shading model.
-
addComment(doc, commentString)
Add a comment to the MaterialX document.
+
314 {}, shaderPreFix = '')
+
315 {
+
316 if (!this.mx) {
+
317 console.error('MaterialX module is not loaded');
+
318 return false;
+
319 }
+
320
+
321 if (!this.materials) {
+
322 console.warn('No Physically Based Materials to convert');
+
323 return false;
+
324 }
+
325
+
326 if (remapKeys.length == 0) {
+
327 remapKeys = this.getInputRemapping(shaderCategory);
+
328 }
+
329
+
330 // Create a dummy doc with the surface shader with all inputs
+
331 // as reference
+
332 let refDoc = this.mx.createDocument();
+
333 refDoc.importLibrary(this.stdlib);
+
334 const refNode = refDoc.addNode(shaderCategory, 'refShader', this.mx.SURFACE_SHADER_TYPE_STRING);
+
335 //refNode.addInputsFromNodeDef() -- This is missing from the JS API.
+
336 this.doc = this.mx.createDocument();
+
337
+
338 // Add header comments
+
339 this.addComment(this.doc, 'Physically Based Materials from https://api.physicallybased.info ');
+
340 this.addComment(this.doc, ' Processed via API and converted to MaterialX ');
+
341 this.addComment(this.doc, ' Target Shading Model: ' + shaderCategory);
+
342 this.addComment(this.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ');
+
343
+
344 // Add properties to the material
+
345 for (let i = 0; i < this.materials.length; i++) {
+
346 const mat = this.materials[i];
+
347 let matName = mat['name'];
+
348
+
349 // Filter by material name(s)
+
350 if (materialNames.length > 0 && !materialNames.includes(matName)) {
+
351 // Skip material
+
352 console.log('Skipping material:', matName);
+
353 continue;
+
354 }
+
355
+
356
+
357 if (shaderPreFix.length > 0) {
+
358 matName = shaderPreFix + '_' + matName;
+
359 }
+
360
+
361 const shaderName = this.doc.createValidChildName('SPB_' + matName);
+
362 this.addComment(this.doc, ' Generated shader: ' + shaderName + ' ');
+
363 const shaderNode = this.doc.addNode(shaderCategory, shaderName, this.mx.SURFACE_SHADER_TYPE_STRING);
+
364 let docString = mat['description'];
+
365 const refString = mat['reference'];
+
366 if (refString.length > 0) {
+
367 if (docString.length > 0) {
+
368 docString += '. ';
+
369 }
+
370 docString += 'Reference: ' + refString[0];
+
371 }
+
372 if (docString.length > 0) {
+
373 shaderNode.setDocString(docString);
+
374 }
+
375
+
376 // Create a new material
+
377 const materialName = this.doc.createValidChildName('MPB_' + matName);
+
378 this.addComment(this.doc, ' Generated material: ' + materialName + ' ');
+
379 const materialNode = this.doc.addNode(this.mx.SURFACE_MATERIAL_NODE_STRING, materialName, this.mx.MATERIAL_TYPE_STRING);
+
380 const shaderInput = materialNode.addInput(this.mx.SURFACE_SHADER_TYPE_STRING, this.mx.SURFACE_SHADER_TYPE_STRING);
+
381 shaderInput.setAttribute(MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName());
+
382
+
383 // Warning this is a bit bespoke for remapping keys
+
384 // to Autodesk Standard Surface shader inputs
+
385 const skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"];
+
386
+
387 let metallness = null;
+
388 let roughness = null;
+
389 let transmission_color = null;
+
390 let transmission = null;
+
391 Object.entries(mat).forEach(([key, value]) => {
+
392
+
393 if (!skipKeys.includes(key)) {
+
394
+
395 if (key == 'metalness') {
+
396 metallness = value;
+
397 //console.log('Metalness:', metallness);
+
398 }
+
399 if (key == 'roughness') {
+
400 roughness = value;
+
401 //console.log('Roughness:', roughness);
+
402 }
+
403 if (key == 'transmission') {
+
404 transmission = value;
+
405 //console.log('Transmission:', transmission);
+
406 }
+
407 if (key == 'color') {
+
408 transmission_color = value;
+
409 //console.log('Color:', color);
+
410 }
+
411
+
412 if (remapKeys[key]) {
+
413 key = remapKeys[key];
+
414 }
+
415
+
416 let refInput = refNode.getInput(key);
+
417 if (!refInput)
+
418 refInput = refNode.addInputFromNodeDef(key);
+
419 if (refInput) {
+
420 const input = shaderNode.addInput(key);
+
421 input.copyContentFrom(refInput);
+
422 if (input) {
+
423 // Convert number vector to string
+
424 if (Array.isArray(value)) {
+
425 value = value.join(',');
+
426 }
+
427 // Convert number to string
+
428 else if (typeof value === 'number') {
+
429 value = value.toString();
+
430 }
+
431 // Note: This API has side-effects as the
+
432 // type is set to "string" when the value is set. Thus
+
433 // we must explicitly set the type here.
+
434 input.setValueString(value, refInput.getType());
+
435 }
+
436 }
+
437 else {
+
438 //console.log('>>> Cannot create input:', key)
+
439 }
+
440 }
+
441 });
+
442
+
443 if (transmission !== null && metallness !== null && roughness !== null && transmission_color !== null)
+
444 {
+
445 if (metallness == 0 && roughness == 0)
+
446 {
+
447 if (remapKeys['transmission_color']) {
+
448 let inputName = remapKeys['transmission_color'];
+
449 let input = shaderNode.addInput(inputName);
+
450 if (input) {
+
451 let value = transmission_color.join(',');
+
452 console.log(`Add "${inputName}": "${value}"`);
+
453 input.setValueString(value, 'color3');
+
454 }
+
455 }
+
456 }
+
457 };
+
458 }
+
459 return true;
+
460 }
+
getInputRemapping(shadingModel)
Get the remapping keys for a given shading model.
+
addComment(doc, commentString)
Add a comment to the MaterialX document.

- -

◆ getInputRemapping()

+ +

◆ getInputRemapping()

@@ -511,8 +489,7 @@

JsPhysicallyBasedMaterialLoader::getInputRemapping ( -   - shadingModel) + shadingModel) @@ -528,18 +505,18 @@

Returns
Remapping keys for the shading model. Empty object if not found

Definition at line 130 of file JsMaterialXPhysicallyBased.js.

-
131  {
-
132  if (shadingModel in this.remapMap) {
-
133  return this.remapMap[shadingModel];
-
134  }
-
135  return {};
-
136  }
-
remapMap
Remap keys for input values for different shading models.
+
131 {
+
132 if (shadingModel in this.remapMap) {
+
133 return this.remapMap[shadingModel];
+
134 }
+
135 return {};
+
136 }
+
remapMap
Remap keys for input values for different shading models.

- -

◆ getJSON()

+ +

◆ getJSON()

+ +

◆ getJSONMaterialNames()

+ +
+
+ + + + + + + +
JsPhysicallyBasedMaterialLoader::getJSONMaterialNames ()
+
+ +

Get list of the Physically Based Material names.

+ +

Definition at line 94 of file JsMaterialXPhysicallyBased.js.

+
95 {
+
96 return this.materialNames
+
97 }
- -

◆ getMaterialXString()

+ +

◆ getMaterialXDocument()

+ +
+
+ + + + + + + +
JsPhysicallyBasedMaterialLoader::getMaterialXDocument ()
+
+ +

Get the MaterialX document.

+ +

Definition at line 102 of file JsMaterialXPhysicallyBased.js.

+
103 {
+
104 return this.doc;
+
105 }
+
+
+
+ +

◆ getMaterialXString()

@@ -572,7 +597,7 @@

JsPhysicallyBasedMaterialLoader::getMaterialXString ( - ) + ) @@ -582,28 +607,28 @@

Returns
{string} - MaterialX document as a string. Empty string if no document

Definition at line 275 of file JsMaterialXPhysicallyBased.js.

-
276  {
-
277  if (!this.doc) {
-
278  console.error('No MaterialX document to convert');
-
279  return '';
-
280  }
-
281 
-
282  // Create write options
-
283  const writeOptions = new this.mx.XmlWriteOptions();
-
284  writeOptions.writeXIncludeEnable = false;
-
285  //writeOptions.writeXIncludes = false;
-
286  writeOptions.elementPredicate = this.skipLibraryElement;
-
287 
-
288  // Convert the MaterialX document to a string
-
289  const mtlx = this.mx.writeToXmlString(this.doc, writeOptions);
-
290  return mtlx;
-
291  }
-
skipLibraryElement(element)
Predicate to skip library elements.
+
276 {
+
277 if (!this.doc) {
+
278 console.error('No MaterialX document to convert');
+
279 return '';
+
280 }
+
281
+
282 // Create write options
+
283 const writeOptions = new this.mx.XmlWriteOptions();
+
284 writeOptions.writeXIncludeEnable = false;
+
285 //writeOptions.writeXIncludes = false;
+
286 writeOptions.elementPredicate = this.skipLibraryElement;
+
287
+
288 // Convert the MaterialX document to a string
+
289 const mtlx = this.mx.writeToXmlString(this.doc, writeOptions);
+
290 return mtlx;
+
291 }
+
skipLibraryElement(element)
Predicate to skip library elements.

- -

◆ getPhysicallyBasedMaterials()

+ +

◆ getPhysicallyBasedMaterials()

@@ -611,7 +636,7 @@

async JsPhysicallyBasedMaterialLoader::getPhysicallyBasedMaterials ( - ) + ) @@ -621,36 +646,36 @@

Returns
{object[]} - List of Physically Based Materials in JSON format

Definition at line 208 of file JsMaterialXPhysicallyBased.js.

-
209  {
-
210  try {
-
211  this.materials = null
-
212  this.materialNames = [];
-
213 
-
214  const response = await fetch(this.url, {
-
215  method: 'GET',
-
216  headers: this.headers
-
217  });
-
218 
-
219  if (!response.ok) {
-
220  throw new Error('Network response was not ok ' + response.statusText);
-
221  }
-
222 
-
223  this.materials = await response.json();
-
224  for (let i = 0; i < this.materials.length; i++) {
-
225  this.materialNames.push(this.materials[i]['name']);
-
226  }
-
227  return this.materials;
-
228  } catch (error) {
-
229  console.error('There has been a problem with your fetch operation:', error);
-
230  }
-
231 
-
232  return null;
-
233  }
+
209 {
+
210 try {
+
211 this.materials = null
+
212 this.materialNames = [];
+
213
+
214 const response = await fetch(this.url, {
+
215 method: 'GET',
+
216 headers: this.headers
+
217 });
+
218
+
219 if (!response.ok) {
+
220 throw new Error('Network response was not ok ' + response.statusText);
+
221 }
+
222
+
223 this.materials = await response.json();
+
224 for (let i = 0; i < this.materials.length; i++) {
+
225 this.materialNames.push(this.materials[i]['name']);
+
226 }
+
227 return this.materials;
+
228 } catch (error) {
+
229 console.error('There has been a problem with your fetch operation:', error);
+
230 }
+
231
+
232 return null;
+
233 }

- -

◆ initializeInputRemapping()

+ +

◆ initializeInputRemapping()

@@ -658,7 +683,7 @@

JsPhysicallyBasedMaterialLoader::initializeInputRemapping ( - ) + ) @@ -668,55 +693,55 @@

Returns
{void}

Definition at line 142 of file JsMaterialXPhysicallyBased.js.

-
143  {
-
144  // Remap keys for Autodesk Standard Surface shader. How to verify this?
-
145  const standard_surface_remapKeys = {
-
146  'color': 'base_color',
-
147  'specularColor': 'specular_color',
-
148  'roughness': 'specular_roughness',
-
149  //'metalness': 'metalness',
-
150  'ior': 'specular_IOR',
-
151  //'transmission': 'transmission',
-
152  'transmission_color': 'transmission_color',
-
153  'thinFilmIor': 'thin_film_IOR',
-
154  'thinFilmThickness': 'thin_film_thickness',
-
155  'transmissionDispersion': 'transmission_dispersion',
-
156  }
-
157  // Remap keys for OpenPBR shading model.
-
158  const openpbr_remapKeys = {
-
159  'color': 'base_color',
-
160  'specularColor': 'specular_color',
-
161  'roughness': 'specular_roughness', // 'base_diffuse_roughness',
-
162  'metalness': 'base_metalness',
-
163  'ior': 'specular_ior',
-
164  'transmission': 'transmission_weight',
-
165  'transmission_color': 'transmission_color',
-
166  'subsurfaceRadius': 'subsurface_radius',
-
167  'thinFilmIor': 'thin_film_ior',
-
168  'thinFilmThickness': 'thin_film_thickness',
-
169  'transmissionDispersion': 'transmission_dispersion_scale',
-
170  }
-
171  // Remap keys for Khronos glTF shading model.
-
172  const gltf_remapKeys = {
-
173  'color': 'base_color',
-
174  'specularColor': 'specular_color',
-
175  'roughness': 'roughness',
-
176  'metalness': 'metallic',
-
177  'transmission_color': 'attenuation_color',
-
178  //'ior': 'ior',
-
179  //'transmission': 'transmission',
-
180  }
-
181 
-
182  this.remapMap = {}
-
183  this.remapMap['standard_surface'] = standard_surface_remapKeys;
-
184  this.remapMap['gltf_pbr'] = gltf_remapKeys;
-
185  this.remapMap['open_pbr_surface'] = openpbr_remapKeys;
-
186  }
+
143 {
+
144 // Remap keys for Autodesk Standard Surface shader. How to verify this?
+
145 const standard_surface_remapKeys = {
+
146 'color': 'base_color',
+
147 'specularColor': 'specular_color',
+
148 'roughness': 'specular_roughness',
+
149 //'metalness': 'metalness',
+
150 'ior': 'specular_IOR',
+
151 //'transmission': 'transmission',
+
152 'transmission_color': 'transmission_color',
+
153 'thinFilmIor': 'thin_film_IOR',
+
154 'thinFilmThickness': 'thin_film_thickness',
+
155 'transmissionDispersion': 'transmission_dispersion',
+
156 }
+
157 // Remap keys for OpenPBR shading model.
+
158 const openpbr_remapKeys = {
+
159 'color': 'base_color',
+
160 'specularColor': 'specular_color',
+
161 'roughness': 'specular_roughness', // 'base_diffuse_roughness',
+
162 'metalness': 'base_metalness',
+
163 'ior': 'specular_ior',
+
164 'transmission': 'transmission_weight',
+
165 'transmission_color': 'transmission_color',
+
166 'subsurfaceRadius': 'subsurface_radius',
+
167 'thinFilmIor': 'thin_film_ior',
+
168 'thinFilmThickness': 'thin_film_thickness',
+
169 'transmissionDispersion': 'transmission_dispersion_scale',
+
170 }
+
171 // Remap keys for Khronos glTF shading model.
+
172 const gltf_remapKeys = {
+
173 'color': 'base_color',
+
174 'specularColor': 'specular_color',
+
175 'roughness': 'roughness',
+
176 'metalness': 'metallic',
+
177 'transmission_color': 'attenuation_color',
+
178 //'ior': 'ior',
+
179 //'transmission': 'transmission',
+
180 }
+
181
+
182 this.remapMap = {}
+
183 this.remapMap['standard_surface'] = standard_surface_remapKeys;
+
184 this.remapMap['gltf_pbr'] = gltf_remapKeys;
+
185 this.remapMap['open_pbr_surface'] = openpbr_remapKeys;
+
186 }

- -

◆ loadMaterialX()

+ +

◆ loadMaterialX()

@@ -724,7 +749,7 @@

JsPhysicallyBasedMaterialLoader::loadMaterialX ( - ) + ) @@ -734,21 +759,21 @@

Returns
{Promise} - Promise to load the MaterialX module

Definition at line 192 of file JsMaterialXPhysicallyBased.js.

-
193  {
-
194  return new Promise((resolve, reject) => {
-
195  MaterialX().then((mtlx) => {
-
196  this.mx = mtlx;
-
197  resolve();
-
198  }).catch((error) => {
-
199  reject(error);
-
200  });
-
201  });
-
202  }
+
193 {
+
194 return new Promise((resolve, reject) => {
+
195 MaterialX().then((mtlx) => {
+
196 this.mx = mtlx;
+
197 resolve();
+
198 }).catch((error) => {
+
199 reject(error);
+
200 });
+
201 });
+
202 }

- -

◆ loadStandardLibraries()

+ +

◆ loadStandardLibraries()

@@ -756,7 +781,7 @@

JsPhysicallyBasedMaterialLoader::loadStandardLibraries ( - ) + ) @@ -766,32 +791,32 @@

Returns
{void}

Definition at line 239 of file JsMaterialXPhysicallyBased.js.

-
240  {
-
241  if (!this.mx) {
-
242  // Call the asynchronous function and then perform additional logic
-
243  this.loadMaterialX().then(() => {
-
244 
-
245  this.esslgenerator = new this.mx.EsslShaderGenerator();
-
246  this.esslgenContext = new this.mx.GenContext(this.esslgenerator);
-
247  this.stdlib = this.mx.loadStandardLibraries(this.esslgenContext);
-
248  let children = this.stdlib.getChildren();
-
249  for (let i = 0; i < children.length; i++) {
-
250  let child = children[i];
-
251  child.setSourceUri('STDLIB_ELEMENT');
-
252  }
-
253 
-
254  console.log("MaterialX is loaded");
-
255  }).catch((error) => {
-
256  console.error("Error loading MaterialX:", error);
-
257  });
-
258  }
-
259  }
-
loadMaterialX()
Load the MaterialX module.
+
240 {
+
241 if (!this.mx) {
+
242 // Call the asynchronous function and then perform additional logic
+
243 this.loadMaterialX().then(() => {
+
244
+
245 this.esslgenerator = new this.mx.EsslShaderGenerator();
+
246 this.esslgenContext = new this.mx.GenContext(this.esslgenerator);
+
247 this.stdlib = this.mx.loadStandardLibraries(this.esslgenContext);
+
248 let children = this.stdlib.getChildren();
+
249 for (let i = 0; i < children.length; i++) {
+
250 let child = children[i];
+
251 child.setSourceUri('STDLIB_ELEMENT');
+
252 }
+
253
+
254 console.log("MaterialX is loaded");
+
255 }).catch((error) => {
+
256 console.error("Error loading MaterialX:", error);
+
257 });
+
258 }
+
259 }
+

- -

◆ skipLibraryElement()

+ +

◆ skipLibraryElement()

- -

◆ validateDocument()

+ +

◆ validateDocument()

@@ -831,7 +855,7 @@

JsPhysicallyBasedMaterialLoader::validateDocument ( - ) + ) @@ -841,19 +865,184 @@

Returns
{[boolean, errors]} - True if the document is valid. False otherwise

Definition at line 111 of file JsMaterialXPhysicallyBased.js.

-
112  {
-
113  if (this.doc) {
-
114  let errors = {}
-
115  let errorString = ''
-
116  var valid = this.doc.validate(errors);
-
117  if (!valid) {
-
118  errorString = errors.message;
-
119  }
-
120  return [valid, errorString]
-
121  }
-
122  return [false, 'No MaterialX document'];
-
123  }
+
112 {
+
113 if (this.doc) {
+
114 let errors = {}
+
115 let errorString = ''
+
116 var valid = this.doc.validate(errors);
+
117 if (!valid) {
+
118 errorString = errors.message;
+
119 }
+
120 return [valid, errorString]
+
121 }
+
122 return [false, 'No MaterialX document'];
+
123 }
+
+
+

+

Member Data Documentation

+ +

◆ doc

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::doc = null
+
+ +

Working MaterialX document.

+ +

Definition at line 43 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ headers

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::headers = {}
+
+ +

Headers for the fetch operation.

+ +

Definition at line 18 of file JsMaterialXPhysicallyBased.js.

+
18{};
+
+
+
+ +

◆ materialNames

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::materialNames = []
+
+ +

List of Physically Based Material names.

+ +

Definition at line 28 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ materials

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::materials = null
+
+ +

List of Physically Based Materials.

+ +

Definition at line 23 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ mx

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::mx = null
+
+ +

MaterialX module.

+ +

Definition at line 38 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ mxMaterialNames

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::mxMaterialNames = []
+
+ +

List of MaterialX Material names.

+ +

Definition at line 33 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ remapMap

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::remapMap = {}
+
+ +

Remap keys for input values for different shading models.

+ +

Definition at line 53 of file JsMaterialXPhysicallyBased.js.

+
53{};
+
+
+ +

◆ stdlib

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::stdlib = null
+
+ +

MaterialX standard libraries.

+ +

Definition at line 48 of file JsMaterialXPhysicallyBased.js.

+ +
+
+ +

◆ url

+ +
+
+ + + + +
JsPhysicallyBasedMaterialLoader::url = ''
+
+ +

URL to fetch the Physically Based Materials.

+ +

Definition at line 13 of file JsMaterialXPhysicallyBased.js.

+

The documentation for this class was generated from the following file:
diff --git a/documents/html/classes.html b/documents/html/classes.html index 71d2ce0..05bd743 100644 --- a/documents/html/classes.html +++ b/documents/html/classes.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Class Index + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,26 +85,32 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Class Index
+
Class Index
@@ -105,7 +118,7 @@ diff --git a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader-members.html b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader-members.html index a56612e..1a61f69 100644 --- a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader-members.html +++ b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader-members.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Member List + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,43 +85,51 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader Member List
+
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader Member List

This is the complete list of members for materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader, including all inherited members.

- + - + - + - + - + + + - + - + - - - + + +
__init__(self) (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
downloadPackage(self, listNumber, materialNumber, packageId=0)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
downloadPackage(self, listNumber, materialNumber, packageId=0)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
downloadPackageByExpression(self, searchExpr, packageId=0) (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
extractPackageData(self, data, pilImage)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
extractPackageData(self, data, pilImage)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
findMaterialsByName(self, materialName)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
getMaterialNames(self)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
getMaterialNames(self)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
getMaterials(self)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
getMaterialsAsJsonString(self)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
getMaterialsAsJsonString(self)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
logger (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
materialNames (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
materialNames (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
materials (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
materials (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
materials (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
package_url (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
package_url (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
readMaterialFiles(self, fileNames)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
root_url (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
root_url (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
url (defined in materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writeMaterialFiles(self, folder, rootFileName)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writeMaterialNamesToFile(self, fileName, sort=True)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writePackageDataToFile(self, data, outputFolder, title, unzipFile=True)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writeMaterialFiles(self, folder, rootFileName)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writeMaterialNamesToFile(self, fileName, sort=True)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
writePackageDataToFile(self, data, outputFolder, title, unzipFile=True)materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader
diff --git a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html index 4cba280..aa8b2df 100644 --- a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html +++ b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader Class Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,9 +85,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader Class Reference
+
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader Class Reference

This class is used to load materials from the GPUOpen material database. - More...

+ More...

- - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - - + + +

+

Public Member Functions

-def __init__ (self)
 
bool writePackageDataToFile (self, data, outputFolder, title, unzipFile=True)
 Write a package data to a file. More...
 __init__ (self)
 
bool writePackageDataToFile (self, data, outputFolder, title, unzipFile=True)
 Write a package data to a file.
 
def extractPackageData (self, data, pilImage)
 Extract the package data from a zip file. More...
 
def downloadPackage (self, listNumber, materialNumber, packageId=0)
 Download a package for a given material from the GPUOpen material database. More...
 
-def downloadPackageByExpression (self, searchExpr, packageId=0)
 
list findMaterialsByName (self, materialName)
 Find materials by name. More...
 extractPackageData (self, data, pilImage)
 Extract the package data from a zip file.
 
 downloadPackage (self, listNumber, materialNumber, packageId=0)
 Download a package for a given material from the GPUOpen material database.
 
 downloadPackageByExpression (self, searchExpr, packageId=0)
 
list findMaterialsByName (self, materialName)
 Find materials by name.
 
list getMaterialNames (self)
 Update the material names from the material lists. More...
list getMaterialNames (self)
 Update the material names from the material lists.
 
list getMaterials (self)
 Get the materials returned from the GPUOpen material database. More...
list getMaterials (self)
 Get the materials returned from the GPUOpen material database.
 
list getMaterialsAsJsonString (self)
 Get the JSON strings for the materials. More...
list getMaterialsAsJsonString (self)
 Get the JSON strings for the materials.
 
-list readMaterialFiles (self, fileNames)
 Load the materials from a set of JSON files downloaded from the GPUOpen material database.
list readMaterialFiles (self, fileNames)
 Load the materials from a set of JSON files downloaded from the GPUOpen material database.
 
int writeMaterialFiles (self, folder, rootFileName)
 Write the materials to a set of MaterialX files. More...
int writeMaterialFiles (self, folder, rootFileName)
 Write the materials to a set of MaterialX files.
 
def writeMaterialNamesToFile (self, fileName, sort=True)
 Write sorted list of the material names to a file in JSON format. More...
 
 writeMaterialNamesToFile (self, fileName, sort=True)
 Write sorted list of the material names to a file in JSON format.
 
- - - - - - - - - - + + + + + + + + + - - + + + + + +

+

Public Attributes

root_url
 
url
 
package_url
 
materials
 
logger
str root_url = 'https://api.matlib.gpuopen.com/api'
 
str url = self.root_url + '/materials'
 
str package_url = self.root_url + '/packages'
 
int materials = None
 
 logger = logging.getLogger('GPUO')
 
materialNames
 
list materials = []
 
list materialNames = []
 
str materials = rootFileName + '_' + str(i) + '.json'
 

Detailed Description

This class is used to load materials from the GPUOpen material database.

See: https://api.matlib.gpuopen.com/api/swagger/ for API information.

Definition at line 17 of file GPUOpenLoader.py.

-

Member Function Documentation

- -

◆ downloadPackage()

+

Constructor & Destructor Documentation

+ +

◆ __init__()

- + - - + + +
def materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.downloadPackage materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.__init__ ( self, self)
+
+ +

Definition at line 22 of file GPUOpenLoader.py.

+
22 def __init__(self):
+
23 self.root_url = 'https://api.matlib.gpuopen.com/api'
+
24 self.url = self.root_url + '/materials'
+
25 self.package_url = self.root_url + '/packages'
+
26 self.materials = None
+
27
+
28 self.logger = logging.getLogger('GPUO')
+
29 logging.basicConfig(level=logging.INFO)
+
30
+
+
+
+

Member Function Documentation

+ +

◆ downloadPackage()

+ +
+
+ - - - - + + + - - + - - + + - - +
 listNumber, materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.downloadPackage ( self,
 materialNumber, listNumber,
 packageId = 0  materialNumber,
) packageId = 0 )
@@ -212,85 +240,119 @@

Definition at line 99 of file GPUOpenLoader.py.

-
99  def downloadPackage(self, listNumber, materialNumber, packageId=0):
-
100  '''
-
101  Download a package for a given material from the GPUOpen material database.
-
102  @param listNumber: The list number of the material to download.
-
103  @param materialNumber: The material number to download.
-
104  @param packageId: The package ID to download.
-
105  Packages are numbered starting at 0. Default is 0.
-
106  with index 0 containing the smallest package (smallest resolution referenced textures).
-
107  '''
-
108  if self.materials == None or len(self.materials) == 0:
-
109  return [None, None]
-
110 
-
111  json_data = self.materials[listNumber]
-
112  if not json_data:
-
113  return [None, None]
-
114 
-
115  jsonResults = None
-
116  jsonResult = None
-
117  if "results" in json_data:
-
118  jsonResults = json_data["results"]
-
119  if len(jsonResults) <= materialNumber:
-
120  return [None, None]
-
121  else:
-
122  jsonResult = jsonResults[materialNumber]
-
123 
-
124  if not jsonResult:
-
125  return [None, None]
-
126 
-
127  # Get the package ID
-
128  jsonPackages = None
-
129  if "packages" in jsonResult:
-
130  jsonPackages = jsonResult["packages"]
-
131  if not jsonPackages:
-
132  return [None, None]
-
133 
-
134  if len(jsonPackages) <= packageId:
-
135  return [None, None]
-
136  package_id = jsonPackages[packageId]
-
137 
-
138  if not package_id:
-
139  return [None, None]
-
140 
-
141  url = f"{self.package_url}/{package_id}/download"
-
142  data = requests.get(url).content
-
143 
-
144  title = jsonResult["title"]
-
145  return [data, title]
-
146 
+
99 def downloadPackage(self, listNumber, materialNumber, packageId=0):
+
100 '''
+
101 Download a package for a given material from the GPUOpen material database.
+
102 @param listNumber: The list number of the material to download.
+
103 @param materialNumber: The material number to download.
+
104 @param packageId: The package ID to download.
+
105 Packages are numbered starting at 0. Default is 0.
+
106 with index 0 containing the smallest package (smallest resolution referenced textures).
+
107 '''
+
108 if self.materials == None or len(self.materials) == 0:
+
109 return [None, None]
+
110
+
111 json_data = self.materials[listNumber]
+
112 if not json_data:
+
113 return [None, None]
+
114
+
115 jsonResults = None
+
116 jsonResult = None
+
117 if "results" in json_data:
+
118 jsonResults = json_data["results"]
+
119 if len(jsonResults) <= materialNumber:
+
120 return [None, None]
+
121 else:
+
122 jsonResult = jsonResults[materialNumber]
+
123
+
124 if not jsonResult:
+
125 return [None, None]
+
126
+
127 # Get the package ID
+
128 jsonPackages = None
+
129 if "packages" in jsonResult:
+
130 jsonPackages = jsonResult["packages"]
+
131 if not jsonPackages:
+
132 return [None, None]
+
133
+
134 if len(jsonPackages) <= packageId:
+
135 return [None, None]
+
136 package_id = jsonPackages[packageId]
+
137
+
138 if not package_id:
+
139 return [None, None]
+
140
+
141 url = f"{self.package_url}/{package_id}/download"
+
142 data = requests.get(url).content
+
143
+
144 title = jsonResult["title"]
+
145 return [data, title]
+
146

- -

◆ extractPackageData()

+ +

◆ downloadPackageByExpression()

- + - - + - - + - - + + +
def materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.extractPackageData materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.downloadPackageByExpression ( self, self,
 data, searchExpr,
 pilImage  packageId = 0 )
+
+ +

Definition at line 147 of file GPUOpenLoader.py.

+
147 def downloadPackageByExpression(self, searchExpr, packageId=0):
+
148 downloadList = []
+
149
+
150 foundList = self.findMaterialsByName(searchExpr)
+
151 if len(foundList) > 0:
+
152 for found in foundList:
+
153 listNumber = found['listNumber']
+
154 materialNumber = found['materialNumber']
+
155 matName = found['title']
+
156 self.logger.info(f'> Download material: {matName} List: {listNumber}. Index: {materialNumber}')
+
157 result = [data, title] = self.downloadPackage(listNumber, materialNumber, packageId)
+
158 downloadList.append(result)
+
159 return downloadList
+
160
+
+
+
+ +

◆ extractPackageData()

+ +
+
+ + + + + + - - + + + + + +
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.extractPackageData ( self,
) data,
pilImage )
@@ -306,44 +368,44 @@

Returns
: A list of extracted data of the form: [ { 'file_name': file_name, 'data': data, 'type': type } ]

Definition at line 66 of file GPUOpenLoader.py.

-
66  def extractPackageData(self, data, pilImage):
-
67  '''
-
68  Extract the package data from a zip file.
-
69  @param data: The data to extract.
-
70  @param pilImage: The PIL image module.
-
71  @return: A list of extracted data of the form:
-
72  [ { 'file_name': file_name, 'data': data, 'type': type } ]
-
73  '''
-
74  if not pilImage:
-
75  self.logger.debug('Pillow (PIL) image module provided. Image data will not be extracted.')
-
76 
-
77  zip_object = io.BytesIO(data)
-
78 
-
79  extracted_data_list = []
-
80  with zipfile.ZipFile(zip_object, 'r') as zip_file:
-
81  # Iterate through the files in the zip archive
-
82  for file_name in zip_file.namelist():
-
83  # Extract each file into memory
-
84  extracted_data = zip_file.read(file_name)
-
85  if file_name.endswith('.mtlx'):
-
86  mtlx_string = extracted_data.decode('utf-8')
-
87  extracted_data_list.append( {'file_name': file_name, 'data': mtlx_string, 'type': 'mtlx'} )
-
88 
-
89  # If the data is a image, create a image in Python
-
90  elif file_name.endswith('.png'):
-
91  if pilImage:
-
92  image = pilImage.open(io.BytesIO(extracted_data))
-
93  else:
-
94  image = None
-
95  extracted_data_list.append( {'file_name': file_name, 'data': image, 'type': 'image'} )
-
96 
-
97  return extracted_data_list
-
98 
+
66 def extractPackageData(self, data, pilImage):
+
67 '''
+
68 Extract the package data from a zip file.
+
69 @param data: The data to extract.
+
70 @param pilImage: The PIL image module.
+
71 @return: A list of extracted data of the form:
+
72 [ { 'file_name': file_name, 'data': data, 'type': type } ]
+
73 '''
+
74 if not pilImage:
+
75 self.logger.debug('Pillow (PIL) image module provided. Image data will not be extracted.')
+
76
+
77 zip_object = io.BytesIO(data)
+
78
+
79 extracted_data_list = []
+
80 with zipfile.ZipFile(zip_object, 'r') as zip_file:
+
81 # Iterate through the files in the zip archive
+
82 for file_name in zip_file.namelist():
+
83 # Extract each file into memory
+
84 extracted_data = zip_file.read(file_name)
+
85 if file_name.endswith('.mtlx'):
+
86 mtlx_string = extracted_data.decode('utf-8')
+
87 extracted_data_list.append( {'file_name': file_name, 'data': mtlx_string, 'type': 'mtlx'} )
+
88
+
89 # If the data is a image, create a image in Python
+
90 elif file_name.endswith('.png'):
+
91 if pilImage:
+
92 image = pilImage.open(io.BytesIO(extracted_data))
+
93 else:
+
94 image = None
+
95 extracted_data_list.append( {'file_name': file_name, 'data': image, 'type': 'image'} )
+
96
+
97 return extracted_data_list
+
98

- -

◆ findMaterialsByName()

+ +

◆ findMaterialsByName()

@@ -378,33 +433,33 @@

Returns
: A list of materials that match the regular expression of the form: [ { 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': title } ]

Definition at line 161 of file GPUOpenLoader.py.

-
161  def findMaterialsByName(self, materialName) -> list:
-
162  '''
-
163  Find materials by name.
-
164  @param materialName: Regular expression to match the material name.
-
165  @return: A list of materials that match the regular expression of the form:
-
166  [ { 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': title } ]
-
167  '''
-
168  if (self.materials == None):
-
169  return None
-
170 
-
171  materialsList = []
-
172  listNumber = 0
-
173  materialNumber = 0
-
174  for materialList in self.materials:
-
175  for material in materialList['results']:
-
176  if re.match(materialName, material['title'], re.IGNORECASE):
-
177  materialsList.append({ 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': material['title'] })
-
178  materialNumber += 1
-
179  listNumber += 1
-
180 
-
181  return materialsList
-
182 
+
161 def findMaterialsByName(self, materialName) -> list:
+
162 '''
+
163 Find materials by name.
+
164 @param materialName: Regular expression to match the material name.
+
165 @return: A list of materials that match the regular expression of the form:
+
166 [ { 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': title } ]
+
167 '''
+
168 if (self.materials == None):
+
169 return None
+
170
+
171 materialsList = []
+
172 listNumber = 0
+
173 materialNumber = 0
+
174 for materialList in self.materials:
+
175 for material in materialList['results']:
+
176 if re.match(materialName, material['title'], re.IGNORECASE):
+
177 materialsList.append({ 'listNumber': listNumber, 'materialNumber': materialNumber, 'title': material['title'] })
+
178 materialNumber += 1
+
179 listNumber += 1
+
180
+
181 return materialsList
+
182

- -

◆ getMaterialNames()

+ +

◆ getMaterialNames()

@@ -412,8 +467,7 @@

list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.getMaterialNames ( -   - self) + self) @@ -423,26 +477,26 @@

Returns
: List of material names. If no materials are loaded, then an empty list is returned.

Definition at line 183 of file GPUOpenLoader.py.

-
183  def getMaterialNames(self) -> list:
-
184  '''
-
185  Update the material names from the material lists.
-
186  @return: List of material names. If no materials are loaded, then an empty list is returned.
-
187  '''
-
188  self.materialNames = []
-
189  if (self.materials == None):
-
190  return []
-
191 
-
192  for materialList in self.materials:
-
193  for material in materialList['results']:
-
194  self.materialNames.append(material['title'])
-
195 
-
196  return self.materialNames
-
197 
+
183 def getMaterialNames(self) -> list:
+
184 '''
+
185 Update the material names from the material lists.
+
186 @return: List of material names. If no materials are loaded, then an empty list is returned.
+
187 '''
+
188 self.materialNames = []
+
189 if (self.materials == None):
+
190 return []
+
191
+
192 for materialList in self.materials:
+
193 for material in materialList['results']:
+
194 self.materialNames.append(material['title'])
+
195
+
196 return self.materialNames
+
197

- -

◆ getMaterials()

+ +

◆ getMaterials()

@@ -450,8 +504,7 @@

list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.getMaterials ( -   - self) + self) @@ -461,73 +514,73 @@

Returns
: List of material lists

Definition at line 198 of file GPUOpenLoader.py.

-
198  def getMaterials(self) -> list:
-
199  '''
-
200  Get the materials returned from the GPUOpen material database.
-
201  Will loop based on the linked-list of materials stored in the database.
-
202  Currently the batch size requested is 100 materials per batch.
-
203  @return: List of material lists
-
204  '''
-
205 
-
206  self.materials = []
-
207  self.materialNames = []
-
208 
-
209  url = self.url
-
210  headers = {
-
211  'accept': 'application/json'
-
212  }
-
213 
-
214  # Get batches of materials. Start with the first 100.
-
215  # Can apply more filters to this as needed in the future.
-
216  # This will get every material in the database.
-
217  params = {
-
218  'limit': 100,
-
219  'offset': 0
-
220  }
-
221  haveMoreMaterials = True
-
222  while (haveMoreMaterials):
-
223 
-
224  response = requests.get(url, headers=headers, params=params)
-
225 
-
226  if response.status_code == HTTPStatus.OK:
-
227 
-
228  raw_response = response.text
-
229 
-
230  # Split the response text assuming the JSON objects are concatenated
-
231  json_strings = raw_response.split('}{')
-
232  #self.logger.info('Number of JSON strings:', len(json_strings))
-
233  json_result_string = json_strings[0]
-
234  jsonObject = json.loads(json_result_string)
-
235  self.materials.append(jsonObject)
-
236 
-
237  # Scan for next batch of materials
-
238  nextQuery = jsonObject['next']
-
239  if (nextQuery):
-
240  # Get limit and offset from this: 'https://api.matlib.gpuopen.com/api/materials/?limit=100&offset=100"'
-
241  # Split the string by '?'
-
242  queryParts = nextQuery.split('?')
-
243  # Split the string by '&'
-
244  queryParts = queryParts[1].split('&')
-
245  # Split the string by '='
-
246  limitParts = queryParts[0].split('=')
-
247  offsetParts = queryParts[1].split('=')
-
248  params['limit'] = int(limitParts[1])
-
249  params['offset'] = int(offsetParts[1])
-
250  self.logger.info(f'Fetch set of materials: limit: {params["limit"]} offset: {params["offset"]}')
-
251  else:
-
252  haveMoreMaterials = False
-
253  break
-
254 
-
255  else:
-
256  self.logger.info(f'Error: {response.status_code}, {response.text}')
-
257 
-
258  return self.materials
-
259 
+
198 def getMaterials(self) -> list:
+
199 '''
+
200 Get the materials returned from the GPUOpen material database.
+
201 Will loop based on the linked-list of materials stored in the database.
+
202 Currently the batch size requested is 100 materials per batch.
+
203 @return: List of material lists
+
204 '''
+
205
+
206 self.materials = []
+
207 self.materialNames = []
+
208
+
209 url = self.url
+
210 headers = {
+
211 'accept': 'application/json'
+
212 }
+
213
+
214 # Get batches of materials. Start with the first 100.
+
215 # Can apply more filters to this as needed in the future.
+
216 # This will get every material in the database.
+
217 params = {
+
218 'limit': 100,
+
219 'offset': 0
+
220 }
+
221 haveMoreMaterials = True
+
222 while (haveMoreMaterials):
+
223
+
224 response = requests.get(url, headers=headers, params=params)
+
225
+
226 if response.status_code == HTTPStatus.OK:
+
227
+
228 raw_response = response.text
+
229
+
230 # Split the response text assuming the JSON objects are concatenated
+
231 json_strings = raw_response.split('}{')
+
232 #self.logger.info('Number of JSON strings:', len(json_strings))
+
233 json_result_string = json_strings[0]
+
234 jsonObject = json.loads(json_result_string)
+
235 self.materials.append(jsonObject)
+
236
+
237 # Scan for next batch of materials
+
238 nextQuery = jsonObject['next']
+
239 if (nextQuery):
+
240 # Get limit and offset from this: 'https://api.matlib.gpuopen.com/api/materials/?limit=100&offset=100"'
+
241 # Split the string by '?'
+
242 queryParts = nextQuery.split('?')
+
243 # Split the string by '&'
+
244 queryParts = queryParts[1].split('&')
+
245 # Split the string by '='
+
246 limitParts = queryParts[0].split('=')
+
247 offsetParts = queryParts[1].split('=')
+
248 params['limit'] = int(limitParts[1])
+
249 params['offset'] = int(offsetParts[1])
+
250 self.logger.info(f'Fetch set of materials: limit: {params["limit"]} offset: {params["offset"]}')
+
251 else:
+
252 haveMoreMaterials = False
+
253 break
+
254
+
255 else:
+
256 self.logger.info(f'Error: {response.status_code}, {response.text}')
+
257
+
258 return self.materials
+
259

- -

◆ getMaterialsAsJsonString()

+ +

◆ getMaterialsAsJsonString()

@@ -535,8 +588,7 @@

list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.getMaterialsAsJsonString ( -   - self) + self) @@ -546,50 +598,78 @@

Returns
: List of JSON strings for the materials. One string per material batch.

Definition at line 260 of file GPUOpenLoader.py.

-
260  def getMaterialsAsJsonString(self) -> list:
-
261  '''
-
262  Get the JSON strings for the materials
-
263  @return: List of JSON strings for the materials. One string per material batch.
-
264  '''
-
265  results = []
-
266 
-
267  if (self.materials == None):
-
268  return 0
-
269  for material in self.materials:
-
270  results.append(json.dumps(material, indent=4, sort_keys=True))
-
271  return results
-
272 
+
260 def getMaterialsAsJsonString(self) -> list:
+
261 '''
+
262 Get the JSON strings for the materials
+
263 @return: List of JSON strings for the materials. One string per material batch.
+
264 '''
+
265 results = []
+
266
+
267 if (self.materials == None):
+
268 return 0
+
269 for material in self.materials:
+
270 results.append(json.dumps(material, indent=4, sort_keys=True))
+
271 return results
+
272

- -

◆ writeMaterialFiles()

+ +

◆ readMaterialFiles()

- + - - + - - + + +
int materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.writeMaterialFiles list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.readMaterialFiles ( self, self,
 folder, fileNames )
+
+ +

Load the materials from a set of JSON files downloaded from the GPUOpen material database.

+ +

Definition at line 273 of file GPUOpenLoader.py.

+
273 def readMaterialFiles(self, fileNames) -> list:
+
274 '''
+
275 Load the materials from a set of JSON files downloaded from
+
276 the GPUOpen material database.
+
277 '''
+
278 self.materials = []
+
279 for fileName in fileNames:
+
280 with open(fileName) as f:
+
281 data = json.load(f)
+
282 self.materials.append(data)
+
283
+
+
+
+ +

◆ writeMaterialFiles()

+ +
+
+ + + + + - - + + - - +
int materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.writeMaterialFiles ( self,
 rootFileName  folder,
) rootFileName )
@@ -605,61 +685,53 @@

Returns
: The number of files written.

Definition at line 284 of file GPUOpenLoader.py.

-
284  def writeMaterialFiles(self, folder, rootFileName) -> int:
-
285  '''
-
286  Write the materials to a set of MaterialX files.
-
287  @param folder: The folder to write the files to.
-
288  @param rootFileName: The root file name to use for the files.
-
289  @return: The number of files written.
-
290  '''
-
291  if (self.materials == None):
-
292  return 0
-
293 
-
294  i = 0
-
295  if (len(self.materials) > 0):
-
296  os.makedirs(folder, exist_ok=True)
-
297  for material in self.materials:
-
298  # Write JSON to file
-
299  fileName = rootFileName + '_' + str(i) + '.json'
-
300  materialFileName = os.path.join(folder, fileName)
-
301  self.logger.info(f'> Write material to file: "{materialFileName}"')
-
302  with open(materialFileName, 'w') as f:
-
303  json.dump(material, f, indent=4, sort_keys=True)
-
304  i += 1
-
305 
-
306  return i
-
307 
+
284 def writeMaterialFiles(self, folder, rootFileName) -> int:
+
285 '''
+
286 Write the materials to a set of MaterialX files.
+
287 @param folder: The folder to write the files to.
+
288 @param rootFileName: The root file name to use for the files.
+
289 @return: The number of files written.
+
290 '''
+
291 if (self.materials == None):
+
292 return 0
+
293
+
294 i = 0
+
295 if (len(self.materials) > 0):
+
296 os.makedirs(folder, exist_ok=True)
+
297 for material in self.materials:
+
298 # Write JSON to file
+
299 fileName = rootFileName + '_' + str(i) + '.json'
+
300 materialFileName = os.path.join(folder, fileName)
+
301 self.logger.info(f'> Write material to file: "{materialFileName}"')
+
302 with open(materialFileName, 'w') as f:
+
303 json.dump(material, f, indent=4, sort_keys=True)
+
304 i += 1
+
305
+
306 return i
+
307

- -

◆ writeMaterialNamesToFile()

+ +

◆ writeMaterialNamesToFile()

- + - - + - - + - - - - - - - +
def materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.writeMaterialNamesToFile materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.writeMaterialNamesToFile ( self, self,
 fileName, fileName,
 sort = True 
) sort = True )
@@ -675,22 +747,22 @@

Definition at line 308 of file GPUOpenLoader.py.

-
308  def writeMaterialNamesToFile(self, fileName, sort=True):
-
309  '''
-
310  Write sorted list of the material names to a file in JSON format
-
311  @param fileName: The file name to write the material names to.
-
312  @param sort: If true, sort the material names.
-
313  '''
-
314  if (self.materialNames == None):
-
315  return
-
316 
-
317  with open(fileName, 'w') as f:
-
318  json.dump(self.materialNames, f, indent=2, sort_keys=sort)
+
308 def writeMaterialNamesToFile(self, fileName, sort=True):
+
309 '''
+
310 Write sorted list of the material names to a file in JSON format
+
311 @param fileName: The file name to write the material names to.
+
312 @param sort: If true, sort the material names.
+
313 '''
+
314 if (self.materialNames == None):
+
315 return
+
316
+
317 with open(fileName, 'w') as f:
+
318 json.dump(self.materialNames, f, indent=2, sort_keys=sort)

- -

◆ writePackageDataToFile()

+ +

◆ writePackageDataToFile()

@@ -746,42 +808,171 @@

Returns
: True if the package was written.

Definition at line 31 of file GPUOpenLoader.py.

-
31  def writePackageDataToFile(self, data, outputFolder, title, unzipFile=True) -> bool:
-
32  '''
-
33  Write a package data to a file.
-
34  @param data: The data to write.
-
35  @param outputFolder: The output folder to write the file to.
-
36  @param title: The title of the file.
-
37  @param unzipFile: If true, the file is unzipped to a folder with the same name
-
38  as the title.
-
39  @return: True if the package was written.
-
40  '''
-
41  if not data:
-
42  return False
-
43 
-
44  if not os.path.exists(outputFolder):
-
45  os.makedirs(outputFolder)
-
46 
-
47  if unzipFile:
-
48  # Assuming `data` is the binary data of the zip file and `title` and `outputFolder` are defined
-
49  unzipFolder = os.path.join(outputFolder, title)
-
50 
-
51  # Use BytesIO to handle the data in memory
-
52  with io.BytesIO(data) as data_io:
-
53  with zipfile.ZipFile(data_io, 'r') as zip_ref:
-
54  zip_ref.extractall(unzipFolder)
-
55 
-
56  self.logger.info(f'Unzipped to folder: "{unzipFolder}"')
-
57 
-
58  else:
-
59  outputFile = os.path.join(outputFolder, f"{title}.zip")
-
60  with open(outputFile, "wb") as f:
-
61  self.logger.info(f'Write package to file: "{outputFile}"')
-
62  f.write(data)
-
63 
-
64  return True
-
65 
+
31 def writePackageDataToFile(self, data, outputFolder, title, unzipFile=True) -> bool:
+
32 '''
+
33 Write a package data to a file.
+
34 @param data: The data to write.
+
35 @param outputFolder: The output folder to write the file to.
+
36 @param title: The title of the file.
+
37 @param unzipFile: If true, the file is unzipped to a folder with the same name
+
38 as the title.
+
39 @return: True if the package was written.
+
40 '''
+
41 if not data:
+
42 return False
+
43
+
44 if not os.path.exists(outputFolder):
+
45 os.makedirs(outputFolder)
+
46
+
47 if unzipFile:
+
48 # Assuming `data` is the binary data of the zip file and `title` and `outputFolder` are defined
+
49 unzipFolder = os.path.join(outputFolder, title)
+
50
+
51 # Use BytesIO to handle the data in memory
+
52 with io.BytesIO(data) as data_io:
+
53 with zipfile.ZipFile(data_io, 'r') as zip_ref:
+
54 zip_ref.extractall(unzipFolder)
+
55
+
56 self.logger.info(f'Unzipped to folder: "{unzipFolder}"')
+
57
+
58 else:
+
59 outputFile = os.path.join(outputFolder, f"{title}.zip")
+
60 with open(outputFile, "wb") as f:
+
61 self.logger.info(f'Write package to file: "{outputFile}"')
+
62 f.write(data)
+
63
+
64 return True
+
65
+
+

+

Member Data Documentation

+ +

◆ logger

+ +
+
+ + + + +
materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.logger = logging.getLogger('GPUO')
+
+ +

Definition at line 28 of file GPUOpenLoader.py.

+ +
+
+ +

◆ materialNames

+ +
+
+ + + + +
list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.materialNames = []
+
+ +

Definition at line 188 of file GPUOpenLoader.py.

+ +
+
+ +

◆ materials [1/3]

+ +
+
+ + + + +
int materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.materials = None
+
+ +

Definition at line 26 of file GPUOpenLoader.py.

+ +
+
+ +

◆ materials [2/3]

+ +
+
+ + + + +
list materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.materials = []
+
+ +

Definition at line 168 of file GPUOpenLoader.py.

+ +
+
+ +

◆ materials [3/3]

+ +
+
+ + + + +
str materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.materials = rootFileName + '_' + str(i) + '.json'
+
+ +

Definition at line 297 of file GPUOpenLoader.py.

+ +
+
+ +

◆ package_url

+ +
+
+ + + + +
str materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.package_url = self.root_url + '/packages'
+
+ +

Definition at line 25 of file GPUOpenLoader.py.

+ +
+
+ +

◆ root_url

+ +
+
+ + + + +
str materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.root_url = 'https://api.matlib.gpuopen.com/api'
+
+ +

Definition at line 23 of file GPUOpenLoader.py.

+ +
+
+ +

◆ url

+ +
+
+ + + + +
str materialxMaterials.GPUOpenLoader.GPUOpenMaterialLoader.url = self.root_url + '/materials'
+
+ +

Definition at line 24 of file GPUOpenLoader.py.

+

The documentation for this class was generated from the following file:
diff --git a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.js b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.js index dfb417d..e466077 100644 --- a/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.js +++ b/documents/html/classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.js @@ -1,21 +1,13 @@ var classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader = [ - [ "__init__", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a1e3cc881c49c3c260b30783cde3f4b33", null ], - [ "downloadPackage", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a4f093fe70aa6759e2a137fbff2591c6c", null ], - [ "downloadPackageByExpression", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#af59fadea86ebe94e2a289938a0fe3677", null ], - [ "extractPackageData", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#accf473c9f3b11dfe6184228bb45c1234", null ], + [ "downloadPackage", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a78bd0830e40c7ed0f19a3f6792a79b49", null ], + [ "extractPackageData", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a9868e4fb69f84012a19957c624e0c1dc", null ], [ "findMaterialsByName", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a761935f0293fab3ffb6b852ecf543c64", null ], [ "getMaterialNames", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#adacaa6cff169e56b7df3ddb761ffcde0", null ], [ "getMaterials", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a19a2e9d18f0191f9576f384d4f3ee4d9", null ], [ "getMaterialsAsJsonString", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a9f18efa789dd3a63ef8cd1abdcd38224", null ], [ "readMaterialFiles", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#aea6443970a62b7e354441e331e99d962", null ], [ "writeMaterialFiles", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a547938c19b0d7e814389a4f6e6da3b1d", null ], - [ "writeMaterialNamesToFile", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#ad058328e04f5400c5d33c93f4a116ea9", null ], - [ "writePackageDataToFile", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a6e21d13a797c2291f867883624ec1e26", null ], - [ "logger", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a03e5b0c8561400aa1605b37f612f15d0", null ], - [ "materialNames", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#adbbabbd050a9b6daaa3e4a577dfb90ad", null ], - [ "materials", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#ad889c458007390326dfba90aa656a5da", null ], - [ "package_url", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a7356521888345661ce3c908c0ead59b7", null ], - [ "root_url", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a323069fbd34fa7f34be43a01eafbe267", null ], - [ "url", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a1ea17cc1b46b09ac1fa0027c7bfd0f13", null ] + [ "writeMaterialNamesToFile", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a007539622ada6fdeda6b61d260c9824f", null ], + [ "writePackageDataToFile", "classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a6e21d13a797c2291f867883624ec1e26", null ] ]; \ No newline at end of file diff --git a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader-members.html b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader-members.html index 94ac2cc..f869053 100644 --- a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader-members.html +++ b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader-members.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Member List + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,53 +85,63 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader Member List
+
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader Member List

This is the complete list of members for materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + +
__init__(self, mx_module, mx.Document mx_stdlib=None)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
addComment(self, doc, commentString)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
convertToMaterialX(self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
convertToMaterialXString(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
doc (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getInputRemapping(self, shadingModel)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getJSON(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getJSONMaterialNames(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getMaterialsFromURL(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getMaterialXDocument(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
initializeInputRemapping(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
loadMaterialsFromFile(self, fileName)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
loadMaterialsFromString(self, matString)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
logger (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materialNames (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materials (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
MTLX_NODE_NAME_ATTRIBUTE (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
mx (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
printMaterials(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
remapMap (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
setDebugging(self, debug=True)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
skipLibraryElement(elem)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoaderstatic
__init__(self, mx_module, mx.Document mx_stdlib=None)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
_getMethodName(self) (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoaderprotected
addComment(self, doc, commentString)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
convertToMaterialX(self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
convertToMaterialXString(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
doc (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getInputRemapping(self, shadingModel)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getJSON(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getJSONMaterialNames(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getMaterialsFromURL(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
getMaterialXDocument(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
initializeInputRemapping(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
loadMaterialsFromFile(self, fileName)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
loadMaterialsFromString(self, matString)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
logger (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materialNames (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materials (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materials (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
materials (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
MTLX_NODE_NAME_ATTRIBUTE (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
mx (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
mx (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
printMaterials(self)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
remapMap (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
setDebugging(self, debug=True)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
skipLibraryElement(elem)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoaderstatic
stdlib (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
support_openpbr (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
support_openpbr (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
uri (defined in materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
validateMaterialXDocument(self, doc)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
writeJSONToFile(self, filename)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
writeMaterialXToFile(self, filename)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
validateMaterialXDocument(self, doc)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
writeJSONToFile(self, filename)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
writeMaterialXToFile(self, filename)materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader
diff --git a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html index 07e5d9f..741f9d9 100644 --- a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html +++ b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader Class Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,9 +85,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader Class Reference
+
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader Class Reference

Class to load Physically Based Materials from the PhysicallyBased site. - More...

+ More...

- - - - - - - - - + + + + + + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + +

+

Public Member Functions

def __init__ (self, mx_module, mx.Document mx_stdlib=None)
 Constructor for the PhysicallyBasedMaterialLoader class. More...
 
def setDebugging (self, debug=True)
 Set the debugging level for the logger. More...
 
dict getInputRemapping (self, shadingModel)
 Get the remapping keys for a given shading model. More...
 __init__ (self, mx_module, mx.Document mx_stdlib=None)
 Constructor for the PhysicallyBasedMaterialLoader class.
 
 setDebugging (self, debug=True)
 Set the debugging level for the logger.
 
dict getInputRemapping (self, shadingModel)
 Get the remapping keys for a given shading model.
 
def initializeInputRemapping (self)
 Initialize remapping keys for different shading models. More...
 
-dict getJSON (self)
 Get the JSON object representing the Physically Based Materials.
 initializeInputRemapping (self)
 Initialize remapping keys for different shading models.
 
dict getJSON (self)
 Get the JSON object representing the Physically Based Materials.
 
list getJSONMaterialNames (self)
 Get the list of material names from the JSON object. More...
list getJSONMaterialNames (self)
 Get the list of material names from the JSON object.
 
mx.Document getMaterialXDocument (self)
 Get the MaterialX document. More...
mx.Document getMaterialXDocument (self)
 Get the MaterialX document.
 
dict loadMaterialsFromFile (self, fileName)
 Load the Physically Based Materials from a JSON file. More...
dict loadMaterialsFromFile (self, fileName)
 Load the Physically Based Materials from a JSON file.
 
dict loadMaterialsFromString (self, matString)
 Load the Physically Based Materials from a JSON string. More...
dict loadMaterialsFromString (self, matString)
 Load the Physically Based Materials from a JSON string.
 
dict getMaterialsFromURL (self)
 Get the Physically Based Materials from the PhysicallyBased site. More...
dict getMaterialsFromURL (self)
 Get the Physically Based Materials from the PhysicallyBased site.
 
def printMaterials (self)
 Print the materials to the console. More...
 
def writeJSONToFile (self, filename)
 Write the materials to a JSON file. More...
 
def validateMaterialXDocument (self, doc)
 Validate the MaterialX document. More...
 
def addComment (self, doc, commentString)
 Add a comment to the MaterialX document. More...
 
mx.Document convertToMaterialX (self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')
 Convert the Physically Based Materials to MaterialX format for a given target shading model. More...
 printMaterials (self)
 Print the materials to the console.
 
 writeJSONToFile (self, filename)
 Write the materials to a JSON file.
 
 validateMaterialXDocument (self, doc)
 Validate the MaterialX document.
 
 addComment (self, doc, commentString)
 Add a comment to the MaterialX document.
 
mx.Document convertToMaterialX (self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')
 Convert the Physically Based Materials to MaterialX format for a given target shading model.
 
def writeMaterialXToFile (self, filename)
 Write the MaterialX document to disk. More...
 
def convertToMaterialXString (self)
 Convert the MaterialX document to a string. More...
 
 writeMaterialXToFile (self, filename)
 Write the MaterialX document to disk.
 
 convertToMaterialXString (self)
 Convert the MaterialX document to a string.
 
- - - + +

+

Static Public Member Functions

bool skipLibraryElement (elem)
 Utility to skip library elements when iterating over elements in a document. More...
bool skipLibraryElement (elem)
 Utility to skip library elements when iterating over elements in a document.
 
- - + - + - - - - - + + + + + - + - + - + - + - - + + + + + + + + +

+

Public Attributes

logger
 logger = lg.getLogger('PBMXLoader')
 
materials
dict materials = {}
 
materialNames
 
uri
 
doc
list materialNames = []
 
str uri = 'https://api.physicallybased.info/materials'
 
 doc = None
 
mx
 mx = mx_module
 
stdlib
 stdlib = mx_stdlib
 
MTLX_NODE_NAME_ATTRIBUTE
str MTLX_NODE_NAME_ATTRIBUTE = 'nodename'
 
support_openpbr
bool support_openpbr = False
 
remapMap
 
dict remapMap = standard_surface_remapKeys;
 
str materials = 'name' and value):
 
str mx = 'open_pbr_surface':
 
int materials = 0:
 
+ + +

+Protected Member Functions

 _getMethodName (self)
 

Detailed Description

Class to load Physically Based Materials from the PhysicallyBased site.

@@ -197,34 +211,26 @@

Definition at line 11 of file physicallyBasedMaterialX.py.

Constructor & Destructor Documentation

- -

◆ __init__()

+ +

◆ __init__()

- + - - + - - + - - - - - - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.__init__ materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.__init__ ( self, self,
 mx_module, mx_module,
mx.Document  mx_stdlib = None 
)mx.Document mx_stdlib = None )
@@ -240,77 +246,102 @@

Definition at line 16 of file physicallyBasedMaterialX.py.

-
16  def __init__(self, mx_module, mx_stdlib : mx.Document = None):
-
17  '''
-
18  @brief Constructor for the PhysicallyBasedMaterialLoader class.
-
19  Will initialize shader mappings and load the MaterialX standard library
-
20  if it is not passed in as an argument.
-
21  @param mx_module The MaterialX module. Required.
-
22  @param mx_stdlib The MaterialX standard library. Optional.
-
23  '''
-
24  self.logger = lg.getLogger('PBMXLoader')
-
25  lg.basicConfig(level=lg.INFO)
-
26 
-
27  self.materials = {}
-
28  self.materialNames = []
-
29  self.uri = 'https://api.physicallybased.info/materials'
-
30  self.doc = None
-
31  self.mx = mx_module
-
32  self.stdlib = mx_stdlib
-
33  self.MTLX_NODE_NAME_ATTRIBUTE = 'nodename'
-
34  self.support_openpbr = False
-
35 
-
36  if not mx_module:
-
37  self.logger.critical(f'> {self._getMethodName()}: MaterialX module not specified.')
-
38  return
-
39 
-
40  # Check for OpenPBR support which is only available in 1.39 and above
-
41  version_major, version_minor, version_patch = self.mx.getVersionIntegers()
-
42  self.logger.debug(f'> MaterialX version: {version_major}.{version_minor}.{version_patch}')
-
43  if (version_major >=1 and version_minor >= 39) or version_major > 1:
-
44  self.logger.debug('> OpenPBR shading model supported')
-
45  self.support_openpbr = True
-
46 
-
47  self.initializeInputRemapping()
-
48 
-
49  # Load the MaterialX standard library if not provided
-
50  if not self.stdlib:
-
51  self.stdlib = self.mx.createDocument()
-
52  libFiles = self.mx.loadLibraries(mx.getDefaultDataLibraryFolders(), mx.getDefaultDataSearchPath(), self.stdlib)
-
53  self.logger.debug(f'> Loaded standard library: {libFiles}')
-
54 
+
16 def __init__(self, mx_module, mx_stdlib : mx.Document = None):
+
17 '''
+
18 @brief Constructor for the PhysicallyBasedMaterialLoader class.
+
19 Will initialize shader mappings and load the MaterialX standard library
+
20 if it is not passed in as an argument.
+
21 @param mx_module The MaterialX module. Required.
+
22 @param mx_stdlib The MaterialX standard library. Optional.
+
23 '''
+
24 self.logger = lg.getLogger('PBMXLoader')
+
25 lg.basicConfig(level=lg.INFO)
+
26
+
27 self.materials = {}
+
28 self.materialNames = []
+
29 self.uri = 'https://api.physicallybased.info/materials'
+
30 self.doc = None
+
31 self.mx = mx_module
+
32 self.stdlib = mx_stdlib
+
33 self.MTLX_NODE_NAME_ATTRIBUTE = 'nodename'
+
34 self.support_openpbr = False
+
35
+
36 if not mx_module:
+
37 self.logger.critical(f'> {self._getMethodName()}: MaterialX module not specified.')
+
38 return
+
39
+
40 # Check for OpenPBR support which is only available in 1.39 and above
+
41 version_major, version_minor, version_patch = self.mx.getVersionIntegers()
+
42 self.logger.debug(f'> MaterialX version: {version_major}.{version_minor}.{version_patch}')
+
43 if (version_major >=1 and version_minor >= 39) or version_major > 1:
+
44 self.logger.debug('> OpenPBR shading model supported')
+
45 self.support_openpbr = True
+
46
+
47 self.initializeInputRemapping()
+
48
+
49 # Load the MaterialX standard library if not provided
+
50 if not self.stdlib:
+
51 self.stdlib = self.mx.createDocument()
+
52 libFiles = self.mx.loadLibraries(mx.getDefaultDataLibraryFolders(), mx.getDefaultDataSearchPath(), self.stdlib)
+
53 self.logger.debug(f'> Loaded standard library: {libFiles}')
+
54

Member Function Documentation

- -

◆ addComment()

+ +

◆ _getMethodName()

+ + + + + +
- + - - + + +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.addComment materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader._getMethodName ( self, self)
+
+protected
+
+ +

Definition at line 244 of file physicallyBasedMaterialX.py.

+
244 def _getMethodName(self):
+
245 frame = inspect.currentframe().f_back
+
246 method_name = frame.f_code.co_name
+
247 return method_name
+
248 #return inspect.currentframe().f_code.co_name
+
249
+
+
+
+ +

◆ addComment()

+ +
+
+ - - - - + + + - - + + - - +
 doc, materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.addComment ( self,
 commentString  doc,
) commentString )
@@ -326,21 +357,21 @@

Returns
None

Definition at line 267 of file physicallyBasedMaterialX.py.

-
267  def addComment(self, doc, commentString):
-
268  '''
-
269  @brief Add a comment to the MaterialX document
-
270  @param doc The MaterialX document to add the comment to
-
271  @param commentString The comment string to add
-
272  @return None
-
273  '''
-
274  comment = doc.addChildOfCategory('comment')
-
275  comment.setDocString(commentString)
-
276 
+
267 def addComment(self, doc, commentString):
+
268 '''
+
269 @brief Add a comment to the MaterialX document
+
270 @param doc The MaterialX document to add the comment to
+
271 @param commentString The comment string to add
+
272 @return None
+
273 '''
+
274 comment = doc.addChildOfCategory('comment')
+
275 comment.setDocString(commentString)
+
276

- -

◆ convertToMaterialX()

+ +

◆ convertToMaterialX()

@@ -396,134 +417,133 @@

Returns
The MaterialX document

Definition at line 277 of file physicallyBasedMaterialX.py.

-
278  remapKeys = {}, shaderPreFix ='') -> mx.Document:
-
279  '''
-
280  @brief Convert the Physically Based Materials to MaterialX format for a given target shading model.
-
281  @param materialNames The list of material names to convert. If empty, all materials will be converted.
-
282  @param shaderCategory The target shading model to convert to. Default is 'standard_surface'.
-
283  @param remapKeys The remapping keys for the target shading model. If empty, the default remapping keys will be used.
-
284  @param shaderPreFix The prefix to add to the shader name. Default is an empty string.
-
285  @return The MaterialX document
-
286  '''
-
287  if not self.mx:
-
288  self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
289  return None
-
290 
-
291  if not self.support_openpbr and shaderCategory == 'open_pbr_surface':
-
292  self.logger.warning(f'> OpenPBR shading model not supported in MaterialX version {self.mx.getVersionString()}')
-
293  return None
-
294 
-
295  if not self.materials:
-
296  self.logger.info('> No materials to convert')
-
297  return None
-
298 
-
299  if len(remapKeys) == 0:
-
300  remapKeys = self.getInputRemapping(shaderCategory)
-
301  if len(remapKeys) == 0:
-
302  self.logger.warning(f'> No remapping keys found for shading model: {shaderCategory}')
-
303 
-
304  # Create main document and import the library document
-
305  self.doc = self.mx.createDocument()
-
306  self.doc.importLibrary(self.stdlib)
-
307 
-
308  # Add header comments
-
309  self.addComment(self.doc, 'Physically Based Materials from https://api.physicallybased.info ')
-
310  self.addComment(self.doc, ' Processsed via API and converted to MaterialX ')
-
311  self.addComment(self.doc, ' Target Shading Model: ' + shaderCategory)
-
312  self.addComment(self.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ')
-
313 
-
314  # Add properties to the material
-
315  for mat in self.materials:
-
316  matName = mat['name']
-
317 
-
318  # Filter by material name(s)
-
319  if len(materialNames) > 0 and matName not in materialNames:
-
320  #self.logger.debug('Skip material: ' + matName)
-
321  continue
-
322 
-
323  if (len(shaderPreFix) > 0):
-
324  matName = matName + '_' + shaderPreFix
-
325 
-
326  shaderName = self.doc.createValidChildName(matName + '_SHD_PBM')
-
327  self.addComment(self.doc, ' Generated shader: ' + shaderName + ' ')
-
328  shaderNode = self.doc.addNode(shaderCategory, shaderName, self.mx.SURFACE_SHADER_TYPE_STRING)
-
329  docString = mat['description']
-
330  refString = mat['reference']
-
331  if len(refString) > 0:
-
332  if len(docString) > 0:
-
333  docString += '. '
-
334  docString += 'Reference: ' + refString[0]
-
335  if len(docString) > 0:
-
336  shaderNode.setDocString(docString)
-
337  #shaderNode.addInputsFromNodeDef()
-
338  #shaderNode.setAttribute(self.mx.InterfaceElement.NODE_DEF_ATTRIBUTE, nodedefString)
-
339 
-
340  # Create a new material
-
341  materialName = self.doc.createValidChildName(matName + '_MAT_PBM')
-
342  self.addComment(self.doc, ' Generated material: ' + materialName + ' ')
-
343  materialNode = self.doc.addNode(self.mx.SURFACE_MATERIAL_NODE_STRING, materialName, self.mx.MATERIAL_TYPE_STRING)
-
344  shaderInput = materialNode.addInput(self.mx.SURFACE_SHADER_TYPE_STRING, self.mx.SURFACE_SHADER_TYPE_STRING)
-
345  shaderInput.setAttribute(self.MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName())
-
346 
-
347  # Keys to skip.
-
348  skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"]
-
349 
-
350  metallness = None
-
351  roughness = None
-
352  color = None
-
353  transmission = None
-
354  for key, value in mat.items():
-
355 
-
356  if (key not in skipKeys):
-
357  if key == 'metalness':
-
358  metallness = value
-
359  if key == 'roughness':
-
360  roughness = value
-
361  if key == 'transmission':
-
362  transmission = value
-
363  if key == 'color':
-
364  color = value
-
365 
-
366  if key in remapKeys:
-
367  key = remapKeys[key]
-
368  input = shaderNode.addInputFromNodeDef(key)
-
369  if input:
-
370  # Convert number vector to string
-
371  if isinstance(value, list):
-
372  value = ','.join([str(x) for x in value])
-
373  # Convert number to string:
-
374  elif isinstance(value, (int, float)):
-
375  value = str(value)
-
376  input.setValueString(value)
-
377  #else:
-
378  # self.logger.debug('Skip unsupported key: ' + key)
-
379 
-
380  if (transmission != None) and (metallness != None) and (roughness != None) and (color != None):
-
381  if (metallness == 0) and (roughness == 0):
-
382  if 'transmission_color' in remapKeys:
-
383  key = remapKeys['transmission_color']
-
384  input = shaderNode.addInputFromNodeDef(key)
-
385  if input:
-
386  self.logger.debug(f'Set transmission color {key}: {color}')
-
387  value = ','.join([str(x) for x in color])
-
388  input.setValueString(value)
-
389 
-
390  return self.doc
-
391 
+
278 remapKeys = {}, shaderPreFix ='') -> mx.Document:
+
279 '''
+
280 @brief Convert the Physically Based Materials to MaterialX format for a given target shading model.
+
281 @param materialNames The list of material names to convert. If empty, all materials will be converted.
+
282 @param shaderCategory The target shading model to convert to. Default is 'standard_surface'.
+
283 @param remapKeys The remapping keys for the target shading model. If empty, the default remapping keys will be used.
+
284 @param shaderPreFix The prefix to add to the shader name. Default is an empty string.
+
285 @return The MaterialX document
+
286 '''
+
287 if not self.mx:
+
288 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
289 return None
+
290
+
291 if not self.support_openpbr and shaderCategory == 'open_pbr_surface':
+
292 self.logger.warning(f'> OpenPBR shading model not supported in MaterialX version {self.mx.getVersionString()}')
+
293 return None
+
294
+
295 if not self.materials:
+
296 self.logger.info('> No materials to convert')
+
297 return None
+
298
+
299 if len(remapKeys) == 0:
+
300 remapKeys = self.getInputRemapping(shaderCategory)
+
301 if len(remapKeys) == 0:
+
302 self.logger.warning(f'> No remapping keys found for shading model: {shaderCategory}')
+
303
+
304 # Create main document and import the library document
+
305 self.doc = self.mx.createDocument()
+
306 self.doc.importLibrary(self.stdlib)
+
307
+
308 # Add header comments
+
309 self.addComment(self.doc, 'Physically Based Materials from https://api.physicallybased.info ')
+
310 self.addComment(self.doc, ' Processsed via API and converted to MaterialX ')
+
311 self.addComment(self.doc, ' Target Shading Model: ' + shaderCategory)
+
312 self.addComment(self.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ')
+
313
+
314 # Add properties to the material
+
315 for mat in self.materials:
+
316 matName = mat['name']
+
317
+
318 # Filter by material name(s)
+
319 if len(materialNames) > 0 and matName not in materialNames:
+
320 #self.logger.debug('Skip material: ' + matName)
+
321 continue
+
322
+
323 if (len(shaderPreFix) > 0):
+
324 matName = matName + '_' + shaderPreFix
+
325
+
326 shaderName = self.doc.createValidChildName(matName + '_SHD_PBM')
+
327 self.addComment(self.doc, ' Generated shader: ' + shaderName + ' ')
+
328 shaderNode = self.doc.addNode(shaderCategory, shaderName, self.mx.SURFACE_SHADER_TYPE_STRING)
+
329 docString = mat['description']
+
330 refString = mat['reference']
+
331 if len(refString) > 0:
+
332 if len(docString) > 0:
+
333 docString += '. '
+
334 docString += 'Reference: ' + refString[0]
+
335 if len(docString) > 0:
+
336 shaderNode.setDocString(docString)
+
337 #shaderNode.addInputsFromNodeDef()
+
338 #shaderNode.setAttribute(self.mx.InterfaceElement.NODE_DEF_ATTRIBUTE, nodedefString)
+
339
+
340 # Create a new material
+
341 materialName = self.doc.createValidChildName(matName + '_MAT_PBM')
+
342 self.addComment(self.doc, ' Generated material: ' + materialName + ' ')
+
343 materialNode = self.doc.addNode(self.mx.SURFACE_MATERIAL_NODE_STRING, materialName, self.mx.MATERIAL_TYPE_STRING)
+
344 shaderInput = materialNode.addInput(self.mx.SURFACE_SHADER_TYPE_STRING, self.mx.SURFACE_SHADER_TYPE_STRING)
+
345 shaderInput.setAttribute(self.MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName())
+
346
+
347 # Keys to skip.
+
348 skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"]
+
349
+
350 metallness = None
+
351 roughness = None
+
352 color = None
+
353 transmission = None
+
354 for key, value in mat.items():
+
355
+
356 if (key not in skipKeys):
+
357 if key == 'metalness':
+
358 metallness = value
+
359 if key == 'roughness':
+
360 roughness = value
+
361 if key == 'transmission':
+
362 transmission = value
+
363 if key == 'color':
+
364 color = value
+
365
+
366 if key in remapKeys:
+
367 key = remapKeys[key]
+
368 input = shaderNode.addInputFromNodeDef(key)
+
369 if input:
+
370 # Convert number vector to string
+
371 if isinstance(value, list):
+
372 value = ','.join([str(x) for x in value])
+
373 # Convert number to string:
+
374 elif isinstance(value, (int, float)):
+
375 value = str(value)
+
376 input.setValueString(value)
+
377 #else:
+
378 # self.logger.debug('Skip unsupported key: ' + key)
+
379
+
380 if (transmission != None) and (metallness != None) and (roughness != None) and (color != None):
+
381 if (metallness == 0) and (roughness == 0):
+
382 if 'transmission_color' in remapKeys:
+
383 key = remapKeys['transmission_color']
+
384 input = shaderNode.addInputFromNodeDef(key)
+
385 if input:
+
386 self.logger.debug(f'Set transmission color {key}: {color}')
+
387 value = ','.join([str(x) for x in color])
+
388 input.setValueString(value)
+
389
+
390 return self.doc
+
391

- -

◆ convertToMaterialXString()

+ +

◆ convertToMaterialXString()

- + - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.convertToMaterialXString materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.convertToMaterialXString ( self) self)
@@ -533,25 +553,25 @@

Returns
The MaterialX document as a string

Definition at line 407 of file physicallyBasedMaterialX.py.

-
407  def convertToMaterialXString(self):
-
408  '''
-
409  @brief Convert the MaterialX document to a string
-
410  @return The MaterialX document as a string
-
411  '''
-
412  if not self.mx:
-
413  self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
414  return
-
415 
-
416  writeOptions = self.mx.XmlWriteOptions()
-
417  writeOptions.writeXIncludeEnable = False
-
418  writeOptions.elementPredicate = self.skipLibraryElement
-
419  mtlx = self.mx.writeToXmlString(self.doc, writeOptions)
-
420  return mtlx
+
407 def convertToMaterialXString(self):
+
408 '''
+
409 @brief Convert the MaterialX document to a string
+
410 @return The MaterialX document as a string
+
411 '''
+
412 if not self.mx:
+
413 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
414 return
+
415
+
416 writeOptions = self.mx.XmlWriteOptions()
+
417 writeOptions.writeXIncludeEnable = False
+
418 writeOptions.elementPredicate = self.skipLibraryElement
+
419 mtlx = self.mx.writeToXmlString(self.doc, writeOptions)
+
420 return mtlx

- -

◆ getInputRemapping()

+ +

◆ getInputRemapping()

@@ -586,23 +599,48 @@

Returns
A dictionary of remapping keys.

Definition at line 66 of file physicallyBasedMaterialX.py.

-
66  def getInputRemapping(self, shadingModel) -> dict:
-
67  '''
-
68  @brief Get the remapping keys for a given shading model.
-
69  @param shadingModel The shading model to get the remapping keys for.
-
70  @return A dictionary of remapping keys.
-
71  '''
-
72  if (shadingModel in self.remapMap):
-
73  return self.remapMap[shadingModel]
-
74 
-
75  self.logger.warn(f'> No remapping keys found for shading model: {shadingModel}')
-
76  return {}
-
77 
+
66 def getInputRemapping(self, shadingModel) -> dict:
+
67 '''
+
68 @brief Get the remapping keys for a given shading model.
+
69 @param shadingModel The shading model to get the remapping keys for.
+
70 @return A dictionary of remapping keys.
+
71 '''
+
72 if (shadingModel in self.remapMap):
+
73 return self.remapMap[shadingModel]
+
74
+
75 self.logger.warn(f'> No remapping keys found for shading model: {shadingModel}')
+
76 return {}
+
77

- -

◆ getJSONMaterialNames()

+ +

◆ getJSON()

+ +
+
+ + + + + + + +
dict materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSON ( self)
+
+ +

Get the JSON object representing the Physically Based Materials.

+ +

Definition at line 132 of file physicallyBasedMaterialX.py.

+
132 def getJSON(self) -> dict:
+
133 ''' Get the JSON object representing the Physically Based Materials '''
+
134 return self.materials
+
135
+
+
+
+ +

◆ getJSONMaterialNames()

@@ -610,8 +648,7 @@

list materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSONMaterialNames ( -   - self) + self) @@ -621,18 +658,18 @@

Returns
The list of material names

Definition at line 136 of file physicallyBasedMaterialX.py.

-
136  def getJSONMaterialNames(self) -> list:
-
137  '''
-
138  Get the list of material names from the JSON object
-
139  @return The list of material names
-
140  '''
-
141  return self.materialNames
-
142 
+
136 def getJSONMaterialNames(self) -> list:
+
137 '''
+
138 Get the list of material names from the JSON object
+
139 @return The list of material names
+
140 '''
+
141 return self.materialNames
+
142

- -

◆ getMaterialsFromURL()

+ +

◆ getMaterialsFromURL()

@@ -640,8 +677,7 @@

dict materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getMaterialsFromURL ( -   - self) + self) @@ -651,36 +687,36 @@

Returns
The JSON object representing the Physically Based Materials

Definition at line 183 of file physicallyBasedMaterialX.py.

-
183  def getMaterialsFromURL(self) -> dict:
-
184  '''
-
185  @brief Get the Physically Based Materials from the PhysicallyBased site
-
186  @return The JSON object representing the Physically Based Materials
-
187  '''
-
188 
-
189  self.materials = None
-
190  self.materialNames = []
-
191  url = self.uri
-
192  headers = {
-
193  'Accept': 'application/json'
-
194  }
-
195 
-
196  response = requests.get(url, headers=headers)
-
197 
-
198  if response.status_code == HTTPStatus.OK:
-
199  self.materials = response.json()
-
200  for mat in self.materials:
-
201  self.materialNames.append(mat['name'])
-
202 
-
203  else:
-
204  self.logger.error(f'> Status: {response.status_code}, {response.text}')
-
205 
-
206  return self.materials
-
207 
+
183 def getMaterialsFromURL(self) -> dict:
+
184 '''
+
185 @brief Get the Physically Based Materials from the PhysicallyBased site
+
186 @return The JSON object representing the Physically Based Materials
+
187 '''
+
188
+
189 self.materials = None
+
190 self.materialNames = []
+
191 url = self.uri
+
192 headers = {
+
193 'Accept': 'application/json'
+
194 }
+
195
+
196 response = requests.get(url, headers=headers)
+
197
+
198 if response.status_code == HTTPStatus.OK:
+
199 self.materials = response.json()
+
200 for mat in self.materials:
+
201 self.materialNames.append(mat['name'])
+
202
+
203 else:
+
204 self.logger.error(f'> Status: {response.status_code}, {response.text}')
+
205
+
206 return self.materials
+
207

- -

◆ getMaterialXDocument()

+ +

◆ getMaterialXDocument()

@@ -688,8 +724,7 @@

mx.Document materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getMaterialXDocument ( -   - self) + self) @@ -699,27 +734,26 @@

Returns
The MaterialX document

Definition at line 143 of file physicallyBasedMaterialX.py.

-
143  def getMaterialXDocument(self) -> mx.Document:
-
144  '''
-
145  Get the MaterialX document
-
146  @return The MaterialX document
-
147  '''
-
148  return self.doc
-
149 
+
143 def getMaterialXDocument(self) -> mx.Document:
+
144 '''
+
145 Get the MaterialX document
+
146 @return The MaterialX document
+
147 '''
+
148 return self.doc
+
149

- -

◆ initializeInputRemapping()

+ +

◆ initializeInputRemapping()

- + - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.initializeInputRemapping materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.initializeInputRemapping ( self) self)
@@ -734,65 +768,65 @@

Definition at line 78 of file physicallyBasedMaterialX.py.

-
78  def initializeInputRemapping(self):
-
79  '''
-
80  @brief Initialize remapping keys for different shading models.
-
81  The currently supported shading models are:
-
82  - standard_surface
-
83  - open_pbr_surface
-
84  - gltf_pbr
-
85  @return None
-
86  '''
-
87  # Remap keys for Autodesk Standard Surface shading model.
-
88  standard_surface_remapKeys = {
-
89  'color': 'base_color',
-
90  'specularColor': 'specular_color',
-
91  'roughness': 'specular_roughness',
-
92  #'metalness': 'metalness',
-
93  'ior': 'specular_IOR',
-
94  #'transmission': 'transmission',
-
95  'transmission_color': 'transmission_color',
-
96  'thinFilmIor' : 'thin_film_IOR',
-
97  'thinFilmThickness' : 'thin_film_thickness',
-
98  'transmissionDispersion' : 'transmission_dispersion',
-
99  }
-
100  # Remap keys for OpenPBR shading model.
-
101  # Q: When to set geometry_thin_walled to true?
-
102  openpbr_remapKeys = {
-
103  'color': 'base_color',
-
104  'specularColor': 'specular_color',
-
105  'roughness': 'specular_roughness', # 'base_diffuse_roughness',
-
106  'metalness': 'base_metalness',
-
107  'ior': 'specular_ior',
-
108  'transmission': 'transmission_weight',
-
109  'transmission_color': 'transmission_color',
-
110  'subsurfaceRadius': 'subsurface_radius',
-
111  'thinFilmIor' : 'thin_film_ior',
-
112  'thinFilmThickness' : 'thin_film_thickness',
-
113  'transmissionDispersion' : 'transmission_dispersion_scale',
-
114  }
-
115  # Remap keys for Khronos glTF shading model.
-
116  gltf_remapKeys = {
-
117  'color': 'base_color',
-
118  'specularColor': 'specular_color',
-
119  'roughness': 'roughness',
-
120  'metalness': 'metallic',
-
121  'transmission_color': 'attenuation_color',
-
122  #'ior': 'ior',
-
123  #'transmission': 'transmission',
-
124  }
-
125 
-
126  self.remapMap = {}
-
127  self.remapMap['standard_surface'] = standard_surface_remapKeys;
-
128  self.remapMap['gltf_pbr'] = gltf_remapKeys;
-
129  if self.support_openpbr:
-
130  self.remapMap['open_pbr_surface'] = openpbr_remapKeys;
-
131 
+
78 def initializeInputRemapping(self):
+
79 '''
+
80 @brief Initialize remapping keys for different shading models.
+
81 The currently supported shading models are:
+
82 - standard_surface
+
83 - open_pbr_surface
+
84 - gltf_pbr
+
85 @return None
+
86 '''
+
87 # Remap keys for Autodesk Standard Surface shading model.
+
88 standard_surface_remapKeys = {
+
89 'color': 'base_color',
+
90 'specularColor': 'specular_color',
+
91 'roughness': 'specular_roughness',
+
92 #'metalness': 'metalness',
+
93 'ior': 'specular_IOR',
+
94 #'transmission': 'transmission',
+
95 'transmission_color': 'transmission_color',
+
96 'thinFilmIor' : 'thin_film_IOR',
+
97 'thinFilmThickness' : 'thin_film_thickness',
+
98 'transmissionDispersion' : 'transmission_dispersion',
+
99 }
+
100 # Remap keys for OpenPBR shading model.
+
101 # Q: When to set geometry_thin_walled to true?
+
102 openpbr_remapKeys = {
+
103 'color': 'base_color',
+
104 'specularColor': 'specular_color',
+
105 'roughness': 'specular_roughness', # 'base_diffuse_roughness',
+
106 'metalness': 'base_metalness',
+
107 'ior': 'specular_ior',
+
108 'transmission': 'transmission_weight',
+
109 'transmission_color': 'transmission_color',
+
110 'subsurfaceRadius': 'subsurface_radius',
+
111 'thinFilmIor' : 'thin_film_ior',
+
112 'thinFilmThickness' : 'thin_film_thickness',
+
113 'transmissionDispersion' : 'transmission_dispersion_scale',
+
114 }
+
115 # Remap keys for Khronos glTF shading model.
+
116 gltf_remapKeys = {
+
117 'color': 'base_color',
+
118 'specularColor': 'specular_color',
+
119 'roughness': 'roughness',
+
120 'metalness': 'metallic',
+
121 'transmission_color': 'attenuation_color',
+
122 #'ior': 'ior',
+
123 #'transmission': 'transmission',
+
124 }
+
125
+
126 self.remapMap = {}
+
127 self.remapMap['standard_surface'] = standard_surface_remapKeys;
+
128 self.remapMap['gltf_pbr'] = gltf_remapKeys;
+
129 if self.support_openpbr:
+
130 self.remapMap['open_pbr_surface'] = openpbr_remapKeys;
+
131

- -

◆ loadMaterialsFromFile()

+ +

◆ loadMaterialsFromFile()

@@ -827,30 +854,30 @@

Returns
The JSON object representing the Physically Based Materials

Definition at line 150 of file physicallyBasedMaterialX.py.

-
150  def loadMaterialsFromFile(self, fileName) -> dict:
-
151  '''
-
152  @brief Load the Physically Based Materials from a JSON file
-
153  @param fileName The filename to load the JSON file from
-
154  @return The JSON object representing the Physically Based Materials
-
155  '''
-
156  self.materials = None
-
157  self.materialNames = []
-
158  if not os.path.exists(fileName):
-
159  self.logger.error(f'> File does not exist: {fileName}')
-
160  return None
-
161 
-
162  with open(fileName, 'r') as json_file:
-
163  self.materials = json.load(json_file)
-
164  for mat in self.materials:
-
165  self.materialNames.append(mat['name'])
-
166 
-
167  return self.materials
-
168 
+
150 def loadMaterialsFromFile(self, fileName) -> dict:
+
151 '''
+
152 @brief Load the Physically Based Materials from a JSON file
+
153 @param fileName The filename to load the JSON file from
+
154 @return The JSON object representing the Physically Based Materials
+
155 '''
+
156 self.materials = None
+
157 self.materialNames = []
+
158 if not os.path.exists(fileName):
+
159 self.logger.error(f'> File does not exist: {fileName}')
+
160 return None
+
161
+
162 with open(fileName, 'r') as json_file:
+
163 self.materials = json.load(json_file)
+
164 for mat in self.materials:
+
165 self.materialNames.append(mat['name'])
+
166
+
167 return self.materials
+
168

- -

◆ loadMaterialsFromString()

+ +

◆ loadMaterialsFromString()

@@ -885,34 +905,33 @@

Returns
The JSON object representing the Physically Based Materials

Definition at line 169 of file physicallyBasedMaterialX.py.

-
169  def loadMaterialsFromString(self, matString) -> dict:
-
170  '''
-
171  @brief Load the Physically Based Materials from a JSON string
-
172  @param matString The JSON string to load the Physically Based Materials from
-
173  @return The JSON object representing the Physically Based Materials
-
174  '''
-
175  self.materials = None
-
176  self.materialNames = []
-
177  self.materials = json.loads(matString)
-
178  for mat in self.materials:
-
179  self.materialNames.append(mat['name'])
-
180 
-
181  return self.materials
-
182 
+
169 def loadMaterialsFromString(self, matString) -> dict:
+
170 '''
+
171 @brief Load the Physically Based Materials from a JSON string
+
172 @param matString The JSON string to load the Physically Based Materials from
+
173 @return The JSON object representing the Physically Based Materials
+
174 '''
+
175 self.materials = None
+
176 self.materialNames = []
+
177 self.materials = json.loads(matString)
+
178 for mat in self.materials:
+
179 self.materialNames.append(mat['name'])
+
180
+
181 return self.materials
+
182

- -

◆ printMaterials()

+ +

◆ printMaterials()

- + - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.printMaterials materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.printMaterials ( self) self)
@@ -922,43 +941,36 @@

Returns
None

Definition at line 208 of file physicallyBasedMaterialX.py.

-
208  def printMaterials(self):
-
209  '''
-
210  @brief Print the materials to the console
-
211  @return None
-
212  '''
-
213  for mat in self.materials:
-
214  self.logger.info('Material name: ' + mat['name'])
-
215  # Print out each key and value
-
216  for key, value in mat.items():
-
217  if (key != 'name' and value):
-
218  self.logger.info(f'> - {key}: {value}')
-
219 
+
208 def printMaterials(self):
+
209 '''
+
210 @brief Print the materials to the console
+
211 @return None
+
212 '''
+
213 for mat in self.materials:
+
214 self.logger.info('Material name: ' + mat['name'])
+
215 # Print out each key and value
+
216 for key, value in mat.items():
+
217 if (key != 'name' and value):
+
218 self.logger.info(f'> - {key}: {value}')
+
219

- -

◆ setDebugging()

+ +

◆ setDebugging()

- + - - + - - - - - - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.setDebugging materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.setDebugging ( self, self,
 debug = True 
) debug = True )
@@ -973,22 +985,22 @@

Returns
None

Definition at line 55 of file physicallyBasedMaterialX.py.

-
55  def setDebugging(self, debug=True):
-
56  '''
-
57  @brief Set the debugging level for the logger.
-
58  @param debug True to set the logger to debug level, otherwise False.
-
59  @return None
-
60  '''
-
61  if debug:
-
62  self.logger.setLevel(lg.DEBUG)
-
63  else:
-
64  self.logger.setLevel(lg.INFO)
-
65 
+
55 def setDebugging(self, debug=True):
+
56 '''
+
57 @brief Set the debugging level for the logger.
+
58 @param debug True to set the logger to debug level, otherwise False.
+
59 @return None
+
60 '''
+
61 if debug:
+
62 self.logger.setLevel(lg.DEBUG)
+
63 else:
+
64 self.logger.setLevel(lg.INFO)
+
65

- -

◆ skipLibraryElement()

+ +

◆ skipLibraryElement()

@@ -999,8 +1011,7 @@

bool materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.skipLibraryElement ( -   - elem) + elem) @@ -1015,38 +1026,31 @@

Returns
True if the element is not in a library, otherwise False.

Definition at line 237 of file physicallyBasedMaterialX.py.

-
237  def skipLibraryElement(elem) -> bool:
-
238  '''
-
239  @brief Utility to skip library elements when iterating over elements in a document.
-
240  @return True if the element is not in a library, otherwise False.
-
241  '''
-
242  return not elem.hasSourceUri()
-
243 
+
237 def skipLibraryElement(elem) -> bool:
+
238 '''
+
239 @brief Utility to skip library elements when iterating over elements in a document.
+
240 @return True if the element is not in a library, otherwise False.
+
241 '''
+
242 return not elem.hasSourceUri()
+
243

- -

◆ validateMaterialXDocument()

+ +

◆ validateMaterialXDocument()

- + - - + - - - - - - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.validateMaterialXDocument materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.validateMaterialXDocument ( self, self,
 doc 
) doc )
@@ -1061,48 +1065,41 @@

Returns
A tuple of (valid, errors) where valid is True if the document is valid, and errors is a list of errors if the document is invalid.

Definition at line 250 of file physicallyBasedMaterialX.py.

-
250  def validateMaterialXDocument(self, doc):
-
251  '''
-
252  @brief Validate the MaterialX document
-
253  @param doc The MaterialX document to validate
-
254  @return A tuple of (valid, errors) where valid is True if the document is valid, and errors is a list of errors if the document is invalid.
-
255  '''
-
256  if not self.mx:
-
257  self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
258  return False, ''
-
259 
-
260  if not doc:
-
261  self.logger.warning(f'> {self._getMethodName()}: MaterialX document is required')
-
262  return False, ''
-
263 
-
264  valid, errors = doc.validate()
-
265  return valid, errors
-
266 
+
250 def validateMaterialXDocument(self, doc):
+
251 '''
+
252 @brief Validate the MaterialX document
+
253 @param doc The MaterialX document to validate
+
254 @return A tuple of (valid, errors) where valid is True if the document is valid, and errors is a list of errors if the document is invalid.
+
255 '''
+
256 if not self.mx:
+
257 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
258 return False, ''
+
259
+
260 if not doc:
+
261 self.logger.warning(f'> {self._getMethodName()}: MaterialX document is required')
+
262 return False, ''
+
263
+
264 valid, errors = doc.validate()
+
265 return valid, errors
+
266

- -

◆ writeJSONToFile()

+ +

◆ writeJSONToFile()

- + - - + - - - - - - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.writeJSONToFile materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.writeJSONToFile ( self, self,
 filename 
) filename )
@@ -1117,47 +1114,40 @@

Returns
True if the file was written successfully, otherwise False

Definition at line 220 of file physicallyBasedMaterialX.py.

-
220  def writeJSONToFile(self, filename):
-
221  '''
-
222  @brief Write the materials to a JSON file
-
223  @param filename The filename to write the JSON file to
-
224  @return True if the file was written successfully, otherwise False
-
225  '''
-
226  if not self.materials:
-
227  self.logger.warning('No materials to write')
-
228  return False
-
229 
-
230  with open(filename, 'w') as json_file:
-
231  json.dump(self.materials, json_file, indent=4)
-
232  return True
-
233 
-
234  return False
-
235 
+
220 def writeJSONToFile(self, filename):
+
221 '''
+
222 @brief Write the materials to a JSON file
+
223 @param filename The filename to write the JSON file to
+
224 @return True if the file was written successfully, otherwise False
+
225 '''
+
226 if not self.materials:
+
227 self.logger.warning('No materials to write')
+
228 return False
+
229
+
230 with open(filename, 'w') as json_file:
+
231 json.dump(self.materials, json_file, indent=4)
+
232 return True
+
233
+
234 return False
+
235

- -

◆ writeMaterialXToFile()

+ +

◆ writeMaterialXToFile()

- + - - + - - - - - - - +
def materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.writeMaterialXToFile materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.writeMaterialXToFile ( self, self,
 filename 
) filename )
@@ -1172,22 +1162,231 @@

Returns
None

Definition at line 392 of file physicallyBasedMaterialX.py.

-
392  def writeMaterialXToFile(self, filename):
-
393  '''
-
394  @brief Write the MaterialX document to disk
-
395  @param filename The filename to write the MaterialX document to
-
396  @return None
-
397  '''
-
398  if not self.mx:
-
399  self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
400  return
-
401 
-
402  writeOptions = self.mx.XmlWriteOptions()
-
403  writeOptions.writeXIncludeEnable = False
-
404  writeOptions.elementPredicate = self.skipLibraryElement
-
405  self.mx.writeToXmlFile(self.doc, filename, writeOptions)
-
406 
+
392 def writeMaterialXToFile(self, filename):
+
393 '''
+
394 @brief Write the MaterialX document to disk
+
395 @param filename The filename to write the MaterialX document to
+
396 @return None
+
397 '''
+
398 if not self.mx:
+
399 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
400 return
+
401
+
402 writeOptions = self.mx.XmlWriteOptions()
+
403 writeOptions.writeXIncludeEnable = False
+
404 writeOptions.elementPredicate = self.skipLibraryElement
+
405 self.mx.writeToXmlFile(self.doc, filename, writeOptions)
+
406
+
+

+

Member Data Documentation

+ +

◆ doc

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.doc = None
+
+ +

Definition at line 30 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ logger

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.logger = lg.getLogger('PBMXLoader')
+
+ +

Definition at line 24 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ materialNames

+ +
+
+ + + + +
list materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.materialNames = []
+
+ +

Definition at line 28 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ materials [1/3]

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.materials = {}
+
+ +

Definition at line 27 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ materials [2/3]

+ +
+
+ + + + +
str materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.materials = 'name' and value):
+
+ +

Definition at line 213 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ materials [3/3]

+ +
+
+ + + + +
int materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.materials = 0:
+
+ +

Definition at line 295 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ MTLX_NODE_NAME_ATTRIBUTE

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.MTLX_NODE_NAME_ATTRIBUTE = 'nodename'
+
+ +

Definition at line 33 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ mx [1/2]

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.mx = mx_module
+
+ +

Definition at line 31 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ mx [2/2]

+ +
+
+ + + + +
str materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.mx = 'open_pbr_surface':
+
+ +

Definition at line 287 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ remapMap

+ +
+
+ + + + +
dict materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.remapMap = standard_surface_remapKeys;
+
+ +

Definition at line 72 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ stdlib

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.stdlib = mx_stdlib
+
+ +

Definition at line 32 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ support_openpbr

+ +
+
+ + + + +
materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.support_openpbr = False
+
+ +

Definition at line 34 of file physicallyBasedMaterialX.py.

+ +
+
+ +

◆ uri

+ +
+
+ + + + +
str materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.uri = 'https://api.physicallybased.info/materials'
+
+ +

Definition at line 29 of file physicallyBasedMaterialX.py.

+

The documentation for this class was generated from the following file:
diff --git a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.js b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.js index 627803c..07fccaa 100644 --- a/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.js +++ b/documents/html/classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.js @@ -1,30 +1,20 @@ var classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader = [ - [ "__init__", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a562aa01290163eac86d6b7a2a8cb7382", null ], - [ "addComment", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ae9e0898cb48b3c163eeea4e7c035cc92", null ], + [ "__init__", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ac0402372fc17f1b12d5fb9e0222d8db9", null ], + [ "addComment", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aeebf1a5739a076154a34bd6d58bea8d4", null ], [ "convertToMaterialX", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ad568a7f8abedc69fb614271dd3faff2a", null ], - [ "convertToMaterialXString", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a7935dfb3fc52dfa51d4ddef5016d28f7", null ], + [ "convertToMaterialXString", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a761fb96e854016db0502cee510c02ef7", null ], [ "getInputRemapping", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a00df7f744ae51556d8f63db4360eef43", null ], [ "getJSON", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aae3e6a57ee0e7f49e394a172d87dc410", null ], [ "getJSONMaterialNames", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a0fac543d80540406546451822598309e", null ], [ "getMaterialsFromURL", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa38eb83c67b0f4c139f523450e1de525", null ], [ "getMaterialXDocument", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ab5cb1ede45bf58bfeddb8948fde47a3e", null ], - [ "initializeInputRemapping", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#abd638d0f058fc0c5b15858c28c759df3", null ], + [ "initializeInputRemapping", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa520500f3603a142c1df6260bee964bd", null ], [ "loadMaterialsFromFile", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a1695a75528ef0135abd02f6aab93d2c9", null ], [ "loadMaterialsFromString", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a14c9374702631d0c03e305fb57b0c45c", null ], - [ "printMaterials", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a836f19e92aeee30884613e4d9e2c4698", null ], - [ "setDebugging", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a55f6fd9b37754a25499353a360f7c85c", null ], - [ "validateMaterialXDocument", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a0e370e9ac4e8cefa9ab0136067ed55cf", null ], - [ "writeJSONToFile", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aec5e05618ea141395f94a2ecc897ab96", null ], - [ "writeMaterialXToFile", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#adefb5c1b44257ae287109366909e914c", null ], - [ "doc", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a1602d9f79454e1faaa224410ddcd697c", null ], - [ "logger", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#abb0fd25e18379d961cebf80307352b32", null ], - [ "materialNames", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a940c8407e5317ce4ef2beb9a1b315819", null ], - [ "materials", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a4b4a9cf55cb2a7d52250701f19ef08ab", null ], - [ "MTLX_NODE_NAME_ATTRIBUTE", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aab6479228f71f8b7f3b6077f67c7d103", null ], - [ "mx", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ae10fc6e2a8a66c4e09ad3f6b5dc320f3", null ], - [ "remapMap", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a7124c367f11e6d430fa6ae58caa7c67e", null ], - [ "stdlib", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa92dc0c1dee535196fccaa43814e728d", null ], - [ "support_openpbr", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a5cb354ab20d9ee591c392004f1ca2ad9", null ], - [ "uri", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a9d6a351c14cb58758e39124176681f58", null ] + [ "printMaterials", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#abbf979af8310df66bb3888886d40504d", null ], + [ "setDebugging", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a8dd7341a2015ea81c2affca688f91f52", null ], + [ "validateMaterialXDocument", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a611d7f557adf6ca07928a7f7cac6c8dc", null ], + [ "writeJSONToFile", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a9234b66dabe72170e0a47f61722e9761", null ], + [ "writeMaterialXToFile", "classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a4a4c8283eead5ae269a566782fd55fa3", null ] ]; \ No newline at end of file diff --git a/documents/html/clipboard.js b/documents/html/clipboard.js new file mode 100644 index 0000000..42c1fb0 --- /dev/null +++ b/documents/html/clipboard.js @@ -0,0 +1,61 @@ +/** + +The code below is based on the Doxygen Awesome project, see +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2022 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +let clipboard_title = "Copy to clipboard" +let clipboard_icon = `` +let clipboard_successIcon = `` +let clipboard_successDuration = 1000 + +$(function() { + if(navigator.clipboard) { + const fragments = document.getElementsByClassName("fragment") + for(const fragment of fragments) { + const clipboard_div = document.createElement("div") + clipboard_div.classList.add("clipboard") + clipboard_div.innerHTML = clipboard_icon + clipboard_div.title = clipboard_title + $(clipboard_div).click(function() { + const content = this.parentNode.cloneNode(true) + // filter out line number and folded fragments from file listings + content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) + let text = content.textContent + // remove trailing newlines and trailing spaces from empty lines + text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') + navigator.clipboard.writeText(text); + this.classList.add("success") + this.innerHTML = clipboard_successIcon + window.setTimeout(() => { // switch back to normal icon after timeout + this.classList.remove("success") + this.innerHTML = clipboard_icon + }, clipboard_successDuration); + }) + fragment.insertBefore(clipboard_div, fragment.firstChild) + } + } +}) diff --git a/documents/html/cookie.js b/documents/html/cookie.js new file mode 100644 index 0000000..53ad21d --- /dev/null +++ b/documents/html/cookie.js @@ -0,0 +1,58 @@ +/*! + Cookie helper functions + Copyright (c) 2023 Dimitri van Heesch + Released under MIT license. +*/ +let Cookie = { + cookie_namespace: 'doxygen_', + + readSetting(cookie,defVal) { + if (window.chrome) { + const val = localStorage.getItem(this.cookie_namespace+cookie) || + sessionStorage.getItem(this.cookie_namespace+cookie); + if (val) return val; + } else { + let myCookie = this.cookie_namespace+cookie+"="; + if (document.cookie) { + const index = document.cookie.indexOf(myCookie); + if (index != -1) { + const valStart = index + myCookie.length; + let valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + return document.cookie.substring(valStart, valEnd); + } + } + } + return defVal; + }, + + writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete + if (window.chrome) { + if (days==0) { + sessionStorage.setItem(this.cookie_namespace+cookie,val); + } else { + localStorage.setItem(this.cookie_namespace+cookie,val); + } + } else { + let date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; + document.cookie = this.cookie_namespace + cookie + "=" + + val + "; SameSite=Lax;" + expiration + "path=/"; + } + }, + + eraseSetting(cookie) { + if (window.chrome) { + if (localStorage.getItem(this.cookie_namespace+cookie)) { + localStorage.removeItem(this.cookie_namespace+cookie); + } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { + sessionStorage.removeItem(this.cookie_namespace+cookie); + } + } else { + this.writeSetting(cookie,'',-1); + } + }, +} diff --git a/documents/html/dir_0e7a2bf207642fde32bb2644c27b5ffb.html b/documents/html/dir_0e7a2bf207642fde32bb2644c27b5ffb.html index 0f89ea3..d8a1b15 100644 --- a/documents/html/dir_0e7a2bf207642fde32bb2644c27b5ffb.html +++ b/documents/html/dir_0e7a2bf207642fde32bb2644c27b5ffb.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: javascript Directory Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,23 +85,35 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
javascript Directory Reference
+
javascript Directory Reference
+ + + + +

+Files

 JsMaterialXPhysicallyBased.js
 
diff --git a/documents/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/documents/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 9baa323..eef01d6 100644 --- a/documents/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/documents/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: src Directory Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,19 +85,27 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
src Directory Reference
+
src Directory Reference
- + +

+

Directories

 materialxMaterials
 
@@ -98,7 +113,7 @@ diff --git a/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.html b/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.html index 1c5c53f..fd345e4 100644 --- a/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.html +++ b/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: materialxMaterials Directory Reference + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,23 +85,46 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials Directory Reference
+
materialxMaterials Directory Reference
+ + + + + + + + + + + + + + + +

+Files

 __init__.py
 
 __main__.py
 
 GPUOpenLoader.py
 
 GPUOpenLoaderCmd.py
 
 physicallyBasedMaterialX.py
 
 physicallyBasedMaterialXCmd.py
 Convert Physically Based Materials to MaterialX Command Line Utility.
 
diff --git a/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.js b/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.js index 5257a07..4f5cee2 100644 --- a/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.js +++ b/documents/html/dir_ed2309c38062a0ffa21222134f4047e1.js @@ -5,5 +5,5 @@ var dir_ed2309c38062a0ffa21222134f4047e1 = [ "GPUOpenLoader.py", "_g_p_u_open_loader_8py_source.html", null ], [ "GPUOpenLoaderCmd.py", "_g_p_u_open_loader_cmd_8py_source.html", null ], [ "physicallyBasedMaterialX.py", "physically_based_material_x_8py_source.html", null ], - [ "physicallyBasedMaterialXCmd.py", "physically_based_material_x_cmd_8py_source.html", null ] + [ "physicallyBasedMaterialXCmd.py", "physically_based_material_x_cmd_8py.html", null ] ]; \ No newline at end of file diff --git a/documents/html/doc.svg b/documents/html/doc.svg new file mode 100644 index 0000000..0b928a5 --- /dev/null +++ b/documents/html/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/documents/html/docd.svg b/documents/html/docd.svg new file mode 100644 index 0000000..ac18b27 --- /dev/null +++ b/documents/html/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/documents/html/doxygen.css b/documents/html/doxygen.css index ffbff02..b3e91d3 100644 --- a/documents/html/doxygen.css +++ b/documents/html/doxygen.css @@ -1,29 +1,422 @@ -/* The standard CSS for doxygen 1.9.1 */ - -body, table, div, p, dl { - font: 400 14px/22px Roboto,sans-serif; +/* The standard CSS for doxygen 1.12.0*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--fragment-copy-ok-color: #2EC82E; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; +--fold-line-color: #808080; +--fold-minus-image: url('minus.svg'); +--fold-plus-image: url('plus.svg'); +--fold-minus-image-relpath: url('../../minus.svg'); +--fold-plus-image-relpath: url('../../plus.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +/** special sections */ +--warning-color-bg: #f8d1cc; +--warning-color-hl: #b61825; +--warning-color-text: #75070f; +--note-color-bg: #faf3d8; +--note-color-hl: #f3a600; +--note-color-text: #5f4204; +--todo-color-bg: #e4f3ff; +--todo-color-hl: #1879C4; +--todo-color-text: #274a5c; +--test-color-bg: #e8e8ff; +--test-color-hl: #3939C4; +--test-color-text: #1a1a5c; +--deprecated-color-bg: #ecf0f3; +--deprecated-color-hl: #5b6269; +--deprecated-color-text: #43454a; +--bug-color-bg: #e4dafd; +--bug-color-hl: #5b2bdd; +--bug-color-text: #2a0d72; +--invariant-color-bg: #d8f1e3; +--invariant-color-hl: #44b86f; +--invariant-color-text: #265532; +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: #090D16; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--fragment-copy-ok-color: #0EA80E; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; +--fold-minus-image: url('minusd.svg'); +--fold-plus-image: url('plusd.svg'); +--fold-minus-image-relpath: url('../../minusd.svg'); +--fold-plus-image-relpath: url('../../plusd.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +/** special sections */ +--warning-color-bg: #2e1917; +--warning-color-hl: #ad2617; +--warning-color-text: #f5b1aa; +--note-color-bg: #3b2e04; +--note-color-hl: #f1b602; +--note-color-text: #ceb670; +--todo-color-bg: #163750; +--todo-color-hl: #1982D2; +--todo-color-text: #dcf0fa; +--test-color-bg: #121258; +--test-color-hl: #4242cf; +--test-color-text: #c0c0da; +--deprecated-color-bg: #2e323b; +--deprecated-color-hl: #738396; +--deprecated-color-text: #abb0bd; +--bug-color-bg: #2a2536; +--bug-color-hl: #7661b3; +--bug-color-text: #ae9ed6; +--invariant-color-bg: #303a35; +--invariant-color-hl: #76ce96; +--invariant-color-text: #cceed5; +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); } -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; } /* @group Heading Levels */ -h1.groupheader { - font-size: 150%; -} - .title { - font: 400 14px/28px Roboto,sans-serif; + font-family: var(--font-family-normal); + line-height: 28px; font-size: 150%; font-weight: bold; margin: 10px 2px; } +h1.groupheader { + font-size: 150%; +} + h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); font-size: 150%; font-weight: normal; margin-top: 1.75em; @@ -46,22 +439,13 @@ h1, h2, h3, h4, h5, h6 { } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; + text-shadow: 0 0 15px var(--glow-color); } dt { font-weight: bold; } -ul.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; - column-count: 3; -} - p.startli, p.startdd { margin-top: 2px; } @@ -113,7 +497,6 @@ h3.version { } div.navtab { - border-right: 1px solid #A3B4D7; padding-right: 15px; text-align: right; line-height: 110%; @@ -127,16 +510,17 @@ td.navtab { padding-right: 6px; padding-left: 6px; } + td.navtabHL { - background-image: url('tab_a.png'); + background-image: var(--nav-gradient-active-image); background-repeat:repeat-x; padding-right: 6px; padding-left: 6px; } td.navtabHL a, td.navtabHL a:visited { - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); } a.navtab { @@ -148,7 +532,13 @@ div.qindex{ width: 100%; line-height: 140%; font-size: 130%; - color: #A0A0A0; + color: var(--index-separator-color); +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; } dt.alphachar{ @@ -157,7 +547,7 @@ dt.alphachar{ } .alphachar a{ - color: black; + color: var(--index-header-color); } .alphachar a:hover, .alphachar a:visited{ @@ -176,8 +566,12 @@ dt.alphachar{ line-height: 1.15em; } +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + .classindex dl.odd { - background-color: #F8F9FC; + background-color: var(--index-odd-item-bg-color); } @media(min-width: 1120px) { @@ -196,21 +590,23 @@ dt.alphachar{ /* @group Link Styling */ a { - color: #3D578C; + color: var(--page-link-color); font-weight: normal; text-decoration: none; } .contents a:visited { - color: #4665A2; + color: var(--page-visited-link-color); } a:hover { - text-decoration: underline; + text-decoration: none; + background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); } -.contents a.qindexHL:visited { - color: #FFFFFF; +a:hover > span.arrow { + text-decoration: none; + background : var(--nav-background-color); } a.el { @@ -221,12 +617,39 @@ a.elRef { } a.code, a.code:visited, a.line, a.line:visited { - color: #4665A2; + color: var(--code-link-color); } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { - color: #4665A2; -} + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } /* @end */ @@ -234,8 +657,35 @@ dl.el { margin-left: -1cm; } +ul.check { + list-style:none; + text-indent: -16px; + padding-left: 38px; +} +li.unchecked:before { + content: "\2610\A0"; +} +li.checked:before { + content: "\2611\A0"; +} + +ol { + text-indent: 0px; +} + ul { - overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ + text-indent: 0px; + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; } #side-nav ul { @@ -249,35 +699,70 @@ ul { .fragment { text-align: left; direction: ltr; - overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-x: auto; overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid var(--fragment-border-color); + border-radius: 4px; + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); } pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: var(--font-family-monospace); +} + +.clipboard { + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; - font-family: monospace, fixed; - font-size: 105%; + fill: var(--fragment-foreground-color); + justify-content: center; + align-items: center; + cursor: pointer; +} + +.clipboard.success { + border: 1px solid var(--fragment-foreground-color); + border-radius: 4px; +} + +.fragment:hover .clipboard, .clipboard.success { + opacity: .28; +} + +.clipboard:hover, .clipboard.success { + opacity: 1 !important; +} + +.clipboard:active:not([class~=success]) svg { + transform: scale(.91); +} + +.clipboard.success svg { + fill: var(--fragment-copy-ok-color); } -div.fragment { - padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ - margin: 4px 8px 4px 2px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; +.clipboard.success { + border-color: var(--fragment-copy-ok-color); } div.line { - font-family: monospace, fixed; + font-family: var(--font-family-monospace); font-size: 13px; min-height: 13px; - line-height: 1.0; + line-height: 1.2; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ @@ -306,24 +791,40 @@ div.line:after { } div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); } +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} span.lineno { padding-right: 4px; + margin-right: 9px; text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); white-space: pre; } -span.lineno a { - background-color: #D8D8D8; +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); } span.lineno a:hover { - background-color: #C8C8C8; + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); } .lineno { @@ -335,24 +836,6 @@ span.lineno a:hover { user-select: none; } -div.ah, span.ah { - background-color: black; - font-weight: bold; - color: #FFFFFF; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); -} - div.classindex ul { list-style: none; padding-left: 0; @@ -374,8 +857,7 @@ div.groupText { } body { - background-color: white; - color: black; + color: var(--page-foreground-color); margin: 0; } @@ -385,33 +867,15 @@ div.contents { margin-right: 8px; } -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - p.formulaDsp { text-align: center; } -img.formulaDsp { - +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; } img.formulaInl, img.inline { @@ -437,89 +901,74 @@ address.footer { img.footer { border: 0px; vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; } /* @group Code Colorization */ span.keyword { - color: #008000 + color: var(--code-keyword-color); } span.keywordtype { - color: #604020 + color: var(--code-type-keyword-color); } span.keywordflow { - color: #e08000 + color: var(--code-flow-keyword-color); } span.comment { - color: #800000 + color: var(--code-comment-color); } span.preprocessor { - color: #806020 + color: var(--code-preprocessor-color); } span.stringliteral { - color: #002080 + color: var(--code-string-literal-color); } span.charliteral { - color: #008080 + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); } span.vhdldigit { - color: #ff00ff + color: var(--code-vhdl-digit-color); } span.vhdlchar { - color: #000000 + color: var(--code-vhdl-char-color); } span.vhdlkeyword { - color: #700070 + color: var(--code-vhdl-keyword-color); } span.vhdllogic { - color: #ff0000 + color: var(--code-vhdl-logic-color); } blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); margin: 0 24px 0 4px; padding: 0 12px 0 16px; } -blockquote.DocNodeRTL { - border-left: 0; - border-right: 2px solid #9CAFD4; - margin: 0 4px 0 24px; - padding: 0 16px 0 12px; -} - /* @end */ -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - td.tiny { font-size: 75%; } @@ -527,18 +976,19 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid var(--table-cell-border-color); } th.dirtab { - background: #EBEFF6; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid var(--separator-color); } hr.footer { @@ -566,14 +1016,14 @@ table.memberdecls { } .memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: var(--memdecl-background-color); border: none; margin: 4px; padding: 1px 0 0 8px; @@ -581,11 +1031,11 @@ table.memberdecls { .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; - color: #555; + color: var(--memdecl-foreground-color); } .memSeparator { - border-bottom: 1px solid #DEE4F0; + border-bottom: 1px solid var(--memdecl-separator-color); line-height: 1px; margin: 0px; padding: 0px; @@ -600,7 +1050,7 @@ table.memberdecls { } .memTemplParams { - color: #4665A2; + color: var(--memdecl-template-color); white-space: nowrap; font-size: 80%; } @@ -613,15 +1063,15 @@ table.memberdecls { .memtitle { padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); border-top-right-radius: 4px; border-top-left-radius: 4px; margin-bottom: -1px; - background-image: url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat: repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); line-height: 1.25; font-weight: 300; float:left; @@ -636,20 +1086,11 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: var(--memdef-template-color); font-weight: normal; margin-left: 9px; } -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - .mempage { width: 100%; } @@ -668,7 +1109,7 @@ table.memberdecls { } .memitem.glow { - box-shadow: 0 0 15px cyan; + box-shadow: 0 0 15px var(--glow-color); } .memname { @@ -681,41 +1122,32 @@ table.memberdecls { } .memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 0px 6px 0px; - color: #253555; + color: var(--memdef-proto-text-color); font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; - /* opera specific markup */ + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - } .overload { - font-family: "courier new",courier,monospace; + font-family: var(--font-family-monospace); font-size: 65%; } .memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 10px 2px 10px; - background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; - background-color: #FFFFFF; + background-color: var(--memdef-doc-background-color); /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; @@ -745,36 +1177,44 @@ dl.reflist dd { .paramtype { white-space: nowrap; + padding: 0px; + padding-bottom: 1px; } .paramname { - color: #602020; white-space: nowrap; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; } + .paramname em { + color: var(--memdef-param-name-color); font-style: normal; + margin-right: 1px; } -.paramname code { - line-height: 14px; + +.paramname .paramdefval { + font-family: var(--font-family-monospace); } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; -} +} .params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { font-weight: bold; vertical-align: top; } - + .params .paramtype, .tparams .paramtype { font-style: italic; vertical-align: top; -} - +} + .params .paramdir, .tparams .paramdir { - font-family: "courier new",courier,monospace; + font-family: var(--font-family-monospace); vertical-align: top; } @@ -798,13 +1238,13 @@ span.mlabels { } span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); text-shadow: none; - color: white; + color: var(--label-foreground-color); margin-right: 4px; padding: 2px 3px; border-radius: 3px; @@ -821,8 +1261,8 @@ span.mlabel { div.directory { margin: 10px 0px; - border-top: 1px solid #9CAFD4; - border-bottom: 1px solid #9CAFD4; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); width: 100%; } @@ -858,9 +1298,14 @@ div.directory { border-left: 1px solid rgba(0,0,0,0.05); } +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + .directory tr.even { padding-left: 6px; - background-color: #F7F8FB; + background-color: var(--index-even-item-bg-color); } .directory img { @@ -878,11 +1323,11 @@ div.directory { cursor: pointer; padding-left: 2px; padding-right: 2px; - color: #3D578C; + color: var(--page-link-color); } .arrow { - color: #9CAFD4; + color: var(--nav-arrow-color); -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; @@ -896,14 +1341,15 @@ div.directory { } .icon { - font-family: Arial, Helvetica; + font-family: var(--font-family-icon); + line-height: normal; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; - background-color: #728DC1; - color: white; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); text-align: center; border-radius: 4px; margin-left: 2px; @@ -920,8 +1366,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderopen.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-open-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -931,8 +1376,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderclosed.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-closed-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -942,17 +1386,13 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('doc.png'); + background-image:var(--icon-doc-image); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } -table.directory { - font: 400 14px Roboto,sans-serif; -} - /* @end */ div.dynheader { @@ -967,7 +1407,7 @@ div.dynheader { address { font-style: normal; - color: #2A3D61; + color: var(--footer-foreground-color); } table.doxtable caption { @@ -981,28 +1421,23 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { - /*width: 100%;*/ margin-bottom: 10px; - border: 1px solid #A8B8D9; + border: 1px solid var(--memdef-border-color); border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } @@ -1010,10 +1445,10 @@ table.fieldtable { padding: 3px 7px 2px; } -.fieldtable td.fieldtype, .fieldtable td.fieldname { +.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit { white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); vertical-align: top; } @@ -1021,15 +1456,20 @@ table.fieldtable { padding-top: 3px; } +.fieldtable td.fieldinit { + padding-top: 3px; + text-align: right; +} + + .fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - /*width: 100%;*/ + border-bottom: 1px solid var(--memdef-border-color); } .fieldtable td.fielddoc p:first-child { margin-top: 0px; -} - +} + .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } @@ -1039,22 +1479,18 @@ table.fieldtable { } .fieldtable th { - background-image:url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); font-size: 90%; - color: #253555; + color: var(--memdef-proto-text-color); padding-bottom: 4px; padding-top: 5px; text-align:left; font-weight: 400; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); } @@ -1062,7 +1498,7 @@ table.fieldtable { top: 0px; left: 10px; height: 36px; - background-image: url('tab_b.png'); + background-image: var(--nav-gradient-image); z-index: 101; overflow: hidden; font-size: 13px; @@ -1071,13 +1507,13 @@ table.fieldtable { .navpath ul { font-size: 11px; - background-image:url('tab_b.png'); + background-image: var(--nav-gradient-image); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); overflow:hidden; margin:0px; padding:0px; @@ -1089,27 +1525,27 @@ table.fieldtable { float:left; padding-left:10px; padding-right:15px; - background-image:url('bc_s.png'); + background-image:var(--nav-breadcrumb-image); background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--nav-foreground-color); } .navpath li.navelem a { height:32px; display:block; - text-decoration: none; outline: none; - color: #283A5D; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; } .navpath li.navelem a:hover { - color:#6884BD; + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); } .navpath li.footer @@ -1121,7 +1557,7 @@ table.fieldtable { background-image:none; background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--footer-foreground-color); font-size: 8pt; } @@ -1133,7 +1569,7 @@ div.summary padding-right: 5px; width: 50%; text-align: right; -} +} div.summary a { @@ -1148,7 +1584,7 @@ table.classindex margin-right: 3%; width: 94%; border: 0; - border-spacing: 0; + border-spacing: 0; padding: 0; } @@ -1166,11 +1602,11 @@ div.ingroups a div.header { - background-image:url('nav_h.png'); + background-image: var(--header-gradient-image); background-repeat:repeat-x; - background-color: #F9FAFC; + background-color: var(--header-background-color); margin: 0px; - border-bottom: 1px solid #C4CFE5; + border-bottom: 1px solid var(--header-separator-color); } div.headertitle @@ -1187,17 +1623,13 @@ dl { padding: 0 0 0 0; } -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +/* + dl.section { margin-left: 0px; padding-left: 0px; } -dl.section.DocNodeRTL { - margin-right: 0px; - padding-right: 0px; -} - dl.note { margin-left: -7px; padding-left: 3px; @@ -1205,33 +1637,13 @@ dl.note { border-color: #D0C000; } -dl.note.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #D0C000; -} - -dl.warning, dl.attention { +dl.warning, dl.attention, dl.important { margin-left: -7px; padding-left: 3px; border-left: 4px solid; border-color: #FF0000; } -dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #FF0000; -} - dl.pre, dl.post, dl.invariant { margin-left: -7px; padding-left: 3px; @@ -1239,16 +1651,6 @@ dl.pre, dl.post, dl.invariant { border-color: #00D000; } -dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00D000; -} - dl.deprecated { margin-left: -7px; padding-left: 3px; @@ -1256,16 +1658,6 @@ dl.deprecated { border-color: #505050; } -dl.deprecated.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #505050; -} - dl.todo { margin-left: -7px; padding-left: 3px; @@ -1273,16 +1665,6 @@ dl.todo { border-color: #00C0E0; } -dl.todo.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00C0E0; -} - dl.test { margin-left: -7px; padding-left: 3px; @@ -1290,16 +1672,6 @@ dl.test { border-color: #3030E0; } -dl.test.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #3030E0; -} - dl.bug { margin-left: -7px; padding-left: 3px; @@ -1307,20 +1679,110 @@ dl.bug { border-color: #C08050; } -dl.bug.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #C08050; +*/ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.important, dl.note, dl.deprecated, dl.bug, +dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; } dl.section dd { - margin-bottom: 6px; + margin-bottom: 2px; +} + +dl.warning, dl.attention, dl.important { + background: var(--warning-color-bg); + border-left: 8px solid var(--warning-color-hl); + color: var(--warning-color-text); +} + +dl.warning dt, dl.attention dt, dl.important dt { + color: var(--warning-color-hl); +} + +dl.note, dl.remark { + background: var(--note-color-bg); + border-left: 8px solid var(--note-color-hl); + color: var(--note-color-text); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-hl); +} + +dl.todo { + background: var(--todo-color-bg); + border-left: 8px solid var(--todo-color-hl); + color: var(--todo-color-text); +} + +dl.todo dt { + color: var(--todo-color-hl); +} + +dl.test { + background: var(--test-color-bg); + border-left: 8px solid var(--test-color-hl); + color: var(--test-color-text); +} + +dl.test dt { + color: var(--test-color-hl); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.bug { + background: var(--bug-color-bg); + border-left: 8px solid var(--bug-color-hl); + color: var(--bug-color-text); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.deprecated { + background: var(--deprecated-color-bg); + border-left: 8px solid var(--deprecated-color-hl); + color: var(--deprecated-color-text); +} + +dl.deprecated dt a { + color: var(--deprecated-color-hl) !important; +} + +dl.note dd, dl.warning dd, dl.pre dd, dl.post dd, +dl.remark dd, dl.attention dd, dl.important dd, dl.invariant dd, +dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color-bg); + border-left: 8px solid var(--invariant-color-hl); + color: var(--invariant-color-text); } +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-hl); +} + + +#projectrow +{ + height: 56px; +} #projectlogo { @@ -1328,34 +1790,38 @@ dl.section dd { vertical-align: bottom; border-collapse: separate; } - + #projectlogo img -{ +{ border: 0px none; } - + #projectalign { vertical-align: middle; + padding-left: 0.5em; } #projectname { - font: 300% Tahoma, Arial,sans-serif; + font-size: 200%; + font-family: var(--font-family-title); margin: 0px; padding: 2px 0px; } - + #projectbrief { - font: 120% Tahoma, Arial,sans-serif; + font-size: 90%; + font-family: var(--font-family-title); margin: 0px; padding: 0px; } #projectnumber { - font: 50% Tahoma, Arial,sans-serif; + font-size: 50%; + font-family: 50% var(--font-family-title); margin: 0px; padding: 0px; } @@ -1365,7 +1831,8 @@ dl.section dd { padding: 0px; margin: 0px; width: 100%; - border-bottom: 1px solid #5373B4; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); } .image @@ -1398,17 +1865,12 @@ dl.section dd { font-weight: bold; } -div.zoom -{ - border: 1px solid #90A5CE; -} - dl.citelist { margin-bottom:50px; } dl.citelist dt { - color:#334975; + color:var(--citation-label-color); float:left; font-weight:bold; margin-right:10px; @@ -1424,8 +1886,8 @@ dl.citelist dd { div.toc { padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); border-radius: 7px 7px 7px 7px; float: right; height: auto; @@ -1433,28 +1895,17 @@ div.toc { width: 200px; } -.PageDocRTL-title div.toc { - float: left !important; - text-align: right; -} - div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); margin-top: 5px; padding-left: 10px; padding-top: 2px; } -.PageDocRTL-title div.toc li { - background-position-x: right !important; - padding-left: 0 !important; - padding-right: 10px; -} - div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); border-bottom: 0 none; margin: 0; } @@ -1463,22 +1914,19 @@ div.toc ul { list-style: none outside none; border: medium none; padding: 0px; -} - -div.toc li.level1 { - margin-left: 0px; } -div.toc li.level2 { +div.toc li[class^='level'] { margin-left: 15px; } -div.toc li.level3 { - margin-left: 30px; +div.toc li.level1 { + margin-left: 0px; } -div.toc li.level4 { - margin-left: 45px; +div.toc li.empty { + background-image: none; + margin-top: 0px; } span.emoji { @@ -1487,29 +1935,13 @@ span.emoji { */ } -.PageDocRTL-title div.toc li.level1 { - margin-left: 0 !important; - margin-right: 0; -} - -.PageDocRTL-title div.toc li.level2 { - margin-left: 0 !important; - margin-right: 15px; -} - -.PageDocRTL-title div.toc li.level3 { - margin-left: 0 !important; - margin-right: 30px; -} - -.PageDocRTL-title div.toc li.level4 { - margin-left: 0 !important; - margin-right: 45px; +span.obfuscator { + display: none; } .inherit_header { font-weight: bold; - color: gray; + color: var(--inherit-header-color); cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; @@ -1541,11 +1973,12 @@ tr.heading h2 { #powerTip { cursor: default; - white-space: nowrap; - background-color: white; - border: 1px solid gray; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); border-radius: 4px 4px 4px 4px; - box-shadow: 1px 1px 7px gray; + box-shadow: var(--tooltip-shadow); display: none; font-size: smaller; max-width: 80%; @@ -1556,7 +1989,7 @@ tr.heading h2 { } #powerTip div.ttdoc { - color: grey; + color: var(--tooltip-doc-color); font-style: italic; } @@ -1564,18 +1997,24 @@ tr.heading h2 { font-weight: bold; } +#powerTip a { + color: var(--tooltip-link-color); +} + #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { - color: #006318; + color: var(--tooltip-declaration-color); } #powerTip div { margin: 0px; padding: 0px; - font: 12px/16px Roboto,sans-serif; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; } #powerTip:before, #powerTip:after { @@ -1620,12 +2059,12 @@ tr.heading h2 { } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: #FFFFFF; + border-top-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } -#powerTip.n:before { - border-top-color: #808080; +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1648,13 +2087,13 @@ tr.heading h2 { } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: #FFFFFF; + border-bottom-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { - border-bottom-color: #808080; + border-bottom-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1675,13 +2114,13 @@ tr.heading h2 { left: 100%; } #powerTip.e:after { - border-left-color: #FFFFFF; + border-left-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { - border-left-color: #808080; + border-left-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1691,13 +2130,13 @@ tr.heading h2 { right: 100%; } #powerTip.w:after { - border-right-color: #FFFFFF; + border-right-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { - border-right-color: #808080; + border-right-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1731,7 +2170,7 @@ table.markdownTable { } table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } @@ -1739,8 +2178,8 @@ table.markdownTable tr { } th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; @@ -1758,36 +2197,33 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter { text-align: center } -.DocNodeRTL { - text-align: right; - direction: rtl; +tt, code, kbd, samp +{ + display: inline-block; } +/* @end */ -.DocNodeLTR { - text-align: left; - direction: ltr; +u { + text-decoration: underline; } -table.DocNodeRTL { - width: auto; - margin-right: 0; - margin-left: auto; +details>summary { + list-style-type: none; } -table.DocNodeLTR { - width: auto; - margin-right: auto; - margin-left: 0; +details > summary::-webkit-details-marker { + display: none; } -tt, code, kbd, samp -{ - display: inline-block; - direction:ltr; +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; } -/* @end */ -u { - text-decoration: underline; +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; } diff --git a/documents/html/doxygen.svg b/documents/html/doxygen.svg index d42dad5..79a7635 100644 --- a/documents/html/doxygen.svg +++ b/documents/html/doxygen.svg @@ -1,4 +1,6 @@ + @@ -17,7 +19,7 @@ - + diff --git a/documents/html/doxygen_crawl.html b/documents/html/doxygen_crawl.html new file mode 100644 index 0000000..be53b69 --- /dev/null +++ b/documents/html/doxygen_crawl.html @@ -0,0 +1,148 @@ + + + +Validator / crawler helper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documents/html/dynsections.js b/documents/html/dynsections.js index 88f2c27..8985f42 100644 --- a/documents/html/dynsections.js +++ b/documents/html/dynsections.js @@ -22,107 +22,184 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); +function toggleVisibility(linkObj) { + return dynsection.toggleVisibility(linkObj); } -function toggleLevel(level) -{ - $('table.directory tr').each(function() { - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; /* @license-end */ - -$(document).ready(function() { +$(function() { $('.code,.codeRef').each(function() { $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); + $.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ]; $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); }); }); diff --git a/documents/html/files.html b/documents/html/files.html index c83fa93..ff2ebae 100644 --- a/documents/html/files.html +++ b/documents/html/files.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: File List + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,25 +85,34 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
File List
+
File List
Here is a list of all documented files with brief descriptions:
- - - - - - - - +
[detail level 123]
 __init__.py
 __main__.py
 GPUOpenLoader.py
 GPUOpenLoaderCmd.py
 JsMaterialXPhysicallyBased.js
 physicallyBasedMaterialX.py
 physicallyBasedMaterialXCmd.py
+ + + + + + + + + +
  javascript
 JsMaterialXPhysicallyBased.js
  src
  materialxMaterials
 __init__.py
 __main__.py
 GPUOpenLoader.py
 GPUOpenLoaderCmd.py
 physicallyBasedMaterialX.py
 physicallyBasedMaterialXCmd.pyConvert Physically Based Materials to MaterialX Command Line Utility
@@ -104,7 +120,7 @@ diff --git a/documents/html/files_dup.js b/documents/html/files_dup.js index 25a4b72..02bdb7a 100644 --- a/documents/html/files_dup.js +++ b/documents/html/files_dup.js @@ -1,10 +1,5 @@ var files_dup = [ - [ "__init__.py", "____init_____8py_source.html", null ], - [ "__main__.py", "____main_____8py_source.html", null ], - [ "GPUOpenLoader.py", "_g_p_u_open_loader_8py_source.html", null ], - [ "GPUOpenLoaderCmd.py", "_g_p_u_open_loader_cmd_8py_source.html", null ], - [ "JsMaterialXPhysicallyBased.js", "_js_material_x_physically_based_8js_source.html", null ], - [ "physicallyBasedMaterialX.py", "physically_based_material_x_8py_source.html", null ], - [ "physicallyBasedMaterialXCmd.py", "physically_based_material_x_cmd_8py_source.html", null ] + [ "javascript", "dir_0e7a2bf207642fde32bb2644c27b5ffb.html", "dir_0e7a2bf207642fde32bb2644c27b5ffb" ], + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] ]; \ No newline at end of file diff --git a/documents/html/folderclosed.svg b/documents/html/folderclosed.svg new file mode 100644 index 0000000..b04bed2 --- /dev/null +++ b/documents/html/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/documents/html/folderclosedd.svg b/documents/html/folderclosedd.svg new file mode 100644 index 0000000..52f0166 --- /dev/null +++ b/documents/html/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/documents/html/folderopen.svg b/documents/html/folderopen.svg new file mode 100644 index 0000000..f6896dd --- /dev/null +++ b/documents/html/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/documents/html/folderopend.svg b/documents/html/folderopend.svg new file mode 100644 index 0000000..2d1f06e --- /dev/null +++ b/documents/html/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/documents/html/functions.html b/documents/html/functions.html index 25d0045..53ec0cc 100644 --- a/documents/html/functions.html +++ b/documents/html/functions.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Class Members + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,223 +85,136 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- _ -

diff --git a/documents/html/functions_func.html b/documents/html/functions_func.html index 11f2fb0..d876b22 100644 --- a/documents/html/functions_func.html +++ b/documents/html/functions_func.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Class Members - Functions + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,184 +85,115 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented functions with links to the class documentation for each member:
-

- _ -

diff --git a/documents/html/functions_vars.html b/documents/html/functions_vars.html index 8e7592a..3539024 100644 --- a/documents/html/functions_vars.html +++ b/documents/html/functions_vars.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: Class Members - Variables + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,47 +85,36 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/documents/html/index.html b/documents/html/index.html index 0e89fc8..df58d53 100644 --- a/documents/html/index.html +++ b/documents/html/index.html @@ -1,18 +1,20 @@ - + - - + + -MaterialXMaterials: Main Page +MaterialXMaterials: MaterialXMaterials + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,23 +85,31 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
-
MaterialXMaterials Documentation
+
+
MaterialXMaterials
-

+

MaterialX Materials

Introduction

Welcome to MaterialX Materials.
This site hosts a set of libraries and command line utilities to query remote databases for MaterialX materials.
-

Visit the Home Page

+

‍Visit the Home Page

+

Related utilities and libraries can be found at the: <button class="btn btn-outline-secondary"> MaterialXLab </button> home page.

+

-
Related utilities and libraries can be found at the: <button class="btn btn-outline-secondary"> MaterialXLab </button> home page.
The current utilities support:
PhysicallyBased database Material descriptions can be downloaded with additional utilities to create materials using either: Autodesk Standard Surface, OpenPBR, or glTF PBR shading model shaders.


+The current utilities support:

PhysicallyBased database Material descriptions can be downloaded with additional utilities to create materials using either: Autodesk Standard Surface, OpenPBR, or glTF PBR shading model shaders.


AMD GPUOpen database MaterialX packages can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.

Each currently has Python implementations.

An interactive page for extracting PhysicallyBased uses a Javascript implementation found here

Dependencies

The Python utilities require:
  1. The MaterialX 1.39 or greater package for PhysicallyBased OpenPBR shader creation
  2. @@ -106,18 +121,20 @@

    This will pull down the dependent packages as needed.

Usage

Commands

    -
  • Query all materials fom PhysicallyBased and convert them to all support shading models. Save the material list and corresponding MaterialX files in the default output location. The build will include this information Python package under the data folder.
  • -
-
python physicallyBasedMaterialXCmd.py
-
or
python -m materialxMaterials physbased
-
    -
  • Query all materials fom GPUOpen. Extract out a few material packages (zip). Save the material lists, material names and unzipped packages (MaterialX and images) in the default output location. The build will include this information Python package under the data folder.
  • +
  • Query all materials fom PhysicallyBased and convert them to all support shading models. Save the material list and corresponding MaterialX files in the default output location. The build will include this information Python package under the data folder.

    +
    python physicallyBasedMaterialXCmd.py
    +

    or

    +
    python -m materialxMaterials physbased
    +
  • +
  • Query all materials fom GPUOpen. Extract out a few material packages (zip). Save the material lists, material names and unzipped packages (MaterialX and images) in the default output location. The build will include this information Python package under the data folder.

    +
    python GPUOpenLoaderCmd.py --materialNames=1 --saveMaterials=1
    +

    or

    +
    python -m materialxMaterials gpuopen --materialNames=1 --saveMaterials=1
    +
-
python GPUOpenLoaderCmd.py --materialNames=1 --saveMaterials=1
-
or
python -m materialxMaterials gpuopen --materialNames=1 --saveMaterials=1
-

Library

+

Library

A Jupyter notebook demonstrates the direct usage of the Python library. The output of the notebook can be found here. The notebook can found in the Github repository under the examples folder.

Results

-
The following are some samples which have been rendered using the MaterialXView utility which is part of the MaterialX binary distribution.
Details about some examples can be found in the Examples pages
+
The following are some samples which have been rendered using the MaterialXViewer utility which is part of the MaterialX binary distribution.
Details about some examples can be found in the Examples pages
@@ -131,12 +148,13 @@

API Reference

The API reference can be found here
+ diff --git a/documents/html/jquery.js b/documents/html/jquery.js index 103c32d..875ada7 100644 --- a/documents/html/jquery.js +++ b/documents/html/jquery.js @@ -1,18 +1,143 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"
Emerald Peaks Wallpaper Indigo Palm Wallpaper Oliana Blue Painted Wood
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp( +"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType +}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c +)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){ +return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll( +":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id") +)&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push( +"\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test( +a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null, +null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne +).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for( +var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n; +return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0, +r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r] +,C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each( +function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r, +"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})} +),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each( +"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element -},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** +* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/resizable.js, widgets/mouse.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(y){"use strict";y.ui=y.ui||{};y.ui.version="1.13.2";var n,i=0,h=Array.prototype.hasOwnProperty,a=Array.prototype.slice;y.cleanData=(n=y.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=y._data(i,"events"))&&e.remove&&y(i).triggerHandler("remove");n(t)}),y.widget=function(t,i,e){var s,n,o,h={},a=t.split(".")[0],r=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=y.Widget),Array.isArray(e)&&(e=y.extend.apply(null,[{}].concat(e))),y.expr.pseudos[r.toLowerCase()]=function(t){return!!y.data(t,r)},y[a]=y[a]||{},s=y[a][t],n=y[a][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},y.extend(n,s,{version:e.version,_proto:y.extend({},e),_childConstructors:[]}),(o=new i).options=y.widget.extend({},o.options),y.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)} +function o(t){return i.prototype[e].apply(this,t)}h[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=y.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},h,{constructor:n,namespace:a,widgetName:t,widgetFullName:r}),s?(y.each(s._childConstructors,function(t,e){var i=e.prototype;y.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),y.widget.bridge(t,n),n},y.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t +){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t +]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i}, +getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within, +s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n
").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})), +this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t +).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split( +","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add( +this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{ +width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(), +!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){ +this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height +,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e, +i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left +)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e +){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0), +i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth( +)-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e, +function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0 +]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right-1){ +targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se", +"n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if( +session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)} +closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if( +session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE, +function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset); +tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList, +finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight())); +return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")} +function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(), +elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight, +viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + */!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b, +"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); +/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 * http://www.smartmenus.org/ - * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)), +mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend( +$.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy( +this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData( +"smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id" +).indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?( +this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for( +var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){ +return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if(( +!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&( +this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0 +]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass( +"highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){ +t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]" +)||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){ +t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"), +a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i, +downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2) +)&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t +)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0), +canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}}, +rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})} +return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1, +bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); diff --git a/documents/html/menu.js b/documents/html/menu.js index 2fe2214..0fd1e99 100644 --- a/documents/html/menu.js +++ b/documents/html/menu.js @@ -22,13 +22,20 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { +function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { function makeTree(data,relPath) { - var result=''; + let result=''; if ('children' in data) { result+='
    '; - for (var i in data.children) { - result+='
  • '+ + for (let i in data.children) { + let url; + const link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ data.children[i].text+''+ makeTree(data.children[i],relPath)+'
  • '; } @@ -36,15 +43,91 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + let searchBoxHtml; if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
  • '); + searchBoxHtml='
    '+ + '
    '+ + '
     '+ + ''+ + '
    '+ + '
    '+ + '
    '+ + '
    '; } else { - $('#main-menu').append('
  • '); + searchBoxHtml='
    '+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
    '; + } + } + + $('#main-nav').before('
    '+ + ''+ + ''+ + '
    '); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
  • '); + } + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; + if ($mainMenuState.length) { + const initResizableIfExists = function() { + if (typeof initResizable==='function') initResizable(treeview); + } + // animate mobile menu + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = () => $menu.css('display', 'block'); + $menu.hide().slideDown(options); + } else { + options['complete'] = () => $menu.css('display', 'none'); + $menu.show().slideUp(options); + } + }); + // set default menu visibility + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); } $('#main-menu').smartmenus(); } diff --git a/documents/html/menudata.js b/documents/html/menudata.js index f3f143b..fbdff7e 100644 --- a/documents/html/menudata.js +++ b/documents/html/menudata.js @@ -25,7 +25,7 @@ var menudata={children:[ {text:"Main Page",url:"index.html"}, {text:"Packages",url:"namespaces.html",children:[ -{text:"Packages",url:"namespaces.html"}]}, +{text:"Package List",url:"namespaces.html"}]}, {text:"Classes",url:"annotated.html",children:[ {text:"Class List",url:"annotated.html"}, {text:"Class Index",url:"classes.html"}, diff --git a/documents/html/minus.svg b/documents/html/minus.svg new file mode 100644 index 0000000..f70d0c1 --- /dev/null +++ b/documents/html/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/documents/html/minusd.svg b/documents/html/minusd.svg new file mode 100644 index 0000000..5f8e879 --- /dev/null +++ b/documents/html/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/documents/html/namespacematerialx_materials_1_1_g_p_u_open_loader.html b/documents/html/namespacematerialx_materials_1_1_g_p_u_open_loader.html index 4b7695b..6a75cf5 100644 --- a/documents/html/namespacematerialx_materials_1_1_g_p_u_open_loader.html +++ b/documents/html/namespacematerialx_materials_1_1_g_p_u_open_loader.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: materialxMaterials.GPUOpenLoader Namespace Reference + - + + @@ -24,10 +26,9 @@
    - - + @@ -36,21 +37,27 @@
    -
    MaterialXMaterials -  0.0.1 +
    +
    MaterialXMaterials 0.0.1
    Utilities for retrieving materials from remote servers
    - + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,23 +85,29 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.GPUOpenLoader Namespace Reference
+
materialxMaterials.GPUOpenLoader Namespace Reference

Utilities to extract materials from the GPUOpen material database. -More...

+More...

- @@ -110,7 +123,7 @@ diff --git a/documents/html/namespacematerialx_materials_1_1physically_based_material_x.html b/documents/html/namespacematerialx_materials_1_1physically_based_material_x.html index 7eaf337..bc400cc 100644 --- a/documents/html/namespacematerialx_materials_1_1physically_based_material_x.html +++ b/documents/html/namespacematerialx_materials_1_1physically_based_material_x.html @@ -1,18 +1,20 @@ - + - - + +MaterialXMaterials: materialxMaterials.physicallyBasedMaterialX Namespace Reference + - + + @@ -24,10 +26,9 @@

+

Classes

class  GPUOpenMaterialLoader
 This class is used to load materials from the GPUOpen material database. More...
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,23 +85,29 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
materialxMaterials.physicallyBasedMaterialX Namespace Reference
+
materialxMaterials.physicallyBasedMaterialX Namespace Reference

Class to load Physically Based Materials from the PhysicallyBased site. -More...

+More...

- @@ -109,7 +122,7 @@ diff --git a/documents/html/namespaces.html b/documents/html/namespaces.html index 182900e..4e59070 100644 --- a/documents/html/namespaces.html +++ b/documents/html/namespaces.html @@ -1,18 +1,20 @@ - + - - + + -MaterialXMaterials: Packages +MaterialXMaterials: Package List + - + + @@ -24,10 +26,9 @@

+

Classes

class  PhysicallyBasedMaterialLoader
 Class to load Physically Based Materials from the PhysicallyBased site. More...
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,26 +85,27 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Packages
+
Package List
Here are the packages with brief descriptions (if available):
-
[detail level 123]
- - - - - - - - +
[detail level 12]
 NmaterialxMaterials
 N__main__
 NGPUOpenLoaderUtilities to extract materials from the GPUOpen material database
 CGPUOpenMaterialLoaderThis class is used to load materials from the GPUOpen material database
 NGPUOpenLoaderCmd
 NphysicallyBasedMaterialXClass to load Physically Based Materials from the PhysicallyBased site
 CPhysicallyBasedMaterialLoaderClass to load Physically Based Materials from the PhysicallyBased site
 NphysicallyBasedMaterialXCmd
+ + +
 NmaterialxMaterials
 NGPUOpenLoaderUtilities to extract materials from the GPUOpen material database
 NphysicallyBasedMaterialXClass to load Physically Based Materials from the PhysicallyBased site
@@ -105,7 +113,7 @@ diff --git a/documents/html/namespaces_dup.js b/documents/html/namespaces_dup.js index 8e94be5..b11bc82 100644 --- a/documents/html/namespaces_dup.js +++ b/documents/html/namespaces_dup.js @@ -1,17 +1,7 @@ var namespaces_dup = [ [ "materialxMaterials", null, [ - [ "__main__", null, [ - [ "main", "____main_____8py.html#acd7f5fefcd7146c6dd868607d85c04f7", null ] - ] ], [ "GPUOpenLoader", "namespacematerialx_materials_1_1_g_p_u_open_loader.html", "namespacematerialx_materials_1_1_g_p_u_open_loader" ], - [ "GPUOpenLoaderCmd", null, [ - [ "GPUOpenLoaderCmd", "_g_p_u_open_loader_cmd_8py.html#acba9ba30ffec65ce6e1120f01a32b4b1", null ] - ] ], - [ "physicallyBasedMaterialX", "namespacematerialx_materials_1_1physically_based_material_x.html", "namespacematerialx_materials_1_1physically_based_material_x" ], - [ "physicallyBasedMaterialXCmd", null, [ - [ "physicallBasedMaterialXCmd", "physically_based_material_x_cmd_8py.html#a962926b309ce16afa06401e2549c4f77", null ] - ] ], - [ "__version__", "____init_____8py.html#a0a3e35178588ad1393c61d4b0b4952d3", null ] + [ "physicallyBasedMaterialX", "namespacematerialx_materials_1_1physically_based_material_x.html", "namespacematerialx_materials_1_1physically_based_material_x" ] ] ] ]; \ No newline at end of file diff --git a/documents/html/navtree.css b/documents/html/navtree.css index 33341a6..69211d4 100644 --- a/documents/html/navtree.css +++ b/documents/html/navtree.css @@ -22,8 +22,13 @@ #nav-tree .selected { background-image: url('tab_a.png'); background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + color: var(--nav-text-active-color); + text-shadow: var(--nav-text-active-shadow); +} + +#nav-tree .selected .arrow { + color: var(--nav-arrow-selected-color); + text-shadow: none; } #nav-tree img { @@ -37,13 +42,12 @@ text-decoration:none; padding:0px; margin:0px; - outline:none; } #nav-tree .label { margin:0px; padding:0px; - font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + font: 12px var(--font-family-nav); } #nav-tree .label a { @@ -52,7 +56,7 @@ #nav-tree .selected a { text-decoration:none; - color:#fff; + color:var(--nav-text-active-color); } #nav-tree .children_ul { @@ -67,7 +71,6 @@ #nav-tree { padding: 0px 0px; - background-color: #FAFAFF; font-size:14px; overflow:auto; } @@ -86,7 +89,8 @@ display:block; position: absolute; left: 0px; - width: 250px; + width: $width; + overflow : hidden; } .ui-resizable .ui-resizable-handle { @@ -94,7 +98,7 @@ } .ui-resizable-e { - background-image:url("splitbar.png"); + background-image:var(--nav-splitbar-image); background-size:100%; background-repeat:repeat-y; background-attachment: scroll; @@ -117,9 +121,8 @@ } #nav-tree { - background-image:url('nav_h.png'); background-repeat:repeat-x; - background-color: #F9FAFC; + background-color: var(--nav-background-color); -webkit-overflow-scrolling : touch; /* iOS 5+ */ } diff --git a/documents/html/navtree.js b/documents/html/navtree.js index 1e272d3..9027ce6 100644 --- a/documents/html/navtree.js +++ b/documents/html/navtree.js @@ -22,525 +22,462 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -var navTreeSubIndices = new Array(); -var arrowDown = '▼'; -var arrowRight = '►'; - -function getData(varName) -{ - var i = varName.lastIndexOf('/'); - var n = i>=0 ? varName.substring(i+1) : varName; - return eval(n.replace(/\-/g,'_')); -} -function stripPath(uri) -{ - return uri.substring(uri.lastIndexOf('/')+1); -} +function initNavTree(toroot,relpath) { + let navTreeSubIndices = []; + const ARROW_DOWN = '▼'; + const ARROW_RIGHT = '►'; + const NAVPATH_COOKIE_NAME = ''+'navpath'; -function stripPath2(uri) -{ - var i = uri.lastIndexOf('/'); - var s = uri.substring(i+1); - var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); - return m ? uri.substring(i-6) : s; -} + const getData = function(varName) { + const i = varName.lastIndexOf('/'); + const n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/-/g,'_')); + } -function hashValue() -{ - return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); -} + const stripPath = function(uri) { + return uri.substring(uri.lastIndexOf('/')+1); + } -function hashUrl() -{ - return '#'+hashValue(); -} + const stripPath2 = function(uri) { + const i = uri.lastIndexOf('/'); + const s = uri.substring(i+1); + const m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; + } -function pathName() -{ - return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); -} + const hashValue = function() { + return $(location).attr('hash').substring(1).replace(/[^\w-]/g,''); + } -function localStorageSupported() -{ - try { - return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + const hashUrl = function() { + return '#'+hashValue(); } - catch(e) { - return false; + + const pathName = function() { + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]/g, ''); } -} -function storeLink(link) -{ - if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { - window.localStorage.setItem('navpath',link); + const storeLink = function(link) { + if (!$("#nav-sync").hasClass('sync')) { + Cookie.writeSetting(NAVPATH_COOKIE_NAME,link,0); + } } -} -function deleteLink() -{ - if (localStorageSupported()) { - window.localStorage.setItem('navpath',''); + const deleteLink = function() { + Cookie.eraseSetting(NAVPATH_COOKIE_NAME); } -} -function cachedLink() -{ - if (localStorageSupported()) { - return window.localStorage.getItem('navpath'); - } else { - return ''; + const cachedLink = function() { + return Cookie.readSetting(NAVPATH_COOKIE_NAME,''); } -} -function getScript(scriptName,func,show) -{ - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement('script'); - script.id = scriptName; - script.type = 'text/javascript'; - script.onload = func; - script.src = scriptName+'.js'; - head.appendChild(script); -} + const getScript = function(scriptName,func) { + const head = document.getElementsByTagName("head")[0]; + const script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); + } -function createIndent(o,domNode,node,level) -{ - var level=-1; - var n = node; - while (n.parentNode) { level++; n=n.parentNode; } - if (node.childrenData) { - var imgNode = document.createElement("span"); - imgNode.className = 'arrow'; - imgNode.style.paddingLeft=(16*level).toString()+'px'; - imgNode.innerHTML=arrowRight; - node.plus_img = imgNode; - node.expandToggle = document.createElement("a"); - node.expandToggle.href = "javascript:void(0)"; - node.expandToggle.onclick = function() { - if (node.expanded) { - $(node.getChildrenUL()).slideUp("fast"); - node.plus_img.innerHTML=arrowRight; - node.expanded = false; - } else { - expandNode(o, node, false, false); + const createIndent = function(o,domNode,node) { + let level=-1; + let n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + const imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=ARROW_RIGHT; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=ARROW_RIGHT; + node.expanded = false; + } else { + expandNode(o, node, false, true); + } } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + let span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); } - node.expandToggle.appendChild(imgNode); - domNode.appendChild(node.expandToggle); - } else { - var span = document.createElement("span"); - span.className = 'arrow'; - span.style.width = 16*(level+1)+'px'; - span.innerHTML = ' '; - domNode.appendChild(span); } -} -var animationInProgress = false; - -function gotoAnchor(anchor,aname,updateLocation) -{ - var pos, docContent = $('#doc-content'); - var ancParent = $(anchor.parent()); - if (ancParent.hasClass('memItemLeft') || - ancParent.hasClass('memtitle') || - ancParent.hasClass('fieldname') || - ancParent.hasClass('fieldtype') || - ancParent.is(':header')) - { - pos = ancParent.position().top; - } else if (anchor.position()) { - pos = anchor.position().top; - } - if (pos) { - var dist = Math.abs(Math.min( - pos-docContent.offset().top, - docContent[0].scrollHeight- - docContent.height()-docContent.scrollTop())); - animationInProgress=true; - docContent.animate({ - scrollTop: pos + docContent.scrollTop() - docContent.offset().top - },Math.max(50,Math.min(500,dist)),function(){ - if (updateLocation) window.location.href=aname; - animationInProgress=false; - }); - } -} - -function newNode(o, po, text, link, childrenData, lastNode) -{ - var node = new Object(); - node.children = Array(); - node.childrenData = childrenData; - node.depth = po.depth + 1; - node.relpath = po.relpath; - node.isLast = lastNode; - - node.li = document.createElement("li"); - po.getChildrenUL().appendChild(node.li); - node.parentNode = po; - - node.itemDiv = document.createElement("div"); - node.itemDiv.className = "item"; - - node.labelSpan = document.createElement("span"); - node.labelSpan.className = "label"; - - createIndent(o,node.itemDiv,node,0); - node.itemDiv.appendChild(node.labelSpan); - node.li.appendChild(node.itemDiv); - - var a = document.createElement("a"); - node.labelSpan.appendChild(a); - node.label = document.createTextNode(text); - node.expanded = false; - a.appendChild(node.label); - if (link) { - var url; - if (link.substring(0,1)=='^') { - url = link.substring(1); - link = url; - } else { - url = node.relpath+link; + let animationInProgress = false; + + const gotoAnchor = function(anchor,aname) { + let pos, docContent = $('#doc-content'); + let ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || ancParent.hasClass('fieldtype') || + ancParent.is(':header')) { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; } - a.className = stripPath(link.replace('#',':')); - if (link.indexOf('#')!=-1) { - var aname = '#'+link.split('#')[1]; - var srcPage = stripPath(pathName()); - var targetPage = stripPath(link.split('#')[0]); - a.href = srcPage!=targetPage ? url : "javascript:void(0)"; - a.onclick = function(){ - storeLink(link); - if (!$(a).parent().parent().hasClass('selected')) - { - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - $(a).parent().parent().addClass('selected'); - $(a).parent().parent().attr('id','selected'); + if (pos) { + const dcOffset = docContent.offset().top; + const dcHeight = docContent.height(); + const dcScrHeight = docContent[0].scrollHeight + const dcScrTop = docContent.scrollTop(); + let dist = Math.abs(Math.min(pos-dcOffset,dcScrHeight-dcHeight-dcScrTop)); + animationInProgress = true; + docContent.animate({ + scrollTop: pos + dcScrTop - dcOffset + },Math.max(50,Math.min(500,dist)),function() { + animationInProgress=false; + if (anchor.parent().attr('class')=='memItemLeft') { + let rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname') { + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype') { + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member } - var anchor = $(aname); - gotoAnchor(anchor,aname,true); - }; - } else { - a.href = url; - a.onclick = function() { storeLink(link); } + }); } - } else { - if (childrenData != null) - { + } + + const newNode = function(o, po, text, link, childrenData, lastNode) { + const node = { + children : [], + childrenData : childrenData, + depth : po.depth + 1, + relpath : po.relpath, + isLast : lastNode, + li : document.createElement("li"), + parentNode : po, + itemDiv : document.createElement("div"), + labelSpan : document.createElement("span"), + label : document.createTextNode(text), + expanded : false, + childrenUL : null, + getChildrenUL : function() { + if (!this.childrenUL) { + this.childrenUL = document.createElement("ul"); + this.childrenUL.className = "children_ul"; + this.childrenUL.style.display = "none"; + this.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }, + }; + + node.itemDiv.className = "item"; + node.labelSpan.className = "label"; + createIndent(o,node.itemDiv,node); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + const a = document.createElement("a"); + node.labelSpan.appendChild(a); + po.getChildrenUL().appendChild(node.li); + a.appendChild(node.label); + if (link) { + let url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + const aname = '#'+link.split('#')[1]; + const srcPage = stripPath(pathName()); + const targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : aname; + a.onclick = function() { + storeLink(link); + aPPar = $(a).parent().parent(); + if (!aPPar.hasClass('selected')) { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + aPPar.addClass('selected'); + aPPar.attr('id','selected'); + } + const anchor = $(aname); + gotoAnchor(anchor,aname); + }; + } else { + a.href = url; + a.onclick = () => storeLink(link); + } + } else if (childrenData != null) { a.className = "nolink"; a.href = "javascript:void(0)"; a.onclick = node.expandToggle.onclick; } + return node; } - node.childrenUL = null; - node.getChildrenUL = function() { - if (!node.childrenUL) { - node.childrenUL = document.createElement("ul"); - node.childrenUL.className = "children_ul"; - node.childrenUL.style.display = "none"; - node.li.appendChild(node.childrenUL); - } - return node.childrenUL; - }; - - return node; -} - -function showRoot() -{ - var headerHeight = $("#top").height(); - var footerHeight = $("#nav-path").height(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - (function (){ // retry until we can scroll to the selected item - try { - var navtree=$('#nav-tree'); - navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); - } catch (err) { - setTimeout(arguments.callee, 0); - } - })(); -} + const showRoot = function() { + const headerHeight = $("#top").height(); + const footerHeight = $("#nav-path").height(); + const windowHeight = $(window).height() - headerHeight - footerHeight; + (function() { // retry until we can scroll to the selected item + try { + const navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); + } -function expandNode(o, node, imm, showRoot) -{ - if (node.childrenData && !node.expanded) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - expandNode(o, node, imm, showRoot); - }, showRoot); - } else { - if (!node.childrenVisited) { - getNode(o, node); + const expandNode = function(o, node, imm, setFocus) { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = ARROW_DOWN; + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } } - $(node.getChildrenUL()).slideDown("fast"); - node.plus_img.innerHTML = arrowDown; - node.expanded = true; } } -} -function glowEffect(n,duration) -{ - n.addClass('glow').delay(duration).queue(function(next){ - $(this).removeClass('glow');next(); - }); -} - -function highlightAnchor() -{ - var aname = hashUrl(); - var anchor = $(aname); - if (anchor.parent().attr('class')=='memItemLeft'){ - var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); - glowEffect(rows.children(),300); // member without details - } else if (anchor.parent().attr('class')=='fieldname'){ - glowEffect(anchor.parent().parent(),1000); // enum value - } else if (anchor.parent().attr('class')=='fieldtype'){ - glowEffect(anchor.parent().parent(),1000); // struct field - } else if (anchor.parent().is(":header")) { - glowEffect(anchor.parent(),1000); // section header - } else { - glowEffect(anchor.next(),1000); // normal member + const glowEffect = function(n,duration) { + n.addClass('glow').delay(duration).queue(function(next) { + $(this).removeClass('glow');next(); + }); } -} -function selectAndHighlight(hash,n) -{ - var a; - if (hash) { - var link=stripPath(pathName())+':'+hash.substring(1); - a=$('.item a[class$="'+link+'"]'); + const highlightAnchor = function() { + const aname = hashUrl(); + const anchor = $(aname); + gotoAnchor(anchor,aname); } - if (a && a.length) { - a.parent().parent().addClass('selected'); - a.parent().parent().attr('id','selected'); - highlightAnchor(); - } else if (n) { - $(n.itemDiv).addClass('selected'); - $(n.itemDiv).attr('id','selected'); - } - if ($('#nav-tree-contents .item:first').hasClass('selected')) { - $('#nav-sync').css('top','30px'); - } else { - $('#nav-sync').css('top','5px'); + + const selectAndHighlight = function(hash,n) { + let a; + if (hash) { + const link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + let topOffset=5; + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); } - showRoot(); -} -function showNode(o, node, index, hash) -{ - if (node && node.childrenData) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - showNode(o,node,index,hash); - },true); - } else { - if (!node.childrenVisited) { - getNode(o, node); - } - $(node.getChildrenUL()).css({'display':'block'}); - node.plus_img.innerHTML = arrowDown; - node.expanded = true; - var n = node.children[o.breadcrumbs[index]]; - if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); - else hash=''; + const getNode = function(o, po) { + const insertFunction = removeToInsertLater(po.li); + po.childrenVisited = true; + const l = po.childrenData.length-1; + for (let i in po.childrenData) { + const nodeData = po.childrenData[i]; + po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2], i==l); + } + insertFunction(); } - if (hash.match(/^#l\d+$/)) { - var anchor=$('a[name='+hash.substring(1)+']'); - glowEffect(anchor.parent(),1000); // line number - hash=''; // strip line number anchors + + const gotoNode = function(o,subIndex,root,hash,relpath) { + const nti = navTreeSubIndices[subIndex][root+hash]; + o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]); + if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index + navTo(o,NAVTREE[0][1],"",relpath); + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + } + if (o.breadcrumbs) { + o.breadcrumbs.unshift(0); // add 0 for root node + showNode(o, o.node, 0, hash); + } } - var url=root+hash; - var i=-1; - while (NAVTREEINDEX[i+1]<=url) i++; - if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath) - } else { - getScript(relpath+'navtreeindex'+i,function(){ - navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath); - } - },true); + + const navTo = function(o,root,hash,relpath) { + const link = cachedLink(); + if (link) { + const parts = link.split('#'); + root = parts[0]; + hash = parts.length>1 ? '#'+parts[1].replace(/[^\w-]/g,'') : ''; + } + if (hash.match(/^#l\d+$/)) { + const anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + const url=root+hash; + let i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function() { + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } } -} -function showSyncOff(n,relpath) -{ + const showSyncOff = function(n,relpath) { n.html(''); -} + } -function showSyncOn(n,relpath) -{ + const showSyncOn = function(n,relpath) { n.html(''); -} + } -function toggleSyncButton(relpath) -{ - var navSync = $('#nav-sync'); - if (navSync.hasClass('sync')) { - navSync.removeClass('sync'); + const o = { + toroot : toroot, + node : { + childrenData : NAVTREE, + children : [], + childrenUL : document.createElement("ul"), + getChildrenUL : function() { return this.childrenUL }, + li : document.getElementById("nav-tree-contents"), + depth : 0, + relpath : relpath, + expanded : false, + isLast : true, + plus_img : document.createElement("span"), + }, + }; + o.node.li.appendChild(o.node.childrenUL); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = ARROW_RIGHT; + + const navSync = $('#nav-sync'); + if (cachedLink()) { showSyncOff(navSync,relpath); - storeLink(stripPath2(pathName())+hashUrl()); + navSync.removeClass('sync'); } else { - navSync.addClass('sync'); showSyncOn(navSync,relpath); - deleteLink(); - } -} - -var loadTriggered = false; -var readyTriggered = false; -var loadObject,loadToRoot,loadUrl,loadRelPath; - -$(window).on('load',function(){ - if (readyTriggered) { // ready first - navTo(loadObject,loadToRoot,loadUrl,loadRelPath); - showRoot(); } - loadTriggered=true; -}); - -function initNavTree(toroot,relpath) -{ - var o = new Object(); - o.toroot = toroot; - o.node = new Object(); - o.node.li = document.getElementById("nav-tree-contents"); - o.node.childrenData = NAVTREE; - o.node.children = new Array(); - o.node.childrenUL = document.createElement("ul"); - o.node.getChildrenUL = function() { return o.node.childrenUL; }; - o.node.li.appendChild(o.node.childrenUL); - o.node.depth = 0; - o.node.relpath = relpath; - o.node.expanded = false; - o.node.isLast = true; - o.node.plus_img = document.createElement("span"); - o.node.plus_img.className = 'arrow'; - o.node.plus_img.innerHTML = arrowRight; - if (localStorageSupported()) { - var navSync = $('#nav-sync'); - if (cachedLink()) { - showSyncOff(navSync,relpath); + navSync.click(() => { + const navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); } else { + navSync.addClass('sync'); showSyncOn(navSync,relpath); + deleteLink(); } - navSync.click(function(){ toggleSyncButton(relpath); }); - } + }); - if (loadTriggered) { // load before ready - navTo(o,toroot,hashUrl(),relpath); - showRoot(); - } else { // ready before load - loadObject = o; - loadToRoot = toroot; - loadUrl = hashUrl(); - loadRelPath = relpath; - readyTriggered=true; - } + navTo(o,toroot,hashUrl(),relpath); + showRoot(); - $(window).bind('hashchange', function(){ - if (window.location.hash && window.location.hash.length>1){ - var a; - if ($(location).attr('hash')){ - var clslink=stripPath(pathName())+':'+hashValue(); - a=$('.item a[class$="'+clslink.replace(/ { + if (!animationInProgress) { + if (window.location.hash && window.location.hash.length>1) { + let a; + if ($(location).attr('hash')) { + const clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ - + - - + + MaterialXMaterials: physicallyBasedMaterialX.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,472 +85,519 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
physicallyBasedMaterialX.py
+
physicallyBasedMaterialX.py
-
1 '''
-
2 @brief Class to load Physically Based Materials from the PhysicallyBased site.
-
3 and convert the materials to MaterialX format for given target shading models.
-
4 '''
-
5 
-
6 import requests, json, os, inspect
-
7 import logging as lg
-
8 from http import HTTPStatus
-
9 import MaterialX as mx
-
10 
- -
12  '''
-
13  @brief Class to load Physically Based Materials from the PhysicallyBased site.
-
14  The class can convert the materials to MaterialX format for given target shading models.
-
15  '''
-
16  def __init__(self, mx_module, mx_stdlib : mx.Document = None):
-
17  '''
-
18  @brief Constructor for the PhysicallyBasedMaterialLoader class.
-
19  Will initialize shader mappings and load the MaterialX standard library
-
20  if it is not passed in as an argument.
-
21  @param mx_module The MaterialX module. Required.
-
22  @param mx_stdlib The MaterialX standard library. Optional.
-
23  '''
-
24  self.loggerlogger = lg.getLogger('PBMXLoader')
-
25  lg.basicConfig(level=lg.INFO)
-
26 
-
27  self.materialsmaterials = {}
-
28  self.materialNamesmaterialNames = []
-
29  self.uriuri = 'https://api.physicallybased.info/materials'
-
30  self.docdoc = None
-
31  self.mxmx = mx_module
-
32  self.stdlibstdlib = mx_stdlib
-
33  self.MTLX_NODE_NAME_ATTRIBUTEMTLX_NODE_NAME_ATTRIBUTE = 'nodename'
-
34  self.support_openpbrsupport_openpbr = False
-
35 
-
36  if not mx_module:
-
37  self.loggerlogger.critical(f'> {self._getMethodName()}: MaterialX module not specified.')
-
38  return
-
39 
-
40  # Check for OpenPBR support which is only available in 1.39 and above
-
41  version_major, version_minor, version_patch = self.mxmx.getVersionIntegers()
-
42  self.loggerlogger.debug(f'> MaterialX version: {version_major}.{version_minor}.{version_patch}')
-
43  if (version_major >=1 and version_minor >= 39) or version_major > 1:
-
44  self.loggerlogger.debug('> OpenPBR shading model supported')
-
45  self.support_openpbrsupport_openpbr = True
-
46 
-
47  self.initializeInputRemappinginitializeInputRemapping()
-
48 
-
49  # Load the MaterialX standard library if not provided
-
50  if not self.stdlibstdlib:
-
51  self.stdlibstdlib = self.mxmx.createDocument()
-
52  libFiles = self.mxmx.loadLibraries(mx.getDefaultDataLibraryFolders(), mx.getDefaultDataSearchPath(), self.stdlibstdlib)
-
53  self.loggerlogger.debug(f'> Loaded standard library: {libFiles}')
-
54 
-
55  def setDebugging(self, debug=True):
-
56  '''
-
57  @brief Set the debugging level for the logger.
-
58  @param debug True to set the logger to debug level, otherwise False.
-
59  @return None
-
60  '''
-
61  if debug:
-
62  self.loggerlogger.setLevel(lg.DEBUG)
-
63  else:
-
64  self.loggerlogger.setLevel(lg.INFO)
-
65 
-
66  def getInputRemapping(self, shadingModel) -> dict:
-
67  '''
-
68  @brief Get the remapping keys for a given shading model.
-
69  @param shadingModel The shading model to get the remapping keys for.
-
70  @return A dictionary of remapping keys.
-
71  '''
-
72  if (shadingModel in self.remapMapremapMap):
-
73  return self.remapMapremapMap[shadingModel]
-
74 
-
75  self.loggerlogger.warn(f'> No remapping keys found for shading model: {shadingModel}')
-
76  return {}
-
77 
- -
79  '''
-
80  @brief Initialize remapping keys for different shading models.
-
81  The currently supported shading models are:
-
82  - standard_surface
-
83  - open_pbr_surface
-
84  - gltf_pbr
-
85  @return None
-
86  '''
-
87  # Remap keys for Autodesk Standard Surface shading model.
-
88  standard_surface_remapKeys = {
-
89  'color': 'base_color',
-
90  'specularColor': 'specular_color',
-
91  'roughness': 'specular_roughness',
-
92  #'metalness': 'metalness',
-
93  'ior': 'specular_IOR',
-
94  #'transmission': 'transmission',
-
95  'transmission_color': 'transmission_color',
-
96  'thinFilmIor' : 'thin_film_IOR',
-
97  'thinFilmThickness' : 'thin_film_thickness',
-
98  'transmissionDispersion' : 'transmission_dispersion',
-
99  }
-
100  # Remap keys for OpenPBR shading model.
-
101  # Q: When to set geometry_thin_walled to true?
-
102  openpbr_remapKeys = {
-
103  'color': 'base_color',
-
104  'specularColor': 'specular_color',
-
105  'roughness': 'specular_roughness', # 'base_diffuse_roughness',
-
106  'metalness': 'base_metalness',
-
107  'ior': 'specular_ior',
-
108  'transmission': 'transmission_weight',
-
109  'transmission_color': 'transmission_color',
-
110  'subsurfaceRadius': 'subsurface_radius',
-
111  'thinFilmIor' : 'thin_film_ior',
-
112  'thinFilmThickness' : 'thin_film_thickness',
-
113  'transmissionDispersion' : 'transmission_dispersion_scale',
-
114  }
-
115  # Remap keys for Khronos glTF shading model.
-
116  gltf_remapKeys = {
-
117  'color': 'base_color',
-
118  'specularColor': 'specular_color',
-
119  'roughness': 'roughness',
-
120  'metalness': 'metallic',
-
121  'transmission_color': 'attenuation_color',
-
122  #'ior': 'ior',
-
123  #'transmission': 'transmission',
-
124  }
-
125 
-
126  self.remapMapremapMap = {}
-
127  self.remapMapremapMap['standard_surface'] = standard_surface_remapKeys;
-
128  self.remapMapremapMap['gltf_pbr'] = gltf_remapKeys;
-
129  if self.support_openpbrsupport_openpbr:
-
130  self.remapMapremapMap['open_pbr_surface'] = openpbr_remapKeys;
-
131 
-
132  def getJSON(self) -> dict:
-
133  ''' Get the JSON object representing the Physically Based Materials '''
-
134  return self.materialsmaterials
-
135 
-
136  def getJSONMaterialNames(self) -> list:
-
137  '''
-
138  Get the list of material names from the JSON object
-
139  @return The list of material names
-
140  '''
-
141  return self.materialNamesmaterialNames
-
142 
-
143  def getMaterialXDocument(self) -> mx.Document:
-
144  '''
-
145  Get the MaterialX document
-
146  @return The MaterialX document
-
147  '''
-
148  return self.docdoc
-
149 
-
150  def loadMaterialsFromFile(self, fileName) -> dict:
-
151  '''
-
152  @brief Load the Physically Based Materials from a JSON file
-
153  @param fileName The filename to load the JSON file from
-
154  @return The JSON object representing the Physically Based Materials
-
155  '''
-
156  self.materialsmaterials = None
-
157  self.materialNamesmaterialNames = []
-
158  if not os.path.exists(fileName):
-
159  self.loggerlogger.error(f'> File does not exist: {fileName}')
-
160  return None
-
161 
-
162  with open(fileName, 'r') as json_file:
-
163  self.materialsmaterials = json.load(json_file)
-
164  for mat in self.materialsmaterials:
-
165  self.materialNamesmaterialNames.append(mat['name'])
-
166 
-
167  return self.materialsmaterials
-
168 
-
169  def loadMaterialsFromString(self, matString) -> dict:
-
170  '''
-
171  @brief Load the Physically Based Materials from a JSON string
-
172  @param matString The JSON string to load the Physically Based Materials from
-
173  @return The JSON object representing the Physically Based Materials
-
174  '''
-
175  self.materialsmaterials = None
-
176  self.materialNamesmaterialNames = []
-
177  self.materialsmaterials = json.loads(matString)
-
178  for mat in self.materialsmaterials:
-
179  self.materialNamesmaterialNames.append(mat['name'])
-
180 
-
181  return self.materialsmaterials
-
182 
-
183  def getMaterialsFromURL(self) -> dict:
-
184  '''
-
185  @brief Get the Physically Based Materials from the PhysicallyBased site
-
186  @return The JSON object representing the Physically Based Materials
-
187  '''
-
188 
-
189  self.materialsmaterials = None
-
190  self.materialNamesmaterialNames = []
-
191  url = self.uriuri
-
192  headers = {
-
193  'Accept': 'application/json'
-
194  }
-
195 
-
196  response = requests.get(url, headers=headers)
-
197 
-
198  if response.status_code == HTTPStatus.OK:
-
199  self.materialsmaterials = response.json()
-
200  for mat in self.materialsmaterials:
-
201  self.materialNamesmaterialNames.append(mat['name'])
-
202 
-
203  else:
-
204  self.loggerlogger.error(f'> Status: {response.status_code}, {response.text}')
-
205 
-
206  return self.materialsmaterials
-
207 
-
208  def printMaterials(self):
-
209  '''
-
210  @brief Print the materials to the console
-
211  @return None
-
212  '''
-
213  for mat in self.materialsmaterials:
-
214  self.loggerlogger.info('Material name: ' + mat['name'])
-
215  # Print out each key and value
-
216  for key, value in mat.items():
-
217  if (key != 'name' and value):
-
218  self.loggerlogger.info(f'> - {key}: {value}')
-
219 
-
220  def writeJSONToFile(self, filename):
-
221  '''
-
222  @brief Write the materials to a JSON file
-
223  @param filename The filename to write the JSON file to
-
224  @return True if the file was written successfully, otherwise False
-
225  '''
-
226  if not self.materialsmaterials:
-
227  self.loggerlogger.warning('No materials to write')
-
228  return False
-
229 
-
230  with open(filename, 'w') as json_file:
-
231  json.dump(self.materialsmaterials, json_file, indent=4)
-
232  return True
-
233 
-
234  return False
-
235 
-
236  @staticmethod
-
237  def skipLibraryElement(elem) -> bool:
-
238  '''
-
239  @brief Utility to skip library elements when iterating over elements in a document.
-
240  @return True if the element is not in a library, otherwise False.
-
241  '''
-
242  return not elem.hasSourceUri()
-
243 
-
244  def _getMethodName(self):
-
245  frame = inspect.currentframe().f_back
-
246  method_name = frame.f_code.co_name
-
247  return method_name
-
248  #return inspect.currentframe().f_code.co_name
-
249 
- -
251  '''
-
252  @brief Validate the MaterialX document
-
253  @param doc The MaterialX document to validate
-
254  @return A tuple of (valid, errors) where valid is True if the document is valid, and errors is a list of errors if the document is invalid.
-
255  '''
-
256  if not self.mxmx:
-
257  self.loggerlogger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
258  return False, ''
-
259 
-
260  if not doc:
-
261  self.loggerlogger.warning(f'> {self._getMethodName()}: MaterialX document is required')
-
262  return False, ''
-
263 
-
264  valid, errors = doc.validate()
-
265  return valid, errors
-
266 
-
267  def addComment(self, doc, commentString):
-
268  '''
-
269  @brief Add a comment to the MaterialX document
-
270  @param doc The MaterialX document to add the comment to
-
271  @param commentString The comment string to add
-
272  @return None
-
273  '''
-
274  comment = doc.addChildOfCategory('comment')
-
275  comment.setDocString(commentString)
-
276 
-
277  def convertToMaterialX(self, materialNames = [], shaderCategory='standard_surface',
-
278  remapKeys = {}, shaderPreFix ='') -> mx.Document:
-
279  '''
-
280  @brief Convert the Physically Based Materials to MaterialX format for a given target shading model.
-
281  @param materialNames The list of material names to convert. If empty, all materials will be converted.
-
282  @param shaderCategory The target shading model to convert to. Default is 'standard_surface'.
-
283  @param remapKeys The remapping keys for the target shading model. If empty, the default remapping keys will be used.
-
284  @param shaderPreFix The prefix to add to the shader name. Default is an empty string.
-
285  @return The MaterialX document
-
286  '''
-
287  if not self.mxmx:
-
288  self.loggerlogger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
289  return None
-
290 
-
291  if not self.support_openpbrsupport_openpbr and shaderCategory == 'open_pbr_surface':
-
292  self.loggerlogger.warning(f'> OpenPBR shading model not supported in MaterialX version {self.mx.getVersionString()}')
-
293  return None
-
294 
-
295  if not self.materialsmaterials:
-
296  self.loggerlogger.info('> No materials to convert')
-
297  return None
-
298 
-
299  if len(remapKeys) == 0:
-
300  remapKeys = self.getInputRemappinggetInputRemapping(shaderCategory)
-
301  if len(remapKeys) == 0:
-
302  self.loggerlogger.warning(f'> No remapping keys found for shading model: {shaderCategory}')
-
303 
-
304  # Create main document and import the library document
-
305  self.docdoc = self.mxmx.createDocument()
-
306  self.docdoc.importLibrary(self.stdlibstdlib)
-
307 
-
308  # Add header comments
-
309  self.addCommentaddComment(self.docdoc, 'Physically Based Materials from https://api.physicallybased.info ')
-
310  self.addCommentaddComment(self.docdoc, ' Processsed via API and converted to MaterialX ')
-
311  self.addCommentaddComment(self.docdoc, ' Target Shading Model: ' + shaderCategory)
-
312  self.addCommentaddComment(self.docdoc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ')
-
313 
-
314  # Add properties to the material
-
315  for mat in self.materialsmaterials:
-
316  matName = mat['name']
-
317 
-
318  # Filter by material name(s)
-
319  if len(materialNames) > 0 and matName not in materialNames:
-
320  #self.logger.debug('Skip material: ' + matName)
-
321  continue
-
322 
-
323  if (len(shaderPreFix) > 0):
-
324  matName = matName + '_' + shaderPreFix
-
325 
-
326  shaderName = self.docdoc.createValidChildName(matName + '_SHD_PBM')
-
327  self.addCommentaddComment(self.docdoc, ' Generated shader: ' + shaderName + ' ')
-
328  shaderNode = self.docdoc.addNode(shaderCategory, shaderName, self.mxmx.SURFACE_SHADER_TYPE_STRING)
-
329  docString = mat['description']
-
330  refString = mat['reference']
-
331  if len(refString) > 0:
-
332  if len(docString) > 0:
-
333  docString += '. '
-
334  docString += 'Reference: ' + refString[0]
-
335  if len(docString) > 0:
-
336  shaderNode.setDocString(docString)
-
337  #shaderNode.addInputsFromNodeDef()
-
338  #shaderNode.setAttribute(self.mx.InterfaceElement.NODE_DEF_ATTRIBUTE, nodedefString)
-
339 
-
340  # Create a new material
-
341  materialName = self.docdoc.createValidChildName(matName + '_MAT_PBM')
-
342  self.addCommentaddComment(self.docdoc, ' Generated material: ' + materialName + ' ')
-
343  materialNode = self.docdoc.addNode(self.mxmx.SURFACE_MATERIAL_NODE_STRING, materialName, self.mxmx.MATERIAL_TYPE_STRING)
-
344  shaderInput = materialNode.addInput(self.mxmx.SURFACE_SHADER_TYPE_STRING, self.mxmx.SURFACE_SHADER_TYPE_STRING)
-
345  shaderInput.setAttribute(self.MTLX_NODE_NAME_ATTRIBUTEMTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName())
-
346 
-
347  # Keys to skip.
-
348  skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"]
-
349 
-
350  metallness = None
-
351  roughness = None
-
352  color = None
-
353  transmission = None
-
354  for key, value in mat.items():
-
355 
-
356  if (key not in skipKeys):
-
357  if key == 'metalness':
-
358  metallness = value
-
359  if key == 'roughness':
-
360  roughness = value
-
361  if key == 'transmission':
-
362  transmission = value
-
363  if key == 'color':
-
364  color = value
-
365 
-
366  if key in remapKeys:
-
367  key = remapKeys[key]
-
368  input = shaderNode.addInputFromNodeDef(key)
-
369  if input:
-
370  # Convert number vector to string
-
371  if isinstance(value, list):
-
372  value = ','.join([str(x) for x in value])
-
373  # Convert number to string:
-
374  elif isinstance(value, (int, float)):
-
375  value = str(value)
-
376  input.setValueString(value)
-
377  #else:
-
378  # self.logger.debug('Skip unsupported key: ' + key)
-
379 
-
380  if (transmission != None) and (metallness != None) and (roughness != None) and (color != None):
-
381  if (metallness == 0) and (roughness == 0):
-
382  if 'transmission_color' in remapKeys:
-
383  key = remapKeys['transmission_color']
-
384  input = shaderNode.addInputFromNodeDef(key)
-
385  if input:
-
386  self.loggerlogger.debug(f'Set transmission color {key}: {color}')
-
387  value = ','.join([str(x) for x in color])
-
388  input.setValueString(value)
-
389 
-
390  return self.docdoc
-
391 
-
392  def writeMaterialXToFile(self, filename):
-
393  '''
-
394  @brief Write the MaterialX document to disk
-
395  @param filename The filename to write the MaterialX document to
-
396  @return None
-
397  '''
-
398  if not self.mxmx:
-
399  self.loggerlogger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
400  return
-
401 
-
402  writeOptions = self.mxmx.XmlWriteOptions()
-
403  writeOptions.writeXIncludeEnable = False
-
404  writeOptions.elementPredicate = self.skipLibraryElementskipLibraryElement
-
405  self.mxmx.writeToXmlFile(self.docdoc, filename, writeOptions)
-
406 
- -
408  '''
-
409  @brief Convert the MaterialX document to a string
-
410  @return The MaterialX document as a string
-
411  '''
-
412  if not self.mxmx:
-
413  self.loggerlogger.critical(f'> {self._getMethodName()}: MaterialX module is required')
-
414  return
-
415 
-
416  writeOptions = self.mxmx.XmlWriteOptions()
-
417  writeOptions.writeXIncludeEnable = False
-
418  writeOptions.elementPredicate = self.skipLibraryElementskipLibraryElement
-
419  mtlx = self.mxmx.writeToXmlString(self.docdoc, writeOptions)
-
420  return mtlx
-
Class to load Physically Based Materials from the PhysicallyBased site.
-
dict getInputRemapping(self, shadingModel)
Get the remapping keys for a given shading model.
- -
list getJSONMaterialNames(self)
Get the list of material names from the JSON object.
-
dict loadMaterialsFromString(self, matString)
Load the Physically Based Materials from a JSON string.
- -
dict loadMaterialsFromFile(self, fileName)
Load the Physically Based Materials from a JSON file.
- -
def setDebugging(self, debug=True)
Set the debugging level for the logger.
-
def __init__(self, mx_module, mx.Document mx_stdlib=None)
Constructor for the PhysicallyBasedMaterialLoader class.
- - -
def convertToMaterialXString(self)
Convert the MaterialX document to a string.
- - - -
dict getMaterialsFromURL(self)
Get the Physically Based Materials from the PhysicallyBased site.
- - -
dict getJSON(self)
Get the JSON object representing the Physically Based Materials.
- - -
def initializeInputRemapping(self)
Initialize remapping keys for different shading models.
-
bool skipLibraryElement(elem)
Utility to skip library elements when iterating over elements in a document.
-
mx.Document convertToMaterialX(self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')
Convert the Physically Based Materials to MaterialX format for a given target shading model.
-
def writeMaterialXToFile(self, filename)
Write the MaterialX document to disk.
- -
def addComment(self, doc, commentString)
Add a comment to the MaterialX document.
-
def writeJSONToFile(self, filename)
Write the materials to a JSON file.
+
1'''
+
2@brief Class to load Physically Based Materials from the PhysicallyBased site.
+
3and convert the materials to MaterialX format for given target shading models.
+
4'''
+
5
+
6import requests, json, os, inspect
+
7import logging as lg
+
8from http import HTTPStatus
+
9import MaterialX as mx
+
10
+
+ +
12 '''
+
13 @brief Class to load Physically Based Materials from the PhysicallyBased site.
+
14 The class can convert the materials to MaterialX format for given target shading models.
+
15 '''
+
+
16 def __init__(self, mx_module, mx_stdlib : mx.Document = None):
+
17 '''
+
18 @brief Constructor for the PhysicallyBasedMaterialLoader class.
+
19 Will initialize shader mappings and load the MaterialX standard library
+
20 if it is not passed in as an argument.
+
21 @param mx_module The MaterialX module. Required.
+
22 @param mx_stdlib The MaterialX standard library. Optional.
+
23 '''
+
24 self.logger = lg.getLogger('PBMXLoader')
+
25 lg.basicConfig(level=lg.INFO)
+
26
+ +
28 self.materialNames = []
+
29 self.uri = 'https://api.physicallybased.info/materials'
+
30 self.doc = None
+
31 self.mxmx = mx_module
+
32 self.stdlib = mx_stdlib
+
33 self.MTLX_NODE_NAME_ATTRIBUTE = 'nodename'
+
34 self.support_openpbr = False
+
35
+
36 if not mx_module:
+
37 self.logger.critical(f'> {self._getMethodName()}: MaterialX module not specified.')
+
38 return
+
39
+
40 # Check for OpenPBR support which is only available in 1.39 and above
+
41 version_major, version_minor, version_patch = self.mxmx.getVersionIntegers()
+
42 self.logger.debug(f'> MaterialX version: {version_major}.{version_minor}.{version_patch}')
+
43 if (version_major >=1 and version_minor >= 39) or version_major > 1:
+
44 self.logger.debug('> OpenPBR shading model supported')
+
45 self.support_openpbr = True
+
46
+ +
48
+
49 # Load the MaterialX standard library if not provided
+
50 if not self.stdlib:
+
51 self.stdlib = self.mxmx.createDocument()
+
52 libFiles = self.mxmx.loadLibraries(mx.getDefaultDataLibraryFolders(), mx.getDefaultDataSearchPath(), self.stdlib)
+
53 self.logger.debug(f'> Loaded standard library: {libFiles}')
+
54
+
+
+
55 def setDebugging(self, debug=True):
+
56 '''
+
57 @brief Set the debugging level for the logger.
+
58 @param debug True to set the logger to debug level, otherwise False.
+
59 @return None
+
60 '''
+
61 if debug:
+
62 self.logger.setLevel(lg.DEBUG)
+
63 else:
+
64 self.logger.setLevel(lg.INFO)
+
65
+
+
+
66 def getInputRemapping(self, shadingModel) -> dict:
+
67 '''
+
68 @brief Get the remapping keys for a given shading model.
+
69 @param shadingModel The shading model to get the remapping keys for.
+
70 @return A dictionary of remapping keys.
+
71 '''
+
72 if (shadingModel in self.remapMap):
+
73 return self.remapMap[shadingModel]
+
74
+
75 self.logger.warn(f'> No remapping keys found for shading model: {shadingModel}')
+
76 return {}
+
77
+
+
+ +
79 '''
+
80 @brief Initialize remapping keys for different shading models.
+
81 The currently supported shading models are:
+
82 - standard_surface
+
83 - open_pbr_surface
+
84 - gltf_pbr
+
85 @return None
+
86 '''
+
87 # Remap keys for Autodesk Standard Surface shading model.
+
88 standard_surface_remapKeys = {
+
89 'color': 'base_color',
+
90 'specularColor': 'specular_color',
+
91 'roughness': 'specular_roughness',
+
92 #'metalness': 'metalness',
+
93 'ior': 'specular_IOR',
+
94 #'transmission': 'transmission',
+
95 'transmission_color': 'transmission_color',
+
96 'thinFilmIor' : 'thin_film_IOR',
+
97 'thinFilmThickness' : 'thin_film_thickness',
+
98 'transmissionDispersion' : 'transmission_dispersion',
+
99 }
+
100 # Remap keys for OpenPBR shading model.
+
101 # Q: When to set geometry_thin_walled to true?
+
102 openpbr_remapKeys = {
+
103 'color': 'base_color',
+
104 'specularColor': 'specular_color',
+
105 'roughness': 'specular_roughness', # 'base_diffuse_roughness',
+
106 'metalness': 'base_metalness',
+
107 'ior': 'specular_ior',
+
108 'transmission': 'transmission_weight',
+
109 'transmission_color': 'transmission_color',
+
110 'subsurfaceRadius': 'subsurface_radius',
+
111 'thinFilmIor' : 'thin_film_ior',
+
112 'thinFilmThickness' : 'thin_film_thickness',
+
113 'transmissionDispersion' : 'transmission_dispersion_scale',
+
114 }
+
115 # Remap keys for Khronos glTF shading model.
+
116 gltf_remapKeys = {
+
117 'color': 'base_color',
+
118 'specularColor': 'specular_color',
+
119 'roughness': 'roughness',
+
120 'metalness': 'metallic',
+
121 'transmission_color': 'attenuation_color',
+
122 #'ior': 'ior',
+
123 #'transmission': 'transmission',
+
124 }
+
125
+
126 self.remapMap = {}
+
127 self.remapMap['standard_surface'] = standard_surface_remapKeys;
+
128 self.remapMap['gltf_pbr'] = gltf_remapKeys;
+
129 if self.support_openpbr:
+
130 self.remapMap['open_pbr_surface'] = openpbr_remapKeys;
+
131
+
+
+
132 def getJSON(self) -> dict:
+
133 ''' Get the JSON object representing the Physically Based Materials '''
+ +
135
+
+
+
136 def getJSONMaterialNames(self) -> list:
+
137 '''
+
138 Get the list of material names from the JSON object
+
139 @return The list of material names
+
140 '''
+
141 return self.materialNames
+
142
+
+
+
143 def getMaterialXDocument(self) -> mx.Document:
+
144 '''
+
145 Get the MaterialX document
+
146 @return The MaterialX document
+
147 '''
+
148 return self.doc
+
149
+
+
+
150 def loadMaterialsFromFile(self, fileName) -> dict:
+
151 '''
+
152 @brief Load the Physically Based Materials from a JSON file
+
153 @param fileName The filename to load the JSON file from
+
154 @return The JSON object representing the Physically Based Materials
+
155 '''
+ +
157 self.materialNames = []
+
158 if not os.path.exists(fileName):
+
159 self.logger.error(f'> File does not exist: {fileName}')
+
160 return None
+
161
+
162 with open(fileName, 'r') as json_file:
+
163 self.materialsmaterialsmaterials = json.load(json_file)
+
164 for mat in self.materialsmaterialsmaterials:
+
165 self.materialNames.append(mat['name'])
+
166
+ +
168
+
+
+
169 def loadMaterialsFromString(self, matString) -> dict:
+
170 '''
+
171 @brief Load the Physically Based Materials from a JSON string
+
172 @param matString The JSON string to load the Physically Based Materials from
+
173 @return The JSON object representing the Physically Based Materials
+
174 '''
+ +
176 self.materialNames = []
+
177 self.materialsmaterialsmaterials = json.loads(matString)
+
178 for mat in self.materialsmaterialsmaterials:
+
179 self.materialNames.append(mat['name'])
+
180
+ +
182
+
+
+
183 def getMaterialsFromURL(self) -> dict:
+
184 '''
+
185 @brief Get the Physically Based Materials from the PhysicallyBased site
+
186 @return The JSON object representing the Physically Based Materials
+
187 '''
+
188
+ +
190 self.materialNames = []
+
191 url = self.uri
+
192 headers = {
+
193 'Accept': 'application/json'
+
194 }
+
195
+
196 response = requests.get(url, headers=headers)
+
197
+
198 if response.status_code == HTTPStatus.OK:
+
199 self.materialsmaterialsmaterials = response.json()
+
200 for mat in self.materialsmaterialsmaterials:
+
201 self.materialNames.append(mat['name'])
+
202
+
203 else:
+
204 self.logger.error(f'> Status: {response.status_code}, {response.text}')
+
205
+ +
207
+
+
+
208 def printMaterials(self):
+
209 '''
+
210 @brief Print the materials to the console
+
211 @return None
+
212 '''
+
213 for mat in self.materialsmaterialsmaterials:
+
214 self.logger.info('Material name: ' + mat['name'])
+
215 # Print out each key and value
+
216 for key, value in mat.items():
+
217 if (key != 'name' and value):
+
218 self.logger.info(f'> - {key}: {value}')
+
219
+
+
+
220 def writeJSONToFile(self, filename):
+
221 '''
+
222 @brief Write the materials to a JSON file
+
223 @param filename The filename to write the JSON file to
+
224 @return True if the file was written successfully, otherwise False
+
225 '''
+
226 if not self.materialsmaterialsmaterials:
+
227 self.logger.warning('No materials to write')
+
228 return False
+
229
+
230 with open(filename, 'w') as json_file:
+
231 json.dump(self.materialsmaterialsmaterials, json_file, indent=4)
+
232 return True
+
233
+
234 return False
+
235
+
+
236 @staticmethod
+
+
237 def skipLibraryElement(elem) -> bool:
+
238 '''
+
239 @brief Utility to skip library elements when iterating over elements in a document.
+
240 @return True if the element is not in a library, otherwise False.
+
241 '''
+
242 return not elem.hasSourceUri()
+
243
+
+
244 def _getMethodName(self):
+
245 frame = inspect.currentframe().f_back
+
246 method_name = frame.f_code.co_name
+
247 return method_name
+
248 #return inspect.currentframe().f_code.co_name
+
249
+
+ +
251 '''
+
252 @brief Validate the MaterialX document
+
253 @param doc The MaterialX document to validate
+
254 @return A tuple of (valid, errors) where valid is True if the document is valid, and errors is a list of errors if the document is invalid.
+
255 '''
+
256 if not self.mxmx:
+
257 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
258 return False, ''
+
259
+
260 if not doc:
+
261 self.logger.warning(f'> {self._getMethodName()}: MaterialX document is required')
+
262 return False, ''
+
263
+
264 valid, errors = doc.validate()
+
265 return valid, errors
+
266
+
+
+
267 def addComment(self, doc, commentString):
+
268 '''
+
269 @brief Add a comment to the MaterialX document
+
270 @param doc The MaterialX document to add the comment to
+
271 @param commentString The comment string to add
+
272 @return None
+
273 '''
+
274 comment = doc.addChildOfCategory('comment')
+
275 comment.setDocString(commentString)
+
276
+
+
+
277 def convertToMaterialX(self, materialNames = [], shaderCategory='standard_surface',
+
278 remapKeys = {}, shaderPreFix ='') -> mx.Document:
+
279 '''
+
280 @brief Convert the Physically Based Materials to MaterialX format for a given target shading model.
+
281 @param materialNames The list of material names to convert. If empty, all materials will be converted.
+
282 @param shaderCategory The target shading model to convert to. Default is 'standard_surface'.
+
283 @param remapKeys The remapping keys for the target shading model. If empty, the default remapping keys will be used.
+
284 @param shaderPreFix The prefix to add to the shader name. Default is an empty string.
+
285 @return The MaterialX document
+
286 '''
+
287 if not self.mxmx:
+
288 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
289 return None
+
290
+
291 if not self.support_openpbr and shaderCategory == 'open_pbr_surface':
+
292 self.logger.warning(f'> OpenPBR shading model not supported in MaterialX version {self.mx.getVersionString()}')
+
293 return None
+
294
+
295 if not self.materialsmaterialsmaterials:
+
296 self.logger.info('> No materials to convert')
+
297 return None
+
298
+
299 if len(remapKeys) == 0:
+
300 remapKeys = self.getInputRemapping(shaderCategory)
+
301 if len(remapKeys) == 0:
+
302 self.logger.warning(f'> No remapping keys found for shading model: {shaderCategory}')
+
303
+
304 # Create main document and import the library document
+
305 self.doc = self.mxmx.createDocument()
+
306 self.doc.importLibrary(self.stdlib)
+
307
+
308 # Add header comments
+
309 self.addComment(self.doc, 'Physically Based Materials from https://api.physicallybased.info ')
+
310 self.addComment(self.doc, ' Processsed via API and converted to MaterialX ')
+
311 self.addComment(self.doc, ' Target Shading Model: ' + shaderCategory)
+
312 self.addComment(self.doc, ' Utility Author: Bernard Kwok. kwokcb@gmail.com ')
+
313
+
314 # Add properties to the material
+
315 for mat in self.materialsmaterialsmaterials:
+
316 matName = mat['name']
+
317
+
318 # Filter by material name(s)
+
319 if len(materialNames) > 0 and matName not in materialNames:
+
320 #self.logger.debug('Skip material: ' + matName)
+
321 continue
+
322
+
323 if (len(shaderPreFix) > 0):
+
324 matName = matName + '_' + shaderPreFix
+
325
+
326 shaderName = self.doc.createValidChildName(matName + '_SHD_PBM')
+
327 self.addComment(self.doc, ' Generated shader: ' + shaderName + ' ')
+
328 shaderNode = self.doc.addNode(shaderCategory, shaderName, self.mxmx.SURFACE_SHADER_TYPE_STRING)
+
329 docString = mat['description']
+
330 refString = mat['reference']
+
331 if len(refString) > 0:
+
332 if len(docString) > 0:
+
333 docString += '. '
+
334 docString += 'Reference: ' + refString[0]
+
335 if len(docString) > 0:
+
336 shaderNode.setDocString(docString)
+
337 #shaderNode.addInputsFromNodeDef()
+
338 #shaderNode.setAttribute(self.mx.InterfaceElement.NODE_DEF_ATTRIBUTE, nodedefString)
+
339
+
340 # Create a new material
+
341 materialName = self.doc.createValidChildName(matName + '_MAT_PBM')
+
342 self.addComment(self.doc, ' Generated material: ' + materialName + ' ')
+
343 materialNode = self.doc.addNode(self.mxmx.SURFACE_MATERIAL_NODE_STRING, materialName, self.mxmx.MATERIAL_TYPE_STRING)
+
344 shaderInput = materialNode.addInput(self.mxmx.SURFACE_SHADER_TYPE_STRING, self.mxmx.SURFACE_SHADER_TYPE_STRING)
+
345 shaderInput.setAttribute(self.MTLX_NODE_NAME_ATTRIBUTE, shaderNode.getName())
+
346
+
347 # Keys to skip.
+
348 skipKeys = ['name', "density", "category", "description", "sources", "tags", "reference"]
+
349
+
350 metallness = None
+
351 roughness = None
+
352 color = None
+
353 transmission = None
+
354 for key, value in mat.items():
+
355
+
356 if (key not in skipKeys):
+
357 if key == 'metalness':
+
358 metallness = value
+
359 if key == 'roughness':
+
360 roughness = value
+
361 if key == 'transmission':
+
362 transmission = value
+
363 if key == 'color':
+
364 color = value
+
365
+
366 if key in remapKeys:
+
367 key = remapKeys[key]
+
368 input = shaderNode.addInputFromNodeDef(key)
+
369 if input:
+
370 # Convert number vector to string
+
371 if isinstance(value, list):
+
372 value = ','.join([str(x) for x in value])
+
373 # Convert number to string:
+
374 elif isinstance(value, (int, float)):
+
375 value = str(value)
+
376 input.setValueString(value)
+
377 #else:
+
378 # self.logger.debug('Skip unsupported key: ' + key)
+
379
+
380 if (transmission != None) and (metallness != None) and (roughness != None) and (color != None):
+
381 if (metallness == 0) and (roughness == 0):
+
382 if 'transmission_color' in remapKeys:
+
383 key = remapKeys['transmission_color']
+
384 input = shaderNode.addInputFromNodeDef(key)
+
385 if input:
+
386 self.logger.debug(f'Set transmission color {key}: {color}')
+
387 value = ','.join([str(x) for x in color])
+
388 input.setValueString(value)
+
389
+
390 return self.doc
+
391
+
+
+
392 def writeMaterialXToFile(self, filename):
+
393 '''
+
394 @brief Write the MaterialX document to disk
+
395 @param filename The filename to write the MaterialX document to
+
396 @return None
+
397 '''
+
398 if not self.mxmx:
+
399 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
400 return
+
401
+
402 writeOptions = self.mxmx.XmlWriteOptions()
+
403 writeOptions.writeXIncludeEnable = False
+
404 writeOptions.elementPredicate = self.skipLibraryElement
+
405 self.mxmx.writeToXmlFile(self.doc, filename, writeOptions)
+
406
+
+
+ +
408 '''
+
409 @brief Convert the MaterialX document to a string
+
410 @return The MaterialX document as a string
+
411 '''
+
412 if not self.mxmx:
+
413 self.logger.critical(f'> {self._getMethodName()}: MaterialX module is required')
+
414 return
+
415
+
416 writeOptions = self.mxmx.XmlWriteOptions()
+
417 writeOptions.writeXIncludeEnable = False
+
418 writeOptions.elementPredicate = self.skipLibraryElement
+
419 mtlx = self.mxmx.writeToXmlString(self.doc, writeOptions)
+
420 return mtlx
+
+
+
Class to load Physically Based Materials from the PhysicallyBased site.
+
dict getInputRemapping(self, shadingModel)
Get the remapping keys for a given shading model.
+
list getJSONMaterialNames(self)
Get the list of material names from the JSON object.
+
dict loadMaterialsFromString(self, matString)
Load the Physically Based Materials from a JSON string.
+ +
dict loadMaterialsFromFile(self, fileName)
Load the Physically Based Materials from a JSON file.
+ + + +
writeMaterialXToFile(self, filename)
Write the MaterialX document to disk.
+ + + + + +
setDebugging(self, debug=True)
Set the debugging level for the logger.
+ +
dict getMaterialsFromURL(self)
Get the Physically Based Materials from the PhysicallyBased site.
+
initializeInputRemapping(self)
Initialize remapping keys for different shading models.
+ + + +
dict getJSON(self)
Get the JSON object representing the Physically Based Materials.
+ + + +
__init__(self, mx_module, mx.Document mx_stdlib=None)
Constructor for the PhysicallyBasedMaterialLoader class.
+
bool skipLibraryElement(elem)
Utility to skip library elements when iterating over elements in a document.
+
mx.Document convertToMaterialX(self, materialNames=[], shaderCategory='standard_surface', remapKeys={}, shaderPreFix='')
Convert the Physically Based Materials to MaterialX format for a given target shading model.
+ +
addComment(self, doc, commentString)
Add a comment to the MaterialX document.
+
diff --git a/documents/html/physically_based_material_x_cmd_8py.html b/documents/html/physically_based_material_x_cmd_8py.html new file mode 100644 index 0000000..1f42a4b --- /dev/null +++ b/documents/html/physically_based_material_x_cmd_8py.html @@ -0,0 +1,262 @@ + + + + + + + +MaterialXMaterials: physicallyBasedMaterialXCmd.py File Reference + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
MaterialXMaterials 0.0.1 +
+
Utilities for retrieving materials from remote servers
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
physicallyBasedMaterialXCmd.py File Reference
+
+
+ +

Convert Physically Based Materials to MaterialX Command Line Utility. +More...

+ +

Go to the source code of this file.

+ + + + +

+Functions

 materialxMaterials.physicallyBasedMaterialXCmd.physicallBasedMaterialXCmd ()
 
+

Detailed Description

+

Convert Physically Based Materials to MaterialX Command Line Utility.

+

This script converts Physically Based Materials to MaterialX using the MaterialX Python API.

+

The script can be run from the command line with the following options:

+

–shadingModel: Shading models to use for conversion. If not specified then all will be used.

+

Options: standard_surface, gltf_pbr, open_pbr_surface

+

–outputDir: Output directory for MaterialX files

+

–writeJSON: Write materials JSON file. Default is True

+

–separateFiles: Convert individual MaterialX files per material. Default is false

+

Example usage:

+ + + + + + +

Definition in file physicallyBasedMaterialXCmd.py.

+

Function Documentation

+ +

◆ physicallBasedMaterialXCmd()

+ +
+
+ + + + + + + +
materialxMaterials.physicallyBasedMaterialXCmd.physicallBasedMaterialXCmd ()
+
+ +

Definition at line 24 of file physicallyBasedMaterialXCmd.py.

+
24def physicallBasedMaterialXCmd():
+
25 logger = logging.getLogger('PB_CMD')
+
26 logging.basicConfig(level=logging.INFO)
+
27
+
28 # TODO: Add arguments for shading model, and output directory using argparse
+
29 parser = argparse.ArgumentParser(description='Convert Physically Based Materials to MaterialX')
+
30 parser.add_argument('--shadingModel', type=str, default='', help='Shading models to use for conversion. '
+
31 ' If not specified then all will be used. '
+
32 ' Options: standard_surface, gltf_pbr, open_pbr_surface')
+
33 parser.add_argument('--outputDir', type=str, default='',
+
34 help='Output directory for MaterialX files. Default location is PhysicallyBasedMaterialX')
+
35 parser.add_argument('--writeJSON', type=bool, default=True,
+
36 help='Write materials JSON file. Default is True')
+
37 parser.add_argument('--separateFiles', type=bool, default=False,
+
38 help='Convert individual MaterialX files per material. Default is false')
+
39 parser.add_argument('--loadFromFile', type=str, default='', help='Load materials a specified file')
+
40 opts = parser.parse_args()
+
41
+
42 outputDir = 'PhysicallyBasedMaterialX'
+
43 if opts.outputDir:
+
44 if not os.path.exists(opts.outputDir):
+
45 logger.info(f'Error: Output directory does not exist: {opts.outputDir}')
+
46 sys.exit(1)
+
47 else:
+
48 outputDir = opts.outputDir
+
49
+
50 shadingModels = []
+
51 if opts.shadingModel:
+
52 shadingModels = opts.shadingModel.split(',')
+
53 shadingModePrefixMap = { 'standard_surface': 'SS', 'gltf_pbr': 'GLTF', 'open_pbr_surface': 'OPBR' }
+
54 shadingModelPrefixes = []
+
55 if len(shadingModels) == 0:
+
56 shadingModels = ['standard_surface', 'gltf_pbr', 'open_pbr_surface']
+
57 shadingModelPrefixes = ['SS', 'GLTF', 'OPBR']
+
58 else:
+
59 for shadingModel in shadingModels:
+
60 shadingModelPrefixes.append(shadingModePrefixMap[shadingModel])
+
61
+
62 writeJSON = opts.writeJSON
+
63 separateFiles = opts.separateFiles
+
64
+
65 # Create loader and get PhysicallyBasedMaterials
+
66 jsonMat = None
+
67 loader = pbmx.PhysicallyBasedMaterialLoader(mx, None)
+
68 if opts.loadFromFile:
+
69 if not os.path.exists(opts.loadFromFile):
+
70 logger.info(f'> Error: File does not exist: {opts.loadFromFile}')
+
71 sys.exit(1)
+
72 logger.info(f'> Load materials from file: {opts.loadFromFile}')
+
73 jsonMat = loader.loadMaterialsFromFile(opts.loadFromFile)
+
74 else:
+
75 jsonMat = loader.getMaterialsFromURL()
+
76
+
77 if jsonMat:
+
78
+
79 # Create folder for MaterialX call PhysicallyBasedMaterialX
+
80 os.makedirs(outputDir, exist_ok=True)
+
81
+
82 if writeJSON:
+
83 logger.info(f'> Write: {outputDir}/PhysicallyBasedMaterial.json')
+
84 loader.writeJSONToFile(os.path.join(outputDir, 'PhysicallyBasedMaterial.json'))
+
85
+
86 if not separateFiles:
+
87 for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
+
88 logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
+
89 matdoc = loader.convertToMaterialX([], shadingModel, {}, prefix)
+
90 valid, errors = loader.validateMaterialXDocument(matdoc)
+
91 if valid:
+
92 fileName = os.path.join(outputDir, f'PhysicallyBasedMaterialX_{prefix}.mtlx')
+
93 loader.writeMaterialXToFile(fileName)
+
94 logger.info(f'> Write: {fileName}')
+
95
+
96 else:
+
97 for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
+
98 logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
+
99 for mat in loader.getJSONMaterialNames():
+
100 materialFilter = [mat]
+
101 matdoc = loader.convertToMaterialX(materialFilter, shadingModel, {}, prefix)
+
102 if matdoc is not None:
+
103 valid, errors = loader.validateMaterialXDocument(matdoc)
+
104 if valid:
+
105 fileName = os.path.join(outputDir, f'PB_{prefix}_{mat}.mtlx')
+
106 loader.writeMaterialXToFile(fileName)
+
107 logger.info(f'> Write: {fileName}')
+
108
+
109 else:
+
110 logger.info('Could not retrieve PhysicallyBased Materials')
+
111
+
+
+
+
+
+ + + + diff --git a/documents/html/physically_based_material_x_cmd_8py_source.html b/documents/html/physically_based_material_x_cmd_8py_source.html index 640e5eb..2a99775 100644 --- a/documents/html/physically_based_material_x_cmd_8py_source.html +++ b/documents/html/physically_based_material_x_cmd_8py_source.html @@ -1,18 +1,20 @@ - + - - + + MaterialXMaterials: physicallyBasedMaterialXCmd.py Source File + - + + @@ -24,10 +26,9 @@
- - + @@ -36,21 +37,27 @@
-
MaterialXMaterials -  0.0.1 +
+
MaterialXMaterials 0.0.1
Utilities for retrieving materials from remote servers
- + + +/* @license-end */ +
@@ -64,8 +71,8 @@
@@ -78,136 +85,142 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
physicallyBasedMaterialXCmd.py
+
physicallyBasedMaterialXCmd.py
-
1 #/usr/bin/env python3
-
2 '''
-
3 @file physicallyBasedMaterialXCmd.py
-
4 @brief Convert Physically Based Materials to MaterialX Command Line Utility
-
5 @details This script converts Physically Based Materials to MaterialX using the MaterialX Python API.
-
6 @details The script can be run from the command line with the following options:
-
7 @details --shadingModel: Shading models to use for conversion. If not specified then all will be used.
-
8 @details Options: standard_surface, gltf_pbr, open_pbr_surface
-
9 @details --outputDir: Output directory for MaterialX files
-
10 @details --writeJSON: Write materials JSON file. Default is True
-
11 @details --separateFiles: Convert individual MaterialX files per material. Default is false
-
12 @details Example usage:
-
13 @details - python physicallyBasedMaterialXCmd.py
-
14 @details - python physicallyBasedMaterialXCmd.py --outputDir=myfolder
-
15 @details - python physicallyBasedMaterialXCmd.py --writeJSON=False
-
16 @details - python physicallyBasedMaterialXCmd.py --shadingModel=gltf_pbr,open_pbr_surface
-
17 @details - python physicallyBasedMaterialXCmd.py --shadingModel=open_pbr_surface --separateFiles=True
-
18 '''
-
19 import os, sys, argparse, logging
-
20 
-
21 import MaterialX as mx
-
22 import physicallyBasedMaterialX as pbmx
-
23 
-
24 def physicallBasedMaterialXCmd():
-
25  logger = logging.getLogger('PB_CMD')
-
26  logging.basicConfig(level=logging.INFO)
-
27 
-
28  # TODO: Add arguments for shading model, and output directory using argparse
-
29  parser = argparse.ArgumentParser(description='Convert Physically Based Materials to MaterialX')
-
30  parser.add_argument('--shadingModel', type=str, default='', help='Shading models to use for conversion. '
-
31  ' If not specified then all will be used. '
-
32  ' Options: standard_surface, gltf_pbr, open_pbr_surface')
-
33  parser.add_argument('--outputDir', type=str, default='',
-
34  help='Output directory for MaterialX files. Default location is PhysicallyBasedMaterialX')
-
35  parser.add_argument('--writeJSON', type=bool, default=True,
-
36  help='Write materials JSON file. Default is True')
-
37  parser.add_argument('--separateFiles', type=bool, default=False,
-
38  help='Convert individual MaterialX files per material. Default is false')
-
39  parser.add_argument('--loadFromFile', type=str, default='', help='Load materials a specified file')
-
40  opts = parser.parse_args()
-
41 
-
42  outputDir = 'PhysicallyBasedMaterialX'
-
43  if opts.outputDir:
-
44  if not os.path.exists(opts.outputDir):
-
45  logger.info(f'Error: Output directory does not exist: {opts.outputDir}')
-
46  sys.exit(1)
-
47  else:
-
48  outputDir = opts.outputDir
-
49 
-
50  shadingModels = []
-
51  if opts.shadingModel:
-
52  shadingModels = opts.shadingModel.split(',')
-
53  shadingModePrefixMap = { 'standard_surface': 'SS', 'gltf_pbr': 'GLTF', 'open_pbr_surface': 'OPBR' }
-
54  shadingModelPrefixes = []
-
55  if len(shadingModels) == 0:
-
56  shadingModels = ['standard_surface', 'gltf_pbr', 'open_pbr_surface']
-
57  shadingModelPrefixes = ['SS', 'GLTF', 'OPBR']
-
58  else:
-
59  for shadingModel in shadingModels:
-
60  shadingModelPrefixes.append(shadingModePrefixMap[shadingModel])
-
61 
-
62  writeJSON = opts.writeJSON
-
63  separateFiles = opts.separateFiles
-
64 
-
65  # Create loader and get PhysicallyBasedMaterials
-
66  jsonMat = None
-
67  loader = pbmx.PhysicallyBasedMaterialLoader(mx, None)
-
68  if opts.loadFromFile:
-
69  if not os.path.exists(opts.loadFromFile):
-
70  logger.info(f'> Error: File does not exist: {opts.loadFromFile}')
-
71  sys.exit(1)
-
72  logger.info(f'> Load materials from file: {opts.loadFromFile}')
-
73  jsonMat = loader.loadMaterialsFromFile(opts.loadFromFile)
-
74  else:
-
75  jsonMat = loader.getMaterialsFromURL()
-
76 
-
77  if jsonMat:
-
78 
-
79  # Create folder for MaterialX call PhysicallyBasedMaterialX
-
80  os.makedirs(outputDir, exist_ok=True)
-
81 
-
82  if writeJSON:
-
83  logger.info(f'> Write: {outputDir}/PhysicallyBasedMaterial.json')
-
84  loader.writeJSONToFile(os.path.join(outputDir, 'PhysicallyBasedMaterial.json'))
-
85 
-
86  if not separateFiles:
-
87  for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
-
88  logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
-
89  matdoc = loader.convertToMaterialX([], shadingModel, {}, prefix)
-
90  valid, errors = loader.validateMaterialXDocument(matdoc)
-
91  if valid:
-
92  fileName = os.path.join(outputDir, f'PhysicallyBasedMaterialX_{prefix}.mtlx')
-
93  loader.writeMaterialXToFile(fileName)
-
94  logger.info(f'> Write: {fileName}')
-
95 
-
96  else:
-
97  for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
-
98  logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
-
99  for mat in loader.getJSONMaterialNames():
-
100  materialFilter = [mat]
-
101  matdoc = loader.convertToMaterialX(materialFilter, shadingModel, {}, prefix)
-
102  if matdoc is not None:
-
103  valid, errors = loader.validateMaterialXDocument(matdoc)
-
104  if valid:
-
105  fileName = os.path.join(outputDir, f'PB_{prefix}_{mat}.mtlx')
-
106  loader.writeMaterialXToFile(fileName)
-
107  logger.info(f'> Write: {fileName}')
-
108 
-
109  else:
-
110  logger.info('Could not retrieve PhysicallyBased Materials')
-
111 
-
112 if __name__ == '__main__':
-
113  physicallBasedMaterialXCmd()
+Go to the documentation of this file.
1#/usr/bin/env python3
+
2'''
+
3@file physicallyBasedMaterialXCmd.py
+
4@brief Convert Physically Based Materials to MaterialX Command Line Utility
+
5@details This script converts Physically Based Materials to MaterialX using the MaterialX Python API.
+
6@details The script can be run from the command line with the following options:
+
7@details --shadingModel: Shading models to use for conversion. If not specified then all will be used.
+
8@details Options: standard_surface, gltf_pbr, open_pbr_surface
+
9@details --outputDir: Output directory for MaterialX files
+
10@details --writeJSON: Write materials JSON file. Default is True
+
11@details --separateFiles: Convert individual MaterialX files per material. Default is false
+
12@details Example usage:
+
13@details - python physicallyBasedMaterialXCmd.py
+
14@details - python physicallyBasedMaterialXCmd.py --outputDir=myfolder
+
15@details - python physicallyBasedMaterialXCmd.py --writeJSON=False
+
16@details - python physicallyBasedMaterialXCmd.py --shadingModel=gltf_pbr,open_pbr_surface
+
17@details - python physicallyBasedMaterialXCmd.py --shadingModel=open_pbr_surface --separateFiles=True
+
18'''
+
19import os, sys, argparse, logging
+
20
+
21import MaterialX as mx
+
22import physicallyBasedMaterialX as pbmx
+
23
+
24def physicallBasedMaterialXCmd():
+
25 logger = logging.getLogger('PB_CMD')
+
26 logging.basicConfig(level=logging.INFO)
+
27
+
28 # TODO: Add arguments for shading model, and output directory using argparse
+
29 parser = argparse.ArgumentParser(description='Convert Physically Based Materials to MaterialX')
+
30 parser.add_argument('--shadingModel', type=str, default='', help='Shading models to use for conversion. '
+
31 ' If not specified then all will be used. '
+
32 ' Options: standard_surface, gltf_pbr, open_pbr_surface')
+
33 parser.add_argument('--outputDir', type=str, default='',
+
34 help='Output directory for MaterialX files. Default location is PhysicallyBasedMaterialX')
+
35 parser.add_argument('--writeJSON', type=bool, default=True,
+
36 help='Write materials JSON file. Default is True')
+
37 parser.add_argument('--separateFiles', type=bool, default=False,
+
38 help='Convert individual MaterialX files per material. Default is false')
+
39 parser.add_argument('--loadFromFile', type=str, default='', help='Load materials a specified file')
+
40 opts = parser.parse_args()
+
41
+
42 outputDir = 'PhysicallyBasedMaterialX'
+
43 if opts.outputDir:
+
44 if not os.path.exists(opts.outputDir):
+
45 logger.info(f'Error: Output directory does not exist: {opts.outputDir}')
+
46 sys.exit(1)
+
47 else:
+
48 outputDir = opts.outputDir
+
49
+
50 shadingModels = []
+
51 if opts.shadingModel:
+
52 shadingModels = opts.shadingModel.split(',')
+
53 shadingModePrefixMap = { 'standard_surface': 'SS', 'gltf_pbr': 'GLTF', 'open_pbr_surface': 'OPBR' }
+
54 shadingModelPrefixes = []
+
55 if len(shadingModels) == 0:
+
56 shadingModels = ['standard_surface', 'gltf_pbr', 'open_pbr_surface']
+
57 shadingModelPrefixes = ['SS', 'GLTF', 'OPBR']
+
58 else:
+
59 for shadingModel in shadingModels:
+
60 shadingModelPrefixes.append(shadingModePrefixMap[shadingModel])
+
61
+
62 writeJSON = opts.writeJSON
+
63 separateFiles = opts.separateFiles
+
64
+
65 # Create loader and get PhysicallyBasedMaterials
+
66 jsonMat = None
+
67 loader = pbmx.PhysicallyBasedMaterialLoader(mx, None)
+
68 if opts.loadFromFile:
+
69 if not os.path.exists(opts.loadFromFile):
+
70 logger.info(f'> Error: File does not exist: {opts.loadFromFile}')
+
71 sys.exit(1)
+
72 logger.info(f'> Load materials from file: {opts.loadFromFile}')
+
73 jsonMat = loader.loadMaterialsFromFile(opts.loadFromFile)
+
74 else:
+
75 jsonMat = loader.getMaterialsFromURL()
+
76
+
77 if jsonMat:
+
78
+
79 # Create folder for MaterialX call PhysicallyBasedMaterialX
+
80 os.makedirs(outputDir, exist_ok=True)
+
81
+
82 if writeJSON:
+
83 logger.info(f'> Write: {outputDir}/PhysicallyBasedMaterial.json')
+
84 loader.writeJSONToFile(os.path.join(outputDir, 'PhysicallyBasedMaterial.json'))
+
85
+
86 if not separateFiles:
+
87 for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
+
88 logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
+
89 matdoc = loader.convertToMaterialX([], shadingModel, {}, prefix)
+
90 valid, errors = loader.validateMaterialXDocument(matdoc)
+
91 if valid:
+
92 fileName = os.path.join(outputDir, f'PhysicallyBasedMaterialX_{prefix}.mtlx')
+
93 loader.writeMaterialXToFile(fileName)
+
94 logger.info(f'> Write: {fileName}')
+
95
+
96 else:
+
97 for shadingModel, prefix in zip(shadingModels, shadingModelPrefixes):
+
98 logger.info(f'> Generate MaterialX for shading model: {shadingModel}')
+
99 for mat in loader.getJSONMaterialNames():
+
100 materialFilter = [mat]
+
101 matdoc = loader.convertToMaterialX(materialFilter, shadingModel, {}, prefix)
+
102 if matdoc is not None:
+
103 valid, errors = loader.validateMaterialXDocument(matdoc)
+
104 if valid:
+
105 fileName = os.path.join(outputDir, f'PB_{prefix}_{mat}.mtlx')
+
106 loader.writeMaterialXToFile(fileName)
+
107 logger.info(f'> Write: {fileName}')
+
108
+
109 else:
+
110 logger.info('Could not retrieve PhysicallyBased Materials')
+
111
+
112if __name__ == '__main__':
+
113 physicallBasedMaterialXCmd()
diff --git a/documents/html/plus.svg b/documents/html/plus.svg new file mode 100644 index 0000000..0752016 --- /dev/null +++ b/documents/html/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/documents/html/plusd.svg b/documents/html/plusd.svg new file mode 100644 index 0000000..0c65bfe --- /dev/null +++ b/documents/html/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/documents/html/resize.js b/documents/html/resize.js index e1ad0fe..178d03b 100644 --- a/documents/html/resize.js +++ b/documents/html/resize.js @@ -22,119 +22,126 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function initResizable() -{ - var cookie_namespace = 'doxygen'; - var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight; - function readCookie(cookie) - { - var myCookie = cookie_namespace+"_"+cookie+"="; - if (document.cookie) { - var index = document.cookie.indexOf(myCookie); - if (index != -1) { - var valStart = index + myCookie.length; - var valEnd = document.cookie.indexOf(";", valStart); - if (valEnd == -1) { - valEnd = document.cookie.length; - } - var val = document.cookie.substring(valStart, valEnd); - return val; - } - } - return 0; - } - - function writeCookie(cookie, val, expiration) - { - if (val==undefined) return; - if (expiration == null) { - var date = new Date(); - date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week - expiration = date.toGMTString(); - } - document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; - } +function initResizable(treeview) { + let sidenav,navtree,content,header,footer,barWidth=6; + const RESIZE_COOKIE_NAME = ''+'width'; - function resizeWidth() - { - var windowWidth = $(window).width() + "px"; - var sidenavWidth = $(sidenav).outerWidth(); + function resizeWidth() { + const sidenavWidth = $(sidenav).outerWidth(); content.css({marginLeft:parseInt(sidenavWidth)+"px"}); - writeCookie('width',sidenavWidth-barWidth, null); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); + } + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); } - function restoreWidth(navWidth) - { - var windowWidth = $(window).width() + "px"; + function restoreWidth(navWidth) { content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + } sidenav.css({width:navWidth + "px"}); } - function resizeHeight() - { - var headerHeight = header.outerHeight(); - var footerHeight = footer.outerHeight(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - content.css({height:windowHeight + "px"}); - navtree.css({height:windowHeight + "px"}); - sidenav.css({height:windowHeight + "px"}); - var width=$(window).width(); - if (width!=collapsedWidth) { - if (width=desktop_vp) { - if (!collapsed) { - collapseExpand(); - } - } else if (width>desktop_vp && collapsedWidth0) { - restoreWidth(0); - collapsed=true; - } - else { - var width = readCookie('width'); - if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } - collapsed=false; + newWidth=0; + } else { + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + newWidth = (width>250 && width<$(window).width()) ? width : 250; } + restoreWidth(newWidth); + const sidenavWidth = $(sidenav).outerWidth(); + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); } header = $("#top"); - sidenav = $("#side-nav"); content = $("#doc-content"); - navtree = $("#nav-tree"); footer = $("#nav-path"); - $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); - $(sidenav).resizable({ minWidth: 0 }); - $(window).resize(function() { resizeHeight(); }); - var device = navigator.userAgent.toLowerCase(); - var touch_device = device.match(/(iphone|ipod|ipad|android)/); - if (touch_device) { /* wider split bar for touch only devices */ - $(sidenav).css({ paddingRight:'20px' }); - $('.ui-resizable-e').css({ width:'20px' }); - $('#nav-sync').css({ right:'34px' }); - barWidth=20; + sidenav = $("#side-nav"); + if (!treeview) { +// title = $("#titlearea"); +// titleH = $(title).height(); +// let animating = false; +// content.on("scroll", function() { +// slideOpts = { duration: 200, +// step: function() { +// contentHeight = $(window).height() - header.outerHeight(); +// content.css({ height : contentHeight + "px" }); +// }, +// done: function() { animating=false; } +// }; +// if (content.scrollTop()>titleH && title.css('display')!='none' && !animating) { +// title.slideUp(slideOpts); +// animating=true; +// } else if (content.scrollTop()<=titleH && title.css('display')=='none' && !animating) { +// title.slideDown(slideOpts); +// animating=true; +// } +// }); + } else { + navtree = $("#nav-tree"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); } - var width = readCookie('width'); - if (width) { restoreWidth(width); } else { resizeWidth(); } - resizeHeight(); - var url = location.href; - var i=url.indexOf("#"); + $(window).resize(function() { resizeHeight(treeview); }); + if (treeview) + { + const device = navigator.userAgent.toLowerCase(); + const touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + if (width) { restoreWidth(width); } else { resizeWidth(); } + } + resizeHeight(treeview); + const url = location.href; + const i=url.indexOf("#"); if (i>=0) window.location.hash=url.substr(i); - var _preventDefault = function(evt) { evt.preventDefault(); }; - $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); - $(".ui-resizable-handle").dblclick(collapseExpand); - $(window).on('load',resizeHeight); + const _preventDefault = function(evt) { evt.preventDefault(); }; + if (treeview) + { + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + // workaround for firefox + $("body").css({overflow: "hidden"}); + } + $(window).on('load',function() { resizeHeight(treeview); }); } /* @license-end */ diff --git a/documents/html/search/all_0.js b/documents/html/search/all_0.js index a7f8903..f0d5100 100644 --- a/documents/html/search/all_0.js +++ b/documents/html/search/all_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['_5f_5finit_5f_5f_0',['__init__',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a562aa01290163eac86d6b7a2a8cb7382',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] + ['_5f_5finit_5f_5f_0',['__init__',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ac0402372fc17f1b12d5fb9e0222d8db9',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_1.js b/documents/html/search/all_1.js index b08b4da..d04f415 100644 --- a/documents/html/search/all_1.js +++ b/documents/html/search/all_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['addcomment_1',['addComment',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ae9e0898cb48b3c163eeea4e7c035cc92',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.addComment()'],['../class_js_physically_based_material_loader.html#aedfda1b37416f4385f4c29f6671ad5a7',1,'JsPhysicallyBasedMaterialLoader::addComment()']]] + ['addcomment_0',['addComment',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aeebf1a5739a076154a34bd6d58bea8d4',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.addComment()'],['../class_js_physically_based_material_loader.html#aedfda1b37416f4385f4c29f6671ad5a7',1,'JsPhysicallyBasedMaterialLoader::addComment()']]] ]; diff --git a/documents/html/search/all_10.js b/documents/html/search/all_10.js index aebbd2d..e27ff31 100644 --- a/documents/html/search/all_10.js +++ b/documents/html/search/all_10.js @@ -1,5 +1,5 @@ var searchData= [ - ['validatedocument_41',['validateDocument',['../class_js_physically_based_material_loader.html#af3a192ef1a27b937ab8d5b67eeebb808',1,'JsPhysicallyBasedMaterialLoader']]], - ['validatematerialxdocument_42',['validateMaterialXDocument',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a0e370e9ac4e8cefa9ab0136067ed55cf',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] + ['validatedocument_0',['validateDocument',['../class_js_physically_based_material_loader.html#af3a192ef1a27b937ab8d5b67eeebb808',1,'JsPhysicallyBasedMaterialLoader']]], + ['validatematerialxdocument_1',['validateMaterialXDocument',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a611d7f557adf6ca07928a7f7cac6c8dc',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_11.js b/documents/html/search/all_11.js index 563e654..858d4a8 100644 --- a/documents/html/search/all_11.js +++ b/documents/html/search/all_11.js @@ -1,8 +1,8 @@ var searchData= [ - ['writejsontofile_43',['writeJSONToFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aec5e05618ea141395f94a2ecc897ab96',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['writematerialfiles_44',['writeMaterialFiles',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a547938c19b0d7e814389a4f6e6da3b1d',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['writematerialnamestofile_45',['writeMaterialNamesToFile',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#ad058328e04f5400c5d33c93f4a116ea9',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['writematerialxtofile_46',['writeMaterialXToFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#adefb5c1b44257ae287109366909e914c',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['writepackagedatatofile_47',['writePackageDataToFile',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a6e21d13a797c2291f867883624ec1e26',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] + ['writejsontofile_0',['writeJSONToFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a9234b66dabe72170e0a47f61722e9761',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['writematerialfiles_1',['writeMaterialFiles',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a547938c19b0d7e814389a4f6e6da3b1d',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['writematerialnamestofile_2',['writeMaterialNamesToFile',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a007539622ada6fdeda6b61d260c9824f',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['writematerialxtofile_3',['writeMaterialXToFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a4a4c8283eead5ae269a566782fd55fa3',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['writepackagedatatofile_4',['writePackageDataToFile',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a6e21d13a797c2291f867883624ec1e26',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] ]; diff --git a/documents/html/search/all_2.js b/documents/html/search/all_2.js index 53e59e0..d12db3e 100644 --- a/documents/html/search/all_2.js +++ b/documents/html/search/all_2.js @@ -1,6 +1,6 @@ var searchData= [ - ['constructor_2',['constructor',['../class_js_physically_based_material_loader.html#a5f0042da938b9c18e1906422a61962cb',1,'JsPhysicallyBasedMaterialLoader']]], - ['converttomaterialx_3',['convertToMaterialX',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ad568a7f8abedc69fb614271dd3faff2a',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.convertToMaterialX()'],['../class_js_physically_based_material_loader.html#ae1e44b5689e8a3d9b434ea9828c9ae9d',1,'JsPhysicallyBasedMaterialLoader::convertToMaterialX()']]], - ['converttomaterialxstring_4',['convertToMaterialXString',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a7935dfb3fc52dfa51d4ddef5016d28f7',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] + ['constructor_0',['constructor',['../class_js_physically_based_material_loader.html#a5f0042da938b9c18e1906422a61962cb',1,'JsPhysicallyBasedMaterialLoader']]], + ['converttomaterialx_1',['convertToMaterialX',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ad568a7f8abedc69fb614271dd3faff2a',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.convertToMaterialX()'],['../class_js_physically_based_material_loader.html#ae1e44b5689e8a3d9b434ea9828c9ae9d',1,'JsPhysicallyBasedMaterialLoader::convertToMaterialX()']]], + ['converttomaterialxstring_2',['convertToMaterialXString',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a761fb96e854016db0502cee510c02ef7',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_3.js b/documents/html/search/all_3.js index 82232af..1de69fb 100644 --- a/documents/html/search/all_3.js +++ b/documents/html/search/all_3.js @@ -1,5 +1,5 @@ var searchData= [ - ['doc_5',['doc',['../class_js_physically_based_material_loader.html#a19ba3f660663b91ec2be3fe81b45b2b4',1,'JsPhysicallyBasedMaterialLoader']]], - ['downloadpackage_6',['downloadPackage',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a4f093fe70aa6759e2a137fbff2591c6c',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] + ['doc_0',['doc',['../class_js_physically_based_material_loader.html#a19ba3f660663b91ec2be3fe81b45b2b4',1,'JsPhysicallyBasedMaterialLoader']]], + ['downloadpackage_1',['downloadPackage',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a78bd0830e40c7ed0f19a3f6792a79b49',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] ]; diff --git a/documents/html/search/all_4.js b/documents/html/search/all_4.js index 35f6ac1..7e24e7c 100644 --- a/documents/html/search/all_4.js +++ b/documents/html/search/all_4.js @@ -1,4 +1,4 @@ var searchData= [ - ['extractpackagedata_7',['extractPackageData',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#accf473c9f3b11dfe6184228bb45c1234',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] + ['extractpackagedata_0',['extractPackageData',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a9868e4fb69f84012a19957c624e0c1dc',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] ]; diff --git a/documents/html/search/all_5.js b/documents/html/search/all_5.js index 1553b3d..69083dd 100644 --- a/documents/html/search/all_5.js +++ b/documents/html/search/all_5.js @@ -1,4 +1,4 @@ var searchData= [ - ['findmaterialsbyname_8',['findMaterialsByName',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a761935f0293fab3ffb6b852ecf543c64',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] + ['findmaterialsbyname_0',['findMaterialsByName',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a761935f0293fab3ffb6b852ecf543c64',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]] ]; diff --git a/documents/html/search/all_6.js b/documents/html/search/all_6.js index eeeceb3..2079dab 100644 --- a/documents/html/search/all_6.js +++ b/documents/html/search/all_6.js @@ -1,14 +1,14 @@ var searchData= [ - ['getinputremapping_9',['getInputRemapping',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a00df7f744ae51556d8f63db4360eef43',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getInputRemapping()'],['../class_js_physically_based_material_loader.html#a4cb1672349161e2f5b4f7f282814e491',1,'JsPhysicallyBasedMaterialLoader::getInputRemapping()']]], - ['getjson_10',['getJSON',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aae3e6a57ee0e7f49e394a172d87dc410',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSON()'],['../class_js_physically_based_material_loader.html#a4eec8fc92b4eec481aaf47dc4a8c19f8',1,'JsPhysicallyBasedMaterialLoader::getJSON()']]], - ['getjsonmaterialnames_11',['getJSONMaterialNames',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a0fac543d80540406546451822598309e',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSONMaterialNames()'],['../class_js_physically_based_material_loader.html#a2920d468eb277062a3be0c9b5a149876',1,'JsPhysicallyBasedMaterialLoader::getJSONMaterialNames()']]], - ['getmaterialnames_12',['getMaterialNames',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#adacaa6cff169e56b7df3ddb761ffcde0',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['getmaterials_13',['getMaterials',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a19a2e9d18f0191f9576f384d4f3ee4d9',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['getmaterialsasjsonstring_14',['getMaterialsAsJsonString',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a9f18efa789dd3a63ef8cd1abdcd38224',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['getmaterialsfromurl_15',['getMaterialsFromURL',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa38eb83c67b0f4c139f523450e1de525',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['getmaterialxdocument_16',['getMaterialXDocument',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ab5cb1ede45bf58bfeddb8948fde47a3e',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getMaterialXDocument()'],['../class_js_physically_based_material_loader.html#a50d3f165475f4b6857db44f46b3e24b9',1,'JsPhysicallyBasedMaterialLoader::getMaterialXDocument()']]], - ['getmaterialxstring_17',['getMaterialXString',['../class_js_physically_based_material_loader.html#a7dc871ee8d3fc8aa1f5cc1429f27bc7a',1,'JsPhysicallyBasedMaterialLoader']]], - ['getphysicallybasedmaterials_18',['getPhysicallyBasedMaterials',['../class_js_physically_based_material_loader.html#a8faa3eec07fd099bb55a65187b07460d',1,'JsPhysicallyBasedMaterialLoader']]], - ['gpuopenmaterialloader_19',['GPUOpenMaterialLoader',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html',1,'materialxMaterials::GPUOpenLoader']]] + ['getinputremapping_0',['getInputRemapping',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a00df7f744ae51556d8f63db4360eef43',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getInputRemapping()'],['../class_js_physically_based_material_loader.html#a4cb1672349161e2f5b4f7f282814e491',1,'JsPhysicallyBasedMaterialLoader::getInputRemapping()']]], + ['getjson_1',['getJSON',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aae3e6a57ee0e7f49e394a172d87dc410',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSON()'],['../class_js_physically_based_material_loader.html#a4eec8fc92b4eec481aaf47dc4a8c19f8',1,'JsPhysicallyBasedMaterialLoader::getJSON()']]], + ['getjsonmaterialnames_2',['getJSONMaterialNames',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a0fac543d80540406546451822598309e',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getJSONMaterialNames()'],['../class_js_physically_based_material_loader.html#a2920d468eb277062a3be0c9b5a149876',1,'JsPhysicallyBasedMaterialLoader::getJSONMaterialNames()']]], + ['getmaterialnames_3',['getMaterialNames',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#adacaa6cff169e56b7df3ddb761ffcde0',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['getmaterials_4',['getMaterials',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a19a2e9d18f0191f9576f384d4f3ee4d9',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['getmaterialsasjsonstring_5',['getMaterialsAsJsonString',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#a9f18efa789dd3a63ef8cd1abdcd38224',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['getmaterialsfromurl_6',['getMaterialsFromURL',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa38eb83c67b0f4c139f523450e1de525',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['getmaterialxdocument_7',['getMaterialXDocument',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ab5cb1ede45bf58bfeddb8948fde47a3e',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.getMaterialXDocument()'],['../class_js_physically_based_material_loader.html#a50d3f165475f4b6857db44f46b3e24b9',1,'JsPhysicallyBasedMaterialLoader::getMaterialXDocument()']]], + ['getmaterialxstring_8',['getMaterialXString',['../class_js_physically_based_material_loader.html#a7dc871ee8d3fc8aa1f5cc1429f27bc7a',1,'JsPhysicallyBasedMaterialLoader']]], + ['getphysicallybasedmaterials_9',['getPhysicallyBasedMaterials',['../class_js_physically_based_material_loader.html#a8faa3eec07fd099bb55a65187b07460d',1,'JsPhysicallyBasedMaterialLoader']]], + ['gpuopenmaterialloader_10',['GPUOpenMaterialLoader',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html',1,'materialxMaterials::GPUOpenLoader']]] ]; diff --git a/documents/html/search/all_7.js b/documents/html/search/all_7.js index 6861dd2..29e842c 100644 --- a/documents/html/search/all_7.js +++ b/documents/html/search/all_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['headers_20',['headers',['../class_js_physically_based_material_loader.html#ab92e487175c47f2d8f2c9ce2f8500765',1,'JsPhysicallyBasedMaterialLoader']]] + ['headers_0',['headers',['../class_js_physically_based_material_loader.html#ab92e487175c47f2d8f2c9ce2f8500765',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_8.js b/documents/html/search/all_8.js index f09703a..c101de1 100644 --- a/documents/html/search/all_8.js +++ b/documents/html/search/all_8.js @@ -1,4 +1,4 @@ var searchData= [ - ['initializeinputremapping_21',['initializeInputRemapping',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#abd638d0f058fc0c5b15858c28c759df3',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.initializeInputRemapping()'],['../class_js_physically_based_material_loader.html#a35561414959983ac09c200bd74bacc9a',1,'JsPhysicallyBasedMaterialLoader::initializeInputRemapping()']]] + ['initializeinputremapping_0',['initializeInputRemapping',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#aa520500f3603a142c1df6260bee964bd',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.initializeInputRemapping()'],['../class_js_physically_based_material_loader.html#a35561414959983ac09c200bd74bacc9a',1,'JsPhysicallyBasedMaterialLoader::initializeInputRemapping()']]] ]; diff --git a/documents/html/search/all_9.js b/documents/html/search/all_9.js index 1859d42..849394a 100644 --- a/documents/html/search/all_9.js +++ b/documents/html/search/all_9.js @@ -1,4 +1,4 @@ var searchData= [ - ['jsphysicallybasedmaterialloader_22',['JsPhysicallyBasedMaterialLoader',['../class_js_physically_based_material_loader.html',1,'']]] + ['jsphysicallybasedmaterialloader_0',['JsPhysicallyBasedMaterialLoader',['../class_js_physically_based_material_loader.html',1,'']]] ]; diff --git a/documents/html/search/all_a.js b/documents/html/search/all_a.js index a410106..c0fdf2d 100644 --- a/documents/html/search/all_a.js +++ b/documents/html/search/all_a.js @@ -1,7 +1,7 @@ var searchData= [ - ['loadmaterialsfromfile_23',['loadMaterialsFromFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a1695a75528ef0135abd02f6aab93d2c9',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['loadmaterialsfromstring_24',['loadMaterialsFromString',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a14c9374702631d0c03e305fb57b0c45c',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['loadmaterialx_25',['loadMaterialX',['../class_js_physically_based_material_loader.html#a61db9877dc4783b689e4091cebcc8de8',1,'JsPhysicallyBasedMaterialLoader']]], - ['loadstandardlibraries_26',['loadStandardLibraries',['../class_js_physically_based_material_loader.html#a5a31fc8486c2df7204263a0ca9af9410',1,'JsPhysicallyBasedMaterialLoader']]] + ['loadmaterialsfromfile_0',['loadMaterialsFromFile',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a1695a75528ef0135abd02f6aab93d2c9',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['loadmaterialsfromstring_1',['loadMaterialsFromString',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a14c9374702631d0c03e305fb57b0c45c',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['loadmaterialx_2',['loadMaterialX',['../class_js_physically_based_material_loader.html#a61db9877dc4783b689e4091cebcc8de8',1,'JsPhysicallyBasedMaterialLoader']]], + ['loadstandardlibraries_3',['loadStandardLibraries',['../class_js_physically_based_material_loader.html#a5a31fc8486c2df7204263a0ca9af9410',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_b.js b/documents/html/search/all_b.js index 2623af0..8216c80 100644 --- a/documents/html/search/all_b.js +++ b/documents/html/search/all_b.js @@ -1,9 +1,10 @@ var searchData= [ - ['gpuopenloader_27',['GPUOpenLoader',['../namespacematerialx_materials_1_1_g_p_u_open_loader.html',1,'materialxMaterials']]], - ['materialnames_28',['materialNames',['../class_js_physically_based_material_loader.html#a928e3076af0dcaf80dd46476c854a574',1,'JsPhysicallyBasedMaterialLoader']]], - ['materials_29',['materials',['../class_js_physically_based_material_loader.html#a57aeca3f4ef045e2f8d844495ea9bcf2',1,'JsPhysicallyBasedMaterialLoader']]], - ['mx_30',['mx',['../class_js_physically_based_material_loader.html#aaa493b357111b16358c52bdcd99047b6',1,'JsPhysicallyBasedMaterialLoader']]], - ['mxmaterialnames_31',['mxMaterialNames',['../class_js_physically_based_material_loader.html#ab5c494882c44f41a973cd826591c0497',1,'JsPhysicallyBasedMaterialLoader']]], - ['physicallybasedmaterialx_32',['physicallyBasedMaterialX',['../namespacematerialx_materials_1_1physically_based_material_x.html',1,'materialxMaterials']]] + ['materialnames_0',['materialNames',['../class_js_physically_based_material_loader.html#a928e3076af0dcaf80dd46476c854a574',1,'JsPhysicallyBasedMaterialLoader']]], + ['materials_1',['materials',['../class_js_physically_based_material_loader.html#a57aeca3f4ef045e2f8d844495ea9bcf2',1,'JsPhysicallyBasedMaterialLoader']]], + ['materialxmaterials_2',['MaterialXMaterials',['../index.html',1,'']]], + ['materialxmaterials_3a_3agpuopenloader_3',['GPUOpenLoader',['../namespacematerialx_materials_1_1_g_p_u_open_loader.html',1,'materialxMaterials']]], + ['materialxmaterials_3a_3aphysicallybasedmaterialx_4',['physicallyBasedMaterialX',['../namespacematerialx_materials_1_1physically_based_material_x.html',1,'materialxMaterials']]], + ['mx_5',['mx',['../class_js_physically_based_material_loader.html#aaa493b357111b16358c52bdcd99047b6',1,'JsPhysicallyBasedMaterialLoader']]], + ['mxmaterialnames_6',['mxMaterialNames',['../class_js_physically_based_material_loader.html#ab5c494882c44f41a973cd826591c0497',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_c.js b/documents/html/search/all_c.js index c1ddae8..e516b63 100644 --- a/documents/html/search/all_c.js +++ b/documents/html/search/all_c.js @@ -1,5 +1,6 @@ var searchData= [ - ['physicallybasedmaterialloader_33',['PhysicallyBasedMaterialLoader',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html',1,'materialxMaterials::physicallyBasedMaterialX']]], - ['printmaterials_34',['printMaterials',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a836f19e92aeee30884613e4d9e2c4698',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] + ['physicallybasedmaterialloader_0',['PhysicallyBasedMaterialLoader',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html',1,'materialxMaterials::physicallyBasedMaterialX']]], + ['physicallybasedmaterialxcmd_2epy_1',['physicallyBasedMaterialXCmd.py',['../physically_based_material_x_cmd_8py.html',1,'']]], + ['printmaterials_2',['printMaterials',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#abbf979af8310df66bb3888886d40504d',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_d.js b/documents/html/search/all_d.js index 9d2a76a..a4d9049 100644 --- a/documents/html/search/all_d.js +++ b/documents/html/search/all_d.js @@ -1,5 +1,5 @@ var searchData= [ - ['readmaterialfiles_35',['readMaterialFiles',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#aea6443970a62b7e354441e331e99d962',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], - ['remapmap_36',['remapMap',['../class_js_physically_based_material_loader.html#a547c339e2799cf483f11af5c1883a5ac',1,'JsPhysicallyBasedMaterialLoader']]] + ['readmaterialfiles_0',['readMaterialFiles',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html#aea6443970a62b7e354441e331e99d962',1,'materialxMaterials::GPUOpenLoader::GPUOpenMaterialLoader']]], + ['remapmap_1',['remapMap',['../class_js_physically_based_material_loader.html#a547c339e2799cf483f11af5c1883a5ac',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_e.js b/documents/html/search/all_e.js index 1d0f288..b7a089d 100644 --- a/documents/html/search/all_e.js +++ b/documents/html/search/all_e.js @@ -1,6 +1,6 @@ var searchData= [ - ['setdebugging_37',['setDebugging',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a55f6fd9b37754a25499353a360f7c85c',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], - ['skiplibraryelement_38',['skipLibraryElement',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ad188128fa3e0493c5dcb6bf0a139329f',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.skipLibraryElement()'],['../class_js_physically_based_material_loader.html#a0ff670b529d0d01fe96d6e7d656c8f2a',1,'JsPhysicallyBasedMaterialLoader::skipLibraryElement(element)']]], - ['stdlib_39',['stdlib',['../class_js_physically_based_material_loader.html#ac5ea5952dab870a8e936f1974b34a8a6',1,'JsPhysicallyBasedMaterialLoader']]] + ['setdebugging_0',['setDebugging',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#a8dd7341a2015ea81c2affca688f91f52',1,'materialxMaterials::physicallyBasedMaterialX::PhysicallyBasedMaterialLoader']]], + ['skiplibraryelement_1',['skipLibraryElement',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html#ad188128fa3e0493c5dcb6bf0a139329f',1,'materialxMaterials.physicallyBasedMaterialX.PhysicallyBasedMaterialLoader.skipLibraryElement()'],['../class_js_physically_based_material_loader.html#a0ff670b529d0d01fe96d6e7d656c8f2a',1,'JsPhysicallyBasedMaterialLoader::skipLibraryElement(element)']]], + ['stdlib_2',['stdlib',['../class_js_physically_based_material_loader.html#ac5ea5952dab870a8e936f1974b34a8a6',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/all_f.js b/documents/html/search/all_f.js index c9f4e22..007f0c0 100644 --- a/documents/html/search/all_f.js +++ b/documents/html/search/all_f.js @@ -1,4 +1,4 @@ var searchData= [ - ['url_40',['url',['../class_js_physically_based_material_loader.html#abd951385181b05d2e82d28a0d6fe4918',1,'JsPhysicallyBasedMaterialLoader']]] + ['url_0',['url',['../class_js_physically_based_material_loader.html#abd951385181b05d2e82d28a0d6fe4918',1,'JsPhysicallyBasedMaterialLoader']]] ]; diff --git a/documents/html/search/classes_0.js b/documents/html/search/classes_0.js index 574f0fc..dfad881 100644 --- a/documents/html/search/classes_0.js +++ b/documents/html/search/classes_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['gpuopenmaterialloader_48',['GPUOpenMaterialLoader',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html',1,'materialxMaterials::GPUOpenLoader']]] + ['gpuopenmaterialloader_0',['GPUOpenMaterialLoader',['../classmaterialx_materials_1_1_g_p_u_open_loader_1_1_g_p_u_open_material_loader.html',1,'materialxMaterials::GPUOpenLoader']]] ]; diff --git a/documents/html/search/classes_1.js b/documents/html/search/classes_1.js index 974f4d9..849394a 100644 --- a/documents/html/search/classes_1.js +++ b/documents/html/search/classes_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['jsphysicallybasedmaterialloader_49',['JsPhysicallyBasedMaterialLoader',['../class_js_physically_based_material_loader.html',1,'']]] + ['jsphysicallybasedmaterialloader_0',['JsPhysicallyBasedMaterialLoader',['../class_js_physically_based_material_loader.html',1,'']]] ]; diff --git a/documents/html/search/classes_2.js b/documents/html/search/classes_2.js index d2a25ad..301d59d 100644 --- a/documents/html/search/classes_2.js +++ b/documents/html/search/classes_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['physicallybasedmaterialloader_50',['PhysicallyBasedMaterialLoader',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html',1,'materialxMaterials::physicallyBasedMaterialX']]] + ['physicallybasedmaterialloader_0',['PhysicallyBasedMaterialLoader',['../classmaterialx_materials_1_1physically_based_material_x_1_1_physically_based_material_loader.html',1,'materialxMaterials::physicallyBasedMaterialX']]] ]; diff --git a/documents/html/search/close.svg b/documents/html/search/close.svg index a933eea..337d6cc 100644 --- a/documents/html/search/close.svg +++ b/documents/html/search/close.svg @@ -1,27 +1,14 @@ + - - - - image/svg+xml - - - - - + - - - - image/svg+xml - - - - - + - - - - image/svg+xml - - - - - - + - - - - image/svg+xml - - - - - + > - + /> + /> diff --git a/documents/html/search/mag_seld.svg b/documents/html/search/mag_seld.svg index 6e720dc..c906f84 100644 --- a/documents/html/search/mag_seld.svg +++ b/documents/html/search/mag_seld.svg @@ -1,74 +1,31 @@ - + - - - - image/svg+xml - - - - - + > - + /> + /> diff --git a/documents/html/search/namespaces_0.js b/documents/html/search/namespaces_0.js index 16333d3..69fb16f 100644 --- a/documents/html/search/namespaces_0.js +++ b/documents/html/search/namespaces_0.js @@ -1,5 +1,5 @@ var searchData= [ - ['gpuopenloader_51',['GPUOpenLoader',['../namespacematerialx_materials_1_1_g_p_u_open_loader.html',1,'materialxMaterials']]], - ['physicallybasedmaterialx_52',['physicallyBasedMaterialX',['../namespacematerialx_materials_1_1physically_based_material_x.html',1,'materialxMaterials']]] + ['materialxmaterials_3a_3agpuopenloader_0',['GPUOpenLoader',['../namespacematerialx_materials_1_1_g_p_u_open_loader.html',1,'materialxMaterials']]], + ['materialxmaterials_3a_3aphysicallybasedmaterialx_1',['physicallyBasedMaterialX',['../namespacematerialx_materials_1_1physically_based_material_x.html',1,'materialxMaterials']]] ]; diff --git a/documents/html/search/search.css b/documents/html/search/search.css index 9074198..19f76f9 100644 --- a/documents/html/search/search.css +++ b/documents/html/search/search.css @@ -1,10 +1,33 @@ -/*---------------- Search Box */ +/*---------------- Search Box positioning */ + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} #MSearchBox { + display: inline-block; white-space : nowrap; - background: white; + background: var(--search-background-color); border-radius: 0.65em; - box-shadow: inset 0.5px 0.5px 3px 0px #555; + box-shadow: var(--search-box-shadow); z-index: 102; } @@ -17,28 +40,47 @@ #MSearchSelect { display: inline-block; vertical-align: middle; - height: 1.4em; - padding: 0 0 0 0.3em; - margin: 0; + width: 20px; + height: 19px; + background-image: var(--search-magnification-select-image); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: var(--search-magnification-image); + margin: 0 0 0 0.5em; + padding: 0; } + #MSearchField { display: inline-block; vertical-align: middle; width: 7.5em; - height: 1.1em; + height: 19px; margin: 0 0.15em; padding: 0; line-height: 1em; border:none; - color: #909090; + color: var(--search-foreground-color); outline: none; - font-family: Arial, Verdana, sans-serif; + font-family: var(--font-family-search); -webkit-border-radius: 0px; border-radius: 0px; background: none; } +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} #MSearchBox .right { display: inline-block; @@ -59,23 +101,15 @@ } #MSearchCloseImg { - height: 1.4em; padding: 0.3em; margin: 0; } .MSearchBoxActive #MSearchField { - color: #000000; + color: var(--search-active-color); } -#main-menu > li:last-child { - /* This
  • object is the parent of the search bar */ - display: flex; - justify-content: center; - align-items: center; - height: 36px; - margin-right: 1em; -} + /*---------------- Search filter selection */ @@ -83,8 +117,8 @@ display: none; position: absolute; left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; + border: 1px solid var(--search-filter-border-color); + background-color: var(--search-filter-background-color); z-index: 10001; padding-top: 4px; padding-bottom: 4px; @@ -97,7 +131,7 @@ } .SelectItem { - font: 8pt Arial, Verdana, sans-serif; + font: 8pt var(--font-family-search); padding-left: 2px; padding-right: 12px; border: 0px; @@ -105,7 +139,7 @@ span.SelectionMark { margin-right: 4px; - font-family: monospace; + font-family: var(--font-family-monospace); outline-style: none; text-decoration: none; } @@ -113,7 +147,7 @@ span.SelectionMark { a.SelectItem { display: block; outline-style: none; - color: #000000; + color: var(--search-filter-foreground-color); text-decoration: none; padding-left: 6px; padding-right: 12px; @@ -121,14 +155,14 @@ a.SelectItem { a.SelectItem:focus, a.SelectItem:active { - color: #000000; + color: var(--search-filter-foreground-color); outline-style: none; text-decoration: none; } a.SelectItem:hover { - color: #FFFFFF; - background-color: #3D578C; + color: var(--search-filter-highlight-text-color); + background-color: var(--search-filter-highlight-bg-color); outline-style: none; text-decoration: none; cursor: pointer; @@ -138,7 +172,7 @@ a.SelectItem:hover { /*---------------- Search results window */ iframe#MSearchResults { - width: 60ex; + /*width: 60ex;*/ height: 15em; } @@ -146,9 +180,12 @@ iframe#MSearchResults { display: none; position: absolute; left: 0; top: 0; - border: 1px solid #000; - background-color: #EEF1F7; + border: 1px solid var(--search-results-border-color); + background-color: var(--search-results-background-color); z-index:10000; + width: 300px; + height: 400px; + overflow: auto; } /* ----------------------------------- */ @@ -156,7 +193,6 @@ iframe#MSearchResults { #SRIndex { clear:both; - padding-bottom: 15px; } .SREntry { @@ -169,8 +205,9 @@ iframe#MSearchResults { padding: 1px 5px; } -body.SRPage { +div.SRPage { margin: 5px 2px; + background-color: var(--search-results-background-color); } .SRChildren { @@ -182,17 +219,18 @@ body.SRPage { } .SRSymbol { - font-weight: bold; - color: #425E97; - font-family: Arial, Verdana, sans-serif; + font-weight: bold; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); text-decoration: none; outline: none; } a.SRScope { display: block; - color: #425E97; - font-family: Arial, Verdana, sans-serif; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + font-size: 8pt; text-decoration: none; outline: none; } @@ -204,14 +242,14 @@ a.SRScope:focus, a.SRScope:active { span.SRScope { padding-left: 4px; - font-family: Arial, Verdana, sans-serif; + font-family: var(--font-family-search); } .SRPage .SRStatus { padding: 2px 5px; font-size: 8pt; font-style: italic; - font-family: Arial, Verdana, sans-serif; + font-family: var(--font-family-search); } .SRResult { @@ -225,14 +263,10 @@ div.searchresults { /*---------------- External search page results */ -.searchresult { - background-color: #F0F3F8; -} - .pages b { color: white; padding: 5px 5px 3px 5px; - background-image: url("../tab_a.png"); + background-image: var(--nav-gradient-active-image-parent); background-repeat: repeat-x; text-shadow: 0 1px 1px #000000; } diff --git a/documents/html/search/search.js b/documents/html/search/search.js index fb226f7..666af01 100644 --- a/documents/html/search/search.js +++ b/documents/html/search/search.js @@ -22,56 +22,9 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -function convertToId(search) -{ - var result = ''; - for (i=0;i document.getElementById("MSearchField"); + this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); + this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); + this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); + this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); + this.DOMSearchClose = () => document.getElementById("MSearchClose"); + this.DOMSearchBox = () => document.getElementById("MSearchBox"); // ------------ Event Handlers // Called when focus is added or removed from the search field. - this.OnSearchFieldFocus = function(isActive) - { + this.OnSearchFieldFocus = function(isActive) { this.Activate(isActive); } - this.OnSearchSelectShow = function() - { - var searchSelectWindow = this.DOMSearchSelectWindow(); - var searchField = this.DOMSearchSelect(); - - if (this.insideFrame) - { - var left = getXPos(searchField); - var top = getYPos(searchField); - left += searchField.offsetWidth + 6; - top += searchField.offsetHeight; - - // show search selection popup - searchSelectWindow.style.display='block'; - left -= searchSelectWindow.offsetWidth; - searchSelectWindow.style.left = left + 'px'; - searchSelectWindow.style.top = top + 'px'; - } - else - { - var left = getXPos(searchField); - var top = getYPos(searchField); - top += searchField.offsetHeight; - - // show search selection popup - searchSelectWindow.style.display='block'; - searchSelectWindow.style.left = left + 'px'; - searchSelectWindow.style.top = top + 'px'; - } + this.OnSearchSelectShow = function() { + const searchSelectWindow = this.DOMSearchSelectWindow(); + const searchField = this.DOMSearchSelect(); + + const left = getXPos(searchField); + const top = getYPos(searchField) + searchField.offsetHeight; + + // show search selection popup + searchSelectWindow.style.display='block'; + searchSelectWindow.style.left = left + 'px'; + searchSelectWindow.style.top = top + 'px'; // stop selection hide timer - if (this.hideTimeout) - { + if (this.hideTimeout) { clearTimeout(this.hideTimeout); this.hideTimeout=0; } return false; // to avoid "image drag" default event } - this.OnSearchSelectHide = function() - { - this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()", + this.OnSearchSelectHide = function() { + this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), this.closeSelectionTimeout); } // Called when the content of the search field is changed. - this.OnSearchFieldChange = function(evt) - { - if (this.keyTimeout) // kill running timer - { + this.OnSearchFieldChange = function(evt) { + if (this.keyTimeout) { // kill running timer clearTimeout(this.keyTimeout); this.keyTimeout = 0; } - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 || e.keyCode==13) - { - if (e.shiftKey==1) - { + const e = evt ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) { + if (e.shiftKey==1) { this.OnSearchSelectShow(); - var win=this.DOMSearchSelectWindow(); - for (i=0;i do a search - { + const searchValue = this.DOMSearchField().value.replace(/ +/g, ""); + if (searchValue!="" && this.searchActive) { // something was found -> do a search this.Search(); } } - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { + } else if (e.keyCode==38 && this.searchIndex>0) { // Up this.searchIndex--; this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { + } else if (e.keyCode==13 || e.keyCode==27) { + e.stopPropagation(); this.OnSelectItem(this.searchIndex); this.CloseSelectionWindow(); this.DOMSearchField().focus(); @@ -314,111 +239,108 @@ function SearchBox(name, resultsPath, inFrame, label, extension) // --------- Actions // Closes the results window. - this.CloseResultsWindow = function() - { + this.CloseResultsWindow = function() { this.DOMPopupSearchResultsWindow().style.display = 'none'; this.DOMSearchClose().style.display = 'none'; this.Activate(false); } - this.CloseSelectionWindow = function() - { + this.CloseSelectionWindow = function() { this.DOMSearchSelectWindow().style.display = 'none'; } // Performs a search. - this.Search = function() - { + this.Search = function() { this.keyTimeout = 0; // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair - { + const code = searchValue.toLowerCase().charCodeAt(0); + let idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair idxChar = searchValue.substr(0, 2); } - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) - { - var hexCode=idx.toString(16); - resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + this.extension; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; + let jsFile; + let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) { + const hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + const loadJS = function(url, impl, loc) { + const scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); } - else // nothing available for this search term - { - resultsPage = this.resultsPath + '/nomatches' + this.extension; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; + + const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + const domSearchBox = this.DOMSearchBox(); + const domPopupSearchResults = this.DOMPopupSearchResults(); + const domSearchClose = this.DOMSearchClose(); + const resultsPath = this.resultsPath; + + const handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') { + domSearchClose.style.display = 'inline-block'; + let left = getXPos(domSearchBox) + 150; + let top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + const maxWidth = document.body.clientWidth; + const maxHeight = document.body.clientHeight; + let width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + let height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } } - window.frames.MSearchResults.location = resultsPageWithSearch; - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (domPopupSearchResultsWindow.style.display!='block') - { - var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline-block'; - if (this.insideFrame) - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - domPopupSearchResultsWindow.style.position = 'relative'; - domPopupSearchResultsWindow.style.display = 'block'; - var width = document.body.clientWidth - 8; // the -8 is for IE :-( - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResults.style.width = width + 'px'; - } - else - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; - var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - } + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); } this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; } // -------- Activation Functions // Activates or deactivates the search panel, resetting things to // their default values if necessary. - this.Activate = function(isActive) - { + this.Activate = function(isActive) { if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) { this.DOMSearchBox().className = 'MSearchBoxActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == this.searchLabel) // clear "Search" term upon entry - { - searchField.value = ''; - this.searchActive = true; - } - } - else if (!isActive) // directly remove the panel - { + this.searchActive = true; + } else if (!isActive) { // directly remove the panel this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.DOMSearchField().value = this.searchLabel; this.searchActive = false; this.lastSearchValue = '' this.lastResultsPage = ''; + this.DOMSearchField().value = ''; } } } @@ -426,391 +348,347 @@ function SearchBox(name, resultsPath, inFrame, label, extension) // ----------------------------------------------------------------------- // The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') - { - return element; - } +function SearchResults() { + + function convertToId(search) { + let result = ''; + for (let i=0;i. + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) { + const parentElement = document.getElementById(id); + let element = parentElement.firstChild; + + while (element && element!=parentElement) { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { + return element; } - } - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { + element = element.firstChild; + } else if (element.nextSibling) { + element = element.nextSibling; + } else { + do { + element = element.parentNode; } - else - { - element.style.display = 'block'; + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) { + element = element.nextSibling; } } } + } - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); + this.Toggle = function(id) { + const element = this.FindChildElement(id); + if (element) { + if (element.style.display == 'block') { + element.style.display = 'none'; + } else { + element.style.display = 'block'; } + } + } - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) { + if (!search) { // get search word from URL + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + const resultRows = document.getElementsByTagName("div"); + let matches = 0; + + let i = 0; + while (i < resultRows.length) { + const row = resultRows.item(i); + if (row.className == "SRResult") { + let rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) { + row.style.display = 'block'; + matches++; + } else { + row.style.display = 'none'; } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; + i++; } + document.getElementById("Searching").style.display='none'; + if (matches == 0) { // no results + document.getElementById("NoMatches").style.display='block'; + } else { // at least one result + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; + // return the first item with index index or higher that is visible + this.NavNext = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; } - return focusItem; + focusItem=null; + index++; } + return focusItem; + } - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; + this.NavPrev = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; } - return focusItem; + focusItem=null; + index--; } + return focusItem; + } - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; + this.ProcessKeys = function(e) { + if (e.type == "keydown") { + this.repeatOn = false; + this.lastKey = e.keyCode; + } else if (e.type == "keypress") { + if (!this.repeatOn) { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; + } else if (e.type == "keyup") { + this.lastKey = 0; + this.repeatOn = false; } + return this.lastKey!=0; + } - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; + this.Nav = function(evt,itemIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + const newIndex = itemIndex-1; + let focusItem = this.NavPrev(newIndex); + if (focusItem) { + let child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') { // children visible + let n=0; + let tmpElem; + for (;;) { // search for last child + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) { + focusItem = tmpElem; + } else { // found it! + break; } + n++; } } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - parent.document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; + if (focusItem) { + focusItem.focus(); + } else { // return focus to search field + document.getElementById("MSearchField").focus(); } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; + } else if (this.lastKey==40) { // Down + const newIndex = itemIndex+1; + let focusItem; + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') { // children visible + focusItem = document.getElementById('Item'+itemIndex+'_c0'); } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } else if (this.lastKey==39) { // Right + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } else if (this.lastKey==37) { // Left + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; } + return false; + } - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } + this.NavChild = function(evt,itemIndex,childIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + if (childIndex>0) { + const newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } else { // already at first child, jump to parent + document.getElementById('Item'+itemIndex).focus(); } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); + } else if (this.lastKey==40) { // Down + const newIndex = childIndex+1; + let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) { // last child, jump to parent next parent + elem = this.NavNext(itemIndex+1); } - else if (this.lastKey==13) // Enter - { - return true; + if (elem) { + elem.focus(); } - return false; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; } + return false; + } } -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} +function createResults(resultsPath) { -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} + function setKeyActions(elem,action) { + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); + } + + function setClassAttr(elem,attr) { + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); + } -function createResults() -{ - var results = document.getElementById("SRResults"); - for (var e=0; e { + const id = elem[0]; + const srResult = document.createElement('div'); srResult.setAttribute('id','SR_'+id); setClassAttr(srResult,'SRResult'); - var srEntry = document.createElement('div'); + const srEntry = document.createElement('div'); setClassAttr(srEntry,'SREntry'); - var srLink = document.createElement('a'); - srLink.setAttribute('id','Item'+e); - setKeyActions(srLink,'return searchResults.Nav(event,'+e+')'); + const srLink = document.createElement('a'); + srLink.setAttribute('id','Item'+index); + setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); setClassAttr(srLink,'SRSymbol'); - srLink.innerHTML = searchData[e][1][0]; + srLink.innerHTML = elem[1][0]; srEntry.appendChild(srLink); - if (searchData[e][1].length==2) // single result - { - srLink.setAttribute('href',searchData[e][1][1][0]); - if (searchData[e][1][1][1]) - { + if (elem[1].length==2) { // single result + srLink.setAttribute('href',resultsPath+elem[1][1][0]); + srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); + if (elem[1][1][1]) { srLink.setAttribute('target','_parent'); + } else { + srLink.setAttribute('target','_blank'); } - var srScope = document.createElement('span'); + const srScope = document.createElement('span'); setClassAttr(srScope,'SRScope'); - srScope.innerHTML = searchData[e][1][1][2]; + srScope.innerHTML = elem[1][1][2]; srEntry.appendChild(srScope); - } - else // multiple results - { + } else { // multiple results srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); - var srChildren = document.createElement('div'); + const srChildren = document.createElement('div'); setClassAttr(srChildren,'SRChildren'); - for (var c=0; cli>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} diff --git a/src/materialxMaterials.egg-info/PKG-INFO b/src/materialxMaterials.egg-info/PKG-INFO index ee330a8..b7aa791 100644 --- a/src/materialxMaterials.egg-info/PKG-INFO +++ b/src/materialxMaterials.egg-info/PKG-INFO @@ -318,7 +318,7 @@ A `Jupyter` notebook demonstrates the direct usage of the Python library. The ou

    Results

    -The following are some samples which have been rendered using the `MaterialXView` utility which is part of the MaterialX binary distribution. +The following are some samples which have been rendered using the `MaterialXViewer` utility which is part of the MaterialX binary distribution. Details about some examples can be found in the Examples pages diff --git a/src/materialxMaterials/data/PhysicallyBasedMaterialX/Cooking_Oil.png b/src/materialxMaterials/data/PhysicallyBasedMaterialX/Cooking_Oil.png index f491f0d..59eb7a5 100644 Binary files a/src/materialxMaterials/data/PhysicallyBasedMaterialX/Cooking_Oil.png and b/src/materialxMaterials/data/PhysicallyBasedMaterialX/Cooking_Oil.png differ diff --git a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterial.json b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterial.json index a06d68c..c4f8816 100644 --- a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterial.json +++ b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterial.json @@ -240,6 +240,40 @@ "https://raw.githubusercontent.com/AntonPalmqvist/physically-based-api/main/images/renders/cycles/600/brick.jpeg" ] }, + { + "name": "Car Paint", + "color": [ + 0.1, + 0.1, + 0.1 + ], + "metalness": 0, + "roughness": 0, + "ior": 1.5, + "density": 0, + "category": [ + "Manmade" + ], + "description": "Modern car paints are nearly always an acrylic polyurethane \"enamel\" with a pigmented basecoat and a clear topcoat. It may be described as \"acrylic\", \"acrylic enamel\", \"urethane\", etc. and the clearcoat in particular may be described as a lacquer. The size of the metal flakes in metallic paints is typically between 100 to 400 microns in diameter. Modern automobile paint is applied in several layers, with a total thickness of around 100 \u03bcm (0.1mm).", + "sources": [ + "https://en.wikipedia.org/wiki/Automotive_paint", + "https://en.wikipedia.org/wiki/Lacquer#Acrylic_lacquers", + "https://hal.science/hal-04030017/document", + "https://patentscope.wipo.int/search/en/detail.jsf?docId=WO2011163461", + "https://thecandeshop.com/metal-flake-for-cars/", + "https://www.theultimatefinish.co.uk/car-care-blog/featured/paintwork/" + ], + "tags": [ + "acrylic", + "coat", + "car paint", + "lacquer", + "metallic" + ], + "reference": [ + "https://raw.githubusercontent.com/AntonPalmqvist/physically-based-api/main/images/renders/cycles/600/car-paint.jpeg" + ] + }, { "name": "Carrot", "color": [ @@ -745,7 +779,6 @@ "https://refractiveindex.info/?shelf=3d&book=glass&page=soda-lime-clear", "https://en.wikipedia.org/wiki/Soda%E2%80%93lime_glass", "https://en.wikipedia.org/wiki/Density", - "https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/Materials/PhysicallyBased/", "https://www.acoustic-supplies.com/absorption-coefficient-chart/", "https://www.acoustic.ua/st/web_absorption_data_eng.pdf" ], diff --git a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_GLTF.mtlx b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_GLTF.mtlx index 0ab7eb9..7117720 100644 --- a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_GLTF.mtlx +++ b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_GLTF.mtlx @@ -85,6 +85,17 @@ + + + + + + + + + + + diff --git a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_OPBR.mtlx b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_OPBR.mtlx index a5e6763..cfa0dcc 100644 --- a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_OPBR.mtlx +++ b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_OPBR.mtlx @@ -85,6 +85,17 @@ + + + + + + + + + + + diff --git a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_SS.mtlx b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_SS.mtlx index 765989e..1083474 100644 --- a/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_SS.mtlx +++ b/src/materialxMaterials/data/PhysicallyBasedMaterialX/PhysicallyBasedMaterialX_SS.mtlx @@ -85,6 +85,17 @@ + + + + + + + + + + +