void UFaceFXMatineeControlInst::InitTrackInst(UInterpTrack* Track) { UInterpGroupInst* GrInst = CastChecked<UInterpGroupInst>( GetOuter() ); AMatineeActor* MatineeActor = CastChecked<AMatineeActor>( GrInst->GetOuter() ); LastUpdatePosition = MatineeActor->InterpPosition; }
void UFaceFXMatineeControl::PreviewUpdateTrack( float NewPosition, UInterpTrackInst* TrackInst ) { UInterpGroupInst* GrInst = CastChecked<UInterpGroupInst>( TrackInst->GetOuter() ); AMatineeActor* MatineeActor = CastChecked<AMatineeActor>( GrInst->GetOuter() ); const bool bJump = !(MatineeActor->bIsPlaying); UpdateTrack(NewPosition, TrackInst, bJump); if(AActor* Actor = TrackInst->GetGroupActor()) { TInlineComponentArray<USkeletalMeshComponent*> SkelMeshComps; Actor->GetComponents(SkelMeshComps); const UFaceFXMatineeControlInst* TrackFaceFX = CastChecked<UFaceFXMatineeControlInst>(TrackInst); const float TimeElapsed = (bJump || NewPosition < TrackFaceFX->LastUpdatePosition) ? 0.F : NewPosition - TrackFaceFX->LastUpdatePosition; for(USkeletalMeshComponent* SkelMeshComp : SkelMeshComps) { // Update space bases so new animation position has an effect. if(SkelMeshComp->AnimScriptInstance) { SkelMeshComp->UpdateMaterialParameters(); } SkelMeshComp->RefreshBoneTransforms(); SkelMeshComp->RefreshSlaveComponents(); SkelMeshComp->UpdateComponentToWorld(); } } }
void UInterpTrackAkAudioEvent::PreviewUpdateTrack(float NewPosition, UInterpTrackInst* TrInst) { UInterpGroupInst* GrInst = CastChecked<UInterpGroupInst>( TrInst->GetOuter() ); AMatineeActor* MatineeActor = CastChecked<AMatineeActor>( GrInst->GetOuter() ); UInterpTrackInstAkAudioEvent* AkEventInst = CastChecked<UInterpTrackInstAkAudioEvent>( TrInst ); UInterpGroup* Group = CastChecked<UInterpGroup>( GetOuter() ); UInterpData* IData = CastChecked<UInterpData>( Group->GetOuter() ); // Dont play sounds unless we are preview playback (ie not scrubbing). bool bJump = !(MatineeActor->bIsPlaying); UpdateTrack(NewPosition, TrInst, bJump); }