2019-12-27 07:44:07 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2019-03-06 13:30:42 -05:00
# 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"
2022-01-21 11:45:18 -05:00
# include "Widgets/Input/SEditableText.h"
2019-03-06 13:30:42 -05:00
# 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 ) ;
2020-10-21 17:56:05 -04:00
static_assert ( TIsSame < typename TRemovePointer < typename TRemoveObjectPointer < decltype ( UDatasmithScene : : AssetImportData ) > : : Type > : : Type , UDatasmithSceneImportData > : : Value , " Please update this details customization " ) ;
2019-03-06 13:30:42 -05:00
static_assert ( TIsDerivedFrom < UDatasmithSceneImportData , UAssetImportData > : : IsDerived , " Please update this details customization " ) ;
TSharedRef < IPropertyHandle > AssetImportDataPropertyHandle = DetailBuilder . GetProperty ( GET_MEMBER_NAME_CHECKED ( UDatasmithScene , AssetImportData ) ) ;
2022-01-21 11:45:18 -05:00
TSharedPtr < IPropertyHandle > SourceDataHandle = AssetImportDataPropertyHandle - > GetChildHandle ( GET_MEMBER_NAME_CHECKED ( UAssetImportData , SourceData ) ) ;
if ( SourceDataHandle )
2019-03-06 13:30:42 -05:00
{
2022-01-21 11:45:18 -05:00
// We don't want the default editable file selection UI, user should use the Source URI.
SourceDataHandle - > MarkHiddenByCustomization ( ) ;
2019-03-06 13:30:42 -05:00
}
}
void FDatasmithSceneDetails : : CustomizeDetails ( const TSharedPtr < IDetailLayoutBuilder > & DetailBuilder )
{
CustomizeDetails ( * DetailBuilder ) ;
}
# undef LOCTEXT_NAMESPACE