本文整理汇总了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());
}
}
示例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);
}
}
示例3: OnAssetSelectedFromPicker
void SGlobalOpenAssetDialog::OnAssetSelectedFromPicker(const FAssetData& AssetData)
{
if (UObject* ObjectToEdit = AssetData.GetAsset())
{
FAssetEditorManager::Get().OpenEditorForAsset(ObjectToEdit);
}
}
示例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;
}
示例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());
}
}
}
示例6: IsOpenForRegistration
//------------------------------------------------------------------------------
bool FBlueprintActionDatabaseRegistrar::IsOpenForRegistration(FAssetData const& AssetKey)
{
UObject const* OwnerKey = GeneratingClass;
if (AssetKey.IsAssetLoaded())
{
OwnerKey = AssetKey.GetAsset();
}
return IsOpenForRegistration(OwnerKey);
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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: 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);
}
}
示例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;
}
示例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;
}
示例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;
}