Josh Buck | (c)2008 - 2012 | www.cgartistry.com
jbUDK Tools is provided free of charge and is free to use under this license. If you find this script useful please consider donating to help fund further development. Or... if you'd rather buy me a beer, indicate that donated funds are for purposes of "beer" and I personally guarantee their allocation as such. Cheers!
Please send bugs, comments and suggestions for features and/or improvements to email@example.com
Running the script
- Copy jbUDKtools to your User\Documents\Maya\version\scripts directory
- Start Maya, open the script editor and type or copy the following text into the Python window:
- Use the "Execute All" button in the script editor OR make a shelf button by selecting the text in the Python window and going to File -> Save Script to Shelf
UDK Grid : Establishes an optimal Maya grid and camera settings for creating UDK assets. The default UDK Grid settings are based on 16 Unreal Units per foot. This can be changed in Settings -> Unreal Units per foot. Press UDK Grid again to maintain an accurate grid after changing the number of UU's per foot. **
Default Grid : Switches all grid and camera settings back to the default Maya settings. **
Divisions : Changes the number of grid divisions. Divisions can be cutomized as needed. Turn on grid snap to work with your custom grid.
Grid Size : Increases and decreses the overall size of the grid.
** jbUDK tools has it's own grid coloring scheme. If you wish to retain your custom grid color settings you can do so by unchecking 'Use jbUDK Tools Grid Colors' in the 'Settings' drop down menu.
Grid Nudge : Nudges the selected object based on the grid division settings.
Position at Zero : Repositions selected objects around the main grid axis. This is based on the bounding box of the object and allows for quick repositioning of objects for building modular structures and/or export. The object is positioned in relation to the main grid axis based on the LFB, CFB, CB and C option. See below for details.
Relocate Object : Postitions the selected object based on the selected LFB, CFB, CB and C option (see below).
Relocate Pivot :Postions the pivot of the selected object in local space based on the selected LFB, CFB, CB and C option (see below).
LFB - Left Front Bottom : Relocates the object so the left front bottom corner of the object is snapped to the main grid axis. (+X, +Y, -Z)
CFB - Center Front Bottom : Relocates the object so it is centered and just behind the main grid axis in -Z. (X, +Y, -Z)
CB - Center Bottom : Relocates the object so it is centered, sitting on the main grid axis. (X, +Y, Z)
C - Center : Relocates the object so it is centerd on the main grid axis. (Z, Y, Z)
Rotate : Rotates the object based on float field values. Default is 0, 90, 0.
Stack : True stacking based on selection order and bounding boxes. Select meshes in order starting with the mesh you want to stack on top of. Select the appropriate radio button for the direction you wish to stack in.
Six Foot Human : Creates a box reference that is 6 feet high and 4 feet wide. Feet are based on UU's per foot as set in Settings -> Unreal Units per foot.
Make Your Own : Create a reference based on float field input. Default settings are 16 feet wide, 8 feet high, 1 foot deep. Feet are based on UU's per foot as set in Settings -> Unreal Units per foot.
Custom : To use your own references, create a folder in your current Maya project named 'UDKreference'. Put Maya Binary files (*.mb) that contain your references in this folder and jbUDK Tools will create a button for each .mb file found when the script is run. .
The calculator fields allow you to enter UU's, inches, feet, yards or miles. All fields update instantly allowing for quick conversions. Settings are based on UU's per foot as set in Settings -> Unreal Units per foot.
Export features allow you to export from your scene in the FBX format. jbUDK Tools will automatically load the latest FBX export preset file (*.fbxexportpreset) located in the root of your current Maya project. If you do not have a valid FBX export preset file in this location you must manually choose a valid FBX export preset file before exporting (do this in the 'settings' dropdown menu.)
To Create a custom FBX preset :
- Open the options box from either File -> Export All... or File -> Export Selection...
- Under General Options, change the file type to FBX export
- Under File Type Specific Options press Edit Preset...
- In the Edit export preset window change the Current Preset to User defined
- Change settings as desired
- Press Save preset at the bottom of the Edit export preset window
- By default the preset file saves to your User\Documents\maya\FBX\Presets\MayaVersionNumber\export
Individual Export : Exports a single selected object from where it exists in world space. Remember, pivot location for UDK is based on the main grid axis --use the transform tools to position and rotate the object as desired before exporting. You will be prompted for a folder location. The resulting FBX file takes the name from the maya scene mesh.
Batch Export : Batch export opens the Batch Export Window. From the batch export window you can create a list of all objects you want to export from your scene and export them at once as separate objects.
Add : Adds to the export list.
Remove : Removes objects either selected in the scene or in the list from the export list.
Remove All : Clears the export list.
Prefix/Suffix : Adds text in these boxes to the beginning and/or end of the mesh names in the export list.
Auto Position : Automatically positions each object based on the LFB, CFB, CB and C setting before export. This allows you to export a large number of objects without first moving them to the main grid axis. Please note that you should have them facing the desired direction.
Restore After Export : Puts the objects back to their original location when the export is completed.
EXPORT : Exports all meshes in the export list.
Tip : The script prints what was exported to the script window -- check this along with the FBX log file for confirmation of export.