forked from blender/blender
Create parsing system that converts supported nodes and ignores unsupported #2
@ -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 {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user