本文整理汇总了C++中FAssetData类的典型用法代码示例。如果您正苦于以下问题:C++ FAssetData类的具体用法?C++ FAssetData怎么用?C++ FAssetData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FAssetData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetObjectPathForSave
void SAssetDialog::CommitObjectPathForSave()
{
if ( ensure(DialogType == EAssetDialogType::Save) )
{
if ( bLastInputValidityCheckSuccessful )
{
const FString ObjectPath = GetObjectPathForSave();
bool bProceedWithSave = true;
// If we were asked to warn on existing assets, do it now
if ( ExistingAssetPolicy == ESaveAssetDialogExistingAssetPolicy::AllowButWarn )
{
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry");
FAssetData ExistingAsset = AssetRegistryModule.Get().GetAssetByObjectPath(FName(*ObjectPath));
if ( ExistingAsset.IsValid() && AssetClassNames.Contains(ExistingAsset.AssetClass) )
{
EAppReturnType::Type ShouldReplace = FMessageDialog::Open( EAppMsgType::YesNo, FText::Format(LOCTEXT("ReplaceAssetMessage", "{ExistingAsset} already exists. Do you want to replace it?"), FText::FromString(CurrentlyEnteredAssetName)) );
bProceedWithSave = (ShouldReplace == EAppReturnType::Yes);
}
}
if ( bProceedWithSave )
{
OnObjectPathChosenForSave.ExecuteIfBound(ObjectPath);
CloseDialog();
}
}
}
}
示例2: IsOpenForRegistration
//------------------------------------------------------------------------------
bool FBlueprintActionDatabaseRegistrar::IsOpenForRegistration(FAssetData const& AssetKey)
{
UObject const* OwnerKey = GeneratingClass;
if (AssetKey.IsAssetLoaded())
{
OwnerKey = AssetKey.GetAsset();
}
return IsOpenForRegistration(OwnerKey);
}
示例3: CanCreateActorFrom
bool UPaperFlipbookActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg)
{
if (AssetData.IsValid() && AssetData.GetClass()->IsChildOf(UPaperFlipbook::StaticClass()))
{
return true;
}
else
{
OutErrorMsg = NSLOCTEXT("Paper2D", "CanCreateActorFrom_NoFlipbook", "No flipbook was specified.");
return false;
}
}
示例4: CanCreateActorFrom
bool UVoreealBasicVolumeActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg)
{
if (AssetData.IsValid() && AssetData.GetClass()->IsChildOf(UBasicVolume::StaticClass()))
{
return true;
}
else
{
OutErrorMsg = NSLOCTEXT("Voreeal", "CanCreateActorFrom_NoVoxelVolume", "No voxel volume was specified.");
return false;
}
}
示例5: CanCreateAnimBlueprint
static bool CanCreateAnimBlueprint(const FAssetData& Skeleton, UClass const * ParentClass)
{
if (Skeleton.IsValid() && ParentClass != NULL)
{
if (UAnimBlueprintGeneratedClass const * GeneratedParent = Cast<const UAnimBlueprintGeneratedClass>(ParentClass))
{
if (Skeleton.GetExportTextName() != FAssetData(GeneratedParent->GetTargetSkeleton()).GetExportTextName())
{
return false;
}
}
}
return true;
}
示例6: OnAssetRemoved
//------------------------------------------------------------------------------
static void BlueprintActionDatabaseImpl::OnAssetRemoved(FAssetData const& AssetInfo)
{
FBlueprintActionDatabase& ActionDatabase = FBlueprintActionDatabase::Get();
if (AssetInfo.IsAssetLoaded())
{
UObject* AssetObject = AssetInfo.GetAsset();
OnAssetRemoved(AssetObject);
}
else
{
ActionDatabase.ClearUnloadedAssetActions(AssetInfo.ObjectPath);
}
}
示例7: OnAddKeyTextEntry
void UMatineeTrackAnimControlHelper::OnAddKeyTextEntry(const FAssetData& AssetData, IMatineeBase* Matinee, UInterpTrack* Track)
{
if (EntryMenu.IsValid())
{
EntryMenu.Pin()->Dismiss();
}
UObject* SelectedObject = AssetData.GetAsset();
if (SelectedObject && SelectedObject->IsA(UAnimSequence::StaticClass()))
{
KeyframeAddAnimSequence = CastChecked<UAnimSequence>(AssetData.GetAsset());
Matinee->FinishAddKey(Track, true);
}
}
示例8: OnAssetSelectedFromPicker
void SGlobalOpenAssetDialog::OnAssetSelectedFromPicker(const FAssetData& AssetData)
{
if (UObject* ObjectToEdit = AssetData.GetAsset())
{
FAssetEditorManager::Get().OpenEditorForAsset(ObjectToEdit);
}
}
示例9: FAssetData
bool FPersonaAssetFamily::IsAssetCompatible(const FAssetData& InAssetData) const
{
UClass* Class = InAssetData.GetClass();
if (Class)
{
if (Class->IsChildOf<USkeleton>())
{
return FAssetData(Skeleton.Get()) == InAssetData;
}
else if (Class->IsChildOf<UAnimationAsset>() || Class->IsChildOf<USkeletalMesh>())
{
const FString* TargetSkeleton = InAssetData.TagsAndValues.Find("Skeleton");
if (TargetSkeleton)
{
return *TargetSkeleton == FAssetData(Skeleton.Get()).GetExportTextName();
}
}
else if (Class->IsChildOf<UAnimBlueprint>())
{
const FString* TargetSkeleton = InAssetData.TagsAndValues.Find("TargetSkeleton");
if (TargetSkeleton)
{
return *TargetSkeleton == FAssetData(Skeleton.Get()).GetExportTextName();
}
}
}
return false;
}
示例10: GenerateActorFactoryMenuItems
void FActorFactoryAssetProxy::GenerateActorFactoryMenuItems( const FAssetData& AssetData, TArray<FMenuItem>* OutMenuItems, bool ExcludeStandAloneFactories )
{
FText UnusedErrorMessage;
const FAssetData NoAssetData;
for ( int32 FactoryIdx = 0; FactoryIdx < GEditor->ActorFactories.Num(); FactoryIdx++ )
{
UActorFactory* Factory = GEditor->ActorFactories[FactoryIdx];
const bool FactoryWorksWithoutAsset = Factory->CanCreateActorFrom( NoAssetData, UnusedErrorMessage );
const bool FactoryWorksWithAsset = AssetData.IsValid() && Factory->CanCreateActorFrom( AssetData, UnusedErrorMessage );
const bool FactoryWorks = FactoryWorksWithAsset || FactoryWorksWithoutAsset;
if ( FactoryWorks )
{
FMenuItem MenuItem = FMenuItem( Factory, NoAssetData );
if ( FactoryWorksWithAsset )
{
MenuItem = FMenuItem( Factory, AssetData );
}
if ( FactoryWorksWithAsset || ( !ExcludeStandAloneFactories && FactoryWorksWithoutAsset ) )
{
OutMenuItems->Add( MenuItem );
}
}
}
}
示例11: OnAssetAdded
//------------------------------------------------------------------------------
static void BlueprintActionDatabaseImpl::OnAssetAdded(FAssetData const& NewAssetInfo)
{
if (NewAssetInfo.IsAssetLoaded())
{
UObject* AssetObject = NewAssetInfo.GetAsset();
if (UBlueprint* NewBlueprint = Cast<UBlueprint>(AssetObject))
{
OnBlueprintChanged(NewBlueprint);
}
else
{
FBlueprintActionDatabase& ActionDatabase = FBlueprintActionDatabase::Get();
ActionDatabase.RefreshAssetActions(AssetObject);
}
}
}
示例12: OnFontChanged
void FSlateFontInfoStructCustomization::OnFontChanged(const FAssetData& InAssetData)
{
const UFont* const FontAsset = Cast<const UFont>(InAssetData.GetAsset());
const FName FirstFontName = (FontAsset && FontAsset->CompositeFont.DefaultTypeface.Fonts.Num()) ? FontAsset->CompositeFont.DefaultTypeface.Fonts[0].Name : NAME_None;
TArray<FSlateFontInfo*> SlateFontInfoStructs = GetFontInfoBeingEdited();
for(FSlateFontInfo* FontInfo : SlateFontInfoStructs)
{
// The font has been updated in the editor, so clear the non-UObject pointer so that the two don't conflict
FontInfo->CompositeFont.Reset();
// We've changed (or cleared) the font asset, so make sure and update the typeface entry name being used by the font info
TypefaceFontNameProperty->SetValue(FirstFontName);
}
if(!FontAsset)
{
const FString PropertyPath = FontObjectProperty->GeneratePathToProperty();
TArray<UObject*> PropertyOuterObjects;
FontObjectProperty->GetOuterObjects(PropertyOuterObjects);
for(const UObject* OuterObject : PropertyOuterObjects)
{
UE_LOG(LogSlate, Warning, TEXT("FSlateFontInfo property '%s' on object '%s' was set to use a null UFont. Slate will be forced to use the fallback font path which may be slower."), *PropertyPath, *OuterObject->GetPathName());
}
}
}
示例13: CanCreateActorFrom
bool UTerrainSplineActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg)
{
if (GetDefault<UPaperRuntimeSettings>()->bEnableTerrainSplineEditing)
{
if (AssetData.IsValid() && AssetData.GetClass()->IsChildOf(UPaperTerrainMaterial::StaticClass()))
{
return true;
}
else
{
return Super::CanCreateActorFrom(AssetData, OutErrorMsg);
}
}
else
{
return false;
}
}
示例14: OnAssetRenamed
//------------------------------------------------------------------------------
static void BlueprintActionDatabaseImpl::OnAssetRenamed(FAssetData const& AssetInfo, const FString& InOldName)
{
FBlueprintActionDatabase& ActionDatabase = FBlueprintActionDatabase::Get();
if (!AssetInfo.IsAssetLoaded())
{
ActionDatabase.MoveUnloadedAssetActions(*InOldName, AssetInfo.ObjectPath);
}
}
示例15: CanSetBasedOnCustomClasses
bool SPropertyEditorAsset::CanSetBasedOnCustomClasses( const FAssetData& InAssetData ) const
{
bool bAllowedToSetBasedOnFilter = true;
if( InAssetData.IsValid() && CustomClassFilters.Num() > 0 )
{
bAllowedToSetBasedOnFilter = false;
UClass* AssetClass = InAssetData.GetClass();
for( const UClass* AllowedClass : CustomClassFilters )
{
if( AssetClass->IsChildOf( AllowedClass ) )
{
bAllowedToSetBasedOnFilter = true;
break;
}
}
}
return bAllowedToSetBasedOnFilter;
}