Category Archives: JavaScript

Flash Building Export Tool

This project was designed to improve building asset creation pipeline for Funzio projects.
Previously artists used to manually create building flash asset with 3D rendered images and it was time consuming because of grid had to be manually created by artist (at that time it was mostly me!) and there were several rules to follow (layer order, visibility and misc properties change…)

To remember all of these rules, I often opened up task document and carefully looked in the steps but it was annoying and easy to miss something.

This tool is consists of Frontend building/grid setup GUI and batch flash asset creation parts.

The GUI is written in Actionscript 3 in Flash and the batch asset creation is written in JSFL (Flash Javascript API)

[Javascript] myEnv class

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

<Example>
myEnv = new MyEnv()
alert(myEnv.read("LIGHTMAPFOLDER"))
alert(myEnv.write("myname","hakjoon"))
alert(myEnv.del("myname"))
alert(myEnv.read())
alert(myEnv.write("test","aaa"))

[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
readMyEnv(property)
  - returns value of property (if not available, return false)

 

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

 

removeMyEnv(property)
  - 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)