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
Required by
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
| Property | When to change |
|---|---|
Material | The material the copy is drawn with |
Anim Duration | Fade duration |
Sound Show / Sound Hide | Transition 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
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
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | InitialMeshComponentsInitial | MeshComponent[] | Mesh components that were duplicated to build this copy. Filled in when the copy is created. |
| var | MaterialInitial | MaterialInterface | Material applied to every duplicated mesh, replacing the source materials. This is what gives the copy its highlight, preview or fade appearance. |
| var | AnimDurationConfig | float | Duration in seconds of the show and hide transition. |
| var | VisibleInitial | bool | Whether the copy is currently shown. Set through Set Visibility so the transition plays. |
| var | ColorInitial | LinearColor | Colour written into the copy's material. Change it through Set Color or Interpolate To Color. |
| var | Sound_ShowSound | SoundBase | Sound played when the copy fades in. |
| var | Sound_HideSound | SoundBase | Sound played when the copy fades out. |
| fn | AddInstances | (MirroredMesh: InstancedStaticMeshComponent, InitialMesh: InstancedStaticMeshComponent) | Mirrors the instances of an instanced static mesh onto the duplicate, so instanced geometry copies correctly. |
| fn | getVisibilityTimeline | (out ShowMaterial: TimelineComponent) | Returns the timeline driving the show and hide transition. Override in a subclass to use a different transition curve. |
| fn | CreateDuplicateMeshComponent | (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. |
| event | SetVisibility | (Set: bool, DestroyAfterTransitionEnded: bool) | Fades the copy in or out, optionally destroying the actor once a fade-out finishes. |
| event | SetAnimationDuration | (AnimDuration: float) | Changes the transition duration at runtime. |
| event | TransitionFinished | () | Fires when a show or hide transition completes. |
| event | SetColor | (Color: LinearColor) | Sets the copy's colour immediately, without interpolation. |
| event | InterpolateToColor | (ref const Color: LinearColor) | Blends the copy's colour towards the target over time. |
| event | ApplyMaterialToMeshes | () | Re-applies the configured material to every duplicated mesh, after the material or meshes change. |