ayon-core/setup/fusion/scripts/Comp/Version Up.py
2018-02-12 16:58:09 +01:00

13 lines
No EOL
392 B
Python

import colorbleed.lib
import avalon.fusion
attrs = comp.GetAttrs()
filename = comp.MapPath(attrs["COMPS_FileName"])
if not filename:
raise RuntimeError("File not saved yet. Can't increment version.")
new = colorbleed.lib.version_up(filename)
print("Incrementing comp to: {}".format(new))
with avalon.fusion.comp_lock_and_undo_chunk(comp, "Save incrementally.."):
comp.Save(new)