Mesh Component: Add button to the Mesh Asset field to open mesh FBX settings (#7547)
This is an UX improvement for Mesh Component as the user can quickly access FBX settings of the mesh to modify it if they so desire. Video https://user-images.githubusercontent.com/27999040/153414278-f7996b9a-8a28-49d4-92a8-daeb9924b148.mp4 Signed-off-by: moraaar moraaar@amazon.com
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -35,6 +36,15 @@ namespace AZ
|
||||
->Field("MaterialSlots", &ModelAsset::m_materialSlots)
|
||||
->Field("LodAssets", &ModelAsset::m_lodAssets)
|
||||
;
|
||||
|
||||
// Note: This class needs to have edit context reflection so PropertyAssetCtrl::OnEditButtonClicked
|
||||
// can open the asset with the preferred asset editor (Scene Settings).
|
||||
if (auto* editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<ModelAsset>("Model Asset", "")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user