UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModAPIBlueprint.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric Contributors
3#pragma once
4
5#include "ModAPIResult.h"
6#include "Templates/Function.h"
7#include "UObject/WeakObjectPtr.h"
8#include "UObject/WeakObjectPtrTemplates.h"
9
10class FProperty;
11class UClass;
12class UFunction;
13class UObject;
14
15namespace Mod::API
16{
18enum class EBlueprintParameter : uint8
19{
26};
27
30{
32 FName Name;
38 FName TypePath = NAME_None;
39
40 bool operator==(const FBlueprintParameter& Other) const = default;
41};
42
45{
47 FName Name;
49 TConstArrayView<FBlueprintParameter> Parameters;
50};
51
53class MODAPI_API FBlueprintCall
54{
55public:
61 static TModResult<TArray<FBlueprintParameter>> Describe(const UFunction& Function, bool bProjected = false);
62
63public:
65 Bind(UClass& DeclaringClass, UClass& ActualClass, const FBlueprintFunction& Expected, bool bProjected = false);
66 static void Invalidate();
67 bool IsCurrent() const;
68 const FProperty* GetParameter(int32 Index) const
69 {
70 return Properties[Index];
71 }
72 EError Process(UObject& Target, TFunctionRef<void(void*)> Write, TFunctionRef<void(const void*)> Read) const;
73
74private:
75 TWeakObjectPtr<UFunction> Function;
76 TArray<const FProperty*> Properties;
77 uint64 Generation = 0;
78};
79} // namespace Mod::API
EBlueprintParameter
Parameter roles supported by synchronous Blueprint exports.
Definition ModAPIBlueprint.h:19
@ Output
A scalar output written through a Blueprint result pin.
Definition ModAPIBlueprint.h:23
@ Input
A scalar passed by value into the Blueprint.
Definition ModAPIBlueprint.h:21
@ Return
The Unreal function return property.
Definition ModAPIBlueprint.h:25
EError
Recoverable failures of generated synchronous API calls.
Definition ModAPIResult.h:11
Validated function and argument properties for one Blueprint class.
Definition ModAPIBlueprint.h:54
static TModResult< TArray< FBlueprintParameter > > Describe(const UFunction &Function, bool bProjected=false)
Describes a synchronous Blueprint function on the game thread.
A synchronous API result containing either a value or a stable error.
Definition ModAPIResult.h:47
One Blueprint function and its expected reflected parameter list.
Definition ModAPIBlueprint.h:45
TConstArrayView< FBlueprintParameter > Parameters
Module-owned parameter descriptions in reflection order.
Definition ModAPIBlueprint.h:49
FName Name
The compiled function name in the declaring class.
Definition ModAPIBlueprint.h:47
A generated parameter description independent of its compiled byte offset.
Definition ModAPIBlueprint.h:30
FName TypePath
Exact reflected type path for a projected parameter.
Definition ModAPIBlueprint.h:38
FName Name
Property name in the compiled function.
Definition ModAPIBlueprint.h:32
FName PropertyClass
Exact Unreal property class, such as FloatProperty.
Definition ModAPIBlueprint.h:34
EBlueprintParameter Role
Parameter direction and result convention.
Definition ModAPIBlueprint.h:36