How to do it...

  1. First, we will update the MyCustomAsset class to be editable in Blueprints and reflect what we'll be doing in this recipe. Go to MyCustomAsset.h and update it to the following code:
#pragma once#include "CoreMinimal.h"#include "UObject/NoExportTypes.h"#include "MyCustomAsset.generated.h"UCLASS(BlueprintType, EditInlineNew)class CHAPTER_10_API UMyCustomAsset : public UObject{  GENERATED_BODY()public:    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Custom Asset")    FString ColorName;  };
  1. From the Chapter_10Editor folder, create a new file called MyCustomAssetPinFactory.h .
  2. Inside the header, add the following code:
#pragma once#include "EdGraphUtilities.h"#include "MyCustomAsset.h"#include "SGraphPinCustomAsset.h"struct ...

Get Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.