How to derive a class defined in Private directories?

Hi,

I’m trying to create a plugin which has a custom editor derived from Actor Blueprint Editor.
To implement this feature with minimum effort, I tried to derive FActorDetails defined in Editor/DetailCustomizations/Private/ActorDetails.h.
However, I could not compile the codes because of the unresolved external symbol error.

Following code is the snippet of my experimental codes.
I’m not sure whether this implementation is correct or not.

  • Build.cs
        PrivateDependencyModuleNames.AddRange(
            new string[]
            {
                // ... <snip> ...

                "DetailCustomizations",

                // ... <snip> ...
            }
        );

        PrivateIncludePaths.AddRange(
            new string[]
            {
                "Editor/DetailCustomizations/Private",
            }
        );
  • Class definition
#include "Editor/DetailCustomizations/Private/ActorDetails.h"

class FMyActorDetails : public FActorDetails
{
public:
	virtual ~FMyActorDetails();

	virtual void CustomizeDetails(IDetailLayoutBuilder& Layout) override;

	static TSharedRef<IDetailCustomization> MakeInstance();
};

FMyActorDetails ::~FMyActorDetails() {}

void FMyActorDetails ::CustomizeDetails(IDetailLayoutBuilder& Layout) {}

TSharedRef<IDetailCustomization> FMyActorDetails ::MakeInstance()
{
    return MakeShareable(new FMyActorDetails );
}

It will be very helpful if someone tells me the advice about this issue.

Thanks.

You should not derive from FActorDetails but rather from IDetailsCustomization and register your customization using FDetailCustomizationsModule::RegisterCustomClassLayout. Extending Class Details is additive (where you Add to the customization with each customization), whereas Struct customization is exclusive by default.

There is some very good info about extending the editor here: C++ Extending the Editor | Live Training | Unreal Engine - YouTube