This is a JSFL script that I created to generate thumbnail icons at various sizes from a piece of artwork in Flash.

// Multiple Size PNG Exporter
// Copyright © 2018 Andrew Doll
// http://www.andrewdollcreative.com/

/* NOTE:Before running this script export one PNG image using the desired PNG export settings.  fl.getDocumentDOM.exportPNG() accepts 3 
** paramaters. The first is the string for the file name.  The second is a Boolean value that specifies whether to use the current PNG 
** publish settings (true) or to display the Export PNG dialog box (false).  The third is a Boolean value that specifies whether to export 
** only the current frame (true) or to export all frames, with each frame as a separate PNG file (false).  Since this script sets the
** second paramater to true just be sure that the PNG export settings are already set to 32 bit PNG.
*/

var dom = fl.getDocumentDOM();
if (dom == null)
{
    alert("Please open a file.");
}
else
{
    var sel = [];
    var exportSizeArray = [];
    var folderURI = "";
    var folderLocation = "";
    var pngFileName = "";
    var URI = "";
    var selWidth;
    var selHeight;
    var sideToUse;
    var scaleAmount;

    function setupExportFolder()
    {
        folderLocation = fl.browseForFolderURL("Select a folder.");
        if(folderLocation != null)
        {
            folderURI = folderLocation + "/PNG Exports";
            FLfile.createFolder(folderURI);
            pngFileName = prompt("What would you like to name the png files?");
        }
    }

    function calculateScaleAmount(selWidth, selHeight)
    {
        if(selWidth >= selHeight)
        {
            sideToUse = selWidth;
        }
        else
        {
            sideToUse = selHeight;
        }
        scaleAmount = exportSizeArray[i]/sideToUse;
        return scaleAmount;
    }

    var selectionCheck = dom.selection;
    if(!selectionCheck || !selectionCheck.length)
    {
        alert("Please select a movie clip on the stage.");
    }
    else
    {
        exportSizeArray = [16, 32, 64, 128, 256, 512, 1024, 2048];

        setupExportFolder();

        if(folderLocation != null && pngFileName != null)
        {
            sel = dom.selection[0];
            dom.clipCopy();

            calculateScaleAmount(selWidth, selHeight);

            for (var i = 0; i < exportSizeArray.length; i++)
            {
                fl.createDocument();
                dom = fl.getDocumentDOM();

                dom.width = exportSizeArray[i];
                dom.height = exportSizeArray[i];

                dom.clipPaste(true);
                sel = dom.selection[0];
                dom.setAlignToDocument(true);
                selWidth = sel.width;
                selHeight = sel.height;
                calculateScaleAmount(selWidth, selHeight);

                dom.scaleSelection(scaleAmount, scaleAmount, "center");

                dom.align("vertical center", true);
                dom.align("horizontal center", true);

                URI = folderURI + "/" + pngFileName + "_" + exportSizeArray[i] + " x " + exportSizeArray[i] + "_" +".png";
                dom.exportPNG(URI, true, true);

                dom.close(false);
            }
        }
    }
}
Posted
AuthorAndrew Doll

I wrote this script to help check which objects in your Maya scene have a second UV set.  A second UV set is required for AO and Lightmapping in Unity or whatever baking application you may be using.  Add this to your Maya shelf and click to run.  It will print out the names of the meshes that do not have 2 UV sets as well as a total count at the end.

# UV2 Checker
import maya.cmds as cmds


def selectMeshes():
    meshes = cmds.ls(selection = False, type = "mesh")
    for mesh in meshes:
        cmds.select(mesh, add = True)
    return meshes


def getUVSetCount(currentObject):
    mesh = currentObject
    indices = cmds.polyUVSet(mesh, query = True, allUVSetsIndices = True)
    return len(indices)

   
def main():
    uvCountPrintString = " UV count is:  "
    
    meshes = selectMeshes()
    meshesThatNeedUV2 = []
    for mesh in meshes:
        currentObjectUVCount = getUVSetCount(mesh)
        if currentObjectUVCount != 2:
            meshesThatNeedUV2.append(mesh)
            print mesh.ljust(15) + uvCountPrintString.ljust(10) + str(currentObjectUVCount)
            
    print "Total number of meshes that require UV2: " + str(len(meshesThatNeedUV2))
            
main()
Posted
AuthorAndrew Doll

Such a simple script, but this has come in very handy when working with large scenes with multiple textures that may be updated by other artists on your team.  Add this to your shelf in Maya and click to run.  This script will go through the texture files in your scene and reload them with the latest file.

#Reload Textures in Maya
import maya.cmds as cmds

def reloadTextures():
    cmds.waitCursor(state = True)
    textureFiles = cmds.ls(type = "file")
    for texture in textureFiles:
        textureFilePath = cmds.getAttr(texture + ".fileTextureName")
        cmds.setAttr(texture + ".fileTextureName", textureFilePath, type = "string")
    cmds.waitCursor(state = False)
    
reloadTextures()
Posted
AuthorAndrew Doll

Looking to build a 2D Platformer in Unity?  I recommend you check out Weekend Code Project:  Build A 2D Platformer In Unity by Jesse Freeman.

This book is a great resource to get started with if you are new to game development in Unity.  It does a great job of teaching you how to build the various parts to a 2D platformer game step by step.  It outlines what the current step is about, then shows the necessary code (in C#), and after that explains what the code is doing in the game.  Super easy to follow!

Posted
AuthorAndrew Doll

This is another set I had when I was a kid and it was just as much fun building it now in 3D as it was using the actual bricks when I was younger.  I'm sure I will do another Lego build in the future, but for now I am going to focus my efforts on learning how to actually use the modelling tools inside of Blender to create my own original models.

Here is another LEGO set that I built with Bricksmith and textured/rendered with Blender and Cycles.  I spent a bit more time on this set cleaning up the meshes for all the pieces that are facing camera so that I could get the little creases in between each brick as well as I added the LEGO logo to each individual stud.  I have to thankLaustinart for his 3 part video series on working with LEGO in Blender.  It was super helpful for texturing and mesh clean up tips.

So here is the final render and a couple of screenshots from Blender.  Let me know what you think!

This is my Disney Inventor Award. I won't go into detail about what I received this award for, but I would like to say that it wouldn't have been possible if not for the brilliant minds of the people that I get to work with everyday.

Posted
AuthorAndrew Doll

Trying out some digital sculpting. Definitely going to have to get a computer that can handle the higher resolution geometry. My Mac Pro is starting to show its age and chug a bit around 1 million polygons.

Posted
AuthorAndrew Doll