How to add button to blueprint details panel?

I want to add a button to my blueprint’s detail panel, like the one from the Sky Light component (see attached image). How can I achieve that?

Thanks!

Stephane
ButtonDetailsPanel.jpg

1 Like

You would have to dig into that class in C++.

Look inside Engine’s source code for this class:

IDetailCustomization

It is not an UObject, it’s pure C++ so you must be careful when using it to not generate memory leaks :slight_smile:

Thanks for the info guys, I did look into that class, looks like C++ is the only way to do that. It would be nice to have a “Button” variable type for blueprints :slight_smile:

2 Likes

Try Blutilities. Maybe it helps

1 Like

Can we please have a button without writing 2 pages of code? Thank you.

2 Likes

Well, you can make a an Event to a Blutility button by checking “Call in Editor”. If you select an instance of that Actor in the scene and scroll down in the details panel on the right, you should find a blutility dropdown menu.

Other than that, no we can not have a button without writing 2 pages. The Engine editor is build around slate and you can’t dodge writing C++/Slate for everything. Blueprints don’t cover everything.

1 Like

I’m using a checkbox, which is the most simple button replacement, using just the bool UProperty.
That’s one line.
Make sure to reset your boolean in PostEditChangeProperty.
Would be great to extend the UProperty meta-data, so we can show a real button instead of a checkbox.
Might need 4 lines in engine code and could help a lot of developers.

4 Likes

Amen to that!

It is now as simple as it should be, just add:


UFUNCTION(BlueprintCallable, CallInEditor)

macro above your function, recompile and button will be there.

Sorry for necro-ing old thread, but it’s easier to find this than actual answer.

19 Likes

Omg <3, just needed this!

Thanks for the update!

You can also define function in bp, and check “Call In Editor”.

5 Likes

Fantastic, thanks for sharing this! Super easy now.

I’m adding it for who might stumble upon it like myself, actually in functions of blueprint there is a tick for call in editor that does just what was asked for something as simple as this.

1 Like