Merge pull request #5571 from aws-lumberyard-dev/Atom/santorac/MaterialEditorHandlesMissingTextures
Updated Material Editor and Asset Processor To Gracefully Handle Missing Textures
This commit is contained in:
+28
-5
@@ -527,8 +527,8 @@ namespace AzToolsFramework
|
||||
m_errorButton = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::UpdateErrorButton(const AZStd::string& errorLog)
|
||||
|
||||
void PropertyAssetCtrl::UpdateErrorButton()
|
||||
{
|
||||
if (m_errorButton)
|
||||
{
|
||||
@@ -543,12 +543,17 @@ namespace AzToolsFramework
|
||||
m_errorButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_errorButton->setFixedSize(QSize(16, 16));
|
||||
m_errorButton->setMouseTracking(true);
|
||||
m_errorButton->setIcon(QIcon("Icons/PropertyEditor/error_icon.png"));
|
||||
m_errorButton->setIcon(QIcon(":/PropertyEditor/Resources/error_icon.png"));
|
||||
m_errorButton->setToolTip("Show Errors");
|
||||
|
||||
// Insert the error button after the asset label
|
||||
qobject_cast<QHBoxLayout*>(layout())->insertWidget(1, m_errorButton);
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::UpdateErrorButtonWithLog(const AZStd::string& errorLog)
|
||||
{
|
||||
UpdateErrorButton();
|
||||
|
||||
// Connect pressed to opening the error dialog
|
||||
// Must capture this for call to QObject::connect
|
||||
@@ -587,6 +592,21 @@ namespace AzToolsFramework
|
||||
logDialog->show();
|
||||
});
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::UpdateErrorButtonWithMessage(const AZStd::string& message)
|
||||
{
|
||||
UpdateErrorButton();
|
||||
|
||||
connect(m_errorButton, &QPushButton::clicked, this, [this, message]() {
|
||||
QMessageBox::critical(nullptr, "Error", message.c_str());
|
||||
|
||||
// Without this, the error button would maintain focus after clicking, which left the red error icon in a blue-highlighted state
|
||||
if (parentWidget())
|
||||
{
|
||||
parentWidget()->setFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void PropertyAssetCtrl::ClearAssetInternal()
|
||||
{
|
||||
@@ -960,7 +980,6 @@ namespace AzToolsFramework
|
||||
else
|
||||
{
|
||||
const AZ::Data::AssetId assetID = GetCurrentAssetID();
|
||||
m_currentAssetHint = "";
|
||||
|
||||
AZ::Outcome<AssetSystem::JobInfoContainer> jobOutcome = AZ::Failure();
|
||||
AssetSystemJobRequestBus::BroadcastResult(jobOutcome, &AssetSystemJobRequestBus::Events::GetAssetJobsInfoByAssetID, assetID, false, false);
|
||||
@@ -1018,7 +1037,7 @@ namespace AzToolsFramework
|
||||
// In case of failure, render failure icon
|
||||
case AssetSystem::JobStatus::Failed:
|
||||
{
|
||||
UpdateErrorButton(errorLog);
|
||||
UpdateErrorButtonWithLog(errorLog);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1043,6 +1062,10 @@ namespace AzToolsFramework
|
||||
m_currentAssetHint = assetPath;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateErrorButtonWithMessage(AZStd::string::format("Asset is missing.\n\nID: %s\nHint:%s", assetID.ToString<AZStd::string>().c_str(), GetCurrentAssetHint().c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
// Get the asset file name
|
||||
|
||||
+3
-1
@@ -168,7 +168,9 @@ namespace AzToolsFramework
|
||||
|
||||
bool IsCorrectMimeData(const QMimeData* pData, AZ::Data::AssetId* pAssetId = nullptr, AZ::Data::AssetType* pAssetType = nullptr) const;
|
||||
void ClearErrorButton();
|
||||
void UpdateErrorButton(const AZStd::string& errorLog);
|
||||
void UpdateErrorButton();
|
||||
void UpdateErrorButtonWithLog(const AZStd::string& errorLog);
|
||||
void UpdateErrorButtonWithMessage(const AZStd::string& message);
|
||||
virtual const AZStd::string GetFolderSelection() const { return AZStd::string(); }
|
||||
virtual void SetFolderSelection(const AZStd::string& /* folderPath */) {}
|
||||
virtual void ClearAssetInternal();
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:28c3cfd8958813b4b539738bfff589731da0aeec5b3376558f377da2ebe973ff
|
||||
size 5455
|
||||
oid sha256:7028c8db4f935f23aa4396668278a67691d92fe345cc9d417a9f47bd9a4af32b
|
||||
size 8130
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="TextureSettings" version="2" type="{980132FF-C450-425D-8AE0-BD96A8486177}">
|
||||
<Class name="AZ::Uuid" field="PresetID" value="{00000000-0000-0000-0000-000000000000}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="Name" field="Preset" value="ReferenceImage" type="{3D2B920C-9EFD-40D5-AAE0-DF131C3D4931}"/>
|
||||
<Class name="unsigned int" field="SizeReduceLevel" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="bool" field="EngineReduce" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="EnableMipmap" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="MaintainAlphaCoverage" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="AZStd::vector" field="MipMapAlphaAdjustments" type="{3349AACD-BE04-50BC-9478-528BF2ACFD55}">
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
<Class name="unsigned int" field="MipMapGenEval" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="ImageProcessingAtom::MipGenType" field="MipMapGenType" value="1" type="{8524F650-1417-44DA-BBB0-C707A7A1A709}"/>
|
||||
<Class name="AZStd::map" field="PlatformSpecificOverrides" type="{74E4843B-0924-583D-8C6E-A37B09BD51FE}">
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="android" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="ios" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="linux" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="mac" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="pc" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::string" field="OverridingPlatform" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8a0935be7347d695ed1716d030b5bae68153a88239b0ff15f67f900ac90be442
|
||||
size 5038
|
||||
oid sha256:a7d94b9c0a77741736b93d8ed4d2b22bc9ae4cf649f3d8b3f10cbaf595a3ed31
|
||||
size 8336
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="TextureSettings" version="2" type="{980132FF-C450-425D-8AE0-BD96A8486177}">
|
||||
<Class name="AZ::Uuid" field="PresetID" value="{00000000-0000-0000-0000-000000000000}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="Name" field="Preset" value="ReferenceImage" type="{3D2B920C-9EFD-40D5-AAE0-DF131C3D4931}"/>
|
||||
<Class name="unsigned int" field="SizeReduceLevel" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="bool" field="EngineReduce" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="EnableMipmap" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="MaintainAlphaCoverage" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="AZStd::vector" field="MipMapAlphaAdjustments" type="{3349AACD-BE04-50BC-9478-528BF2ACFD55}">
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
<Class name="unsigned int" field="MipMapGenEval" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="ImageProcessingAtom::MipGenType" field="MipMapGenType" value="1" type="{8524F650-1417-44DA-BBB0-C707A7A1A709}"/>
|
||||
<Class name="AZStd::map" field="PlatformSpecificOverrides" type="{74E4843B-0924-583D-8C6E-A37B09BD51FE}">
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="android" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="ios" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="linux" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="mac" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="pc" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::string" field="OverridingPlatform" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bb243cd6d6414b4e95eab919fa94193b57825902b8d09f40ce3f334d829e74e2
|
||||
size 6286
|
||||
oid sha256:3bbd45e3ef81850da81d1cc01775930a53c424e64e287b00990af3e7e6a682ba
|
||||
size 9701
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="TextureSettings" version="2" type="{980132FF-C450-425D-8AE0-BD96A8486177}">
|
||||
<Class name="AZ::Uuid" field="PresetID" value="{00000000-0000-0000-0000-000000000000}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="Name" field="Preset" value="ReferenceImage" type="{3D2B920C-9EFD-40D5-AAE0-DF131C3D4931}"/>
|
||||
<Class name="unsigned int" field="SizeReduceLevel" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="bool" field="EngineReduce" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="EnableMipmap" value="true" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="bool" field="MaintainAlphaCoverage" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
|
||||
<Class name="AZStd::vector" field="MipMapAlphaAdjustments" type="{3349AACD-BE04-50BC-9478-528BF2ACFD55}">
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="unsigned int" field="element" value="50" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
</Class>
|
||||
<Class name="unsigned int" field="MipMapGenEval" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="ImageProcessingAtom::MipGenType" field="MipMapGenType" value="1" type="{8524F650-1417-44DA-BBB0-C707A7A1A709}"/>
|
||||
<Class name="AZStd::map" field="PlatformSpecificOverrides" type="{74E4843B-0924-583D-8C6E-A37B09BD51FE}">
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="android" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="ios" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="linux" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="mac" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}">
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#4·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#2·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#3·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#0·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{FED51EB4-F646-51FF-9646-9852CF90F353}">
|
||||
<Class name="AddressType" field="value1" value="AZStd::map({74E4843B-0924-583D-8C6E-A37B09BD51FE})::PlatformSpecificOverrides·0/AZStd::pair({CAC4E67F-D626-5452-A057-ACB57D53F549})#1·0/" version="1" type="{90752F2D-CBD3-4EE9-9CDD-447E797C8408}"/>
|
||||
<Class name="any" field="value2" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::pair" field="element" type="{CAC4E67F-D626-5452-A057-ACB57D53F549}">
|
||||
<Class name="AZStd::string" field="value1" value="pc" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="DataPatch" field="value2" type="{BFF7A3F5-9014-4000-92C7-9B2BC7913DA9}">
|
||||
<Class name="AZ::Uuid" field="m_targetClassId" value="{980132FF-C450-425D-8AE0-BD96A8486177}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="unsigned int" field="m_targetClassVersion" value="2" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::unordered_map" field="m_patch" type="{CEA836FC-77E0-5E46-BD0F-2E5A39D845E9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::string" field="OverridingPlatform" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <AzCore/JSON/document.h>
|
||||
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
|
||||
#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -21,21 +22,24 @@ namespace AZ
|
||||
{
|
||||
// Declarations...
|
||||
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& sourcePath, uint32_t productSubId);
|
||||
// Note that these functions default to TraceLevel::Error to preserve legacy behavior of these APIs. It would be nice to make the default match
|
||||
// RPI.Reflect/Asset/AssetUtils.h which is TraceLevel::Warning, but we are close to a release so it isn't worth the risk at this time.
|
||||
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId);
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& sourcePath, uint32_t productSubId, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& sourcePath, uint32_t productSubId = 0);
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& sourcePath, uint32_t productSubId = 0, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId = 0);
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId = 0, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, const char* sourcePathForDebug);
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, const char* sourcePathForDebug, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId);
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, TraceLevel reporting = TraceLevel::Error);
|
||||
|
||||
//! Attempts to resolve the full path to a product asset given its ID
|
||||
AZStd::string GetProductPathByAssetId(const AZ::Data::AssetId& assetId);
|
||||
@@ -65,12 +69,12 @@ namespace AZ
|
||||
// Definitions...
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& sourcePath, uint32_t productSubId)
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& sourcePath, uint32_t productSubId, TraceLevel reporting)
|
||||
{
|
||||
auto assetId = MakeAssetId(sourcePath, productSubId);
|
||||
auto assetId = MakeAssetId(sourcePath, productSubId, reporting);
|
||||
if (assetId.IsSuccess())
|
||||
{
|
||||
return LoadAsset<AssetDataT>(assetId.GetValue(), sourcePath.c_str());
|
||||
return LoadAsset<AssetDataT>(assetId.GetValue(), sourcePath.c_str(), reporting);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -79,20 +83,20 @@ namespace AZ
|
||||
}
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId)
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId, TraceLevel reporting)
|
||||
{
|
||||
AZStd::string resolvedPath = ResolvePathReference(originatingSourcePath, referencedSourceFilePath);
|
||||
return LoadAsset<AssetDataT>(resolvedPath, productSubId);
|
||||
return LoadAsset<AssetDataT>(resolvedPath, productSubId, reporting);
|
||||
}
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId)
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, TraceLevel reporting)
|
||||
{
|
||||
return LoadAsset<AssetDataT>(assetId, nullptr);
|
||||
return LoadAsset<AssetDataT>(assetId, nullptr, reporting);
|
||||
}
|
||||
|
||||
template<typename AssetDataT>
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, [[maybe_unused]] const char* sourcePathForDebug)
|
||||
Outcome<AZ::Data::Asset<AssetDataT>> LoadAsset(const AZ::Data::AssetId& assetId, [[maybe_unused]] const char* sourcePathForDebug, TraceLevel reporting)
|
||||
{
|
||||
if (nullptr == AZ::IO::FileIOBase::GetInstance()->GetAlias("@products@"))
|
||||
{
|
||||
@@ -111,11 +115,11 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Error("AssetUtils", false, "Could not load %s [Source='%s' Cache='%s' AssetID=%s] ",
|
||||
AssetUtilsInternal::ReportIssue(reporting, AZStd::string::format("Could not load %s [Source='%s' Cache='%s' AssetID=%s] ",
|
||||
AzTypeInfo<AssetDataT>::Name(),
|
||||
sourcePathForDebug ? sourcePathForDebug : "<unknown>",
|
||||
asset.GetHint().empty() ? "<unknown>" : asset.GetHint().c_str(),
|
||||
assetId.ToString<AZStd::string>().c_str());
|
||||
assetId.ToString<AZStd::string>().c_str()).c_str());
|
||||
|
||||
return AZ::Failure();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,18 @@ namespace AZ
|
||||
|
||||
namespace MaterialUtils
|
||||
{
|
||||
Outcome<Data::Asset<ImageAsset>> GetImageAssetReference(AZStd::string_view materialSourceFilePath, const AZStd::string imageFilePath);
|
||||
enum class GetImageAssetResult
|
||||
{
|
||||
Empty, //! No image was actually requested, the path was empty
|
||||
Found, //! The requested asset was found
|
||||
Missing //! The requested asset was not found, and a placeholder asset was used instead
|
||||
};
|
||||
|
||||
//! Finds an ImageAsset referenced by a material file (or a placeholder)
|
||||
//! @param imageAsset the resulting ImageAsset
|
||||
//! @param materialSourceFilePath the full path to a material source file that is referenfing an image file
|
||||
//! @param imageFilePath the path to an image source file, which could be relative to the asset root or relative to the material file
|
||||
GetImageAssetResult GetImageAssetReference(Data::Asset<ImageAsset>& imageAsset, AZStd::string_view materialSourceFilePath, const AZStd::string imageFilePath);
|
||||
|
||||
//! Resolve an enum to a uint32_t given its name and definition array (in MaterialPropertyDescriptor).
|
||||
//! @param propertyDescriptor it contains the definition of all enum names in an array.
|
||||
|
||||
@@ -29,6 +29,14 @@ namespace AZ
|
||||
Count
|
||||
};
|
||||
|
||||
namespace DefaultImageAssetPaths
|
||||
{
|
||||
static constexpr char DefaultFallback[] = "textures/defaults/defaultfallback.png.streamingimage";
|
||||
static constexpr char Processing[] = "textures/defaults/processing.png.streamingimage";
|
||||
static constexpr char ProcessingFailed[] = "textures/defaults/processingfailed.png.streamingimage";
|
||||
static constexpr char Missing[] = "textures/defaults/missing.png.streamingimage";
|
||||
}
|
||||
|
||||
class ImageSystemInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -63,11 +63,21 @@ namespace AZ
|
||||
{
|
||||
BusDisconnect();
|
||||
}
|
||||
|
||||
bool MaterialBuilder::ReportMaterialAssetWarningsAsErrors() const
|
||||
{
|
||||
bool warningsAsErrors = false;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(warningsAsErrors, "/O3DE/Atom/RPI/MaterialBuilder/WarningsAsErrors");
|
||||
}
|
||||
return warningsAsErrors;
|
||||
}
|
||||
|
||||
//! Adds all relevant dependencies for a referenced source file, considering that the path might be relative to the original file location or a full asset path.
|
||||
//! This will usually include multiple source dependencies and a single job dependency, but will include only source dependencies if the file is not found.
|
||||
//! Note the AssetBuilderSDK::JobDependency::m_platformIdentifier will not be set by this function. The calling code must set this value before passing back
|
||||
//! to the AssetBuilderSDK::CreateJobsResponse. If isOrderedOnceForMaterialTypes is true and the dependency is a materialtype file, the job dependency type
|
||||
//! to the AssetBuilderSDK::CreateJobsResponse. If isOrderedOnceForMaterialTypes is true and the dependency is a .materialtype file, the job dependency type
|
||||
//! will be set to JobDependencyType::OrderOnce.
|
||||
void AddPossibleDependencies(AZStd::string_view currentFilePath,
|
||||
AZStd::string_view referencedParentPath,
|
||||
@@ -277,8 +287,8 @@ namespace AZ
|
||||
|
||||
return materialTypeAssetOutcome.GetValue();
|
||||
}
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json)
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> MaterialBuilder::CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json) const
|
||||
{
|
||||
auto material = LoadSourceData<MaterialSourceData>(json, materialSourceFilePath);
|
||||
|
||||
@@ -292,7 +302,7 @@ namespace AZ
|
||||
return {};
|
||||
}
|
||||
|
||||
auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, true);
|
||||
auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, ReportMaterialAssetWarningsAsErrors());
|
||||
if (!materialAssetOutcome.IsSuccess())
|
||||
{
|
||||
return {};
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <AssetBuilderSDK/AssetBuilderBusses.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
||||
#include <AzCore/JSON/document.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -37,6 +39,9 @@ namespace AZ
|
||||
|
||||
private:
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json) const;
|
||||
bool ReportMaterialAssetWarningsAsErrors() const;
|
||||
|
||||
bool m_isShuttingDown = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzCore/IO/IOUtils.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -46,6 +47,12 @@ namespace AZ
|
||||
|
||||
AZStd::string ResolvePathReference(const AZStd::string& originatingSourceFilePath, const AZStd::string& referencedSourceFilePath)
|
||||
{
|
||||
// The IsAbsolute part prevents "second join parameter is an absolute path" warnings in StringFunc::Path::Join below
|
||||
if (referencedSourceFilePath.empty() || AZ::IO::PathView{referencedSourceFilePath}.IsAbsolute())
|
||||
{
|
||||
return referencedSourceFilePath;
|
||||
}
|
||||
|
||||
AZStd::string normalizedReferencedPath = referencedSourceFilePath;
|
||||
AzFramework::StringFunc::Path::Normalize(normalizedReferencedPath);
|
||||
|
||||
@@ -113,7 +120,7 @@ namespace AZ
|
||||
return results;
|
||||
}
|
||||
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& sourcePath, uint32_t productSubId)
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& sourcePath, uint32_t productSubId, TraceLevel reporting)
|
||||
{
|
||||
bool assetFound = false;
|
||||
AZ::Data::AssetInfo sourceInfo;
|
||||
@@ -122,7 +129,7 @@ namespace AZ
|
||||
|
||||
if (!assetFound)
|
||||
{
|
||||
AZ_Error("AssetUtils", false, "Could not find asset [%s]", sourcePath.c_str());
|
||||
AssetUtilsInternal::ReportIssue(reporting, AZStd::string::format("Could not find asset [%s]", sourcePath.c_str()).c_str());
|
||||
return AZ::Failure();
|
||||
}
|
||||
else
|
||||
@@ -131,10 +138,10 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId)
|
||||
Outcome<Data::AssetId> MakeAssetId(const AZStd::string& originatingSourcePath, const AZStd::string& referencedSourceFilePath, uint32_t productSubId, TraceLevel reporting)
|
||||
{
|
||||
AZStd::string resolvedPath = ResolvePathReference(originatingSourcePath, referencedSourceFilePath);
|
||||
return MakeAssetId(resolvedPath, productSubId);
|
||||
return MakeAssetId(resolvedPath, productSubId, reporting);
|
||||
}
|
||||
} // namespace AssetUtils
|
||||
} // namespace RPI
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace AZ
|
||||
MaterialPropertyId propertyId{ group.first, property.first };
|
||||
if (!property.second.m_value.IsValid())
|
||||
{
|
||||
AZ_Warning("Material source data", false, "Source data for material property value is invalid.");
|
||||
materialAssetCreator.ReportWarning("Source data for material property value is invalid.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -317,22 +317,20 @@ namespace AZ
|
||||
{
|
||||
case MaterialPropertyDataType::Image:
|
||||
{
|
||||
Outcome<Data::Asset<ImageAsset>> imageAssetResult = MaterialUtils::GetImageAssetReference(
|
||||
materialSourceFilePath, property.second.m_value.GetValue<AZStd::string>());
|
||||
Data::Asset<ImageAsset> imageAsset;
|
||||
|
||||
if (imageAssetResult.IsSuccess())
|
||||
MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference(
|
||||
imageAsset, materialSourceFilePath, property.second.m_value.GetValue<AZStd::string>());
|
||||
|
||||
if (result == MaterialUtils::GetImageAssetResult::Missing)
|
||||
{
|
||||
auto& imageAsset = imageAssetResult.GetValue();
|
||||
// Load referenced images when load material
|
||||
imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad);
|
||||
materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset);
|
||||
}
|
||||
else
|
||||
{
|
||||
materialAssetCreator.ReportError(
|
||||
materialAssetCreator.ReportWarning(
|
||||
"Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(),
|
||||
property.second.m_value.GetValue<AZStd::string>().data());
|
||||
}
|
||||
|
||||
imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad);
|
||||
materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset);
|
||||
}
|
||||
break;
|
||||
case MaterialPropertyDataType::Enum:
|
||||
|
||||
@@ -451,20 +451,21 @@ namespace AZ
|
||||
{
|
||||
case MaterialPropertyDataType::Image:
|
||||
{
|
||||
auto imageAssetResult = MaterialUtils::GetImageAssetReference(
|
||||
materialTypeSourceFilePath, property.m_value.GetValue<AZStd::string>());
|
||||
Data::Asset<ImageAsset> imageAsset;
|
||||
|
||||
if (imageAssetResult)
|
||||
{
|
||||
auto imageAsset = imageAssetResult.GetValue();
|
||||
materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset);
|
||||
}
|
||||
else
|
||||
MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference(
|
||||
imageAsset, materialTypeSourceFilePath, property.m_value.GetValue<AZStd::string>());
|
||||
|
||||
if (result == MaterialUtils::GetImageAssetResult::Missing)
|
||||
{
|
||||
materialTypeAssetCreator.ReportError(
|
||||
"Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(),
|
||||
property.m_value.GetValue<AZStd::string>().data());
|
||||
}
|
||||
else
|
||||
{
|
||||
materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MaterialPropertyDataType::Enum:
|
||||
|
||||
@@ -28,25 +28,36 @@ namespace AZ
|
||||
{
|
||||
namespace MaterialUtils
|
||||
{
|
||||
Outcome<Data::Asset<ImageAsset>> GetImageAssetReference(AZStd::string_view materialSourceFilePath, const AZStd::string imageFilePath)
|
||||
GetImageAssetResult GetImageAssetReference(Data::Asset<ImageAsset>& imageAsset, AZStd::string_view materialSourceFilePath, const AZStd::string imageFilePath)
|
||||
{
|
||||
imageAsset = {};
|
||||
|
||||
if (imageFilePath.empty())
|
||||
{
|
||||
// The image value was present but specified an empty string, meaning the texture asset should be explicitly cleared.
|
||||
return AZ::Success(Data::Asset<ImageAsset>());
|
||||
return GetImageAssetResult::Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
Outcome<Data::AssetId> imageAssetId = AssetUtils::MakeAssetId(materialSourceFilePath, imageFilePath, StreamingImageAsset::GetImageAssetSubId());
|
||||
// We use TraceLevel::None because fallback textures are available and we'll return GetImageAssetResult::Missing below in that case.
|
||||
// Callers of GetImageAssetReference will be responsible for logging warnings or errors as needed.
|
||||
|
||||
Outcome<Data::AssetId> imageAssetId = AssetUtils::MakeAssetId(materialSourceFilePath, imageFilePath, StreamingImageAsset::GetImageAssetSubId(), AssetUtils::TraceLevel::None);
|
||||
|
||||
if (!imageAssetId.IsSuccess())
|
||||
{
|
||||
return AZ::Failure();
|
||||
}
|
||||
else
|
||||
{
|
||||
Data::Asset<ImageAsset> unloadedImageAssetReference(imageAssetId.GetValue(), azrtti_typeid<StreamingImageAsset>(), imageFilePath);
|
||||
return AZ::Success(unloadedImageAssetReference);
|
||||
// When the AssetId cannot be found, we don't want to outright fail, because the runtime has mechanisms for displaying fallback textures which gives the
|
||||
// user a better recovery workflow. On the other hand we can't just provide an empty/invalid Asset<ImageAsset> because that would be interpreted as simply
|
||||
// no value was present and result in using no texture, and this would amount to a silent failure.
|
||||
// So we use a randomly generated (well except for the "BADA55E7" bit ;) UUID which the runtime and tools will interpret as a missing asset and represent
|
||||
// it as such.
|
||||
static const Uuid InvalidAssetPlaceholderId = "{BADA55E7-1A1D-4940-B655-9D08679BD62F}";
|
||||
imageAsset = Data::Asset<ImageAsset>{InvalidAssetPlaceholderId, azrtti_typeid<StreamingImageAsset>(), imageFilePath};
|
||||
return GetImageAssetResult::Missing;
|
||||
}
|
||||
|
||||
imageAsset = Data::Asset<ImageAsset>{imageAssetId.GetValue(), azrtti_typeid<StreamingImageAsset>(), imageFilePath};
|
||||
return GetImageAssetResult::Found;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImageAssetHandler.h>
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
#include <AzCore/Settings/SettingsRegistry.h>
|
||||
#include <AzFramework/Asset/AssetSystemBus.h>
|
||||
|
||||
@@ -52,7 +53,7 @@ namespace AZ
|
||||
missingAssetStatus, &AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById, asset.GetId().m_guid);
|
||||
|
||||
// Determine which fallback image to use
|
||||
const char* relativePath = "textures/defaults/defaultfallback.png.streamingimage";
|
||||
const char* relativePath = DefaultImageAssetPaths::DefaultFallback;
|
||||
|
||||
bool useDebugFallbackImages = true;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
@@ -66,15 +67,15 @@ namespace AZ
|
||||
{
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Queued:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiling:
|
||||
relativePath = "textures/defaults/processing.png.streamingimage";
|
||||
relativePath = DefaultImageAssetPaths::Processing;
|
||||
break;
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Failed:
|
||||
relativePath = "textures/defaults/processingfailed.png.streamingimage";
|
||||
relativePath = DefaultImageAssetPaths::ProcessingFailed;
|
||||
break;
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Missing:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Unknown:
|
||||
case AzFramework::AssetSystem::AssetStatus::AssetStatus_Compiled:
|
||||
relativePath = "textures/defaults/missing.png.streamingimage";
|
||||
relativePath = DefaultImageAssetPaths::Missing;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,12 +118,16 @@ namespace AZ
|
||||
else if (value.is<Data::Asset<Data::AssetData>>())
|
||||
{
|
||||
result.m_value = Data::Asset<RPI::ImageAsset>(
|
||||
AZStd::any_cast<Data::Asset<Data::AssetData>>(value).GetId(), azrtti_typeid<RPI::StreamingImageAsset>());
|
||||
AZStd::any_cast<Data::Asset<Data::AssetData>>(value).GetId(),
|
||||
azrtti_typeid<RPI::StreamingImageAsset>(),
|
||||
AZStd::any_cast<Data::Asset<Data::AssetData>>(value).GetHint());
|
||||
}
|
||||
else if (value.is<Data::Asset<StreamingImageAsset>>())
|
||||
{
|
||||
result.m_value = Data::Asset<RPI::ImageAsset>(
|
||||
AZStd::any_cast<Data::Asset<StreamingImageAsset>>(value).GetId(), azrtti_typeid<RPI::StreamingImageAsset>());
|
||||
AZStd::any_cast<Data::Asset<StreamingImageAsset>>(value).GetId(),
|
||||
azrtti_typeid<RPI::StreamingImageAsset>(),
|
||||
AZStd::any_cast<Data::Asset<StreamingImageAsset>>(value).GetHint());
|
||||
}
|
||||
else if (value.is<Data::Asset<ImageAsset>>())
|
||||
{
|
||||
|
||||
@@ -625,23 +625,6 @@ namespace UnitTest
|
||||
// We use local functions to easily start a new MaterialAssetCreator for each test case because
|
||||
// the AssetCreator would just skip subsequent operations after the first failure is detected.
|
||||
|
||||
auto expectError = [](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 2)
|
||||
{
|
||||
MaterialSourceData sourceData;
|
||||
|
||||
sourceData.m_materialType = "@exefolder@/Temp/test.materialtype";
|
||||
|
||||
AddPropertyGroup(sourceData, "general");
|
||||
|
||||
setOneBadInput(sourceData);
|
||||
|
||||
AZ_TEST_START_ASSERTTEST;
|
||||
auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", false);
|
||||
AZ_TEST_STOP_ASSERTTEST(expectedAsserts); // Usually one for the initial error, and one for when End() is called
|
||||
|
||||
EXPECT_FALSE(materialAssetOutcome.IsSuccess());
|
||||
};
|
||||
|
||||
auto expectWarning = [](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 1)
|
||||
{
|
||||
MaterialSourceData sourceData;
|
||||
@@ -692,10 +675,10 @@ namespace UnitTest
|
||||
});
|
||||
|
||||
// Missing image reference
|
||||
expectError([](MaterialSourceData& materialSourceData)
|
||||
expectWarning([](MaterialSourceData& materialSourceData)
|
||||
{
|
||||
AddProperty(materialSourceData, "general", "MyImage", AZStd::string("doesNotExist.streamingimage"));
|
||||
}, 3); // Expect a 3rd error because AssetUtils reports its own assertion failure
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -888,4 +888,43 @@ namespace UnitTest
|
||||
EXPECT_EQ(indexFromOldName, indexFromNewName);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void CheckPropertyValueRoundTrip(const T& value)
|
||||
{
|
||||
AZ::RPI::MaterialPropertyValue materialPropertyValue{value};
|
||||
AZStd::any anyValue{value};
|
||||
AZ::RPI::MaterialPropertyValue materialPropertyValueFromAny = MaterialPropertyValue::FromAny(anyValue);
|
||||
AZ::RPI::MaterialPropertyValue materialPropertyValueFromRoundTrip = MaterialPropertyValue::FromAny(MaterialPropertyValue::ToAny(materialPropertyValue));
|
||||
|
||||
EXPECT_EQ(materialPropertyValue, materialPropertyValueFromAny);
|
||||
EXPECT_EQ(materialPropertyValue, materialPropertyValueFromRoundTrip);
|
||||
|
||||
if (materialPropertyValue.Is<Data::Asset<ImageAsset>>())
|
||||
{
|
||||
EXPECT_EQ(materialPropertyValue.GetValue<Data::Asset<ImageAsset>>().GetHint(), materialPropertyValueFromAny.GetValue<Data::Asset<ImageAsset>>().GetHint());
|
||||
EXPECT_EQ(materialPropertyValue.GetValue<Data::Asset<ImageAsset>>().GetHint(), materialPropertyValueFromRoundTrip.GetValue<Data::Asset<ImageAsset>>().GetHint());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MaterialTests, TestMaterialPropertyValueAsAny)
|
||||
{
|
||||
CheckPropertyValueRoundTrip(true);
|
||||
CheckPropertyValueRoundTrip(false);
|
||||
CheckPropertyValueRoundTrip(7);
|
||||
CheckPropertyValueRoundTrip(8u);
|
||||
CheckPropertyValueRoundTrip(9.0f);
|
||||
CheckPropertyValueRoundTrip(AZ::Vector2(1.0f, 2.0f));
|
||||
CheckPropertyValueRoundTrip(AZ::Vector3(1.0f, 2.0f, 3.0f));
|
||||
CheckPropertyValueRoundTrip(AZ::Vector4(1.0f, 2.0f, 3.0f, 4.0f));
|
||||
CheckPropertyValueRoundTrip(AZ::Color(1.0f, 2.0f, 3.0f, 4.0f));
|
||||
CheckPropertyValueRoundTrip(Data::Asset<Data::AssetData>{});
|
||||
CheckPropertyValueRoundTrip(Data::Asset<ImageAsset>{});
|
||||
CheckPropertyValueRoundTrip(Data::Asset<StreamingImageAsset>{});
|
||||
CheckPropertyValueRoundTrip(Data::Asset<Data::AssetData>{Uuid::CreateRandom(), azrtti_typeid<AZ::RPI::StreamingImageAsset>(), "TestAssetPath.png"});
|
||||
CheckPropertyValueRoundTrip(Data::Asset<ImageAsset>{Uuid::CreateRandom(), azrtti_typeid<AZ::RPI::StreamingImageAsset>(), "TestAssetPath.png"});
|
||||
CheckPropertyValueRoundTrip(Data::Asset<StreamingImageAsset>{Uuid::CreateRandom(), azrtti_typeid<AZ::RPI::StreamingImageAsset>(), "TestAssetPath.png"});
|
||||
CheckPropertyValueRoundTrip(m_testImageAsset);
|
||||
CheckPropertyValueRoundTrip(Data::Instance<Image>{m_testImage});
|
||||
CheckPropertyValueRoundTrip(AZStd::string{"hello"});
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -26,6 +26,21 @@ namespace AtomToolsFramework
|
||||
//! Get the combined output of all messages
|
||||
AZStd::string GetDump() const;
|
||||
|
||||
//! Return the number of OnAssert calls
|
||||
size_t GetAssertCount() const;
|
||||
|
||||
//! Return the number of OnException calls
|
||||
size_t GetExceptionCount() const;
|
||||
|
||||
//! Return the number of OnError calls, and includes OnAssert and OnException if @includeHigher is true
|
||||
size_t GetErrorCount(bool includeHigher = false) const;
|
||||
|
||||
//! Return the number of OnWarning calls, and includes higher categories if @includeHigher is true
|
||||
size_t GetWarningCount(bool includeHigher = false) const;
|
||||
|
||||
//! Return the number of OnPrintf calls, and includes higher categories if @includeHigher is true
|
||||
size_t GetPrintfCount(bool includeHigher = false) const;
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Debug::TraceMessageBus::Handler overrides...
|
||||
@@ -38,5 +53,11 @@ namespace AtomToolsFramework
|
||||
|
||||
size_t m_maxMessageCount = std::numeric_limits<size_t>::max();
|
||||
AZStd::list<AZStd::string> m_messages;
|
||||
|
||||
size_t m_assertCount = 0;
|
||||
size_t m_exceptionCount = 0;
|
||||
size_t m_errorCount = 0;
|
||||
size_t m_warningCount = 0;
|
||||
size_t m_printfCount = 0;
|
||||
};
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
+1
@@ -49,6 +49,7 @@ namespace AtomToolsFramework
|
||||
//! @param propertyValue the value being converted before saving
|
||||
bool ConvertToExportFormat(
|
||||
const AZStd::string& exportPath,
|
||||
[[maybe_unused]] const AZ::Name& propertyId,
|
||||
const AZ::RPI::MaterialTypeSourceData::PropertyDefinition& propertyDefinition,
|
||||
AZ::RPI::MaterialPropertyValue& propertyValue);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace AtomToolsFramework
|
||||
|
||||
bool TraceRecorder::OnAssert(const char* message)
|
||||
{
|
||||
++m_assertCount;
|
||||
if (m_messages.size() < m_maxMessageCount)
|
||||
{
|
||||
m_messages.push_back(AZStd::string::format("Assert: %s", message));
|
||||
@@ -40,6 +41,7 @@ namespace AtomToolsFramework
|
||||
|
||||
bool TraceRecorder::OnException(const char* message)
|
||||
{
|
||||
++m_exceptionCount;
|
||||
if (m_messages.size() < m_maxMessageCount)
|
||||
{
|
||||
m_messages.push_back(AZStd::string::format("Exception: %s", message));
|
||||
@@ -49,6 +51,7 @@ namespace AtomToolsFramework
|
||||
|
||||
bool TraceRecorder::OnError(const char* /*window*/, const char* message)
|
||||
{
|
||||
++m_errorCount;
|
||||
if (m_messages.size() < m_maxMessageCount)
|
||||
{
|
||||
m_messages.push_back(AZStd::string::format("Error: %s", message));
|
||||
@@ -58,6 +61,7 @@ namespace AtomToolsFramework
|
||||
|
||||
bool TraceRecorder::OnWarning(const char* /*window*/, const char* message)
|
||||
{
|
||||
++m_warningCount;
|
||||
if (m_messages.size() < m_maxMessageCount)
|
||||
{
|
||||
m_messages.push_back(AZStd::string::format("Warning: %s", message));
|
||||
@@ -67,11 +71,58 @@ namespace AtomToolsFramework
|
||||
|
||||
bool TraceRecorder::OnPrintf(const char* /*window*/, const char* message)
|
||||
{
|
||||
++m_printfCount;
|
||||
if (m_messages.size() < m_maxMessageCount)
|
||||
{
|
||||
m_messages.push_back(AZStd::string::format("%s", message));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t TraceRecorder::GetAssertCount() const
|
||||
{
|
||||
return m_assertCount;
|
||||
}
|
||||
|
||||
size_t TraceRecorder::GetExceptionCount() const
|
||||
{
|
||||
return m_exceptionCount;
|
||||
}
|
||||
|
||||
size_t TraceRecorder::GetErrorCount(bool includeHigher) const
|
||||
{
|
||||
if (includeHigher)
|
||||
{
|
||||
return m_errorCount + GetAssertCount() + GetExceptionCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_errorCount;
|
||||
}
|
||||
}
|
||||
|
||||
size_t TraceRecorder::GetWarningCount(bool includeHigher) const
|
||||
{
|
||||
if (includeHigher)
|
||||
{
|
||||
return m_warningCount + GetErrorCount(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_warningCount;
|
||||
}
|
||||
}
|
||||
|
||||
size_t TraceRecorder::GetPrintfCount(bool includeHigher) const
|
||||
{
|
||||
if (includeHigher)
|
||||
{
|
||||
return m_printfCount + GetWarningCount(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_printfCount;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
+6
-2
@@ -495,8 +495,6 @@ namespace AtomToolsFramework
|
||||
return AZ::Uuid::CreateNull();
|
||||
}
|
||||
|
||||
traceRecorder.GetDump().clear();
|
||||
|
||||
bool openResult = false;
|
||||
AtomToolsDocumentRequestBus::EventResult(openResult, documentId, &AtomToolsDocumentRequestBus::Events::Open, requestedPath);
|
||||
if (!openResult)
|
||||
@@ -507,6 +505,12 @@ namespace AtomToolsFramework
|
||||
AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsDocumentSystemRequestBus::Events::DestroyDocument, documentId);
|
||||
return AZ::Uuid::CreateNull();
|
||||
}
|
||||
else if (traceRecorder.GetWarningCount(true) > 0)
|
||||
{
|
||||
QMessageBox::warning(
|
||||
QApplication::activeWindow(), QString("Document opened with warnings"),
|
||||
QString("Warnings encountered: \n%1\n\n%2").arg(requestedPath.c_str()).arg(traceRecorder.GetDump().c_str()));
|
||||
}
|
||||
|
||||
return documentId;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ namespace AtomToolsFramework
|
||||
|
||||
bool ConvertToExportFormat(
|
||||
const AZStd::string& exportPath,
|
||||
[[maybe_unused]] const AZ::Name& propertyId,
|
||||
const AZ::RPI::MaterialTypeSourceData::PropertyDefinition& propertyDefinition,
|
||||
AZ::RPI::MaterialPropertyValue& propertyValue)
|
||||
{
|
||||
@@ -175,7 +176,7 @@ namespace AtomToolsFramework
|
||||
const uint32_t index = propertyValue.GetValue<uint32_t>();
|
||||
if (index >= propertyDefinition.m_enumValues.size())
|
||||
{
|
||||
AZ_Error("AtomToolsFramework", false, "Invalid value for material enum property: '%s'.", propertyDefinition.m_name.c_str());
|
||||
AZ_Error("AtomToolsFramework", false, "Invalid value for material enum property: '%s'.", propertyId.GetCStr());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -186,18 +187,33 @@ namespace AtomToolsFramework
|
||||
// Image asset references must be converted from asset IDs to a relative source file path
|
||||
if (propertyDefinition.m_dataType == AZ::RPI::MaterialPropertyDataType::Image)
|
||||
{
|
||||
AZStd::string imagePath;
|
||||
AZ::Data::AssetId imageAssetId;
|
||||
|
||||
if (propertyValue.Is<AZ::Data::Asset<AZ::RPI::ImageAsset>>())
|
||||
{
|
||||
const auto& imageAsset = propertyValue.GetValue<AZ::Data::Asset<AZ::RPI::ImageAsset>>();
|
||||
const auto& imagePath = AZ::RPI::AssetUtils::GetSourcePathByAssetId(imageAsset.GetId());
|
||||
propertyValue = GetExteralReferencePath(exportPath, imagePath);
|
||||
return true;
|
||||
imageAssetId = imageAsset.GetId();
|
||||
}
|
||||
|
||||
if (propertyValue.Is<AZ::Data::Instance<AZ::RPI::Image>>())
|
||||
{
|
||||
const auto& image = propertyValue.GetValue<AZ::Data::Instance<AZ::RPI::Image>>();
|
||||
const auto& imagePath = image ? AZ::RPI::AssetUtils::GetSourcePathByAssetId(image->GetAssetId()) : "";
|
||||
if (image)
|
||||
{
|
||||
imageAssetId = image->GetAssetId();
|
||||
}
|
||||
}
|
||||
|
||||
imagePath = AZ::RPI::AssetUtils::GetSourcePathByAssetId(imageAssetId);
|
||||
|
||||
if (imageAssetId.IsValid() && imagePath.empty())
|
||||
{
|
||||
AZ_Error("AtomToolsFramework", false, "Image asset could not be found for property: '%s'.", propertyId.GetCStr());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyValue = GetExteralReferencePath(exportPath, imagePath);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <Atom/RPI.Edit/Material/MaterialPropertyId.h>
|
||||
#include <Atom/RPI.Edit/Material/MaterialUtils.h>
|
||||
#include <Atom/RPI.Public/Material/Material.h>
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
#include <Atom/RPI.Reflect/Image/Image.h>
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialFunctor.h>
|
||||
@@ -594,7 +595,7 @@ namespace MaterialEditor
|
||||
MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue());
|
||||
if (propertyValue.IsValid())
|
||||
{
|
||||
if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyDefinition, propertyValue))
|
||||
if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId.GetFullName(), propertyDefinition, propertyValue))
|
||||
{
|
||||
AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetFullName().GetCStr(), m_absolutePath.c_str());
|
||||
result = false;
|
||||
@@ -708,6 +709,8 @@ namespace MaterialEditor
|
||||
AZ_Error("MaterialDocument", false, "Material document extension not supported: '%s'.", m_absolutePath.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool elevateWarnings = false;
|
||||
|
||||
// In order to support automation, general usability, and 'save as' functionality, the user must not have to wait
|
||||
// for their JSON file to be cooked by the asset processor before opening or editing it.
|
||||
@@ -716,7 +719,7 @@ namespace MaterialEditor
|
||||
// Long term, the material document should not be concerned with assets at all. The viewport window should be the
|
||||
// only thing concerned with assets or instances.
|
||||
auto materialAssetResult =
|
||||
m_materialSourceData.CreateMaterialAssetFromSourceData(Uuid::CreateRandom(), m_absolutePath, true, true, &m_sourceDependencies);
|
||||
m_materialSourceData.CreateMaterialAssetFromSourceData(Uuid::CreateRandom(), m_absolutePath, elevateWarnings, true, &m_sourceDependencies);
|
||||
if (!materialAssetResult)
|
||||
{
|
||||
AZ_Error("MaterialDocument", false, "Material asset could not be created from source data: '%s'.", m_absolutePath.c_str());
|
||||
@@ -754,7 +757,7 @@ namespace MaterialEditor
|
||||
AZ_Error("MaterialDocument", false, "Material parent asset ID could not be created: '%s'.", m_materialSourceData.m_parentMaterial.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
auto parentMaterialAssetResult = parentMaterialSourceData.CreateMaterialAssetFromSourceData(
|
||||
parentMaterialAssetIdResult.GetValue(), m_materialSourceData.m_parentMaterial, true, true);
|
||||
if (!parentMaterialAssetResult)
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ namespace AZ
|
||||
propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second);
|
||||
}
|
||||
|
||||
if (!AtomToolsFramework::ConvertToExportFormat(path, propertyDefinition, propertyValue))
|
||||
if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId.GetFullName(), propertyDefinition, propertyValue))
|
||||
{
|
||||
AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str());
|
||||
result = false;
|
||||
|
||||
Reference in New Issue
Block a user