Having some problems with MD3 models, need help!

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
hardcore_gamer
Posts: 109
Joined: Sun Jan 14, 2018 12:14 pm

Having some problems with MD3 models, need help!

Post by hardcore_gamer »

Hi! This is my first post here, though I have lurked this forum for some time now. :)

Anyway, I have a problem getting my MD3 models into Gzdoom Builder. So basically my problem is this: I am able to get my model to work as long as it only uses a single texture (I texture the model inside Misfit 3D), but once I have to use more than one I am not sure what to do. For example, here is modeldef code for a pipe model I got working which only uses a single texture:

Model pipe
{

Path "Models/pipe"
Model 0 "pipe.md3"
Skin 0 "PIPTC1R2.png"
scale 1 0.6 0.6
frameindex MERC A 0 0

}


I get it how this works when I only need a single texture for the model, in which case I just use the "skin 0 "insert texture name"" line. But what am I suppose to do if my model is more complex and uses more than a single texture? I tried simply adding the extra textures into the same folder as the model and then added extra skin lines for each, but that did not work and just caused the model to not show up in the editor.

Can anyone explain it to me how this works? How do you handle models that use more than one texture? Or are you suppose to somehow convert all the textures that the model uses into a single texture? And if so how do I do this? I am using Misfit model 3d.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Having some problems with MD3 models, need help!

Post by Apeirogon »

From my, limited, expirience, you can try
"skin model_number skin_file
surfaceskin model_number surface_number skin_name"
I have it works only if I use two texture to one model. If I try to use more, engine lost it mind and paint model only with texture defined in "skin" property, ignoring all surfaceskin options.
But I think there are opportunity use as many skin to surface as much as you wantб and this depends of options on model import.

Other way UVW mapping, turn all texture set to one single texture, google it, which is worst than hell. Especialy if you try remap model with already existing textures.
I try to do so, because of multimaterial logic in 3ds max, but after first hour of monotone "chose one polygon-right mouse click on it-chose stitch line-turn to poin mode(dont know how it exactly named in english version of 3ds)-choose vertex and weld it-turn to edge mode and move to next polygon" I split on it and return to sprite.
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Having some problems with MD3 models, need help!

Post by AFADoomer »

^^^ This is essentially correct.

The "group index" numbers align with the ordering of the group/surfaces within your model.

This:

Code: Select all

SurfaceSkin 0 0 "Whatever.png"
Would set the skin of the first group within model 0 to Whatever.png.

Code: Select all

SurfaceSkin 0 3 "WhateverElse.png"
Would set the skin of the fourth group within model 0 to WhateverElse.png.

If you provide a Skin definition (like you have in your example), all of the groups with no SurfaceSkin definition will use that skin.

If you provide no Skin or SurfaceSkin information, the model attempts to use the texture paths that it was compiled with (so you can compile a model with multiple textures, then place those textures in the same relative path in your .pk3, and the model will work properly).
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Having some problems with MD3 models, need help!

Post by Apeirogon »

AFADoomer wrote: The "group index" numbers align with the ordering of the group/surfaces within your model.

This:

Code: Select all

SurfaceSkin 0 0 "Whatever.png"
Would set the skin of the first group within model 0 to Whatever.png.

Code: Select all

SurfaceSkin 0 3 "WhateverElse.png"
Would set the skin of the fourth group within model 0 to WhateverElse.png.
I do something like this

Code: Select all

Model test
{
	Path "models"
	Model 0 "test.md3"
	Scale 25.0 25.0 25.0

	Path "models"
	surfaceSkin 0 0 "multmat_1.tga"//legs
	surfaceSkin 0 1 "multmat_2.tga"//hands
	surfaceskin 0 2 "multmat_3.tga"//torso

   FrameIndex 1111 q 0 0
}

actor test
{
states
{
spawn:
	1111 q 1
loop
}}
And it only show me left textured hand of this model, thats all. No legs, torso and second hand. What I do wrong?
Last edited by Blue Shadow on Mon Jan 22, 2018 8:58 am, edited 1 time in total.
Reason: Enabled BBCode.
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Having some problems with MD3 models, need help!

Post by AFADoomer »

Are your textures actually .tga? Unlike Q3 engine games, GZDoom doesn't automatically try to load .jpg or .png if the .tga isn't found. Can you upload a working copy?
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Having some problems with MD3 models, need help!

Post by R4L »

Here's what I do:

-Import the object in Blender.
-Make sure the materials for the object follow the .pk3 path names.
-Use Nash's MD3 exporter to make an .md3 file.

Then, in my .pk3:

-Setup the general structure:
Image

Notice that I have a Models folder. Inside that folder are all the folders for each model I have in my mod. For example, I have a model of a flashlight. So in my Models folder, there is a FLight folder. Inside the FLight folder is the .md3 file for the model, and a Skins folder where all the .pngs are for the model. So that means my .pk3 folder structure is Models/FLight/Skins.

That means in Blender, the material that the object uses has to be named the same, so if my flashlight model in blender is only 1 object, the material for that object needs to be named Models/FLight/Skins/whatevertexture.png. So if you have a model that has 3 objects for example (a pistol 3d model), with 3 different materials using 3 different textures, you should name them as so:

Models/Pistol/Skins/Texture1.png
Models/Pistol/Skins/Texture2.png
Models/Pistol/Skins/Texture3.png

Then you make sure your .pk3 file has the same folder structure. So your textures should be in Models/Pistol/Skins.

Next, in your MODELDEF lump, instead of using the Skin property, you just specify Frame Index. If you have named your material's paths correctly on your model, GZDoom will find the textures in the Skins folder automatically:
Image

Make sure you give the frame a lump name. Notice mine is FSH1A0. So in DECORATE, you need to define the model now with the same lump name:
Image

Last but not least, you need to define a patch in your TEXTURES lump:
Image

If you've done correctly, you can have many models in your map:
Image
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Having some problems with MD3 models, need help!

Post by Apeirogon »

R4L wrote: -Import the object in Blender.
I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.
AFADoomer wrote:Can you upload a working copy?
http://rgho.st/7DK4DCLQM
summon work
summon dont_work
hardcore_gamer
Posts: 109
Joined: Sun Jan 14, 2018 12:14 pm

Re: Having some problems with MD3 models, need help!

Post by hardcore_gamer »

Wow I had no idea there were so many replies here! I had given up on this thread because I thought it was dead since for days nobody replied. I will try out some of your solutions to see if they work!
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Having some problems with MD3 models, need help!

Post by AFADoomer »

Apeirogon wrote:
AFADoomer wrote:Can you upload a working copy?
http://rgho.st/7DK4DCLQM
summon work
summon dont_work
Opening your dredout.md3 model, I see the following surfaces (in this order):

Code: Select all

Dreadnaught_Missile_Launcher
Dreadnaught_Assault_Cannon_R
Dreadnaught_Lascannon
Dreadnaught_Torso
Dreadnaught_Missile_Nub_3
Dreadnaught_Missile_Nub_2
Dreadnaught_Missile_Nub_4
Dreadnaught_Missile_Nub_1
Dreadnaught_Assault_Cannon_Chamber_R
I'm not sure where those are defined in your export process... But that's the list that the surfaceskin index numbers will correspond to.
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Having some problems with MD3 models, need help!

Post by R4L »

Apeirogon wrote:
R4L wrote: -Import the object in Blender.
I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.
What version of blender are you using? See if you can open your model natively in whatever program you made it with (Sketchfab?) and try exporting it again, then importing it into Blender. Also, what does the error say?

Also, thanks AFADoomer for explaining texture paths better than I did haha.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Having some problems with MD3 models, need help!

Post by Apeirogon »

AFADoomer wrote:
Apeirogon wrote:
AFADoomer wrote:Can you upload a working copy?
http://rgho.st/7DK4DCLQM
summon work
summon dont_work
Opening your dredout.md3 model, I see the following surfaces (in this order):

Code: Select all

Dreadnaught_Missile_Launcher
Dreadnaught_Assault_Cannon_R
Dreadnaught_Lascannon
Dreadnaught_Torso
Dreadnaught_Missile_Nub_3
Dreadnaught_Missile_Nub_2
Dreadnaught_Missile_Nub_4
Dreadnaught_Missile_Nub_1
Dreadnaught_Assault_Cannon_Chamber_R
I'm not sure where those are defined in your export process... But that's the list that the surfaceskin index numbers will correspond to.
Yes, I too see this surface. But all of it have one of the three material used in original model.
And if you define just one from three avaliable texture on dread, with "skin 0" command, gzdoom place this one texture in corresponded place on model, but/and try paint all other part of model in same texture. So it know how and where it must place texture, but "There can be only one, MacLaud!".
Here model in fbx with screenshot from max, what used multimaterial-textures on model and it numbers. All surface number I pick from there.
http://rgho.st/6J6JMSBhX
R4L wrote:
Apeirogon wrote:
R4L wrote: -Import the object in Blender.
I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.
What version of blender are you using? See if you can open your model natively in whatever program you made it with (Sketchfab?) and try exporting it again, then importing it into Blender. Also, what does the error say?

Also, thanks AFADoomer for explaining texture paths better than I did haha.
2.79
Open new created fbx file and then export it to fbx again, right?
Error is
Spoiler:
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Having some problems with MD3 models, need help!

Post by R4L »

Apeirogon wrote: 2.79
Open new created fbx file and then export it to fbx again, right?
Error is
Spoiler:
Try this plug-in: https://drive.google.com/file/d/0B_cBWJ ... 1BTHc/view
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Having some problems with MD3 models, need help!

Post by AFADoomer »

Apeirogon wrote:Yes, I too see this surface. But all of it have one of the three material used in original model.
And if you define just one from three avaliable texture on dread, with "skin 0" command, gzdoom place this one texture in corresponded place on model, but/and try paint all other part of model in same texture. So it know how and where it must place texture, but "There can be only one, MacLaud!".
Here model in fbx with screenshot from max, what used multimaterial-textures on model and it numbers. All surface number I pick from there.
http://rgho.st/6J6JMSBhX
It will always default back to whatever you set with Skin. You have to define the SkinSurface texture for each of the parts that you want to be different...

Example:

Code: Select all

SurfaceSkin 0 0 "dreadnaught_legsmissileflamer.tga"
SurfaceSkin 0 1 "dreadnaught_appendages.tga"
SurfaceSkin 0 2 "dreadnaught_appendages.tga"
SurfaceSkin 0 3 "dreadnaught_torso.tga"
SurfaceSkin 0 4 "dreadnaught_appendages.tga"
SurfaceSkin 0 5 "dreadnaught_appendages.tga"
SurfaceSkin 0 6 "dreadnaught_appendages.tga"
SurfaceSkin 0 7 "dreadnaught_appendages.tga"
SurfaceSkin 0 8 "dreadnaught_appendages.tga"
(I have no idea if these are the right textures for each model segment, I just filled texture names in)

The image you attached is the materials (the textures, basically, in this case), not the model surfaces/groups. Those have nothing to do with the index used for defining SurfaceSkin. I don't even have Blender installed, so can't help with telling you exactly where to look for the surface groups.
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Having some problems with MD3 models, need help!

Post by R4L »

That's why he's better off defining the correct paths in Blender. It's far less complicated to set up. Simply apply your textures in blender and make sure the material paths match your .pk3. No messing around with SurfaceSkin.
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Having some problems with MD3 models, need help!

Post by AFADoomer »

Yes, I absolutely agree... It's far easier to compile it with the right paths in the first place.
Post Reply

Return to “Assets (and other stuff)”