[Tutorial] Import MESH into 3DS MAX



  • TiptoeTiptoe Posts: 184
    ****! ****! ****! What can I say? Graboi, you sir, are da man!!!!!!!!

    I am just totally blown away by this, I thought it would take someone months to figure this out. I was also very worried that it might not be possible to do it at all.

    What you have done is just mind bogglingly awesome! You just wait till the Ogre folks find out what you've done, man are you gonna be popular (those folks have been begging for an importer like this for forever) :mrgreen:.

    All I can say is THANKYOU!

    Incredible, incredible work!
  • graboigraboi Posts: 38
    Thanks , your very welcome :)
    It will take a little more work to be a general OGRE file importer
    but that is where I want to go with it. enjoy!
  • graboigraboi Posts: 38
    Ok, here's an update with ver 0.01 of the rollout.
    you no longer have to save the animations to xaf file.
    Just follow the button order.
    You can 'technically' keep loading up different animation files, however,
    I have noticed some strangeness when I do this too many times.
    Seems to be a Maxscript thing.


  • heronheron Posts: 637

    Just ran the script and it's beautiful!
    Any chance having it load into the menu when you start max?
  • Outstanding work dude. Now all I have to do is find an output script for Max 2010.
  • TiptoeTiptoe Posts: 184
    Graboi you are an absolute phenomenon! I can't believe how fast you work :shock:.

    Thankyou, thankyou, thankyou.
  • graboigraboi Posts: 38
    Thank's all

    Yes you can set it up to run as a plugin i believe, I will investigate.
    The next update will have an animation track browser/loader so you can
    load up multiple animations at once and choose the one to play.
    Also I would like to parse the material files to load up default textures etc.
    The MESH files have a tag in there specifying the base SKELETON the mesh
    uses so the 'Import Base Pose' button can go away and I will load it with the
    MESH automatically. lol , prolly have it tommorrow ! :) just kidding.

    Oh yeah once I get the importing completely nailed I'll work on the exporter.

    Update: Ha Ha, I had a big Doh! moment and realized why loading multiple animations
    is causing some artifacts. I forgot to clear the old keys from the bones that dont have keys in the
    new animation. Lets consider it rudimentary animation blending :) I'll have it fixed tommorrow.
  • TiptoeTiptoe Posts: 184
    I just got home and tested it. And as Heron said, it works beautifully :mrgreen:.

    I did have one little hiccup at the start, when I asked it to 'run' the script, I got an error message when I tried to load the animation. But when I used 'Open script and Crtl+E' to start it, it worked perfectly. So I'm very, very happy :mrgreen:.

    Edit: I forgot to mention, I loaded the Alchemist model and his run animation. When I play the run animation, it's very fast (maybe twice the speed of the in game animation) is this normal?
  • graboigraboi Posts: 38
    edited November 2009
    Lol, you caught me!
    I haven't been using the keyframes encoded timings ... until now!
    This update fixes the keyframe issue with loading multiple animations
    and now uses the keyframes encoded timing based on 30fps max's default
    (so set max to that if it isn't). You will notice the animation is much smoother.
    Oh yeah and that WalkTreeAnimate undefined bug is fixed (i think) :) .



    UPDATE: Get the latest version! Many improvements.

  • SkiffySkiffy Posts: 38
    **** nice :)
    this works great for characters!

    Umm any plans on making the importer work more with tilesets? I know the previous ones had issues with loading the town set because it used vertex colors. I would love to be able to import all those assets from the game. Keep up the wicked scripting everyone!

    "Skiffy the junkyard monster stares at the monitor.. and then tosses it into the trash compactor"
  • graboigraboi Posts: 38
    Yes, I'm actually working on a completely new XML parser using the
    .NET hooks in maxscript, it should enable this to become a much
    better all around OGRE file importer, not just torchlight specific
    which is kinda what it is now... coming soon ;)

    In fact the new parser is coming along , loads all the scene stuff I've tried so far

  • I have modified a MESH file in 3DS MAX 2010 and I was wondering how can I convert it back into a mesh file so I can use it in the game.
  • graboigraboi Posts: 38
    Well Runic has only released plugins for max 2009, I am planning on writing a maxscipt exporter eventually,
    If its a static mesh you could export it as a wavefront or 3ds file then bring it into Blender (free 3d app , awsome stuff)
    and then use the blender ogre exporter (OGRE3d.org) , If its animated you can try something like md5 export script
    for max then import that into blender then use the blendrer OGRE exporter , something like that.
  • ZZZZ I wish Runic would concentrate on the newest version of max.....

    I will try what you said.
  • TiptoeTiptoe Posts: 184
    Some people have had success with the OgreMax exporters: http://www.ogremax.com/

    I haven't tried this myself yet, so I can't say if it works or not. Good luck!
  • Ok I have been able to save the static mesh as a 3ds file and I have it imported to blender and i have the exporter downloaded. But can you explain how I can use blender and the ogre exporter to convert the file into a mesh file.
  • TiptoeTiptoe Posts: 184
    Graboi I've just tested the new script, it's perfect!

    Whatever the bug was that wouldn't let me 'run' it, you've squashed it. It now works just fine. I also love the fact that it now imports the model in an upright position (as opposed to laying flat on his back :roll:) and the animation now plays at normal speed.

    Fantastic job :mrgreen:.
  • I am trying to open the Ogremeshesexporter in blender but it gives me an error.....
  • I am now having trouble with the ogre console......

    it doesn't seem to be exporting correctly.

    It seems is wants to export each object as a separate xml file....


  • graboigraboi Posts: 38
    Sorry I haven't used the blender exporter myself.
    There is a forum for the exporter at the OGRE3D site
    however. Maybe try there, good luck!
  • graboi wrote:
    Sorry I haven't used the blender exporter myself.
    There is a forum for the exporter at the OGRE3D site
    however. Maybe try there, good luck!

    Yah I already made my own thread for help because the thread for the exporter doesn't list anything as help.

    I wish there was an exporter for max 2010 though......
  • graboigraboi Posts: 38
    Here's the new mesh importer I have been working on. It will only import meshes, no bones for now ,
    but Its good for the level sets someone was asking about.
    If your MESH.xml files are in the same directory as the textures it will do its best to load the texture also.
    Whats really fun is you don't have to restart the script to load more meshes. :)
    This script requires DOT NET be installed on your computer and I believe it will only work on MAX 8 and up.

    http://rapidshare.com/files/308528968/I ... DotNet.zip

    Have Fun,


    Oh yeah here's a handy dos command to batch convert you MESH's just open a dos window in the MESH directory you want and type

    for %1 in ( *.MESH) DO c:\OgreCommandLineTools\OgreXmlConverter %1

    and then go grab a coffee or something ;)
  • heronheron Posts: 637
    so that batch command will convert .mesh to .xml?
    very nice! beats dragging a single file over to the OgreXmlConverter.exe!
  • graboigraboi Posts: 38
    Yeah , much better.And for skeletons just replace MESH ...

    for %1 in ( *.SKELETON) DO c:\OgreCommandLineTools\OgreXmlConverter %1
  • TiptoeTiptoe Posts: 184
    heron wrote:
    so that batch command will convert .mesh to .xml?
    very nice! beats dragging a single file over to the OgreXmlConverter.exe!

    I'll say! Great tip Graboi!

    Question: Is the Command Prompt the same thing as a DOS window?

    As for the new mesh importer, I will test it as soon as I get home. I've been having lots of fun with the character importer, now it's time to see how those levels are designed :mrgreen:.
  • graboigraboi Posts: 38
    Yes, command prompt = DOS window. I also recommend a nice utility called
    Command Prompt Here for windows that puts a right click action under your folder icon
    in any explorer window like ..


    Saves a lot of typing cd .. cd .. cd etc
    Just Google 'Command Prompt Here' its a windows powertoy or something.
  • TiptoeTiptoe Posts: 184
    Oh that is excellent! Changing directories is a pain in the neck. Thanks very much :mrgreen:.
  • graboigraboi Posts: 38
    Hey , everyone I found this,

    get the 'Download Non-Commercial SDK' and unzip it it has installers for the max plugin

    Its a free for non comercial game engine.
    It has exporters for max 9 thru 2010 that support
    Ogre MESH and SKELETON files , the resulting .xml's
    Can be turned into binary Ogre files with OgreXmlConverter without a hiccup.
    I haven't tried them in the game, but my new mesh importer works fine on the mesh files
    and I can load the skeleton files , Theres a tag in the mesh files that the animation rollout
    I posted chokes on but that is getting an update soon to use the new mesh parser.
    Anyway might be promising for exporting to the game without all the file conversion , Blender
    Hocus Pocus, Try it out :)
  • TiptoeTiptoe Posts: 184
    Fantastic! I'll download it and try it out as soon as I get home :mrgreen:.
Sign In or Register to comment.