Blueprint run construction script on button press

How do I make it so that the construction script (or another function if that is impossible) is only run when I push a button in the blueprints properties panel in the editor?

I am using a spline that constructs meshes and deforms then when the points are moved. This causes a lot of lag in the editor and I want to postpone this rebuilding until I am done arranging my spline points.

Stuff like speed tree I think has a way to only “recalculate” or “rebuild” when you push a button.

Currently there is no automated way to do that.

That said, you can structure some logic in your BP to make it happen. Make an editable Bool called “Update” or something.

Then in your graph, make it so that only when this value is true do your meshes get updated. Then at the very end of that chain, make it automatically turn itself to ‘false’ again.

In practice this looks kind of hacky, since you will click the boolean to cause the update but you will never actually see the box get checked since it will be unchecking itself right away. This has become a fairly standard practice for me.

Edit I al

Also, you could kind of do it using “Blutilities” by doing stuff in the event graph with a custom event with “Call in editor” checked. Then you will actually get a ‘function’ to select under blutilities and then you press the “Run” button.

You may have to enable blutilities under experimental features for this to work, but with this setup it will feel more like a button. You can also do stuff this way that you normally could not do, such as communicate with cross level actors.

You can even trigger these events in matinee and see them get called in the editor.

  • Then in your graph, make it so that only when this value is true do your meshes get updated. Then at the very end of that chain, make it automatically turn itself to ‘false’ again.

So, how can I make mesh get updated? Is there a node for it?

Very old thread, but if you still struggling with it, here is the solution :slight_smile:

In your Blueprint create a function and and set a check by “Call in Editor”.

So you can run a certain function by pressing a button in your bluprint properties :slight_smile:

Greets

1 Like