UActorComponent::InvalidateLightingCache
#include "Components/ActorComponent.h"
Access: public
Specifiers: inline
Description
Invalidates the component's cached static lighting with default options. Calls InvalidateLightingCacheDetailed with bInvalidateBuildEnqueuedLighting=true and bTranslationOnly=false.
Caveats & Gotchas
- • This forces a Lightmass rebuild for the component on the next baked-lighting build — call it only when geometry or material changes warrant a re-bake.
- • Has no effect on dynamic/Lumen lighting; it only pertains to statically baked lightmaps.
- • In the editor, this marks the level as needing to be saved — call sparingly to avoid false dirty states.
Signature
void InvalidateLightingCache() Return Type
void Example
Invalidate lighting after runtime geometry change C++
void UMyMeshComponent::ApplyProceduralMesh()
{
// Update the mesh data
UpdateMeshData();
// Notify the lighting system the cached data is stale
InvalidateLightingCache();
MarkRenderStateDirty();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?