AGeneratedDynamicMeshActor

[AGeneratedDynamicMeshActor](API\Plugins\GeometryScriptingEditor\GeometryActors\AGeneratedDynamicMeshActor) is an Editor-only subclass of [ADynamicMeshActor](API\Runtime\GeometryFramework\ADynamicMeshActor) that provides special support for dynamic procedural generation of meshes in the Editor, eg via Blueprints.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

GeometryScriptingEditor

Header

/Engine/Plugins/Experimental/GeometryScripting/Source/GeometryScriptingEditor/Public/GeometryActors/GeneratedDynamicMeshActor.h

Include

#include "GeometryActors/GeneratedDynamicMeshActor.h"

Syntax

UCLASS()
class AGeneratedDynamicMeshActor : public ADynamicMeshActor

Remarks

AGeneratedDynamicMeshActor is an Editor-only subclass of ADynamicMeshActor that provides special support for dynamic procedural generation of meshes in the Editor, eg via Blueprints. Expensive procedural generation implemented via BP can potentially cause major problems in the Editor, in particular with interactive performance. AGeneratedDynamicMeshActor provides special infrastructure for this use case. Essentially, instead of doing procedural generation in the Construction Script, a BP-implementable event OnRebuildGeneratedMesh is available, and doing the procedural mesh regeneration when that function fires will generally provide better in-Editor interactive performance.

Variables

Name Description

Protected variable

bool

 

bGeneratedMeshRebuildPending

This internal flag is set in OnConstruction, and will cause ExecuteRebuildGeneratedMesh to fire the OnRebuildGeneratedMesh event, after which the flag will be cleared

Protected variable

bool

 

bIsRegisteredWithGenerationManager

Indicates that this Actor is registered with the UEditorGeometryGenerationSubsystem, which is where the mesh rebuilds are executed

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

bool

 

bResetOnRebuild

If true, the internal UDynamicMesh will be cleared before the OnRebuildGeneratedMesh event is fired.

Constructors

Name Description

Public function

AGeneratedDynamicMeshActor

(
    const FObjectInitializer& ObjectIn...
)

Destructors

Functions

Name Description

Public function UFunction BlueprintCallable, Category

void

 

CopyPropertiesFromStaticMesh

(
    AStaticMeshActor* StaticMeshAc...,
    bool bCopyComponentMaterials
)

Attempt to copy Actor Properties from a StaticMeshActor.

Public function UFunction BlueprintCallable, Category

void

 

CopyPropertiesToStaticMesh

(
    AStaticMeshActor* StaticMeshAc...,
    bool bCopyComponentMaterials
)

Attempt to copy Actor Properties to a StaticMeshActor.

Public function Virtual

void

 

ExecuteRebuildGeneratedMeshIfPending()

This function will fire the OnRebuildGeneratedMesh event if the actor has been marked for a pending rebuild (eg via OnConstruction)

Public function UFunction Category, BlueprintImplementableEvent callineditor

void

 

OnRebuildGeneratedMesh

(
    UDynamicMesh* TargetMesh
)

This event will be fired to notify the BP that the generated Mesh should be rebuilt.

Protected function Virtual

void

 

RegisterWithGenerationManager()

Protected function Virtual

void

 

UnregisterWithGenerationManager()

Overridden from AActor

Name Description

Public function Virtual

void

 

Destroyed()

Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending

Public function Virtual

void

 

OnConstruction

(
    const FTransform& Transform
)

Called when an instance of this class is placed (in editor) or spawned.