Going beyond awesome with Blueprints

First I love the blueprint system and you did an extraordinary job making it so cool to work with.

As I am generally a C# developer I got accustomed to a few quality of life features like properties.
It would be a great addition if you could implement something similar in Unreal. I know I can write custom getter/setter functions but properties are so much neater.

Aside from that, I would appreciate to be able to add these properties to interfaces. The same applies to event dispatchers.

Lastly a great addition would be, if we could choose actors with interfaces in public interface variables when they are placed in the map.
Right now when you add an interface variable, make it public, place the blueprint in the map and you want to fill its slot with an actor from the map which has the interface applied, no fitting actors are found in the map.

Hi Unavi,

I’ve got good news for you, C# property style accessors are coming in 4.17, though only declared from C++ for now (and they won’t work in interfaces since there is still a backing variable that is used to store the metadata). Here’s an example of usage:


private:
	UPROPERTY(EditAnywhere, BlueprintSetter=ApplySkin)
	UCharacterSkinDescription* ActiveSkin;

public:
	UFUNCTION(BlueprintSetter)
	void ApplySkin(UCharacterSkinDescription* InSkin)
	{
		if (InSkin != ActiveSkin)
		{
			ActiveSkin = InSkin;

			USkeletalMeshComponent* MyMeshComponent = GetMesh();
			MyMeshComponent->SetSkeletalMesh(ActiveSkin ? ActiveSkin->Mesh : nullptr);

			MyMeshComponent->OverrideMaterials.Reset();
			if (ActiveSkin != nullptr)
			{
				for (int32 Index = 0; Index < ActiveSkin->Materials.Num(); ++Index)
				{
					MyMeshComponent->SetMaterial(Index, ActiveSkin->Materials[Index]);
				}
			}
		}
	}


This will show up as a regular variable that can be read or set in a BP, but setting it calls the method instead.

Cheers,
Michael Noland

Thank you Michael. It is great to here that you see the potential and you are already working in this direction. Do you have any estimate if and when we can expect to use this in blueprints?
Any insight you can share related to my other questions?
Cheers,
Lukas

Wow another huge win for blueprint component creation! Thanks so much! I can’t tell you how many times I’ve refactored code after I realized a variable change needs to trigger a UI event, which can be solved in seconds with a setter.

Declaring accessors in C++ will be available in 4.17 (releasing in the next month); no news on interface improvements.

Cheers,
Michael Noland

Maybe it would be nice to have some small icon on top of get and set blueprint node which is linked to getter and setter to make it clear that it is not just simple operation. Icon can be in similar style as clock on latent blueprint nodes.