void FUMGSequencerObjectBindingManager::BindPossessableObject( const FGuid& PossessableGuid, UObject& PossessedObject ) { UPanelSlot* PossessedSlot = Cast<UPanelSlot>(&PossessedObject); if ( PossessedSlot != nullptr && PossessedSlot->Content != nullptr ) { SlotContentPreviewObjectToGuidMap.Add(PossessedSlot->Content, PossessableGuid); GuidToSlotContentPreviewObjectsMap.Add(PossessableGuid, PossessedSlot->Content); // Save the name of the widget containing the slots. This is the object to look up that contains the slot itself(the thing we are animating) FWidgetAnimationBinding NewBinding; NewBinding.AnimationGuid = PossessableGuid; NewBinding.SlotWidgetName = PossessedSlot->GetFName(); NewBinding.WidgetName = PossessedSlot->Content->GetFName(); WidgetAnimation->AnimationBindings.Add(NewBinding); } else if( PossessedSlot == nullptr ) { PreviewObjectToGuidMap.Add(&PossessedObject, PossessableGuid); GuidToPreviewObjectsMap.Add(PossessableGuid, &PossessedObject); FWidgetAnimationBinding NewBinding; NewBinding.AnimationGuid = PossessableGuid; NewBinding.WidgetName = PossessedObject.GetFName(); WidgetAnimation->AnimationBindings.Add(NewBinding); } }
void UWidgetAnimation::BindPossessableObject(const FGuid& ObjectId, UObject& PossessedObject, UObject* Context) { // If it's the Root Widget if (&PossessedObject == PreviewWidget.Get()) { PreviewObjectToIds.Add(&PossessedObject, ObjectId); IdToPreviewObjects.Add(ObjectId, &PossessedObject); FWidgetAnimationBinding NewBinding; { NewBinding.AnimationGuid = ObjectId; NewBinding.WidgetName = PossessedObject.GetFName(); NewBinding.bIsRootWidget = true; } AnimationBindings.Add(NewBinding); return; } UPanelSlot* PossessedSlot = Cast<UPanelSlot>(&PossessedObject); if ((PossessedSlot != nullptr) && (PossessedSlot->Content != nullptr)) { SlotContentPreviewObjectToIds.Add(PossessedSlot->Content, ObjectId); IdToSlotContentPreviewObjects.Add(ObjectId, PossessedSlot->Content); // Save the name of the widget containing the slots. This is the object // to look up that contains the slot itself (the thing we are animating). FWidgetAnimationBinding NewBinding; { NewBinding.AnimationGuid = ObjectId; NewBinding.SlotWidgetName = PossessedSlot->GetFName(); NewBinding.WidgetName = PossessedSlot->Content->GetFName(); NewBinding.bIsRootWidget = false; } AnimationBindings.Add(NewBinding); } else if (PossessedSlot == nullptr) { PreviewObjectToIds.Add(&PossessedObject, ObjectId); IdToPreviewObjects.Add(ObjectId, &PossessedObject); FWidgetAnimationBinding NewBinding; { NewBinding.AnimationGuid = ObjectId; NewBinding.WidgetName = PossessedObject.GetFName(); NewBinding.bIsRootWidget = false; } AnimationBindings.Add(NewBinding); } }