Navigation
API > API/Plugins > API/Plugins/MeshPartitionEditor
This is the base class for components modifying the MegaMesh. This is an EditorOnly Component. Their bounds represent the area they are affecting. They provide (overridable) interface to interact with the MegaMesh:
- Logic to attach/detach to the AMeshPartition (to move/update the MegaMesh as a whole)
- Invalidate bounds when updated (trigger a new compilation process for an area)
- Perform modification as a step (by modifying a FDynamicMesh) (could evolve into adding/modifying a displacement render target in the future).
The MegaMeshClassVersion meta data should be set to a positive number if you provide a deterministic cache behavior via GatherDependencies() (non-positive ModifierVersions will instead use random cache keys that are updated on change, and are less reliable in general) Whenever the implementation of the class is changed (such that it would generate a different result in Apply), the MegaMeshClassVersion should be bumped.
| Name | UModifierComponent |
| Type | class |
| Header File | /Engine/Plugins/Experimental/MeshPartition/Source/MeshPartitionEditor/Public/MeshPartitionModifierComponent.h |
| Include Path | #include "MeshPartitionModifierComponent.h" |
Syntax
UCLASS (MinimalAPI, Abstract,
HideCategories=(HLOD, RayTracing, TextureStreaming, Physics, Collision, Lighting, Rendering, Mobile, Navigation, Activation, Cooking, LOD, AssetUserData),
Meta=(MegaMeshClassVersion="0"))
class UModifierComponent :
public UPrimitiveComponent ,
public UE::MeshPartition::IModifierBlueprintInterface
Inheritance Hierarchy
- FRenderAssetOwnerStreamingState → UPrimitiveComponent → UModifierComponent
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UModifierComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsBodyInstanceOwner
- IPhysicsBodyInstanceOwnerResolver
- IPhysicsComponent
- IModifierBlueprintInterface
Derived Classes
UModifierComponent derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UModifierComponent() |
MeshPartitionModifierComponent.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AffectedMegaMesh | TSoftObjectPtr< AMeshPartition > | MegaMesh affected by the modifier. | MeshPartitionModifierComponent.h |
|
| BaseGrowth | MeshPartition::FBaseGrowth | MeshPartitionModifierComponent.h |
|
|
| bDrawBounds | bool | Transient Visualization Settings. | MeshPartitionModifierComponent.h |
|
| bIgnoreChanged | bool | MeshPartitionModifierComponent.h | ||
| bIsDisabled | bool | Disable processing this modifier completely. | MeshPartitionModifierComponent.h |
|
| bIsInteractive | bool | MeshPartitionModifierComponent.h | ||
| bIsTemporarilyDisabledInEditor | bool | Temporarily disable processing this modifier in any Mesh Partition builds (Preview/PCG Query/Modifier tool targets). | MeshPartitionModifierComponent.h |
|
| bNeedToRegisterWithMeshPartition | bool | Transient property that starts out true to make it easy to make sure that the MegaMesh knows of our existence (particularly when copying modifiers). | MeshPartitionModifierComponent.h | |
| CacheKey | FGuid | MeshPartitionModifierComponent.h |
|
|
| LastAppliedBounds | TArray< FBox > | The last bounds of the modifier that were integrated into the built mesh. | MeshPartitionModifierComponent.h | |
| LastSubmittedBounds | TArray< FBox > | The last bounds of the modifier that were submitted for evaluation, which may or may not have been applied yet. | MeshPartitionModifierComponent.h | |
| PreUndoMeshPartition | AMeshPartition * | Used to detect changes to our assigned megamesh across undo. | MeshPartitionModifierComponent.h | |
| PreviewSection | TWeakObjectPtr< MeshPartition::APreviewSection > | MeshPartitionModifierComponent.h |
|
|
| Priority | double | The sub priority orders modifiers within the same priority layer (higher is applied later). | MeshPartitionModifierComponent.h |
|
| Type | FPriorityLayerName | Modifiers are grouped into priority layers whose relative application order is controlled by the mesh partition definition. | MeshPartitionModifierComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSharedPtr< T > AllocateBackgroundOp
(
const FName& InOpName, |
MeshPartitionModifierComponent.h | ||
AActor * BindToNearestMeshPartition() |
Binds the modifier to the nearest MeshPartition in the world | MeshPartitionModifierComponent.h | |
AActor * BP_BindToNearestMeshPartition() |
Binds the modifier to the nearest MeshPartition. | MeshPartitionModifierComponent.h |
|
AMeshPartition * GetAffectedMeshPartition() |
MeshPartitionModifierComponent.h | ||
const MeshPartition::FBaseGrowth & GetBaseGrowth() |
MeshPartitionModifierComponent.h | ||
const FGuid & GetCacheKey() |
MeshPartitionModifierComponent.h | ||
| Function collecting the current list of priority layers declared in the Mesh Partition Definition. | MeshPartitionModifierComponent.h | ||
bool GetIsDisabledFlag() |
MeshPartitionModifierComponent.h | ||
int32 GetMegaMeshClassVersion () |
Get the MegaMeshClassVersion of this modifier. | MeshPartitionModifierComponent.h | |
| Function collecting the current list of channels declared in the MegaMesh Definition This is used by the ui of any Modifier presenting a channel option. | MeshPartitionModifierComponent.h |
|
|
UMeshPartitionEditorComponent * GetMeshPartitionEditorComponent() |
A helper to retrieve the parent AMeshPartition's UMeshPartitionEditorComponent. | MeshPartitionModifierComponent.h | |
MeshPartition::APreviewSection * GetPreviewSection() |
MeshPartitionModifierComponent.h | ||
double GetPriority() |
MeshPartitionModifierComponent.h | ||
FName GetPriorityLayer() |
Function getting the priority layer for this modifier from the declared priority layers in the Mesh Partition Definition. | MeshPartitionModifierComponent.h | |
const FName & GetType() |
MeshPartitionModifierComponent.h | ||
bool IntersectsAnyBounds
(
TConstArrayView< FBox > InBoundsToTest |
MeshPartitionModifierComponent.h | ||
bool IsDisabled() |
MeshPartitionModifierComponent.h | ||
bool IsFree() |
MeshPartitionModifierComponent.h | ||
bool IsInteractive() |
MeshPartitionModifierComponent.h | ||
void PrepareResources() |
Ensures any async resources required by this modifier are prepared. | MeshPartitionModifierComponent.h | |
void SetAffectedMeshPartition
(
AMeshPartition* InMeshPartition |
Sets the MeshPartition to be affected by this modifier. | MeshPartitionModifierComponent.h | |
void SetBaseGrowth
(
const FBaseGrowth& InBaseGrowth |
Sets the BaseGrowth structure, representing how a given modifier should grow the base bounds. | MeshPartitionModifierComponent.h | |
void SetDrawBounds
(
bool bEnabled |
Called by the SceneProxy to determine if the component should be visualized at the current moment. | MeshPartitionModifierComponent.h | |
void SetIgnoreChanged
(
const bool bInIgnoreChanged |
Allows to modulate OnChanged behavior. | MeshPartitionModifierComponent.h | |
void SetIsDisabledFlag
(
const bool bInIsDisabled |
MeshPartitionModifierComponent.h | ||
void SetIsInteractive
(
const bool bInIsInteractive |
Marks this modifier as currently interactive. | MeshPartitionModifierComponent.h | |
void SetPriority
(
const double InPriority |
MeshPartitionModifierComponent.h | ||
void SetPriorityLayer
(
const FName PriorityLayer |
Function setting the priority layer for this modifier from the declared priority layers in the Mesh Partition Definition. | MeshPartitionModifierComponent.h | |
void SetType
(
const FName& InType |
Sets the type of this modifier. | MeshPartitionModifierComponent.h | |
FGuid UpdateCacheKey
(
bool bInChangeCacheKey |
Updates the stored cache key. | MeshPartitionModifierComponent.h | |
void UpdateLastAppliedBounds() |
Last applied bounds is updated when the modifier is applied to the mesh so changes to those bounds can be tracked and updates can be triggered. | MeshPartitionModifierComponent.h |
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CanRender() |
MeshPartitionModifierComponent.h | ||
virtual TArray< FBox > ComputeBounds () |
Computes the set of bounding boxes describing the regions this modifier is affecting. | MeshPartitionModifierComponent.h | |
virtual FBox ComputeCombinedBounds () |
This function returns single bounding box representing the total area this modifier may affect. | MeshPartitionModifierComponent.h | |
virtual TSharedPtr< const MeshPartition::IModifierBackgroundOp > CreateBackgroundOp
(
const MeshPartition::EBuildType InBuildType |
Called to prepare for applying the modifier. | MeshPartitionModifierComponent.h | |
virtual TUniquePtr< FWorldPartitionComponentDesc > CreateClassComponentDesc() |
MeshPartitionModifierComponent.h | ||
virtual void DrawVisualization
(
const FSceneView* View, |
Called by the visualizer to give the modifier an oppertunity to render a debug visualization of itself when selected. | MeshPartitionModifierComponent.h | |
virtual FColor EditorUnselectedModifierColor() |
Get the color of the modifier in it's unselected state for scene proxy drawing. | MeshPartitionModifierComponent.h | |
virtual UE::Tasks::FTask GetAsyncPrepareResourcesTask() |
MeshPartitionModifierComponent.h | ||
virtual FGuid GetCodeVersionKey() |
MeshPartitionModifierComponent.h | ||
virtual double GetComplexity () |
Gets the added complexity when applying this modifier. | MeshPartitionModifierComponent.h | |
virtual float GetComplexityMultiplier () |
Gets the complexity multiplier when applying this modifier. | MeshPartitionModifierComponent.h | |
virtual TArray< UModifierComponent * > GetInteractiveProxies() |
MeshPartitionModifierComponent.h | ||
virtual void InitializeModifier () |
UPrimitiveComponent Implementation. | MeshPartitionModifierComponent.h | |
virtual bool IsBase() |
Allows to determine if this modifier will be used as a base. | MeshPartitionModifierComponent.h | |
virtual bool IsContiguous() |
MeshPartitionModifierComponent.h | ||
virtual bool IsTemporarilyDisabledInEditor () |
Returns true if the modifier is temporarily disabled from being processed in any MegaMesh builds. | MeshPartitionModifierComponent.h | |
virtual void MarkAsRegisteredWithMeshPartition
(
const AMeshPartition* InMeshPartition |
Called by UMeshPartitionEditorComponent when gathering all of its modifiers to let the modifier know that it has been registered, so that it doesn't try to call OnModifierAssigned unnecessarily. | MeshPartitionModifierComponent.h | |
virtual void OnChanged
(
TConstArrayView< const FBox > InBoundingBoxes, |
Called when the modifier changed and needs to be processed again. | MeshPartitionModifierComponent.h | |
virtual void OnMegaMeshDefinitionChanged
(
const UMeshPartitionDefinition* InDefinition |
Called when the parent AMeshPartition's UMeshPartitionDefinition changed. | MeshPartitionModifierComponent.h | |
virtual void OnMegaMeshDefinitionModified
(
const UMeshPartitionDefinition* InDefinition, |
Called when a property from the parent AMeshPartition's UMeshPartitionDefinition changed. | MeshPartitionModifierComponent.h | |
virtual void PostBuildSectionMesh
(
AActor* InSection, |
Called after a MeshPartition::APreviewSection or MeshPartition::ACompiledSectionFMeshData has been built in case the modifier needs to perform additional processing. | MeshPartitionModifierComponent.h | |
virtual void PostProcessSection
(
AActor* InSection |
Called after a MeshPartition::APreviewSection or MeshPartition::ACompiledSection has been built and their associated mesh finalized in case the modifier needs to perform additional processing. | MeshPartitionModifierComponent.h | |
virtual void PropertyChanged
(
FPropertyChangedEvent& InPropertyChangedEvent |
Called after a class member property changes. | MeshPartitionModifierComponent.h | |
virtual void SetIsTemporarilyHiddenInEditor
(
const bool bInIsHidden |
Called to show/hide components. | MeshPartitionModifierComponent.h | |
virtual void SetPreviewSection
(
MeshPartition::APreviewSection* InPreviewSection |
Sets the internal preview section. Meaning this base modifier is used to build the preview section. | MeshPartitionModifierComponent.h | |
virtual bool ShouldDrawBoundingBox() |
MeshPartitionModifierComponent.h | ||
virtual void UninitializeModifier() |
Called before a modifier will be unloaded and unregistered in case it need resource cleaning. | MeshPartitionModifierComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
We need this for the SceneProxy to function properly. | MeshPartitionModifierComponent.h | |
virtual void OnUpdateTransform
(
EUpdateTransformFlags InUpdateTransformFlags, |
MeshPartitionModifierComponent.h | ||
virtual void PostEditComponentMove
(
bool bFinished |
USceneComponent Implementation. | MeshPartitionModifierComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TStructOnScope< FActorComponentInstanceData > GetComponentInstanceData() |
MeshPartitionModifierComponent.h | ||
virtual FBox GetStreamingBoundsEditor() |
MeshPartitionModifierComponent.h | ||
virtual void OnComponentDestroyed
(
bool bInDestroyingHierarchy |
MeshPartitionModifierComponent.h | ||
virtual void OnRegister() |
UActorComponent Implementation. | MeshPartitionModifierComponent.h | |
virtual void OnUnregister() |
MeshPartitionModifierComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsEditorOnly() |
MeshPartitionModifierComponent.h | ||
virtual void PostDuplicate
(
bool bDuplicateForPIE |
MeshPartitionModifierComponent.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& InPropertyChangedEvent |
MeshPartitionModifierComponent.h | ||
virtual void PostEditUndo() |
MeshPartitionModifierComponent.h | ||
virtual void PreEditChange
(
FProperty* InPropertyAboutToChange |
MeshPartitionModifierComponent.h | ||
virtual void PreEditChange
(
FEditPropertyChain& PropertyAboutToChange |
MeshPartitionModifierComponent.h | ||
virtual void PreEditUndo() |
MeshPartitionModifierComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
UObject Implementation. | MeshPartitionModifierComponent.h |
Overridden from IModifierBlueprintInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BP_SetAffectedMegaMesh
(
AMeshPartition* InMeshPartition |
Sets the MeshPartition to be affected by this modifier. | MeshPartitionModifierComponent.h |
|
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMeshPartitionDefinition * GetMegaMeshDefinition() |
A helper to retrieve the parent AMeshPartition's UMeshPartitionDefinition. | MeshPartitionModifierComponent.h | |
FBox GetOwnerBounds
(
const bool bShouldBeRegistered |
Gets the bound of the actor owning this component. | MeshPartitionModifierComponent.h |
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GatherDependencies
(
MeshPartition::IDependencyInterface& Dependencies |
Gather Dependencies for this modifier, including asset and class dependencies and other relevant data (for example local settings) that affect the modifier apply behavior. | MeshPartitionModifierComponent.h | |
virtual bool ShouldShowSpriteComponent () |
Determines whether the editor-only sprite billboard is shown | MeshPartitionModifierComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Builds a PropertyKey to be used in ActorDesc properties. | MeshPartitionModifierComponent.h | ||
static bool IsAffectedMeshPartitionPropertyName
(
const FName& InName |
MeshPartitionModifierComponent.h |