Create parsing system that converts supported nodes and ignores unsupported #2

Merged
Bogdan Nagirniak merged 14 commits from Vasyl-Pidhirskyi/blender:BLEN-500 into matx-export-material 2023-08-28 12:29:46 +02:00
Showing only changes of commit 3f1b272170 - Show all commits

View File

@ -8,7 +8,10 @@
#include <MaterialXCore/Node.h> #include <MaterialXCore/Node.h>
#include <MaterialXFormat/XmlIo.h> #include <MaterialXFormat/XmlIo.h>
#include "NOD_shader.h" #include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BKE_appdir.h"
#include "NOD_shader.h" #include "NOD_shader.h"
@ -47,9 +50,14 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph, Material *mater
else { else {
BogdanNagirniak marked this conversation as resolved Outdated

this needs to be removed

this needs to be removed
create_standard_surface(doc, material); create_standard_surface(doc, material);
} }
MaterialX::writeToXmlFile(
doc, char dir_path[FILE_MAX], file_path[FILE_MAX], file_name[32];
MaterialX::FilePath("c:/Users/Vasyl_Pidhirskyi/Work/AMD/blender-git/tmp/material.mtlx")); BLI_path_join(dir_path, sizeof(dir_path), BKE_tempdir_session(), "hydra", "materialx");
BLI_dir_create_recursive(dir_path);
SNPRINTF(file_name, "mat_%p.mtlx", material);
BLI_path_join(file_path, sizeof(file_path), dir_path, file_name);
MaterialX::writeToXmlFile(doc, MaterialX::FilePath(file_path));
return doc; return doc;
} }