Wow. This is something I was working on this morning, and now after reading this, I'm really surprised that accepting numerical values from the command line is not something that is native in Nuke Python. Python yes, but in the nuke module, No?
[working on this]
Okay, here is a solution, but still ("Hey, Foundry!") why arg vectors can't take ints and floats from the command line when nuke is running a nuke module is beyond me.
But try this:
Pass the numbers as a string. Yeah, goofy, but you can make it work then.
Here is my testing script which I named "test.py".
Take these lines and paste them into a python file.
script = sys.argv
print "1 is: " + script
file1 = sys.argv
print "2 is: " + file1
file2 = sys.argv
print "3 is: " + file2
## submit numbers as a string
range = sys.argv
## filter the string into numbers
a0 = str(range)
a1 = a0.split(" ") ## make it into list
a2 = str(a1) ## make the list into a string
a3 = a2.replace('[',' ') ## get rid of front bracket
a4 = a3.replace(']',' ') ## get rid of back bracket
a5 = a4.replace(' ','') ## get rid of spaces
a6 = str(a5)
a6i1 = a6.find("','") ##forward find the gap between fs and fe
a6i2 = a6.rfind("','") ## reverse find the gap betweeen fi and fe
fs = int(a6[+1:a6i1]) ## find fs in the string and caste it as an int
fi = int(a6[a6i2+3:-1]) ## same for fi
fe = int(a6[a6i1+3:a6i2]) ## same for fe
print "4 is: " + str(fs)
print "5 is: " + str(fe)
print "6 is: " + str(fi)
What I wanted were arguments passed to a simple nuke script that would turn a sequence of images from one file format to another (eg. like jpg to tif).
So, I wanted to pass the following through args at the command line:
or, in example:
nuke7.0 -x test.py foo.%04d.jpg bar.%04d.tif 1 10 1
But since I could not pass the frame values as numbers, I passed them like this:
nuke7.0 -x test.py foo.%04d.jpg bar.%04d.tif "1 10 1"
The filtering of the last string leaves it in this format:
All you have to do is filter the beginning, end and middle indexes for that string and you find the numbers contained there no matter what they are.
(see script example for details)
PS - It works, but it's a silly pain. Foundry needs to fix this.