Photoshop render element importer v0.02

Edit:
For updated versions of these tools, go to this thread:
http://www.chaosgroup.com/forums/vbulletin/showthread.php?t=41740

--------------------------------------------------------------------
So it’s 4am right now and I’ve been up all evening writing a script and some actions for Photoshop to automate importing of render elements.
Here they are if anyone wants them.
I have only tested them in Photoshop CS3 but they might work in CS2 as well.

Download!

The zip file consists of 3 files. One is a bat file used to make the vrimg2exr.exe utility easier to use, One is a collection of actions and the other is a Photoshop script that attempts to automate everything. Here’s some quick descriptions:

vrimg2exr.bat file:
This file will automatically save out the separate channels into exr files.
To edit the file simply open it in notepad. You can change the naming and such that way.

Actions:
-Add Single Layer-
This action pops up an “open” dialog letting you select a picture to add as a layer to the current picture. The picture will be added as the topmost layer and set to Linear Dodge blending. While it’s possible to select more then one image in the dialog it won’t do you much good.
-Add Open as Layers-
To use this action simply open all the elements you want to have in the picture, select the diffuse (usually) image and repeatedly run the script.
Every time it runs it will add the next open image to the one that’s currently active. As in the previous one it will add them in Linear Dodge.
This action is probably the easiest to use.
-Element Compositor-
The third action is for those who aren’t sure how to handle rendered elements. When you run it it will tell you which pictures to open, let you select the right one, and then add it as a layer with the proper blend mode. It’s not as fast a method but good to learn I suppose.

The script is a bit different. In order for it to work you have to use the right filenames or at least somewhat close. (the bat file does that for you) To use it don’t have a picture active and run the script. you will get a file open dialog. Select ALL the pictures and click ok. The script will recognize the names and automatically add them to a new picture with the right blend modes and in order starting with the diffuse as base.
Note you might run into problems with the script as it’s still pretty new. Thankfully Photoshop is quite foolproof so it’s pretty safe but be careful just in case. You use it at your own risk :wink:

These are the elements the script supports:

  • VRayDiffuseFilter
    VRayRawLighting
    VRayGlobalIllumination
    VRayReflection
    VRayRefraction
    VRayCaustics
    VRaySpecular
    VRayBackground
    VRayAtmosphere
    Alpha

Any unsupported elements will be added with the default filename, set to Linear Dodge and hidden.

###########Changelist###########
v0.02
-The script now imports unrecognized elements.
-A setting has been added to import the elements as smart layers. To use open the script in a text editor.

##########installation###########

Put the bat file in the same folder as vrimg2exr.exe.
Usually the “tools” folder under program files\chaos group\.
To use it simply drop the vrimg file on top of it. you can make it easier to get to by creating a shortcut icon somewhere. I have it in the “sendto” folder in the main profile in Documents And Settings. that way you can rightclick the vrimg files and simply select Send To → vrimg2exr

The Actions file should go in the C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Actions folder, and the script file should go in the Presets\Scripts folder.
Once you restart Photoshop you can start it from the file/scripts menu.

Enjoy! :smile:

I didnt test it yet but…
THANKS THANKS THANKS !!!

Glad to hear I’m not the only one who wanted this script :wink:

Would be perfect if Photoshop could open vrimg directly but… :lol:

That’s my wish too, life will be easier especially for hi-res image files larger than 1.5gb

I’ve not had a chance to use it yet but wanted to say a big thank you anyway. It’s very generous of you to share what sounds like a very useful tool 8)

Thanks again,

Andy

Anytime :slight_smile:
Let me know if you all have any ideas for improvements.

is this only for CS3?

I haven’t tested it for anything else. Doesn’t hurt to try though I guess.

I’m probably being an idiot, but I can’t seem to get the .bat file to work.

I’ve dropped it in the same folder as the vrimg2exr.exe file (C:\Program Files\Chaos Group\V-Ray\3dsmax R9 for x86\tools) but when I drag my vrimg file onto the .bat file, it gives me the message:

`vrimg2exr` is not recognized as an internal or external command, operable program or batch file

:?

Any ideas?

Hmmm strange.
Which operating system do you use?

Your plugin is really useful, but would it be possible to run the script using an EXR (with all the extra channels inside) with the plugin PROEXR for CS3, and let your plugin reorder the elements inside? That would mean changing the blending modes too.

Would have to create a new script for that, but sure it’s possible. Not even very difficult.

Id be very interested in that script.

Also, do either of you know how to open and exr with ProExr and then change to 8/16 bit and have all the layers comp together correctly?

Here’s the action I currently use for arranging EXR layers (from ProEXR)
It only supports the most common layers, but if you study the actions you should be able to add your own pretty easily.
Do note though that this uses the raw elements of the render. For instance the VRayLighting element is broken up into VRayRawLighting and VRayDiffuseFilter meaning you have to use those two and not the VRayLighting one

This is a list of the elements it supports and how to composite them manually. It’s set up as you’d see it in Photoshop. with the bottom one being the base layer. Add is the same as “Linear Dodge”:

VRaySpecular - Add
VRayBackground - Add
VRaySelfIllumination - Add
Group - Add
--VRayRawRefraction - Multiply
--VRayRefractionFilter - Normal
Group - Add
--VRayRawReflection - Multiply
--VRayReflectionFilter - Normal
Group - Add
--VRayRawGlobalIllumination - Multiply
--VRayDiffuseFilter* - Normal
VRayRawLighting - Multiply
VRayDiffuseFilter* - Normal

*yes, this layer is used twice.

These are the most basic elements of a standard CG scene. Any other elements are ignored.
If you were to not use the RAW elements you wouldn’t need as many elements but the action doesn’t support it. For reference though, here’s how to composite them:
VRaySelfIllumination - Add
VRayBackground - Add
VRayRefraction - Add
VRayReflection - Add
VRayGlobalIllumination - Add
VRayLighting - Normal

sorry if this post got a bit complex. Just ask if you’re wondering about something. :slight_smile:
EXR.zip (795 Bytes)

Hello
We were waiting for this tool for… 1 year.

Thanks for your work
Arno

I have the same problem, XP pro. Trid on two different machines.

You probably need to set the Working folder in the shortcut properties for the .bat file to the same folder that contains vrimg2exr.exe; it does not automatically look for the .exe in the same folder as the .bat file.

Best regards,
Vlado

I placed the bat file directly in C:\Program Files\Chaos Group\V-Ray\3dsmax R8 for x86\tools

it’s not a shortcut.

You still need to create a shortcut to the bat file for it to work properly. Also I suggest placing the shortcut in the “send to” folder in “documents and settings”. That way you can right click a vrimg file and send it directly to the bat file from anywhere.