Fix path not showing up in asset property control (#1037)

This commit is contained in:
michabr
2021-05-28 13:40:08 -07:00
committed by GitHub
parent 0fd69d6d0c
commit aedc270304
2 changed files with 13 additions and 7 deletions
@@ -953,11 +953,16 @@ namespace AzToolsFramework
return;
}
const AZ::Data::AssetId assetID = GetCurrentAssetID();
m_currentAssetHint = "";
if (!m_unnamedType)
const AZStd::string& folderPath = GetFolderSelection();
if (!folderPath.empty())
{
m_currentAssetHint = folderPath;
}
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);
@@ -971,7 +976,7 @@ namespace AzToolsFramework
if (!jobs.empty())
{
// The default behavior is show to the source filename.
// The default behavior is to show the source filename.
assetPath = jobs[0].m_sourceFile;
AZStd::string errorLog;
@@ -158,7 +158,10 @@ bool PropertyHandlerDirectory::ReadValuesIntoGUI(size_t index, PropertyDirectory
ctrl->blockSignals(true);
{
// Set currently selected folder path
// Note: this must be done before setting asset type below which updates the GUI display
ctrl->SetCurrentAssetHint(instance);
ctrl->SetFolderSelection(instance);
// We need to set the asset type so the property panel labels get
// populated properly (via SetCurrentAssetType). To avoid defining
@@ -166,8 +169,6 @@ bool PropertyHandlerDirectory::ReadValuesIntoGUI(size_t index, PropertyDirectory
// logic to run (otherwise it will early-out due to invalid asset type).
const char* throwAwayAssetType = "{43EDD212-F589-43C8-BC02-A8F9243271CB}";
ctrl->SetCurrentAssetType(AZ::Data::AssetType(throwAwayAssetType));
ctrl->SetFolderSelection(instance);
}
ctrl->blockSignals(false);