:repeat: Batch texture conversion to various render-friendly mip-mapped formats
Batch convert textures to various render-friendly mip-mapped formats
:information_source: Note that this tool is no longer maintained. TOPs in recent Houdini versions are good replacement for it. See this blog post for more info.
This tool helps with pre-processing of textures for offline renderers. It can be used from Houdini, Maya, Nuke or as a standalone application.
Renderers usually convert common texture formats (jpg, png, tga..) into more render friendly mip-mapped formats (rat, rs, tx..) which can be a time consuming process. Mainly if the renderer discards the converted texture afterwards and this process gets repeated many times.
It is therefore more efficient to pre-convert them once and let renderers use them.
It can be also used as a batch images converter, e.g. for converting raw photos with dcraw.
Screenshots from Houdini, Ubuntu standalone, Windows standalone, Maya and Nuke
You can see video of this tool here.
Download or clone this repository.
Houdini
HOUDINI_PATH = &;/path/to/this/repo/
Maya
PYTHONPATH=/path/to/this/repo/scripts/python
Nuke
set "PYTHONPATH=%PYTHONPATH%;/path/to/this/repo/scripts/python"
set "NUKE_PATH=%NUKE_PATH%;/path/to/this/repo/nuke"
Standalone
$ python -m pip install pyside2
import batch_convert
gui = batch_convert.runGui()
$ python batch_textures_converter.py
--path
argument, which will set folder path (see $ python batch_textures_converter.py --help
for help)" /// "
This tool works on Linux and Windows. Feel free to test it under and contribute for OS X version. Right now the following output formats are supported:
However it is easy to extend / modify this tool so that it suits your needs. Note that those are only presets. Those tools can handle more formats and can be customized for different cases. Check man pages of the tools for more information.
To add new output format, simply implement a new class in scripts/python/batch_convert/converters.py, which inherits from GenericCommand() class. Class is very simple, so it should be straightforward to add your custom output formats.
This tool relies on external executables to perform conversion (e.g. iconvert for RAT, maketx for TX...). Make sure that you have them available in your system's PATH variable. If an executable is not found, then it will print a warning and will hide it from the output formats list in gui.
batch_convert.runGui()
accepts optional argument: path
, use it setting default folder path
If there are multiple textures with the same name, but different extensions, the tool will pick the one with the highest priority, as specified in ext_priority
list in __init__.py
Check beggining of __init__.py
for configuration
Feel free to contribute to this project by creating pull requests or by buying me a beer :)