HomeModule plugins › AFM_MeshCopy
Module

AFM_MeshCopy

Creates a duplicate of an actor's meshes under a new material, shared by highlighting, snapping previews and visibility transitions.

What it gives you

  • Ghost copies of any actor's geometry
  • Fade in and out with sound
  • Colour interpolation on the copy

Requires

AFM_AutoDestroy

Required by

AFM_Visibility AFS_Core_Highlight AFS_Core_Snapping

1 assets16 API members

Description

Several framework features need to draw a copy of an object: the mesh-copy highlight style, the snapping preview ghost, and the visibility fade. BP_Helper_MeshCopy provides that once.

It duplicates the source mesh components — including instanced static meshes — applies a single material to all of them, and provides timeline-driven show and hide transitions with optional sound.

Setup

This plugin is used by other systems rather than configured directly. Enable it as a dependency of AFS_Core_Highlight, AFS_Core_Snapping or AFM_Visibility.

Usage

Creating a copy

Spawn BP_Helper_MeshCopy, call CreateDuplicateMeshComponent with the meshes to copy, set Material, then SetVisibility to fade it in.

Colour

SetColor for an immediate change, InterpolateToColor to blend.

Key properties

PropertyWhen to change
MaterialThe material the copy is drawn with
Anim DurationFade duration
Sound Show / Sound HideTransition feedback

Extending

Derive and override getVisibilityTimeline for a different transition curve — BP_Helper_MeshCopy_Visibility and BP_Helper_MeshCopy_Anchor are the shipped examples.

Performance notes

Performance

A copy doubles the draw calls for that object while visible. Destroy copies after fade-out — SetVisibility takes a flag to do this automatically.

Example map

Visible as the ghost preview in Map_Examples_Snapping and as a highlight style in Map_Examples_Highlight.

Troubleshooting

The copy is invisible. No material assigned, or the source meshes were not passed to CreateDuplicateMeshComponent.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Helper

BP_Helper_MeshCopy16 members
extends Actor
KindNameSignatureDescription
varInitialMeshComponentsInitialMeshComponent[]Mesh components that were duplicated to build this copy. Filled in when the copy is created.
varMaterialInitialMaterialInterfaceMaterial applied to every duplicated mesh, replacing the source materials. This is what gives the copy its highlight, preview or fade appearance.
varAnimDurationConfigfloatDuration in seconds of the show and hide transition.
varVisibleInitialboolWhether the copy is currently shown. Set through Set Visibility so the transition plays.
varColorInitialLinearColorColour written into the copy's material. Change it through Set Color or Interpolate To Color.
varSound_ShowSoundSoundBaseSound played when the copy fades in.
varSound_HideSoundSoundBaseSound played when the copy fades out.
fnAddInstances(MirroredMesh: InstancedStaticMeshComponent, InitialMesh: InstancedStaticMeshComponent)Mirrors the instances of an instanced static mesh onto the duplicate, so instanced geometry copies correctly.
fngetVisibilityTimeline(out ShowMaterial: TimelineComponent)Returns the timeline driving the show and hide transition. Override in a subclass to use a different transition curve.
fnCreateDuplicateMeshComponent(MeshComponentsToDuplicate: MeshComponent[], out MeshComponentsMap: Map<MeshComponent, MeshComponent>)Duplicates the given mesh components onto this actor and returns a map from each source mesh to its copy.
eventSetVisibility(Set: bool, DestroyAfterTransitionEnded: bool)Fades the copy in or out, optionally destroying the actor once a fade-out finishes.
eventSetAnimationDuration(AnimDuration: float)Changes the transition duration at runtime.
eventTransitionFinished()Fires when a show or hide transition completes.
eventSetColor(Color: LinearColor)Sets the copy's colour immediately, without interpolation.
eventInterpolateToColor(ref const Color: LinearColor)Blends the copy's colour towards the target over time.
eventApplyMaterialToMeshes()Re-applies the configured material to every duplicated mesh, after the material or meshes change.