[Javascript] myEnv class

myEnv is custom environment variable read/write/delete class that can be used for Photoshop.

myEnv = new MyEnv()

[Javascript] read/write/remove custom environment variable for photoshop

I needed to store some variables like opened folder location in open dialog for photoshop script.
Currently I couldn’t find good native photoshop environment variable storing method yet so I decided to make my own.

readMyEnv(key) : reads key's value and return it.
writeMyEnv(key,value) : write key and value in myVar.env
removeMyEnv(key) : remove key and its value from myVar.env
  • myVar.env will be used for environment variable storing file.
    When any function runs, it checks if myVar.env exists and if not, creates one.
    All key and value will be written as key1=value1;key2=value2;key3=value3; …  in myVar.env
  - returns value of property (if not available, return false)


 - write property and its value (if not available, return false)


  - remove property and its value from env file (if not available, return false)

[Javascript] lightmap batch compositing in photoshop

In my previous work, lightmap passes were created from Maya mental-ray render. The results(ambient lightmap, Ambient Occlusion, shadowmap and full lightmap pass) were composited by certain rule.


[Javascript] lightmap batch compositing script from Hakjoon Lee on Vimeo.

The rendered lightmap passes were composited in photoshop and huge amount of pass compositing work required automation tool.
The following javascript works for photoshop to do batch compositing process.(click the link at the bottom to span code view)



UPDATE : [mel script] renderImageManager

* Update Description 

writer : Hakjoon Lee
date : August 7, 2012
Script title : Render Image Manager

> Added Preset and Flipbook function.

>>>>> Download Script (right click and ‘save as’)

* Script Description : 

It helps recording any desired attributes (e.g. final gathering Accuracy, camera F Stop, light intensity…) as caption texts on the rendered image in renderView window so you can compare the rendered images with changed attribute values. It is useful when you do series of test rendering.
It also saves temporarily stored images in the renderView window and attribute captions to accessible files and loads them back into the renderView window when you need them later.
- You can save node's preset with its render image so it can be restored later.
 (it is useful when you simply want to return all your attributes to the point when you rendered it.)

- You can flipbook between only selected images in the renderView window.
 (it is useful there are many images in the slot so difficult to compare two non-adjacent images instantly)

* Functions

1. Caption
2. Preset
3. Flipbook
4. Save and Load Images


1. Caption

 - Write *selected attributes and their values as caption on the 'Render View'
 *(you can add attributes to the selection group in the UI)

 - Read attributes and their values in the 'Render View' caption and apply the values to the current scene attributes.

2. Preset

- Save *selected nodes' presets and write preset number as caption in the 'Render View'
*(you can add nodes to the selection group in the UI)

- Load saved preset if you can see a [preset_number] caption in the 'Render View'

3. Flipbook

- in case you have many images in the 'Render View' slot and you want to compare some of them, sometimes it would be not easy because you have many images in between.

- You can choose maximum 4 images from 'Render View', slide only them directly in the 'render image manager' window.

4. Save and Load images

- *Save images in the 'Render View' with caption. 
*(filenames and caption text will be stored in filename.set file)

- *Load saved images and caption. 
*(it will open filename.set file)