Welcome to Dawn of Eternity

In order to download and play the game you need to sign up for an account and activate it, it's free. Once you have an active account you will be able to see the download page at the top of the forum.

Sign Up

How to link an assigned material file with a mesh

Discussion in 'Help & Documentation' started by Hiyorests, Nov 8, 2016.

  1. Hiyorests

    Hiyorests Administrator
    Staff Member Developer

    Joined:
    Nov 1, 2014
    Messages:
    76
    Likes Received:
    13
    Gender:
    Female
    In-Game Name:
    Hiyorests
    Linking a material file with a mesh file can be a rather confusing task if you do not know what you're doing. It's simple, fast and easy once you get used to it.

    This tutorial covers:
    • Finding a mesh with an existing material (broken or not) and checking the assigned material line,
    • Changing a material that is set for a mesh,
    • Checking and ensuring a simple code is correct,
    • Changing multiple sections of an assigned material. (covered in point 2)

    First thing, you must have Notepad++ installed.
    This program is free, and is all I know that you can use to edit .MESH files without using blender. It is easy to install, and very useful for a wide variety of things.
    Please remember, regular notepad will not work. It has be Notepad++.


    Once you've installed this, you need to find your mesh and material that you want to edit.
    This tutorial is only for files that already have materials assigned. Does not matter if they are incorrect - we can fix that.

    Checking an assigned material

    This is an incredibly easy thing to do.
    For this tutorial, I will be using the treasure chest model as an example.

    The first step is to open the .mesh file in Notepad++.
    Once you have done this, try and find the chest.MATERIAL file. If there is no specific file, look in another .material file that is relevant (for example, the chest material code is in objects.material, which are both in the same folder (\Dawn of Eternity\game\media\world\objects)
    Once these two files are open, look at the code in the material. For the chest, there are 2 lines for it.
    [​IMG]
    In pink is the material line. This is applied to the mesh itself. The green is the way to tell the difference between the obvious wooden part, and the metallic rings. The blue shows the texture file assigned (always make sure your texture file format matches the one on the material).
    The code is obviously /global/items/containers/chest/metal for the metal. As you can see, it's similar for the wood.
    In your material file, copy the material heading (/global/items/containers/chest/metal) and press ctrl+f in the mesh file. (chest.mesh for this. Open with notepad++)
    Don't worry about all of the confusing things that come up (such as NUL NUL etc). Just ignore what you do not need.
    Find /global/items/containers/chest/metal in your mesh. This is obviously the metal material that is assigned.
    You have now identified the material heading(s) in the mesh file.

    Changing a material that is set for a mesh.


    Continuing where we left off, change the heading (in blue and green/red below) to your desired heading, or something simple, such as chestmetalMat (which is what I will be using as an example in this tutorial). Do the same for wood, and change the result to something similar, such as chestwoodMat.
    In the image below, you can see the material headings in blue. The different parts (wood and metal) in different colours, and at the bottom in orange, what I changed one of the headings to.
    [​IMG]
    Once this is completed, save over the mesh or (and more conveniently) save the mesh as a new file. Chest2.mesh is pretty simple. Just make sure to select the "all files" part when saving a mesh (sometimes you have to scroll upwards) and type .mesh as the format.
    [​IMG]

    Once this is done, go back to your .material file (objects.material in this case).

    Change /global/items/containers/chest/metal and /global/items/containers/chest/wood to whatever you changed your headings to. I changed mine to chestwoodMat and chestmetalMat, so these need to be changed in the material file too.
    [​IMG]
    As you can see here, the blue and the purple are both the same file. Feel free to edit the original file, and just change the names as you see fit. For simplicity, i'm just going to change it to basic colouring.
    I'm going to make the wood chestwood.png and the metal to chestmetal.png.
    In photoshop, I just grabbed 2 basic files for this. (I do not claim ownership of these textures, by the way).
    Below, you can see the two textures and how the match the lines in the materials.
    [​IMG]
    Once this is done, copy the sections of your edited material and cut it into a new file. Save this new file as whatever you like (but please, choose something simple, like chest2.material)
    [​IMG]
    Now, load up your mesh in-game, and check that it works.
    Don't use the chest as an example, explore alternative meshes, and the ways they all work (trees can be challenging, but are interesting)

    Good luck!
    W.I.P tutorial, will add more in future.
     
    • Informative Informative x 1

Share This Page