MetaForge Documentation
Fab Store PageDiscord
  • MetaForge
    • Getting Started
    • Plugin Configuration
    • Runtime Configuration
    • Project Configuration
    • Model Objects
    • Model Managers
    • Registering Models
    • Conditionals
    • Validators
    • References
    • References (Advanced)
    • Property Drawers
    • List Properties
    • IDE File Templates
    • Runtime Usage
  • Contact Us
Powered by GitBook
On this page
  • Step 1: Define a Model Object
  • Step 2: Create a Model Manager for Your Objects
  • Step 3: Create a Blueprint with the Base Custom Configuration
  • Step 4: Set Up an Initializer to Register Your Models with MetaForge
  • Step 5: Connect the Config Blueprint to Your Initializer
  • Step 6: Test Your Setup
  1. MetaForge

Getting Started

PreviousMetaForgeNextPlugin Configuration

Last updated 5 months ago

To get started with MetaForge, there are a few setup steps:

  1. Plugin installation. Marketplace plugins should automatically be installed into your unreal plugins folder.

  2. Plugin Activation: Activate the plugin in your Unreal Editor.

  1. Project Setup (Below)

Step 1: Define a Model Object

Define a model object and apply annotations to it:

#pragma once

#include "UDataModel.h"
#include "UMyModelObject.generated.h"

UCLASS()
class UMyModelObject : public UObject, public IDataModel
{
    GENERATED_BODY()
public:
    virtual FName GetModelId() override {
        return IdProperty;
    }

    UPROPERTY(EditAnywhere, Category = "MyModel", meta = (Component = "SNameProperty"))
    FName IdProperty;
};

Step 2: Create a Model Manager for Your Objects

Create a model manager that will manage your model objects:

#pragma once

#include "CoreMinimal.h"
#include "UMyModelObject.h"
#include "Data/BaseModelManager.h"
#include "UMyModelManager.generated.h"

UCLASS(Blueprintable, BlueprintType)
class UMyModelManager : public UObject, public BaseModelManager<UMyModelObject, UMyModelManager>
{
    GENERATED_BODY()

protected:
    virtual TArray<UObject*>& GetObjectsMutable() override {
        return reinterpret_cast<TArray<UObject*>&>(ModelObjects);
    }
    virtual UMyModelObject* CreateNewObject() const override {
        UMyModelObject* newObj = NewObject<UMyModelObject>();
        newObj->IdProperty = FName("Default Name");
        return newObj;
    }

    UPROPERTY(Instanced)
    TArray<UMyModelObject*> ModelObjects;
};

Step 3: Create a Blueprint with the Base Custom Configuration

Create a blueprint using the base custom configuration to link with your model objects.

Step 4: Set Up an Initializer to Register Your Models with MetaForge

Create an initializer to register your models:

#pragma once

#include "UInitializer.generated.h"

UCLASS()
class UInitializer : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()

public:
    UFUNCTION(BlueprintCallable, Category = "Data Model")
    static void Initialize() {
        #if WITH_EDITOR //this is editor specific stuff
            FMetaForgeEditorModule* MyModule = FMetaForgeEditorModule::GetModule();
            MyModule->RegisterModule<UMyModelObject, UMyModelManager>("MyModel");
        #endif
    }
};

Step 5: Connect the Config Blueprint to Your Initializer

Use the initializer to connect the configuration blueprint, as shown in the provided screenshot below:

Step 6: Test Your Setup

Since this is a code based plugin, you will need to execute a build from your IDE, and, in general, it is more efficient to run the editor also from your IDE, so that changing C++ classes and objects is a simpler workflow.

After executing a build, run your editor and open the MetaForge panel, available in the Tools menu.

You should be presented with the MetaForge window:

Plugin Activation
Blueprint Setup
Tools Menu
MetaForge