Home Technical Talk

pbUDK udk export and collsion tool for maya

passerby
polycounter lvl 12
Offline / Send Message
passerby polycounter lvl 12
Just a little script i been working on for a while, that i use for creating quick collision hulls, and exporting to udk with one click, thought it could be useful to some maya and udk users.

when it creates new collision hulls, it automatically follows the unreal UCX_ naming convention for collisions, and on export it centers everything to the world origin so that pivots are properly placed in udk.

pbUDKjpg


Installation
Clone or extract contents to the parent of your Maya scripts folder(for me this is "C:\Users\User\Documents\maya\2012-x64"). Than enable the DDConvexHull plug-in for your version of Maya in the Maya plugin manager.

Once this is done simply just open a python console and run these commands.
import pbUDK
pbUDK.UI()
Optionally you could create a shelf button containing the same python code as above.
 GITHUB

UPDATE 1.01:
Added batch exporting.
Made batch export selections persistent, and attached to the scene.

Replies

  • jStins
    Options
    Offline / Send Message
    jStins interpolator
    This looks pretty useful. I'll check it out soon. Thanks!
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Thanks give me a heads up if you find any problems with it.
  • chrisavigni
    Options
    Offline / Send Message
    chrisavigni polycounter lvl 12
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Also forgot to mention install notes in the readme, and the collision stuff only works on Maya 2012, 2013, and 2014.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Made a minor update to this too, now instead of just exporting the selected meshes, or the whole scene, there is the option to work with batch export from a list.

    I implemented in a way that the selection for the batch export is stored in the scene file and persistent between sessions.
  • Minos
    Options
    Offline / Send Message
    Minos polycounter lvl 16
    Bump!

    This wonderful little script is a huge time saver and works perfectly for Unreal 4. I wrote a little tutorial on my workflow if anyone is interested:
    http://thiagoklafke.com/batchexport.html

    Thanks Chris for the script!

  • kippernicus
    Options
    Offline / Send Message
    kippernicus polycounter lvl 11
    Nother bump here.

    Any plans on updating this for Maya 2016 ext2? I just messed around with the plugin (which is fantastic, by the way) and ran into some issues with objects showing up twice in the export list, as well as not being able to remove objects from the list on occasion. Here's the error I get:

    # Error: AttributeError: file C:\Program Files\Autodesk\Maya2016.5\Python\lib\site-packages\pymel\core\nodetypes.py line 1801: nt.Transform(u'CrowdA_EndCap_Curve') has no attribute or method named 'pbExport' #

    The error isn't entirely consistent, but it does seem to happen every time I try to remove multiple items from the list at once by shift-selecting them.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I can look at things again for you, also be sure to get the copy of it from github , i can not test for Maya 2016 ext2 or compile the convex hull plugin for Maya 2016 since i currently only have Maya 2012 and 2015 and don't see myself getting a more recent Maya anytime soon since my current job is no longer in tech art but in software engineering now.

    But i will see if i can recreate that bug for you in my copy of 2015, and see what else i can do. Is their any new features people are looking for?
  • kippernicus
    Options
    Offline / Send Message
    kippernicus polycounter lvl 11
    Thanks for the reply. Yeah, I grabbed it from github yesterday. I understand about the convex hull deal. I appreciate you looking into the error though. :)

    A "clear all" button would be pretty great, along with the ability to add a custom suffix or prefix to exported meshes, depending on their parent-child relationship. I could be wrong, but the "move to origin" checkbox doesn't seem to work as described. For me, it simply clears the the transforms and exports it from it's current position. Other than that, the tool works fine; box and sphere generators work perfectly, the export children works and it seems to recognize my FBX preset settings.

    These are very minor gripes considering how useful this tool has been for me so far. Thank you again for creating this and making it available for everyone.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    what are you thoughts, on custom suffix or prefix that you would like?
    also check out the new version 1.05 i just committed, and see if it fixes the duplicate problem as well as the attribute error that happens when trying to remove said duplicate.

    also look into the centering behavior, it should center things to the worlds 0, 0, 0 than freeze transformations before export, and return things to their old location when done
  • kippernicus
    Options
    Offline / Send Message
    kippernicus polycounter lvl 11
    Having the option to do it in the first place seems good enough for me. My original thought was to include it to not have to worry about the UCX_ naming convention for collision meshes, but I see that you're already generating the correct name when adding a hull from the menu (which is phenomenal, by the way).

    "Move to Origin" works for me now. I'm still getting duplicates in the export list, but for some reason it's only happening with certain objects. If I were to create a new cube, for instance, adding and removing it from the list works. Not sure what's happening there, but exporting those items that are duplicated in the list still works fine.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Can you try grabbing the latest from my unstable dev branch, https://github.com/cmcpasserby/pbUDK/tree/develop
    than let me know if that fixes the duplicate bug. I also added a clear all button in that one as well which should remove any attribute data left behind from older versions. If that works let me know and i will merge the change into the release version.


  • kippernicus
    Options
    Offline / Send Message
    kippernicus polycounter lvl 11
    Sorry for the late reply, Passerby. I just grabbed the latest version and tried testing it. I wasn't able to add any objects into the export list in the scene I'm working in, so I started a new scene, created some primitives and tried adding them to the list. Looks like I'm only able to add objects that have a collision mesh applied to them. The remove and clear buttons seem to work though. :smile:. Lemme know if there's anything else you'd like me to test with this one.


  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    yeah seems i was too hasty with last change will fix it soon. Also i dont currently have to work with maya much so i dont get to test in a production envirmeant anymore. I also just pushed a new version that should fix that.
  • MDiamond
    Options
    Offline / Send Message
    MDiamond polycounter lvl 10
    Can someone please compile this to Maya 2016? I would love to try it out.
  • mr.AFK
    Options
    Offline / Send Message
    mr.AFK polycounter lvl 5
    Getting a error message when I try to enable the plug-in "DDConvexHull-2017_64bit" in the plug-in manager:
    // Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) // 

    What am I missing here/doing wrong? I can't figure it out...
    I extracted:
    the "DDConvexHull-2017_64bit.mll" into C:\Users\User\Documents\maya\2017\plug-ins\
    the "udk.png" into C:\Users\User\Documents\maya\2017\prefs\icons\
    the "pbUDK.py" and the "udkExport"-folder (+content) into C:\Users\User\Documents\maya\2017\scripts\

  • MDiamond
    Options
    Offline / Send Message
    MDiamond polycounter lvl 10
    mr.AFK said:
    Getting a error message when I try to enable the plug-in "DDConvexHull-2017_64bit" in the plug-in manager:
    // Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) // 

    What am I missing here/doing wrong? I can't figure it out...
    I extracted:
    the "DDConvexHull-2017_64bit.mll" into C:\Users\User\Documents\maya\2017\plug-ins\
    the "udk.png" into C:\Users\User\Documents\maya\2017\prefs\icons\
    the "pbUDK.py" and the "udkExport"-folder (+content) into C:\Users\User\Documents\maya\2017\scripts\

    mr.AFK said:
    Getting a error message when I try to enable the plug-in "DDConvexHull-2017_64bit" in the plug-in manager:
    // Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) // 

    What am I missing here/doing wrong? I can't figure it out...
    I extracted:
    the "DDConvexHull-2017_64bit.mll" into C:\Users\User\Documents\maya\2017\plug-ins\
    the "udk.png" into C:\Users\User\Documents\maya\2017\prefs\icons\
    the "pbUDK.py" and the "udkExport"-folder (+content) into C:\Users\User\Documents\maya\2017\scripts\

    I got it to work, here's what I did:
    1)Extracted the zip to C:\Users\[yourname]\Documents\maya\[yourversion]
    2)Loaded the plugin version in the plugin manager
    3)Opened the script editor, Load Script>C:\Users\[yourname]\Documents\maya\[yourversion]\pbUDK-master\scripts\pbUDK.py
    4)Save script to Shelf
  • Chanbeast
    Options
    Offline / Send Message
    Chanbeast null
    MDiamond said:
    mr.AFK said:
    Getting a error message when I try to enable the plug-in "DDConvexHull-2017_64bit" in the plug-in manager:
    // Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) // 

    What am I missing here/doing wrong? I can't figure it out...
    I extracted:
    the "DDConvexHull-2017_64bit.mll" into C:\Users\User\Documents\maya\2017\plug-ins\
    the "udk.png" into C:\Users\User\Documents\maya\2017\prefs\icons\
    the "pbUDK.py" and the "udkExport"-folder (+content) into C:\Users\User\Documents\maya\2017\scripts\

    mr.AFK said:
    Getting a error message when I try to enable the plug-in "DDConvexHull-2017_64bit" in the plug-in manager:
    // Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) // 

    What am I missing here/doing wrong? I can't figure it out...
    I extracted:
    the "DDConvexHull-2017_64bit.mll" into C:\Users\User\Documents\maya\2017\plug-ins\
    the "udk.png" into C:\Users\User\Documents\maya\2017\prefs\icons\
    the "pbUDK.py" and the "udkExport"-folder (+content) into C:\Users\User\Documents\maya\2017\scripts\

    I got it to work, here's what I did:
    1)Extracted the zip to C:\Users\[yourname]\Documents\maya\[yourversion]
    2)Loaded the plugin version in the plugin manager
    3)Opened the script editor, Load Script>C:\Users\[yourname]\Documents\maya\[yourversion]\pbUDK-master\scripts\pbUDK.py
    4)Save script to Shelf
    Hey MDiamond, sorry to bother you -- I'm actually having the same problem as mr.AFK. As soon as I try to load the DDConvexHull-2017_64bit.mll plug-in, I get this error: 

    "// Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) //"

    Am I just not installing the plug-in correctly? Were you using Maya 2017 when you got this working?

    Thanks in advance!
  • MDiamond
    Options
    Offline / Send Message
    MDiamond polycounter lvl 10
    Chanbeast said:
    Hey MDiamond, sorry to bother you -- I'm actually having the same problem as mr.AFK. As soon as I try to load the DDConvexHull-2017_64bit.mll plug-in, I get this error: 

    "// Error: line 1: The specified module could not be found.
     (DDConvexHull-2017_64bit) //"

    Am I just not installing the plug-in correctly? Were you using Maya 2017 when you got this working?

    Thanks in advance!

    Hey, sorry for the late reply.
    Yes, I'm using on Maya 2017. 
    weirdly, I just installed on my brand new laptop and didn't need to load the DCC plug-in the plugin manager. I just dropped the pbUDK-master folder in the Maya version folder and loaded the script through the script editor and it worked np.

    Cheers.
  • [HP]
    Options
    Offline / Send Message
    [HP] polycounter lvl 13
    Working like a charm on 2016.5. I wish it had sets, but I'm glad it at least works with groups, so I can just name the group to what I want my .FBX to be called and set the pivot of the group to where I want it to. This way I don't have to keep renaming the mesh every single time I want to export it, I just make sure the meshes are inside their respective group, and export.

    This beats the default Maya Game Exporter any day, tried to use that but it feels like it's been coded by someone in isolation and it wasn't tested by an actual artist, the usability is just horrible and convoluted.

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    wow have not been here in a while and didn't think people are still using this. I am open to suggestions such as using sets, and updating it to be for ue4 and unity since it was only ever made for udk
  • PurpleSwag666
    Options
    Offline / Send Message
    PurpleSwag666 polycounter lvl 3
    passerby said:
    wow have not been here in a while and didn't think people are still using this. I am open to suggestions such as using sets, and updating it to be for ue4 and unity since it was only ever made for udk
    This plugin is very useful,thank you very much.But now i update my maya to 2018,i got some problem(maya2017 no problem).When i use this plugin export mesh to UE4 can`t find smoothing groups,all setting same like maya2017,will you update this plugin?
Sign In or Register to comment.