UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PoseWatch.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "UObject/Object.h"
8#include "BoneIndices.h"
9#include "PoseWatch.generated.h"
10
11struct FCompactHeapPose;
12class UAnimBlueprint;
13class UBlendProfile;
14struct FSlateIcon;
15
29
30UCLASS(MinimalAPI)
33{
35
36public:
37#if WITH_EDITOR
39 ENGINE_API const FText GetPath() const;
40
43
45 ENGINE_API FText GetLabel() const;
46
48 ENGINE_API bool GetIsVisible() const;
49
51 ENGINE_API UPoseWatchFolder* GetParent() const;
52
56 ENGINE_API bool SetParent(UPoseWatchFolder* Parent, bool bForce = false);
57
60
62 ENGINE_API bool SetLabel(const FText& InLabel);
63
65 ENGINE_API void SetIsVisible(bool bInIsVisible, bool bUpdateChildren=true);
66
68 ENGINE_API void OnRemoved();
69
71 ENGINE_API bool IsIn(const UPoseWatchFolder* InFolder) const;
72
74 ENGINE_API bool IsDescendantOf(const UPoseWatchFolder* InFolder) const;
75
77 ENGINE_API bool IsAssignedFolder() const;
78
81
84
86 ENGINE_API bool HasChildren() const;
87
90
92 ENGINE_API void UpdateVisibility();
93
96
98 ENGINE_API void SetIsExpanded(bool bInIsExpanded);
99
101 ENGINE_API bool GetIsExpanded() const;
102
103private:
105 FText FindUniqueNameInParent(UPoseWatchFolder* InParent) const;
106
108 bool HasPoseWatchChildren() const;
109
111 bool HasPoseWatchDescendents() const;
112#endif // WITH_EDITOR
113
114#if WITH_EDITORONLY_DATA
115protected:
116 UPROPERTY()
117 FText Label;
118
119 UPROPERTY()
121
122 UPROPERTY()
123 bool bIsVisible = false;
124
126 bool bIsExpanded = true;
127#endif // WITH_EDITORONLY_DATA
128};
129
130UCLASS(MinimalAPI)
133{
135
136public:
137#if WITH_EDITOR
138
139 virtual ~UPoseWatchElement() = default;
140
143
145 ENGINE_API FText GetLabel() const;
146
148 ENGINE_API bool GetIsVisible() const;
149
151 ENGINE_API virtual bool GetIsEnabled() const;
152
154 ENGINE_API UPoseWatch* GetParent() const;
155
157 ENGINE_API void SetParent(UPoseWatch* InParent);
158
160 ENGINE_API bool SetLabel(const FText& InLabel);
161
163 ENGINE_API virtual void SetIsVisible(bool bInIsVisible);
164
167
170
173
176
178 ENGINE_API FColor GetColor() const;
179
181 ENGINE_API virtual void SetColor(const FColor& InColor);
182
184 ENGINE_API bool HasColor() const;
185
187 ENGINE_API void SetHasColor(const bool bInHasColor);
188
190 ENGINE_API FName GetIconName() const;
191
194
197
198private:
199 ENGINE_API FText FindUniqueNameInParent(class UPoseWatch* InParent) const;
200
201#endif // WITH_EDITOR
202
203#if WITH_EDITORONLY_DATA
204protected:
205
206 // If true will draw the node to the view port.
207 UPROPERTY()
208 bool bIsVisible = true;
209
210 UPROPERTY()
211 bool bHasColor = true;
212
213 UPROPERTY()
215
216 UPROPERTY()
217 FText Label;
218
219 UPROPERTY()
220 FName IconName;
221
222 UPROPERTY()
224
225#endif // WITH_EDITORONLY_DATA
226};
227
228UCLASS(MinimalAPI)
230{
232
233public:
234
236
237#if WITH_EDITOR
238
239 ENGINE_API virtual bool GetIsEnabled() const;
240
242
243#endif // WITH_EDITOR
244
245#if WITH_EDITORONLY_DATA
247 UPROPERTY(EditAnywhere, editfixedsize, Category = Default, meta = (UseAsBlendMask = true))
249
251 UPROPERTY(EditAnywhere, Category = Default, meta = (EditCondition = "ViewportMask != nullptr"))
253
255 UPROPERTY(EditAnywhere, Category = Default, meta = (ClampMin = 0.f, ClampMax = 1.f, EditCondition = "ViewportMask != nullptr"))
257
259 UPROPERTY(EditAnywhere, Category = Default)
261#endif // WITH_EDITORONLY_DATA
262};
263
264UCLASS(MinimalAPI)
267{
269
270public:
271#if WITH_EDITOR
273 ENGINE_API const FText GetPath() const;
274
277
279 ENGINE_API FText GetLabel() const;
280
282 ENGINE_API bool GetIsVisible() const;
283
285 ENGINE_API bool GetIsEnabled() const;
286
288 ENGINE_API bool GetIsNodeEnabled() const;
289
291 UE_DEPRECATED(5.1, "Node watches no longer have colors, use the color of its elements instead.")
292 ENGINE_API FColor GetColor() const;
293
295 ENGINE_API void SetIsExpanded(bool bInIsExpanded);
296
298 ENGINE_API bool GetIsExpanded() const;
299
302
304 ENGINE_API UPoseWatchFolder* GetParent() const;
305
309 ENGINE_API bool SetParent(UPoseWatchFolder* InParent, bool bForce=false);
310
313
316
318 ENGINE_API bool SetLabel(const FText& InLabel);
319
321 ENGINE_API void SetIsVisible(bool bInIsVisible);
322
324 UE_DEPRECATED(5.1, "Node watches no longer have colors, use the color of its elements instead.")
325 ENGINE_API void SetColor(const FColor& InColor);
326
329
331 ENGINE_API void OnRemoved();
332
335
337 ENGINE_API bool IsIn(const UPoseWatchFolder* InFolder) const;
338
340 ENGINE_API bool IsAssignedFolder() const;
341
344
347
350
352 ENGINE_API void UpdateVisibility();
353
356
359
361 template< class TElementType > TObjectPtr<TElementType> AddElement(const FText InLabel, const FName IconName);
362
364 TArray<TObjectPtr<UPoseWatchElement>>& GetElements() { return Elements; }
365
368
371
373 bool Contains(const TObjectPtr<UPoseWatchElement> InElement) { return Elements.Contains(InElement); }
374 bool Contains(const UPoseWatchElement* const InElement) { return Elements.ContainsByPredicate([InElement](const TObjectPtr<UPoseWatchElement>& ContainedElement) { return InElement == ContainedElement.Get(); }); }
375
377 template< class TElementType > TObjectPtr<TElementType> GetFirstElementOfType()
378 {
379 for (UPoseWatchElement* Element : Elements)
380 {
382 {
383 return FoundElement;
384 }
385 }
386 return nullptr;
387 }
388
389
390private:
392 ENGINE_API FText FindUniqueNameInParent(UPoseWatchFolder* InParent) const;
393
394#endif // WITH_EDITOR
395
396#if WITH_EDITORONLY_DATA
397public:
398 ENGINE_API virtual void Serialize(FArchive& Ar) override;
399
400 UPROPERTY()
402
403 UPROPERTY()
405 UPROPERTY()
407 UPROPERTY()
409 UPROPERTY()
411
412protected:
413 UPROPERTY()
415
416 UPROPERTY()
417 bool bDeleteOnDeselection = false;
418
419 // If true will draw the pose to the viewport
420 UPROPERTY()
421 bool bIsVisible = true;
422
423 // If true, the node is able to be drawn to the view port.
425 bool bIsNodeEnabled = false;
426
427 UPROPERTY()
428 bool bIsExpanded = true;
429
430 UPROPERTY()
432
433 UPROPERTY()
434 FText Label;
435
436 UPROPERTY()
438
439 UPROPERTY()
441#endif // WITH_EDITORONLY_DATA
442};
443
444
445#if WITH_EDITOR
446
447template< class TElementType > TObjectPtr<TElementType> UPoseWatch::AddElement(const FText InLabel, const FName InIconName)
448{
450 PoseWatchElement->SetParent(this);
451 PoseWatchElement->SetUniqueLabel(InLabel);
452 PoseWatchElement->SetIconName(InIconName);
454 Elements.Add(PoseWatchElement);
455
456 return PoseWatchElement;
457}
458
459#endif // WITH_EDITOR
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Archive.h:1208
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
Definition Text.h:385
Definition Array.h:670
Definition AnimBlueprint.h:82
Definition BlendProfile.h:132
Definition Object.h:95
Definition PoseWatch.h:133
Definition PoseWatch.h:33
Definition PoseWatch.h:230
Definition PoseWatch.h:267
Definition PoseWatch.h:17
FColor ChoosePoseWatchColor()
TSet< UPoseWatchFolder * > GetChildrenPoseWatchFoldersOf(const UPoseWatchFolder *Folder, const UAnimBlueprint *AnimBlueprint)
TSet< UPoseWatch * > GetChildrenPoseWatchOf(const UPoseWatchFolder *Folder, const UAnimBlueprint *AnimBlueprint)
FText FindUniqueNameInParent(TParent *InParent, const TItem *InItem)
Definition Color.h:486
static CORE_API FColor MakeRandomColor()
Definition Color.cpp:499
Definition BonePose.h:356
Definition SlateIcon.h:13
Definition ElementType.h:30
Definition ObjectPtr.h:488
Definition WeakObjectPtrTemplates.h:25