Merge branch 'main' into Atom/guthadam/ATOM-15486
This commit is contained in:
@@ -182,6 +182,22 @@ namespace AzToolsFramework
|
||||
instanceToParentUnder = prefabEditorEntityOwnershipInterface->GetRootPrefabInstance();
|
||||
parent = instanceToParentUnder->get().GetContainerEntityId();
|
||||
}
|
||||
|
||||
//Detect whether this instantiation would produce a cyclical dependency
|
||||
auto relativePath = m_prefabLoaderInterface->GetRelativePathToProject(filePath);
|
||||
Prefab::TemplateId templateId = m_prefabSystemComponentInterface->GetTemplateIdFromFilePath(relativePath);
|
||||
|
||||
// If the template isn't currently loaded, there's no way for it to be in the hierarchy so we just skip the check.
|
||||
if (templateId != Prefab::InvalidTemplateId && IsPrefabInInstanceAncestorHierarchy(templateId, instanceToParentUnder->get()))
|
||||
{
|
||||
return AZ::Failure(
|
||||
AZStd::string::format(
|
||||
"Instantiate Prefab operation aborted - Cyclical dependency detected\n(%s depends on %s).",
|
||||
relativePath.Native().c_str(),
|
||||
instanceToParentUnder->get().GetTemplateSourcePath().Native().c_str()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
// Initialize Undo Batch object
|
||||
@@ -192,7 +208,7 @@ namespace AzToolsFramework
|
||||
instanceToParentUnderDomBeforeCreate, instanceToParentUnder->get());
|
||||
|
||||
// Instantiate the Prefab
|
||||
auto instanceToCreate = prefabEditorEntityOwnershipInterface->InstantiatePrefab(filePath, instanceToParentUnder);
|
||||
auto instanceToCreate = prefabEditorEntityOwnershipInterface->InstantiatePrefab(relativePath, instanceToParentUnder);
|
||||
|
||||
if (!instanceToCreate)
|
||||
{
|
||||
@@ -242,6 +258,23 @@ namespace AzToolsFramework
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
bool PrefabPublicHandler::IsPrefabInInstanceAncestorHierarchy(TemplateId prefabTemplateId, InstanceOptionalConstReference instance)
|
||||
{
|
||||
InstanceOptionalConstReference currentInstance = instance;
|
||||
|
||||
while (currentInstance.has_value())
|
||||
{
|
||||
if (currentInstance->get().GetTemplateId() == prefabTemplateId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
currentInstance = currentInstance->get().GetParentInstance();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PrefabPublicHandler::CreateLink(
|
||||
const EntityList& topLevelEntities, Instance& sourceInstance, TemplateId targetTemplateId,
|
||||
UndoSystem::URSequencePoint* undoBatch, AZ::EntityId commonRootEntityId)
|
||||
|
||||
@@ -106,6 +106,14 @@ namespace AzToolsFramework
|
||||
const AZStd::vector<AZ::EntityId>& entityIds, EntityList& inputEntityList, EntityList& topLevelEntities,
|
||||
AZ::EntityId& commonRootEntityId, InstanceOptionalReference& commonRootEntityOwningInstance);
|
||||
|
||||
/* Detects whether an instance of prefabTemplateId is present in the hierarchy of ancestors of instance.
|
||||
*
|
||||
* \param prefabTemplateId The template id to test for
|
||||
* \param instance The instance whose ancestor hierarchy prefabTemplateId will be tested against.
|
||||
* \return true if an instance of the template of id prefabTemplateId could be found in the ancestor hierarchy of instance, false otherwise.
|
||||
*/
|
||||
bool IsPrefabInInstanceAncestorHierarchy(TemplateId prefabTemplateId, InstanceOptionalConstReference instance);
|
||||
|
||||
static Instance* GetParentInstance(Instance* instance);
|
||||
static Instance* GetAncestorOfInstanceThatIsChildOfRoot(const Instance* ancestor, Instance* descendant);
|
||||
static void GenerateContainerEntityTransform(const EntityList& topLevelEntities, AZ::Vector3& translation, AZ::Quaternion& rotation);
|
||||
|
||||
@@ -721,6 +721,8 @@ namespace AzToolsFramework
|
||||
|
||||
TemplateId PrefabSystemComponent::GetTemplateIdFromFilePath(AZ::IO::PathView filePath) const
|
||||
{
|
||||
AZ_Assert(!filePath.IsAbsolute(), "Prefab - GetTemplateIdFromFilePath was passed an absolute path. Prefabs use paths relative to the project folder.");
|
||||
|
||||
auto found = m_templateFilePathToIdMap.find(filePath);
|
||||
if (found != m_templateFilePathToIdMap.end())
|
||||
{
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ namespace AZ
|
||||
for (const RPI::ViewPtr& view : packet.m_views)
|
||||
{
|
||||
if (m_renderPipelineIdsForPersistentView.find(view.get()) != m_renderPipelineIdsForPersistentView.end() &&
|
||||
(view->GetUsageFlags() & RPI::View::UsageCamera))
|
||||
(RHI::CheckBitsAny(view->GetUsageFlags(), RPI::View::UsageCamera | RPI::View::UsageReflectiveCubeMap)))
|
||||
{
|
||||
RPI::ShaderResourceGroup* viewSrg = view->GetShaderResourceGroup().get();
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
},
|
||||
"debug": {
|
||||
"TAGS":[
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND":"../Windows/build_ninja_windows.cmd",
|
||||
@@ -67,7 +68,8 @@
|
||||
},
|
||||
"profile_nounity": {
|
||||
"TAGS":[
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND":"../Windows/build_ninja_windows.cmd",
|
||||
@@ -83,7 +85,9 @@
|
||||
"asset_profile": {
|
||||
"TAGS":[
|
||||
"default",
|
||||
"weekly-build-metrics"
|
||||
"weekly-build-metrics",
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"COMMAND":"../Windows/build_asset_windows.cmd",
|
||||
"PARAMETERS": {
|
||||
@@ -98,21 +102,10 @@
|
||||
"ASSET_PROCESSOR_PLATFORMS":"es3"
|
||||
}
|
||||
},
|
||||
"asset_clean_profile": {
|
||||
"TAGS":[
|
||||
"nightly"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
"CLEAN_ASSETS": "1"
|
||||
},
|
||||
"steps": [
|
||||
"clean",
|
||||
"asset_profile"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"TAGS":[
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND":"../Windows/build_ninja_windows.cmd",
|
||||
@@ -127,7 +120,8 @@
|
||||
},
|
||||
"monolithic_release": {
|
||||
"TAGS":[
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND":"../Windows/build_ninja_windows.cmd",
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
},
|
||||
"packaging": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
},
|
||||
"nightly-clean": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,8 @@
|
||||
},
|
||||
"debug": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_linux.sh",
|
||||
@@ -43,9 +44,10 @@
|
||||
},
|
||||
"profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"daily-pipeline-metrics",
|
||||
"weekly-build-metrics"
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"daily-pipeline-metrics",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_linux.sh",
|
||||
"PARAMETERS": {
|
||||
@@ -98,7 +100,9 @@
|
||||
},
|
||||
"asset_profile": {
|
||||
"TAGS": [
|
||||
"weekly-build-metrics"
|
||||
"weekly-build-metrics",
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"COMMAND": "build_asset_linux.sh",
|
||||
"PARAMETERS": {
|
||||
@@ -126,21 +130,10 @@
|
||||
"ASSET_PROCESSOR_PLATFORMS": "pc,server"
|
||||
}
|
||||
},
|
||||
"asset_clean_profile": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
"CLEAN_ASSETS": "1"
|
||||
},
|
||||
"steps": [
|
||||
"clean",
|
||||
"asset_profile"
|
||||
]
|
||||
},
|
||||
"periodic_test_profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_linux.sh",
|
||||
@@ -155,7 +148,8 @@
|
||||
},
|
||||
"benchmark_test_profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_linux.sh",
|
||||
@@ -170,7 +164,8 @@
|
||||
},
|
||||
"release": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_linux.sh",
|
||||
@@ -184,7 +179,8 @@
|
||||
},
|
||||
"monolithic_release": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_linux.sh",
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
"packaging": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
},
|
||||
"nightly-clean": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,8 @@
|
||||
},
|
||||
"profile_pipe": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"steps": [
|
||||
"profile",
|
||||
@@ -28,7 +29,8 @@
|
||||
},
|
||||
"debug": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_mac.sh",
|
||||
@@ -56,7 +58,8 @@
|
||||
},
|
||||
"profile_nounity": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_mac.sh",
|
||||
@@ -70,7 +73,9 @@
|
||||
},
|
||||
"asset_profile": {
|
||||
"TAGS": [
|
||||
"weekly-build-metrics"
|
||||
"weekly-build-metrics",
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"COMMAND": "build_asset_mac.sh",
|
||||
"PARAMETERS": {
|
||||
@@ -84,21 +89,10 @@
|
||||
"ASSET_PROCESSOR_PLATFORMS": "osx_gl"
|
||||
}
|
||||
},
|
||||
"asset_clean_profile": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
"CLEAN_ASSETS": "1"
|
||||
},
|
||||
"steps": [
|
||||
"clean",
|
||||
"asset_profile"
|
||||
]
|
||||
},
|
||||
"periodic_test_profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_mac.sh",
|
||||
@@ -113,7 +107,8 @@
|
||||
},
|
||||
"benchmark_test_profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_mac.sh",
|
||||
@@ -128,7 +123,8 @@
|
||||
},
|
||||
"release": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_mac.sh",
|
||||
@@ -142,7 +138,8 @@
|
||||
},
|
||||
"monolithic_release": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_mac.sh",
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
"packaging": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
},
|
||||
"nightly-clean": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,8 @@
|
||||
},
|
||||
"debug_vs2019_pipe": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"steps": [
|
||||
"debug_vs2019",
|
||||
@@ -125,7 +126,8 @@
|
||||
},
|
||||
"profile_vs2019_nounity": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_windows.cmd",
|
||||
@@ -157,10 +159,11 @@
|
||||
},
|
||||
"test_gpu_profile_vs2019": {
|
||||
"TAGS":[
|
||||
"nightly"
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"PIPELINE_ENV":{
|
||||
"NODE_LABEL":"windows-gpu"
|
||||
"NODE_LABEL":"windows-gpu"
|
||||
},
|
||||
"COMMAND": "build_test_windows.cmd",
|
||||
"PARAMETERS": {
|
||||
@@ -176,7 +179,9 @@
|
||||
},
|
||||
"asset_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"weekly-build-metrics"
|
||||
"weekly-build-metrics",
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"COMMAND": "build_asset_windows.cmd",
|
||||
"PARAMETERS": {
|
||||
@@ -191,21 +196,10 @@
|
||||
"ASSET_PROCESSOR_PLATFORMS": "pc,server"
|
||||
}
|
||||
},
|
||||
"asset_clean_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
"CLEAN_ASSETS": "1"
|
||||
},
|
||||
"steps": [
|
||||
"clean",
|
||||
"asset_profile_vs2019"
|
||||
]
|
||||
},
|
||||
"periodic_test_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_windows.cmd",
|
||||
@@ -222,7 +216,8 @@
|
||||
},
|
||||
"sandbox_test_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
@@ -242,7 +237,8 @@
|
||||
},
|
||||
"benchmark_test_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_test_windows.cmd",
|
||||
@@ -259,7 +255,8 @@
|
||||
},
|
||||
"release_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_windows.cmd",
|
||||
@@ -274,7 +271,8 @@
|
||||
},
|
||||
"monolithic_release_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "build_windows.cmd",
|
||||
@@ -289,7 +287,8 @@
|
||||
},
|
||||
"install_profile_vs2019": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
"nightly-incremental",
|
||||
"nightly-clean"
|
||||
],
|
||||
"COMMAND": "build_windows.cmd",
|
||||
"PARAMETERS": {
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
"packaging": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
},
|
||||
"nightly-clean": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,8 @@
|
||||
},
|
||||
"debug": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "../Mac/build_mac.sh",
|
||||
@@ -34,7 +35,8 @@
|
||||
},
|
||||
"profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"daily-pipeline-metrics",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
@@ -50,7 +52,8 @@
|
||||
},
|
||||
"profile_nounity": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "../Mac/build_mac.sh",
|
||||
@@ -65,7 +68,8 @@
|
||||
},
|
||||
"asset_profile": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "../Mac/build_asset_mac.sh",
|
||||
@@ -80,21 +84,10 @@
|
||||
"ASSET_PROCESSOR_PLATFORMS": "ios"
|
||||
}
|
||||
},
|
||||
"asset_clean_profile": {
|
||||
"TAGS": [
|
||||
"nightly"
|
||||
],
|
||||
"PIPELINE_ENV": {
|
||||
"CLEAN_ASSETS": "true"
|
||||
},
|
||||
"steps": [
|
||||
"clean",
|
||||
"asset_profile"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"TAGS": [
|
||||
"nightly",
|
||||
"nightly-incremental",
|
||||
"nightly-clean",
|
||||
"weekly-build-metrics"
|
||||
],
|
||||
"COMMAND": "../Mac/build_mac.sh",
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
"packaging": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
},
|
||||
"nightly-clean": {
|
||||
"CLEAN_WORKSPACE": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user