RealDocs

AActor::InvalidateLightingCacheDetailed

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtualENGINE_API

Description

Invalidates all static lighting data produced by the last lighting build for this actor, with control over whether to do a full invalidation or a translation-only pass.

Caveats & Gotchas

  • Even with bTranslationOnly=true, a lighting rebuild is still required before the level will look correct — this flag only narrows which cached data is dirtied, not whether a rebuild is needed.
  • Calling this on many actors in a loop (e.g. during a bulk editor operation) can be expensive due to per-component invalidation calls. Batch your actor moves and then invalidate once if possible.
  • Overrides in subclasses must propagate the call to all primitive components that have baked lighting; the base implementation iterates GetComponents<UPrimitiveComponent>() and calls InvalidateLightingCache() on each.

Signature

ENGINE_API virtual void InvalidateLightingCacheDetailed(bool bTranslationOnly)

Parameters

Name Type Description Default
bTranslationOnly bool If true, only invalidates lighting data that depends on the actor's translation, skipping more expensive rotation/scale-dependent re-computation.

Return Type

void

Example

Invalidate only translation-dependent lighting after a move C++
#if WITH_EDITOR
void AMyEditorActor::OnTranslationChanged()
{
    // Only translation changed — skip full invalidation for speed
    InvalidateLightingCacheDetailed(true);
}
#endif

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.