UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SCS_Node.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
8#include "UObject/Object.h"
9#include "Misc/Guid.h"
12#include "Engine/Blueprint.h"
13#include "SCS_Node.generated.h"
14
15class UBlueprint;
16
18
19UCLASS(MinimalAPI)
21{
23
24
25 UPROPERTY()
26 TObjectPtr<UClass> ComponentClass;
27
29 UPROPERTY()
30 TObjectPtr<class UActorComponent> ComponentTemplate;
31
33 UPROPERTY()
34 FBlueprintCookedComponentInstancingData CookedComponentInstancingData;
35
36#if WITH_EDITORONLY_DATA
38 UPROPERTY()
39 FText CategoryName;
40#endif //WITH_EDITORONLY_DATA
41
43 UPROPERTY()
44 FName AttachToName;
45
47 UPROPERTY()
48 FName ParentComponentOrVariableName;
49
51 //@TODO: We can potentially remove this if/when inherited SCS component template instances are included in subobject serialization, as we could then infer that the owner class is always the same as the BP class.
52 UPROPERTY()
53 FName ParentComponentOwnerClassName;
54
56 UPROPERTY()
57 bool bIsParentComponentNative;
58
60 UPROPERTY()
62
64 UPROPERTY(EditAnywhere, Category=BPVariableDescription)
66
67 UPROPERTY()
68 FGuid VariableGuid;
69
70#if WITH_EDITORONLY_DATA
72 UPROPERTY()
74
75 /* (DEPRECATED) If this is a native component, this is the name of the UActorComponent */
76 UPROPERTY()
78
80 UPROPERTY()
82#endif // WITH_EDITORONLY_DATA
83
84 //~ Begin UObject Interface
85 virtual void Serialize(FArchive& Ar) override;
86 virtual void PostLoad() override;
87 //~ End UObject Interface
88
89#if WITH_EDITOR
90
93
96
98 virtual EDataValidationResult IsDataValid(class FDataValidationContext& Context) const override;
99#endif // WITH_EDITOR
100
111 ENGINE_API UActorComponent* ExecuteNodeOnActor(AActor* Actor, USceneComponent* ParentComponent, const FTransform* RootTransform, const struct FRotationConversionCache* RootRelativeRotationCache, bool bIsDefaultTransform, ESpawnActorScaleMethod TransformScaleMethod = ESpawnActorScaleMethod::OverrideRootScale);
112
114 ENGINE_API UActorComponent* GetActualComponentTemplate(class UBlueprintGeneratedClass* ActualBPGC) const;
115
117 ENGINE_API const FBlueprintCookedComponentInstancingData* GetActualComponentTemplateData(class UBlueprintGeneratedClass* ActualBPGC) const;
118
120 TArray<USCS_Node*> GetAllNodes();
121
123 const TArray<USCS_Node*>& GetChildNodes() const { return ChildNodes; }
124
126 ENGINE_API void AddChildNode(USCS_Node* InNode, bool bAddToAllNodes = true);
127
129 ENGINE_API void RemoveChildNode(USCS_Node* InNode, bool bRemoveFromAllNodes = true);
130
132 ENGINE_API void RemoveChildNodeAt(int32 ChildIndex, bool bRemoveFromAllNodes = true);
133
135 ENGINE_API void MoveChildNodes(USCS_Node* SourceNode, int32 InsertLocation = INDEX_NONE);
136
138 TArray<const USCS_Node*> GetAllNodes() const;
139
142
144 ENGINE_API void PreloadChain();
145
147 ENGINE_API bool IsRootNode() const;
148
150 inline FName GetVariableName() const
151 {
152 return InternalVariableName;
153 }
154
156 ENGINE_API void SetVariableName(const FName& NewName, bool bRenameTemplate = true);
157
159 class USimpleConstructionScript* GetSCS() const
160 {
162 }
163
164#if WITH_EDITOR
167
170#endif
171
173 ENGINE_API void SetMetaData(FName Key, FString Value);
174
176 ENGINE_API const FString& GetMetaData(FName Key) const;
177
179 ENGINE_API void RemoveMetaData(FName Key);
180
182 ENGINE_API int32 FindMetaDataEntryIndexForKey(FName Key) const;
183
184#if WITH_EDITOR
186 ENGINE_API void SetParent(USCS_Node* InParentNode);
187
189 ENGINE_API void SetParent(const USceneComponent* InParentComponent);
190
193
196
199#endif
200
201protected:
203 static void RenameComponentTemplate(UActorComponent* ComponentTemplate, const FName& NewName);
204
205private:
211 UPROPERTY()
212 FName InternalVariableName;
213
214#if WITH_EDITOR
217#endif
218};
219
ESpawnActorScaleMethod
Definition Actor.h:85
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
bool SaveToTransactionBuffer(UObject *Object, bool bMarkDirty)
Definition UObjectGlobals.cpp:3361
EDataValidationResult
Definition UObjectGlobals.h:4225
Definition Actor.h:257
Definition Archive.h:1208
Definition DataValidation.h:40
Definition NameTypes.h:617
Definition Text.h:385
Definition Array.h:670
Definition ActorComponent.h:152
Definition BlueprintGeneratedClass.h:433
Definition Blueprint.h:403
FORCEINLINE UObject * GetOuter() const
Definition UObjectBase.h:223
Definition Object.h:95
Definition SCS_Node.h:21
Definition SimpleConstructionScript.h:18
Definition BlueprintGeneratedClass.h:345
Definition Guid.h:109
Definition EngineTypes.h:1955
Definition ObjectPtr.h:488
Definition WeakObjectPtrTemplates.h:25