Command line tools available with maya to create optimized texture format
1. imf_copy
allows to convert all files supported by mental ray, including optimized file format
2. imf_disp
allows to display all files supported by mental ray, including optimized file format
Script example to convert all textures files in a given directory
From a Windows DOS command prompt, type
for %i in (*.bmp *.tga *.jpg) do imf_copy -r -p %i %i.map
foo.bmp will be converted to foo.bmp.map
If you put the above command line into a batch file or cmd file, you need to change few things in order to work (DOS)
for %%i in (*.bmp *.tga *.jpg) do imf_copy -r -p %%i %%i.map
Script example to convert all textures files, recursively from a given root directory
cd to_drive_letter_where_the_root_directory_is_located
cd to_root_directory
for /R %i in (*.bmp *.tga *.jpg) do imf_copy -r -p %i %i.map
If you want to remove the original file extension and replace it with .map here is how you proceed:
cd to_drive_letter_where_the_root_directory_is_located
cd to_root_directory
for /R %i in (*.bmp *.tga *.jpg) do imf_copy -r -p %i %~dpni.map
Construct explanation:
1. %~di provides the drive letter of the file contained in %i
c:
2. %~pi provides the path of the file contained in %i
\Documents and Settings\My Documents\Maya\Projects\MayaIsSoCool\
3. %~ni provides the filename of the file contained in %i
RobotDiffuse
4. %~xi provides the file extension of the file contained in %i
.bmp
Concatenating the construct allows to recompose the entire file path.
%~dpni will result into
c:\Documents and Settings\My Documents\Maya\Projects\MayaIsSoCool\RobotDiffuse
Thanks to Dave Lajoie for his Tip
Recent Comments