I have a custom trigger volume class derived from ‘AVolume’, say ‘ACustomVolume’.
I have no problems using this class in the level if I use the ‘place actor’ editor tool to place these - I get a nice default cube shape with x/y/z exposed and can change the volume using the brush builder dropdown.
Now I’ve created a blueprint subclass of this (say ‘BP_Custom_Volume’) with some added functionality but if I drop this blueprint actor into the level the default shape does not get created. Nothing happens even if I manually setup a cubebuilder from the dropdown and specify x/y/z from the details panel.
Obviously there’s some magic happening when a (non-blueprint) volume class is dropped into the level that automatically generates the default builder and I need to make this happen in my custom class, but after digging through the source code quite a bit (Brush.cpp/EditorBrushBuilder.cpp/Model.cpp/etc) I think I can safely say I’m stuck
Below is a snippet of code I found on the Answers hub; I’ve tried calling it in many different ways (custom UFunction called from Blueprint construction script/PostEditChangeProperty override/etc) but it doesn’t seem to do anything.
UCubeBuilder* cubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
cubeBuilder->X = 1000;
cubeBuilder->Y = 1000;
cubeBuilder->Z = 200;
cubeBuilder->Build(World, this);
GEditor->Exec(World, TEXT("BRUSH ADDED"));
GEditorModeTools().MapChangeNotify();
To summarize - I need a way to setup my custom Brush actor’s default shape and extents (example to a cube sized 100,100,100) just as the Editor does to any ‘pure’ brush actor (C++ based Volume OR BSP) that is placed into a level.