Having some problems with MD3 models, need help!
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.
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.
-
- Posts: 109
- Joined: Sun Jan 14, 2018 12:14 pm
Having some problems with MD3 models, need help!
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.
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.
Re: Having some problems with MD3 models, need help!
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.
"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.
Re: Having some problems with MD3 models, need help!
^^^ This is essentially correct.
The "group index" numbers align with the ordering of the group/surfaces within your model.
This:Would set the skin of the first group within model 0 to Whatever.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).
The "group index" numbers align with the ordering of the group/surfaces within your model.
This:
Code: Select all
SurfaceSkin 0 0 "Whatever.png"
Code: Select all
SurfaceSkin 0 3 "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).
Re: Having some problems with MD3 models, need help!
I do something like thisAFADoomer wrote: The "group index" numbers align with the ordering of the group/surfaces within your model.
This:Would set the skin of the first group within model 0 to Whatever.png.Code: Select all
SurfaceSkin 0 0 "Whatever.png"
Would set the skin of the fourth group within model 0 to WhateverElse.png.Code: Select all
SurfaceSkin 0 3 "WhateverElse.png"
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
}}
Last edited by Blue Shadow on Mon Jan 22, 2018 8:58 am, edited 1 time in total.
Reason: Enabled BBCode.
Reason: Enabled BBCode.
Re: Having some problems with MD3 models, need help!
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?
- 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!
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:
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:
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:
Last but not least, you need to define a patch in your TEXTURES lump:
If you've done correctly, you can have many models in your map:
-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:
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:
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:
Last but not least, you need to define a patch in your TEXTURES lump:
If you've done correctly, you can have many models in your map:
Re: Having some problems with MD3 models, need help!
I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.R4L wrote: -Import the object in Blender.
http://rgho.st/7DK4DCLQMAFADoomer wrote:Can you upload a working copy?
summon work
summon dont_work
-
- Posts: 109
- Joined: Sun Jan 14, 2018 12:14 pm
Re: Having some problems with MD3 models, need help!
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!
Re: Having some problems with MD3 models, need help!
Opening your dredout.md3 model, I see the following surfaces (in this order):Apeirogon wrote:http://rgho.st/7DK4DCLQMAFADoomer wrote:Can you upload a working copy?
summon work
summon dont_work
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
- 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!
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?Apeirogon wrote:I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.R4L wrote: -Import the object in Blender.
Also, thanks AFADoomer for explaining texture paths better than I did haha.
Re: Having some problems with MD3 models, need help!
Yes, I too see this surface. But all of it have one of the three material used in original model.AFADoomer wrote:Opening your dredout.md3 model, I see the following surfaces (in this order):Apeirogon wrote:http://rgho.st/7DK4DCLQMAFADoomer wrote:Can you upload a working copy?
summon work
summon dont_workI'm not sure where those are defined in your export process... But that's the list that the surfaceskin index numbers will correspond to.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
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
2.79R4L wrote: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?Apeirogon wrote:I have problem with this. Every time I try feed Blender with my model.fbx it crash with error.R4L wrote: -Import the object in Blender.
Also, thanks AFADoomer for explaining texture paths better than I did haha.
Open new created fbx file and then export it to fbx again, right?
Error is
Spoiler:
- 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!
Try this plug-in: https://drive.google.com/file/d/0B_cBWJ ... 1BTHc/viewApeirogon wrote: 2.79
Open new created fbx file and then export it to fbx again, right?
Error isSpoiler:
Re: Having some problems with MD3 models, need help!
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...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
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"
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.
- 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!
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.
Re: Having some problems with MD3 models, need help!
Yes, I absolutely agree... It's far easier to compile it with the right paths in the first place.