Frictional Games Forum (read-only)
[MDL ED] Changing the material of an entity - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [MDL ED] Changing the material of an entity (/thread-56488.html)



Changing the material of an entity - SuspecM - 09-12-2019

So I was playing around in the model editor and found out that you can change or add a "submesh" for an entity (picture hereĀ https://imgur.com/a/YRjkxQx)
The only problem is that while it shows the chosen material on the model in the modeleditor, it resets to the default material of the model in-game and in the model test menu. Is there a way to change a model's material this way or is it just a waste or time?


RE: Changing the material of an entity - Mudbill - 09-14-2019

I'm not sure how you went ahead with this but there are some pitfalls that could affect the results. Personally I haven't used this particular feature much so I can't speak on its reliability, but I know that having multiple sets of files with the same names can cause the engine to load the wrong set which would make your edits not apply.

What I normally do when I want to change the material of a model file is that I open the .dae file (the model itself) with a text editor and search up "library_images" which is the section where external files are referenced. There should be an "init_from" pointing to the texture file that the model uses, for example "servant_grunt.dds". If you change this name to something else, the model will use another material, because the material it uses is based on the texture file name, for example "servant_grunt.mat".


RE: Changing the material of an entity - SuspecM - 09-14-2019

(09-14-2019, 03:40 PM)Mudbill Wrote: I'm not sure how you went ahead with this but there are some pitfalls that could affect the results. Personally I haven't used this particular feature much so I can't speak on its reliability, but I know that having multiple sets of files with the same names can cause the engine to load the wrong set which would make your edits not apply.

What I normally do when I want to change the material of a model file is that I open the .dae file (the model itself) with a text editor and search up "library_images" which is the section where external files are referenced. There should be an "init_from" pointing to the texture file that the model uses, for example "servant_grunt.dds". If you change this name to something else, the model will use another material, because the material it uses is based on the texture file name, for example "servant_grunt.mat".

May I ask what kind of text editor did you use? I tried it with Notepad++ but all I got was gibberish on any .dds file I tried.