Merge branch 'main' into SpawnableEntityIdMapping

This commit is contained in:
AMZN-koppersr
2021-06-04 14:00:06 -07:00
76 changed files with 962 additions and 340 deletions
@@ -9,11 +9,6 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
"""
C24064528: The File menu options function normally
C16780778: The File menu options function normally-New view interaction Model enabled
"""
import os
import sys
@@ -54,7 +49,10 @@ class TestFileMenuOptions(EditorTestHelper):
("Save",),
("Save As",),
("Save Level Statistics",),
("Project Settings", "Project Settings Tool"),
("Edit Project Settings",),
("Edit Platform Settings",),
("New Project",),
("Open Project",),
("Show Log File",),
("Resave All Slices",),
("Exit",),
@@ -15,6 +15,7 @@ import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@@ -40,6 +41,10 @@ class TestBasicEditorWorkflows(object):
@pytest.mark.SUITE_main
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
expected_lines = [
"Create and load new level: True",
"New entity creation: True",
@@ -7,8 +7,6 @@ distribution (the "License"). All use of this software is governed by the Licens
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
C16780783: Base Edit Menu Options (New Viewport Interaction Model)
"""
import os
@@ -17,6 +15,7 @@ import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools.environment.process_utils as process_utils
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@@ -33,6 +32,7 @@ class TestMenus(object):
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
process_utils.kill_processes_named("o3de", ignore_extensions=True) # Kill ProjectManager windows
request.addfinalizer(teardown)
@@ -80,8 +80,7 @@ class TestMenus(object):
expected_lines,
cfg_args=[level],
run_python="--runpython",
auto_test_mode=True,
timeout=log_monitor_timeout,
timeout=log_monitor_timeout
)
@pytest.mark.test_case_id("C16780807")
@@ -107,13 +106,13 @@ class TestMenus(object):
"Menus_ViewMenuOptions.py",
expected_lines,
cfg_args=[level],
auto_test_mode=True,
run_python="--runpython",
timeout=log_monitor_timeout,
timeout=log_monitor_timeout
)
@pytest.mark.test_case_id("C16780778")
@pytest.mark.SUITE_sandbox
@pytest.mark.xfail # LYN-4208
def test_Menus_FileMenuOptions_Work(self, request, editor, level, launcher_platform):
expected_lines = [
"New Level Action triggered",
@@ -122,7 +121,10 @@ class TestMenus(object):
"Save Action triggered",
"Save As Action triggered",
"Save Level Statistics Action triggered",
"Project Settings Tool Action triggered",
"Edit Project Settings Action triggered",
"Edit Platform Settings Action triggered",
"New Project Action triggered",
"Open Project Action triggered",
"Show Log File Action triggered",
"Resave All Slices Action triggered",
"Exit Action triggered",
@@ -135,7 +137,6 @@ class TestMenus(object):
"Menus_FileMenuOptions.py",
expected_lines,
cfg_args=[level],
auto_test_mode=True,
run_python="--runpython",
timeout=log_monitor_timeout,
)
timeout=log_monitor_timeout
)
@@ -16,6 +16,7 @@ import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole
@@ -46,6 +47,11 @@ class TestDynamicSliceInstanceSpawner(object):
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, editor, level, workspace, project,
launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
# Ensure temp level does not already exist
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@@ -16,6 +16,7 @@ import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
@@ -40,6 +41,11 @@ class TestEmptyInstanceSpawner(object):
@pytest.mark.SUITE_main
@pytest.mark.dynveg_area
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
@@ -23,6 +23,7 @@ import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@@ -46,6 +47,11 @@ class TestGraphComponentSync(object):
@pytest.mark.BAT
@pytest.mark.SUITE_main
def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
@@ -122,6 +128,11 @@ class TestGraphComponentSync(object):
"""
Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set.
"""
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
@@ -139,7 +139,7 @@ namespace AzNetworking
NetworkOutputSerializer networkSerializer(buffer.GetBuffer(), buffer.GetSize());
{
ISerializer& serializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
ISerializer& networkISerializer = networkSerializer; // To get the default typeinfo parameters in ISerializer
// First, serialize out the header
if (!header.SerializePacketFlags(networkSerializer))
@@ -148,7 +148,7 @@ namespace AzNetworking
return false;
}
if (!serializer.Serialize(header, "Header"))
if (!networkISerializer.Serialize(header, "Header"))
{
AZLOG(NET_FragmentQueue, "Reconstructed fragmented packet failed header serialization");
return false;
+7 -7
View File
@@ -118,10 +118,10 @@ void CVarMenu::AddUniqueCVarsItem(QString displayName,
// Otherwise we could have just used the action's currently checked
// state and updated the CVar's value only
bool cVarOn = (cVar->GetFVal() == availableCVar.m_onValue);
bool checked = !cVarOn;
SetCVar(cVar, checked ? availableCVar.m_onValue : availableCVar.m_offValue);
action->setChecked(checked);
if (checked)
bool cVarChecked = !cVarOn;
SetCVar(cVar, cVarChecked ? availableCVar.m_onValue : availableCVar.m_offValue);
action->setChecked(cVarChecked);
if (cVarChecked)
{
// Set the rest of the CVars in the group to their off values
SetCVarsToOffValue(availableCVars, availableCVar);
@@ -132,9 +132,9 @@ void CVarMenu::AddUniqueCVarsItem(QString displayName,
// Initialize the action's checked state based on its associated CVar's current value
ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data());
bool checked = (cVar && cVar->GetFVal() == availableCVar.m_onValue);
action->setChecked(checked);
if (checked)
bool cVarChecked = (cVar && cVar->GetFVal() == availableCVar.m_onValue);
action->setChecked(cVarChecked);
if (cVarChecked)
{
// Set the rest of the CVars in the group to their off values
SetCVarsToOffValue(availableCVars, availableCVar);
@@ -205,10 +205,10 @@ CTrackViewAnimNode::CTrackViewAnimNode(IAnimSequence* pSequence, IAnimNode* anim
for (int i = 0; i < nodeCount; ++i)
{
IAnimNode* node = pSequence->GetNode(i);
IAnimNode* pParentNode = node->GetParent();
IAnimNode* pNodeParentNode = node->GetParent();
// If our node is the parent, then the current node is a child of it
if (animNode == pParentNode)
if (animNode == pNodeParentNode)
{
CTrackViewAnimNodeFactory animNodeFactory;
CTrackViewAnimNode* pNewTVAnimNode = animNodeFactory.BuildAnimNode(pSequence, node, this);
@@ -68,12 +68,12 @@ CTrackViewTrack::CTrackViewTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackA
{
// Search for child tracks
const unsigned int subTrackCount = m_pAnimTrack->GetSubTrackCount();
for (unsigned int subTrackIndex = 0; subTrackIndex < subTrackCount; ++subTrackIndex)
for (unsigned int subTrackI = 0; subTrackI < subTrackCount; ++subTrackI)
{
IAnimTrack* pSubTrack = m_pAnimTrack->GetSubTrack(subTrackIndex);
IAnimTrack* pSubTrack = m_pAnimTrack->GetSubTrack(subTrackI);
CTrackViewTrackFactory trackFactory;
CTrackViewTrack* pNewTVTrack = trackFactory.BuildTrack(pSubTrack, pTrackAnimNode, this, true, subTrackIndex);
CTrackViewTrack* pNewTVTrack = trackFactory.BuildTrack(pSubTrack, pTrackAnimNode, this, true, subTrackI);
m_childNodes.push_back(std::unique_ptr<CTrackViewNode>(pNewTVTrack));
}
@@ -177,4 +177,5 @@ namespace AZ
} // namespace Render
AZ_TYPE_INFO_SPECIALIZE(Render::DisplayMapperOperationType, "{41CA80B1-9E0D-41FB-A235-9638D2A905A5}");
AZ_TYPE_INFO_SPECIALIZE(Render::OutputDeviceTransformType, "{B94085B7-C0D4-466A-A791-188A4559EC8D}");
} // namespace AZ
@@ -12,11 +12,13 @@
#pragma once
#include <AzCore/Asset/AssetCommon.h>
#include <ACES/Aces.h>
#include <Atom/RPI.Reflect/Pass/PassAsset.h>
#include <Atom/RPI.Reflect/Pass/PassData.h>
#include <Atom/RPI.Reflect/System/AnyAsset.h>
#include <AzCore/Asset/AssetCommon.h>
namespace AZ
{
@@ -33,6 +35,7 @@ namespace AZ
AZ_TYPE_INFO(AcesParameterOverrides, "{3EE8C0D4-3792-46C0-B91C-B89A81C36B91}");
static void Reflect(ReflectContext* context);
// Load preconfigured preset for specific ODT mode defined by m_preset
void LoadPreset();
// When enabled allows parameter overrides for ACES configuration
@@ -98,6 +101,5 @@ namespace AZ
DisplayMapperConfigurationDescriptor m_config;
};
} // namespace RPI
} // namespace Render
} // namespace AZ
@@ -311,14 +311,9 @@ namespace AZ
{
auto tileBufferResolution = GetTileDataBufferResolution();
// generate a UUID for the buffer name to keep it unique when there are multiple render pipelines
AZ::Uuid uuid = AZ::Uuid::CreateRandom();
AZStd::string uuidString;
uuid.ToString(uuidString);
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadWrite;
desc.m_bufferName = AZStd::string::format("LightList_%s", uuidString.c_str());
desc.m_bufferName = "LightList";
desc.m_elementSize = sizeof(uint32_t);
desc.m_byteCount = tileBufferResolution.m_width * tileBufferResolution.m_height * 256 * sizeof(uint32_t);
m_lightList = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -118,14 +118,9 @@ namespace AZ
void LightCullingRemap::CreateRemappedLightListBuffer()
{
// generate a UUID for the buffer name to keep it unique when there are multiple render pipelines
AZ::Uuid uuid = AZ::Uuid::CreateRandom();
AZStd::string uuidString;
uuid.ToString(uuidString);
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadWrite;
desc.m_bufferName = AZStd::string::format("LightListRemapped_%s", uuidString.c_str());
desc.m_bufferName = "LightListRemapped";
desc.m_elementSize = RHI::GetFormatSize(LightListRemappedFormat);
desc.m_byteCount = m_tileDim.m_width * m_tileDim.m_height * NumBins * MaxLightsPerTile * desc.m_elementSize;
m_lightListRemapped = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -23,6 +23,15 @@ namespace AZ
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Enum<OutputDeviceTransformType>()
->Version(0)
->Value("48Nits", OutputDeviceTransformType::OutputDeviceTransformType_48Nits)
->Value("1000Nits", OutputDeviceTransformType::OutputDeviceTransformType_1000Nits)
->Value("2000Nits", OutputDeviceTransformType::OutputDeviceTransformType_2000Nits)
->Value("4000Nits", OutputDeviceTransformType::OutputDeviceTransformType_4000Nits)
->Value("NumOutputDeviceTransformTypes", OutputDeviceTransformType::NumOutputDeviceTransformTypes)
;
serializeContext->Class<AcesParameterOverrides>()
->Version(0)
->Field("OverrideDefaults", &AcesParameterOverrides::m_overrideDefaults)
@@ -38,6 +47,22 @@ namespace AZ
->Field("SurroundGamma", &AcesParameterOverrides::m_surroundGamma)
->Field("Gamma", &AcesParameterOverrides::m_gamma);
}
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->Class<AcesParameterOverrides>("AcesParameterOverrides")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Category, "render")
->Attribute(AZ::Script::Attributes::Module, "render")
->Constructor()
->Method("LoadPreset", &AcesParameterOverrides::LoadPreset)
->Property("overrideDefaults", BehaviorValueProperty(&AcesParameterOverrides::m_overrideDefaults))
->Property("preset", BehaviorValueProperty(&AcesParameterOverrides::m_preset))
->Property("alterSurround", BehaviorValueProperty(&AcesParameterOverrides::m_alterSurround))
->Property("applyDesaturation", BehaviorValueProperty(&AcesParameterOverrides::m_applyDesaturation))
->Property("applyCATD60toD65", BehaviorValueProperty(&AcesParameterOverrides::m_applyCATD60toD65))
;
}
}
void AcesParameterOverrides::LoadPreset()
@@ -71,11 +96,12 @@ namespace AZ
;
serializeContext->Class<DisplayMapperConfigurationDescriptor>()
->Version(1)
->Version(2)
->Field("Name", &DisplayMapperConfigurationDescriptor::m_name)
->Field("OperationType", &DisplayMapperConfigurationDescriptor::m_operationType)
->Field("LdrGradingLutEnabled", &DisplayMapperConfigurationDescriptor::m_ldrGradingLutEnabled)
->Field("LdrColorGradingLut", &DisplayMapperConfigurationDescriptor::m_ldrColorGradingLut)
->Field("AcesParameterOverrides", &DisplayMapperConfigurationDescriptor::m_acesParameterOverrides)
;
}
}
@@ -74,6 +74,7 @@ namespace AZ
desc.m_elementFormat = filters.front()->GetElementFormat();
desc.m_byteCount = totalElementCount * elementSize;
desc.m_bufferData = data.data();
desc.m_isUniqueName = true;
auto buffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -100,16 +100,9 @@ namespace AZ
bool ExposureControlSettings::InitCommonBuffer()
{
// generate a UUID for the buffer name to keep it unique
AZ::Uuid uuid = AZ::Uuid::CreateRandom();
AZStd::string uuidString;
uuid.ToString(uuidString);
AZStd::string bufferName = AZStd::string::format("%s_%s", ExposureControlBufferBaseName, uuidString.c_str());
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::Constant;
desc.m_bufferName = bufferName;
desc.m_bufferName = ExposureControlBufferName;
desc.m_byteCount = sizeof(ShaderParameters);
desc.m_elementSize = sizeof(ShaderParameters);
@@ -117,7 +110,7 @@ namespace AZ
if (!m_buffer)
{
AZ_Assert(false, "Failed to create the RPI::Buffer[%s] which is used for the exposure control feature.", bufferName.c_str());
AZ_Assert(false, "Failed to create the RPI::Buffer[%s] which is used for the exposure control feature.", desc.m_bufferName.c_str());
return false;
}
@@ -28,8 +28,8 @@ namespace AZ
{
class PostProcessSettings;
// Base name of the buffer used for the exposure control feature. Usually distinct identifier will be added to this name for each exposure control settings.
static const char* const ExposureControlBufferBaseName = "ExposureControlBuffer";
// Name of the buffer used for the exposure control feature
static const char* const ExposureControlBufferName = "ExposureControlBuffer";
// The post process sub-settings class for the exposure control feature
class ExposureControlSettings final
@@ -47,9 +47,8 @@ namespace AZ
m_getDepthPass = static_cast<DepthOfFieldWriteFocusDepthFromGpuPass*>(pass.get());
// Create buffer for read back focus depth. We append static counter to avoid name conflicts.
AZStd::string bufferName = AZStd::string::format("DepthOfFieldReadBackAutoFocusDepthBuffer_%d", s_bufferInstance++);
RPI::CommonBufferDescriptor desc;
desc.m_bufferName = bufferName;
desc.m_bufferName = "DepthOfFieldReadBackAutoFocusDepthBuffer";
desc.m_poolType = RPI::CommonBufferPoolType::ReadWrite;
desc.m_byteCount = sizeof(float);
desc.m_elementSize = aznumeric_cast<uint32_t>(desc.m_byteCount);
@@ -71,6 +71,7 @@ namespace AZ
desc.m_bufferName = bufferName;
desc.m_byteCount = sizeof(ShaderParameters);
desc.m_elementSize = sizeof(ShaderParameters);
desc.m_isUniqueName = true;
m_buffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
}
@@ -34,7 +34,7 @@ namespace AZ
{
namespace Render
{
static const char* const EyeAdaptationBufferBaseName = "EyeAdaptationBuffer";
static const char* const EyeAdaptationBufferName = "EyeAdaptationBuffer";
RPI::Ptr<EyeAdaptationPass> EyeAdaptationPass::Create(const RPI::PassDescriptor& descriptor)
{
@@ -49,12 +49,10 @@ namespace AZ
void EyeAdaptationPass::InitBuffer()
{
AZStd::string bufferName = AZStd::string::format("%s_%p", EyeAdaptationBufferBaseName, this);
ExposureCalculationData defaultData;
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadWrite;
desc.m_bufferName = bufferName;
desc.m_bufferName = EyeAdaptationBufferName;
desc.m_byteCount = sizeof(ExposureCalculationData);
desc.m_elementSize = aznumeric_cast<uint32_t>(desc.m_byteCount);
desc.m_bufferData = &defaultData;
@@ -62,14 +62,9 @@ namespace AZ
void LuminanceHistogramGeneratorPass::CreateHistogramBuffer()
{
// generate a UUID for the buffer name to keep it unique when there are multiple render pipelines
AZ::Uuid uuid = AZ::Uuid::CreateRandom();
AZStd::string uuidString;
uuid.ToString(uuidString);
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadWrite;
desc.m_bufferName = AZStd::string::format("LuminanceHistogramBuffer_%s", uuidString.c_str());
desc.m_bufferName = "LuminanceHistogramBuffer";
desc.m_elementSize = sizeof(uint32_t);
desc.m_byteCount = NumHistogramBins * sizeof(uint32_t);
desc.m_elementFormat = RHI::Format::R32_UINT;
@@ -210,12 +210,10 @@ namespace AZ
if (m_meshInfoBuffer == nullptr)
{
AZStd::string uuidString = AZ::Uuid::CreateRandom().ToString<AZStd::string>();
// allocate the MeshInfo structured buffer
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc.m_bufferName = AZStd::string::format("RayTracingMeshInfo_%s", uuidString.c_str());
desc.m_bufferName = "RayTracingMeshInfo";
desc.m_byteCount = newMeshByteCount;
desc.m_elementSize = sizeof(MeshInfo);
m_meshInfoBuffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -283,12 +281,10 @@ namespace AZ
if (m_materialInfoBuffer == nullptr)
{
AZStd::string uuidString = AZ::Uuid::CreateRandom().ToString<AZStd::string>();
// allocate the MaterialInfo structured buffer
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc.m_bufferName = AZStd::string::format("RayTracingMaterialInfo_%s", uuidString.c_str());
desc.m_bufferName = "RayTracingMaterialInfo";
desc.m_byteCount = newMaterialByteCount;
desc.m_elementSize = sizeof(MaterialInfo);
m_materialInfoBuffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -193,7 +193,7 @@ namespace AZ
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::Constant;
desc.m_bufferName = AZStd::string::format("SkyboxBuffer_%p", this);
desc.m_bufferName = "SkyboxBuffer";
desc.m_byteCount = byteCount;
desc.m_elementSize = byteCount;
desc.m_bufferData = &m_physicalSkyData;
@@ -89,13 +89,13 @@ namespace AZ
// Create the transform buffer, grow by powers of two
RPI::CommonBufferDescriptor desc2;
desc2.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc2.m_bufferName = AZStd::string::format("'m_objectToWorldBuffer_%" PRIXPTR, reinterpret_cast<uintptr_t>(this));
desc2.m_bufferName = "m_objectToWorldBuffer";
desc2.m_byteCount = byteCount;
desc2.m_elementSize = elementSize;
m_objectToWorldBuffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc2);
desc2.m_bufferName = AZStd::string::format("'m_objectToWorldHistoryBuffer_%p", this);
desc2.m_bufferName = "m_objectToWorldHistoryBuffer";
m_objectToWorldHistoryBuffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc2);
}
else
@@ -119,7 +119,7 @@ namespace AZ
// Create the normal buffer, grow by powers of two
RPI::CommonBufferDescriptor desc2;
desc2.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc2.m_bufferName = AZStd::string::format("'m_objectToWorldInverseTransposeBuffer_%" PRIXPTR, reinterpret_cast<uintptr_t>(this));
desc2.m_bufferName = "m_objectToWorldInverseTransposeBuffer";
desc2.m_byteCount = byteCount;
desc2.m_elementSize = elementSize;
@@ -40,13 +40,11 @@ namespace AZ
if (m_bufferIndex.IsValid())
{
AZStd::string bufferName = AZStd::string::format("%s_%" PRIXPTR, descriptor.m_bufferName.c_str(), reinterpret_cast<uintptr_t>(this));
uint32_t byteCount = RHI::NextPowerOfTwo(GetMax<uint32_t>(BufferMinSize, m_elementCount * m_elementSize));
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc.m_bufferName = bufferName;
desc.m_bufferName = descriptor.m_bufferName;
desc.m_byteCount = byteCount;
desc.m_elementSize = descriptor.m_elementSize;
@@ -261,8 +261,8 @@ namespace AZ
if (vulkanDescriptor.m_constantDataPool && constantDataSize)
{
m_constantDataBuffer = Buffer::Create();
const RHI::BufferDescriptor descriptor(RHI::BufferBindFlags::Constant, constantDataSize);
RHI::BufferInitRequest request(*m_constantDataBuffer, descriptor);
const RHI::BufferDescriptor bufferDescriptor(RHI::BufferBindFlags::Constant, constantDataSize);
RHI::BufferInitRequest request(*m_constantDataBuffer, bufferDescriptor);
RHI::ResultCode rhiResult = vulkanDescriptor.m_constantDataPool->InitBuffer(request);
if (rhiResult != RHI::ResultCode::Success)
{
@@ -112,6 +112,8 @@ namespace AZ
AZStd::mutex m_pendingUploadMutex;
RHI::BufferViewDescriptor m_bufferViewDescriptor;
RHI::AttachmentId m_attachmentId;
};
template <class structureType>
@@ -35,7 +35,7 @@ namespace AZ
// BufferSystemInterface overrides...
RHI::Ptr<RHI::BufferPool> GetCommonBufferPool(CommonBufferPoolType poolType) override;
Data::Instance<Buffer> CreateBufferFromCommonPool(const CommonBufferDescriptor& descriptor) override;
Data::Instance<Buffer> FindCommonBuffer(AZStd::string_view bufferName) override;
Data::Instance<Buffer> FindCommonBuffer(AZStd::string_view uniqueBufferName) override;
void Init();
void Shutdown();
@@ -53,6 +53,9 @@ namespace AZ
RHI::Format m_elementFormat = RHI::Format::Unknown; //<! [optional] If it's specified with a valid format, the size of this format will be used instead of m_elementSize
AZ::u64 m_byteCount = 0;
const void* m_bufferData = nullptr; //<! [optional] Initial data content of this buffer. This data buffer size needs to be same as m_bufferSizeInbytes
//! Set to true if you want this buffer to be discoverable by BufferSystemInterface::FindCommonBuffer using m_bufferName.
//! Note that create buffer may fail if there is a buffer with the same name.
bool m_isUniqueName = false;
};
class BufferSystemInterface
@@ -78,7 +81,7 @@ namespace AZ
virtual Data::Instance<Buffer> CreateBufferFromCommonPool(const CommonBufferDescriptor& descriptor) = 0;
//! Find a buffer by name. The buffer has to be created by CreateBufferFromCommonPool function
virtual Data::Instance<Buffer> FindCommonBuffer(AZStd::string_view bufferName) = 0;
virtual Data::Instance<Buffer> FindCommonBuffer(AZStd::string_view uniqueBufferName) = 0;
};
} // namespace RPI
} // namespace AZ
@@ -60,11 +60,15 @@ namespace AZ
const Data::Asset<ResourcePoolAsset>& GetPoolAsset() const;
CommonBufferPoolType GetCommonPoolType() const;
const AZStd::string& GetName() const;
private:
// Called by asset creators to assign the asset to a ready state.
void SetReady();
AZStd::string m_name;
AZStd::vector<uint8_t> m_buffer;
RHI::BufferDescriptor m_bufferDescriptor;
@@ -114,7 +114,7 @@ namespace AZ
if (auto* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<ModelAssetBuilderComponent, SceneAPI::SceneCore::ExportingComponent>()
->Version(26); // [ATOM-14992]
->Version(27); // [ATOM-15658]
}
}
@@ -14,9 +14,11 @@
#include <Atom/RPI.Reflect/Model/MorphTargetDelta.h>
#include <SceneAPI/SceneCore/Containers/Utilities/Filters.h>
#include <SceneAPI/SceneCore/Containers/Utilities/SceneGraphUtilities.h>
#include <SceneAPI/SceneCore/Utilities/SceneGraphSelector.h>
#include <SceneAPI/SceneCore/Containers/Views/FilterIterator.h>
#include <SceneAPI/SceneCore/Containers/Views/PairIterator.h>
#include <SceneAPI/SceneCore/Containers/Views/SceneGraphDownwardsIterator.h>
#include <SceneAPI/SceneCore/Containers/Views/SceneGraphChildIterator.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzCore/Asset/AssetManagerBus.h>
@@ -27,62 +29,42 @@ namespace AZ::RPI
AZStd::unordered_map<AZStd::string, MorphTargetExporter::SourceBlendShapeInfo> MorphTargetExporter::GetBlendShapeInfos(
const Containers::Scene& scene,
const AZStd::optional<AZStd::string>& filterMeshName) const
const MeshData* meshData) const
{
const Containers::SceneGraph& sceneGraph = scene.GetGraph();
const auto contentStorage = sceneGraph.GetContentStorage();
const auto nameStorage = sceneGraph.GetNameStorage();
const auto foundBaseMeshIter = AZStd::find_if(sceneGraph.GetContentStorage().cbegin(), sceneGraph.GetContentStorage().cend(), [meshData](const auto& nodeData)
{
return nodeData.get() == meshData;
});
if (foundBaseMeshIter == sceneGraph.GetContentStorage().cend())
{
return {};
}
const auto baseMeshNodeIndex = sceneGraph.ConvertToNodeIndex(foundBaseMeshIter);
const auto childBlendShapeDatas = Containers::MakeDerivedFilterView<DataTypes::IBlendShapeData>(
Containers::Views::MakeSceneGraphChildView(sceneGraph, baseMeshNodeIndex, sceneGraph.GetContentStorage().cbegin(), true)
);
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> result;
const auto keyValueView = Containers::Views::MakePairView(nameStorage, contentStorage);
const auto filteredView = Containers::Views::MakeFilterView(keyValueView, Containers::DerivedTypeFilter<DataTypes::IBlendShapeData>());
for (const auto& [name, object] : filteredView)
for (auto it = childBlendShapeDatas.cbegin(); it != childBlendShapeDatas.cend(); ++it)
{
const Containers::SceneGraph::NodeIndex sceneNodeIndex = sceneGraph.Find(name.GetPath());
const Containers::SceneGraph::NodeIndex blendShapeNodeIndex = sceneGraph.ConvertToNodeIndex(it.GetBaseIterator().GetBaseIterator().GetHierarchyIterator());
AZStd::set<AZ::Crc32> types;
Events::GraphMetaInfoBus::Broadcast(&Events::GraphMetaInfo::GetVirtualTypes, types, scene, sceneNodeIndex);
if (types.find(Events::GraphMetaInfo::GetIgnoreVirtualType()) == types.end())
Events::GraphMetaInfoBus::Broadcast(&Events::GraphMetaInfo::GetVirtualTypes, types, scene, blendShapeNodeIndex);
if (!types.contains(Events::GraphMetaInfo::GetIgnoreVirtualType()))
{
const char* sceneNodePath = name.GetPath();
const Containers::SceneGraph::NodeIndex nodeIndex = sceneGraph.Find(sceneNodePath);
if (nodeIndex.IsValid())
{
const AZStd::string meshNodeName = SourceBlendShapeInfo::GetMeshNodeName(sceneGraph, nodeIndex);
if (!filterMeshName.has_value() ||
(filterMeshName.has_value() && filterMeshName.value() == meshNodeName))
{
const AZStd::string blendShapeName = sceneGraph.GetNodeName(nodeIndex).GetName();
SourceBlendShapeInfo& blendShapeInfo = result[blendShapeName];
blendShapeInfo.m_sceneNodeIndices.push_back(nodeIndex);
}
}
else
{
AZ_Warning(ModelAssetBuilderComponent::s_builderName, false, "Cannot retrieve scene graph index for blend shape node with path %s.", sceneNodePath);
}
const AZStd::string blendShapeName{sceneGraph.GetNodeName(blendShapeNodeIndex).GetName(), sceneGraph.GetNodeName(blendShapeNodeIndex).GetNameLength()};
result[blendShapeName].m_sceneNodeIndices.emplace_back(blendShapeNodeIndex);
}
}
return result;
}
AZStd::string MorphTargetExporter::SourceBlendShapeInfo::GetMeshNodeName(const Containers::SceneGraph& sceneGraph,
const Containers::SceneGraph::NodeIndex& sceneNodeIndex)
{
const auto* blendShapeData =
azrtti_cast<const DataTypes::IBlendShapeData*>(sceneGraph.GetNodeContent(sceneNodeIndex).get());
AZ_Assert(blendShapeData, "Cannot get mesh node name from scene node. Node is expected to be a blend shape.");
if (blendShapeData)
{
Containers::SceneGraph::NodeIndex morphMeshParentIndex = sceneGraph.GetNodeParent(sceneNodeIndex);
return sceneGraph.GetNodeName(morphMeshParentIndex).GetName();
}
return {};
}
void MorphTargetExporter::ProduceMorphTargets(const Containers::Scene& scene,
uint32_t vertexOffset,
const ModelAssetBuilderComponent::SourceMeshContent& sourceMesh,
@@ -92,9 +74,14 @@ namespace AZ::RPI
{
const Containers::SceneGraph& sceneGraph = scene.GetGraph();
#if defined(AZ_ENABLE_TRACING)
const auto baseMeshIt = AZStd::find(sceneGraph.GetContentStorage().cbegin(), sceneGraph.GetContentStorage().cend(), sourceMesh.m_meshData);
const Containers::SceneGraph::NodeIndex baseMeshIndex = sceneGraph.ConvertToNodeIndex(baseMeshIt);
const AZStd::string_view baseMeshName{sceneGraph.GetNodeName(baseMeshIndex).GetName(), sceneGraph.GetNodeName(baseMeshIndex).GetNameLength()};
#endif
// Get the blend shapes for the given mesh
const AZStd::string_view meshName = sourceMesh.m_name.GetStringView();
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> blendShapeInfos = GetBlendShapeInfos(scene, meshName);
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> blendShapeInfos = GetBlendShapeInfos(scene, sourceMesh.m_meshData.get());
for (const auto& iter : blendShapeInfos)
{
@@ -109,12 +96,12 @@ namespace AZ::RPI
{
#if defined(AZ_ENABLE_TRACING)
const Containers::SceneGraph::NodeIndex morphMeshParentIndex = sceneGraph.GetNodeParent(sceneNodeIndex);
const char* meshNodeName = sceneGraph.GetNodeName(morphMeshParentIndex).GetName();
const AZStd::string_view sourceMeshName{sceneGraph.GetNodeName(morphMeshParentIndex).GetName(), sceneGraph.GetNodeName(morphMeshParentIndex).GetNameLength()};
#endif
AZ_Assert(AZ::StringFunc::Equal(sourceMesh.m_name.GetCStr(), meshNodeName, /*bCaseSensitive=*/true),
"Scene graph mesh node (%s) has a different name than the product mesh (%s).",
meshNodeName, sourceMesh.m_name.GetCStr());
AZ_Assert(AZ::StringFunc::Equal(baseMeshName, sourceMeshName, /*bCaseSensitive=*/true),
"Scene graph mesh node (%.*s) has a different name than the product mesh (%.*s).",
AZ_STRING_ARG(sourceMeshName), AZ_STRING_ARG(baseMeshName));
const DataTypes::MatrixType globalTransform = Utilities::BuildWorldTransform(sceneGraph, sceneNodeIndex);
BuildMorphTargetMesh(vertexOffset, sourceMesh, productMesh, metaAssetCreator, blendShapeName, blendShapeData, globalTransform, coordSysConverter, scene.GetSourceFilename());
@@ -39,12 +39,9 @@ namespace AZ
struct SourceBlendShapeInfo
{
AZStd::vector<AZ::SceneAPI::Containers::SceneGraph::NodeIndex> m_sceneNodeIndices;
static AZStd::string GetMeshNodeName(const AZ::SceneAPI::Containers::SceneGraph& sceneGraph,
const AZ::SceneAPI::Containers::SceneGraph::NodeIndex& sceneNodeIndex);
};
//! Retrieve all scene graph nodes per blend shape for all available blend shapes.
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> GetBlendShapeInfos(const AZ::SceneAPI::Containers::Scene& scene, const AZStd::optional<AZStd::string>& filterMeshName = AZStd::nullopt) const;
AZStd::unordered_map<AZStd::string, SourceBlendShapeInfo> GetBlendShapeInfos(const AZ::SceneAPI::Containers::Scene& scene, const MeshData* meshData) const;
//! Calculate position delta tolerance that is used to indicate whether a given vertex is part of the sparse set of morphed vertices
//! or if it will be skipped and optimized out due to a hardly visible or no movement at all.
@@ -32,10 +32,6 @@ namespace AZ
auto buffer = Data::InstanceDatabase<Buffer>::Instance().FindOrCreate(
Data::InstanceId::CreateFromAssetId(bufferAsset.GetId()),
bufferAsset);
if (buffer && buffer->m_rhiBuffer)
{
buffer->m_rhiBuffer->SetName(Name(bufferAsset.GetHint()));
}
return buffer;
}
@@ -170,6 +166,16 @@ namespace AZ
return resultCode;
}
}
m_rhiBuffer->SetName(Name(bufferAsset.GetName()));
// Only generate buffer's attachment id if the buffer is writable
if (RHI::CheckBitsAny(m_rhiBuffer->GetDescriptor().m_bindFlags,
RHI::BufferBindFlags::ShaderWrite | RHI::BufferBindFlags::CopyWrite | RHI::BufferBindFlags::DynamicInputAssembly))
{
// attachment id = bufferName_bufferInstanceId
m_attachmentId = Name(bufferAsset.GetName() + "_" + bufferAsset.GetId().m_guid.ToString<AZStd::string>(false, false));
}
return RHI::ResultCode::Success;
}
@@ -312,7 +318,8 @@ namespace AZ
const RHI::AttachmentId& Buffer::GetAttachmentId() const
{
return m_rhiBuffer->GetName();
AZ_Assert(!m_attachmentId.GetStringView().empty(), "Read-only buffer doesn't need attachment id");
return m_attachmentId;
}
const RHI::BufferViewDescriptor& Buffer::GetBufferViewDescriptor() const
@@ -152,15 +152,22 @@ namespace AZ
}
Data::Instance<Buffer> BufferSystem::CreateBufferFromCommonPool(const CommonBufferDescriptor& descriptor)
{
Uuid bufferId = Uuid::CreateName(descriptor.m_bufferName.c_str());
// Report error if there is a buffer with same name.
// Note: this shouldn't return the existing buffer because users are expecting a newly created buffer.
if (Data::InstanceDatabase<Buffer>::Instance().Find(Data::InstanceId(bufferId)))
{
Uuid bufferId;
if (descriptor.m_isUniqueName)
{
AZ_Error("BufferSystem", false, "Buffer with same name '%s' already exist", descriptor.m_bufferName.c_str());
return nullptr;
bufferId = Uuid::CreateName(descriptor.m_bufferName.c_str());
// Report error if there is a buffer with same name.
// Note: this shouldn't return the existing buffer because users are expecting a newly created buffer.
if (Data::InstanceDatabase<Buffer>::Instance().Find(Data::InstanceId(bufferId)))
{
AZ_Error("BufferSystem", false, "Buffer with same name '%s' already exist", descriptor.m_bufferName.c_str());
return nullptr;
}
}
else
{
bufferId = Uuid::CreateRandom();
}
RHI::Ptr<RHI::BufferPool> bufferPool = GetCommonBufferPool(descriptor.m_poolType);
@@ -207,9 +214,9 @@ namespace AZ
return nullptr;
}
Data::Instance<Buffer> BufferSystem::FindCommonBuffer(AZStd::string_view bufferName)
Data::Instance<Buffer> BufferSystem::FindCommonBuffer(AZStd::string_view uniqueBufferName)
{
Uuid bufferId = Uuid::CreateName(bufferName.data());
Uuid bufferId = Uuid::CreateName(uniqueBufferName.data());
return Data::InstanceDatabase<Buffer>::Instance().Find(Data::InstanceId(bufferId));
}
} // namespace RPI
@@ -30,7 +30,7 @@ namespace AZ
// Create the ring buffer from common pool
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::DynamicInputAssembly;
desc.m_bufferName = AZStd::string::format("DyanmicBufferRing_%p", this);
desc.m_bufferName = "DyanmicBufferRing";
desc.m_elementSize = 1;
desc.m_byteCount = ringBufferSize;
m_ringBuffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
@@ -30,7 +30,8 @@ namespace AZ
if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext->Class<BufferAsset>()
->Version(1)
->Version(2)
->Field("Name", &BufferAsset::m_name)
->Field("Buffer", &BufferAsset::m_buffer)
->Field("BufferDescriptor", &BufferAsset::m_bufferDescriptor)
->Field("BufferViewDescriptor", &BufferAsset::m_bufferViewDescriptor)
@@ -80,5 +81,10 @@ namespace AZ
{
return m_poolType;
}
const AZStd::string& BufferAsset::GetName() const
{
return m_name;
}
} //namespace RPI
} // namespace AZ
@@ -152,7 +152,10 @@ namespace AZ
void BufferAssetCreator::SetBufferName(AZStd::string_view name)
{
m_asset.SetHint(name);
if (ValidateIsReady())
{
m_asset->m_name = name;
}
}
bool BufferAssetCreator::Clone(const Data::Asset<BufferAsset>& sourceAsset, Data::Asset<BufferAsset>& clonedResult, Data::AssetId& inOutLastCreatedAssetId)
@@ -474,6 +474,7 @@ namespace UnitTest
desc.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc.m_bufferName = "Buffer1";
desc.m_byteCount = bufferInfo.m_bufferDescriptor.m_byteCount;
desc.m_isUniqueName = true;
Data::Instance<RPI::Buffer> bufferInst = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
// buffer created
@@ -488,8 +489,33 @@ namespace UnitTest
EXPECT_EQ(bufferFound2.get(), nullptr);
}
// Failed if creates a buffer with duplicated name with existing buffer
TEST_F(BufferTests, BufferSystem_CreateDuplicatedNamedBuffer_Fail)
// Failed if creates a buffe which has a same name with existing buffer
// and has m_isUniqueName is enabled
TEST_F(BufferTests, BufferSystem_CreateDuplicatedNamedBufferEnableUniqueName_Fail)
{
using namespace AZ;
ExpectedBuffer bufferInfo = CreateValidBuffer();
RPI::CommonBufferDescriptor desc;
desc.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
desc.m_bufferName = "Buffer1";
desc.m_byteCount = bufferInfo.m_bufferDescriptor.m_byteCount;
desc.m_isUniqueName = true;
Data::Instance<RPI::Buffer> bufferInst = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
// buffer created
EXPECT_NE(bufferInst.get(), nullptr);
AZ_TEST_START_ASSERTTEST;
Data::Instance<RPI::Buffer> bufferInst2 = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
AZ_TEST_STOP_ASSERTTEST(1);
// buffer NOT created
EXPECT_EQ(bufferInst2.get(), nullptr);
}
// create a buffer which has a same name with existing buffer
TEST_F(BufferTests, BufferSystem_CreateDuplicatedNamedBuffers_Success)
{
using namespace AZ;
@@ -503,12 +529,10 @@ namespace UnitTest
Data::Instance<RPI::Buffer> bufferInst = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
// buffer created
EXPECT_NE(bufferInst.get(), nullptr);
AZ_TEST_START_ASSERTTEST;
Data::Instance<RPI::Buffer> bufferInst2 = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
AZ_TEST_STOP_ASSERTTEST(1);
// buffer NOT created
EXPECT_EQ(bufferInst2.get(), nullptr);
// buffer created
EXPECT_NE(bufferInst2.get(), nullptr);
}
// Buffer instance creation unit tests
@@ -510,9 +510,9 @@ namespace ShaderManagementConsole
AZStd::vector<AZ::Uuid> documentIdsToClose;
documentIdsToClose.reserve(m_tabWidget->count());
const AZ::Uuid documentIdToKeepOpen = GetDocumentIdFromTab(tabIndex);
for (int tabIndex = 0; tabIndex < m_tabWidget->count(); ++tabIndex)
for (int tabI = 0; tabI < m_tabWidget->count(); ++tabI)
{
const AZ::Uuid documentId = GetDocumentIdFromTab(tabIndex);
const AZ::Uuid documentId = GetDocumentIdFromTab(tabI);
if (documentId != documentIdToKeepOpen)
{
documentIdsToClose.push_back(documentId);
@@ -0,0 +1,119 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <Atom/Feature/Material/MaterialAssignment.h>
#include <ACES/Aces.h>
namespace AZ
{
namespace Render
{
struct AcesParameterOverrides;
//! DisplayMapperComponentRequests provides an interface to request operations on a DisplayMapperComponent
class DisplayMapperComponentRequests
: 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
virtual void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) = 0;
//! Get display mapper type
virtual DisplayMapperOperationType GetDisplayMapperOperationType() const = 0;
//! Set ACES parameter overrides for ACES mapping, display mapper must be set to Aces to see the difference
virtual void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) = 0;
//! Get ACES parameter overrides
virtual const AcesParameterOverrides& GetAcesParameterOverrides() const = 0;
// Enable or disable ACES parameter overrides
virtual void SetOverrideAcesParameters(bool value) = 0;
// Check if ACES parameters are overriding default preset values
virtual bool GetOverrideAcesParameters() const = 0;
// Set gamma adjustment to compensate for dim surround
virtual void SetAlterSurround(bool value) = 0;
// Get gamma adjustment to compensate for dim surround
virtual bool GetAlterSurround() const = 0;
// Set desaturation to compensate for luminance difference
virtual void SetApplyDesaturation(bool value) = 0;
// Get desaturation to compensate for luminance difference
virtual bool GetApplyDesaturation() const = 0;
// Set color appearance transform (CAT) from ACES white point to assumed observer adapted white point
virtual void SetApplyCATD60toD65(bool value) = 0;
// Get color appearance transform (CAT) from ACES white point to assumed observer adapted white point
virtual bool GetApplyCATD60toD65() const = 0;
// Set reference black luminance value
virtual void SetCinemaLimitsBlack(float value) = 0;
// Get reference black luminance value
virtual float GetCinemaLimitsBlack() const = 0;
// Set reference white luminance value
virtual void SetCinemaLimitsWhite(float value) = 0;
// Get reference white luminance value
virtual float GetCinemaLimitsWhite() const = 0;
// Set min luminance value
virtual void SetMinPoint(float value) = 0;
// Get min luminance value
virtual float GetMinPoint() const = 0;
// Set mid luminance value
virtual void SetMidPoint(float value) = 0;
// Get mid luminance value
virtual float GetMidPoint() const = 0;
// Set max luminance value
virtual void SetMaxPoint(float value) = 0;
// Get max luminance value
virtual float GetMaxPoint() const = 0;
// Set gamma adjustment value
virtual void SetSurroundGamma(float value) = 0;
// Get gamma adjustment value
virtual float GetSurroundGamma() const = 0;
// Set optional gamma value that is applied as basic gamma curve OETF
virtual void SetGamma(float value) = 0;
// Get optional gamma value that is applied as basic gamma curve OETF
virtual float GetGamma() const = 0;
};
using DisplayMapperComponentRequestBus = EBus<DisplayMapperComponentRequests>;
//! DisplayMapperComponent can send out notifications on the DisplayMapperComponentNotifications
class DisplayMapperComponentNotifications : public ComponentBus
{
public:
//! Notifies that display mapper type changed
virtual void OnDisplayMapperOperationTypeUpdated([[maybe_unused]] const DisplayMapperOperationType& displayMapperOperationType)
{
}
//! Notifies that ACES parameter overrides changed
virtual void OnAcesParameterOverridesUpdated([[maybe_unused]] const AcesParameterOverrides& acesParameterOverrides)
{
}
};
using DisplayMapperComponentNotificationBus = EBus<DisplayMapperComponentNotifications>;
} // namespace Render
} // namespace AZ
@@ -39,6 +39,5 @@ namespace AZ
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
}
}
} // namespace Render
} // namespace AZ
@@ -10,6 +10,8 @@
*
*/
#include "AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h"
#include <AzCore/RTTI/BehaviorContext.h>
#include <Atom/RPI.Public/Scene.h>
@@ -32,6 +34,69 @@ namespace AZ
->Version(0)
->Field("Configuration", &DisplayMapperComponentController::m_configuration);
}
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
behaviorContext->EBus<DisplayMapperComponentRequestBus>("DisplayMapperComponentRequestBus")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Category, "render")
->Attribute(AZ::Script::Attributes::Module, "render")
// LoadPreset
->Event("LoadPreset", &DisplayMapperComponentRequestBus::Events::LoadPreset)
// DisplayMapperOperationType
->Event("SetDisplayMapperOperationType", &DisplayMapperComponentRequestBus::Events::SetDisplayMapperOperationType)
->Event("GetDisplayMapperOperationType", &DisplayMapperComponentRequestBus::Events::GetDisplayMapperOperationType)
->VirtualProperty("DisplayMapperOperationType", "GetDisplayMapperOperationType", "SetDisplayMapperOperationType")
// AcesParameterOverrides
->Event("SetAcesParameterOverrides", &DisplayMapperComponentRequestBus::Events::SetAcesParameterOverrides)
->Event("GetAcesParameterOverrides", &DisplayMapperComponentRequestBus::Events::GetAcesParameterOverrides)
->VirtualProperty("AcesParameterOverrides", "GetAcesParameterOverrides", "SetAcesParameterOverrides")
// OverrideAcesParameters
->Event("SetOverrideAcesParameters", &DisplayMapperComponentRequestBus::Events::SetOverrideAcesParameters)
->Event("GetOverrideAcesParameters", &DisplayMapperComponentRequestBus::Events::GetOverrideAcesParameters)
->VirtualProperty("OverrideAcesParameters", "GetOverrideAcesParameters", "SetOverrideAcesParameters")
// AlterSurround
->Event("SetAlterSurround", &DisplayMapperComponentRequestBus::Events::SetAlterSurround)
->Event("GetAlterSurround", &DisplayMapperComponentRequestBus::Events::GetAlterSurround)
->VirtualProperty("AlterSurround", "GetAlterSurround", "SetAlterSurround")
// ApplyDesaturation
->Event("SetApplyDesaturation", &DisplayMapperComponentRequestBus::Events::SetApplyDesaturation)
->Event("GetApplyDesaturation", &DisplayMapperComponentRequestBus::Events::GetApplyDesaturation)
->VirtualProperty("ApplyDesaturation", "GetApplyDesaturation", "SetApplyDesaturation")
// ApplyCATD60toD65
->Event("SetApplyCATD60toD65", &DisplayMapperComponentRequestBus::Events::SetApplyCATD60toD65)
->Event("GetApplyCATD60toD65", &DisplayMapperComponentRequestBus::Events::GetApplyCATD60toD65)
->VirtualProperty("ApplyCATD60toD65", "GetApplyCATD60toD65", "SetApplyCATD60toD65")
// CinemaLimitsBlack
->Event("SetCinemaLimitsBlack", &DisplayMapperComponentRequestBus::Events::SetCinemaLimitsBlack)
->Event("GetCinemaLimitsBlack", &DisplayMapperComponentRequestBus::Events::GetCinemaLimitsBlack)
->VirtualProperty("CinemaLimitsBlack", "GetCinemaLimitsBlack", "SetCinemaLimitsBlack")
// CinemaLimitsWhite
->Event("SetCinemaLimitsWhite", &DisplayMapperComponentRequestBus::Events::SetCinemaLimitsWhite)
->Event("GetCinemaLimitsWhite", &DisplayMapperComponentRequestBus::Events::GetCinemaLimitsWhite)
->VirtualProperty("CinemaLimitsWhite", "GetCinemaLimitsWhite", "SetCinemaLimitsWhite")
// MinPoint
->Event("SetMinPoint", &DisplayMapperComponentRequestBus::Events::SetMinPoint)
->Event("GetMinPoint", &DisplayMapperComponentRequestBus::Events::GetMinPoint)
->VirtualProperty("MinPoint", "GetMinPoint", "SetMinPoint")
// MidPoint
->Event("SetMidPoint", &DisplayMapperComponentRequestBus::Events::SetMidPoint)
->Event("GetMidPoint", &DisplayMapperComponentRequestBus::Events::GetMidPoint)
->VirtualProperty("MidPoint", "GetMidPoint", "SetMidPoint")
// MaxPoint
->Event("SetMaxPoint", &DisplayMapperComponentRequestBus::Events::SetMaxPoint)
->Event("GetMaxPoint", &DisplayMapperComponentRequestBus::Events::GetMaxPoint)
->VirtualProperty("MaxPoint", "GetMaxPoint", "SetMaxPoint")
// SurroundGamma
->Event("SetSurroundGamma", &DisplayMapperComponentRequestBus::Events::SetSurroundGamma)
->Event("GetSurroundGamma", &DisplayMapperComponentRequestBus::Events::GetSurroundGamma)
->VirtualProperty("SurroundGamma", "GetSurroundGamma", "SetSurroundGamma")
// Gamma
->Event("SetGamma", &DisplayMapperComponentRequestBus::Events::SetGamma)
->Event("GetGamma", &DisplayMapperComponentRequestBus::Events::GetGamma)
->VirtualProperty("Gamma", "GetGamma", "SetGamma")
;
}
}
void DisplayMapperComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
@@ -57,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();
}
@@ -76,6 +145,219 @@ namespace AZ
return m_configuration;
}
void DisplayMapperComponentController::LoadPreset(OutputDeviceTransformType preset)
{
AcesParameterOverrides propertyOverrides;
propertyOverrides.m_preset = preset;
propertyOverrides.m_overrideDefaults = true;
propertyOverrides.LoadPreset();
SetAcesParameterOverrides(propertyOverrides);
}
void DisplayMapperComponentController::SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType)
{
if (m_configuration.m_displayMapperOperation != displayMapperOperationType)
{
m_configuration.m_displayMapperOperation = displayMapperOperationType;
OnConfigChanged();
DisplayMapperComponentNotificationBus::Broadcast(
&DisplayMapperComponentNotificationBus::Handler::OnDisplayMapperOperationTypeUpdated,
m_configuration.m_displayMapperOperation);
}
}
DisplayMapperOperationType DisplayMapperComponentController::GetDisplayMapperOperationType() const
{
return m_configuration.m_displayMapperOperation;
}
void DisplayMapperComponentController::SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides)
{
m_configuration.m_acesParameterOverrides = parameterOverrides;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
DisplayMapperComponentNotificationBus::Broadcast(
&DisplayMapperComponentNotificationBus::Handler::OnAcesParameterOverridesUpdated,
m_configuration.m_acesParameterOverrides);
}
const AcesParameterOverrides& DisplayMapperComponentController::GetAcesParameterOverrides() const
{
return m_configuration.m_acesParameterOverrides;
}
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)
{
OnConfigChanged();
}
}
bool DisplayMapperComponentController::GetOverrideAcesParameters() const
{
return m_configuration.m_acesParameterOverrides.m_overrideDefaults;
}
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)
{
OnConfigChanged();
}
}
bool DisplayMapperComponentController::GetAlterSurround() const
{
return m_configuration.m_acesParameterOverrides.m_alterSurround;
}
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)
{
OnConfigChanged();
}
}
bool DisplayMapperComponentController::GetApplyDesaturation() const
{
return m_configuration.m_acesParameterOverrides.m_applyDesaturation;
}
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)
{
OnConfigChanged();
}
}
bool DisplayMapperComponentController::GetApplyCATD60toD65() const
{
return m_configuration.m_acesParameterOverrides.m_applyCATD60toD65;
}
void DisplayMapperComponentController::SetCinemaLimitsBlack(float value)
{
m_configuration.m_acesParameterOverrides.m_cinemaLimitsBlack = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetCinemaLimitsBlack() const
{
return m_configuration.m_acesParameterOverrides.m_cinemaLimitsBlack;
}
void DisplayMapperComponentController::SetCinemaLimitsWhite(float value)
{
m_configuration.m_acesParameterOverrides.m_cinemaLimitsWhite = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetCinemaLimitsWhite() const
{
return m_configuration.m_acesParameterOverrides.m_cinemaLimitsWhite;
}
void DisplayMapperComponentController::SetMinPoint(float value)
{
m_configuration.m_acesParameterOverrides.m_minPoint = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetMinPoint() const
{
return m_configuration.m_acesParameterOverrides.m_minPoint;
}
void DisplayMapperComponentController::SetMidPoint(float value)
{
m_configuration.m_acesParameterOverrides.m_midPoint = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetMidPoint() const
{
return m_configuration.m_acesParameterOverrides.m_midPoint;
}
void DisplayMapperComponentController::SetMaxPoint(float value)
{
m_configuration.m_acesParameterOverrides.m_maxPoint = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetMaxPoint() const
{
return m_configuration.m_acesParameterOverrides.m_maxPoint;
}
void DisplayMapperComponentController::SetSurroundGamma(float value)
{
m_configuration.m_acesParameterOverrides.m_surroundGamma = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetSurroundGamma() const
{
return m_configuration.m_acesParameterOverrides.m_surroundGamma;
}
void DisplayMapperComponentController::SetGamma(float value)
{
m_configuration.m_acesParameterOverrides.m_gamma = value;
if (m_configuration.m_displayMapperOperation == DisplayMapperOperationType::Aces)
{
OnConfigChanged();
}
}
float DisplayMapperComponentController::GetGamma() const
{
return m_configuration.m_acesParameterOverrides.m_gamma;
}
void DisplayMapperComponentController::OnConfigChanged()
{
// Register the configuration with the AcesDisplayMapperFeatureProcessor for this scene.
@@ -12,10 +12,12 @@
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Component/TransformBus.h>
#include <AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h>
#include <AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentBus.h>
#include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
#include <Atom/Feature/PostProcess/PostProcessFeatureProcessorInterface.h>
@@ -24,7 +26,10 @@ namespace AZ
{
namespace Render
{
struct AcesParameterOverrides;
class DisplayMapperComponentController final
: DisplayMapperComponentRequestBus::Handler
{
public:
friend class EditorDisplayMapperComponent;
@@ -43,6 +48,35 @@ namespace AZ
void SetConfiguration(const DisplayMapperComponentConfig& config);
const DisplayMapperComponentConfig& GetConfiguration() const;
//! DisplayMapperComponentRequestBus::Handler overrides...
void LoadPreset(OutputDeviceTransformType preset) override;
void SetDisplayMapperOperationType(DisplayMapperOperationType displayMapperOperationType) override;
DisplayMapperOperationType GetDisplayMapperOperationType() const override;
void SetAcesParameterOverrides(const AcesParameterOverrides& parameterOverrides) override;
const AcesParameterOverrides& GetAcesParameterOverrides() const override;
void SetOverrideAcesParameters(bool value) override;
bool GetOverrideAcesParameters() const override;
void SetAlterSurround(bool value) override;
bool GetAlterSurround() const override;
void SetApplyDesaturation(bool value) override;
bool GetApplyDesaturation() const override;
void SetApplyCATD60toD65(bool value) override;
bool GetApplyCATD60toD65() const override;
void SetCinemaLimitsBlack(float value) override;
float GetCinemaLimitsBlack() const override;
void SetCinemaLimitsWhite(float value) override;
float GetCinemaLimitsWhite() const override;
void SetMinPoint(float value) override;
float GetMinPoint() const override;
void SetMidPoint(float value) override;
float GetMidPoint() const override;
void SetMaxPoint(float value) override;
float GetMaxPoint() const override;
void SetSurroundGamma(float value) override;
float GetSurroundGamma() const override;
void SetGamma(float value) override;
float GetGamma() const override;
private:
AZ_DISABLE_COPY(DisplayMapperComponentController);
@@ -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
{
@@ -54,54 +53,89 @@ namespace AZ
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
// m_overrideDefaults
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_overrideDefaults, "Override Defaults",
"When enabled allows parameter overrides for ACES configuration")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_alterSurround
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_alterSurround, "Alter Surround",
"Apply gamma adjustment to compensate for dim surround")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_applyDesaturation
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyDesaturation, "Alter Desaturation",
"Apply desaturation to compensate for luminance difference")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_applyCATD60toD65
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyCATD60toD65, "Alter CAT D60 to D65",
"Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_cinemaLimitsBlack
->DataElement(
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsBlack,
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_cinemaLimitsBlack,
"Cinema Limit (black)",
"Reference black luminance value")
->Attribute(AZ::Edit::Attributes::Min, 0.02f)
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_cinemaLimitsWhite)
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_cinemaLimitsWhite
->DataElement(
Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsWhite,
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_cinemaLimitsWhite,
"Cinema Limit (white)",
"Reference white luminance value")
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_cinemaLimitsBlack)
->Attribute(AZ::Edit::Attributes::Max, 4000.f)
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_minPoint
->DataElement(
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)",
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)",
"Linear extension below this")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
->Attribute(AZ::Edit::Attributes::Min, 0.002f)
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_midPoint)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues)
// m_midPoint
->DataElement(Edit::UIHandlers::Slider, &AcesParameterOverrides::m_midPoint,
"Mid Point (luminance)", "Middle gray")
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_minPoint)
->Attribute(AZ::Edit::Attributes::Max, &AcesParameterOverrides::m_maxPoint)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues)
// m_maxPoint
->DataElement(
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_midPoint, "Mid Point (luminance)",
"Middle gray")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
->DataElement(
Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)",
Edit::UIHandlers::Slider, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)",
"Linear extension above this")
->Attribute(AZ::Edit::Attributes::Min, &AcesParameterOverrides::m_midPoint)
->Attribute(AZ::Edit::Attributes::Max, 4000.f)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues)
// m_surroundGamma
->DataElement(
AZ::Edit::UIHandlers::Slider, &AcesParameterOverrides::m_surroundGamma, "Surround Gamma",
"Gamma adjustment to be applied to compensate for the condition of the viewing environment")
->Attribute(AZ::Edit::Attributes::Min, 0.6f)
->Attribute(AZ::Edit::Attributes::Max, 1.2f)
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// m_gamma
->DataElement(
AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_surroundGamma, "Surround Gamma",
"Gamma adjustment to be applied to compensate for the condition of the viewing environment")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
->DataElement(
AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_gamma, "Gamma",
AZ::Edit::UIHandlers::Slider, &AcesParameterOverrides::m_gamma, "Gamma",
"Optional gamma value that is applied as basic gamma curve OETF")
->Attribute(AZ::Edit::Attributes::Min, 0.2f)
->Attribute(AZ::Edit::Attributes::Max, 4.0f)
->Attribute(AZ::Edit::Attributes::Step, 0.005f)
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
// Load preset group
@@ -145,6 +179,8 @@ namespace AZ
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->Class<EditorDisplayMapperComponent>()->RequestBus("DisplayMapperComponentRequestBus");
behaviorContext->ConstantProperty("EditorDisplayMapperComponentTypeId", BehaviorConstant(Uuid(EditorDisplayMapperComponentTypeId)))
->Attribute(AZ::Script::Attributes::Module, "render")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
@@ -36,6 +36,7 @@ set(FILES
Include/AtomLyIntegration/CommonFeatures/PostProcess/Bloom/BloomComponentConfig.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldBus.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/DepthOfField/DepthOfFieldComponentConfig.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentBus.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConstants.h
Include/AtomLyIntegration/CommonFeatures/PostProcess/ExposureControl/ExposureControlBus.h
@@ -595,7 +595,7 @@ namespace AZ
// Create a buffer and populate it with the transforms
RPI::CommonBufferDescriptor descriptor;
descriptor.m_bufferData = boneTransforms.data();
descriptor.m_bufferName = AZStd::string::format("BoneTransformBuffer_%s_%s", actorInstance->GetActor()->GetName(), Uuid::CreateRandom().ToString<AZStd::string>().c_str());
descriptor.m_bufferName = AZStd::string::format("BoneTransformBuffer_%s", actorInstance->GetActor()->GetName());
descriptor.m_byteCount = boneTransforms.size() * sizeof(float);
descriptor.m_elementSize = floatsPerBone * sizeof(float);
descriptor.m_poolType = RPI::CommonBufferPoolType::ReadOnly;
@@ -287,9 +287,9 @@ namespace AudioControls
QDataStream stream(&encoded, QIODevice::ReadOnly);
while (!stream.atEnd())
{
int row, col;
int streamRow, streamCol;
QMap<int, QVariant> roleDataMap;
stream >> row >> col >> roleDataMap;
stream >> streamRow >> streamCol >> roleDataMap;
if (!roleDataMap.isEmpty())
{
// If dropping a folder, make sure that folder name doesn't already exist where it is being dropped
@@ -341,9 +341,9 @@ namespace AudioControls
{
QByteArray data = mimeData->data(format);
QDataStream stream(&data, QIODevice::ReadOnly);
int row, col;
int streamRow, streamCol;
QMap<int, QVariant> roleDataMap;
stream >> row >> col >> roleDataMap;
stream >> streamRow >> streamCol >> roleDataMap;
if (!roleDataMap.isEmpty() && roleDataMap[eDR_TYPE] != eIT_FOLDER)
{
return false;
@@ -1628,18 +1628,18 @@ namespace MCommon
}
else
{
const float screenWidth = static_cast<float>(camera->GetScreenWidth());
const float screenHeight = static_cast<float>(camera->GetScreenHeight());
const float cameraScreenWidth = static_cast<float>(camera->GetScreenWidth());
const float cameraScreenHeight = static_cast<float>(camera->GetScreenHeight());
// find the 4 corners of the frustum
AZ::Vector3 corners[4];
const AZ::Matrix4x4 inversedProjectionMatrix = MCore::InvertProjectionMatrix(camera->GetProjectionMatrix());
const AZ::Matrix4x4 inversedViewMatrix = MCore::InvertProjectionMatrix(camera->GetViewMatrix());
corners[0] = MCore::Unproject(0.0f, 0.0f, screenWidth, screenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[1] = MCore::Unproject(screenWidth, 0.0f, screenWidth, screenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[2] = MCore::Unproject(screenWidth, screenHeight, screenWidth, screenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[3] = MCore::Unproject(0.0f, screenHeight, screenWidth, screenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[0] = MCore::Unproject(0.0f, 0.0f, cameraScreenWidth, cameraScreenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[1] = MCore::Unproject(cameraScreenWidth, 0.0f, cameraScreenWidth, cameraScreenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[2] = MCore::Unproject(cameraScreenWidth, cameraScreenHeight, cameraScreenWidth, cameraScreenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
corners[3] = MCore::Unproject(0.0f, cameraScreenHeight, cameraScreenWidth, cameraScreenHeight, camera->GetFarClipDistance(), inversedProjectionMatrix, inversedViewMatrix);
// calculate the intersection points with the ground plane and create an AABB around those
// if there is no intersection point then use the ray target as point, which is the projection onto the far plane basically
@@ -319,9 +319,9 @@ namespace EMotionFX
step.mDependencies.Clear(false);
// calculate the new dependencies for this step
for (ActorInstance* actorInstance : step.mActorInstances)
for (ActorInstance* stepActorInstance : step.mActorInstances)
{
AddDependenciesToStep(actorInstance, &step);
AddDependenciesToStep(stepActorInstance, &step);
}
// assume that there is only one of the same actor instance in the whole schedule
@@ -91,10 +91,10 @@ namespace EMotionFX
}
else
{
AZ::Outcome<size_t> index = factory.FindRegisteredIndexByTypeId(instance);
if (index.IsSuccess())
AZ::Outcome<size_t> motionIndex = factory.FindRegisteredIndexByTypeId(instance);
if (motionIndex.IsSuccess())
{
GUI->setCurrentIndex(static_cast<int>(index.GetValue() + 1)); // +1 because we inserted an 'Automatic' one as first entry.
GUI->setCurrentIndex(static_cast<int>(motionIndex.GetValue() + 1)); // +1 because we inserted an 'Automatic' one as first entry.
}
else
{
@@ -725,23 +725,23 @@ namespace GraphCanvas
case Attribute::LineColor:
case Attribute::StripeColor:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (IsColorValid(value))
if (IsColorValid(valueStr))
{
style->SetAttribute(attribute, ParseColor(value));
style->SetAttribute(attribute, ParseColor(valueStr));
}
break;
}
case Attribute::BackgroundImage:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (value.startsWith(QStringLiteral(":/")))
if (valueStr.startsWith(QStringLiteral(":/")))
{
value = QString("qrc%1").arg(value);
valueStr = QString("qrc%1").arg(valueStr);
}
QUrl url(value);
QUrl url(valueStr);
if (url.isValid())
{
style->SetAttribute(attribute, url);
@@ -844,103 +844,103 @@ namespace GraphCanvas
case Attribute::BorderStyle:
case Attribute::LineStyle:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (IsLineStyleValid(value))
if (IsLineStyleValid(valueStr))
{
style->SetAttribute(attribute, QVariant::fromValue(ParseLineStyle(value)));
style->SetAttribute(attribute, QVariant::fromValue(ParseLineStyle(valueStr)));
}
break;
}
case Attribute::LineCurve:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (IsLineCurveValid(value))
if (IsLineCurveValid(valueStr))
{
style->SetAttribute(attribute, QVariant::fromValue(ParseLineCurve(value)));
style->SetAttribute(attribute, QVariant::fromValue(ParseLineCurve(valueStr)));
}
break;
}
case Attribute::CapStyle:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (IsCapStyleValid(value))
if (IsCapStyleValid(valueStr))
{
style->SetAttribute(attribute, QVariant::fromValue(ParseCapStyle(value)));
style->SetAttribute(attribute, QVariant::fromValue(ParseCapStyle(valueStr)));
}
break;
}
case Attribute::FontFamily:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (QString::compare(value, QLatin1String("default"), Qt::CaseInsensitive) == 0)
if (QString::compare(valueStr, QLatin1String("default"), Qt::CaseInsensitive) == 0)
{
value = defaultFontInfo.family();
valueStr = defaultFontInfo.family();
}
else
{
QFont font(value);
QFont font(valueStr);
QFontInfo info(font);
if (!info.exactMatch())
{
qWarning() << "Invalid font-family:" << value;
qWarning() << "Invalid font-family:" << valueStr;
}
}
style->SetAttribute(attribute, value);
style->SetAttribute(attribute, valueStr);
}
case Attribute::FontStyle:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (QString::compare(value, QLatin1String("default"), Qt::CaseInsensitive) == 0)
if (QString::compare(valueStr, QLatin1String("default"), Qt::CaseInsensitive) == 0)
{
style->SetAttribute(attribute, defaultFontInfo.style());
}
else
{
if (IsFontStyleValid(value))
if (IsFontStyleValid(valueStr))
{
style->SetAttribute(attribute, ParseFontStyle(value));
style->SetAttribute(attribute, ParseFontStyle(valueStr));
}
}
break;
}
case Attribute::FontWeight:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (QString::compare(value, QLatin1String("default"), Qt::CaseInsensitive) == 0)
if (QString::compare(valueStr, QLatin1String("default"), Qt::CaseInsensitive) == 0)
{
style->SetAttribute(attribute, defaultFontInfo.weight());
}
else
{
if (IsFontWeightValid(value))
if (IsFontWeightValid(valueStr))
{
style->SetAttribute(attribute, ParseFontWeight(value));
style->SetAttribute(attribute, ParseFontWeight(valueStr));
}
}
break;
}
case Attribute::FontVariant:
{
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
if (QString::compare(value, QLatin1String("default"), Qt::CaseInsensitive) == 0)
if (QString::compare(valueStr, QLatin1String("default"), Qt::CaseInsensitive) == 0)
{
style->SetAttribute(attribute, defaultFont.capitalization());
}
else
{
if (IsFontVariantValid(value))
if (IsFontVariantValid(valueStr))
{
style->SetAttribute(attribute, value);
style->SetAttribute(attribute, valueStr);
}
}
break;
@@ -965,23 +965,23 @@ namespace GraphCanvas
break;
case Attribute::PaletteStyle:
{
QString value(member->value.GetString());
style->SetAttribute(attribute, QVariant::fromValue(ParsePaletteStyle(value)));
QString valueStr(member->value.GetString());
style->SetAttribute(attribute, QVariant::fromValue(ParsePaletteStyle(valueStr)));
break;
}
case Attribute::PatternTemplate:
case Attribute::PatternPalettes:
{
QString value(member->value.GetString());
style->SetAttribute(attribute, value);
QString valueStr(member->value.GetString());
style->SetAttribute(attribute, valueStr);
break;
}
case Attribute::Steps:
{
QList<QVariant> stepList;
QString value(member->value.GetString());
QString valueStr(member->value.GetString());
QStringList splitValues = value.split("|");
QStringList splitValues = valueStr.split("|");
for (QString currentString : splitValues)
{
@@ -1325,12 +1325,12 @@ namespace GraphCanvas
AZStd::vector< Endpoint > endpoints;
SlotRequestBus::EventResult(endpoints, currentEndpoint.GetSlotId(), &SlotRequests::GetRemappedModelEndpoints);
for (const Endpoint& endpoint : endpoints)
for (const Endpoint& e : endpoints)
{
// If we haven't already processed the node, add it to our explore set so we can recurse.
if (retVal.count(endpoint) == 0)
if (retVal.count(e) == 0)
{
exploreSet.insert(endpoint);
exploreSet.insert(e);
}
}
}
+2 -2
View File
@@ -279,8 +279,8 @@ namespace GraphModel
m_connections.erase(iter);
#if defined(AZ_ENABLE_TRACING)
auto iter = AZStd::find(m_connections.begin(), m_connections.end(), connection);
AZ_Assert(iter == m_connections.end(), "Graph is broken. The same connection object was found multiple times.");
auto iterConnection = AZStd::find(m_connections.begin(), m_connections.end(), connection);
AZ_Assert(iterConnection == m_connections.end(), "Graph is broken. The same connection object was found multiple times.");
#endif
return true;
@@ -110,10 +110,10 @@ CUiAnimViewAnimNode::CUiAnimViewAnimNode(IUiAnimSequence* pSequence, IUiAnimNode
for (int i = 0; i < nodeCount; ++i)
{
IUiAnimNode* pNode = pSequence->GetNode(i);
IUiAnimNode* pParentNode = pNode->GetParent();
IUiAnimNode* pNodeParentNode = pNode->GetParent();
// If our node is the parent, then the current node is a child of it
if (pAnimNode == pParentNode)
if (pAnimNode == pNodeParentNode)
{
CUiAnimViewAnimNodeFactory animNodeFactory;
CUiAnimViewAnimNode* pNewUiAVAnimNode = animNodeFactory.BuildAnimNode(pSequence, pNode, this);
@@ -510,20 +510,20 @@ bool CUiAnimViewAnimNode::BaseClassPropertyPotentiallyChanged(
{
for (const AZ::SerializeContext::ClassElement& baseElement : baseClassData->m_elements)
{
size_t offset = baseClassOffset + baseElement.m_offset;
size_t baseOffset = baseClassOffset + baseElement.m_offset;
if (baseElement.m_flags & AZ::SerializeContext::ClassElement::FLG_BASE_CLASS)
{
if (BaseClassPropertyPotentiallyChanged(context, dstComponent, srcComponent, baseElement, offset))
if (BaseClassPropertyPotentiallyChanged(context, dstComponent, srcComponent, baseElement, baseOffset))
{
valueChanged = true;
}
}
else
{
if (HasComponentParamValueAzChanged(dstComponent, srcComponent, baseElement, offset))
if (HasComponentParamValueAzChanged(dstComponent, srcComponent, baseElement, baseOffset))
{
valueChanged = true;
AzEntityPropertyChanged(srcComponent, dstComponent, baseElement, offset);
AzEntityPropertyChanged(srcComponent, dstComponent, baseElement, baseOffset);
}
}
}
@@ -59,12 +59,12 @@ CUiAnimViewTrack::CUiAnimViewTrack(IUiAnimTrack* pTrack, CUiAnimViewAnimNode* pT
{
// Search for child tracks
const unsigned int subTrackCount = m_pAnimTrack->GetSubTrackCount();
for (unsigned int subTrackIndex = 0; subTrackIndex < subTrackCount; ++subTrackIndex)
for (unsigned int subTrackI = 0; subTrackI < subTrackCount; ++subTrackI)
{
IUiAnimTrack* pSubTrack = m_pAnimTrack->GetSubTrack(subTrackIndex);
IUiAnimTrack* pSubTrack = m_pAnimTrack->GetSubTrack(subTrackI);
CUiAnimViewTrackFactory trackFactory;
CUiAnimViewTrack* pNewUiAVTrack = trackFactory.BuildTrack(pSubTrack, pTrackAnimNode, this, true, subTrackIndex);
CUiAnimViewTrack* pNewUiAVTrack = trackFactory.BuildTrack(pSubTrack, pTrackAnimNode, this, true, subTrackI);
m_childNodes.push_back(std::unique_ptr<CUiAnimViewNode>(pNewUiAVTrack));
}
@@ -422,12 +422,12 @@ namespace Audio
if (stereoToMono)
{
// Samples are interleaved now, copy only left channel to the output
float* inputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float* outputData = reinterpret_cast<float*>(m_conversionBufferOut.m_data);
float* bufferInputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float* bufferOutputData = reinterpret_cast<float*>(m_conversionBufferOut.m_data);
for (AZ::u32 frame = 0; frame < numFrames; ++frame)
{
outputData[frame] = *inputData++;
++inputData;
bufferOutputData[frame] = *bufferInputData++;
++bufferInputData;
}
}
else // monoToStereo
@@ -435,21 +435,21 @@ namespace Audio
// Split single samples to both left and right channels
if (shouldDeinterleave)
{
float* inputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float** outputData = reinterpret_cast<float**>(m_conversionBufferOut.m_data);
float* bufferInputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float** bufferOutputData = reinterpret_cast<float**>(m_conversionBufferOut.m_data);
for (AZ::u32 frame = 0; frame < numFrames; ++frame)
{
outputData[0][frame] = outputData[1][frame] = inputData[frame];
bufferOutputData[0][frame] = bufferOutputData[1][frame] = bufferInputData[frame];
}
}
else
{
float* inputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float* outputData = reinterpret_cast<float*>(m_conversionBufferOut.m_data);
float* bufferInputData = reinterpret_cast<float*>(m_conversionBufferIn.m_data);
float* bufferOutputData = reinterpret_cast<float*>(m_conversionBufferOut.m_data);
for (AZ::u32 frame = 0; frame < numFrames; ++frame)
{
*outputData++ = inputData[frame];
*outputData++ = inputData[frame];
*bufferOutputData++ = bufferInputData[frame];
*bufferOutputData++ = bufferInputData[frame];
}
}
}
@@ -263,9 +263,9 @@ namespace Multiplayer
// Validate that we aren't already planning to remove this entity
if (safeToExit)
{
for (auto entityId : m_removeList)
for (auto remoteEntityId : m_removeList)
{
if (entityId == entityId)
if (remoteEntityId == remoteEntityId)
{
safeToExit = false;
}
@@ -340,31 +340,31 @@ namespace
}
// Pass in the associated class data so we can do more intensive lookups?
const AZ::SerializeContext::ClassData* classData = serializeContext.FindClassData(node.first);
const AZ::SerializeContext::ClassData* nodeClassData = serializeContext.FindClassData(node.first);
if (classData == nullptr)
if (nodeClassData == nullptr)
{
continue;
}
// Detect primitive types os we avoid making nodes out of them.
// Or anything that is 'pure data' and should be populated through a different mechanism.
if (classData->m_azRtti && classData->m_azRtti->IsTypeOf<ScriptCanvas::PureData>())
if (nodeClassData->m_azRtti && nodeClassData->m_azRtti->IsTypeOf<ScriptCanvas::PureData>())
{
continue;
}
// Skip over some of our more dynamic nodes that we want to populate using different means
else if (classData->m_azRtti && classData->m_azRtti->IsTypeOf<ScriptCanvas::Nodes::Core::GetVariableNode>())
else if (nodeClassData->m_azRtti && nodeClassData->m_azRtti->IsTypeOf<ScriptCanvas::Nodes::Core::GetVariableNode>())
{
continue;
}
else if (classData->m_azRtti && classData->m_azRtti->IsTypeOf<ScriptCanvas::Nodes::Core::SetVariableNode>())
else if (nodeClassData->m_azRtti && nodeClassData->m_azRtti->IsTypeOf<ScriptCanvas::Nodes::Core::SetVariableNode>())
{
continue;
}
else
{
nodePaletteModel.RegisterCustomNode(categoryPath, node.first, node.second, classData);
nodePaletteModel.RegisterCustomNode(categoryPath, node.first, node.second, nodeClassData);
}
}
@@ -563,13 +563,13 @@ namespace ScriptCanvasEditor
else if (slotType == GraphCanvas::SlotTypes::DataSlot)
{
const AZ::EntityId& slotId2 = GetTargetId();
const GraphCanvas::GraphId& graphId = GetGraphId();
const GraphCanvas::GraphId& graphId2 = GetGraphId();
GraphCanvas::Endpoint endpoint;
GraphCanvas::SlotRequestBus::EventResult(endpoint, slotId2, &GraphCanvas::SlotRequests::GetEndpoint);
bool promotedElement = false;
GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint);
GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId2, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint);
if (promotedElement)
{
@@ -4090,23 +4090,23 @@ namespace ScriptCanvas
auto userFunctionIter = m_userInsThatRequireTopology.find(nodeling);
if (userFunctionIter != m_userInsThatRequireTopology.end())
{
auto& node = *userFunctionIter->first;
auto outSlots = node.GetSlotsByType(CombinedSlotType::ExecutionOut);
auto& userFunctionNode = *userFunctionIter->first;
auto outSlots = userFunctionNode.GetSlotsByType(CombinedSlotType::ExecutionOut);
if (outSlots.empty() || !outSlots.front())
{
AddError(node.GetEntityId(), nullptr, ScriptCanvas::ParseErrors::NoOutSlotInFunctionDefinitionStart);
AddError(userFunctionNode.GetEntityId(), nullptr, ScriptCanvas::ParseErrors::NoOutSlotInFunctionDefinitionStart);
return;
}
if (!ExecutionContainsCyclesCheck(node, *outSlots.front()))
if (!ExecutionContainsCyclesCheck(userFunctionNode, *outSlots.front()))
{
auto definition = userFunctionIter->second;
auto entrySlot = definition->GetId().m_slot;
AZ_Assert(entrySlot, "Bad accounting in user function definition node");
AZStd::vector<VariablePtr> returnValues;
UserOutCallCollector userOutCallCollector;
TraverseExecutionConnections(node, *entrySlot, userOutCallCollector);
TraverseExecutionConnections(userFunctionNode, *entrySlot, userOutCallCollector);
const AZStd::unordered_set<const ScriptCanvas::Nodes::Core::FunctionDefinitionNode*>& uniqueNodelingsOut = userOutCallCollector.GetOutCalls();
for (const auto& returnCall : uniqueNodelingsOut)
@@ -121,13 +121,13 @@ namespace ScriptCanvas
{
if (slotId == ExpressionNodeBaseProperty::GetInSlotId(this))
{
for (const SlotId& slotId : m_dirtyInputs)
for (const SlotId& dirtySlotId : m_dirtyInputs)
{
auto variableIter = m_slotToVariableMap.find(slotId);
auto variableIter = m_slotToVariableMap.find(dirtySlotId);
if (variableIter != m_slotToVariableMap.end())
{
PushVariable(variableIter->second, (*FindDatum(slotId)));
PushVariable(variableIter->second, (*FindDatum(dirtySlotId)));
}
}
@@ -2060,23 +2060,23 @@ namespace WhiteBox
polygonHandle.m_faceHandles.push_back(faceHandleToVisit);
// for all halfedges
for (const auto halfedgeHandle : faceHalfedges)
for (const auto faceHalfedgeHandle : faceHalfedges)
{
const EdgeHandle edgeHandle = HalfedgeEdgeHandle(whiteBox, halfedgeHandle);
const EdgeHandle edgeHandle = HalfedgeEdgeHandle(whiteBox, faceHalfedgeHandle);
// if we haven't seen this halfedge before and we want to track it,
// store it in visited halfedges
if (halfedgeHandle != oppositeHalfedgeHandle
if (faceHalfedgeHandle != oppositeHalfedgeHandle
// ignore border halfedges (not inside the polygon)
&& AZStd::find(borderHalfedgeHandles.cbegin(), borderHalfedgeHandles.cend(), halfedgeHandle) ==
&& AZStd::find(borderHalfedgeHandles.cbegin(), borderHalfedgeHandles.cend(), faceHalfedgeHandle) ==
borderHalfedgeHandles.cend()
// ensure we do not visit the same halfedge again
&& AZStd::find(visitedHalfedges.cbegin(), visitedHalfedges.cend(), halfedgeHandle) ==
&& AZStd::find(visitedHalfedges.cbegin(), visitedHalfedges.cend(), faceHalfedgeHandle) ==
visitedHalfedges.cend()
// ignore the halfedge if we've already tracked it in our 'building' list
&& AZStd::find(buildingEdgeHandles.cbegin(), buildingEdgeHandles.cend(), edgeHandle) ==
buildingEdgeHandles.cend())
{
halfedgesToVisit.push_back(HalfedgeOppositeHalfedgeHandle(whiteBox, halfedgeHandle));
halfedgesToVisit.push_back(HalfedgeOppositeHalfedgeHandle(whiteBox, faceHalfedgeHandle));
}
}
}
@@ -3198,10 +3198,10 @@ namespace WhiteBox
// <missing> - add bottom faces if mesh was 2d previously (reverse winding order)
FaceHandles allFacesToRemove = polygonHandle.m_faceHandles;
for (const auto& polygonHandle : polygonHandlesToRemove)
for (const auto& polygonHandleToRemove : polygonHandlesToRemove)
{
allFacesToRemove.insert(
allFacesToRemove.end(), polygonHandle.m_faceHandles.cbegin(), polygonHandle.m_faceHandles.cend());
allFacesToRemove.end(), polygonHandleToRemove.m_faceHandles.cbegin(), polygonHandleToRemove.m_faceHandles.cend());
}
// remove all faces that were already there
-2
View File
@@ -291,7 +291,6 @@ function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
# Install the Find file to our <install_location>/cmake directory
install(FILES ${CMAKE_CURRENT_LIST_FILE}
DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# We only want to install external targets that are part of our source tree
@@ -302,7 +301,6 @@ function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
get_filename_component(rel_path ${rel_path} DIRECTORY)
install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY}
DESTINATION ${rel_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endif()
@@ -30,11 +30,11 @@ ly_associate_package(PACKAGE_NAME azslc-1.7.21-rev1-multiplatform
ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee)
ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5)
ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e)
ly_associate_package(PACKAGE_NAME Blast-1.1.7-rev1-multiplatform TARGETS Blast PACKAGE_HASH 36b8f393bcd25d0f85cfc7a831ebbdac881e6054c4f0735649966aa6aa86e6f0)
ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e)
# platform-specific:
ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-windows TARGETS AWSGameLiftServerSDK PACKAGE_HASH a0586b006e4def65cc25f388de17dc475e417dc1e6f9d96749777c88aa8271b0)
ly_associate_package(PACKAGE_NAME Blast-v1.1.7_rc2-9-geb169fe-rev1-windows TARGETS Blast PACKAGE_HASH 216df71f4ffaf4a6ea3f2e77e5f27d68f2325e717fbd1626b00c785b82cd1b67)
ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-windows TARGETS DirectXShaderCompilerDxc PACKAGE_HASH decc53e97c7ddda9c7f853a30af7808a7b652a912f59ad2cd4bca5d308aae2c4)
ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817)
ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-windows TARGETS freetype PACKAGE_HASH 88dedc86ccb8c92f14c2c033e51ee7d828fa08eafd6475c6aa963938a99f4bf3)
+9 -4
View File
@@ -51,6 +51,12 @@ if(NOT CPACK_GENERATOR)
return()
endif()
if(${CPACK_DESIRED_CMAKE_VERSION} VERSION_LESS ${CMAKE_MINIMUM_REQUIRED_VERSION})
message(FATAL_ERROR
"The desired version of CMake to be included in the package is "
"below the minimum required version of CMake to run")
endif()
# pull down the desired copy of CMake so it can be included in the package
if(NOT (CPACK_CMAKE_PACKAGE_FILE AND CPACK_CMAKE_PACKAGE_HASH))
message(FATAL_ERROR
@@ -67,7 +73,7 @@ list(GET _version_componets 1 _minor_version)
set(_url_version_tag "v${_major_version}.${_minor_version}")
set(_package_url "https://cmake.org/files/${_url_version_tag}/${CPACK_CMAKE_PACKAGE_FILE}")
message(STATUS "Ensuring CMake ${CPACK_DESIRED_CMAKE_VERSION} is available for packaging...")
message(STATUS "Downloading CMake ${CPACK_DESIRED_CMAKE_VERSION} for packaging...")
download_file(
URL ${_package_url}
TARGET_FILE ${_cmake_package_dest}
@@ -77,7 +83,7 @@ download_file(
list(GET _results 0 _status_code)
if (${_status_code} EQUAL 0 AND EXISTS ${_cmake_package_dest})
message(STATUS "-> Package found and verified!")
message(STATUS "Package found and verified!")
else()
file(REMOVE ${_cmake_package_dest})
list(REMOVE_AT _results 0)
@@ -95,7 +101,6 @@ endif()
install(FILES ${_cmake_package_dest}
DESTINATION ./Tools/Redistributables/CMake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# IMPORTANT: required to be included AFTER setting all property overrides
@@ -135,7 +140,7 @@ endfunction()
# configure ALL components here
ly_configure_cpack_component(
${LY_DEFAULT_INSTALL_COMPONENT} REQUIRED
${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} REQUIRED
DISPLAY_NAME "${PROJECT_NAME} Core"
DESCRIPTION "${PROJECT_NAME} Headers, Libraries and Tools"
)
+14 -29
View File
@@ -11,7 +11,7 @@
set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise
ly_set(LY_DEFAULT_INSTALL_COMPONENT Core)
ly_set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
file(RELATIVE_PATH runtime_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
file(RELATIVE_PATH library_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
@@ -27,6 +27,9 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
# De-alias target name
ly_de_alias_target(${ALIAS_TARGET_NAME} TARGET_NAME)
# get the component ID. if the property isn't set for the target, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_property(install_component TARGET ${TARGET_NAME} PROPERTY INSTALL_COMPONENT)
# All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that
# we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the
# headers end up in one folder instead of duplicating the folder structure of the public/interface include directory.
@@ -41,7 +44,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
unset(current_public_headers)
install(DIRECTORY ${include_directory}
DESTINATION ${include_location}/${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
FILES_MATCHING
PATTERN *.h
PATTERN *.hpp
@@ -68,13 +71,13 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME)
TARGETS ${TARGET_NAME}
ARCHIVE
DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
LIBRARY
DESTINATION ${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
RUNTIME
DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory}
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
)
# CMakeLists.txt file
@@ -182,7 +185,7 @@ set_property(TARGET ${TARGET_NAME}
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake"
DESTINATION ${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
)
# Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target
@@ -239,9 +242,13 @@ function(ly_setup_subdirectory absolute_target_source_dir)
"\n"
"${CREATE_ALIASES_PLACEHOLDER}"
)
# get the component ID. if the property isn't set for the directory, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_property(install_component DIRECTORY ${absolute_target_source_dir} PROPERTY INSTALL_COMPONENT)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/CMakeLists.txt"
DESTINATION ${target_source_dir}
COMPONENT ${ly_install_target_COMPONENT}
COMPONENT ${install_component}
)
endfunction()
@@ -262,7 +269,6 @@ function(ly_setup_cmake_install)
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
REGEX "Findo3de.cmake" EXCLUDE
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
@@ -290,7 +296,6 @@ function(ly_setup_cmake_install)
"${LY_ROOT_FOLDER}/CMakeLists.txt"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Collect all Find files that were added with ly_add_external_target_path
@@ -303,7 +308,6 @@ function(ly_setup_cmake_install)
endforeach()
install(FILES ${additional_find_files}
DESTINATION cmake/3rdParty
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all
@@ -320,7 +324,6 @@ function(ly_setup_cmake_install)
configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# BuiltInPackage_<platform>.cmake: since associations could happen in any cmake file across the engine. We collect
@@ -340,7 +343,6 @@ function(ly_setup_cmake_install)
)
install(FILES "${pal_builtin_file}"
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endfunction()
@@ -362,7 +364,6 @@ endfunction()
function(ly_copy source_file target_directory)
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
endfunction()"
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
unset(runtime_commands)
@@ -408,7 +409,6 @@ endfunction()"
list(REMOVE_DUPLICATES runtime_commands)
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
install(CODE "${runtime_commands_str}"
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endfunction()
@@ -427,7 +427,6 @@ function(ly_setup_others)
install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}"
DESTINATION ${install_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
)
@@ -438,14 +437,12 @@ function(ly_setup_others)
install(FILES
${o3de_scripts}
DESTINATION ./scripts
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(DIRECTORY
${LY_ROOT_FOLDER}/scripts/bundler
${LY_ROOT_FOLDER}/scripts/o3de
DESTINATION ./scripts
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "tests" EXCLUDE
@@ -453,7 +450,6 @@ function(ly_setup_others)
install(DIRECTORY "${LY_ROOT_FOLDER}/python"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
REGEX "downloaded_packages" EXCLUDE
REGEX "runtime" EXCLUDE
)
@@ -462,19 +458,16 @@ function(ly_setup_others)
install(DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/Registry
DESTINATION ./${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(DIRECTORY
${LY_ROOT_FOLDER}/Registry
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Engine Source Assets
install(DIRECTORY
${LY_ROOT_FOLDER}/Assets
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Gem Source Assets and Registry
@@ -494,7 +487,6 @@ function(ly_setup_others)
# the "Assets" folder from being copied underneath the <gem-root>/Assets folder
install(DIRECTORY ${gem_abs_assets_path}
DESTINATION ${gem_assets_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endif()
endforeach()
@@ -510,7 +502,6 @@ function(ly_setup_others)
get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY)
install(FILES ${gem_json_path}
DESTINATION ${gem_relative_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endforeach()
@@ -518,14 +509,12 @@ function(ly_setup_others)
install(DIRECTORY
${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config
DESTINATION Gems/Atom/Asset/ImageProcessingAtom
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Templates
install(DIRECTORY
${LY_ROOT_FOLDER}/Templates
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Misc
@@ -534,7 +523,6 @@ function(ly_setup_others)
${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endfunction()
@@ -548,15 +536,12 @@ function(ly_setup_target_generator)
${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp
${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in
DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform
DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake
DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endfunction()
@@ -73,7 +73,6 @@ ly_append_configurations_options(
/wd4389 # comparison, signed/unsigned mismatch
/wd4436 # the result of unary operator may be unaligned
/wd4450 # declaration hides global declaration
/wd4457 # declaration hides function parameter
# Enabling warnings that are disabled by default from /W4
# https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a
size 107016
oid sha256:d717f77fe01f45df934a61bbc215e5322447d21e16f3cebcf2a02f148178f266
size 106449
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac0348c906c91de864cba91c0231b4794d8a00fafa630d13f2232351b90aa59b
oid sha256:8c804a6be619b9f35cad46eab30b94def7a4ac7142a92cb3f7c78a659381d834
size 11074
@@ -9,24 +9,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(LY_WIX_PATH "" CACHE PATH "Path to the WiX install path")
if(LY_WIX_PATH)
file(TO_CMAKE_PATH ${LY_QTIFW_PATH} CPACK_WIX_ROOT)
elseif(DEFINED ENV{WIX})
file(TO_CMAKE_PATH $ENV{WIX} CPACK_WIX_ROOT)
endif()
set(CPACK_WIX_ROOT "" CACHE PATH "Path to the WiX install path")
if(CPACK_WIX_ROOT)
if(NOT EXISTS ${CPACK_WIX_ROOT})
message(FATAL_ERROR "Invalid path supplied for LY_WIX_PATH argument or WIX environment variable")
message(FATAL_ERROR "Invalid path supplied for CPACK_WIX_ROOT argument")
endif()
else()
# early out as no path to WiX has been supplied effectively disabling support
return()
endif()
set(CPACK_GENERATOR "WIX")
set(CPACK_GENERATOR WIX)
set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-windows-x86_64")
set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.zip")
@@ -306,6 +306,20 @@
"CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
}
},
"windows_installer": {
"TAGS": [
"package"
],
"COMMAND": "build_installer_windows.cmd",
"PARAMETERS": {
"CONFIGURATION": "profile",
"OUTPUT_DIRECTORY": "build\\windows_vs2019",
"CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DCPACK_WIX_ROOT=\"!WIX!\"",
"CMAKE_LY_PROJECTS": "",
"CMAKE_TARGET": "ALL_BUILD",
"CMAKE_NATIVE_BUILD_ARGS": "/m /nologo"
}
},
"project_enginesource_profile_vs2019": {
"TAGS": [
"project"
@@ -0,0 +1,22 @@
@ECHO OFF
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
CALL "%~dp0build_windows.cmd"
IF NOT %ERRORLEVEL%==0 GOTO :error
CALL "%~dp0installer_windows.cmd"
IF NOT %ERRORLEVEL%==0 GOTO :error
EXIT /b 0
:error
EXIT /b 1
@@ -0,0 +1,64 @@
@ECHO OFF
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
SETLOCAL EnableDelayedExpansion
CALL %~dp0env_windows.cmd
IF NOT EXIST %OUTPUT_DIRECTORY% (
ECHO [ci_build] Error: $OUTPUT_DIRECTORY was not found
GOTO :error
)
PUSHD %OUTPUT_DIRECTORY%
REM Override the temporary directory used by wix to the workspace
SET "WIX_TEMP=!WORKSPACE!/temp/wix"
IF NOT EXIST "%WIX_TEMP%" (
MKDIR "%WIX_TEMP%"
)
REM Make sure we are using the CMake version of CPack and not the one that comes with chocolatey
SET CPACK_PATH=
IF "%LY_CMAKE_PATH%"=="" (
REM quote the paths from 'where' so we can properly tokenize ones in the list with spaces
FOR /F delims^=^"^ tokens^=1 %%i in ('where /F cpack') DO (
REM The cpack in chocolatey expects a number supplied with --version so it will error
"%%i" --version > NUL
IF !ERRORLEVEL!==0 (
SET "CPACK_PATH=%%i"
GOTO :run_cpack
)
)
) ELSE (
SET "CPACK_PATH=%LY_CMAKE_PATH%\cpack.exe"
)
:run_cpack
ECHO [ci_build] "!CPACK_PATH!" --version
"!CPACK_PATH!" --version
IF ERRORLEVEL 1 (
ECHO [ci_build] CPack not found!
GOTO :popd_error
)
ECHO [ci_build] "!CPACK_PATH!" -C %CONFIGURATION%
"!CPACK_PATH!" -C %CONFIGURATION%
IF NOT %ERRORLEVEL%==0 GOTO :popd_error
POPD
EXIT /b 0
:popd_error
POPD
:error
EXIT /b 1
@@ -29,3 +29,6 @@ choco install corretto8jdk -y --ia INSTALLDIR="c:\jdk8" # Custom directory to ha
# Install CMake
choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
# Install Windows Installer XML toolkit (WiX)
choco install wixtoolset -y