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


C++ FAssetData::IsValid方法代码示例

本文整理汇总了C++中FAssetData::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ FAssetData::IsValid方法的具体用法?C++ FAssetData::IsValid怎么用?C++ FAssetData::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FAssetData的用法示例。


在下文中一共展示了FAssetData::IsValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CommitObjectPathForSave

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: 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

示例3: OnAssetSelected

void SAssetDialog::OnAssetSelected(const FAssetData& AssetData)
{
	CurrentlySelectedAssets = GetCurrentSelectionDelegate.Execute();
	
	if ( AssetData.IsValid() )
	{
		SetCurrentlySelectedPath(AssetData.PackagePath.ToString());
		SetCurrentlyEnteredAssetName(AssetData.AssetName.ToString());
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:10,代码来源:SAssetDialog.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: 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

示例6: 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

示例7: OnSetObject

void FPrimaryAssetIdCustomization::OnSetObject(const FAssetData& AssetData)
{
	UAssetManager& Manager = UAssetManager::Get();

	if (StructPropertyHandle.IsValid() && StructPropertyHandle->IsValidHandle())
	{
		FPrimaryAssetId AssetId;
		if (AssetData.IsValid())
		{
			AssetId = Manager.GetPrimaryAssetIdForData(AssetData);
			ensure(AssetId.IsValid());
		}

		StructPropertyHandle->SetValueFromFormattedString(AssetId.ToString());
	}
}
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:16,代码来源:PrimaryAssetIdCustomization.cpp

示例8: 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

示例9: 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

示例10: HandleHyperlinkNavigate

END_SLATE_FUNCTION_BUILD_OPTIMIZATION

void SReflectorTreeWidgetItem::HandleHyperlinkNavigate()
{
	FAssetData AssetData = WidgetInfo->GetWidgetAssetData();
	if ( AssetData.IsValid() )
	{
		if ( OnAccessAsset.IsBound() )
		{
			AssetData.GetPackage();
			OnAccessAsset.Execute(AssetData.GetAsset());
			return;
		}
	}

	if ( OnAccessSourceCode.IsBound() )
	{
		OnAccessSourceCode.Execute(GetWidgetFile(), GetWidgetLineNumber(), 0);
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:20,代码来源:SWidgetReflectorTreeWidgetItem.cpp

示例11: 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 )
		{
			const bool bAllowedClassIsInterface = AllowedClass->HasAnyClassFlags(CLASS_Interface);
			if( AssetClass->IsChildOf( AllowedClass ) || (bAllowedClassIsInterface && AssetClass->ImplementsInterface(AllowedClass)) )
			{
				bAllowedToSetBasedOnFilter = true;
				break;
			}
		}
	}

	return bAllowedToSetBasedOnFilter;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:20,代码来源:SPropertyEditorAsset.cpp

示例12: if

	TArray<FAssetData> ExtractAssetDataFromDrag(const TSharedPtr<FDragDropOperation>& Operation)
	{
		TArray<FAssetData> DroppedAssetData;

		if (!Operation.IsValid())
		{
			return DroppedAssetData;
		}

		if (Operation->IsOfType<FExternalDragOperation>())
		{
			TSharedPtr<FExternalDragOperation> DragDropOp = StaticCastSharedPtr<FExternalDragOperation>(Operation);
			if ( DragDropOp->HasText() )
			{
				TArray<FString> DroppedAssetStrings;
				const TCHAR AssetDelimiter[] = { AssetMarshalDefs::AssetDelimiter, TEXT('\0') };
				DragDropOp->GetText().ParseIntoArray(DroppedAssetStrings, AssetDelimiter, true);

				FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
				IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();

				for (int Index = 0; Index < DroppedAssetStrings.Num(); Index++)
				{
					// Truncate each string so that it doesn't exceed the maximum allowed length of characters to be converted to an FName
					FString TruncatedString = DroppedAssetStrings[ Index ].Left( NAME_SIZE );
					FAssetData AssetData = AssetRegistry.GetAssetByObjectPath( FName( *TruncatedString ) );
					if ( AssetData.IsValid() )
					{
						DroppedAssetData.Add( AssetData );
					}
				}
			}
		}
		else if (Operation->IsOfType<FAssetDragDropOp>())
		{
			TSharedPtr<FAssetDragDropOp> DragDropOp = StaticCastSharedPtr<FAssetDragDropOp>( Operation );
			DroppedAssetData.Append( DragDropOp->AssetData );
		}

		return DroppedAssetData;
	}
开发者ID:magetron,项目名称:UnrealEngine4-mod,代码行数:41,代码来源:AssetSelection.cpp

示例13: CacheAssetData

void UEdGraphNode_Reference::CacheAssetData(const FAssetData& AssetData)
{
	if ( AssetData.IsValid() )
	{
		bUsesThumbnail = true;
		CachedAssetData = AssetData;
	}
	else
	{
		CachedAssetData = FAssetData();
		bUsesThumbnail = false;

		if ( PackageNames.Num() == 1 )
		{
			const FString PackageNameStr = PackageNames[0].ToString();
			if ( FPackageName::IsValidLongPackageName(PackageNameStr, true) )
			{
				if ( PackageNameStr.StartsWith(TEXT("/Script")) )
				{
					CachedAssetData.AssetClass = FName(TEXT("Code"));
				}
				else
				{
					const FString PotentiallyMapFilename = FPackageName::LongPackageNameToFilename(PackageNameStr, FPackageName::GetMapPackageExtension());
					const bool bIsMapPackage = FPlatformFileManager::Get().GetPlatformFile().FileExists(*PotentiallyMapFilename);
					if ( bIsMapPackage )
					{
						CachedAssetData.AssetClass = FName(TEXT("World"));
					}
				}
			}
		}
		else
		{
			CachedAssetData.AssetClass = FName(TEXT("Multiple Nodes"));
		}
	}

}
开发者ID:Codermay,项目名称:Unreal4,代码行数:39,代码来源:EdGraphNode_Reference.cpp

示例14: if

	TArray<FAssetData> ExtractAssetDataFromDrag(const TSharedPtr<FDragDropOperation>& Operation)
	{
		TArray<FAssetData> DroppedAssetData;

		if (!Operation.IsValid())
		{
			return DroppedAssetData;
		}

		if (Operation->IsOfType<FExternalDragOperation>())
		{
			TSharedPtr<FExternalDragOperation> DragDropOp = StaticCastSharedPtr<FExternalDragOperation>(Operation);
			if ( DragDropOp->HasText() )
			{
				TArray<FString> DroppedAssetStrings;
				const TCHAR AssetDelimiter[] = { AssetMarshalDefs::AssetDelimiter, TEXT('\0') };
				DragDropOp->GetText().ParseIntoArray(DroppedAssetStrings, AssetDelimiter, true);

				FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
				IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();

				for (int Index = 0; Index < DroppedAssetStrings.Num(); Index++)
				{
					FAssetData AssetData = AssetRegistry.GetAssetByObjectPath( *DroppedAssetStrings[ Index ] );
					if ( AssetData.IsValid() )
					{
						DroppedAssetData.Add( AssetData );
					}
				}
			}
		}
		else if (Operation->IsOfType<FAssetDragDropOp>())
		{
			TSharedPtr<FAssetDragDropOp> DragDropOp = StaticCastSharedPtr<FAssetDragDropOp>( Operation );
			DroppedAssetData.Append( DragDropOp->AssetData );
		}

		return DroppedAssetData;
	}
开发者ID:Codermay,项目名称:Unreal4,代码行数:39,代码来源:AssetSelection.cpp

示例15: OnAssetSelected

void FPropertyEditor::OnAssetSelected( const FAssetData& AssetData )
{
	// Set the object found from the asset picker
	GetPropertyHandle()->SetValueFromFormattedString( AssetData.IsValid() ? AssetData.GetAsset()->GetPathName() : TEXT("None") );
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:5,代码来源:PropertyEditor.cpp


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