Updated editor material component slots to support dynamic previews rendered with property overrides applied
Fixed scaling issues with labels used for images Reduced updating previews and material component inspector to only apply after a value is committed Storing cache of previously rendered material previews Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
+14
@@ -148,11 +148,13 @@ namespace AZ
|
||||
BaseClass::Activate();
|
||||
MaterialReceiverNotificationBus::Handler::BusConnect(GetEntityId());
|
||||
MaterialComponentNotificationBus::Handler::BusConnect(GetEntityId());
|
||||
EditorMaterialSystemComponentNotificationBus::Handler::BusConnect();
|
||||
UpdateMaterialSlots();
|
||||
}
|
||||
|
||||
void EditorMaterialComponent::Deactivate()
|
||||
{
|
||||
EditorMaterialSystemComponentNotificationBus::Handler::BusDisconnect();
|
||||
MaterialReceiverNotificationBus::Handler::BusDisconnect();
|
||||
MaterialComponentNotificationBus::Handler::BusDisconnect();
|
||||
BaseClass::Deactivate();
|
||||
@@ -260,6 +262,18 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void EditorMaterialComponent::OnRenderMaterialPreviewComplete(
|
||||
[[maybe_unused]] const AZ::EntityId& entityId,
|
||||
[[maybe_unused]] const AZ::Render::MaterialAssignmentId& materialAssignmentId,
|
||||
[[maybe_unused]] const QPixmap& pixmap)
|
||||
{
|
||||
if (entityId == GetEntityId())
|
||||
{
|
||||
AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(
|
||||
&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues);
|
||||
}
|
||||
}
|
||||
|
||||
AZ::u32 EditorMaterialComponent::OnConfigurationChanged()
|
||||
{
|
||||
return AZ::Edit::PropertyRefreshLevels::AttributesAndValues;
|
||||
|
||||
Reference in New Issue
Block a user