the dusho exporter won't export multiple materials for one mesh, and will only work with the first one
Based on my experience, materials does not need for export. The 3d model automatically gets materials for appropriate submeshes with the same name. Technically, 3d model in .mesh format stores only the submesh information. Like this: <submeshes> <submesh material="any_submesh_name"
These materials(in Blender) only allow properly create *.MATERIAL file. In most cases, I create this *.MATERIAL file manually.
the dusho exporter won't export multiple materials for one mesh, and will only work with the first one
Based on my experience, materials does not need for export. The 3d model automatically gets materials for appropriate submeshes with the same name. Technically, 3d model in .mesh format stores only the submesh information. Like this: <submeshes> <submesh material="any_submesh_name"
These materials(in Blender) only allow properly create *.MATERIAL file. In most cases, I create this *.MATERIAL file manually.
Yes but if you check the .material file, you will see the material name and it's properties (alpha, difusse, texture, etc.) but this materials are 1 per sub-mesh object. You can check this by joining all the parts from an armor model and export it, since you exported only one object, you will end up with one material for all the parts.
Wow thanks SO much guys for the added info; I love it when I'm able to pick up new knowledge from the experts!
I thought of reducing the Material of the Submesh to just 1, because it seemed the efficient way to me. So I tried to "unlink" (right-click on Material name) the HuM_DHPlate/Scalp Material from the model. But when I tried to export I got this error message...
Since I could not understand this I decided to try just playing with the .MATERIAL file.
I left both Materials in the .MATERIAL file but tried using the helmet texture for the HuM_DHPlate/Scalp Material and it worked!
...the dusho exporter won't export multiple materials for one mesh, and will only work with the first one...
So I tried removing the HuM_DHPlate/Helmet Material and leaving only the HuM_DHPlate/Scalp Material, still using the helmet texture file and it also worked (same result as the pic above).
I will probably try to go for a full set export using what I've learned so far - one more set for Anarch's TL1 Armors Mod!
P.S. It bothers me a little that (a) there are unnecessary Materials in the model and (b) the Material name in the .MATERIAL file is the wrong one (should be /Helmet not /Scalp).
I think I will also try NOT to use "joining meshes" and instead I will directly assign Mesh parts to Bones with weight-painting. I am hoping this will allow me to remove the unnecessary Submeshes AND their Materials safely, resulting in a "cleaner" model and .MATERIAL file.
I know scripting, but knowing the blender api stuff...
I took a quick look. Line 706 is where things start:
materialName = ob.name if len(ob.data.materials)>0: materialName = ob.data.materials[0].name
For a test I made a cube with half red and half white as 2 materials. Dusho's script errors out. Probably because I didn't put textures on it.
I used the regular Ogre3d exporter and it worked. What it does is split the materials into their own submeshes.
I'm pretty sure the def bCollectMeshData(meshData, selectedObjects, applyModifiers): method can be changed to loop over the materials and separate them into the submeshes the same way ogre3d exporter does.
Things I changed: I put a checkbox on to the exporter for "Enable by Material". Default is old behavior. Added code so that it supports exporting a single mesh with multiple materials as submeshes. If exporting by material, submesh material names are taken from the actual material name, not the mesh data name. Now supports multiple textures per material.
There is a catch to the export by material. If you are exporting more than one object and a single material is used more than once, it will probably not do what you want. I was thinking it should combine the meshes assigned to the same material?
Anyways, give it a try. Let me know if it needs any tweaks.
@Vkoslak I'm kinda blown away this thread pushed you into making a new imp/exp script for Blender
Thanks so much for this and I will test soon as I can.
Would you be okay if I also post your script in its own thread in the "Tools" section of this site?
Sure thing. It's just some edits to Dusho's script.
If I'm really going to mess with it, I should put it in source control on github.
Okay I moved it over just wanted to ask though - what would be the advantage of being able to export multiple Materials for a Mesh?
The efect of normals, that's the shading effect, with one mesh with multiple materials the blender won't recalculate the normals on the edges and you are going to have a uniform shading on all the unions, you can see that this doesn't happen with the heads I made for the destro, you will notice in the forehead/scalp shading specially. It's a minor thing, so I never asked for it before
I'm getting the hang of moving/rotating/scaling in edit mode to put new armor pieces on to the base models.
But when I reach the stage for rigging I end up deleting my work file because I keep screwing up; I've done this maybe 10 times already, each file averaging about 2 hours of work .
What I've been trying to do is "join" each armor piece mesh to an existing sub-mesh of the base model (i.e. join 'new-chest-armor' to 'existing-chest-submesh', etc...). And then I try to weight-paint to get each mesh to deform properly in posing. But like I said I keep screwing up, specially on the weighting.
I AM having fun still, but I am getting impatient to produce results So I decided to come here and ask for some directions please!
The pic above is my latest workfile for the Alch Homunculus set - it has no rigging at all yet. Can I ask please for suggestions on the best sequence of "next steps" I should take? Anything would be much appreciated. Thanks in advance!
Edit - Thanks Vkoslak and Anarch for the added info about multiple materials for meshes
Keep an unmodified base mesh around and use it to transfer paint weights from. That will get you most of the way there. I think I documented how to do that elsewhere on this site a while back.
Taking a break for today. At this time I have a model with all the necessary meshes all properly named for TL2 (pauldrons = shoulders, forearm = upper gloves, hand = lower gloves, etc.)
Tomorrow I will try weight-transferring from a standard Hum_M mesh...