forked from autodesk-forks/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXmlExport.h
70 lines (54 loc) · 2.46 KB
/
XmlExport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// TM & (c) 2021 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#ifndef MATERIALX_XMLEXPORT_H
#define MATERIALX_XMLEXPORT_H
#include <MaterialXFormat/XmlIo.h>
namespace MaterialX
{
/// @class XmlExportOptions
/// A set of options for controlling the behavior of XML export functions.
class MX_FORMAT_API XmlExportOptions : public XmlWriteOptions
{
public:
XmlExportOptions();
~XmlExportOptions() { }
/// Whether to merge all of the looks/lookgroups into a single look
bool mergeLooks;
/// The name of the lookgroup to merge
std::string lookGroupToMerge;
/// Whether to flatten filenames
bool flattenFilenames;
/// Resolved texture path for flattening filenames
FileSearchPath resolvedTexturePath;
/// String resolver applied during flattening filenames
StringResolverPtr stringResolver;
};
/// @name Export Functions
/// @{
/// Export a Document as XML to the given output stream.
/// @param doc The Document to be written.
/// @param stream The output stream to which data is written.
/// @param exportOptions An optional pointer to an XmlExportOptions object.
/// If provided, then the given options will affect the behavior of the
/// export function. Defaults to a null pointer.
MX_FORMAT_API void exportToXmlStream(DocumentPtr doc, std::ostream& stream, const XmlExportOptions* exportOptions = nullptr);
/// Export a Document as XML to the given filename.
/// @param doc The Document to be written.
/// @param filename The filename to which data is written. This argument can
/// be supplied either as a FilePath or a standard string.
/// @param exportOptions An optional pointer to an XmlExportOptions object.
/// If provided, then the given options will affect the behavior of the
/// write function. Defaults to a null pointer.
MX_FORMAT_API void exportToXmlFile(DocumentPtr doc, const FilePath& filename, const XmlExportOptions* exportOptions = nullptr);
/// Export a Document as XML to a new string, returned by value.
/// @param doc The Document to be written.
/// @param exportOptions An optional pointer to an XmlExportOptions object.
/// If provided, then the given options will affect the behavior of the
/// write function. Defaults to a null pointer.
/// @return The output string, returned by value
MX_FORMAT_API string exportToXmlString(DocumentPtr doc, const XmlExportOptions* exportOptions = nullptr);
/// @}
} // namespace MaterialX
#endif