Get All Actors in 3D Level

ways to get the list of actors in the current 3D Level / Scene

Something that isn't entirely apparent in Unreal, especially if your work involves Sequencer, is that the obvious function to get all levels in the current Editor World isn't always enough to get every actor in the viewport.

For Persistent Actors

The most basic function to get the available actors in our 3D Level is get_all_level_actors:

EditorActorSubsystem = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)

actors = unreal_systems.EditorActorSubsystem.get_all_level_actors()

A shortcoming of this method, if your work involves Sequencer, is that Spawnables are not included:


Including Sequencer Spawned Actors

This method relies on the fact that Sequencer currently adds a SequencerActor tag to any actors it spawns:

This will give us a list of any spawnable actors which we can add to our earlier results:

This updated function will successfully find the Spawnable Actor:


Expanded Options

From a pipeline perspective we might want the ability to separate Spawnable (Sequencer) actors from Possessable (Persistent Level) actors. This convenience function supports each posibility:

Last updated