Customization: how to retrieve the blueprint editor

I’m writing a detail customization for some property of a custom actor component. I would like to know how to retrieve the blueprint editor, which itself would allow me to get the SCSEditor.

What I want to achieve is being able to reuse the socket chooser widget from within my customization - this needs a reference to the parent node in the SCS tree. More generally, a pointer to the editor is nice to have in order to replicate some of the customizations done in BlueprintDetailsCustomizations.

The way I’m currently doing it is walking up the outers hierarchy of the handle of the property I’m customizing:

  • Get the outer template
  • Get its owner blueprint generated class
  • Retrieve the generating blueprint itself
  • FToolkitManager::Get().FindEditorForAsset( blueprint )
  • Cast to BlueprintEditor

Which seems really convoluted to me.

What better alternatives are there?

Hi Gabriel,

I don’t know any better alternative. Including Phillip, maybe he knows.

Cheers,
M

Hi Gabriel,

Where are you registering your details customization? If it originates from somewhere within the Blueprint editor code itself you could potentially pass it in as a parameter (e.g. see SKismetInspector::EnableComponentDetailsCustomization()).

Otherwise Maciej is correct, FindEditorForAsset() is probably your best bet.

Hope this helps! -phil.

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Hi, thanks for your answer!

I’m registering the customization in a module startup so I suppose I can’t easily retrieve the blueprint editor at this point.
I’ll keep my FindEditorForAsset() then!

Sure, go ahead if it might help!