Export the sample scene

mesa-logo-feature-image

Let’s go , now that Mesa is installed we will export the Sample scenes.

1. Open Maya !

2. Open the Source SDK from Steam tools and set the right game you want to export for.

Note :

If you want to export to Dota 2, and TF2 you will have to edit your GameConfig.txt .

Example path : c:/steam/steamapps/your-steam-account/sourcesdk/bin/source2009/bin/gameconfig.txt

Open it and copy the default configuration and edit the path to Dota2, or TF2.

With Portal 2, you must download the Portal 2 authoring tools, from Steam Library > Tools.

with L4D and L4D2, you must download the respective Authoring tools from Steam library > Tools.

3. Set the current Project on ModName_source ( or read the tutorial  )

4. Open the maya scene in “/ModName_source/scenes/props/cube.mb

mesa_sample_scene01

5.Take a look on the Shelves to locate the MESA Shelf.

mesa_shelf

6. Click on the First Icons “ SMD Options “, and display the Paths Tab

mesa_sample_scene02

The smd option attributes for the export are stored into the maya scene, so you probably have the same path than my personal path.

7. click on Default

SMD / QC path : this is the location where the SMD and the QC script will be exported.

Note :

The default name will be identical to the name of the scene., you can change the name, but it’s better to have the right scene name than your final MDL.

This is also important to not change the directory or the export will fail to export.

Materials Path :  The materialsrc path is always the materialsrc directory, if when you click on Default button and the path is not the “/mod_source/materialsrc/“, you probably get some trouble to export the textures.

The information at the bottom are just here as informative title , and to tell you what environment variables are set in your maya.env .

It could be helpful if you work on several mod projects.

8. now switch to the Export Tab.

mesa_sample_scene03

The scene is properly set up to export :

  • Reference model
  • Physics model
  • Lod Range model
  • Textures TGA to VTF
  • Material files VMT
  • Animation sample ( Animation tab)

 

9. Click on OK settings .

10. Important : Save the Maya Scene.

Note :

Do not forget to launch the source sdk and to set the current Game, on your Mod Project. or the compiler will fail to export the assets.

11. Click again to open the Smd option panel

12. Click on Full Compile .

You can see the progress bar , and you get some feedback from the script editor and the trace window.

mesa_sample_scene04

  1. Open the HL Model Viewer

mesa_sample_scene05

Voila

27 Comments

  1. I’m currently setting up a project structure to map for L4D2; one thing to note is that for L4D2, you don’t refer to the ‘bin’ folder in the source SDK, the path is ‘Steam\steamapps\common\left 4 dead 2\bin’, and you don’t have to change ‘GameConfig.txt’. Please correct me if I’m wrong :) I’m looking forward to using this tool, but first I’m making the block shapes in Sketchup before I go to Maya.

  2. i was wondering if someone could do a tutorial on this, i am trying to use mesa with SFM. i am having a lot of problems with the paths and spaces. i got to the point in the options window but i still get this error

    C:/Program Files (x86)/Steam/steamapps/common/SourceFilmmaker/content/khmesa/models/props/The system cannot find the path specified.

    i tried every variation with and without spaces and quotes and using Progra~1 instead of Program Files… but i keep getting this error.

    • hey Liuboto, can you tell me more about what you are doing when it happens, as it a bit complicated to me, to know the action you did to proceed
      So what did you do to get this error : “the system”cannot find the path specified” ?
      and sorry for the late reply.

      Red

      • i think part of the problem is that i am trying to use mesa with source filmmaker and the mods for sfm have a different folder structure:
        instead of modname_source/ and modname/ you have content/modname and game/modname. i will mess around a bit more and make a video of the steps to reproduce the problem.

        • luiboto, it works identically , i already test out by myslef and everything is working good with SFM.

          “../content/modname/” is the equivalent of “drive:/modname_source/”
          and
          “../game/modname/” is the equivalent of “../sourcemods/modname/”

          Red

  3. Hi Nicholas,

    Could you elaborate a little on how to set up for L4D2.

    As it is my maya env file looks like this –
    XBMLANGPATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\mesa\icons;
    SOURCE_BIN_PATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin\;
    SOURCE_MOD_PATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2;
    SOURCE_MOD_NAME = mymod
    SOURCESDK = E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin;
    VPROJECT = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\;

    But when I hit the SMD options button in maya it cannot find the file.

    I’ve also copied the Gameconfif.txt from left for dead and added it to to the bottom of the main Gameconfig.txt

    Cheers

    • EDIT:

      Got the SMD export working, but when i hit compile, The VMT is not created. The output window says exporting VMT files but nothing is in the folder.

      Any ideas?

    • Hi Gavk,

      1. L4D2 come with a authoring tools so i guess you donot have any thing to edit in your gameconfig.txt

      2. another error come from the semi colon at the end of line of your maya.env declaration

      XBMLANGPATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\mesa\icons;
      SOURCE_BIN_PATH = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin\”
      SOURCE_MOD_PATH = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\”
      SOURCE_MOD_NAME = mymod
      SOURCESDK = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin\”
      VPROJECT = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\”

      3. also be careful on one point, as your maya Project should be setup on the SOURCE_MOD_PATH.
      Go and read the answer i did for StudentR HERE should help you.

      4. it possible you forget to set up the layer membership correctly. I don’t have the proper tutorial for you on my site, so i must redirect you that tutorial :
      http://www.northcapestudios.com/blog/?p=45
      read this : 2.4 Preparing your model for export

      cheers
      Red

      • Thanks for your quick response Red,

        I’m nearly there (I think)

        I think the only thing that isn’t happening now is the QC compile, the script editor reads as follows –

        smdOptionWindow;
        pCube2
        e:/program files/steam/steamapps/common/left 4 dead 2/left4dead2
        E:/mymod/
        modelsrc/
        models/pCubeShape2 OK TO WRITE
        base texture map vtf creation
        normal map vtf creation
        pCubeShape1 OK TO WRITE
        base texture map vtf creation
        normal map vtf creation
        ‘E:/Program’ is not recognized as an internal or external command,
        operable program or batch file.

        I’m not sure which script it is getting stuck on.

        • looks like the space characters into the path generates the problem.
          so add quotes like that.

          XBMLANGPATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\mesa\icons;
          SOURCE_BIN_PATH = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin\”
          SOURCE_MOD_PATH = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\”
          SOURCE_MOD_NAME = mymod
          SOURCESDK = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\bin\”
          VPROJECT = “E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\”

          also do not export your model with a texture into the bump mappping channel of the phongE shader, or it will give you another error.

          • Thanks for all your help Red!

            Got it working now, you were right it did not like the spaces. However quote marks did not work, I had to use the shortened path name.

            I’ll paste it below for future reference should anyone else need it.

            XBMLANGPATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2\mesa\icons;
            SOURCE_BIN_PATH = E:\Progra~1\Steam\steamapps\common\left4d~1\bin
            SOURCE_MOD_PATH = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2
            SOURCE_MOD_NAME = mymod
            SOURCESDK = E:\Progra~1\Steam\steamapps\common\left4d~1\bin
            VPROJECT = E:\Program Files\Steam\steamapps\common\left 4 dead 2\left4dead2

  4. Hello Nicolas and all you guys.
    I´m totally stuck exporting with mesa: I tried to install it and exported the cube_sample as it was described in the tutorial, but I can´t see anything in the modelviewer althougt all files were exported (.mdl/ .dx80.vtx/ .dx90.vtx/ .phy/ .sw.vtx/ .vvd) and no error was shown.

    Do you know what could be wrong ?
    I am using the student version of Maya 2013 64 bit on Windows 7.

  5. Update: Got the right ‘default’ directory by moving my scene to C:\…\ModName_source\scenes\props
    However, the shader is still not exporting correctly.

  6. It would really be helpful if there was a tutorial for preparing a model for export. I can get a working .mdl out of the sample, but smds exported from my own scenes don’t compile correctly (i.e. they crash the game when loaded).

      • Thanks for your response. I still can’t get it to work, unfortunately. Studiomdl isn’t giving me a .phy when I compile. Any idea what could be causing that?

        • yes i think there is a problem with the physic layer, and the physic mesh, you must have an UV map on your physic model, but you don’t care on how it look , a simple planar is sufficient.
          you must also apply the same phong E material to your physic model , than the one you have on your main models.
          also be careful about the layer relationship,and don’t forget to add the Shape node.

          • Ok. I’ve tracked down the issue to the Phong E shader not exporting correctly. The materials path is not right when I hit ‘default’ on the path tab (it points to the directory C:\…\modelsrc\modelname.mb). Could that be causing the issue? If so, how do I fix it?

            • Yes this is surely a important issue.
              when you hit default button the path is always mod_src/materialsrc/ and nothing else after that folder.
              be sure you set the current maya project on the folder where the workspace.mel is located.
              put your tga file in your materialsrc folder and load the tga in the color channel.
              save the scene , open the smd option window > path tab, and click on default button again.
              if the path is not set on mod_src/materialsrc/ the shader will not be exported correctly.

              • It still won’t work for my model, but the sample shows the correct ‘default’ directory. Is there anything I can do aside from using ‘set project’ to verify the project association of my .mb?

Comments are closed.