Page 1 of 1

Importing LoG1 model having several material

Posted: Thu May 21, 2015 12:19 am
by philippe.martin
Good Day,

For instance, I would like to import Goromorg statue model from LoG1. I open it with the Grimrock Model Toolkit, all seems to be ok, textures/material seems to be set correctly. Then I save the model into my dungeon. My custom object.lua script contains :

Code: Select all

defineObject{
	name = "dungeon_goromorg_statue",
	baseObject = "base_wall",
	class = "Decoration",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/env/dungeon_goromorg_statue.fbx",
		},
	},
	replaceWall = true,
	replaceFloor = false,
	placement = "wall",
	editorIcon = 92,
}
The result is not so bad... but there is only the texture of the statue itself rendered, not the rest of the material... Could someone indicate me a thread or a tutorial explaining how to proceed with multiple texturing ? What's wrong in the above script ?

Re: Importing LoG1 model having several material

Posted: Thu May 21, 2015 12:24 am
by minmay
Grimrock 2 does not include all Grimrock 1 materials. You need to copy them over yourself. A few are in the asset pack, and you can just copy over the definitions from Grimrock 1, for others you'd have to copy over the images too (and convert the normal maps).

Re: Importing LoG1 model having several material

Posted: Thu May 21, 2015 8:08 am
by philippe.martin
minmay wrote:Grimrock 2 does not include all Grimrock 1 materials. You need to copy them over yourself. A few are in the asset pack, and you can just copy over the definitions from Grimrock 1, for others you'd have to copy over the images too (and convert the normal maps).
Thank you for this quick reply.
I understand the original texture are not all included in LoG2 and I am using the LoG asset pack. My question was more on the manner to apply multiple textures on a model (into model.lua script ?). I thought that if I can see them on the "Grimrock Model Toolkit" (also in my dungeon) it will be ok...meaning the textures are included. But apparently not. This means I have certainly to tell in the script above the right 'material(s)' parameter(s) in several class component ? Isn't it ?

Re: Importing LoG1 model having several material

Posted: Thu May 21, 2015 8:44 am
by minmay
Textures are not included in the model file. That would be very inefficient due to the fact that multiple models often use the same texture. Instead the model file specifies material names, which must be defined with defineMaterial.

Re: Importing LoG1 model having several material

Posted: Thu May 21, 2015 9:25 am
by philippe.martin
Thanks !

Now I undestand my mistake. My Grimrock Model Toolkit was pointing on wrong materials repository. Of course this tool has to point to 'My Dungeon' folder assets. In this folder I have to import all materials I need and 'declare' them into the script 'materials.lua'. From this step I can wear my objects from those declared materials. Then, just adding what is missing in 'My Dungeon' and redeclare it... nothing more to manage in 'objects.lua' script.