void UMockingAnimInstance::NativeInitializeAnimation() { //Very Important Line Super::NativeInitializeAnimation(); MockingVehicle = Cast<AMockingVehicle>(GetOwningActor()); }
void UAnimInstance::Montage_Advance(float DeltaSeconds) { bool bUpdateRootMotionMontageInstance = false; FRootMotionMovementParams ExtractedRootMotion; // go through all montage instances, and update them // and make sure their weight is updated properly for (int32 I=0; I<MontageInstances.Num(); ++I) { // should never be NULL ensure(MontageInstances[I]); if( MontageInstances[I] ) { MontageInstances[I]->Advance(DeltaSeconds, ExtractedRootMotion); if( !MontageInstances[I]->IsValid() ) { delete MontageInstances[I]; MontageInstances.RemoveAt(I); bUpdateRootMotionMontageInstance = true; --I; } #if DO_CHECK && WITH_EDITORONLY_DATA && 0 else { FAnimMontageInstance * AnimMontageInstance = MontageInstances(I); // print blending time and weight and montage name UE_LOG(LogAnimation, Warning, TEXT("%d. Montage (%s), DesiredWeight(%0.2f), CurrentWeight(%0.2f), BlendingTime(%0.2f)"), I+1, *AnimMontageInstance->Montage->GetName(), AnimMontageInstance->DesiredWeight, AnimMontageInstance->Weight, AnimMontageInstance->BlendTime ); } #endif } } if( bUpdateRootMotionMontageInstance ) { UpdateRootMotionMontageInstance(); } // If Root Motion has been extracted, forward it to character physics. if( ExtractedRootMotion.bHasRootMotion ) { ACharacter * CharacterOwner = Cast<ACharacter>(GetOwningActor()); if( CharacterOwner && CharacterOwner->CharacterMovement ) { CharacterOwner->CharacterMovement->RootMotionParams.Accumulate(ExtractedRootMotion); } } }
class AWheeledVehicle * UVehicleAnimInstance::GetVehicle() { return Cast<AWheeledVehicle> (GetOwningActor()); }