Download

Execute editor actions via blueprint ?

Hello all ! This is my very first post here, so i’m happy to say hello.

I just need to execute some unreal interface action, for example buils menu–>lighting info–>lightmap resolution adjustment–>manipulate the ratio scroolbar value via blueprint.
I’m coming from 3dsmax world in wich it’s quite simple to do that (thanks to maxscript listener)… But i’m totally stuck with unreal… Someone have an idea how to do that ?
My goal is to make a tool wich make gpu bake very easy, with quality presets, lightmap resolution manager (that’s the point of this post) and other stuff wich allows to manage the bake using a single centralized widget.
Just like my SolidRocks plugin for 3dsmax/vray.
Thanks in advance, i wish you all the best.

Think you would have to expose some functions yourself from cpp to blueprints then.


FToolMenuSection& Section = SubMenu->AddSection("LevelEditorBuildLightingResolution3", LOCTEXT( "LightingResolutionHeading3", "Ratio" ) );

TSharedRef<SWidget> Ratio = SNew(SSpinBox<int32>)
    .MinValue(0)
    .MaxValue(400)
    .ToolTipText(LOCTEXT( "LightingResolutionRatioToolTip", "Ratio to apply (New Resolution = Ratio / 100.0f * CurrentResolution)." ))
    .Value(FLevelEditorActionCallbacks::GetLightingResolutionRatio())
    .OnEndSliderMovement_Static(&FLevelEditorActionCallbacks::SetLightingResolutionRatio)
    .OnValueCommitted_Static(&FLevelEditorActionCallbacks::SetLightingResolutionRatioCommit);

Section.AddEntry(FToolMenuEntry::InitWidget("Ratio", Ratio, LOCTEXT( "LightingResolutionRatio", "Ratio" )));

Is where the slider is added to slate in Engine\Source\Editor\LevelEditor\Private\LevelEditorToolBar.cpp

You could make a cpp where you make functions available to blueprint that calls the same FLevelEditorActionCallbacks.

Thank you very much for your help !