Nuke: batch convert images

Convert a folder of images from one format to another using Nuke

NukeConvert

I made a python script that will take a folder of images and convert them to your format of choice using Nuke in command line mode. It can also iterate through all the subfolders and rebuild the tree in the destination, converting any images it finds. Handy for converting a bunch of dpx files to jpg for a website, or converting a whole tree of CG passes from one format to another. It goes through Nuke so default colourspaces for each format are applied. The script sets jpgs to 100% quality and sets exrs to the format that is most efficient for Nuke. So if your CG passes are in the wrong exr format, you could run them through this to speed up your comp.

Runs in a linux terminal. Look in the .py file for examples of how to call it.

Friendly version

Some users are not keen on typing long commands into the terminal so I have also made a GUI interface which you can run directly from a Nuke menu. Just add the menu item, using the example menu.py line included, and when you run the tool in Nuke it will bring up a friendly dialog asking for the source and destination directories and other options. When you press OK, it loads a terminal and runs the above script using the options you gave. Though I could run it completely invisibly, I chose to run it in a terminal so you could see its progress and estimated time left. So even though you are launching it from within Nuke, it’s running a separate background instance of Nuke to do the converting. You can carry on comping.

In a good pipeline you shouldn’t have to do conversions like this but there’s always some unusual circumstance where a bunch of files need to be converted for one reason or another. A handy tool to have in those situations, or if in a more ad-hoc environment.

Download here

Advertisements

About davemne
VFX artist, developer and musician from the UK.

3 Responses to Nuke: batch convert images

  1. Choua Vang says:

    Hi David, I’m having trouble getting this to work. It could be because I’m trying to run this on windows instead of Linux. If so, then that could just be the problem, but if not here is my question.

    I believe I did everything correctly because the menu and everything is working fine. But when I get to the part pressing ‘Ok’ to convert the images. Nothing happens. Since I am running this on windows, would that be the problem? Please let me know and thank you so much!

    Cheers!

    • David Emeny says:

      Hi Choua, yes I wrote it for Linux so I’m not sure what would happen under windows. It calls the ‘gnome-terminal’ so perhaps you can replace that bit with the windows equivalent?

  2. Nick says:

    im trying to get this to work as well for windows. I replaced the gnome-terminal with cmd.exe or just cmd and then run into a problem of the filepath either not being read correctly, or the file path trying to be executed as a command instead. im currently at:

    thestring = “cmd.exe [‘c:\program files\nuke10.5\nuke10.5.exe’,’-t’] %s……………. I think its launch nuke correctly now, but i honestly dont know much more than basic command prompt and no real python.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: