Within the Blueprint system, we can use instances of our MyCustomAsset
class as variables, provided we mark that class as a BlueprintType
in its UCLASS
macro.
However, by default, our new asset is simply treated as UObject
, and we can't access any of its members:
For some types of assets, we might wish to enable in-line editing of literal values in the same way that classes such as FVector
support the following:
In order to enable this, we need to use a Graph Pin visualizer. This recipe will show you how to enable in-line editing of an arbitrary type using a custom widget defined by you.
Create a new header file called
MyCustomAssetPinFactory.h
.Inside the header, add the following code:
#pragma once #include "EdGraphUtilities.h" #include "MyCustomAsset.h" #include "SGraphPinCustomAsset.h" struct UE4COOKBOOKEDITOR_API FMyCustomAssetPinFactory : public FGraphPanelPinFactory { public: virtual TSharedPtr<class SGraphPin>...