Files
UnrealEngineUWP/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContentEditor/Private/DatasmithSceneDetails.cpp
benoit deschenes 33872145ad Datasmith Scene Import - Removing the option to manually change the source path in the asset detail, user must go through the source URI
#jira UE-139657
#rb JeanLuc.Conrenthin
#preflight 61eadf80e4313f36f01f184f

#ROBOMERGE-AUTHOR: benoit.deschenes
#ROBOMERGE-SOURCE: CL 18690570 in //UE5/Release-5.0/... via CL 18690588 via CL 18690597
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18690625 by benoit deschenes in ue5-main branch]
2022-01-21 11:45:18 -05:00

46 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "DatasmithSceneDetails.h"
#include "DatasmithAssetImportData.h"
#include "DatasmithContentEditorModule.h"
#include "DatasmithScene.h"
#include "DetailCategoryBuilder.h"
#include "DetailLayoutBuilder.h"
#include "DetailWidgetRow.h"
#include "PropertyHandle.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/SWidget.h"
#include "Widgets/Input/SEditableText.h"
#include "Widgets/Text/STextBlock.h"
#define LOCTEXT_NAMESPACE "DatasmithSceneDetails"
void FDatasmithSceneDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
TArray< TWeakObjectPtr< UObject > > Objects;
DetailBuilder.GetObjectsBeingCustomized( Objects );
check( Objects.Num() > 0 );
UDatasmithScene* DatasmithScene = Cast< UDatasmithScene >( Objects[0].Get() );
check( DatasmithScene );
static_assert( TIsSame< typename TRemovePointer< typename TRemoveObjectPointer<decltype( UDatasmithScene::AssetImportData )>::Type >::Type, UDatasmithSceneImportData >::Value, "Please update this details customization" );
static_assert( TIsDerivedFrom < UDatasmithSceneImportData, UAssetImportData >::IsDerived, "Please update this details customization" );
TSharedRef< IPropertyHandle > AssetImportDataPropertyHandle = DetailBuilder.GetProperty( GET_MEMBER_NAME_CHECKED( UDatasmithScene, AssetImportData ) );
TSharedPtr< IPropertyHandle > SourceDataHandle = AssetImportDataPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(UAssetImportData, SourceData));
if (SourceDataHandle)
{
// We don't want the default editable file selection UI, user should use the Source URI.
SourceDataHandle->MarkHiddenByCustomization();
}
}
void FDatasmithSceneDetails::CustomizeDetails(const TSharedPtr<IDetailLayoutBuilder>& DetailBuilder)
{
CustomizeDetails( *DetailBuilder );
}
#undef LOCTEXT_NAMESPACE