UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DatasmithSceneXmlReader.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Map.h"
10#include "Math/Quat.h"
11#include "Math/Transform.h"
12#include "Math/UnrealMathSSE.h"
14#include "Templates/UniquePtr.h"
15
16#define UE_API DATASMITHCORE_API
17
19class FXmlFile;
20class FXmlNode;
21class UTexture;
22struct FLinearColor;
23
25{
26public:
27 // Force non-inline constructor and destructor to prevent instantiating TUniquePtr< FXmlFile > with an incomplete FXmlFile type (forward declared)
30
33
34private:
35 bool ParseXmlFile(TSharedRef< IDatasmithScene >& OutScene, bool bInAppend = false);
36 void PatchUpVersion(TSharedRef< IDatasmithScene >& OutScene) const;
37
38 [[nodiscard]] FString UnsanitizeXMLText(const FString& InString) const;
39
40 template<typename T> T ValueFromString(const FString& InString) const = delete;
41 FVector VectorFromNode(FXmlNode* InNode, const TCHAR* XName, const TCHAR* YName, const TCHAR* ZName) const;
42 FQuat QuatFromHexString(const FString& HexString) const;
43 FQuat QuatFromNode(FXmlNode* InNode) const;
44 FTransform ParseTransform(FXmlNode* InNode) const;
46
48 void ParseLevelSequence(FXmlNode* InNode, const TSharedRef<IDatasmithLevelSequenceElement>& OutElement) const;
49 void ParseLevelVariantSets( FXmlNode* InNode, const TSharedRef<IDatasmithLevelVariantSetsElement>& OutElement, const TMap< FString, TSharedPtr<IDatasmithActorElement> >& Actors, const TMap< FString, TSharedPtr<IDatasmithElement> >& Objects ) const;
50 void ParseVariantSet( FXmlNode* InNode, const TSharedRef<IDatasmithVariantSetElement>& OutElement, const TMap< FString, TSharedPtr<IDatasmithActorElement> >& Actors, const TMap< FString, TSharedPtr<IDatasmithElement> >& Objects ) const;
51 void ParseVariant( FXmlNode* InNode, const TSharedRef<IDatasmithVariantElement>& OutElement, const TMap< FString, TSharedPtr<IDatasmithActorElement> >& Actors, const TMap< FString, TSharedPtr<IDatasmithElement> >& Objects ) const;
52 void ParseActorBinding( FXmlNode* InNode, const TSharedRef<IDatasmithActorBindingElement>& OutElement, const TMap< FString, TSharedPtr<IDatasmithElement> >& Objects ) const;
53 void ParsePropertyCapture( FXmlNode* InNode, const TSharedRef<IDatasmithPropertyCaptureElement>& OutElement ) const;
54 void ParseObjectPropertyCapture( FXmlNode* InNode, const TSharedRef<IDatasmithObjectPropertyCaptureElement>& OutElement, const TMap< FString, TSharedPtr<IDatasmithElement> >& Objects ) const;
57 UE_DEPRECATED(5.5, "The experimental Cloth importer is no longer supported.")
60 void ParseTextureElement(FXmlNode* InNode, TSharedPtr<IDatasmithTextureElement>& OutElement) const;
61 void ParseTexture(FXmlNode* InNode, FString& OutTextureFilename, FDatasmithTextureSampler& OutTextureUV) const;
65 UE_DEPRECATED(5.5, "The experimental Cloth importer is no longer supported.")
71 void ParsePostProcess(FXmlNode* InNode, const TSharedPtr< IDatasmithPostProcessElement >& Element) const;
72 void ParsePostProcessVolume(FXmlNode* InNode, const TSharedRef< IDatasmithPostProcessVolumeElement >& Element) const;
73 void ParseColor(FXmlNode* InNode, FLinearColor& OutColor) const;
75 void ParseMaterial(FXmlNode* InNode, TSharedPtr< IDatasmithMaterialElement >& OutElement) const;
76 void ParseMaterialInstance(FXmlNode* InNode, TSharedPtr< IDatasmithMaterialInstanceElement >& OutElement) const;
77 void ParseDecalMaterial(FXmlNode* InNode, TSharedPtr< IDatasmithDecalMaterialElement >& OutElement) const;
78 void ParseUEPbrMaterial(FXmlNode* InNode, TSharedPtr< IDatasmithUEPbrMaterialElement >& OutElement) const;
79 void ParseCustomActor(FXmlNode* InNode, TSharedPtr< IDatasmithCustomActorElement >& OutElement) const;
81 void ParseLandscape(FXmlNode* InNode, TSharedRef< IDatasmithLandscapeElement >& OutElement) const;
82
83 template< typename ElementType >
84 void ParseKeyValueProperties(const FXmlNode* InNode, ElementType& OutElement) const;
85
86 bool LoadFromFile(const FString& InFilename);
87 bool LoadFromBuffer(const FString& XmlBuffer);
88
90 void ParseExpressionInput(const FXmlNode* InNode, TSharedPtr< IDatasmithUEPbrMaterialElement >& OutElement, ExpressionInputType& ExpressionInput) const;
91
92 TUniquePtr< FXmlFile > XmlFile;
93 FString ProjectPath;
94};
95
96#undef UE_API
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_API
Definition DatasmithSceneXmlReader.h:16
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
Definition DatasmithSceneXmlReader.h:25
UE_API ~FDatasmithSceneXmlReader()
UE_API bool ParseBuffer(const FString &XmlBuffer, TSharedRef< IDatasmithScene > &OutScene, bool bInAppend=false)
Definition DatasmithSceneXmlReader.cpp:1153
UE_API bool ParseFile(const FString &InFilename, TSharedRef< IDatasmithScene > &OutScene, bool bInAppend=false)
Definition DatasmithSceneXmlReader.cpp:1143
Definition DatasmithTypes.h:20
Definition XmlFile.h:26
Definition XmlNode.h:37
Definition IDatasmithSceneElements.h:73
Definition IDatasmithSceneElements.h:519
Definition IDatasmithSceneElements.h:1272
Definition IDatasmithSceneElements.h:582
Definition IDatasmithSceneElements.h:682
Definition IDatasmithSceneElements.h:317
Definition IDatasmithSceneElements.h:605
Definition IDatasmithSceneElements.h:355
Definition IDatasmithSceneElements.h:630
Definition IDatasmithSceneElements.h:654
Definition IDatasmithSceneElements.h:269
Definition IDatasmithSceneElements.h:1410
Definition IDatasmithSceneElements.h:708
Definition IDatasmithSceneElements.h:763
Definition IDatasmithSceneElements.h:1466
Definition IDatasmithSceneElements.h:800
Definition DatasmithMaterialElements.h:213
Definition UnrealString.h.inl:34
Definition SharedPointer.h:153
Definition UniquePtr.h:107
Definition Texture.h:1219
@ false
Definition radaudio_common.h:23
Definition Color.h:48