Is possible to batch converter a folder of images to .RAT?

   18540   11   1
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
First of all, hi to everyone!

its my first post, and i just installed Houdini Apprentice and hope to make magic like the first famous Houdini lol

i already have 1 drive, with my textures of daily use. but i dont want to convert one by one,

since the .rat format is the more suitable for texturing, is there a command or a script for convert a folder into .RAT format?

other question:

Why convertion an image to .rat format, increases its size about 100%?

i just tested and convert a 9mb texture file and it jumped just to 90mb!

Thanx for any help or reply

Sty
User Avatar
Member
7766 posts
Joined: 7月 2005
Offline
The iconvert command line tool comes with Houdini for converting image files. So you can run a script that uses it. Using bash, it's a one liner:
for f in *; do iconvert $f ${f%%.*}.rat; done
User Avatar
Member
7766 posts
Joined: 7月 2005
Offline
PS. As for the file size, it depends on which format you're converting from. I think .rat files have no compression, explaining the big difference in file sizes. .rat files are also mipmaps (http://en.wikipedia.org/wiki/Mipmap) [en.wikipedia.org] so they will be about 1/3 larger than the original uncompressed size as well.
User Avatar
スタッフ
2598 posts
Joined: 7月 2005
Offline
edward
The iconvert command line tool comes with Houdini for converting image files. So you can run a script that uses it. Using bash, it's a one liner:
for f in *; do iconvert $f ${f%%.*}.rat; done

You can also create a COP network with a File COP (to read the source image) and an output driver to save .rat files.

Or use mplay.
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
wow!!!!

really thanx guys!

I am impressed for such great responses and such kindness

i will test there and go deep and deep into Houdine!

/voila!

/sty
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
hi ppl…i just could not make it work!

can anyone explain me more simple?

i went to directory, type as mentioned, but didnt work…

(i dont know nothing about programming, even HTML programming lol)
User Avatar
Member
7766 posts
Joined: 7月 2005
Offline
Oh, you're on Windows? Uh, try what Mark said then
User Avatar
Member
136 posts
Joined: 7月 2005
Offline
for %i in (*.*) do dhoudini/bin/iconvert %i %i.rat

replace dhoudini/bin/ with your own path to iconvert.exe.
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
Yes! i am under windows

i will rety now, thanx again ppl!

Really impressed for the fast response!

Sty
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
thanx AndrewVK!!!! Finally put that to work!

Damn Fast! :roll: :roll: :roll:

just convert a bunch of images less than any batch process that i`ve ever made (audio, video or whatever)

Thanx again!

Sty
User Avatar
Member
1 posts
Joined: 8月 2009
Offline
Here is an windows script. It will convert all image files in folder “c:\houdini\bin\” .


cd “c:\houdini\bin\”
var string list
lf -n “*” > $list
while ($list <> “”)
do
var str file ; lex “1” $list > $file
# Convert this $file.
var str ratfile ; sal -p “[^.^l” “.rat”
system iconvert $file $ratfile
done


You can add other arguments to the lf command to collect file list based on names, dates, sizes, etc. Similarly, you can change the sal command to make the rat file name include timestamp, etc.

The script is in the free version of biterscripting ( http://www.biterscripting.com [biterscripting.com] ) .

Sojwita
User Avatar
Member
101 posts
Joined: 7月 2009
Offline
thanx again for this new solution!!!
  • Quick Links