3ds Max USD API Reference
Loading...
Searching...
No Matches
MaxMeshConversionOptions.h
1//**************************************************************************/
2// Copyright (c) 2022 Autodesk, Inc.
3// All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license
6// agreement provided at the time of installation or download, or which
7// otherwise accompanies this software in either electronic or hard copy form.
8//**************************************************************************/
9#pragma once
10#include "MaxUsd/MappedAttributeBuilder.h"
11
13{
14public:
15
20 enum class MaxUSDAPI NormalsMode
21 {
22 AsPrimVar = 0,
23 AsAttribute = 1,
24 None = 2
25 };
26
31 enum class MaxUSDAPI MeshFormat
32 {
33 FromScene = 0,
34 PolyMesh = 1,
35 TriMesh = 2
36 };
37
42
46 MaxUSDAPI void SetDefaults();
47
56
61 MaxUSDAPI const std::map<int, maxUsd::MappedAttributeBuilder::Config>& GetChannelMappings() const;
62
67 MaxUSDAPI void SetChannelMappings(const std::map<int, maxUsd::MappedAttributeBuilder::Config>& mappings);
68
73 MaxUSDAPI NormalsMode GetNormalMode() const;
74
79 MaxUSDAPI void SetNormalsMode(NormalsMode normalMode);
80
85 MaxUSDAPI MeshFormat GetMeshFormat() const;
86
91 MaxUSDAPI void SetMeshFormat(MeshFormat meshFormat);
92
99 MaxUSDAPI void SetBakeObjectOffsetTransform(bool bakeObjectOffset);
100
105 MaxUSDAPI bool GetBakeObjectOffsetTransform() const;
106
111 MaxUSDAPI void SetPreserveEdgeOrientation(bool preserve);
112
117 MaxUSDAPI bool GetPreserveEdgeOrientation() const;
118
126 MaxUSDAPI void SetChannelPrimvarConfig(int channel, const maxUsd::MappedAttributeBuilder::Config& config);
127
133 MaxUSDAPI const maxUsd::MappedAttributeBuilder::Config& GetChannelPrimvarConfig(int channelId) const;
134
135protected:
136 // Normal options
137 NormalsMode normalMode = NormalsMode::AsPrimVar;
138 // How meshes should be exported.
139 MeshFormat meshFormat = MeshFormat::FromScene;
140 // Bake the offset from a node's pivot in the geometry. Otherwise,
141 // an additional Xform will be used for the node.
142 bool bakeObjectOffsetTransform = true;
143 // Preserve edge orientation on export,
144 // When true, we won't try to make the mesh planar, avoiding triangulation of a few faces
145 // This will result in an exported mesh that looks like the original
146 bool preserveEdgeOrientation = false;
147 // Channel primvar output configuration.
148 std::map<int, maxUsd::MappedAttributeBuilder::Config> channelToPrimvarConfig;
149};
Definition: MaxMeshConversionOptions.h:13
MaxUSDAPI MeshFormat GetMeshFormat() const
Gets the MeshFormat to be used.
MaxUSDAPI void SetBakeObjectOffsetTransform(bool bakeObjectOffset)
Sets whether or not the Object-offset transform should be baked into the geometry....
MaxUSDAPI bool GetBakeObjectOffsetTransform() const
Gets whether or not the Object-offset transform should be baked into the geometry.
MaxUSDAPI MaxMeshConversionOptions()
Constructor.
MaxUSDAPI void SetNormalsMode(NormalsMode normalMode)
Sets the normal conversion mode.
MaxUSDAPI void SetChannelMappings(const std::map< int, maxUsd::MappedAttributeBuilder::Config > &mappings)
Sets the channel to primvar map.
MaxUSDAPI void SetPreserveEdgeOrientation(bool preserve)
Sets whether or not to preserve max edge orientation.
MaxUSDAPI const maxUsd::MappedAttributeBuilder::Config & GetChannelPrimvarConfig(int channelId) const
Returns the primvar configuration for the specified channel.
MaxUSDAPI NormalsMode GetNormalMode() const
Gets the normal conversion mode.
MaxUSDAPI void SetDefaultChannelPrimvarMappings()
Sets default channel to primvar mappings. alpha -> "displayOpacity" shading -> "mapShading" vertex co...
MaxUSDAPI void SetDefaults()
Sets default mesh conversion options. This includes a call to SetDefaultChannelPrimvarMappings().
MaxUSDAPI void SetChannelPrimvarConfig(int channel, const maxUsd::MappedAttributeBuilder::Config &config)
Configures a channel to primvar mapping. The specified channel will be exported using the given confi...
MaxUSDAPI bool GetPreserveEdgeOrientation() const
Gets whether or not to preserve max edge orientation.
MaxUSDAPI const std::map< int, maxUsd::MappedAttributeBuilder::Config > & GetChannelMappings() const
Returns the channel to primvar map.
MaxUSDAPI void SetMeshFormat(MeshFormat meshFormat)
Sets the mesh format to be used.