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


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

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


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

示例1: RecordAssetOpened

void FPersonaAssetFamily::RecordAssetOpened(const FAssetData& InAssetData)
{
	if (IsAssetCompatible(InAssetData))
	{
		UClass* Class = InAssetData.GetClass();
		if (Class)
		{
			if (Class->IsChildOf<USkeleton>())
			{
				Skeleton = Cast<USkeleton>(InAssetData.GetAsset());
			}
			else if (Class->IsChildOf<UAnimationAsset>())
			{
				AnimationAsset = Cast<UAnimationAsset>(InAssetData.GetAsset());
			}
			else if (Class->IsChildOf<USkeletalMesh>())
			{
				Mesh = Cast<USkeletalMesh>(InAssetData.GetAsset());
			}
			else if (Class->IsChildOf<UAnimBlueprint>())
			{
				AnimBlueprint = Cast<UAnimBlueprint>(InAssetData.GetAsset());
			}
		}

		OnAssetOpened.Broadcast(InAssetData.GetAsset());
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:28,代码来源:PersonaAssetFamily.cpp

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

示例3: OnAssetSelectedFromPicker

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

示例4: PerformAction

	virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) override
	{
		UAnimGraphNode_SequencePlayer* SpawnedNode = CastChecked<UAnimGraphNode_SequencePlayer>(FEdGraphSchemaAction_K2NewNode::PerformAction(ParentGraph, FromPin, Location, bSelectNewNode));
		SpawnedNode->Node.Sequence = Cast<UAnimSequence>(AssetInfo.GetAsset());

		return SpawnedNode;
	}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,代码来源:AnimGraphNode_SequencePlayer.cpp

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

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

示例7: OnAddKeyTextEntry

void UMatineeTrackAnimControlHelper::OnAddKeyTextEntry(const FAssetData& AssetData, IMatineeBase* Matinee, UInterpTrack* Track)
{
	if( EntryPopupWindow.IsValid() )
	{
		EntryPopupWindow.Pin()->RequestDestroyWindow();
	}

	KeyframeAddAnimSequence = CastChecked<UAnimSequence>(AssetData.GetAsset());

	Matinee->FinishAddKey(Track,true);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:11,代码来源:MatineeTrackHelpers.cpp

示例8: OnSpriteDoubleClicked

void SSpriteList::OnSpriteDoubleClicked(const FAssetData& AssetData)
{
	TSharedPtr<FSpriteEditor> SpriteEditor = SpriteEditorPtr.Pin();
	if (SpriteEditor.IsValid())
	{
		if (UPaperSprite* NewSpriteToEdit = Cast<UPaperSprite>(AssetData.GetAsset()))
		{
			SpriteEditor->SetSpriteBeingEdited(NewSpriteToEdit);
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:11,代码来源:SSpriteList.cpp

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

示例10: OnAssetSelected

void SFlipbookKeyframeWidget::OnAssetSelected(const FAssetData& AssetData)
{
	if (UPaperFlipbook* Flipbook = FlipbookBeingEdited.Get())
	{
		FScopedFlipbookMutator EditLock(Flipbook);

		if (EditLock.KeyFrames.IsValidIndex(FrameIndex))
		{
			UPaperSprite* NewSprite = Cast<UPaperSprite>(AssetData.GetAsset());

			EditLock.KeyFrames[FrameIndex].Sprite = NewSprite;
		}
	}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:14,代码来源:STimelineTrack.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: 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

示例13: AddBlueprintAction

//------------------------------------------------------------------------------
bool FBlueprintActionDatabaseRegistrar::AddBlueprintAction(FAssetData const& AssetDataOwner, UBlueprintNodeSpawner* NodeSpawner)
{
	bool bReturnResult = false;

	// @TODO: assert that AddBlueprintAction(UBlueprintNodeSpawner* NodeSpawner) 
	//        wouldn't come up with a different key (besides GeneratingClass)
	if(AssetDataOwner.IsAssetLoaded())
	{
		bReturnResult = AddBlueprintAction(AssetDataOwner.GetAsset(), NodeSpawner);
	}
	else
	{
		bReturnResult = AddBlueprintAction(NodeSpawner->NodeClass, NodeSpawner);
		if(bReturnResult)
		{
			TArray<UBlueprintNodeSpawner*>& ActionList = UnloadedActionDatabase.FindOrAdd(AssetDataOwner.ObjectPath);
			ActionList.Add(NodeSpawner);
		}
	}
	return bReturnResult;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:22,代码来源:BlueprintActionDatabaseRegistrar.cpp

示例14: DoReplaceReferences

bool FAssetDeleteModel::DoReplaceReferences(const FAssetData& ReplaceReferencesWith )
{
	if ( !CanReplaceReferences() )
	{
		return false;
	}

	// Find which object the user has elected to be the "object to consolidate to"
	UObject* ObjectToConsolidateTo = ReplaceReferencesWith.GetAsset();
	check( ObjectToConsolidateTo );

	TArray<UObject*> FinalConsolidationObjects;
	for ( TSharedPtr< FPendingDelete >& PendingDelete : PendingDeletes )
	{
		FinalConsolidationObjects.Add(PendingDelete->GetObject());
	}

	// The consolidation action clears the array, so we need to save the count.
	int32 ObjectsBeingDeletedCount = FinalConsolidationObjects.Num();

	// Perform the object consolidation
	bool bShowDeleteConfirmation = false;
	ObjectTools::FConsolidationResults ConsResults = ObjectTools::ConsolidateObjects( ObjectToConsolidateTo, FinalConsolidationObjects, bShowDeleteConfirmation );

	// If the consolidation went off successfully with no failed objects, prompt the user to checkout/save the packages dirtied by the operation
	if ( ConsResults.DirtiedPackages.Num() > 0 && ConsResults.FailedConsolidationObjs.Num() == 0)
	{
		FEditorFileUtils::PromptForCheckoutAndSave( ConsResults.DirtiedPackages, false, true );
	}
	// If the consolidation resulted in failed (partially consolidated) objects, do not save, and inform the user no save attempt was made
	else if ( ConsResults.FailedConsolidationObjs.Num() > 0)
	{
		//DisplayMessage( true, LOCTEXT( "Consolidate_WarningPartial", "Not all objects could be consolidated, no save has occurred" ).ToString() );
	}

	ObjectsDeleted = ObjectsBeingDeletedCount - ( ConsResults.FailedConsolidationObjs.Num() + ConsResults.InvalidConsolidationObjs.Num() );

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

示例15: HasCompatibleConnection

bool UMaterialGraphSchema::HasCompatibleConnection(const FAssetData& FunctionAssetData, uint32 TestType, EEdGraphPinDirection TestDirection) const
{
	if (TestType != 0)
	{
		const FString* CombinedInputTagValue = FunctionAssetData.TagsAndValues.Find(GET_MEMBER_NAME_CHECKED(UMaterialFunction, CombinedInputTypes));
		const FString* CombinedOutputTagValue = FunctionAssetData.TagsAndValues.Find(GET_MEMBER_NAME_CHECKED(UMaterialFunction, CombinedOutputTypes));
		uint32 CombinedInputTypes = CombinedInputTagValue ? FCString::Atoi(**CombinedInputTagValue) : 0;
		uint32 CombinedOutputTypes = CombinedOutputTagValue ? FCString::Atoi(**CombinedOutputTagValue) : 0;

		if (CombinedOutputTypes == 0)
		{
			// Need to load function to build combined output types
			UMaterialFunction* MaterialFunction = Cast<UMaterialFunction>(FunctionAssetData.GetAsset());
			if (MaterialFunction != nullptr)
			{
				CombinedInputTypes = MaterialFunction->CombinedInputTypes;
				CombinedOutputTypes = MaterialFunction->CombinedOutputTypes;
			}
		}

		if (TestDirection == EGPD_Output)
		{
			if (CanConnectMaterialValueTypes(CombinedInputTypes, TestType))
			{
				return true;
			}
		}
		else
		{
			if (CanConnectMaterialValueTypes(TestType, CombinedOutputTypes))
			{
				return true;
			}
		}
	}

	return false;
}
开发者ID:johndpope,项目名称:UE4,代码行数:38,代码来源:MaterialGraphSchema.cpp


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