Monday, January 24, 2022

Restructure layers in Photoshop

In our pipeline we try to keep a mirrored setup between our actual game assets (*.png, *.fbx etc) and source assets (*.ma, *.psd etc) So for instance .../assets/images/foo.png would have a source file located in .../assets_source/images/foo.psd. But since having a unique *.psd file for every single icon is a bit much, we also have single *.psd files that contain multiple assets.

Our exporter (https://maybedoublequotes.blogspot.com/2021/12/image-exporter-setup-and-tools.html) could then look at the layersets inside the *.psd file to determine the final output path. When exporting a layer or layerset, the path of the *.psd file is used as the base of the export path, adding the layersets of the selected layer or layersets as folders. This makes it possible to export a lot of files from the same *.psd to different locations on disk. But what if the source and assets are out of sync?

Unity batch atlas creation

In our game we use a few sprite atlases based on a single master atlas (HD astc, HD etc2, SD astc and SD et2). Each atlas has different settings for each platform. Manually creating all these copies with all the settings takes some time and is very error prone. So I created a tool that let's you select the folders you want to include and the rest is automated. 

Add tasks to story chapter

Our game uses a custom node editor to set up our task driven chapters. Our developers used to create these by hand, adding one task at a time (and there can be up to 50!) and setting the values on each. Values include icon, costs, story files etc. Understandably this takes a while. But since they create this from a google sheet with most of the settings defined, I figured we could automate this.


Create story and world character prefab

Creating the prefabs for the characters in our game is a bit of work. Custom scripts with a lot of options and a few more edits make it quite a task. As we were updating our characters (which sometimes required us to rebuild the entire character prefab because we unpacked the character FBX) and the rapid addition of new characters required us to automate the process.

Unity batch create prefab variants

Creating a prefab variant is simple. Doing it for 5 prefabs is harder. Doing it for 5 prefabs and replacing images and localization terms is a drag. So I created a script that does just that.

Wednesday, January 5, 2022

Houdini - Hitting a brick wall

I've been wanting to get into Houdini for a few months now and I finally had some time to dive in. A friend of mine told me to start with a goal in mind and something simple, like a brick wall. And although it sounds simple (I'll have an entire building for you in Maya in minutes 😅) building it procedurally in Houdini requires a bit more more forethought. 

Color to vertex color

For some of the assets in our game we use a wave shader to give the illusion of wind. We use a basic setup which uses a gradient starting from the pivot up to scale the wave amount. But some objects were a bit more complex and needed a custom gradient. If the texture didn't need alpha we could use the alpha channel to store the gradient, but that could mean we would have to add an additional uv set and above all, some did use alpha so the channel was already taken. We decided to start using vertex colors to store our gradient in.


Monday, January 3, 2022

Reorder in mel

We have a system in our game where objects appear by their order in the FBX. Changing the order in Maya for a few items is doable, but when more than 10 items are involved it starts to get a bit tedious.


FBX clip exporter

Maya's GameExporter offers some great functionality making the process of exporting multiple FBX clips a lot less painless than it was before. But due to the version of Maya we were working in, we didn't have access to it. So we built our own FBX exporter that offers some great options suited to our needs.

Create gradient texture


When first starting with shaders I was intrigued by the something I saw where greyscale values were used to create screenwhipes using a lerp. In our game we had some texture swaps which were instant and I thought it would be a nice idea to use this technique to create some nice animated texture transitions.

Quick batch render

It always bothered me that Maya sets a global location for your batch renders. I always have that "Ok, where did my renders end up again?" moment, then copying the renders over to the correct path. I wanted to streamline this a bit, letting me choose my batch render location for each file. 


Terrain texture generation

When creating terrain textures for our game, the shader I wrote shows transitions between textures based on a combination of vertex colors and  the alpha channel value of the texture. To do this our artists created separate layer sets for the alpha values which then had to be manually copied over to the destination file's right channel. Although this works, doing this 10 times in a row, constantly making sure the right layers and channels are visible really slows down your work.


Baking textures part 2

In Baking textures part 1 I talked about getting the baked maps from Maya. But these are mostly just black and white maps, so we want to use Photoshop to edit and export them. But the challenge is to keep it flexible! Although Photoshop has some great non-destructive tools, I haven't figured out how to use a linked layer's luminance as a mask like you would a clipping mask (After Effects does have this option for layers. So Adobe, if you're reading this please add it to Photoshop along with the guide layer option from After Effects for smart objects 😂) Let's get to it!

Baking textures part 1

After going through the process of baking out textures multiple times I decided enough was enough! A simple tool was needed that could let artists easily render out custom baked maps. 


Sunday, January 2, 2022

Multiple colorsets to UV

We came to a point in our mobile game where texture maps became costly so we started looking for alternatives. We wanted to look at using vertex colors, but were unsure if they would offer the fidelity we were looking for. Luckily one of our outsourcing partners Ocellus is able to create beautiful art that you wouldn't even suspect uses vertex colors. But we also wanted to use multiple color sets which is no problem in Maya, but Unity only sees the first color set. So how to get multiple color sets into our shader?


Image exporter setup and tools

Our studio relies a lot on Photoshop. Almost all the art in the game at some point either passes Photoshop or is created inside it entirely. We realized quickly we would need a solid pipeline to make sure we could export fast, easy and intuitive. And so the jolly exporter was born!


Saturday, January 1, 2022

Photoshop extension update

Now that we have our Photoshop extension with all the fancy tools sometimes we need an update. We can streamline the process from a user standpoint but also from a developer standpoint. Adding in buttons and script referrals in html and js can be quite tricky and error prone.

Friday, December 31, 2021

Photoshop extension setup

 Since a lot of the work in our studio depends on Photoshop a lot of tools are going to be created. Having artists go to File->Scripts->Browse every time they need a tool is not ideal. What was the name for that script that does that export thing again? What location did we use for scripts again? We streamlined this by creating a Photoshop extension. Even though the future of extensions in its current form is a bit unsure (they are already under legacy in Photoshop 2021😅), it still gives us a lot of flexibility.


Thursday, December 16, 2021

Split blendshapes by texture


Creating blendshapes can be a daunting task, especially if they also have to be split in left and right and done for multiple characters with a lot of blendshapes. I created a tool that lets you split your blendshape based on a texture using the attribute painting operations (artAttrCtx)

Wednesday, December 15, 2021

Vertex Animation Texture part 2

Soooo... we have our beautiful Vertex Animation Texture. Would look great on a shirt (seriously, try it) but we want to use it to move some pixels. So let's fire up Unity and see how far we get.

Tuesday, December 14, 2021

Vertex Animation Texture part 1



I don't know about you, but the idea of turning an animation into a texture just blows my mind. The ability to convert a very complex animation with dynamics or fluids into a texture to me is very exciting and opens up a lot of possibilities.

Monday, December 13, 2021

Maya selection to Photoshop

Back in 2017, someone pointed me to a Python script which let you create a selection in Maya and based on the UV's let you transfer that over to Photoshop as a shape layer. I was intrigued by the idea and tried to reengineer it as an exercise. But the thing that constantly tripped me up was finding the correct winding order (not to mention my inexperience in Mel and Java scripting) so after a while I abandoned the idea.

A few weeks ago I was looking at solving a different issue and came across a Mel command that reminded me of my earlier failed attempts. And all of a sudden it hit me, this might actually work!