Delete Iterations via Python?

Am I crazy or was there a Delete Iterations (except for the highest iteration) python script floating around?

It’s in the flame examples folder:
/opt/Autodesk/flame_2021.1/python_examples/clean_batch_iteration.py

Legend! Thank you.

Ooh. This sounds good. I’ll have to take a look and see how easy it is modified to keep the latest five.

Not that easy. I really need to learn me some python

1 Like

@MikeV do you know the answer to this? I haven’t tried yet, but I’m wondering if a for loop would work. Where I >5, or something like that?

Wherever you see these lines in the Autodesk sample script:

for iteration in batch_group.batch_iterations:
flame.delete(iteration, confirm=False)

You could change it to:

for iteration in batch_group.batch_iterations[:-5]:
flame.delete(iteration, confirm=False)

This will prevent it from deleting the last 5 iterations in a batch group as it runs the delete loop.

Mike

2 Likes

#BOOM!! Thanks man!!

Thanks @MikeV

I modified the script using your suggestion.
It works very nicely. Thanks @MikeV

1 Like