Source Filmmaker > Obecné diskuze > Detaily tématu
Nate Hartmann 20. zář. 2013 v 8.13 odp.
Getting MMD models into SFM?
So there's this model I want to use for SFM, but it's a .pmx file (Used in the freeware MikuMikuDance) and I have to convert into a .mdl to use it in SFM.
I have Blender, and I've successfully been able to port the .pmx in (With the add-on Pymeshio) but it seems like it won't convert to source just like that.

Can anyone teach me how to convert .PMX files to SFM?

Or would it be better if I ask someone to port it for me?

If someone's willing to port the MMD model without re-distributing (The creator specifically told me not to distribute), then that'd be great. :D
Naposledy upravil Nate Hartmann; 27. zář. 2013 v 11.55 odp.
Zobrazeno 115 z 27 komentářů
< >
Sarsour 21. zář. 2013 v 4.53 dop. 
you need to install an SMD/DMX importer exporter for blender.
you should then use that to export the model into SMD format, write a QC file out on notepad (check Valve developer website or just google on how to write one out) for the SMD files you exported.
make VMT files in the materials folder of the source filmmaker named after all the materials in the materials tab in Blender, the VMT (also notepad texts) should refer to the textures(UV'd) of the model which you should converted into a VTF image file (valve texture file) using VTFedit (google it for download).when you have all these things ready, you just drag the QC file you wrote onto the studiomdl (provided in the SDK of SFM and all other source games) and it creates the .mdl model files for you.
I would happily do it for you, but all the time I spend doing this stuff is already spent on my project of which I have a deadline for.
I learned this stuff not too long ago, shouldn't be too hard for you, just some research.
Nate Hartmann 21. zář. 2013 v 8.50 odp. 
Thanks for the detailed information. :D
I'll try and see what I can do, (For now I've just exported the SMD file), but if the rest proves to be too complicated for me (The process looks daunting as it is) I'll try to look for an alternative route.
Again, thanks for the reply. :)
Sarsour 22. zář. 2013 v 6.37 dop. 
Its not that hard, its just process intensive.
depending on what kind of model you will want to compile, you will need certain comands in your qc which you place with your smd in the same folder before you compile using the studiomdl, Ill give you my qc text to use as an example and you will just have to replace the smd names with yours.
Nate Hartmann 22. zář. 2013 v 6.15 odp. 
Thanks, but I've already finished writing a basic .qc for the character model. :)
Instead, can you give me a basic template for the VMT?

Unlike the .qc, there wasn't much I could find about the VMT's, and I don't think I understood that as much as I should have.

Do I have to write one VMT for each texture I have in the model?
And I'm pretty sure I have to specify what kind of textures they are (Hair/Skin/Cloth, whatnot) but I'm not entirely sure how to do this.
Sarsour 22. zář. 2013 v 7.32 odp. 
When you go to your materials tab in Blender, every one of those materials in the list should have their own VMT's for the selected model.
usually for character models use vertexlitgeneric.
"VertexLitGeneric"
{
"$basetexture" "/materials/models/<texture>"
"$bumpmap" "/materials/models/<texture>"
"$phong" "1"
"$phongexponent" "5"
"$phongboost" "1.0"
"$phongfresnelranges" "[0 0.5 1]"
"$rimlight" "1"
"$rimlightexponent" "2"
"$rimlightboost" "1.5"

}
this is basically what I use for the body/clothes/hair (the clothes and hair are modeled as a regular mesh).
the phong and rimlight are to give it the specular effects.
note that the specular map is taken from the alpha channel of the bump map texture.

for eyes, I use this

"eyes"
{
"$basetexture" "materials/<eyeball texture>"
"$iris" "models/<Iris texture>"
"$halflambert" "1"
}
Left eye and right eyes should have their own VMT, but they can refer to the same VTF's
Naposledy upravil Sarsour; 22. zář. 2013 v 7.37 odp.
Nate Hartmann 24. zář. 2013 v 7.32 dop. 
Got it, and thanks a lot for all the help. :D
...But I think I'm going to leave this extracting this model up to somone else, or at least do a small leave on this project for now until I get more experience with converting other models, because so far, this thing has proven to be way too much trouble for me. (It seems I have to extensively edit the model to make it applicable for change. So far I've had to delete multiple bones, and textures, but it still goes over the limit of materials I can use for and MDL file.)

Again, thanks for all the help. :)
Sarsour 24. zář. 2013 v 7.59 dop. 
Use an example SMD from any model thats been converted, there are a few valve left in the SDK folders ( I think they contain qc's aswell) once you get the hang of getting one full model in, you'l understand it, and you can keep that qc that worked as a template any other models should be a breeze.
Keep at it!
Naposledy upravil Sarsour; 24. zář. 2013 v 7.59 dop.
Pte Jack 26. zář. 2013 v 2.24 odp. 
Look at this...

http://i.imgur.com/ZAuZxki.png

This is the Oliver model you were looking for, well the shirted model, not the caped.

This model when loaded into Blender had over 220 bones, Valve format only allows 125ish, so it takes quite a bit of work to ferret out the unnecessary bones. The second problem is that the interface used to create the MMD model was Japanese, so EVERYTHING had to be renamed in blender, from Bones to Textures... Elements of the mesh have to be separated out to create individual object, ie the shirt, pants, hat eyeppatch, shoes, socks, etc. Then the flexes are another problem. The MMD models are very detailed, the first time I attempted to compile with facial flexes there were over 24000 vertexes moved in one mesh, the limit is 10000 per mesh.

But, converting MMDs is almost the same as what I do in the XNA to SMF Guide I posted. Once you get the proper plugins for and get the model into Blender it's all the same... to get it into SFM Format.
Naposledy upravil Pte Jack; 26. zář. 2013 v 2.36 odp.
Nate Hartmann 27. zář. 2013 v 11.55 odp. 
Woah. So it is possible.

Yeah, well, I was pretty much on the verge of giving up this project, but if there's an example before me, I guess I can try to continue. I'll still have to learn a LOT of things to get this done, though.

I've got a few questions. First, I can fluently understand Japanese (I'm half Japanese) and I didn't feel the need to re-name the bones, but is it a necessity for it to be in English? Or can I just leave it like that?
Secondly, can you post a link to that XNA to SMF guide you mentioned? I think that will help a great deal.

Thanks for the support, I'll try to finish this.
raptornx01 28. zář. 2013 v 3.24 dop. 
You'll probably need a language pack (if you don't have one already) as japanese characters don't show up by default.

and here's his guide

http://steamcommunity.com/sharedfiles/filedetails/?id=178989049
Pte Jack 28. zář. 2013 v 8.13 dop. 
Yup, it is possible and sorry it took so long, but I had to find the required plugins and test to see if it was possible.

There is a MMD (PMX) importer available for Blender, Once a model is in Blender it is just that, a model, so following the Blender through compile process of the Guide that Raptorn gave you is the exact same. I show how to convert a XNALara model to SFM using Blender in it.

That being said, There are extremely detailed models, The vertex count and the number of bones can be quite daunting. The Caped version of Oliver has over 220 bones, and the vertix count was somewhere aound 500K I think it was. The models are clothed which means you have to split out individual models as you work through it. Max Bones allowed to be compiled from a SMD is 128 (2 of those are dedidated) These are not player models for games so theVertex count doesn`t matter until you get into flexes. The max vertexes that can be moved in a single mesh is 100,000, adding all the flexes that are embedded in this model ran somewhere around 250,000. Everything from bones to vertex groups to textures have to be renamed because the model was created in a Japanese based modeling program, BUT the good thing is that as you rename bones, the vertex group associated to that bone will rename automatically (or viceversa renaming a vertex group will rename it`s associated bone), but the bone count has to be reduced substantially.

The language problem isn`t the fact that the model was created in Japanese, it`s the fact that Blender doesn`t display Japanese Characters (unless you can find a language pack for Blender). The thing is I don`t know if a model that has these undisplayable chararcter will compile without being converted to a more universal language.
Naposledy upravil Pte Jack; 28. zář. 2013 v 8.29 dop.
Nate Hartmann 1. lis. 2013 v 8.11 odp. 
Hi, it's me again. :)
So, I'm sorry to kick start this (Kind of) old thread, but I recently picked up on this project again, and I've come to the part in your tutorial where I have to re-name, decrease, (and in my case) re-rig the armature. So far so good. I've just been having some problems. (By the way, I'm working on the caped model right now.)

Here's some questions:
1. How do you make body groups for SFM? I've been looking online for the answer to that, but I came up short.
2. I separated the meshes groups by the texture they used, (Ex. The jacket and the skin use different texture images so I separated each) but to rig the bones, do I need to put them back together to the same group?
3. How do you make facial flexes?
4. How do you simulate cloth physics? Should I put jiggle bones for Oliver's jacket? If so, how do you do hat? What about his hair? (I removed all the bones for Oliver's hair and upper jacket)
5. Did your eye textures of Oliver work fine in the final version of the model? From the posters you put, it seems like they're working perfectly fine, but in the textured mode of Blender, my Oliver eye texture seems to be completely white, save for the white smudges that were initially assigned to that eyeball layer.

It's kind of a lot to ask, and I apologize for that. D:
What you said about the model was completely true; this Oliver is detailed as hell. Most MMD models have a lot less polygons.
Pte Jack 1. lis. 2013 v 9.04 odp. 
Body groups are separate objects in Blender. They make their own model smd/dmx with armature (if that makes sense). The body group is then added to the qc at compile time. So, let's say you have a model that is completely together, the mesh is all connected as one object in Blender, but you want to make a head body group., you would select the mesh that would make the head group and separate it into it's own object.

Ah flip... I'm working on the Sniper's camper right now and I just got to this point. A model is a model once you get it into blender, so maybe I'll start over again and make a tutorial on this. This is somewhere I really did not want to go because ppl are making $$$,$$$.$$ instructing this in schools (that's 6 figures), for me, I get 000,000.00, lol.

The bone structure/armature. I find that it is best to work off one armature. So in your case the layers of clothing, this is difficult. Each layer has to be it's own object and each layer has to be assigned to vetex groups that match the bone names. Is there an easy way to do it, maybe. but the problem is that to do all the layers at the same time, all the layers have to be one object. Which means that if you join all the objects into one, no two vertice can occupy the same space, or when you separate them back into separate objects, you're going to create holes in the mesh.

Once the vertex groups are assigned and you export the objects, each object will pick up the skeleton and write that to its smd. So if you import the body.smd into a blender session, it will have an armature, if you import the vest into a blender session, it will have it's own armature. ect.

It is really hard to explain in this type of forum.

Facial flexes are shapekeys in Blender. You program the shape keys to do what you want and when you export the model to smd, it will create a vta file with the flexes in it. you then have to assign them in the qc. (also, there are limits and restrictions, too many to add to this post, especially if you are exporting smds and complying using guistudiomdl.) I haven't explored DMX yet or how to compile an HWM.

As for Eyes, I have no luck with eyes. especially the iris material overlay. I'm still fighting to give Ralph movable eyes.






Naposledy upravil Pte Jack; 1. lis. 2013 v 9.05 odp.
Nate Hartmann 9. lis. 2013 v 7.15 dop. 
Thanks again, and sorry for my slow (As usual) reply.

I really, really appreciate everything you've done to help me, and I thank you very much for everything you've done. You don't need to teach me what you don't want to, if I really need it, I can always look for other methods.

So far, I've been having a load of trouble with this model in particular, (Mostly with the eyes and the bones, as you mentioned) so I decided to change it. Basically I scrapped converting this model (Though I will go back to it in the future) and changed my Oliver model to a (Comparably) simpler one.
With this model I was able to skip through a majority of my past troubles, and with your tutorial I was able to go up to writing a .qc and uploading it to SFM. It loaded up perfectly; with one last problem: The textures are skewed.

Here's a snapshot of what happened: http://steamcommunity.com/sharedfiles/filedetails?id=193438258

So I'm thinking that there was an error in either the compiling (Which is weird, since I didn't get any errors) or the .vmt assigning, since I was able to see the assigned textures on Blender perfectly.

This, (As well as the facial flexes) is really just my last hurdle, if I get this done, I think I can get everything I have else fixed and working.
Again, thank you so much for your help.
Zobrazeno 115 z 27 komentářů
< >
Na stránku: 15 30 50
Datum odeslání: 20. zář. 2013 v 8.13 odp.
Počet příspěvků: 27