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


C++ UInterpGroupInst类代码示例

本文整理汇总了C++中UInterpGroupInst的典型用法代码示例。如果您正苦于以下问题:C++ UInterpGroupInst类的具体用法?C++ UInterpGroupInst怎么用?C++ UInterpGroupInst使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetOuter

void UFaceFXMatineeControlInst::InitTrackInst(UInterpTrack* Track)
{
	UInterpGroupInst* GrInst = CastChecked<UInterpGroupInst>( GetOuter() );
	AMatineeActor* MatineeActor = CastChecked<AMatineeActor>( GrInst->GetOuter() );

	LastUpdatePosition = MatineeActor->InterpPosition;
}
开发者ID:oliverzx,项目名称:FaceFX-UE4,代码行数:7,代码来源:FaceFXMatineeControlInst.cpp

示例2: check

bool UMatineeTrackVectorPropHelper::PreCreateTrack( UInterpGroup* Group, const UInterpTrack *TrackDef, bool bDuplicatingTrack, bool bAllowPrompts ) const
{
	bool bResult = true;

	if( bAllowPrompts && bDuplicatingTrack == false )
	{
		bResult = false;

		// For Property tracks - pop up a dialog to choose property name.
		TrackAddPropName = NAME_None;

		FEdModeInterpEdit* Mode = (FEdModeInterpEdit*)GEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_InterpEdit );
		check(Mode != NULL);

		IMatineeBase* InterpEd = Mode->InterpEd;
		check(InterpEd != NULL);

		UInterpGroupInst* GrInst = InterpEd->GetMatineeActor()->FindFirstGroupInst(Group);
		check(GrInst);

		AActor* Actor = GrInst->GetGroupActor();
		if ( Actor != NULL )
		{
			TArray<FName> PropNames;
			FMatineeUtils::GetInterpVectorPropertyNames(Actor, PropNames);
			bResult = ChooseProperty(PropNames);
		}
	}

	return bResult;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:31,代码来源:MatineeTrackHelpers.cpp

示例3: PreviewUpdateTrack

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();
		}
	}
}
开发者ID:eirland,项目名称:FaceFX-UE4,代码行数:30,代码来源:FaceFXMatineeControl.cpp

示例4: PreviewUpdateTrack

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);
}
开发者ID:audiokinetic,项目名称:WwiseUE4Plugin,代码行数:12,代码来源:InterpTrackAkAudioEvent.cpp

示例5: CreateFromInterpGroup

bool UCameraAnim::CreateFromInterpGroup(class UInterpGroup* SrcGroup, class AMatineeActor* InMatineeActor)
{
	// assert we're controlling a camera actor
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
	{
		UInterpGroupInst* GroupInst = InMatineeActor ? InMatineeActor->FindFirstGroupInst(SrcGroup) : NULL;
		if (GroupInst)
		{
			check( GroupInst->GetGroupActor()->IsA(ACameraActor::StaticClass()) );
		}
	}
#endif
	
	// copy length information
	AnimLength = (InMatineeActor && InMatineeActor->MatineeData) ? InMatineeActor->MatineeData->InterpLength : 0.f;

	UInterpGroup* OldGroup = CameraInterpGroup;

	if (CameraInterpGroup != SrcGroup)
	{
		// copy the source interp group for use in the CameraAnim
		// @fixme jf: fixed this potentially creating an object of UInterpGroup and raw casting it to InterpGroupCamera.  No source data in UE4 to test though.
		CameraInterpGroup = Cast<UInterpGroupCamera>(StaticDuplicateObject(SrcGroup, this, NAME_None, RF_AllFlags, UInterpGroupCamera::StaticClass()));

		if (CameraInterpGroup)
		{
			// delete the old one, if it exists
			if (OldGroup)
			{
				OldGroup->MarkPendingKill();
			}

			// success!
			return true;
		}
		else
		{
			// creation of new one failed somehow, restore the old one
			CameraInterpGroup = OldGroup;
		}
	}
	else
	{
		// no need to perform work above, but still a "success" case
		return true;
	}

	// failed creation
	return false;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:50,代码来源:CameraAnim.cpp

示例6: check

UInterpGroup* FAssetTypeActions_CameraAnim::CreateInterpGroup(UCameraAnim* InCameraAnim, FCameraPreviewInfo& PreviewInfo)
{
	check(InCameraAnim);

	CreatePreviewPawn(InCameraAnim, PreviewInfo.PawnClass, PreviewInfo.Location, PreviewInfo.Rotation);

	PreviewInfo.PawnInst = PreviewPawn.Get();

	if (PreviewInfo.PawnInst)
	{
		// create InterpGroup so that we can play animation to this pawn
		check(PreviewMatineeActor.Get()->MatineeData);
		UInterpGroup* NewGroup = ConstructObject<UInterpGroup>(UInterpGroup::StaticClass(), PreviewMatineeActor.Get()->MatineeData, NAME_None, RF_Transient);
		NewGroup->GroupName = FName(TEXT("Preview Pawn"));
		NewGroup->EnsureUniqueName();

		PreviewMatineeActor.Get()->MatineeData->InterpGroups.Add(NewGroup);

		// now add group inst
		UInterpGroupInst* NewGroupInst = ConstructObject<UInterpGroupInst>(UInterpGroupInst::StaticClass(), PreviewMatineeActor.Get(), NAME_None, RF_Transient);
		// Initialise group instance, saving ref to actor it works on.
		NewGroupInst->InitGroupInst(NewGroup, PreviewInfo.PawnInst);
		const int32 NewGroupInstIndex = PreviewMatineeActor.Get()->GroupInst.Add(NewGroupInst);

		//Link group with actor
		PreviewMatineeActor.Get()->InitGroupActorForGroup(NewGroup, PreviewInfo.PawnInst);

		// Now time to add AnimTrack so that we can play animation
		int32 AnimTrackIndex = INDEX_NONE;
		// add anim track but do not use addtotrack function that does too many things 
		// Construct track and track instance objects.
		UInterpTrackAnimControl* AnimTrack = ConstructObject<UInterpTrackAnimControl>( UInterpTrackAnimControl::StaticClass(), NewGroup, NAME_None, RF_Transient );
		check(AnimTrack);

		NewGroup->InterpTracks.Add(AnimTrack);
		
		// use config anim slot
		AnimTrack->SlotName = FName(*GConfig->GetStr(TEXT("MatineePreview"), TEXT("DefaultAnimSlotName"), GEditorIni));
		UInterpTrackInst* NewTrackInst = ConstructObject<UInterpTrackInst>( AnimTrack->TrackInstClass, NewGroupInst, NAME_None, RF_Transient );
		check(NewTrackInst);

		NewGroupInst->TrackInst.Add(NewTrackInst);

		// Initialize track, giving selected object.
		NewTrackInst->InitTrackInst(AnimTrack);

		// Save state into new track before doing anything else (because we didn't do it on ed mode change).
		NewTrackInst->SaveActorState(AnimTrack);
		check(NewGroupInst->TrackInst.Num() > 0);

		// add default anim curve weights to be 1
		int32 KeyIndex = AnimTrack->CreateNewKey(0.0f);
		AnimTrack->SetKeyOut(0, KeyIndex, 1.0f);

		if(PreviewInfo.AnimSeq != NULL)
		{
			KeyIndex = AnimTrack->AddKeyframe(0.0f, NewGroupInst->TrackInst[0], CIM_Linear);
			FAnimControlTrackKey& NewSeqKey = AnimTrack->AnimSeqs[KeyIndex];
			NewSeqKey.AnimSeq = PreviewInfo.AnimSeq;	
		}

		PreviewPawn = PreviewInfo.PawnInst;

		return NewGroup;
	}
	return NULL;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:67,代码来源:AssetTypeActions_CameraAnim.cpp

示例7: KeySelectedColor

void UFaceFXMatineeControl::DrawTrack( FCanvas* Canvas, UInterpGroup* Group, const FInterpTrackDrawParams& Params )
{
	static const FColor	KeySelectedColor(255,128,0);
	static const FColor KeyLabelColor(225,225,225);
	static const FColor KeyBackgroundColor(0,150,200);
	static const FColor KeyColorBlack(0,0,0);
	static const int32	KeyVertOffset = 3;

	const bool bHitTesting = Canvas->IsHitTesting();
	const bool bAllowBarSelection = bHitTesting && Params.bAllowKeyframeBarSelection;
	const bool bAllowTextSelection = bHitTesting && Params.bAllowKeyframeTextSelection;

	AMatineeActor* MatineeActor = CastChecked<AMatineeActor>(Group->GetOuter()->GetOuter());
	UInterpGroupInst* GroupInst = MatineeActor->FindFirstGroupInst(Group);
	const AActor* GroupActor = GroupInst ? GroupInst->GetGroupActor() : nullptr;

	//cached animation ids
	TArray<FFaceFXAnimId> AnimIds;
	AnimIds.AddUninitialized(Keys.Num());
	
	//Draw the tiles for each animation
	for (int32 i = 0; i < Keys.Num(); i++)
	{
		const FFaceFXTrackKey& AnimKey = Keys[i];

		FFaceFXAnimId AnimationId;
		if(AnimKey.AnimationId.IsValid())
		{
			AnimationId = AnimKey.AnimationId;
		}
		else if(const UFaceFXAnim* Animation = GetAnimation(AnimKey, this))
		{
			AnimationId = Animation->GetId();
		}

		AnimIds[i] = AnimationId;

		//determine animation duration
		const float AnimStartTime = AnimKey.Time;
		const float AnimEndTime = AnimStartTime + AnimKey.GetAnimationDuration(GroupActor);

		const int32 StartPixelPos = FMath::TruncToInt((AnimStartTime - Params.StartTime) * Params.PixelsPerSec);
		const int32 EndPixelPos = FMath::TruncToInt((AnimEndTime - Params.StartTime) * Params.PixelsPerSec);

		// Find if this sound is one of the selected ones.
		bool bKeySelected = false;
		for (const FInterpEdSelKey& SelectedKey : Params.SelectedKeys)
		{
			if(SelectedKey.Group == Group && SelectedKey.Track == this && SelectedKey.KeyIndex == i)
			{
				bKeySelected = true;
				break;
			}
		}

		const FColor& BorderColor = bKeySelected ? KeySelectedColor : KeyColorBlack;

		if(bAllowBarSelection) 
		{
			Canvas->SetHitProxy(new HInterpTrackKeypointProxy(Group, this, i));
		}
		Canvas->DrawTile(StartPixelPos, KeyVertOffset, EndPixelPos - StartPixelPos + 1, FMath::TruncToFloat(Params.TrackHeight - 2.f*KeyVertOffset), 0.f, 0.f, 1.f, 1.f, BorderColor);
		Canvas->DrawTile(StartPixelPos+1, KeyVertOffset+1, EndPixelPos - StartPixelPos - 1, FMath::TruncToFloat(Params.TrackHeight - 2.f*KeyVertOffset) - 2, 0.f, 0.f, 1.f, 1.f, KeyBackgroundColor);
		if(bAllowBarSelection)
		{
			Canvas->SetHitProxy(nullptr);
		}
	}
	
	// Use base-class to draw key triangles
	Super::DrawTrack( Canvas, Group, Params );

	//Draw animation names on top
	for (int32 i = 0; i < Keys.Num(); i++)
	{
		const FFaceFXTrackKey& AnimKey = Keys[i];
		
		//fetch the cached animation id for the key
		const FFaceFXAnimId& AnimId = AnimIds[i];

		FString AnimName(TEXT("Unknown"));
		if(AnimId.IsValid())
		{
			AnimName = AnimId.Group.IsNone() ? TEXT("") : AnimId.Group.ToString() + TEXT(" / ");
			AnimName += AnimId.Name.ToString();
		}

		if(AnimKey.bLoop)
		{
			AnimName += TEXT(" [Looping]");
		}

		int32 XL, YL;
		StringSize(GEngine->GetSmallFont(), XL, YL, *AnimName);

		if (bAllowTextSelection)
		{
			Canvas->SetHitProxy(new HInterpTrackKeypointProxy(Group, this, i));
		}

//.........这里部分代码省略.........
开发者ID:eirland,项目名称:FaceFX-UE4,代码行数:101,代码来源:FaceFXMatineeControl.cpp


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