Oct 26, 2016

Arnold | Convert to .TX File Using Batch Flile





I really confused the convert .tx file other than use TX-Manager in Maya.I've wanted to make multiple files automatically. Unfortunately, The maketx.exe is not automatically and not useful for me.Then. I challenge to write a butch file with a lot of advices from our technical director.

The file is in zip that link to dropbox. 

Refarenced documents : 


Attention! It's necessary to use maketx.exe that was compiled from OpenImageIO.
mast to download this zip file.  

I really confused the convert .tx file other than use TX-Manager in Maya.
I've wanted to make multiple files automatically. 
Unfortunately, The maketx.exe is not automatically and not useful for me.

Then. I challenge to write a butch file with a lot of advices from our technical director.

First of all, maketx.exe can convert .tx file. It is part of OpenImageIO.
Then I executed that. Lets confirm using maketx.exe.

( In Command Prompt )

cd ../..
cd Utility
cd maketx

-v -u --oiio --checknan --filter lanczos3 example,xxx.jpg -o example,yyy.tx

>

it could convert any images to .tx files.
Then, I try to make a batch file for convert .tx file.
-----------------------------------------------------------------------------------
I got a hint from Mr.Tokoi. It was the drag and drop some files to batch file icon.
It is this. It was wrote those code.that name is hoge.bat
-----------------------------------------------------------------------------------

@echo off

for %%f in (%*) do (
  echo %%f %%~dpnf.tx
)
pause;

>



Drag and drop multiple files to batch icon.
The result was this in command prompt. It could show me like this flow of .jpg rename to .tx.
It was so quickly and smooth.
Then I try to analyze this batch. And I have to be learning The basic writing of batch file.

*@echo off : It don't appear under the command in command prompt. If you use @echo on, It appear all command in that.

*for command :  for  (option)   %%Alphabet   in   (Target of Loop)   do    

*in (%*) : It loop command of insert file's number 

%~* : This command have a lot of pattern. for example %~l, %~fl, %~xl ......  This Commands are able to combine each other. "l" is a variable name
           So, ~dpnf . d,p,n is command and f is a variable name from %%f.


Enough explanation!
The result is below batch program. That name is "TXconvertor.bat"



@echo off
echo TX:Convertor version Bata0.01
for %%f in (%*) do (
echo original file %%f convert to %%~dpnf.tx
P:\_setup\tmp\maketx\maketx -v -u --oiio --checknan --filter lanczos3 %%f -o %%~dpnf.tx
)
echo TX-Convertor DONE.
pause;


*Drag and drop multiple files on TXconvertor.bat. You will get multiple .tx format files at the same place.
And the result will be this command prompt. 


No comments:

Post a Comment