Back at school I did a small tool for fast batch processing of textures from Houdini: batch_textures_convert. It was a simple and useful idea, quick to implement and good learning experience. Being integrated into Houdini, it was easy for artists to use.
It turned out that a couple of external people have used it as well, occasionally sending me emails with setup questions, or asking about compatibility with newer Houdini versions.
The tool worked all right, could be used from Maya, Nuke etc. It also wasn't too hard to add custom commands, e.g. by adding them here.
I have stopped maintaining it soon after graduating though. One of the reasons for that was introduction of TOPs into Houdini. TOPs offered a far more elegant, powerful and easier way of doing many things, including batch conversion of textures!
Therefore I've decided to write this post, where I will show a better way of batch converting textures with TOPs.
TOPs have the same requirements as my tool: the program, which will process our files, needs to be in the PATH
environment variable (or a full path can be set as well). Specifying command is however much easier in TOPs. Command that Houdini will execute can be edited directly in node parameters. On top of that, parallel execution can be easily controlled from a scheduler.
I will replicate a command for creating Arnold's TX textures from my tool in TOPs: maketx -u --oiio --checknan --filter lanczos3 texture_in_path -o texture_out_path
. maketx
is part of the OIIO project.
We need to define two things: inputs and the command:
Let's use everything our machine has to offer:
Caching is also very easy to do, just specify the expected output parameter:
With caching, we can control behavior in case of existing outputs directly from Houdini.
That's it. Hopefully you can see from this mini tutorial the power of TOPs and why it is a good alternative to many tools and ad-hoc scripts.