View Full Version : psd>><mental>>images
francescaluce 12-15-2004, 09:06 PM a simple set of scripts for photoshop to export your current document directly to the mentalimages imf_copy utility. it support also .psd to be translated on the fly, copy to all the host involved into the net for instant tests on DR, and a mass converter to get a whole folder out to .map pictures.
I added the maya imf_copy path, the chance to append any format to the imf_copy, alpha support and a more robust file checking for hosts failures.
http://img135.exs.cx/img135/2829/memorymapscripts9mz.jpg
**
ciao
francesca
| |
slipknot66
12-15-2004, 11:13 PM
Obrigado=Thank you Francesca:)
Jozvex
12-16-2004, 12:07 AM
Great! Thanks!
:thumbsup:
shine77
07-25-2005, 01:15 PM
Anybody got this working?
I always get =
Script: C:\Program Files\Adobe\Photoshop CS\Presets\Scripts\topmap\wshRun-imf_copy.vbs
Line: 200
Char: 4
Error: the system cannot find the file specified.
Code: 80070002
I just cant figure it out:)
Thanx
francescaluce
07-25-2005, 06:45 PM
Anybody got this working?
indeed.. me !! and every time I run it !! :)
just cant figure it out:)
it is simply that it cannot find the imf_copy executable.
did you read first the instruction and so ran first the
ExportMemoryMapSettings ?
ciao
francesca
is their any chance this script would work with ps 7 ?
i didn't find preset -> scritps..
francescaluce
07-26-2005, 01:24 AM
as long it has a script folder it will work by
pointing to that folder the .js script. I'm
assuming that psd7 is using the same object
model of CS, but I'm not sure about this.
francesca
as long it has a script folder it will work by
pointing to that folder the .js script. I'm
assuming that psd7 is using the same object
model of CS, but I'm not sure about this.
francesca
thx francesce.
it don't have script folder...i have CS 1 but it needs more ram to open the same file that ps 7 do..when it comes to about 60 mb files it don't open them...ps 7 do:shrug: i think i'll go back to CS...
shine77
07-26-2005, 04:47 PM
indeed.. me !! and every time I run it !! :)
it is simply that it cannot find the imf_copy executable.
did you read first the instruction and so ran first the
ExportMemoryMapSettings ?
ciao
francesca
Yeb I ran it and I can run the imf_copy from anywhere through commandline.
The imf_copy path is = c:\program files\alias\maya6.5\
just the normal one and it gives me that the path is ok
thanx for the reply
IlCattivo
08-28-2005, 10:23 PM
This is just amazing, exactly what I was looking for. I hate cmd and things like that. Thanks a lot!
But of course I'm failing and I get the same result as "Shine77".
Script: C:\Program Files\Adobe\Photoshop CS\Presets\Scripts\topmap\wshRun-imf_copy.vbs
Line: 200
Char: 4
Error: the system cannot find the file specified.
Code: 80070002
All the paths seems to be ok (at least it says so) so I can't understand whats wrong.
But it does write a file, a .tif file (even though I choose .map and I get an error massage)
I have tried to force convert the .tif file simply by changing the extension to .map and It seems to work. At least I can render the image, but I don't know if the file benefits from the .map features.
Anyhow, if someone knows how to fix this I would be very grateful.
francescaluce
08-29-2005, 01:28 AM
well check manually the path the script is using.
open your winexplorer and rightclick on MyComputer
selecting Properties, then goto the Advanced tab and
click EnvironmentVariables. on the UserVariablesFor..
find the IMF_DIR and look if it has a slash \ at the end.
if not add it.
dunno why it is not working for you directly from the
MemoryMapSetting script as it checks automatically
for the slash at the end, I recently installed CS2 and
did the usual procedure for myself too and no problems
at all nor I can replicate your problem actually. btw
try the above solution it should fix it.
ciao
francesca
floze
09-29-2005, 06:02 PM
I hunted that problem down: it's the spaces in your folder names. If there is any in your maya installation directory (like C:\Program Files\Alias\Maya6.5), it wont find the file.
Temporary solution: put the imf_ tools into any directory that has no blank spaces, like 'C:\temp\imf_disp\bin\'. The 'bin' is important because the script searches for a subfolder called bin.
Trust me, it works! Thanks Francesca! :)
edit: When using the 'Export Memory Map Settings' from within photoshop, simply point it to, for example 'C:\temp\imf_disp\' - not to 'C:\temp\imf_disp\bin\'
Ash-Man
09-29-2005, 08:22 PM
great as awlayes francesca :thumbsup:
I wounder if ther is a command that you can do to run the conversion to an entire folder
francescaluce
09-29-2005, 08:55 PM
thx floze for the bug fixing. I will fix it in a near future.
I wonder if ther is a command that you can do to run the conversion to an entire folder ashaiad, did you try to look just down the ExportMemoryMapImage script ?
if I understand what you mean the ExportMemoryMapMass should do the trick..
converting a whole folder of valid images to .map files.
ciao
francesca
Ash-Man
09-29-2005, 09:33 PM
thanks for the reply
Iwas looking ofr a way to do it in Dos
I found it
imf_copy -v -p %q c:\files\%q.map map
thaks aywas, great tool
francescaluce
09-30-2005, 01:36 PM
take a look at the mass_converter.vbs, it uses windows script host to
get a folder and a collection of images to get passed to the imf_disp.
'get folder object and files collection
Set oFolder = filesys.GetFolder(nFolder)
Set fColl = oFolder.Files
'the collection
i = 0
t1 = Timer
For Each f in fColl
fullName = f.name
fExt = chkExt(fullName)
If Not fExt = "mmh" Then
realName = Left (fullName, InStrRev(fullName,".")-1)
inFile = ckSlash(nFolder) & fullName
outFile = ckSlash(outFolder) & realName & ".map"
'invoke the imf_copy for each image
return = oShell.run (pImfCopy & "imf_copy " & strFlags & " " _
& """" & inFile & """" & " " & """" & outFile & """", 0 , true)
If Not return = 0 Then 'imf_copy closed with errors
MsgBox "Errors occurred for " & inFile, 32, "Info"
Else
i = i+1
End If
End If
Next
t2 = Timer
t1 = t2-t1
MsgBox "Converted " & i & " files over " & e &", in " & ForMAtnUMBER(t1) & _
" secs", 32, "Info"
you then need just a javascript file that will be engaged from psd to launch the vbs
back script... that means you can also double click the vbs file and use it as a .bat file,
the .vbs is not related to psd in this case. the conclusion is.. don't use .bat files with dos
cmds where wsh is more clear and effective.
ciao
francesca
floze
09-30-2005, 01:42 PM
you then need just a javascript file that will be engaged from psd to launch the vbs
back script... that means you can also double click the vbs file and use it as a .bat file,
the .vbs is not related to psd in this case. the conclusion is.. don't use .bat files with dos
cmds where wsh is more clear and effective.
ciao
francesca
No doubt that it's way more flexible and effective, but this little .bat did a very good job for me so far:
:convertfile
@IF %1 == "" GOTO end
imf_copy -p %1 "%~d1%~p1%~n1.map"
@SHIFT
@GOTO convertfile
:end
@ECHO.
@ECHO Done!
@pause
Original by Daniel Rind.
Copy and paste the above code into a blank textfile and rename the extension to .bat - then drag and drop any texture onto the .bat file's icon. The converted files will be in the same folder as the original textures.
rybeck
12-13-2005, 12:43 PM
it is great tip to know...
Thanks for sharing.
Lorecanth
12-14-2005, 02:24 AM
again thanks francesca.
jimbojetset2
02-11-2006, 04:35 PM
unfortunatly i get the same problem as the others, tryed placing imf_copy in the main maya 7 folder, didn't help, tryed putting it in folder with no spaces, tryed renaming it from imf_copy to Imf_copy just in case it was case sensitive. No luck. v.strange using cs2 if that helps
redcore
02-26-2006, 03:03 PM
what these scripts are good for guys?
thx.
krazyrokr
03-17-2006, 03:52 AM
fantastic script, this is going to save me a lot of time. many thanks
Ash-Man
03-23-2006, 12:21 AM
OK
I managed to make it work
I had to change few lines in the script
wshRun-imf_copy.vbs
it seems fine so far
I need to work on the Mass now and start testign again
sorry for the previous post
Ash-Man
03-23-2006, 02:16 AM
return = oShell.run (pImfCopy & "imf_copy " & strFlags & " " & """" & fullPath & """" & " " & """" & outFile & """", 0 , true)
I think the problem is comming from the pImfCopy
once it was removed from the code line
it worked fine
or at least thatwhat i think
tinytimanimation
06-14-2006, 09:46 PM
im using cs2 and its not even loading in photoshop in the scripts menu. i tried executing it by using "browse" then pointing to it in the plug-ins folder, but nothing happens. Im on windows x64 and all my programs are in "Program Files(x86)" but I dont know if that makes a difference.
Lamster
06-15-2006, 02:11 PM
Hmm, I'm curious about this IMF_COPY thing. What are the benefits of using the memory mapped file textures over regular file textures? Does using them help mental ray to better manage memory? Speed up render time? Crash with out of memory less often? :p
I'd really really love to know more about this, could someone please offer a little bit of kind advice on this, or perhaps point to a thread or a link with info or discussion about this ?
Thanks
Terence
Ash-Man
06-15-2006, 02:42 PM
Hmm, I'm curious about this IMF_COPY thing. What are the benefits of using the memory mapped file textures over regular file textures? Does using them help mental ray to better manage memory? Speed up render time? Crash with out of memory less often? :p
I'd really really love to know more about this, could someone please offer a little bit of kind advice on this, or perhaps point to a thread or a link with info or discussion about this ?
Thanks
Terence
Lets say you have 4 K texture file that mean Maya will have to store the entire file in mem while it render
however when you convert it to map file
when mental ray render a small section of your image it will opne that littel part of the file in map format
so it will be smaller mem usage
Lamster
06-15-2006, 03:03 PM
Hmmm.... then it means that I've gotta use this imf_copy thing far more often then! I went to google and read up a brief description of this memory map file texture thing. There was a brief mention of the imf file texture not showing up properly in maya as a swatch, but it'd render fine for mental ray. I guess that's really minor, so I'll download this and give it a go tomorrow! If this allows me to render something I couldn't render before due to memory limitations, then it's all good :)
Thanks Francesca once again
Terence
Lamster
06-22-2006, 08:54 AM
Hmm, I've tried installing this and running it. True enough, I've ran into problems with the spaces in folder names and other problems. Even when I made a copy of all the imf related exe files and the dll file from my Maya bin, and moved it into a simple IMF_TOOl\bin\ directory, i still got an error at line 158 of massConverter.vbs, saying Unable to wait for process. I have no idea what that's about.
I took a look throught the .massConvertor.vbs and found that line, it corresponds with the
return = oShell.run (pImfCopy & "imf_copy " & strFlags & " " & """" & fullPath & """" & " " & """" & outFile & """", 0 , true)
Now looking thru the code, it seems that this part of the program simply takes the pImfCopy which was stored earlier during the main() and putting it into a string which is run after evaluation. What this Unable to wait for process error is, I cannot understand.
I think that I'll almost never be using a whole PSD file as my texture, so I'm rather happy to convert to JPG and do the imf copy using that little script that was provided by floze there. Thanks mate.
Terence
francescaluce
06-22-2006, 05:22 PM
ehy the only problem of this bunch of scripts is that
they do not support spaces in the path pointing to the
imf appz and that they're only for english win systems.
both things are easily workaround-able.
ciao
francesca
daddyo
10-07-2006, 01:03 AM
I get the scripts to show up just fine in CS2, and running the setup one as well... I can't run the mass, or single file convert for the same path problem...
I'm not big on programming, but what is the fix exactly? Pointing the script to a different directory for the imf copy utility?
I'll try ashaid's workaround...
Also, I liked the batch file idea... will try that as well... it will fit in my workflo because I have to batch a bunch of versions of my textures at different resolutions... I can then go into each directory and run the batch there....
EDIT:::::
Ashaid's fix works fine...just replace the script files with the ones he provides above... Its pretty cool having the process built into photoshop. You go from .psd straight to .map files and they are great. The batch is very convenient too... no need to have the copy utility in the same folder...
delarge
12-11-2006, 04:55 PM
hi.
old thread but still useful. I use francesca's version of the map exporter. I have a german installation of windows but the imf_path and host variables are set properly. but when it comes to writing out the file, after choosing format and options, an error message appears saying 'errors occured during conversion'...
I had the script runnung before my system got a new image, so I'm not sure waht the problem is...
any idea?
cheers
rob
foxtrott
11-30-2007, 01:40 AM
It is very promising however asks for XSI path.
But I guess it needs the imf_copy application path, isn't it?
It doesn't work anyway... I use Maya so what shall I put in as for path::?
I need help figuring this out. When I type in the desired path for the Settings in Photoshop, what files are supposed to be in that folder?
I have been using the MS_DOS batch, by dragging my desired tif images that I want converted into .map files, but they don't get created in the same folder. I see the cmd window pop up really quick, but I don't get my .map file. I have the batch file in the same folder as my tif files.
If anyone could help, would be great. I'm trying to reder some props with alpha channels using Mental Ray in Maya, but with the tif files it is giving me an error and nothing is rendering at all.
Hellgaurdian
05-09-2009, 08:16 AM
hey francesca.. thanx for this script.. really needed it.. but there's a problem.. it no doubt creates a .map file.. but its a 0 byte file.. So i cant use it.. its says "error during conversion".. I am using maya 2009.. does anyone know wats wrong..??
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.