| 234 | }; |
| 235 | |
| 236 | void BSDFCodeGenerator::createStdLib() |
| 237 | { |
| 238 | // Setup search path. |
| 239 | MaterialX::FilePathVec libraryFolders; |
| 240 | libraryFolders.push_back(_mtlxLibPath); |
| 241 | MaterialX::FileSearchPath searchPath; |
| 242 | searchPath.append(_mtlxLibPath.c_str()); |
| 243 | |
| 244 | // Create a document to store standard library. |
| 245 | s_pStdLib = MaterialX::createDocument(); |
| 246 | |
| 247 | // Load the standard library. |
| 248 | auto res = MaterialX::loadLibraries(libraryFolders, searchPath, s_pStdLib); |
| 249 | AU_ASSERT( |
| 250 | res.size(), "Failed to load MaterialX standard libraries from %s\n", _mtlxLibPath.c_str()); |
| 251 | } |
| 252 | |
| 253 | BSDFCodeGenerator::BSDFCodeGenerator( |
| 254 | const string& mtlxPath, const string& surfaceShaderNodeCategory) : |