Editor Plugin Development: How do I make a form with properties of an actor?

Could someone give me a basic example of how I can put a form with some information from an Actor to generate from the plugin, from there I can move on with the development.

I’m a few days into this. I’m having some difficulty in doing a simple thing in a plugin that I’m developing even scouring the documentation. Other than that I only find old documentation about it.

Preferably, I would like a more native way of doing this, without customizations.


This plugin was created using the “Editor Mode” template when using the “New Plugin” of UE4. I’m using it as the basis for this plugin I’m developing:

234377-a-editor-mode-plugin-example.png


And it’s this kind of property that I want to put in my plugin, in this area of the editor, at first it would only have one String and one Enum to be selected:

234378-plugin-editor-mode-i-want-to-do.png


Could someone help me with this, please?

After much research, trial and error, I got what I wanted. I discovered that the secret to what I wanted is, briefly, in this setup:

ALSO, I’ve put an example plugin in the GitHub (I called it Empex - Editor Mode Plugin Example) to make it easier for someone who is looking for it:

  1. Create a DetailView in the FPropertyEditorModule with its DetailsViewArgs:
    (http://api.unrealengine.com/INT/API/...ateDetailView/)

    void SEmpexEditModeTools::Construct(const FArguments& InArgs)
    {
    // initialize settings view
    FDetailsViewArgs DetailsViewArgs;
    {
        // Some arguments here...
    }
    
    DetailsView = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor").CreateDetailView(DetailsViewArgs);
    
    ChildSlot
    [
        SNew(SScrollBox)
        + SScrollBox::Slot()
        [
            SNew(SVerticalBox)
            + SVerticalBox::Slot()
            .Padding(15, 12, 0, 12)
            [
                SNew(STextBlock)
                .Text(LOCTEXT("Empex_Tip", "This is a simple text!"))
            ]
            + SVerticalBox::Slot()
            .AutoHeight()
            [
                DetailsView.ToSharedRef() // And
            ]
        ]
    ];
    

    }

    void SEmpexEditModeTools::SetDetailsObjects(const TArray<TWeakObjectPtr<>>& InObjects)
    {
    DetailsView->SetObjects(InObjects);
    }

  2. And declare some properties, obviously:

    UENUM()
    enum class EEmpexEnumDataExample : uint8
    {
    Foo UMETA(DisplayName = “Foo”),
    Bar UMETA(DisplayName = “Bar”),
    Foobar UMETA(DisplayName = “Foobar”),
    };

    UCLASS()
    class UEmpexSettings : public UObject
    {
    GENERATED_UCLASS_BODY()

    public:
    // UObject interface
    virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;

    ~UEmpexSettings();
    
    float GetFloatFoo() const { return FloatFoo; }
    void SetFloatFoo(float InRadius);
    

    protected:
    /** Example float property /
    UPROPERTY(EditAnywhere, Category = CategoryOne, meta = (DisplayName = “Float Foo”))
    float FloatFoo;
    public:
    /
    * Min and Max FloatFoo range retrieved from config */
    float FloatFooMin;
    float FloatFooMax;

    /** Example boolean property */
    UPROPERTY(EditAnywhere, Category = CategoryOne, meta = (DisplayName = "Boolean Bar"))
    bool bBooleanBar;
    
    /** Example enum property */
    UPROPERTY(EditAnywhere, Category = AnotherCategory)
    EEmpexEnumDataExample EnumDataExample;
    

    };

  3. There are a few more settings that are part of the structure of a plugin, but all of this you can see in the source code I’m making available on GitHub.

And the result you can see in the image:

235035-screenshot-empex-plugin.png

Regards,
Lucas Martins.

Thanks my brudda. Time saver

1 Like