Navigation
API > API/Editor > API/Editor/BlueprintGraph
Serves as a centralized data-store for all UBlueprintNodeSpawner node- templates. Implemented this way (rather than internal to UBlueprintNodeSpawner) since node-templates require a UEdGraph/UBlueprint outer chain. Instead of instantiating a bunch of graphs/blueprints per UBlueprintNodeSpawner, we'd rather have a small centralized set here.
| Name | FBlueprintNodeTemplateCache |
| Type | class |
| Header File | /Engine/Source/Editor/BlueprintGraph/Public/BlueprintNodeTemplateCache.h |
| Include Path | #include "BlueprintNodeTemplateCache.h" |
Syntax
class FBlueprintNodeTemplateCache : public FGCObject
Inheritance Hierarchy
- FGCObject → FBlueprintNodeTemplateCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FBlueprintNodeTemplateCache() |
BlueprintNodeTemplateCache.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ApproximateObjectMem | int64 | It can be costly to tally back up the estimated cache size every time an entry is added, so we keep this approximate tally of memory allocated for UObjects (owned by this system). | BlueprintNodeTemplateCache.h | |
| NodeTemplateCache | TMap< UBlueprintNodeSpawner const *, TObjectPtr< UEdGraphNode > > | BlueprintNodeTemplateCache.h | ||
| TemplateOuters | TArray< TObjectPtr< UBlueprint > > | Unfortunately, we cannot nest template-nodes in the transient package. | BlueprintNodeTemplateCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearCachedTemplate
(
UBlueprintNodeSpawner const* NodeSpawner |
Wipes any nodes that were cached on behalf of the specified spawner (should be called when NodeSpawner is destroyed, in case GetNodeTemplate() was called for it). | BlueprintNodeTemplateCache.h | |
int64 GetEstimateCacheSize() |
Approximates the current memory footprint of the entire cache (instantiated UObject sizes + allocated container space). | BlueprintNodeTemplateCache.h | |
UEdGraphNode * GetNodeTemplate
(
UBlueprintNodeSpawner const* NodeSpawner, |
Retrieves a cached template associated with the supplied spawner. | BlueprintNodeTemplateCache.h | |
UEdGraphNode * GetNodeTemplate
(
UBlueprintNodeSpawner const* NodeSpawner, |
Retrieves a cached template associated with the supplied spawner. | BlueprintNodeTemplateCache.h | |
int64 RecalculateCacheSize() |
External systems can make changes that alter the memory footprint of the cache (like calling AllocateDefaultPins), and since we don't recalculate the cache's size every frame sometimes we need to update the internal estimate. | BlueprintNodeTemplateCache.h |
Overridden from FGCObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddReferencedObjects
(
FReferenceCollector& Collector |
BlueprintNodeTemplateCache.h | ||
virtual FString GetReferencerName() |
BlueprintNodeTemplateCache.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool IsTemplateOuter
(
UEdGraph* ParentGraph |
Utility method to help external systems identify if a graph they have belongs here, to the FBlueprintNodeTemplateCache system. | BlueprintNodeTemplateCache.h |