Isotropix Forums

Version-up script for Clarisse (Nuke Style)

Find useful scripts shared by the community here

Version-up script for Clarisse (Nuke Style)

Unread postby Arvid » Fri Nov 08, 2013 3:24 pm

I made a script to automatically save a new version of your project using the same conventions as Nuke. It's especially useful in combination with the $PNAME variable for your output paths because it makes it easy to version-up in Nuke. Hope you find it useful, and perhaps we can get this as a native function in Clarisse soon as well! :mrgreen:

Add it to the toolbar by right-clicking -> Add item

python code

# Python script for Clarisse
# Saves a new version of the project by increasing the version number, Nuke-style.
# Use a "v" followed by a number with any padding in the filename such as "file_v001.project" and the script will find the version and save a new file for you.

def padding(s, num, p="0"):
while len(s) < num: s = p + s
return s

def log(i):

def getProjectPath():
path = ix.application.get_factory().get_vars().get("PDIR").get_string() + "/"
project_file = ix.application.get_factory().get_vars().get("PNAME").get_string()

if project_file.find(".project") == -1: project_file += ".project"

project = path + project_file

return path, project, project_file

def numeric(s):
return int(s), True
return "", False

def versionUp(n = ""):
path, project, file_name = getProjectPath()

file = project

if len(n)>0: file = n # use argument passed if there is one

v = file.rfind("v")

if v == -1: return file, False # no "v" found

b = ""
for i in range(v+1,len(file)): # look for numbers following the "v"
n, ok = numeric(file[i])
if ok: b = b + file[i]
else: break # stop looking at the first non-number

pad = len(b)
if pad == 0: return file, False # the v had no numbers after it

version, success = numeric(b) # get integer from string

if not success: return file, False # non-number snuck in?
version = version + 1

restr = padding(str(version), pad) # add back padding zeroes

return file[:v] + "v" + restr + file[v+pad+1:], True # construct new project name and return

new_name, success = versionUp()

if success: ix.save_project(new_name)
Posts: 191
Joined: Thu Jan 31, 2013 3:44 pm

Re: Version-up script for Clarisse

Unread postby isoyann » Tue Dec 10, 2013 11:59 am

Works like a charm, nice work! :)
User avatar
Posts: 640
Joined: Mon Jan 28, 2013 11:11 am

Re: Version-up script for Clarisse (Nuke Style)

Unread postby jhoey » Thu May 01, 2014 12:36 am

Oh, that is handy. Thanks, Arvid!
Jeremy Hoey
Senior Digital Matte Artist, Method Studios Vancouver
Posts: 93
Joined: Sat Mar 22, 2014 9:37 am
Location: Vancouver, BC

Re: Version-up script for Clarisse (Nuke Style)

Unread postby vinyvince » Fri Jun 17, 2016 5:36 pm

Super cool!

Thanks for sharing with us :)


Posts: 27
Joined: Sun May 29, 2016 12:50 pm
Posts: 41
Joined: Sun May 29, 2016 1:50 pm

Return to Useful Community Scripts