UColorCorrectRegionsSubsystem

World Subsystem responsible for managing [AColorCorrectRegion](API\Plugins\ColorCorrectRegions\AColorCorrectRegion) classes in level.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

ColorCorrectRegions

Header

/Engine/Plugins/Experimental/ColorCorrectRegions/Source/ColorCorrectRegions/Public/ColorCorrectRegionsSubsystem.h

Include

#include "ColorCorrectRegionsSubsystem.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UColorCorrectRegionsSubsystem :
    public UWorldSubsystem ,
    public FColorCorrectRegionsEditorUndoClient

Remarks

World Subsystem responsible for managing AColorCorrectRegion classes in level. This subsystem handles: Level Loaded, Undo/Redo, Added to level, Removed from level events. Unfortunately AActor class itself is not aware of when it is added/removed, Undo/Redo etc in the level.

This is the only way (that we found) that was handling all region aggregation cases in more or less efficient way. Covered cases: Region added to a level, deleted from level, level loaded, undo, redo, level closed, editor closed: World subsystem keeps track of all Regions in a level via three events OnLevelActorAdded, OnLevelActorDeleted, OnLevelActorListChanged. Actor classes are unaware of when they are added/deleted/undo/redo etc in the level, therefore this is the best place to manage this. Alternative strategies (All tested): World's AddOnActorSpawnedHandler. Flawed. Invoked in some cases we don't need, but does not get called during UNDO/REDO AActor 's PostSpawnInitialize, PostActorCreated and OnConstruction are also flawed. AActor does not have an internal event for when its deleted (EndPlay is the closest we have).

Variables

Name Description

Public variable

TArray < AColorC ...

 

Regions

Stores pointers to all ColorCorrectRegion Actors.

Functions

Name Description

Public function UFunction

void

 

OnActorDeleted

(
    AActor * InActor
)

A callback for CC Region deletion.

Public function UFunction

void

 

OnActorSpawned

(
    AActor * InActor
)

A callback for CC Region creation.

Public function UFunction

void

 

OnLevelActorListChanged()

A callback for when the level is loaded.

Public function

void

 

SortRegionsByPriority()

Sorts regions based on priority.

Overridden from USubsystem

Name Description

Public function Virtual

void

 

Deinitialize()

Implement this for deinitialization of instances of the system

Public function Virtual

void

 

Initialize

(
    FSubsystemCollectionBase & Collecti...
)

Subsystem Init/Deinit.

Overridden from FEditorUndoClient

Name Description

Public function Virtual

void

 

PostRedo

(
    bool bSuccess
)

Signal that client should run any PostRedo code

Public function Virtual

void

 

PostUndo

(
    bool bSuccess
)

Undo/redo is only supported by editor.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback