Category Archives: Script

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)

Unity3D Asset Placement Tool

  • It is designed to provide asset placement tool in unity set dressing. We needed to place random props -especially vegetation – on game area. This was my first C# in Unity3D project and a bit challenge until I get familiar to the new language and Unity3D structure but pretty fun experience.

Workflow

a. Placement
1) Select prop prefabs to place and add them to the prop list

Select target objects (prefabs) to place props upon on and add them to the target objects list. Uncheck ‘Use Map’ check box if you don’t have Design Map.

2) Select Design Map to define prop placeable area. Then add desired terrain objects to place props upon on to target objects list. Prop will be placed only on ‘green’ zone.

 

3) Adjust instance number. It is total number of instantiated props.
4) Adjust ‘Place props on slope <‘ number. It won’t place props where its ground angle is over the degree. (0 is flat ground. 90 is vertical wall.)
5) Adjust Rotation and Scale min/max values to give random values between the range to instances.
6) Press “Place Props” button to place props on the target objects.

You can re-layout props by pressing “Place Props” button until you like it. (It will not increase instance number)
Instantiated props will be parented to ‘propGroup_000’ gameObject

b. Masking

  1. Add mask objects to Ignore List, then props won’t be placed over mask objects.

Cactus is placed on roof.

Added houses to mask object list.

c. Adjust Prop Ratio

1) you can adjust percentage of specific prefab in the mix

d. Prop placement by ground slope angle

[tech note] color set history significantly increases maya scene size!

‘polyBlendColor’ command without ‘constructionHistory(ch)’ flag off will increase maya file size a lot.

cmds.polyBlendColor(bcn='a', src='b', dst='c', bfn=1, bwa=0.5, bwb=0.5, bwc=0.5, bwd=0.5,ch=0,cch=0)

When delete a ‘colorSet’, you should set the ‘colorSet’ first and then delete. If you duplicate the mesh which had the color set, it will recreate deleted color sets in duplicated.

cmds.polyColorSet(ccs=1, cs="colorSet1")  //set "colorSet1" as current color set.
cmds.polyColorSet(d=1,cs="colorSet1")  //delete "colorSet1" color set.

[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)