UBspConversionTool

Converts BSP brushes to static meshes.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MeshModelingToolsEditorOnly

Header

/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/MeshModelingToolsEditorOnly/Public/BspConversionTool.h

Include

#include "BspConversionTool.h"

Syntax

UCLASS()
class UBspConversionTool : public UInteractiveTool

Remarks

Converts BSP brushes to static meshes.

Known limitations:

  • Preview does not respond to property changes in the brush detail panel while the tool is running. User would need to create some event that does change the preview (such as tool property change, or selection change).

  • BSP brushes with non-manifold geometry (specifically, the stair brushes) cannot be used with the "Convert, then combine" path because boolean operations do not allow them. The user gets properly notified of this if it comes up.

Variables

Name Description

Protected variable

bool

 

bCanAccept

Protected variable

TArray< ABrush ...

 

BrushesToConvert

Protected variable

TArray< ABrush ...

 

BrushesToDelete

Protected variable

ABrush *

 

BrushForPivot

Protected variable

TMap< ABrush &#...

 

CachedBrushes

Protected variable

EBspConversionT...

 

PendingAction

Protected variable UProperty

TObjectPtr< UPr...

 

PreviewMesh

Public variable UProperty

TObjectPtr< UBs...

 

Settings

Protected variable

UWorld *

 

TargetWorld

Public variable UProperty

TObjectPtr< UBs...

 

ToolActions

Constructors

Name Description

Public function

UBspConversionTool()

Functions

Name Description

Protected function

void

 

ApplyAction

(
    EBspConversionToolAction ActionType
)

Protected function Const

bool

 

AtLeastOneValidConversionTarget()

Returns true if there is at least one valid conversion actor selected (an explicitly selected brush, or a volume if those are included).

Protected function

bool

 

CombineThenConvert

(
    FText* ErrorMessage
)

The easy conversion path, where we just use the existing bsp conversion function to convert everything that was selected.

Protected function

bool

 

CompareAndUpdateConversionTargets()

Updates the targets that the conversion functions operate on (BrushesToConvert, BrushForPivot), based on level composition, current selection, and settings.

Protected function

bool

 

ComputeAndUpdatePreviewMesh

(
    FText* ErrorMessage
)

Performs conversion of BrushesToConvert and stores the result in the preview mesh.

Protected function

bool

 

ConvertThenCombine

(
    FText* ErrorMessage
)

The more complicated conversion path, where we convert brushes individually and use static mesh boolean operations to combine them.

Protected function Const

bool

 

IsValidConversionTarget

(
    const ABrush* Brush
)

Determines whether the passed in pointer is a valid convertible brush.

Protected function

void

 

OnEditorActorMoved

(
    AActor* InActor
)

Actor movements include any transform changes, and change both the preview and the cached brushes.

Protected function

void

 

OnEditorLevelActorListChanged()

Changes to the actor list may change the order of brush composition, or add or remove implicitly included subtractive brushes.

Protected function

void

 

OnEditorSelectionChanged

(
    UObject* NewSelection
)

This is the primary event we'll be responding to.

Public function Virtual

void

 

RequestAction

(
    EBspConversionToolAction ActionType
)

Public function Virtual

void

 

SetWorld

(
    UWorld* World
)

Overridden from UInteractiveTool

Name Description

Public function Virtual Const

bool

 

CanAccept()

Public function Virtual Const

bool

 

HasAccept()

Public function Virtual Const

bool

 

HasCancel()

Public function Virtual

void

 

OnPropertyModified

(
    UObject* PropertySet,
    FProperty* Property
)

Automatically called by UInteractiveToolPropertySet.OnModified delegate to notify Tool of child property set changes

Public function Virtual

void

 

OnTick

(
    float DeltaTime
)

Action support/system

Public function Virtual

void

 

RegisterActions

(
    FInteractiveToolActionSet& ActionS...
)

Override this function to register the set of Actions this Tool supports, using FInteractiveToolActionSet::RegisterAction.

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

Allow the Tool to do any custom drawing (ie via PDI/RHI)

Public function Virtual

void

 

Setup()

Called by ToolManager to initialize the Tool after ToolBuilder::BuildTool() has been called

Public function Virtual

void

 

Shutdown

(
    EToolShutdownType ShutdownType
)

Called by ToolManager to shut down the Tool