Home Technical Talk

FBX Exportsets script for UDK

polycounter lvl 14
Offline / Send Message
Xoliul polycounter lvl 14
One of the issues of having a really streamlined pipeline at work is that it sucks to go home and not have any of that stuff :(
So I spent today writing a "Light" version of the Exportsets script that MoP wrote at work. It's fairly simple but does provide all the functionality.

So what is this, what does it do?
  • No more manual selecting, File > Export Selected, checking settings, etc...
  • It keeps track of sets of objects to be exported
  • For every set, the type (Static/Skeletal for now) is stored
  • It also stores the export path, and automatically injects an "SM_" or "SK_" prefix if necessary.
  • Exports with one click!
Result is that it should be really quick and easy to export stuff for UDK now!


Here's the link: http://www.scriptspot.com/3ds-max/scripts/udk-fbxporter


I literally finished this 20 minutes ago, so if you find any bugs let me know.

Replies

  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    Awesome! I will try this out at home. I was going to find time this week to write one of these so thank you!!
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Hey thanks man. Anyone creating 3D meshes for UDK in Max should use something like this, it's just so much easier!
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya i made something pretty similar for maya, exports groups, out to fbx, using the group name as the export name, into the projects data dir, and it centers things at 0,0,0 as it exports.

    since it works on groups, i can include a lod group in there and a mesh with the ucx_ prefix, and it will come into udk with working lods and collisions too.

    i find most of these type of things are best to just ustom make for your self, since that way it can be based on your workflow and how you orginze your files.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Wowzers, that is a keeper!
  • JonathanLambert
    Options
    Offline / Send Message
    JonathanLambert polycounter lvl 6
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    passerby wrote: »
    ya i made something pretty similar for maya, exports groups, out to fbx, using the group name as the export name, into the projects data dir, and it centers things at 0,0,0 as it exports.

    since it works on groups, i can include a lod group in there and a mesh with the ucx_ prefix, and it will come into udk with working lods and collisions too.

    i find most of these type of things are best to just ustom make for your self, since that way it can be based on your workflow and how you orginze your files.

    Ah hey, UCX stuff is something i completely forgot about! I'll try adding that soon, should only be a few lines. I'm not too sure how the lodgroups thing works.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Xoliul wrote: »
    Ah hey, UCX stuff is something i completely forgot about! I'll try adding that soon, should only be a few lines. I'm not too sure how the lodgroups thing works.

    ya i never tired lodgroups in max, but and only recently discovered them in maya, but they pretty much worked out of the box for me.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    I've been using it just for a bit and thanks so much again! :)

    I just added to mine a quick modification so if you're exporting just one mesh in a set then the file picker automatically fills out the file name box in the Save Path dialog, filling it with the name of your currently selected object.

    My MaxScript knowledge is appalling but this is what I did to btn_pickpath:
    		local savepath = undefined
    		local filedefault = ""
    		
    		selected = selection as array
    		if selected.count == 1 then
    		(
    			for o in selected do filedefault = o.name
    		)
    		
    		savepath = getSaveFileName caption:"Choose Save Path" types:"FBX(*.fbx)" historyCategory:"FBXporterpath" initialDir:maxfilepath filename:filedefault
    

    I'm sure you can just get the name of the selected object without the loop but that's how I roll.
  • systemic
    Options
    Offline / Send Message
    systemic polycounter lvl 7
    Wow, really useful. Thank you so much!
  • megalmn2000
    Options
    Offline / Send Message
    megalmn2000 polycounter lvl 13
    Thanks a lot Laurens! I don't know why, but seems like it doesn't work well for me. :( The export button doesn't seems to work.
    But I can still select some meshes and group them to a new selection.
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    For some reason it not working for me. I try running the script and nothing happens I'm using max 2013
  • devingeesr
    Options
    Offline / Send Message
    devingeesr polycounter lvl 13
    ex that it's working fine now!
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Thanks a lot Laurens! I don't know why, but seems like it doesn't work well for me. :( The export button doesn't seems to work.
    But I can still select some meshes and group them to a new selection.

    Hey didn't catch this. Are you using Max 2008 or something? They changed the FBX exporter recently, which is pretty much a prerequisite for UDK: it needs a recent FBX exporter because the old ones weren't very good.
    I haven't really got the time to test this on 4 years worth of Max releases, but I'm guessing 2010 upwards should work? Definitely 2011 and 2012.

    edit: yeah devin it's a macroscript. That tends to confuse people a bit (even though it's actually easier and better).
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    I can confirm it works in 2010 and up. Haven't tried older.
  • megalmn2000
    Options
    Offline / Send Message
    megalmn2000 polycounter lvl 13
    Xoliul wrote: »
    Hey didn't catch this. Are you using Max 2008 or something? They changed the FBX exporter recently, which is pretty much a prerequisite for UDK: it needs a recent FBX exporter because the old ones weren't very good.
    I haven't really got the time to test this on 4 years worth of Max releases, but I'm guessing 2010 upwards should work? Definitely 2011 and 2012.

    edit: yeah devin it's a macroscript. That tends to confuse people a bit (even though it's actually easier and better).

    Thanks for your support! I'm using 3ds Max 2012. Perhaps, if I change the FBX format it should work. Anyways, I,m gonna try it after work! :)
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Ok that's strange. It's quite a simple script, so it shouldn't really fail.
    Are you sure the export path is correct and that it has write access to that folder ?
    Does it log anything in the Maxscript debug log ? (F11)
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    It might be worth verifying that the FBX plugin is loaded - I believe it's possible to disable it by default, and if it's not loaded that could be why the export is failing.
    There are plugin manager script functions to force the loading of any known plugins.
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Yes I read about that and thought my code covered it... I'll have to check again.
    Then again, it should be easy to replicate by just rebooting Max and trying to run the script without doing a prior manual export ? That's never gone wrong for me when testing.
  • decorix
    Options
    Offline / Send Message
    decorix polycounter lvl 11
    Hi Laurens,

    I have installed the script (max2012) thanks. But I'm wondering
    if i'm using it the right way.

    Does it work like this..?

    you select you're meshes, but then?

    then I use the add them to the (set contents).
    my meshes get added. eg. box01, box02

    Then you have the Export sets option..

    add-new. How does this work?

    I then export, but i don't get any FBX settings. Only Explict Normals
    I can check. Is this correct?

    How do you go from UDK?

    I import my FBX in UDK..

    Is this how it works?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    yeah so basically, the bottom part is the set contents. You add meshes, set the path, choose the type.
    Then, you hit "Add New" to create a new set, this creates a hidden object that stores the set.
    You can then just hit "Export" and it will export to FBX, without a dialog (that's the point, it sets the right settings automatically for you). Just bring it into UDk then :)
    If you select a set, and then change the properties, it saves these right away to the set.
Sign In or Register to comment.