From 7c54eeb5b293403f6b4db0b0a30f749007a152cf Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 2 Jul 2024 20:57:54 +0200 Subject: [PATCH] never extend the content browser context menu if any skeletal mesh or skeltons selected at the same time --- .../SGEditor/SGContentBrowserExtension.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/SenseGloveEditor/Private/SGEditor/SGContentBrowserExtension.cpp b/Source/SenseGloveEditor/Private/SGEditor/SGContentBrowserExtension.cpp index 8c751e8a..2c3243e1 100644 --- a/Source/SenseGloveEditor/Private/SGEditor/SGContentBrowserExtension.cpp +++ b/Source/SenseGloveEditor/Private/SGEditor/SGContentBrowserExtension.cpp @@ -233,6 +233,8 @@ void FSGContentBrowserExtension::AssetExtenderCallback( FMenuBuilder& MenuBuilder, const TArray SelectedAssets) { bool bShouldExtendTheMenu = true; + bool bAnySkeletalMeshSelected = false; + bool bAnySkeletonSelected = false; for (const FAssetData& Asset: SelectedAssets) { @@ -252,6 +254,22 @@ void FSGContentBrowserExtension::AssetExtenderCallback( bShouldExtendTheMenu = false; break; } + + if (bIsChildOfUSkeletalMesh) + { + bAnySkeletalMeshSelected = true; + } + + if (bIsChildOfUSkeleton) + { + bAnySkeletonSelected = true; + } + + if (bAnySkeletalMeshSelected && bAnySkeletonSelected) + { + bShouldExtendTheMenu = false; + break; + } } if (!bShouldExtendTheMenu)