16#include <pxr/base/tf/staticTokens.h>
17#include <pxr/base/tf/token.h>
18#include <pxr/usd/usd/usdFileFormat.h>
19#include <pxr/usd/usd/usdaFileFormat.h>
20#include <pxr/usd/usd/usdcFileFormat.h>
22#include "MaxUsd/MaxUSDAPI.h"
23#include "MaxUsd/Builders/SceneBuilderOptions.h"
24#include "MaxUsd/MeshConversion/MaxMeshConversionOptions.h"
25#include "MaxUsd/Utilities/TranslationUtils.h"
27PXR_NAMESPACE_OPEN_SCOPE
30#define PXR_MAXUSD_USD_SCENE_BUILDER_OPTIONS_TOKENS \
32 (convertMaterialsTo) \
38TF_DECLARE_PUBLIC_TOKENS(
39 MaxUsdUsdSceneBuilderOptionsTokens,
41 PXR_MAXUSD_USD_SCENE_BUILDER_OPTIONS_TOKENS);
43PXR_NAMESPACE_CLOSE_SCOPE
55 enum class MaxUSDAPI ContentSource
66 enum class MaxUSDAPI UpAxis
75 enum class MaxUSDAPI FileFormat
85 enum class MaxUSDAPI TimeMode
93 static MaxUSDAPI
const double MIN_SAMPLES_PER_FRAME;
94 static MaxUSDAPI
const double MAX_SAMPLES_PER_FRAME;
297 MaxUSDAPI
void SetNormalsMode(
const MaxMeshConversionOptions::NormalsMode& normalsMode);
309 MaxUSDAPI
void SetMeshFormat(
const MaxMeshConversionOptions::MeshFormat& meshFormat);
476 MaxUSDAPI
const std::map<std::string, ChaserArgs>& GetAllChaserArgs()
const;
482 MaxUSDAPI
void SetAllChaserArgs(
const std::map<std::string, ChaserArgs>& chaserArgs)
const;
573 std::map<std::string, ChaserArgs> allChaserArgs;
Definition: MaxMeshConversionOptions.h:13
USD Scene Build configuration options.
Definition: USDSceneBuilderOptions.h:49
MaxUSDAPI void SetMeshFormat(const MaxMeshConversionOptions::MeshFormat &meshFormat)
Sets how meshes should be exported.
MaxUSDAPI void SetDefaults()
Set the the default option values.
MaxUSDAPI MaxMeshConversionOptions::MeshFormat GetMeshFormat() const
Return how meshes should be exported.
MaxUSDAPI bool GetUseUSDVisibility() const
Check if we should attempt to match the Hidden state in Max with the USD visibility attribute.
MaxUSDAPI void SetTranslateShapes(bool translateShapes)
Translate 3ds Max shapes into USD meshes.
pxr::TfToken convertMaterialsTo
Definition: USDSceneBuilderOptions.h:541
MaxUSDAPI void SetTranslateHidden(bool translateHiddenObjects)
Sets whether hidden objects should be translated.
pxr::TfToken bonesPrimName
Prim to be created to put the bones on.
Definition: USDSceneBuilderOptions.h:566
std::set< std::string > contextNames
Contexts (plugin config) names.
Definition: USDSceneBuilderOptions.h:575
MaxUSDAPI bool GetAllowNestedGprims() const
Gets whether or not the exporter should allow nested Gprims. Nested gprims are technically illegal in...
bool translateMaterials
Flag indicating if the materials should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:531
MaxUSDAPI void SetOpenInUsdview(bool openInUsdview)
Whether or not the produced USD file should be opened in Usdview at the end of the export.
Tab< INode * > nodesToExport
Definition: USDSceneBuilderOptions.h:558
MaxUSDAPI bool GetTranslateLights() const
Check if 3ds Max lights should be translated into USD lights.
MaxUSDAPI USDSceneBuilderOptions OptionsWithAppliedContexts() const
Returns a copy of the current USDSceneBuilderOptions with the JobContext option overrides applied on ...
MaxUSDAPI MaxMeshConversionOptions::NormalsMode GetNormalsMode() const
Return how normals should be exported.
std::map< std::string, std::string > ChaserArgs
Gets the map of export chasers with their specified arguments.
Definition: USDSceneBuilderOptions.h:475
MaxUSDAPI void SetUsdStagesAsReferences(bool usdStagesAsReferences)
Sets whether USD Stage Objects should be exported as USD References.
UpAxis upAxis
Up axis of the USD Stage produced from the translation of the 3ds Max content:
Definition: USDSceneBuilderOptions.h:553
MaxUSDAPI bool GetTranslateCameras() const
Check if 3ds Max cameras should be translated into USD cameras.
MaxUSDAPI void SetTranslateMaterials(bool translateMaterials)
Translate 3ds Max materials into USD.
MaxUSDAPI void SetNormalsMode(const MaxMeshConversionOptions::NormalsMode &normalsMode)
Sets how normals should be exported.
pxr::TfToken::Set allMaterialConversions
Specifies the set of targeted materials for material conversion on export.
Definition: USDSceneBuilderOptions.h:538
MaxUSDAPI void SetUseUSDVisibility(bool useUSDVibility)
Sets whether we should attempt to match the Hidden state in Max with the USD visibility attribute.
maxUsd::TimeConfig timeConfig
Time configuration for the export to USD.
Definition: USDSceneBuilderOptions.h:562
MaxUSDAPI const Tab< INode * > & GetNodesToExport() const
Gets the nodes to convert to USD.
MaxUSDAPI void SetContentSource(const ContentSource &contentSource)
Build USD content from the given 3ds Max content source.
std::vector< std::string > chaserNames
Chasers and their arguments.
Definition: USDSceneBuilderOptions.h:572
MaxUSDAPI void SetBonesPrimName(const pxr::TfToken &bonesPrimName)
Set the the name to be used for the bone prim.
MaxUSDAPI bool GetTranslateMaterials() const
Check if materials should be translated.
MaxUSDAPI FileFormat GetFileFormat() const
Return the format of the file to export.
MaxUSDAPI void SetNodesToExport(const Tab< INode * > &nodes)
Sets the nodes to convert to USD.
MaxUSDAPI MaxMeshConversionOptions & GetMeshConversionOptions()
Gets the mesh conversion options.
MaxUSDAPI bool GetTranslateHidden() const
Check if hidden objects should be translated.
MaxUSDAPI void SetAnimationsPrimName(const pxr::TfToken &animationsPrimName)
Set the the name to be used for the Animation prim.
MaxUSDAPI double GetSamplesPerFrame() const
Gets the number of samples to be exported to USD, per frame.
bool translateLights
Flag indicating if the lights should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:527
MaxMeshConversionOptions meshConversionOptions
Mesh conversion options.
Definition: USDSceneBuilderOptions.h:555
MaxUSDAPI bool GetOpenInUsdview() const
Check if the produced USD file should be opened in Usdview at the end of the export.
MaxUSDAPI void SetChaserNames(const std::vector< std::string > &chasers)
Sets the chaser list to use at export.
FileFormat saveFormat
Internal format of the USD file to export:
Definition: USDSceneBuilderOptions.h:551
MaxUSDAPI void SetAllowNestedGprims(bool allowNestedGprims)
Sets whether or not the exporter should allow nested Gprims. Nested gprims are technically illegal in...
pxr::TfToken skelAnimPrimName
Prim to be created to put the skeleton animation on.
Definition: USDSceneBuilderOptions.h:568
MaxUSDAPI void SetTranslateSkin(bool trasnlateSkin)
Translate 3ds Max skin and skeleton into USD.
MaxUSDAPI void SetStartFrame(double startFrame)
Sets the first frame from which to export, only used if the time mode is EXPLICIT or FRAME_RANGE.
MaxUSDAPI const std::vector< std::string > & GetChaserNames() const
Gets the list of export chasers to be called at USD export.
MaxUSDAPI TimeMode GetTimeMode() const
Gets the time mode to be used for export.
MaxUSDAPI double GetStartFrame() const
Gets the first frame from which to export, only used if the time mode is configured as EXPLICIT or FR...
MaxUSDAPI void SetShadingMode(const pxr::TfToken &shadingMode)
Sets the shading schema (mode) to use for material export.
bool openInUsdview
Whether or not to open the exported file in Usdview.
Definition: USDSceneBuilderOptions.h:570
bool translateShapes
Flag indicating if the shapes should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:525
MaxUSDAPI bool GetTranslateSkin() const
Check if skin and skeleton should be translated.
MaxUSDAPI pxr::TfToken GetShadingMode() const
Gets the shading schema (mode) to use for material export.
MaxUSDAPI UpAxis GetUpAxis() const
Return the "up axis" of the USD Stage produced from the translation of the 3ds Max content.
MaxUSDAPI void SetEndFrame(double endFrame)
Sets the last frame from which to export, only used if the time mode is FRAME_RANGE.
bool translateSkin
Flag indicating if skin and bones should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:533
MaxUSDAPI void SetAllChaserArgs(const std::map< std::string, ChaserArgs > &chaserArgs) const
Sets the export chasers' arguments map.
MaxUSDAPI bool GetUsdStagesAsReferences() const
Checks if USD Stage Objects should be exported as USD References.
MaxUSDAPI void SetAllMaterialConversions(const pxr::TfToken::Set &materialConversions)
Sets the set of targeted materials for material conversion.
bool translateCameras
Flag indicating if the cameras should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:529
MaxUSDAPI void SetConvertMaterialsTo(pxr::TfToken shader)
Sets the USD material type targeted to convert the 3ds Max materials.
Definition: USDSceneBuilderOptions.h:231
MaxUSDAPI void SetTranslateCameras(bool translateCameras)
Translate 3ds Max cameras into USD cameras.
MaxUSDAPI bool GetTranslateMeshes() const
Check if 3ds Max meshes should be translated into USD meshes.
MaxUSDAPI double GetEndFrame() const
Gets the last frame from which to export, only used if the time mode is configured as FRAME_RANGE.
MaxUSDAPI void SetRootPrimPath(const std::wstring &rootPrimPath)
Sets the root prim path to export to.
MaxUSDAPI void SetUpAxis(const UpAxis &upAxis)
Set the "up axis" of the USD Stage produced from the translation of the 3ds Max content.
MaxUSDAPI const pxr::TfToken::Set & GetAllMaterialConversions() const
Gets the set of targeted materials for material conversion.
bool useUSDVisibility
Flag indicating if we should use the USD visibility attribute to match the Max hidden state.
Definition: USDSceneBuilderOptions.h:547
MaxUSDAPI const pxr::TfToken & GetAnimationsPrimName() const
Gets the configured animation prim name.
pxr::TfToken shadingMode
Specifies the shading schema to use for material export.
Definition: USDSceneBuilderOptions.h:536
MaxUSDAPI bool GetTranslateShapes() const
Check if 3ds Max shapes should be translated into USD meshes.
MaxUSDAPI const std::set< std::string > & GetContextNames() const
Gets the list of contexts (plug-in configurations) to be applied on USD export.
MaxUSDAPI USDSceneBuilderOptions() noexcept
Constructor.
bool translateHidden
Flag indicating if hidden objects should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:543
MaxUSDAPI ContentSource GetContentSource() const
Return the 3ds Max content source from which to build the USD scene.
MaxUSDAPI const pxr::TfToken & GetBonesPrimName() const
Gets the configured bone prim name.
MaxUSDAPI void SetOptions(const USDSceneBuilderOptions &options)
Copies the values from an existing options object.
MaxUSDAPI const maxUsd::TimeConfig GetResolvedTimeConfig() const
Resolves the actual time configuration from the selected TimeMode, the set values for startFrame and ...
bool translateMeshes
Flag indicating if the meshes should be translated between 3dsMax and USD:
Definition: USDSceneBuilderOptions.h:523
MaxUSDAPI const std::wstring & GetRootPrimPath() const
Gets the configured root prim path.
bool allowNestedGprims
Flag indicating if the exporter is allowed to nest Gprims.
Definition: USDSceneBuilderOptions.h:549
TimeMode timeMode
Describes what frames to export.
Definition: USDSceneBuilderOptions.h:560
MaxUSDAPI void SetFileFormat(const FileFormat &format)
Set the internal format of the USD file to export.
std::wstring rootPrimPath
Root prim path to export to.
Definition: USDSceneBuilderOptions.h:564
MaxUSDAPI void SetTranslateMeshes(bool translateMeshes)
Translate 3ds Max meshes into USD meshes.
ContentSource contentSource
Source of the 3ds Max content from which to build the USD scene:
Definition: USDSceneBuilderOptions.h:521
MaxUSDAPI void SetContextNames(const std::set< std::string > contexts)
Sets the context list to use at export.
MaxUSDAPI void SetTimeMode(const TimeMode &timeMode)
Sets the time mode for export, either CURRENT or EXPLICIT. If explicit, export from the time specifie...
bool usdStagesAsReferences
Flag indicating if USD Stage objects should be exported as USD references.
Definition: USDSceneBuilderOptions.h:545
MaxUSDAPI void SetTranslateLights(bool translateLights)
Translate 3ds Max lights into USD lights.
MaxUSDAPI void SetSamplesPerFrame(double samplesPerFrame)
Sets the number of samples to be exported to USD, per frame.
MaxUSDAPI pxr::TfToken GetConvertMaterialsTo() const
Token identifier of the USD material type targeted to convert the 3ds Max materials.
Definition: USDSceneBuilderOptions.h:240