Hopefully this is useful to people exporting stuff out to UDK from Maya. You can batch export your models which take the geometry name. Currently trying to figure out an elegant solution to renaming/checking again if name is correct. So make sure to name your objects otherwise you are gonna get pSphere9000 :P Anywho here it is.
Download Here.
Installation:
1. Download the .mel file.
2. Place it in your My Documents/maya/scripts folder.
3. Re-start Maya (or type rehash in command line) and type fbxExporter; in the MEL command line to launch the tool.
4. Make shelf button or add to marking menu's for profit.
TO DO:
- Implement ASE batch export
- Implement quick pivot changes as second tab.
- Implement some sort of quick export options like recently used paths/last used options.
Cheers and feedback is always appreciated
EDIT: O and big thanks to MoP. Used his multiObjTool script to learn. Thanks MoP
Replies
One thing I might suggest is that you investigate Sets with custom attributes on them (eg. export path) so that if the user exports a selection of multiple objects to a specific path/filename, you then store those objects in a new Set, name the Set to match the filename, and store the path in a custom attribute.
You could also use Locators in sets to allow users to set custom pivot points for export - then the script can simply offset the contents of the Set to make the Locator be at world 0,0,0, resulting in a nicely aligned set of objects in a single FBX file.
This'll mean you can have scenes containing multiple objects in any heirarchy, all being exported to custom FBX files with any offset or any sub-grouping of objects, which is much more flexible than simply outputting each object to its own filename.
... hmm, I should probably get around to upgrading my old scripts
Keep up the good work, I'm sure a lot of people will find this handy, and no doubt have other good ideas to improve it too!
No problem. Ill get that in by end of this week/today. Been working away/learning pymel for my next tool. Let me know if you have any suggestions!
Feel free too Also got the script updated to move back to its original location. Updated the original post with download too. Also looking back at the code, center pivot unchecked never worked haha so fixed that too.
thanks Lamont. Seen a bunch of scripts that do it that way. Gonna try and re-write this script with set functionality like MoP suggested and move this to python and maybe learn some pyQT along the way. Let me know what you cook up with it
Just a thought.
One thing I'm interested in, and not sure how you would go about this, is some kind of system for exporting objects with collisions as well. I'd guess something like taking a mesh's name and allowing an option for user-input prefixes to get exported with it, like UCX_ or whatnot.
I'm gonna use it everytime now !
Some questions/suggestions :
-What does mean "Preserve Mesh Input Connections" ?
-It's possible to get a message box error when you hit "export" without tipping before an output path ? I know, it's stupid, but sometimes I forgot and *bam*, I got a Maya crash. :poly142:
-Does this exporter support the LODs ? Like explained on this UDN page : http://udn.epicgames.com/Three/FBXStaticMeshPipeline.html#Static%20Mesh%20LODs ?
-It's also possible to export the full scene if when don't select anything ?
[EDIT]
I guess, something like that :
But I don't get the message, only an error in the comment line of the maya window :
"//Error: Cannot find procedure "fbxExport()"."
@Froyok: Thanks for bringing those errors up. I swear I thought i put in checks but probably removed them at some point. Will fix those up today. Regarding preserve mesh input connections, if something is grouped, the fbx exporter will export that group as one mesh.
LOD's should be doable. They just need an option ticked, which reminds me, anyone have any experience exporting animation with FBX? Do you just tick the animation box when exporting it or is there something else too? Regarding the full scene export, is there a functionality you want when nothing is selected?
@S2Engine: Trying to think of a friendly way to integrate collision export as well. MoP's set method would probably be my best bet.
@Lamont: thanks for that UCX code, will probably use it/tweak it to get what I need.
Guess I have a lot of coding to do haha
Thanks a bunch for the awesome script!
Hey not sure about this. Will try it on 2015 but are you using LT by any chance?
EDIT:Tested in 2015. Didnt notice a slow down.
Thanks! Not sure what it is. Mind hosting the ma/mb file somewhere to test or showing what the outliner looks like.
And on further examination, I notice it seams to fail on a specific items: it will go troughs the list of items in my Outliner in order (First selected to last selected) but the moment it selects a specific object, it will move it (if i ticket center to grid) but not export it. And to correct what I said earlier, even if I select the item alone, it will NOT export it as normal. So maybe its something wrong with my model but I didn't treat it any differently then the others.
On an other note, changing the name of the problematic item seamed to fix it, but how would that make any sense?
So the problematic item is Skeleton_Pelvis
Its weird that changing the name seams to fix it, its not like Maya would even allow me to have two items named the same.
EDIT: Yup its name conflict. So inside my code I call Maya Short Name instead of Full Name (was a noob back then XD) so it trys to select Skeleton_Pelvis but there is a skeleton pelvis inside skeleton_small and one in the root of the scene.
Just open up the script and copy and paste that in. Should work exactly the same. Seems when two conflicts like that happen. Maya forces the second mesh to take the long name of the mesh. Ill update the dropbox mel file when I get back home. Hope that helps Weird reading code I wrote like 3 years ago haha
You really saved my buns!! It works perfect now!
I just wanted to say "many thanks" for developing and sharing this utility.
Today I test it out with Maya 2016 and it still works like a charm: it's a great time saver tool.
Thanks in Advance
Thanks,
HP
Thanks for the kind words @MaddHattPatt and @Dennispls
fbxExporter();
?I've been using this script for years without problem. I'm wondering if it's perhaps a glitch with Maya 2016 or perhaps I am doing something different with some of my models without knowing that's causing this.