# Defocus from Metadata

**URL:** <https://forum.logik.tv/t/defocus-from-metadata/14907>\
**Category:** Tools and Tech\
**Tags:** action\
**Created:** [September 12, 2026, 4:03pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907 "2026-09-12T16:03:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_M](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/marcus_m/32/10887_2.png) [@Marcus\_M](https://forum.logik.tv/u/Marcus_M)\
**Post date:** [September 12, 2026, 4:03pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/1 "2026-09-12T16:03:19Z")

</div>

I’m currently matching some CGI into a shot. The shot had a lot of focus pulls that I was about to eye match. I realised this information was in the arriraw metadata so I say loosely that I created a script to transfer the metadata from the exr to the defocus node in batch and it was perfect. I’m just making this known if anyone else might find this useful and I’m happy to share the script but I only tested on a few arri clips so far so can’t guarantee it always works.

---

<div class="post-metadata">

**Author:** ![Sinan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/sinan/32/155_2.png) [@Sinan](https://forum.logik.tv/u/Sinan)\
**Post date:** [September 12, 2026, 4:48pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/2 "2026-09-12T16:48:16Z")

</div>

You should be able to map it with an expression with no scripts needed.

---

<div class="post-metadata">

**Author:** ![philm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/philm/32/9286_2.png) [@philm](https://forum.logik.tv/u/philm)\
**Post date:** [September 12, 2026, 4:55pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/3 "2026-09-12T16:55:02Z")

</div>

Wait

What

Metadata is useful?

Say it isn’t so

---

<div class="post-metadata">

**Author:** ![imag4media](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/imag4media/32/255_2.png) [@imag4media](https://forum.logik.tv/u/imag4media)\
**Post date:** [September 12, 2026, 8:04pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/4 "2026-09-12T20:04:17Z")

</div>

Haven’t tried that side of the trick yet, but should work. it’s been helpful to create your own duplicate keys so they don’t step on the orig. (ex. cinelens\_distance or cinelens\_iris)

Camera metadata can change format per manufacturer. also some tools don’t appreciate animated metadata, especially w slips. Workaround is baking the curves.

Its on my list of RnD to “unwrap” distortion and vig on plates w anim data from camera, but at the moment i’m finishing a tool to swap lenses as easily as the real deal. full sets 2x SPH and 2x ANA.

once you have setup, it helps to make a procedural solution so that they hook automatically to many tools at once. (distortion, DoF, vig, etc)

Also happy to share process to interested folk. Drop me DM

---

<div class="post-metadata">

**Author:** ![Marcus\_M](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/marcus_m/32/10887_2.png) [@Marcus\_M](https://forum.logik.tv/u/Marcus_M)\
**Post date:** [September 13, 2026, 8:49am UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/5 "2026-09-13T08:49:02Z")

</div>

I’ll attach my file to this message incase its of use. Maybe it could be added to the bigger picture. I’m currently looking for some Sony & Red Exrs to get it working on those as well.

M

[extract\_lens\_metadata.py](https://forum.logik.tv/uploads/short-url/9FlmxzxXkHbBuZhJO0hS8H61kKK.py) (20.7 KB)

---

<div class="post-metadata">

**Author:** ![Marcus\_M](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/marcus_m/32/10887_2.png) [@Marcus\_M](https://forum.logik.tv/u/Marcus_M)\
**Post date:** [September 13, 2026, 8:55am UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/6 "2026-09-13T08:55:24Z")

</div>

1. Right-click the plate → Lens Metadata → Extract Focus Curve
2. Enter the distance from camera to your element in metres. Check the Batch start frame and bokeh aspect (pre-filled from the lens squeeze). OK.
3. Add a Blur, set it to Defocus, Load Setup, pick the `.blur_node` it wrote to your Desktop.

---

<div class="post-metadata">

**Author:** ![philm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/philm/32/9286_2.png) [@philm](https://forum.logik.tv/u/philm)\
**Post date:** [September 13, 2026, 11:57am UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/7 "2026-09-13T11:57:09Z")

</div>

Sample footage is available from arri, red and Sony.

Just search the websites, download and transcode.

Or soft import, inject synthetic metadata (or not)

and export.

---

<div class="post-metadata">

**Author:** ![imag4media](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/imag4media/32/255_2.png) [@imag4media](https://forum.logik.tv/u/imag4media)\
**Post date:** [September 13, 2026, 2:01pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/8 "2026-09-13T14:01:39Z")

</div>

To get proper DoF you’ll also want to grab the sensor size and the tStop.

---

<div class="post-metadata">

**Author:** ![imag4media](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/imag4media/32/255_2.png) [@imag4media](https://forum.logik.tv/u/imag4media)\
**Post date:** [September 13, 2026, 5:27pm UTC](https://forum.logik.tv/t/defocus-from-metadata/14907/9 "2026-09-13T17:27:18Z")

</div>

Script looks good.

Camera metadata from source sometimes has the focus embedded in metadata keys. this is where i would copy that info to a “cinelens\_\*” metadata key. If diff camera metadata format, then it can all be sanitized to your own defined keys.

Once you have the keys to link, you could have a version that automatically matches distance from plate.

-Andy D
