Merge branch 'main' into Prefab/CreatePrefab
This commit is contained in:
+1
-1
@@ -36,4 +36,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using EditorAnimationSystemRequestsBus = AZ::EBus<EditorAnimationSystemRequests>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,4 +52,4 @@ namespace AzToolsFramework
|
||||
|
||||
using EntityCompositionNotificationBus = AZ::EBus<EntityCompositionNotifications>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,6 +348,11 @@ namespace AzToolsFramework
|
||||
*/
|
||||
virtual bool AreAnyEntitiesSelected() = 0;
|
||||
|
||||
/*!
|
||||
* Returns the number of selected entities.
|
||||
*/
|
||||
virtual int GetSelectedEntitiesCount() = 0;
|
||||
|
||||
/*!
|
||||
* Retrieves the set of selected entities.
|
||||
* \return a list of entity Ids.
|
||||
|
||||
@@ -57,4 +57,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "Application/moc_Ticker.cpp"
|
||||
#include "Application/moc_Ticker.cpp"
|
||||
|
||||
@@ -55,4 +55,4 @@ namespace AzToolsFramework
|
||||
float m_timeoutMS;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,6 +395,7 @@ namespace AzToolsFramework
|
||||
->Event("MarkEntityDeselected", &ToolsApplicationRequests::MarkEntityDeselected)
|
||||
->Event("IsSelected", &ToolsApplicationRequests::IsSelected)
|
||||
->Event("AreAnyEntitiesSelected", &ToolsApplicationRequests::AreAnyEntitiesSelected)
|
||||
->Event("GetSelectedEntitiesCount", &ToolsApplicationRequests::GetSelectedEntitiesCount)
|
||||
;
|
||||
|
||||
behaviorContext->EBus<ToolsApplicationNotificationBus>("ToolsApplicationNotificationBus")
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace AzToolsFramework
|
||||
SourceControlFileInfo GetSceneSourceControlInfo() override;
|
||||
|
||||
bool AreAnyEntitiesSelected() override { return !m_selectedEntities.empty(); }
|
||||
int GetSelectedEntitiesCount() override { return m_selectedEntities.size(); }
|
||||
const EntityIdList& GetSelectedEntities() override { return m_selectedEntities; }
|
||||
const EntityIdList& GetHighlightedEntities() override { return m_highlightedEntities; }
|
||||
void SetSelectedEntities(const EntityIdList& selectedEntities) override;
|
||||
|
||||
@@ -165,4 +165,4 @@ namespace AzToolsFramework
|
||||
AZ::Data::AssetId m_assetId;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -75,4 +75,4 @@ namespace AzToolsFramework
|
||||
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -76,4 +76,4 @@ namespace AzToolsFramework
|
||||
QString m_title;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -283,4 +283,4 @@ namespace AzToolsFramework
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "AssetBrowser/Entries/moc_AssetBrowserEntry.cpp"
|
||||
#include "AssetBrowser/Entries/moc_AssetBrowserEntry.cpp"
|
||||
|
||||
+1
-1
@@ -69,4 +69,4 @@ namespace AzToolsFramework
|
||||
m_absolutePathToFileId.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,4 +55,4 @@ namespace AzToolsFramework
|
||||
AZ_DISABLE_COPY_MOVE(FolderAssetBrowserEntry);
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -63,4 +63,4 @@ namespace AzToolsFramework
|
||||
AZ_DISABLE_COPY_MOVE(ProductAssetBrowserEntry);
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -95,4 +95,4 @@ namespace AzToolsFramework
|
||||
bool m_isInitialUpdate = false;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -80,4 +80,4 @@ namespace AzToolsFramework
|
||||
AZ_DISABLE_COPY_MOVE(SourceAssetBrowserEntry);
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -47,4 +47,4 @@ namespace AzToolsFramework
|
||||
QScopedPointer<Ui::EmptyPreviewerClass> m_ui;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -23,4 +23,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include <AssetBrowser/Previewer/moc_Previewer.cpp>
|
||||
#include <AssetBrowser/Previewer/moc_Previewer.cpp>
|
||||
|
||||
+1
-1
@@ -44,4 +44,4 @@ namespace AzToolsFramework
|
||||
|
||||
using PreviewerRequestBus = AZ::EBus<PreviewerRequests>;
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -34,4 +34,4 @@ namespace AzToolsFramework
|
||||
virtual const QString& GetName() const = 0;
|
||||
};
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -613,4 +613,4 @@ namespace AzToolsFramework
|
||||
} // namespace AssetBrowser
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "AssetBrowser/Search/moc_Filter.cpp"
|
||||
#include "AssetBrowser/Search/moc_Filter.cpp"
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 949 B |
@@ -8,4 +8,4 @@
|
||||
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
|
||||
<path d="M20.9694824,19.6604004 L16.3757324,15.0666504 C17.4069824,13.7541504 17.9694824,12.1604004 17.9694824,10.4729004 C17.9694824,6.34790039 14.5944824,2.97290039 10.4694824,2.97290039 C6.34448242,2.97290039 2.96948242,6.34790039 2.96948242,10.4729004 C2.96948242,14.5979004 6.34448242,17.9729004 10.4694824,17.9729004 C12.1569824,17.9729004 13.7507324,17.4104004 15.0632324,16.3791504 L19.6569824,20.9729004 L20.9694824,19.6604004 Z M10.4694824,16.0979004 C7.37573242,16.0979004 4.84448242,13.5666504 4.84448242,10.4729004 C4.84448242,7.37915039 7.37573242,4.84790039 10.4694824,4.84790039 C13.5632324,4.84790039 16.0944824,7.37915039 16.0944824,10.4729004 C16.0944824,13.5666504 13.5632324,16.0979004 10.4694824,16.0979004 Z" id="Shape" fill="#E9E9E9" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
+5
-2
@@ -139,8 +139,11 @@ namespace AzToolsFramework
|
||||
}
|
||||
else
|
||||
{
|
||||
QPixmap pixmap = thumbnail->GetPixmap(size);
|
||||
painter->drawPixmap(point, pixmap.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
// Scaling and centering pixmap within bounds to preserve aspect ratio
|
||||
const QPixmap pixmap = thumbnail->GetPixmap(size).scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
const QSize sizeDelta = size - pixmap.size();
|
||||
const QPoint pointDelta = QPoint(sizeDelta.width() / 2, sizeDelta.height() / 2);
|
||||
painter->drawPixmap(point + pointDelta, pixmap);
|
||||
}
|
||||
return m_iconSize;
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace AzToolsFramework
|
||||
AzToolsFrameworkModule();
|
||||
~AzToolsFrameworkModule() override = default;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,4 +72,4 @@ namespace AzToolsFramework
|
||||
m_componentModeBuilders, m_transition);
|
||||
}
|
||||
} // namespace ComponentModeFramework
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -50,4 +50,4 @@ namespace AzToolsFramework
|
||||
Transition m_transition; ///< Entering/Leaving ComponentMode.
|
||||
};
|
||||
} // namespace ComponentModeFramework
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -105,4 +105,4 @@ namespace AzToolsFramework
|
||||
return PivotHasTranslationOverride(pivotOverride) || PivotHasOrientationOverride(pivotOverride);
|
||||
}
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -103,4 +103,4 @@ namespace AzToolsFramework
|
||||
bool PivotHasOrientationOverride(AZ::u8 pivotOverride);
|
||||
bool PivotHasTransformOverride(AZ::u8 pivotOverride);
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -32,4 +32,4 @@ namespace AzToolsFramework
|
||||
{
|
||||
m_boxEdit.UpdateManipulators();
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -40,4 +40,4 @@ namespace AzToolsFramework
|
||||
private:
|
||||
BoxViewportEdit m_boxEdit;
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -183,4 +183,4 @@ namespace AzToolsFramework
|
||||
} // Debug
|
||||
} // AzToolsFramework
|
||||
|
||||
#endif // AZ_ENABLE_TRACE_CONTEXT
|
||||
#endif // AZ_ENABLE_TRACE_CONTEXT
|
||||
|
||||
+1
-1
@@ -20,4 +20,4 @@ namespace AzToolsFramework
|
||||
return Print(buffer, size, stack, printUuids, startIndex);
|
||||
}
|
||||
} // Debug
|
||||
} // AzToolsFramework
|
||||
} // AzToolsFramework
|
||||
|
||||
+1
-1
@@ -37,4 +37,4 @@ namespace AzToolsFramework
|
||||
|
||||
using EditorEntityContextPickingRequestBus = AZ::EBus<EditorEntityContextPickingRequests>;
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -36,4 +36,4 @@ namespace AzToolsFramework
|
||||
void OnSliceEntitiesLoaded(const AZStd::vector<AZ::Entity*>& entities) override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace AzToolsFramework
|
||||
virtual void RemoveFromChildrenWithOverrides(const EntityIdList& parentEntityIds, const AZ::EntityId& entityId) = 0;
|
||||
};
|
||||
using EditorEntityModelRequestBus = AZ::EBus<EditorEntityModelRequests>;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-1
@@ -31,11 +31,19 @@ namespace AzToolsFramework
|
||||
//! /param entities The entities to put under the new prefab.
|
||||
//! /param nestedPrefabInstances The nested prefab instances to put under the new prefab.
|
||||
//! /param filePath The filepath corresponding to the prefab file to be created.
|
||||
//! /param instanceToParentUnder The instance under which the newly created prefab instance is parented under.
|
||||
//! /param instanceToParentUnder The instance the newly created prefab instance is parented under.
|
||||
//! /return The optional reference to the prefab created.
|
||||
virtual Prefab::InstanceOptionalReference CreatePrefab(
|
||||
const AZStd::vector<AZ::Entity*>& entities, AZStd::vector<AZStd::unique_ptr<Prefab::Instance>>&& nestedPrefabInstances,
|
||||
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
|
||||
|
||||
//! Instantiate the prefab file provided.
|
||||
//! /param filePath The filepath for the prefab file the instance should be created from.
|
||||
//! /param instanceToParentUnder The instance the newly instantiated prefab instance is parented under.
|
||||
//! /return The optional reference to the prefab instance.
|
||||
virtual Prefab::InstanceOptionalReference InstantiatePrefab(
|
||||
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
|
||||
|
||||
virtual Prefab::InstanceOptionalReference GetRootPrefabInstance() = 0;
|
||||
|
||||
virtual bool LoadFromStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) = 0;
|
||||
|
||||
+21
-13
@@ -19,6 +19,7 @@
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h>
|
||||
#include <AzToolsFramework/Prefab/EditorPrefabComponent.h>
|
||||
#include <AzToolsFramework/Prefab/Instance/InstanceEntityMapperInterface.h>
|
||||
#include <AzToolsFramework/Prefab/Instance/Instance.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabDomUtils.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabLoader.h>
|
||||
@@ -241,19 +242,6 @@ namespace AzToolsFramework
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The template is already loaded, this is the case of either saving as same name or different name(loaded from before).
|
||||
// Update the template with the changes
|
||||
AzToolsFramework::Prefab::PrefabDom dom;
|
||||
bool success = AzToolsFramework::Prefab::PrefabDomUtils::StoreInstanceInPrefabDom(*m_rootInstance, dom);
|
||||
if (!success)
|
||||
{
|
||||
AZ_Error("Prefab", false, "Failed to convert current root instance into a DOM when saving file '%.*s'", AZ_STRING_ARG(filename));
|
||||
return false;
|
||||
}
|
||||
m_prefabSystemComponent->UpdatePrefabTemplate(templateId, dom);
|
||||
}
|
||||
|
||||
Prefab::TemplateId prevTemplateId = m_rootInstance->GetTemplateId();
|
||||
m_rootInstance->SetTemplateId(templateId);
|
||||
@@ -307,6 +295,26 @@ namespace AzToolsFramework
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
|
||||
Prefab::InstanceOptionalReference PrefabEditorEntityOwnershipService::InstantiatePrefab(
|
||||
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder)
|
||||
{
|
||||
AZStd::unique_ptr<Prefab::Instance> createdPrefabInstance = m_prefabSystemComponent->InstantiatePrefab(filePath);
|
||||
|
||||
if (createdPrefabInstance)
|
||||
{
|
||||
if (!instanceToParentUnder)
|
||||
{
|
||||
instanceToParentUnder = *m_rootInstance;
|
||||
}
|
||||
|
||||
Prefab::Instance& addedInstance = instanceToParentUnder->get().AddInstance(AZStd::move(createdPrefabInstance));
|
||||
HandleEntitiesAdded({addedInstance.m_containerEntity.get()});
|
||||
return addedInstance;
|
||||
}
|
||||
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
|
||||
Prefab::InstanceOptionalReference PrefabEditorEntityOwnershipService::GetRootPrefabInstance()
|
||||
{
|
||||
AZ_Assert(m_rootInstance, "A valid root prefab instance couldn't be found in PrefabEditorEntityOwnershipService.");
|
||||
|
||||
+3
@@ -191,6 +191,9 @@ namespace AzToolsFramework
|
||||
const AZStd::vector<AZ::Entity*>& entities, AZStd::vector<AZStd::unique_ptr<Prefab::Instance>>&& nestedPrefabInstances,
|
||||
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder) override;
|
||||
|
||||
Prefab::InstanceOptionalReference InstantiatePrefab(
|
||||
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder) override;
|
||||
|
||||
Prefab::InstanceOptionalReference GetRootPrefabInstance() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
+1
-1
@@ -48,4 +48,4 @@ namespace AzToolsFramework
|
||||
|
||||
/// Type to inherit to implement BoxManipulatorRequests
|
||||
using BoxManipulatorRequestBus = AZ::EBus<BoxManipulatorRequests>;
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -40,4 +40,4 @@ namespace AzToolsFramework
|
||||
|
||||
using MaterialBrowserRequestBus = AZ::EBus<MaterialBrowserRequests>;
|
||||
} // namespace MaterialBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -38,4 +38,4 @@ namespace AzToolsFramework
|
||||
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
||||
};
|
||||
} // namespace MaterialBrowser
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -216,4 +216,4 @@ namespace AzToolsFramework
|
||||
///< intersecting point.
|
||||
};
|
||||
} // namespace Picking
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -52,4 +52,4 @@ namespace AzToolsFramework
|
||||
RegisteredBoundId m_nextBoundId = RegisteredBoundId(1); ///< Next bound id to use when a bound is registered.
|
||||
};
|
||||
} // namespace Picking
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabPublicInterface.h>
|
||||
#include <AzToolsFramework/UI/EditorEntityUi/EditorEntityUiInterface.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerWidgetInterface.h>
|
||||
#include <AzToolsFramework/UI/Prefab/PrefabIntegrationBus.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ namespace AzToolsFramework
|
||||
}
|
||||
|
||||
return context.Report(result,
|
||||
result.GetProcessing() == JSR::Processing::Completed ? "Succesfully loaded instance information for prefab." :
|
||||
result.GetProcessing() == JSR::Processing::Completed ? "Successfully loaded instance information for prefab." :
|
||||
"Failed to load instance information for prefab");
|
||||
}
|
||||
|
||||
|
||||
+6
-20
@@ -21,9 +21,9 @@
|
||||
#include <AzToolsFramework/Prefab/Instance/TemplateInstanceMapperInterface.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabDomUtils.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabPublicInterface.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabPublicNotificationBus.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabSystemComponentInterface.h>
|
||||
#include <AzToolsFramework/Prefab/Template/Template.h>
|
||||
#include <AzToolsFramework/UI/Outliner/EntityOutlinerWidgetInterface.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
@@ -90,17 +90,13 @@ namespace AzToolsFramework
|
||||
|
||||
if (instanceCountToUpdateInBatch > 0)
|
||||
{
|
||||
// Notify Propagation has begun
|
||||
PrefabPublicNotificationBus::Broadcast(&PrefabPublicNotifications::OnPrefabInstancePropagationBegin);
|
||||
|
||||
EntityIdList selectedEntityIds;
|
||||
ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
|
||||
ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequests::SetSelectedEntities, EntityIdList());
|
||||
|
||||
// Disable the Outliner to avoid showing the propagation steps
|
||||
EntityOutlinerWidgetInterface* entityOutlinerWidgetInterface = AZ::Interface<EntityOutlinerWidgetInterface>::Get();
|
||||
if (entityOutlinerWidgetInterface)
|
||||
{
|
||||
entityOutlinerWidgetInterface->SetUpdatesEnabled(false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < instanceCountToUpdateInBatch; ++i)
|
||||
{
|
||||
Instance* instanceToUpdate = m_instancesUpdateQueue.front();
|
||||
@@ -168,18 +164,8 @@ namespace AzToolsFramework
|
||||
}
|
||||
ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequests::SetSelectedEntities, selectedEntityIds);
|
||||
|
||||
// Enable the Outliner
|
||||
if (entityOutlinerWidgetInterface)
|
||||
{
|
||||
entityOutlinerWidgetInterface->SetUpdatesEnabled(true);
|
||||
|
||||
auto prefabPublicInterface = AZ::Interface<PrefabPublicInterface>::Get();
|
||||
if (prefabPublicInterface)
|
||||
{
|
||||
AZ::EntityId rootEntityId = prefabPublicInterface->GetLevelInstanceContainerEntityId();
|
||||
entityOutlinerWidgetInterface->ExpandEntityChildren(rootEntityId);
|
||||
}
|
||||
}
|
||||
// Notify Propagation has ended
|
||||
PrefabPublicNotificationBus::Broadcast(&PrefabPublicNotifications::OnPrefabInstancePropagationEnd);
|
||||
}
|
||||
|
||||
m_updatingTemplateInstancesInQueue = false;
|
||||
|
||||
@@ -228,6 +228,10 @@ namespace AzToolsFramework
|
||||
AZ_Assert(instanceDom.IsObject(), "Link Id '%u' cannot be added because the DOM of the instance is not an object.", m_id);
|
||||
instanceDom.AddMember(rapidjson::StringRef(PrefabDomUtils::LinkIdName), rapidjson::Value().SetUint64(m_id), allocator);
|
||||
}
|
||||
else
|
||||
{
|
||||
linkIdReference->get().SetUint64(m_id);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Prefab
|
||||
|
||||
@@ -161,6 +161,61 @@ namespace AzToolsFramework
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::InstantiatePrefab(
|
||||
AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position)
|
||||
{
|
||||
auto prefabEditorEntityOwnershipInterface = AZ::Interface<PrefabEditorEntityOwnershipInterface>::Get();
|
||||
if (!prefabEditorEntityOwnershipInterface)
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Could not instantiate prefab - internal error "
|
||||
"(PrefabEditorEntityOwnershipInterface unavailable)."));
|
||||
}
|
||||
|
||||
InstanceOptionalReference instanceToParentUnder;
|
||||
|
||||
// Get parent entity and owning instance
|
||||
if (parent.IsValid())
|
||||
{
|
||||
instanceToParentUnder = m_instanceEntityMapperInterface->FindOwningInstance(parent);
|
||||
}
|
||||
|
||||
if (!instanceToParentUnder.has_value())
|
||||
{
|
||||
instanceToParentUnder = prefabEditorEntityOwnershipInterface->GetRootPrefabInstance();
|
||||
parent = instanceToParentUnder->get().GetContainerEntityId();
|
||||
}
|
||||
|
||||
{
|
||||
// Initialize Undo Batch object
|
||||
ScopedUndoBatch undoBatch("Instantiate Prefab");
|
||||
|
||||
PrefabDom instanceToParentUnderDomBeforeCreate;
|
||||
m_instanceToTemplateInterface->GenerateDomForInstance(
|
||||
instanceToParentUnderDomBeforeCreate, instanceToParentUnder->get());
|
||||
|
||||
// Instantiate the Prefab
|
||||
auto instanceToCreate = prefabEditorEntityOwnershipInterface->InstantiatePrefab(filePath, instanceToParentUnder);
|
||||
|
||||
if (!instanceToCreate)
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Could not instantiate the prefab provided - internal error "
|
||||
"(A null instance is returned)."));
|
||||
}
|
||||
|
||||
PrefabUndoHelpers::UpdatePrefabInstance(
|
||||
instanceToParentUnder->get(), "Update prefab instance", instanceToParentUnderDomBeforeCreate, undoBatch.GetUndoBatch());
|
||||
|
||||
CreateLink({}, instanceToCreate->get(), instanceToParentUnder->get().GetTemplateId(),
|
||||
undoBatch.GetUndoBatch(), parent);
|
||||
AZ::EntityId containerEntityId = instanceToCreate->get().GetContainerEntityId();
|
||||
|
||||
// Apply position
|
||||
AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetWorldTranslation, position);
|
||||
}
|
||||
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::FindCommonRootOwningInstance(
|
||||
const AZStd::vector<AZ::EntityId>& entityIds, EntityList& inputEntityList, EntityList& topLevelEntities,
|
||||
AZ::EntityId& commonRootEntityId, InstanceOptionalReference& commonRootEntityOwningInstance)
|
||||
@@ -222,19 +277,16 @@ namespace AzToolsFramework
|
||||
m_instanceToTemplateInterface->GeneratePatch(patch, containerEntityDomBefore, containerEntityDomAfter);
|
||||
m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, containerEntityId);
|
||||
|
||||
PrefabUndoHelpers::CreateLink(
|
||||
LinkId linkId = PrefabUndoHelpers::CreateLink(
|
||||
sourceInstance.GetTemplateId(), targetTemplateId, patch, sourceInstance.GetInstanceAlias(),
|
||||
undoBatch);
|
||||
|
||||
sourceInstance.SetLinkId(linkId);
|
||||
|
||||
// Update the cache - this prevents these changes from being stored in the regular undo/redo nodes
|
||||
m_prefabUndoCache.Store(containerEntityId, AZStd::move(containerEntityDomAfter));
|
||||
}
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::InstantiatePrefab(AZStd::string_view /*filePath*/, AZ::EntityId /*parent*/, AZ::Vector3 /*position*/)
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Prefab - InstantiatePrefab is yet to be implemented."));
|
||||
}
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::SavePrefab(AZ::IO::Path filePath)
|
||||
{
|
||||
auto templateId = m_prefabSystemComponentInterface->GetTemplateIdFromFilePath(filePath.c_str());
|
||||
@@ -322,9 +374,9 @@ namespace AzToolsFramework
|
||||
AZ::EntityId entityId, UndoSystem::URSequencePoint* parentUndoBatch)
|
||||
{
|
||||
// Create Undo node on entities if they belong to an instance
|
||||
InstanceOptionalReference instanceOptionalReference = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
|
||||
InstanceOptionalReference owningInstance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
|
||||
|
||||
if (instanceOptionalReference.has_value())
|
||||
if (owningInstance.has_value())
|
||||
{
|
||||
PrefabDom afterState;
|
||||
AZ::Entity* entity = GetEntityById(entityId);
|
||||
@@ -340,12 +392,27 @@ namespace AzToolsFramework
|
||||
|
||||
if (patch.IsArray() && !patch.Empty() && beforeState.IsObject())
|
||||
{
|
||||
// Update the state of the entity
|
||||
PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
|
||||
state->SetParent(parentUndoBatch);
|
||||
state->Capture(beforeState, afterState, entityId);
|
||||
if (IsInstanceContainerEntity(entityId) && !IsLevelInstanceContainerEntity(entityId))
|
||||
{
|
||||
m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, entityId);
|
||||
|
||||
state->Redo();
|
||||
// Save these changes as patches to the link
|
||||
PrefabUndoLinkUpdate* linkUpdate =
|
||||
aznew PrefabUndoLinkUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
|
||||
linkUpdate->SetParent(parentUndoBatch);
|
||||
linkUpdate->Capture(patch, owningInstance->get().GetLinkId());
|
||||
|
||||
linkUpdate->Redo();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update the state of the entity
|
||||
PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast<AZ::u64>(entityId)));
|
||||
state->SetParent(parentUndoBatch);
|
||||
state->Capture(beforeState, afterState, entityId);
|
||||
|
||||
state->Redo();
|
||||
}
|
||||
}
|
||||
|
||||
// Update the cache
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace AzToolsFramework
|
||||
|
||||
// PrefabPublicInterface...
|
||||
PrefabOperationResult CreatePrefab(const AZStd::vector<AZ::EntityId>& entityIds, AZ::IO::PathView filePath) override;
|
||||
PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, AZ::Vector3 position) override;
|
||||
PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) override;
|
||||
PrefabOperationResult SavePrefab(AZ::IO::Path filePath) override;
|
||||
PrefabEntityResult CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position) override;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace AzToolsFramework
|
||||
* @param position The position in world space the prefab should be instantiated in.
|
||||
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
|
||||
*/
|
||||
virtual PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, AZ::Vector3 position) = 0;
|
||||
virtual PrefabOperationResult InstantiatePrefab(AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) = 0;
|
||||
|
||||
/**
|
||||
* Saves changes to prefab to disk.
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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/EBus/EBus.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
namespace Prefab
|
||||
{
|
||||
class PrefabPublicNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
virtual ~PrefabPublicNotifications() = default;
|
||||
|
||||
virtual void OnPrefabInstancePropagationBegin() {}
|
||||
virtual void OnPrefabInstancePropagationEnd() {}
|
||||
};
|
||||
|
||||
using PrefabPublicNotificationBus = AZ::EBus<PrefabPublicNotifications>;
|
||||
|
||||
} // namespace Prefab
|
||||
} // namespace AzToolsFramework
|
||||
@@ -261,6 +261,29 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::unique_ptr<Instance> PrefabSystemComponent::InstantiatePrefab(AZ::IO::PathView filePath)
|
||||
{
|
||||
// Retrieve the template id for the source prefab filepath
|
||||
Prefab::TemplateId templateId = GetTemplateIdFromFilePath(filePath);
|
||||
|
||||
if (templateId == Prefab::InvalidTemplateId)
|
||||
{
|
||||
// Load the template from the file
|
||||
templateId = m_prefabLoader.LoadTemplateFromFile(filePath);
|
||||
}
|
||||
|
||||
if (templateId == Prefab::InvalidTemplateId)
|
||||
{
|
||||
AZ_Error("Prefab", false,
|
||||
"Could not load template from path %s during InstantiatePrefab. Unable to proceed",
|
||||
filePath);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return InstantiatePrefab(templateId);
|
||||
}
|
||||
|
||||
AZStd::unique_ptr<Instance> PrefabSystemComponent::InstantiatePrefab(const TemplateId& templateId)
|
||||
{
|
||||
TemplateReference instantiatingTemplate = FindTemplate(templateId);
|
||||
|
||||
@@ -115,9 +115,16 @@ namespace AzToolsFramework
|
||||
*/
|
||||
void RemoveAllTemplates() override;
|
||||
|
||||
/**
|
||||
* Generates a new Prefab Instance based on the Template whose source is stored in filepath.
|
||||
* @param filePath the path to the prefab source file containing the template being instantiated.
|
||||
* @return A unique_ptr to the newly instantiated instance. Null if operation failed.
|
||||
*/
|
||||
AZStd::unique_ptr<Instance> InstantiatePrefab(AZ::IO::PathView filePath) override;
|
||||
|
||||
/**
|
||||
* Generates a new Prefab Instance based on the Template referenced by templateId
|
||||
* @param templateId the id of the template being instantiated
|
||||
* @param templateId the id of the template being instantiated.
|
||||
* @return A unique_ptr to the newly instantiated instance. Null if operation failed.
|
||||
*/
|
||||
AZStd::unique_ptr<Instance> InstantiatePrefab(const TemplateId& templateId) override;
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ namespace AzToolsFramework
|
||||
virtual void UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom) = 0;
|
||||
virtual void PropagateTemplateChanges(TemplateId templateId) = 0;
|
||||
|
||||
virtual AZStd::unique_ptr<Instance> InstantiatePrefab(AZ::IO::PathView filePath) = 0;
|
||||
virtual AZStd::unique_ptr<Instance> InstantiatePrefab(const TemplateId& templateId) = 0;
|
||||
virtual AZStd::unique_ptr<Instance> CreatePrefab(const AZStd::vector<AZ::Entity*>& entities,
|
||||
AZStd::vector<AZStd::unique_ptr<Instance>>&& instancesToConsume, AZ::IO::PathView filePath,
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace AzToolsFramework
|
||||
state->Redo();
|
||||
}
|
||||
|
||||
void CreateLink(
|
||||
LinkId CreateLink(
|
||||
TemplateId sourceTemplateId, TemplateId targetTemplateId, PrefabDomReference patch,
|
||||
const InstanceAlias& instanceAlias, UndoSystem::URSequencePoint* undoBatch)
|
||||
{
|
||||
@@ -41,6 +41,8 @@ namespace AzToolsFramework
|
||||
linkAddUndo->Capture(targetTemplateId, sourceTemplateId, instanceAlias, patch, InvalidLinkId);
|
||||
linkAddUndo->SetParent(undoBatch);
|
||||
linkAddUndo->Redo();
|
||||
|
||||
return linkAddUndo->GetLinkId();
|
||||
}
|
||||
|
||||
void RemoveLink(
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace AzToolsFramework
|
||||
void UpdatePrefabInstance(
|
||||
const Instance& instance, AZStd::string_view undoMessage, const PrefabDom& instanceDomBeforeUpdate,
|
||||
UndoSystem::URSequencePoint* undoBatch);
|
||||
void CreateLink(
|
||||
LinkId CreateLink(
|
||||
TemplateId sourceTemplateId, TemplateId targetTemplateId, PrefabDomReference patch,
|
||||
const InstanceAlias& instanceAlias, UndoSystem::URSequencePoint* undoBatch);
|
||||
void RemoveLink(
|
||||
|
||||
+1
-1
@@ -34,4 +34,4 @@ namespace AzToolsFramework
|
||||
|
||||
} // namespace AzToolsFramework::Components
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -74,4 +74,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace SQLite
|
||||
} // namespace AZFramework
|
||||
} // namespace AZFramework
|
||||
|
||||
@@ -116,4 +116,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -95,4 +95,4 @@ namespace AzToolsFramework
|
||||
AZ::DataPatch::FlagsMap m_previousDataFlagsMap;
|
||||
AZ::DataPatch::FlagsMap m_nextDataFlagsMap;
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
@@ -70,4 +70,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using SliceDependencyBrowserNotificationsBus = AZ::EBus<SliceDependencyBrowserNotifications>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -131,4 +131,4 @@ namespace AzToolsFramework
|
||||
*/
|
||||
bool GetSliceDependendentsByRelativeAssetPath(const AZStd::string& relativePath, AZStd::vector<AZStd::string>& dependents) const;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,4 +100,4 @@ namespace AzToolsFramework
|
||||
SliceRelationshipNodeSet m_dependents;
|
||||
SliceRelationshipNodeSet m_dependencies;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,20 +71,12 @@ namespace AzToolsFramework
|
||||
SharedThumbnail thumbnail;
|
||||
ThumbnailerRequestsBus::BroadcastResult(thumbnail, &ThumbnailerRequests::GetThumbnail, m_key, m_contextName.c_str());
|
||||
QPainter painter(this);
|
||||
QPixmap pixmap = thumbnail->GetPixmap();
|
||||
// preserve thumbnail image's ratio, if the widget is wider than the image, center the image hotizontally
|
||||
float aspectRatio = aznumeric_cast<float>(pixmap.width()) / pixmap.height();
|
||||
int originalWidth = width();
|
||||
int originalHeight = height();
|
||||
int realHeight = qMin(aznumeric_cast<int>(originalWidth /aspectRatio), originalHeight);
|
||||
int realWidth = aznumeric_cast<int>(realHeight * aspectRatio);
|
||||
int x = (originalWidth - realWidth) / 2;
|
||||
// pixmap needs to be manually scaled to produce smoother result and avoid looking pixelated
|
||||
// using painter.setRenderHint(QPainter::SmoothPixmapTransform); does not seem to work
|
||||
// Note: there is a potential issue with pixmap.scaled:
|
||||
// it is multithreaded (using global threadPool) and blocking until finished.
|
||||
// A deadlock will happen if global threadPool has no free threads available.
|
||||
painter.drawPixmap(QPoint(x, 0), pixmap.scaled(realWidth, realHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
|
||||
// Scaling and centering pixmap within bounds to preserve aspect ratio
|
||||
const QPixmap pixmap = thumbnail->GetPixmap().scaled(size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
const QSize sizeDelta = size() - pixmap.size();
|
||||
const QPoint pointDelta = QPoint(sizeDelta.width() / 2, sizeDelta.height() / 2);
|
||||
painter.drawPixmap(pointDelta, pixmap);
|
||||
}
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,4 +37,4 @@ namespace AzToolsFramework
|
||||
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
|
||||
|
||||
};
|
||||
} // AzToolsFramework
|
||||
} // AzToolsFramework
|
||||
|
||||
+1
-1
@@ -189,4 +189,4 @@ namespace AzToolsFramework
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
clipboard->setMimeData(mimeData.release());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -69,4 +69,4 @@ namespace AzToolsFramework
|
||||
private:
|
||||
ComponentDataContainer m_components;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,4 +28,4 @@ namespace AzToolsFramework
|
||||
->Field("CurrentAssetID", &AssetReferenceBase::m_currentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,4 +43,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using EditorDisabledCompositionRequestBus = AZ::EBus<EditorDisabledCompositionRequests>;
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -112,4 +112,4 @@ namespace AzToolsFramework
|
||||
EditorComponentBase::Deactivate();
|
||||
}
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -49,4 +49,4 @@ namespace AzToolsFramework
|
||||
AZStd::vector<AZ::Component*> m_disabledComponents;
|
||||
};
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -71,4 +71,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using EditorEntityIconComponentNotificationBus = AZ::EBus<EditorEntityIconComponentNotifications>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -103,4 +103,4 @@ namespace AzToolsFramework
|
||||
bool m_componentOrderIsDirty = true; ///< This flag indicates our stored serialization order data is out of date and must be rebuilt before serialization occurs
|
||||
};
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -50,4 +50,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using EditorInspectorComponentNotificationBus = AZ::EBus<EditorInspectorComponentNotifications>;
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
|
||||
using EditorPendingCompositionRequestBus = AZ::EBus<EditorPendingCompositionRequests>;
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -125,4 +125,4 @@ namespace AzToolsFramework
|
||||
EditorComponentBase::Deactivate();
|
||||
}
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -49,4 +49,4 @@ namespace AzToolsFramework
|
||||
AZStd::vector<AZ::Component*> m_pendingComponents;
|
||||
};
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -40,4 +40,4 @@ namespace AzToolsFramework
|
||||
|
||||
using EditorSelectionAccentingRequestBus = AZ::EBus<EditorSelectionAccentingRequests>;
|
||||
} // namespace Components
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -74,4 +74,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -69,4 +69,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace AzToolsFramework
|
||||
|
||||
bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,4 +48,4 @@ namespace AzToolsFramework
|
||||
return outFreeDiskSpace >= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,4 +32,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif // EDITOR_ENTITY_ID_LIST_CONTAINER_H
|
||||
#endif // EDITOR_ENTITY_ID_LIST_CONTAINER_H
|
||||
|
||||
+1
-1
@@ -35,4 +35,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModel.cpp"
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModel.cpp"
|
||||
|
||||
+1
-1
@@ -55,4 +55,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp"
|
||||
#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp"
|
||||
|
||||
@@ -24,4 +24,4 @@ namespace AzToolsFramework
|
||||
QMenu* parentMenu,
|
||||
const AzToolsFramework::EntityIdSet& entitySelectionWithFlatHierarchy,
|
||||
NewLayerFunction newLayerFunction);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,4 +51,4 @@ namespace LegacyFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -62,4 +62,4 @@ namespace AzToolsFramework
|
||||
->Field("m_serializableWindowState", &MainWindowSavedState::m_serializableWindowState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,4 +53,4 @@ namespace AzToolsFramework
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -94,4 +94,4 @@ namespace AzToolsFramework
|
||||
|
||||
return dlg.m_result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,4 @@ namespace AzToolsFramework
|
||||
} // Logging
|
||||
} // AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -104,4 +104,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(const AzToolsFramework::Logging::LogLine*);
|
||||
Q_DECLARE_METATYPE(const AzToolsFramework::Logging::LogLine*);
|
||||
|
||||
+1
-1
@@ -115,4 +115,4 @@ namespace AzToolsFramework
|
||||
} // namespace Logging
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/Logging/moc_LogTableItemDelegate.cpp"
|
||||
#include "UI/Logging/moc_LogTableItemDelegate.cpp"
|
||||
|
||||
@@ -316,4 +316,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#include "UI/Logging/moc_LogTableModel.cpp"
|
||||
#include "UI/Logging/moc_LogTableModel.cpp"
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -56,4 +56,4 @@ namespace AzToolsFramework
|
||||
} // namespace LogPanel
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -102,4 +102,4 @@ namespace AzToolsFramework
|
||||
virtual void Clear();
|
||||
};
|
||||
} // namespace LogPanel
|
||||
} // namespace AzToolsFramework
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+10
-17
@@ -286,12 +286,12 @@ namespace AzToolsFramework
|
||||
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusConnect(
|
||||
GetEntityContextId());
|
||||
EditorEntityInfoNotificationBus::Handler::BusConnect();
|
||||
AZ::Interface<EntityOutlinerWidgetInterface>::Register(this);
|
||||
Prefab::PrefabPublicNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
EntityOutlinerWidget::~EntityOutlinerWidget()
|
||||
{
|
||||
AZ::Interface<EntityOutlinerWidgetInterface>::Unregister(this);
|
||||
Prefab::PrefabPublicNotificationBus::Handler::BusDisconnect();
|
||||
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusDisconnect();
|
||||
EditorEntityInfoNotificationBus::Handler::BusDisconnect();
|
||||
EditorPickModeNotificationBus::Handler::BusDisconnect();
|
||||
@@ -1109,25 +1109,18 @@ namespace AzToolsFramework
|
||||
setEnabled(true);
|
||||
SetEntityOutlinerState(m_gui, true);
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::SetUpdatesEnabled(bool enable)
|
||||
|
||||
void EntityOutlinerWidget::OnPrefabInstancePropagationBegin()
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
QTimer::singleShot(1, this, [this]() {
|
||||
m_gui->m_objectTree->setUpdatesEnabled(true);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gui->m_objectTree->setUpdatesEnabled(false);
|
||||
}
|
||||
m_gui->m_objectTree->setUpdatesEnabled(false);
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::ExpandEntityChildren(AZ::EntityId entityId)
|
||||
void EntityOutlinerWidget::OnPrefabInstancePropagationEnd()
|
||||
{
|
||||
QModelIndex index = GetIndexFromEntityId(entityId);
|
||||
m_gui->m_objectTree->expand(index);
|
||||
QTimer::singleShot(1, this, [this]() {
|
||||
m_gui->m_objectTree->setUpdatesEnabled(true);
|
||||
m_gui->m_objectTree->expand(m_proxyModel->index(0,0));
|
||||
});
|
||||
}
|
||||
|
||||
void EntityOutlinerWidget::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId /*parentId*/, AZ::EntityId childId)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user