Files
UnrealEngineUWP/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContentEditor/Private/DatasmithSceneDetails.cpp
steve robb 48359cce3e Removed some TIsSame usage (part of a larger change to deprecate TIsSame).
#rb james.hopkin
#preflight 63bff06d4b018bfa800453f0

[CL 23661851 by steve robb in ue5-main branch]
2023-01-12 09:01:39 -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( std::is_same_v< typename TRemovePointer< typename TRemoveObjectPointer<decltype( UDatasmithScene::AssetImportData )>::Type >::Type, UDatasmithSceneImportData >, "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