# Overwrite default pattern for batch name

**URL:** <https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765>\
**Category:** Python\
**Created:** [January 4, 2022, 10:19am UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765 "2022-01-04T10:19:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyleobley](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@kyleobley](https://forum.logik.tv/u/kyleobley)\
**Post date:** [January 4, 2022, 10:19am UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/1 "2022-01-04T10:19:42Z")

</div>

Hey all,

Does anyone know if it’s possible to change the naming pattern for a batchgroup? We have a standard name setup [batch name] \_\_comp\_\_v[iteration###] but I’m working on some scripts that use Python to create the base batchgroup but based per task (i.e. comp, clean-up, matte).

I’ve managed to get everything working just fine with the proper names and all but now our default naming is getting in the way. So for cleanup and mattes I get: 0010\_\_cleanup\_\_comp\_\_v001 which makes sense. I’d rather not change the default naming for various reasons so is there anyway to overwrite this?

Cheers!

---

<div class="post-metadata">

**Author:** ![claussteinmassl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/claussteinmassl/32/1922_2.png) [@claussteinmassl](https://forum.logik.tv/u/claussteinmassl)\
**Post date:** [January 4, 2022, 10:26am UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/2 "2022-01-04T10:26:10Z")

</div>

Hey Kyle,

there is a hook for setting up the default name:

```auto

def batch_default_iteration_name(project, *args, **kwargs):
    return "<batch name>_comp_v<iteration###>"

```

But I think you can’t change that dynamically. It only runs on startup to overwrite the preferences.

How do you create the batch files so they get this naming? I would assume you could change their name to your needs after the creation… 🤔

Cheers,  
Claus

---

<div class="post-metadata">

**Author:** ![kyleobley](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@kyleobley](https://forum.logik.tv/u/kyleobley)\
**Post date:** [January 4, 2022, 11:08am UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/3 "2022-01-04T11:08:13Z")

</div>

Hey Claus,

Yeah, that’s what I use to define the default name currently. This new method names the batch based on clip name + task unless it’s a comp since that’s usually what things are. I suppose I’m making it difficult on myself trying to keep the default name but overwrite only in certain senarios.

I’ll try seeing if I can adjust the default iteration name dynamically…might work…

Thanks!

---

<div class="post-metadata">

**Author:** ![kyleobley](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@kyleobley](https://forum.logik.tv/u/kyleobley)\
**Post date:** [January 4, 2022, 11:45am UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/4 "2022-01-04T11:45:07Z")

</div>

Yeah, no luck @claussteinmassl . You’re right that it seems to only be called when the project is loaded.

---

<div class="post-metadata">

**Author:** ![claussteinmassl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/claussteinmassl/32/1922_2.png) [@claussteinmassl](https://forum.logik.tv/u/claussteinmassl)\
**Post date:** [January 4, 2022, 12:21pm UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/5 "2022-01-04T12:21:56Z")

</div>

I did a quick test. After you created the batch group, you can access the current iteration and change it’s name:

```auto
import flame
batch_group = flame.batch.create_batch_group(name="foo")
cur_iteration = batch_group.current_iteration
cur_iteration.name = "<batch name>_bar_v<iteration###>"

```

 ![Screen Shot 2022-01-04 at 13.15.39](https://us1.discourse-cdn.com/flex020/uploads/thedepartmentofexternalservices/original/2X/2/239d996bcef5a55f0d079a7b9faeb83c3273811b.png)

Maybe we can also call the hook to find out which pattern has been defined, so the above code respects that naming pattern and only changes “comp” to something else… 🤔

---

<div class="post-metadata">

**Author:** ![kyleobley](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@kyleobley](https://forum.logik.tv/u/kyleobley)\
**Post date:** [January 4, 2022, 12:48pm UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/6 "2022-01-04T12:48:29Z")

</div>

Oh man, nice one! I didn’t realize you could change the iteration name like that. That worked perfectly, thank you so much.

For our current use I wouldn’t need to check the pattern since anything but a comp is an exception so I can simply add this little nugget of goodness into that case.

Finally I can have our Flame comp names match Nuke. Yay for a clean workflow and uniformity!

Many thanks again!

---

<div class="post-metadata">

**Author:** ![claussteinmassl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/claussteinmassl/32/1922_2.png) [@claussteinmassl](https://forum.logik.tv/u/claussteinmassl)\
**Post date:** [January 4, 2022, 1:48pm UTC](https://forum.logik.tv/t/overwrite-default-pattern-for-batch-name/4765/7 "2022-01-04T13:48:05Z")

</div>

You’re welcome! 🙂
