Home Technical Talk

Maya / UE4 Tools

polycounter lvl 7
Offline / Send Message
Amatobahn polycounter lvl 7
Hey all,

I've finally been able to [make time to] convert my 3dsMax tools for UE4 to Maya! Now you can maximize your workflow!
GREG'S TOOLS v1.0.0
(name pending)

toolsMain.png
Install:
Be sure to get the most recent versions of the script (Last Updated: 10/31/14)

Install the tool into the /Documents/maya/scripts

Load in the script through the script editor. From here you have the option to create a shelf icon for your own personal use.
toolsScriptEditor.png


Download Greg's Tools for Maya.

Unreal Engine 4 Scene & Grid Spacing:
This tool sets up the default system units (centimeters, generic Maya units) and default grid spacing (10units), and changes so that the scene is Z up. Also has the ability to toggle different sizes of grid matching UE4's grid snaps.

Unreal Engine 4 Reference Spawner:

This tool will spawn in a to-scale (6'5 Based on UE4 Shooter Template) box into your scene.

Unreal Engine 4 Collision:

This tool takes the selected collision meshes, and will rename those selected using a supplied base name and converting it into the appropriate syntax for UE4.
toolsCollision.png

toolsCollisionOutliner.png
FBX Export for Unreal Engine 4:
Allows you to export you mesh for UE4.
//Greg's Tools for Maya v. 1.0.0
{
    //Global Variables
    string $filename = "";
    
    //Check if tool is alredy open
    if(`window -exists GregsTools`){
        deleteUI GregsTools; //Delets window when it already exists
    }
    
    //Create the Window
    window -t "Greg's Tools" -widthHeight 162 400 -mnb false -mxb false GregsTools;
        
        //Layout
        rowColumnLayout -columnWidth 1 162 -rowSpacing 1 10;
        text -label "Maya v1.0.0" -align "left";
        
            //Group Frame "Scene Setup"
            text -label "Scene Setup";
            
            //UE4 Scene Setup Button
            button -label "Setup UE4 Scene"  -command "createUE4Scene()";
            
            //Horizontal Rule
            text -label "-----------------------------------------------";
            
            //Group Frame "Grid Spacing"
            text -label "Grid Spacing";
            
            //Grid Spacing Option Menu
            optionMenu -changeCommand "grid -size #1" gridBox;
                menuItem -label "1";
                menuItem -label "5";
                menuItem -label "10";
                menuItem -label "50";
                menuItem -label "100";
                menuItem -label "500";
                menuItem -label "1000";
                menuItem -label "5000";
                menuItem -label "10000";
            
            optionMenu -e -v "10" gridBox;
            
            //Horizontal Rule
            text -label "-----------------------------------------------";
            
            //Group Frame "Reference Spawn"
            text -label "Reference Spawn";
            
            //Spawn Simple Box Reference
            button -label "Simple Box" -command "spawnSimpleBox()";
            
            //Horizontal Rule
            text -label "-----------------------------------------------";
            
            //Group Frame "UE4 Collision"
            text -label "UE4 Collision";
            
            //Button for UE4 Collision tool
            button -label "Set Up Collision" -command "setUpUE4Collision()";
            
            //Horizontal Rule
            text -label "-----------------------------------------------";
            
            //Group Frame "FBX for UE4"
            text -label "FBX for UE4";
            
            //Button to Export FBX
            button -label "Export" -command "SaveLocation()";
            
            
            //Functions ------------------------------------------------
            
            //Create UE4 Scene
            proc createUE4Scene()
            {
                setUpAxis "z";
                currentUnit -linear "centimeter" -angle "degree" -time "film";
                grid -size 10 -spacing 10 -divisions 1;
            }
            
            //Spawn Simple Box
            proc spawnSimpleBox()
            {
                if(`objExists UE4ReferenceBox`)
                {
                  confirmDialog -title "Reference Exists" -message "Reference Box already exists in your scene." -button "OK" -dismissString "OK";  
                }
                else
                {
                    polyCube -depth 196 -width 64 -height 64 -name "UE4ReferenceBox";
                    move -absolute 0 0 98 UE4ReferenceBox;
                    move -r 0 0 -98 UE4ReferenceBox.scalePivot UE4ReferenceBox.rotatePivot;
                    performFreezeTransformations(0);
                    select -clear;
                }
            }
            
            //UE4 Collision
            proc setUpUE4Collision()
            {
                string $collisionName;
                //Creates prompt
                string $result = `promptDialog -title "Collision Setup" -message "Enter parent object name below:" -button "Rename" -button "Cancel" -defaultButton "Rename" -cancelButton "Cancel" -dismissString "Cancel"`;
                //if OK is pressed
                if($result == "Rename")
                {
                    string $sel[] = `ls -long -sl`;
                    float $size = size($sel);
                    int $suffix = 0;
                    string $suffixNum = "0";
                    
                    $collisionName = `promptDialog -query -text`;
                    
                    if($size == 0)
                    {
                        confirmDialog -message "There were no objects selected" -button "OK" -dismissString "OK";  
                    }
                    if($size != 0)
                    {
                        if($collisionName != "")
                        {
                            for ($i = 0; $i<$size; $i++)
                            {
                                if($size == 1)
                                {
                                   rename $sel[$i] ("UCX_" + $collisionName);
                                }
                                if($size > 1)
                                {
                                    string $suffixNum = (string)$suffix;
                                    rename $sel[$i] ("UCX_" + $collisionName + "_" + $suffixNum);
                                    $suffix += 1;
                                }
                            }
                        }
                        confirmDialog -message "Selected objects have been renamed." -button "OK" -dismissString "OK";
                    }
                }
            }
            
            //FBX Export To UE4
            proc SaveLocation()
            {
                fileBrowser("ExportFile","OK", "FBX export",2);
            }
            proc ExportFile(string $dirpath, string $type)
            {
                FBXExport -f ($dirpath) -s;
                confirmDialog -title "Success!" -message "The file has beeen Exported." -button "OK" -dismissString "OK";  
            }
            
    //Show Greg's Tools       
    showWindow GregsTools;   

//Copyright Greg Amato. www.iamgregamato.com. tools.iamgregamato.com. 2014.    
}

Replies

Sign In or Register to comment.