# Python in Flame, automatically create a script in Nuke

**URL:** <https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545>\
**Category:** Python\
**Created:** [April 15, 2022, 9:28am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545 "2022-04-15T09:28:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chadi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/chadi/32/643_2.png) [@chadi](https://forum.logik.tv/u/chadi)\
**Post date:** [April 15, 2022, 9:28am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/1 "2022-04-15T09:28:12Z")

</div>

Hello  
It is all almost in the title, but is it possible to make a python script that can let me create a Nuke script using import and export nodes data inside a Batch to automate the creation of Nuke scripts based on batches?

---

<div class="post-metadata">

**Author:** ![chadi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/chadi/32/643_2.png) [@chadi](https://forum.logik.tv/u/chadi)\
**Post date:** [April 15, 2022, 9:29am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/2 "2022-04-15T09:29:02Z")

</div>

Of course the creation of that Nuke script is to be able to export an EXR sequence with metadata copied from original sequence

---

<div class="post-metadata">

**Author:** ![andymilkis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/andymilkis/32/11067_2.png) [@andymilkis](https://forum.logik.tv/u/andymilkis)\
**Post date:** [April 15, 2022, 9:54am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/3 "2022-04-15T09:54:44Z")

</div>

Hi Chadi,

I have to think that it is possible although I’ve never done it. With the flame Python API you can get the path and file name of clips, so it should be pretty straightforward to insert that information into a new Nuke script with Python.

---

<div class="post-metadata">

**Author:** ![chadi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/chadi/32/643_2.png) [@chadi](https://forum.logik.tv/u/chadi)\
**Post date:** [April 15, 2022, 10:00am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/4 "2022-04-15T10:00:48Z")

</div>

Any idea where I can start? I have never done Python in Flame before, but have some scripting notions  
Thanks Andy

---

<div class="post-metadata">

**Author:** ![andymilkis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/andymilkis/32/11067_2.png) [@andymilkis](https://forum.logik.tv/u/andymilkis)\
**Post date:** [April 15, 2022, 11:04am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/5 "2022-04-15T11:04:09Z")

</div>

Yes. Go to the help files in flame and look in the API section. You’ll see a heading called Python API Examples. I’m pretty sure that the command to import clips or get the path is in there. You can pop open the flame python console and test it out.

---

<div class="post-metadata">

**Author:** ![andymilkis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/andymilkis/32/11067_2.png) [@andymilkis](https://forum.logik.tv/u/andymilkis)\
**Post date:** [April 15, 2022, 11:05am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/6 "2022-04-15T11:05:37Z")

</div>

And def check out this early Logik Live that I did with @fredwarren

[![](https://us1.discourse-cdn.com/flex020/uploads/thedepartmentofexternalservices/original/2X/e/e4f426d04a3d9c5c1d8f81661c8d17c5425b9bea.jpeg "Logik Live Episode #07 - Writing Python Scripts for Flame with Andy Milkis and Frederic Warren") ](https://www.youtube.com/watch?v=jfxJYUnWIjY)

---

<div class="post-metadata">

**Author:** ![chadi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/chadi/32/643_2.png) [@chadi](https://forum.logik.tv/u/chadi)\
**Post date:** [April 15, 2022, 11:38am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/7 "2022-04-15T11:38:29Z")

</div>

Watching it now 🙂

---

<div class="post-metadata">

**Author:** ![mikael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikael](https://forum.logik.tv/u/mikael)\
**Post date:** [February 8, 2024, 11:35am UTC](https://forum.logik.tv/t/python-in-flame-automatically-create-a-script-in-nuke/5545/8 "2024-02-08T11:35:34Z")

</div>

Did you manage to get this working? would be interesting to see how.
