1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Level Design

Mapcore helpful scripting Sub-forum?

  • tr0nic
  • October 31, 2013 at 4:59 PM
  • tr0nic
    • October 31, 2013 at 4:59 PM
    • #1

    Hey, I'm looking for a MaxScript that automatically move my objects to the scene origin (0,0,0) and export them as .FBX (MAX to UDK)


    I found a script that does exactly that but If I select my collision and my mesh, it creates 2 separate .FBX instead of combining them into a single one.

    (UCX_SM_Cage.fbx) + (SM_Cage.fbx) instead of SM_Cage.fbx(which contains the collision info of UCX_SM_Cage)


    Also, maybe it would be great to have a place to share useful scripts. Like Unwrapping, exporting, etc?

  • Thrik
    • October 31, 2013 at 5:59 PM
    • #2

    Not sure it warrants a whole forum (that's normally only done if there are too many posts about a subject for one forum), but a sticky thread about it might be good. I could sticky this one if you want to keep the OP up to date with links to posts in the thread with useful stuff?

  • Spherix
    • November 1, 2013 at 8:24 AM
    • #3

    I refrained from asking questions about Vscripting for source here cause it didn't seem fitting ;o

  • Sjonsson
    • November 1, 2013 at 8:41 AM
    • #4

    I haven't seen this done in Max but I've seen it used in Maya Using MEL and it worked just fine except for one thing - you always has to specify where you want to export it to with a browser window but there's probably a workaround for that.

  • Thrik
    • November 1, 2013 at 10:41 AM
    • #5

    OK, give me a head count guys. I can create a third creative forum for coding, I just don't want to take up space up the forum home page if it'll only get like one post a week.


    I've no problem with coding stuff being posted in the 3D/2D forums (depending on whether it relates to 3D or 2D implementations) but I appreciate it feels a bit weird and a proper coding forum would be more ideal.

  • shawnolson
    • November 1, 2013 at 3:06 PM
    • #6
    Quote from tr0nic

    Hey, I'm looking for a MaxScript that automatically move my objects to the scene origin (0,0,0) and export them as .FBX (MAX to UDK)


    I found a script that does exactly that but If I select my collision and my mesh, it creates 2 separate .FBX instead of combining them into a single one.

    (UCX_SM_Cage.fbx) + (SM_Cage.fbx) instead of SM_Cage.fbx(which contains the collision info of UCX_SM_Cage)


    Also, maybe it would be great to have a place to share useful scripts. Like Unwrapping, exporting, etc?

    Display More

    Here is the code you want. Unfortunately, the forum is formatting it poorly, so you will have to make due.


    Please be aware that this kind of scenario assumes that all objects have pivot points at the same location before you export. To handle exporting props at location in Wall Worm, I had to build into my exporters an option to MOVE THE WORLD, so to speak, at export time instead of this scenario. But since we have no control over options in FBX, this is probably as close as it gets.


    (

    --First see if there is a selection

    if selection.count > 0 then (


    --Prompt the artist to choose the file name to save this as

    local filename = getSaveFileName caption:"Save as FBX at Origin" types:"Autidesk FBX (*.fbx)|*.fbx" historyCategory:"Saved FBX"


    --Only run the export if the user actually chose a file

    if filename != undefined then (


    --Run all transform calculations in World space

    in coordsys world (


    --Store the original position

    local oldTransform = for obj in selection collect obj.pos


    --Move all the objects to the origin

    selection.pos = [0,0,0]

    --Run the export

    exportFile filename #noPrompt selectedOnly:true using:FBXExP

    --Now put all the toys back where you found them

    for index = 1 to selection.count do (


    obj = selection[index]

    obj.pos = oldTransform[index]

    )

    )

    ) else (

    messagebox "File was not saved."

    )

    ) else (

    messagebox "Nothing was selected"

    )

    )


    Edit: it formatted fair without being in a CODE tag.

  • e-freak
    • November 1, 2013 at 4:08 PM
    • #7

    i'd be in for a scripting forum in terms of fbx exporting, if you want to export the same asset over and over again, it might make to store meta data in a user created attribute with the export path or at least the export name, to prevent repeatedly answering the same dialog - or using the render node's name as the export name.

  • Puddy
    • November 1, 2013 at 4:13 PM
    • #8

    Why more subforums? Can't you get an overview of the, like, two topics that are active at any one time?

  • tr0nic
    • November 1, 2013 at 10:14 PM
    • #9

    It was only a suggestion.. if you don't like it, don't do it! I wasn't sure if it was ok to post this in the 3d creative forum!

    Thanks ShawnOlson, I will try this over the week-end! I have a basic scripting class at school so I should be ok understanding your code

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. Custom Gamemodes Contest

    Angel
    July 20, 2026 at 11:46 AM
  2. FAQ

    Angel
    July 20, 2026 at 10:14 AM
  3. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  4. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  5. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  6. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  7. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  8. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  9. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  10. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™