# Missing Animation Curves in Cooked Builds

**URL:** <https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784>\
**Category:** Character & Animation\
**Tags:** Cooking, UE4-17, unreal-engine, question, CPP\
**Created:** [September 29, 2017, 9:55pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784 "2017-09-29T21:55:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4ec72694](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4ec72694](https://forums.unrealengine.com/u/anonymous_user_4ec72694)\
**Post date:** [September 29, 2017, 9:55pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/1 "2017-09-29T21:55:03Z")

</div>

We are noticing our animation curves in 4.17.2 is being dropped in cooked builds. I came across this piece of code in AnimSequence which clears the animation curves before serializing and then put back the curves. We basically disabled this portion of the code and now our animation curves came back in cooked builds. Is there another way to put in animation curves? Are we missing a step for cooking animation curves? Or is this the plan to not use animation curves?

thanks  
–bill

```
void UAnimSequence::Serialize(FArchive& Ar)
{
	Ar.UsingCustomVersion(FFrameworkObjectVersion::GUID);

	FRawCurveTracks RawCurveCache;

	if (Ar.IsCooking())
	{
		RawCurveCache.FloatCurves = MoveTemp(RawCurveData.FloatCurves);
		RawCurveData.FloatCurves.Reset();

#if WITH_EDITORONLY_DATA
		RawCurveCache.VectorCurves = MoveTemp(RawCurveData.VectorCurves);
		RawCurveData.VectorCurves.Reset();

		RawCurveCache.TransformCurves = MoveTemp(RawCurveData.TransformCurves);
		RawCurveData.TransformCurves.Reset();
#endif
	}

	Super::Serialize(Ar);

	if (Ar.IsCooking())
	{
		RawCurveData.FloatCurves = MoveTemp(RawCurveCache.FloatCurves);
#if WITH_EDITORONLY_DATA
		RawCurveData.VectorCurves = MoveTemp(RawCurveCache.VectorCurves);
		RawCurveData.TransformCurves = MoveTemp(RawCurveCache.TransformCurves);
#endif
	}

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4ec72694](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4ec72694](https://forums.unrealengine.com/u/anonymous_user_4ec72694)\
**Post date:** [September 29, 2017, 10:47pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/2 "2017-09-29T22:47:52Z")

</div>

Nevermind. I found out that there was an accessor function (UAnimSequence::GetCurveData) that we have to go through to get the curves which decides if it gets the raw curve or the compressed curve.

Thanks!

---

<div class="post-metadata">

**Author:** ![ForRealz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forrealz/32/88716_2.png) [@ForRealz](https://forums.unrealengine.com/u/ForRealz)\
**Post date:** [December 3, 2017, 8:42pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/3 "2017-12-03T20:42:12Z")

</div>

Thanks, this helped me out.

---

<div class="post-metadata">

**Author:** ![Highflex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Highflex](https://forums.unrealengine.com/u/Highflex)\
**Post date:** [March 26, 2018, 8:47pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/4 "2018-03-26T20:47:02Z")

</div>

I ran into this Issue recently when i was testing various Animations in a Cooked Build:

Turns out i was getting the Data using Animation-\>RawCurveData which directly uses the Raw Curve, though this won’t work in Cooked Builds anymore so you have to use Animation-\>GetCurveData() which takes care of choosing between CompressedCurveData or RawCurveData, as example to access the Curve it could look like this:

(Animation-\>GetCurveData().GetCurveData(Uid));

---

<div class="post-metadata">

**Author:** ![Rainbowdash](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rainbowdash](https://forums.unrealengine.com/u/Rainbowdash)\
**Post date:** [July 31, 2019, 11:35am UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/5 "2019-07-31T11:35:44Z")

</div>

for me GetCurveData() returns an empty array in cooked builds UE4.22

i’m trying to get curve keys from an UAnimSequence with following code

```
Sequence->GetCurveData().GetCurveData(Uid)

```

did i miss something?

AnimSequenceBase.h line107 looks like this it just returns RawCurveData:

```
virtual const FRawCurveTracks& GetCurveData() const { return RawCurveData; }
```

---

<div class="post-metadata">

**Author:** ![ForRealz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/forrealz/32/88716_2.png) [@ForRealz](https://forums.unrealengine.com/u/ForRealz)\
**Post date:** [July 31, 2019, 4:50pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/6 "2019-07-31T16:50:32Z")

</div>

In 4.22, they removed CompressedCurveData. Seems like it might be related to your issue, but I’m not sure.

---

<div class="post-metadata">

**Author:** ![Rainbowdash](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rainbowdash](https://forums.unrealengine.com/u/Rainbowdash)\
**Post date:** [July 31, 2019, 10:45pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/7 "2019-07-31T22:45:01Z")

</div>

Yes looked through the commits, its now a byte Stream.

```
 TArray<uint8> CompressedCurveByteStream;
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_864904b2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_864904b2](https://forums.unrealengine.com/u/anonymous_user_864904b2)\
**Post date:** [October 31, 2019, 2:25pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/8 "2019-10-31T14:25:56Z")

</div>

Hello, is anybody managed to get curve in packaged build? (GetCurveData doesn’t work for me)

---

<div class="post-metadata">

**Author:** ![Rainbowdash](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rainbowdash](https://forums.unrealengine.com/u/Rainbowdash)\
**Post date:** [November 3, 2019, 10:43pm UTC](https://forums.unrealengine.com/t/missing-animation-curves-in-cooked-builds/405784/9 "2019-11-03T22:43:23Z")

</div>

For finding a curve value at a specific time i use something like this, maybe this helps you out. (Works in a Shipping build).

```
void yourfunction (UAnimSequence* Sequence, FName CurveName){
    
    		USkeleton* Skeleton = Sequence->GetSkeleton();
    
    		const FSmartNameMapping* NameMapping = Skeleton->GetSmartNameContainer(USkeleton::AnimCurveMappingName);
    
    		USkeleton::AnimCurveUID Uid;
    		Uid = NameMapping->FindUID(CurveName);
    
                   float value = Sequence->EvaluateCurveData(Uid, <TIME>);
    
    }
```
