[Tutorial] Import MESH into 3DS MAX

12467

Comments

  • Might sound like the dumbest question ever, but where do I find/how do I use this XML converter? All I've found so far is an archive full of gibberish... I'm really interested in modding this, please help...
    "I was and am a nobody, and nothing anybody can say will make me feel like somebody."
  • graboigraboi Posts: 38
    Ogre3d site download the command line tools, install, then just drag and drop the mesh and skeleton files on to the
    ogrexmlconverter.exe and it will spit out an xml of the file.
    It installs right to c:\ogrecommandlinetools\ or something similar
    http://sourceforge.net/projects/ogre/files/ogre-tools/1.6.3/OgreCommandLineTools_1.6.3.msi/download
  • Hellmouth: I don't think its a dumb question at all because I had the exact same problem, and to be honest, I haven't found the .exe that you get with that download, still. LOL
    But here is what I did, and I think it makes the most sense, since all you want is the converter and not all that other stuff.

    Tiptoe is the one who deserves credit for this, posting these links earlier. And yes Tiptoe, this workflow will work for you!

    First Download this:
    http://sourceforge.net/apps/trac/rigsof ... .exe?rev=2
    then Download This:
    http://sourceforge.net/apps/trac/rigsof ... .dll?rev=2

    The first download is just the OgreXMLConverter.exe program you want
    and the second is the .dll file you need to run the OgreXMLConverter.exe
    Simply make a folder and put both the OgreXMLConverter.exe and the OgreMain.dll files in the folder.
    Now when you drag a .mesh file onto the OgreXMLConverter.exe it will work as expected.

    TaylorMouse: Thank you for your work with this 3ds max importer but I think it still doesn't work for all the models.
    I have been able to import the Alchemist, but not all other models.
    Specifically, if you try the Construct Mesh or the Burrower mesh I think you will find that the importer is unable to import these files.

    The work around I found for this is to use the latest version of 3d Object Converter (4.4 I think). Thanks to Monkey nutz for bringing this program to my attention here.

    Anyways Once you have the .mesh converted to .xml you can easily open the .xml file in 3d object Converter. Unfortunately it will cost you 50.00 to get the export features, but it's good for viewing the mesh if nothing else.
    Be sure to checkout the features of 3d Object Converter as you can view the uvs save them and do other stuff as well.

    Anyways, to get the Mesh into 3ds max WITH UVS, simply export from 3d Object Converter (File\Save As)(you have to have the full version as stated) and go all the way down the list and make sure you choose "Wavefront .obj" as your export type.
    Once you export as this type you can easily import into 3ds max WITH UV's intact.
    Hope this helps, and I'm sure TaylorMouse will have this all sorted so you won't need 3d Object Converter anyways. :)

    BTW, I have already exported a bunch of characters to test this out and so far I haven't run into any problems yet with the mesh or UV's.
    Freelance Artist: www.BradM3D.com
  • I just tried out the Bone Importer, and its working good for me so far.

    One question though.

    How would I actually use this, without having to re-rig the entire model for each bone animation set.

    As it stands, I don't know how I could say, rig a character with one bone animation sequence, then import another bone animation sequence to use on the same rig.

    Is it possible to get all the animations into one rig?

    thanks!
    Freelance Artist: www.BradM3D.com
  • graboigraboi Posts: 38
    I will be working on the meshes next to bring in all the vertex/bone weights and UV's etc,
    with a nice GUI rollout for max, next couple of days most likely.

    As far as all the animations in one rig, sure , I think I would save each one out to a max animation file then load
    the one i needed , like run, idle what ever. Once I get the weights in I can make the skin modifier right in maxscript
    so they will be all rigged up.
  • That would be awesome man! Im looking forward to it.
    Freelance Artist: www.BradM3D.com
  • graboigraboi Posts: 38
    Ok, heres a quick and dirty update to rig up the mesh with the bones.

    First use the new bone importer in the zip to load up base pose skeleton of the mesh you want.

    for example Vanquisher.SKELETON.xml ,

    then run the included mesh importer script and load up the mesh.

    ie Vanquisher.MESH.xml

    and there you go a nicely rigged up mesh you can pose.
    Once i fix some bone problems with the animation files and finish the Max rollout then you
    will be able to load up the animation files on top of the rigged mesh.

    Cheers

    http://rapidshare.com/files/305735638/ImportOgreXml_Fix2.zip
  • Just wanted to say i have used your scripts before TaylorMouse. Awesome work mate, without them i would have been lost :)
  • graboigraboi Posts: 38
    Quick update I had the weights all setting to just one bone in the previous script,
    here's the new stuff.
    Again these are continuations of Taylormouse and cascasdes work so props to all :)

    http://rapidshare.com/files/305745448/ImportOgreXml_Fix2.zip
  • awesome stuff, ill check it out.

    so far im still trying to get the **** animations to work with my script, mostly i just want to figure it out for educational purposes, purely selfish.

    as for the rollout wrapper, i would prolly be a good idea to first perfect these things and then load it all into a wrapper. that atleast how i usualy do it ;)

    what i was thinking was actualy doing it based on the files in the folder, i.e. load the main obj, then load the skeleton (since in the folders they always have the same name so its just matter of changing the file string. and then load the animation file associated that points to all the the anim rigs to add those in, all these files have consistant naming so it should be fairly simple (could add a little overwrite check for others just to make this a more all round ogre importer)

    an other thing i was thinking of was doing the xml conversion on the fly, ie load a .mesh and run that through the xmlconverter and read the file after that. that will eliminate any manual conversion and thus make it easier.

    any how, great stuff and hope it will all come to gether in some nice tools.
  • TiptoeTiptoe Posts: 184
    This is fantastic!

    I do have a slight problem with the new script though, when I tested 'ImportOgreXml_Fix2', it gave me an error: Maxscript FileIn Exception: -- Unknown property: "count" in undefined.

    I have no idea what that means, but maybe it will be useful to you :roll:

    Anyway, I tried it again with the old 'ImportOgreXmlSkel.ms' and 'ImportOgreXml_fix.ms' and it worked like a charm :mrgreen:. I now have a character with bones (but no skin modifier yet, so the bones aren't attached to the mesh).

    But this is so great! I can't thank you guys enough for this.
  • hi !

    After fumbling couple of times with the standard import script (no bones & animation)

    have you noticed that one can import the models/assets from every other folder than

    LevelSets\town1 ?

    EDIT: it gives this error

    vertex_array[v] = POINT3 p1 p2 p3

    Cheers !!
  • BradMyers82, thanks a lot, you've really helped me. :D
    However, when I choose a XML file to import, I get this message.

    Untitled-1copy-4.png?t=1258033421
    "I was and am a nobody, and nothing anybody can say will make me feel like somebody."
  • TiptoeTiptoe Posts: 184
    CaSCaDe wrote:
    i did it :D \o/ works on all skeletons i have imported so far.

    give it a go

    http://dl.dropbox.com/u/867177/ImportOgreXmlSkel.ms

    also made a minor ajustment to the model importer to line up everything as it should, ogre coord system works different then the max coord system so adjusted to make it work.

    http://dl.dropbox.com/u/867177/ImportOgreXml_Fix.ms

    Hellmouth try using Cascade's scripts (links above). I was getting the same error message when I was using the original script, but Cascade managed to fix it :mrgreen:.

    The first script imports the bones, the second script imports the mesh. I've tested them and I can confirm they work in both Max 8 and Max 2010.
  • graboigraboi Posts: 38
    Tiptoe

    Which file were you trying to import when you got that error , If I can reproduce it I can
    probably find the problem.

    Cascade

    Yeah what I would really like to do is work this into a generic Ogre importer
    so we need to add all the optional attributes that the files support, scale etc..

    I was thinking about your animation problem also, I noticed in your scripts
    you negate the x values and swap the y and z to align things for max.
    I would try to read them straight and then just negate the rotation axis,
    anyway that has worked for me. good luck!
  • TiptoeTiptoe Posts: 184
    graboi wrote:
    Tiptoe

    Which file were you trying to import when you got that error , If I can reproduce it I can
    probably find the problem.

    I was trying to import the Destoyer/Warrior model, 'player.MESH.xml'.
  • Tiptoe, thanks a lot. It works now. :D
    "I was and am a nobody, and nothing anybody can say will make me feel like somebody."
  • TiptoeTiptoe Posts: 184
    Hellmouth wrote:
    Tiptoe, thanks a lot. It works now. :D

    Great news! Do you have a new downoad link for it?
  • graboigraboi Posts: 38
    Tiptoe I haven't had a problem opening that mesh player.MESH.xml

    make sure you load the skeleton of the base pose first, player.SKELETON.xml
    the bones need to be there before the script makes the skin/weighting
    (you have to run ImportOgreXmlBonesTest.ms, then run ImportOgreXml_fix2.ms)
    I know its a little awkward but once i get all the script stuff working 100% I'll make a nice
    rollout for max (or maybe Cascade or Taylormouse will ;) )
    In any case I have done a lot more work and have the animations working 100% now.
    I just have to do some fixing on the bone/vertex weights, they are close but not quite right.

    I will be uploading the new scripts pretty soon with instructions on how to get the animations
    in as well.

    Cheers,

    Graboi
  • Woo Hoo! Can't wait! Sounds Awesome!
    Freelance Artist: www.BradM3D.com
  • graboigraboi Posts: 38
    Ok , phew , re-writing the mesh importer to support weights on shared geometry meshes was a
    huge pain, lol, anyway here it is, the weights are right the animations are right .
    I still need to clean up some code and make the rollout but I figured It was useful like this.
    Please follow the directions below.

    First you must have your MESH and SKELETON files in xml format.
    Use OgreCommandLineTools.

    Yes I know everything is laying down on the floor in max.
    After the last step you can clear the -90.0 x rotation from the root bone
    for happiness.

    Steps for success (mostly)

    Import the animation you want with ImportOgreXmlSkeleton.ms

    for instance 'Run.SKELETON.xml' from the warrior directory.

    ->Edit->Select All.

    ->File->Save Animation

    Save to something clever like 'DestroyerRun' , just use max's defaults.

    ->File->Reset

    Import the base SKELETON with ImportOgreXmlSkeleton.ms

    for instance 'player.SKELETON.xml'

    Import the MESH with ImportOgreXmlWeightedMesh.ms

    for instance 'player.MESH.xml'

    ->Edit->Select All

    ->File->Load Animation

    load your previously saved motion file

    play

    For now you will have to trim the animation start and end times yourself
    you can clip off keyframe 0 as it is a duplicate of keyframe 1

    now go ahead and select rotation and the root bone and clear the -90 there.

    Have Fun, and let me know which files this crashes on for you.

    Graboi

    http://rapidshare.com/files/307107103/OgreXmlImport.zip

    UPDATE: real quick update adds multi material texture channel, you can open materials
    and use the eye dropper on a mesh to set the texture to whatever you want (its defaulted to body.png)

    http://rapidshare.com/files/307140305/ImportOgreXmlWeightedMesh01.ms
  • heronheron Posts: 637
    awesome script!
    I noticed the mesh once imported are in a rig mode stance, so once you load up the skeleton (which is not in rig mode) the model becomes distorted.
    if only the skeleton has the rig mode stance to go along with the rig mode stance mesh.

    Below is a shot of a monster (construct) I load up with the running skeleton.

    constructn.jpg

    maybe I missed a step to get it properly rigged?
  • graboigraboi Posts: 38
    You have to load up the meshes base pose skeleton first, it will be named the same as the mesh except .SKELETON
    this is what binds the bones and the mesh in its rest pose.
    do not load the animated SKELETON files Directly , that is what you have done there.
    Read the above post carefully , the animated SKELETONS need to be loaded and saved to a
    Max .xaf files seperately then loaded onto the base pose using FIle->load animation
  • heronheron Posts: 637
    graboi wrote:
    You have to load up the meshes base pose skeleton first, it will be named the same as the mesh except .SKELETON
    this is what binds the bones and the mesh in its rest pose.
    do not load the animated SKELETON files Directly , that is what you have done there.
    Read the above post carefully , the animated SKELETONS need to be loaded and saved to a
    Max .xaf files seperately then loaded onto the base pose using FIle->load animation

    Ah, gotcha! So load the (animated).skeleton (ex:run)
    Then save the run animation.
    Reset.
    Load up a base skeleton (rig mode)
    Load up mesh (model)
    Select all the bones (excluding the mesh)
    Load up the run animation.
    Done.

    construct2.jpg

    Awesome! I will test the material script later.
  • graboigraboi Posts: 38
    There you go!
    Here's a shot with the textures :)

    construct.jpg
  • heronheron Posts: 637
    edited November 2009
    sweet!
    I cannot load the new script.

    ImportOgreXmlWeightedMesh01.ms

    crashz.th.jpg

    *update*

    I used the first ImportOgreXmlWeightedMesh.ms and was able to map a texture to it all the uv intact.

    construct3.jpg

    Btw, can you script so that when you load up the skeleton it would be -90 x in rotation (both mesh and skeleton)?
    Right now it seems tedious doing one animation at a time, lol.
    Other than that, it's perfect! <3
  • graboigraboi Posts: 38
    Hmm, that looks like a web page script , lol.
    you' ve downloaded the web page instead of the file :).

    try this one,
    replace the ImportOgreXmlWeightedMesh.ms with this new one for textures.

    http://rapidshare.com/files/307154910/ImportOgreXmlWeightedMesh01.zip
  • heronheron Posts: 637
    graboi wrote:
    Hmm, that looks like a web page script , lol.
    you' ve downloaded the web page instead of the file :).

    try this one,
    replace the ImportOgreXmlWeightedMesh.ms with this new one for textures.

    http://rapidshare.com/files/307154910/ImportOgreXmlWeightedMesh01.zip

    Ah! I right-click on your link to do a save-as to grab the ms script from rapidshare, lol.
    But the new one zip is working! Great Job!
  • graboigraboi Posts: 38
    heron wrote:
    Btw, can you script so that when you load up the skeleton it would be -90 x in rotation (both mesh and skeleton)?
    Right now it seems tedious doing one animation at a time, lol.
    Other than that, it's perfect! <3

    Yes , Not to worry, next I will be making a nice max GUI rollout , where you can load animations and set
    scale and clear root rotations and all kinds of nice stuff. Next few days or so , kinda need a break right now ,lol.
  • heronheron Posts: 637
    graboi wrote:
    heron wrote:
    Btw, can you script so that when you load up the skeleton it would be -90 x in rotation (both mesh and skeleton)?
    Right now it seems tedious doing one animation at a time, lol.
    Other than that, it's perfect! <3

    Yes , Not to worry, next I will be making a nice max GUI rollout , where you can load animations and set
    scale and clear root rotations and all kinds of nice stuff. Next few days or so , kinda need a break right now ,lol.

    Sounds Great! Cannot wait.
    Here's a dragonspawn with a running animation.

    http://www.youtube.com/watch?v=2_aJJQCioTI

    dragonrun.jpg
Sign In or Register to comment.