Pages

Tuesday 21 July 2020

Convert images to Pixar .tex format using handy right-click in Windows

After playing a little with Pixar Renderman, I found it laborious to convert images to the .tex format preferred by the renderer.

Here is a super simple one line script to make it as easy as possible to convert image files.

This is a Windows only hack, using the right-click context menu in Windows Explorer.

Open the 'sendTo' folder. Don't know where that is? Don't worry, you don't have to.
Just press 'windows-R' to get the launcher and type 'shell:sendto'


You should see your sendTo folder. Something like this:


Now, right-click in there and create a new text file. Name the new file 'txmake' or something else if you like.

You have created a .txt file, but we actually need a .bat file. We need to rename the file and give it a new extension.

Here is a quick way to do that: Shift-Right-click on a blank part of the sendTo window. You should see the enhanced version of the right-click menu.


One option you should see is 'Open PowerShell window here'. Clicking that will open a command line window with the current working directory set to the sendTo directory. That's a killer tip by itself!

OK, now we can rename the txt file:
ren txmake.txt txmake.bat

The icon for the txmake file will change to a document with cogs. This is a windows batch file and it is executable.






Right-click the file and select edit. Enter the following lines and save the file.


@echo off

C:\Progra~1\Pixar\RenderManProServer-23.3\bin\txmake.exe %1 %~n1.tex



%1 represents a file dropped onto the batch file.
%~n1 is the file with the extension stripped off the end of the file name

Make sure the path to your Renderman installation is correctly inserted into this script.

Usage:

Browse to any image file in Windows explorer.
Right-click the image file > send to > txmake



The tex file will be created in the same folder.