当前位置: 首页>>代码示例>>C++>>正文


C++ FAssetData类代码示例

本文整理汇总了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();
			}
		}
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:30,代码来源:SAssetDialog.cpp

示例2: IsOpenForRegistration

//------------------------------------------------------------------------------
bool FBlueprintActionDatabaseRegistrar::IsOpenForRegistration(FAssetData const& AssetKey)
{
	UObject const* OwnerKey = GeneratingClass;
	if (AssetKey.IsAssetLoaded())
	{
		OwnerKey = AssetKey.GetAsset();
	}
	return IsOpenForRegistration(OwnerKey);
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:10,代码来源:BlueprintActionDatabaseRegistrar.cpp

示例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;
	}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:12,代码来源:PaperFlipbookActorFactory.cpp

示例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;
	}
}
开发者ID:ChillyFlashER,项目名称:Voreeal,代码行数:12,代码来源:VoreealBasicVolumeActorFactory.cpp

示例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;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:14,代码来源:AnimBlueprintFactory.cpp

示例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);
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:15,代码来源:BlueprintActionDatabase.cpp

示例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);
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:15,代码来源:MatineeTrackHelpers.cpp

示例8: OnAssetSelectedFromPicker

void SGlobalOpenAssetDialog::OnAssetSelectedFromPicker(const FAssetData& AssetData)
{
	if (UObject* ObjectToEdit = AssetData.GetAsset())
	{
		FAssetEditorManager::Get().OpenEditorForAsset(ObjectToEdit);
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:7,代码来源:SGlobalOpenAssetDialog.cpp

示例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;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:29,代码来源:PersonaAssetFamily.cpp

示例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 );
			}
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:27,代码来源:AssetSelection.cpp

示例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);
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:17,代码来源:BlueprintActionDatabase.cpp

示例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());
		}
	}
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:26,代码来源:SlateFontInfoCustomization.cpp

示例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;
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:18,代码来源:TerrainSplineActorFactory.cpp

示例14: OnAssetRenamed

//------------------------------------------------------------------------------
static void BlueprintActionDatabaseImpl::OnAssetRenamed(FAssetData const& AssetInfo, const FString& InOldName)
{
	FBlueprintActionDatabase& ActionDatabase = FBlueprintActionDatabase::Get();

	if (!AssetInfo.IsAssetLoaded())
	{
		ActionDatabase.MoveUnloadedAssetActions(*InOldName, AssetInfo.ObjectPath);
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:10,代码来源:BlueprintActionDatabase.cpp

示例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;
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:19,代码来源:SPropertyEditorAsset.cpp


注:本文中的FAssetData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。