My last post describe how to render with NUKE from command line/terminal. Now i want to introduce shell script for NUKE batch render.
Lets take some folders with our DPX files:
~/nuke_prj/footage003
~/nuke_prj/footage035
~/nuke_prj/footage056
Define output folder:
~/nuke_prj_output/
Nuke render script:
nuke_batch_convertion_to_jpg.nk
Now our shell script. Just copy text below in your text file in ~/nuke_prj/ folder. Don't forget to setup permissions with chmod.
startdate=`date +"d%dm%my%yh%Hm%M"`
if test $1; then
echo "Your input directory is $1"
else
echo "Please, define an input directory."
exit
fi
if test $2; then
echo "Your output directory is $2"
else
echo "Please, define an output directory"
exit
fi
if [ "$1" = "$2" ]; then
echo "Can't output into input, sorry!"
exit
fi
list=`find $1 -name footage*`
count=0
for folder in $list
do
let "count+=1"
done
echo "Found $count source folders in $1"
i=1
for folder in $list
do
echo "($i/$count) Processing $folder..."
newfolder=${folder/$1/$2}
echo "($i/$count) Creating $newfolder..."
mkdir -p $newfolder
files=(`ls $folder| cut -d'.' -f1`)
filecount=0
for file in ${files[@]}
do
let "filecount+=1"
done
startframe=${files[0]}
endframe=$((startframe+filecount-1))
input=${folder}
output=${newfolder}
echo "Processing $filecount files"
if test ! -e $2/render_log.txt; then
echo "Writing log in $2/render_log_$startdate.txt"
touch $2/render_log_$startdate.txt
fi
/Applications/Nuke/Nuke/Nuke -x $1/batch.nk $input $output $startframe,$endframe >> $2/render_log_$startdate.txt
let "i+=1"
done
Check path to your nuke program executable in this script. And enter next string in shell:
[you_batch_script_filename] ~/nuke_prj/ ~/nuke_prj_output/
Hit return and wait while all files in folder ~/nuke_prj/ will be converted to ~/nuke_prj_output/
вторник, 15 июня 2010 г.
четверг, 10 июня 2010 г.
NUKE command line render
How to render with nuke from command line/terminal?
Answer is simple.
Just make simple script. Here's example:
Read1 - Reformat - Write
Put "/path/[argv 0].%07d.dpx" string in file field of your Read node.
This is your path into folder with DPX files and mysterious [argv 0] string, which tells NUKE filename from argument set in command line/terminal.
Next I use Reformat node to do some simple work in this example. Lets reformat DPX to PAL.)))
And finally, I add Write node with another file field string like "/path/output/[argv 0].#######.jpg". In this node i've changed path for output folder and use same argument [argv 0] for filename.
Save script. Close NUKE.
Last step is enter command:
nuke.exe -x my_script.nk myfilename 1,50
Nuke will execute my_script.nk created earlier, get myfilename and render 50 frames.
That's all.
Answer is simple.
Just make simple script. Here's example:
Read1 - Reformat - Write
Put "/path/[argv 0].%07d.dpx" string in file field of your Read node.
This is your path into folder with DPX files and mysterious [argv 0] string, which tells NUKE filename from argument set in command line/terminal.
Next I use Reformat node to do some simple work in this example. Lets reformat DPX to PAL.)))
And finally, I add Write node with another file field string like "/path/output/[argv 0].#######.jpg". In this node i've changed path for output folder and use same argument [argv 0] for filename.
Save script. Close NUKE.
Last step is enter command:
nuke.exe -x my_script.nk myfilename 1,50
Nuke will execute my_script.nk created earlier, get myfilename and render 50 frames.
That's all.
Подписаться на:
Сообщения (Atom)