<p>With my current understanding of how After Effects expressions work, I don't think that can be done.</p>
<p>According to user Mylenium in <a href="https://community.adobe.com/t5/after-effects-discussions/dynamic-keyframe-value-using-expression/m-p/10130410" rel="nofollow noreferrer">this comment thread</a>,</p>
<blockquote>
<p>Keyframe values are read-only</p>
</blockquote>

CC BY-SA 4.0
2021-10-29T02:41:45.803Z
2021-10-29T02:41:45.803Z
Stimpson
<p>I'm making a preset for my video projects. It's a shape layer that takes dimensions from a text layer, so the text fits accurately in the shape.</p>
<p>For this, I'm doing the following:</p>
<p>Shape Layer &gt; Contents &gt; Box &gt; Box shape (X, Y in pixels) &gt;</p>
<pre><code>width = thisComp.layer(&quot;Text&quot;).sourceRectAtTime().width;
height = thisComp.layer(&quot;Text&quot;).sourceRectAtTime().height;

[width, height]
</code></pre>
<p>Wich, as I said, it makes the text fit in the box. It works all fine here.
What I want to do is to animate the shape's dimensions (X and Y property, as said above) using keyframes instead of <code>linear()</code> or other expressions. I want to modify only one specified keyframe (in this case, the last one).</p>
<p>Thanks in advance!</p>

<after-effects><after-effects-expressions>
Change single keyframe value using expressions
spund3
# Change single keyframe value using expressions

(Asked by: username_0 on 2021-08-20)

I'm making a preset for my video projects. It's a shape layer that takes dimensions from a text layer, so the text fits accurately in the shape.
For this, I'm doing the following:
Shape Layer > Contents > Box > Box shape (X, Y in pixels) >
width = thisComp.layer("Text").sourceRectAtTime().width;
height = thisComp.layer("Text").sourceRectAtTime().height;

[width, height]

Wich, as I said, it makes the text fit in the box. It works all fine here.
What I want to do is to animate the shape's dimensions (X and Y property, as said above) using keyframes instead of linear() or other expressions. I want to modify only one specified keyframe (in this case, the last one).
Thanks in advance!

**Tags:** after-effects, after-effects-expressions


---

## 1 answers

### Answer by username_1 on 2021-10-29. Score: 0

With my current understanding of how After Effects expressions work, I don't think that can be done.

According to user Mylenium in [this comment thread](https://community.adobe.com/t5/after-effects-discussions/dynamic-keyframe-value-using-expression/m-p/10130410),

> Keyframe values are read-only


---

