PDA

View Full Version : .MAP files - lots of them - howto?


Bart_K
11-04-2004, 06:31 PM
Hi, does anybody know of an easy and fast way to convert lots of textures to the .MAP format? Doing it by hand, one by one thru the imf_copy would take lika a few days :sad: i know francescaluce wrote a plugin for photoshopCS that does that, but i'm on Maya, so can't use it.. (requires XSI paths) - a batch file maybe, or sumthin?

thanks in advance

Bart_K

Undseth
11-04-2004, 10:55 PM
With a batchfile one can reuse it, if the texture files are updated.

I wish there was some kind of drag and drop thingy for this, like selecting lots of files and simply dropping them onto say a utilityfile in explorer, a utilitywhich can be accessed to be able to change some options for the conversion.

Hehe it took me a while before I got around to write a batchfile, instead of typing in the command in command prompt. :scream:

thebigMuh
11-04-2004, 11:37 PM
Copy this into an empty batch file (like "mass_mapper.bat"), and put it on your desktop:


REM @ECHO OFF
REM Simple mass file conversion using imf_copy
REM by Daniel Rind, enjoy
REM modify the imf_copy line to change parameters
:convertfile
@IF "%1" == "" GOTO end
imf_copy %~f1 %~d1%~p1%~n1.map
@SHIFT
@GOTO convertfile
:end
@ECHO.
@ECHO Done!
@pause


Then drag & drop any number of images onto it to convert them into .map files. It will create the files in the same directory the originals are in. If you need a reference for changing the batch file to your needs, look here:

http://labmice.techtarget.com/articles/batchcmds.htm#variable

That's the good ole .bat power for you ;)

Ciao, ¡muh!

beaker
11-05-2004, 12:09 AM
I'm not sure how to do it though a dos shell but in a csh or bash its a really simple command. You can either download cygwin or install Unix Services for Windows(free download off microsofts site) and run these commands.

Change your directory to wherever your files are at that need to be converted. This command will convert everything in the folder your in. Change the "imf_copy -prL" to whatever command you want it to run. Don't forget the trailing space after the command.

ls -1 | awk '{print "imf_copy -prL " $0}'

If you want to create a batch file that you can edit then use this command:
ls -1 | awk '{print "imf_copy -prL " $0}' > map_convert.bat

This will put all the commands into a file called "map_convert.bat". Which is just a text file you can edit and later execute.

Undseth
11-05-2004, 01:58 AM
Thanks for the batchfile thebigMuh! :thumbsup:

Bart_K
11-05-2004, 10:58 AM
thanks guys, much appreciated :thumbsup:

Bart_K

Pickman
07-03-2005, 11:09 AM
Hey thebigMuh, nice batch file, how do you pass commands like -r -p ? in your batch file ?
THX, really nice script !

floze
07-03-2005, 12:14 PM
Well, the script works as long as you dont have any spaces in your path. If you do have spaces it will fail. So the safest way would be putting the path into (") quotes, like this:
REM @ECHO OFF
REM Simple mass file conversion using imf_copy
REM by Daniel Rind, enjoy
REM modify the imf_copy line to change parameters
:convertfile
@IF "%1" == "" GOTO end
imf_copy %1 "%~d1%~p1%~n1.map"
@SHIFT
@GOTO convertfile
:end
@ECHO.
@ECHO Done!
@pause
The options go right behind the imf_copy command, so you might want to change it to:imf_copy -p -r %1 "%~d1%~p1%~n1.map"
Maybe I'll find the time tomorrow to write a little more sophisticated batch.

Pickman
07-03-2005, 05:01 PM
Hey Floze, thx for the reply, oki, I'll try the command that way :-) get some time to write a more sophisticated one mate lol.

Still about rendering, I read a few threads about quadratic filter issues in maya 6.0.1.
Did you have any chance to test it out in maya 6.5 ? Do I still need to apply your elliptic filter in this version of the software, cause I will shortly move to 6.5?

THX, I didn't try to plug it into my shading network, is it complicated ? I'm very new to MR and maya rendering in general :-)

THX a lot

abcxyzboy
08-20-2005, 01:23 AM
Wow! I was having a huge problem getting imf_copy to work. I was getting this error...

Error: Cannot find procedure "imf_copy".

I came along this batch file thing and thought that I would give it a try. I had problems due to a space in my path. After trying to fix the path problem by messing with the script, and not knowing what the hell I was doing, I thought I would just copy the files I wanted to a new directory on my C drive. Worked great no more space in the path problem.

However, for some of my files. Half of my tifs were not supported by imf_copy. Does anyone have any ideas on why some of my tifs were not supported while others were? I have no idea why so I have converted them to jpg and then used the batch file. If you have a ton of files to convert to tga or jpg etc, I suggest you first open one of the files in Photoshop, and use the action window to create a new action to be used with the batch function in Photoshop. If you need details read on...

1 Open your file in Photoshop
2 Goto Window/Actions
3 Hit the Create New Action Button (2nd from the right at the bottom of the actions window)
4 Name your action and hit record
5 Save your file as a jpg (or whatever, not tif)
6 Stop recording your moves by hitting the stop button (far left bottom, actions window)
7 Put all the files that you want to convert in a separate folder
8 Go to File/Automate/batch in Photoshop. This last step will bring up the action that you just created and convert all of the files in your folder. (there will be some options to choose from)

I have found the photoshop actions and batch functions to be extremely useful yet few of my colleagues seem to use it, they usuallly think it is too complicated, It is so simple and can save so much time. I often use it to resize images.

CGTalk Moderation
08-20-2005, 01:23 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.