PR feedback and fixing TrackView

This commit is contained in:
mnaumov
2021-06-02 18:48:50 -07:00
parent 4f72e49ad4
commit c3df73bed8
4 changed files with 28 additions and 4 deletions
@@ -96,7 +96,7 @@ namespace AZ
;
serializeContext->Class<DisplayMapperConfigurationDescriptor>()
->Version(1)
->Version(2)
->Field("Name", &DisplayMapperConfigurationDescriptor::m_name)
->Field("OperationType", &DisplayMapperConfigurationDescriptor::m_operationType)
->Field("LdrGradingLutEnabled", &DisplayMapperConfigurationDescriptor::m_ldrGradingLutEnabled)
@@ -26,6 +26,11 @@ namespace AZ
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::DisplayMapperComponentRequests, "{9E2E8AF5-1176-44B4-A461-E09867753349}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
//! Load preconfigured preset for specific ODT mode
virtual void LoadPreset(OutputDeviceTransformType preset) = 0;
//! Set display mapper type
@@ -122,10 +122,14 @@ namespace AZ
void DisplayMapperComponentController::Activate(EntityId entityId)
{
m_entityId = entityId;
DisplayMapperComponentRequestBus::Handler::BusConnect(m_entityId);
}
void DisplayMapperComponentController::Deactivate()
{
DisplayMapperComponentRequestBus::Handler::BusDisconnect(m_entityId);
m_postProcessInterface = nullptr;
m_entityId.SetInvalid();
}
@@ -186,6 +190,10 @@ namespace AZ
void DisplayMapperComponentController::SetOverrideAcesParameters(bool value)
{
if (m_configuration.m_acesParameterOverrides.m_overrideDefaults == value)
{
return; // prevents flickering when set via TrackView
}
m_configuration.m_acesParameterOverrides.m_overrideDefaults = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
@@ -200,6 +208,10 @@ namespace AZ
void DisplayMapperComponentController::SetAlterSurround(bool value)
{
if (m_configuration.m_acesParameterOverrides.m_alterSurround != value)
{
return; // prevents flickering when set via TrackView
}
m_configuration.m_acesParameterOverrides.m_alterSurround = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
@@ -214,6 +226,10 @@ namespace AZ
void DisplayMapperComponentController::SetApplyDesaturation(bool value)
{
if (m_configuration.m_acesParameterOverrides.m_applyDesaturation != value)
{
return; // prevents flickering when set via TrackView
}
m_configuration.m_acesParameterOverrides.m_applyDesaturation = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
@@ -228,6 +244,10 @@ namespace AZ
void DisplayMapperComponentController::SetApplyCATD60toD65(bool value)
{
if (m_configuration.m_acesParameterOverrides.m_applyCATD60toD65 != value)
{
return; // prevents flickering when set via TrackView
}
m_configuration.m_acesParameterOverrides.m_applyCATD60toD65 = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
@@ -10,10 +10,9 @@
*
*/
#include "Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h"
#include <AzCore/RTTI/BehaviorContext.h>
#include <PostProcess/DisplayMapper/EditorDisplayMapperComponent.h>
#include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
namespace AZ
{
@@ -180,7 +179,7 @@ namespace AZ
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->Class<DisplayMapperComponent>()->RequestBus("DisplayMapperComponentRequestBus");
behaviorContext->Class<EditorDisplayMapperComponent>()->RequestBus("DisplayMapperComponentRequestBus");
behaviorContext->ConstantProperty("EditorDisplayMapperComponentTypeId", BehaviorConstant(Uuid(EditorDisplayMapperComponentTypeId)))
->Attribute(AZ::Script::Attributes::Module, "render")