Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Alchemist
Original Poster
#1 Old 7th Feb 2005 at 7:45 PM Last edited by tiggerypum : 26th Mar 2006 at 8:52 AM.
Default MilkShape Plugins (V2.16) with Basic Animation Support
NOTICE: am no longer going to update or support these older plugins. Use the newer UniMesh plugins instead, which will allow you to work with object, animated and body/clothing/hair meshes in one package.
I have removed the binary and will be asking for the thread to be locked.

Unimesh is here: http://www.modthesims2.com/showthread.php?t=122399

<* Wes *>

NOTE: Requires MilkShape 1.7.3 for use.
I have finally got the next level of mesh support developed in these two MilkShape plugins. The new plugins will import and export 'bones' and the corresponding bone assignments from animated objects. Like all the software at this stage, it is still not as extensively tested as some of the commercial stuff (although I haven't yet seen any commercial stuff that does this available yet).
You will notice I have removed all commercial use restrictions, although restrictions on redistribution of the plugin itself remaons in effect. These are also rectroactive to previous versions, but I would prefer you use the latest, because I am not going to make specific updates to older versions.
What these plugins won't do:
They cannot import and re-export bumpmap normals (mainly because there's no place to put them in MilkShape). There are also several datatypes that appear in some body meshes that have not been sufficiently decoded to provide support for. I have edited body meshes and they do appear to work, although there may be some missing effects (perhaps fatness and pregnancy changes).
You also cannot, at this time, add or delete bones but you can move them. The plugin also only supports ONE bone assignment per vertex (due to MilkShape limitations; many body meshes have up to three). It also only supports a single bone weighting (1.0). You won't see the weighting on the screen anywhere, it is created on export, to match the bone assignments.

You CAN add new vertices and faces, remap the UVs, and change the bones vertices are assigned to. For those interested in working on ANIMs, this should be a real asset, because you can unassign vertices from one 'bone' to another, and see what changed in the animation.

Please report any bugs here. Please start a new thread to discuss anything not directly related to performance issues. I will start a seperate thread for usage discussion.

Those interested in playing with an 'adult' mesh can see my starting mesh, which is a direct rip-off of all the careful work Fleabay did on the adult male bottom. I didn't do much to it except add a single sphere (you can guess where). My apologies in advance, it is meant to be a proof-of-concept, not a finished replacement work. Someone else can (and probably will) take that ball and run with it.

<* Wes *>

Update Note: V2.10 adds support for exporting new locations for bones, should you decide to move them. It also saves the original model name in the 'group comments' and uses this on export, to work around the MilkShape limitation on name lengths. Please be sure to update both plugins, as I have not tested using mismatched versions.
V2.11 Fixes a bug that failed to reverse the rotation direction for export (used to adjust moved joint positions).
V2.12 relaxes some limits for the importer used on an array that matches groups with items (please keep the versions paired, for maintainability).
V2.13 Fixes a corrupt mouse-click area on multi-part non-animation mesh exports.
V2.14 Allows choice to not import bones if importing a second (or more) model if the first had a set of bones.
V2.15 Bases bone assignment on heaviest weighted bone (if > 1)
V2.16 Fixes repeating group names when comments are deleted
Attached: V2.16 Plugins and ReadMe
Screenshots
Advertisement
Test Subject
#2 Old 7th Feb 2005 at 7:47 PM
awesome. thanks wes!
Alchemist
Original Poster
#3 Old 7th Feb 2005 at 8:57 PM
I forgot to mention that you will probably want to change the display size for the joints in MilkShape, as the default is WAY too big. Go on the file menu, select preferences, then the Misc. tab, and se Bone Size to something like 0.007500 (that's what I use).
The joints are those GIANT blue circles covering up your mesh. Changing this size will make them more in scale with the TS2 meshes.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#4 Old 7th Feb 2005 at 10:06 PM
Thanks, Wes!!
Test Subject
#5 Old 7th Feb 2005 at 10:09 PM
Quote: Originally posted by wes_h
Someone else can (and probably will) take that ball and run with it.


You just HAD to say that didn't you Jolly GOOD STUFF! I'm impressed.
Field Researcher
#6 Old 7th Feb 2005 at 10:22 PM
Oh Good work, really good work. You are the best !!!
Lab Assistant
#7 Old 8th Feb 2005 at 2:35 AM Last edited by Saikatsu : 8th Feb 2005 at 2:42 AM.
Hmmm... it seems to import just fine... gives me a big list of things it couldn't import though. And when I export my edited mesh and replace the GMDC in SimPe, it changes the GMDC's filename (I copy the original before replacing, then paste it back in) and it doesn't show up as changed in Body Shop. (EDIT: Just relized a mistake I made there, so the lack of change is more than likely my own fault)
The fat mesh deformation does not work at all, so there's no "perhaps" there. XP
Looks like the plugins still have a ways to go, but I'm impressed that someone's even gotten it this far. I don't know how people do these things. XD
Alchemist
Original Poster
#8 Old 8th Feb 2005 at 2:41 AM
Quote: Originally posted by Saikatsu
Hmmm... it seems to import just fine... gives me a big list of things it couldn't import though. And when I export my edited mesh and replace the GMDC in SimPe, it changes the GMDC's filename (I copy the original before replacing, then paste it back in) and it doesn't show up as changed in Body Shop.
The fat mesh deformation does not work at all, so there's no "perhaps" there. XP
Looks like the plugins still have a ways to go, but I'm impressed that someone's even gotten it this far. I don't know how people do these things. XD


Thanks for looking... the list is there for you to see, and maybe help correlate what these things actually seem to do and not do. Even if you can't write a stick of code, you can help with careful observation.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#9 Old 8th Feb 2005 at 3:11 AM
You cannot make me use Milkshape, no matter how hard you try! Must resist...

Do you know of a format to export from Milkshape and preserve the joint info? The OBJ format doesn't seem to keep the joint info going from Milkshape to Maya. Should it?
Alchemist
Original Poster
#10 Old 8th Feb 2005 at 4:55 AM
Quote: Originally posted by fleabay
You cannot make me use Milkshape, no matter how hard you try! Must resist...

Do you know of a format to export from Milkshape and preserve the joint info? The OBJ format doesn't seem to keep the joint info going from Milkshape to Maya. Should it?


I can't find my .obj spec here, and I can't really remember.
My objective is not to sell MilkShape, I plan to 'graduate' to something better later. But this code developement has allowed me to 'explore' things much faster, since I could tweak the code and try something else. There are no written specs to write from (except what Whatsitoya, Delphy, Miche and I have put together). I'm sure they exist, and are well guarded deep in the inner bowels of Maxis/EA.
You've seen the stuff that works, you should have seen some of the disasters that happened on the way here.
If this wasn't just a hobby, I'd probably have copies of Maya and 3DS here.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Test Subject
#11 Old 8th Feb 2005 at 8:21 AM
Hey Wes, why don't you come on over to the world of Blender? It's a much more complete tool than Milkshape (infact, I think it feels just as good as any comercial tool), you can easily add scripts and exporters (Python scripts) and it's absolutely free! We could really use your work over here, especially now that the obj's exported with Blender don't seem to work with the Mesh Tool.

So, whaddaya say?

Kidding aside, I'm really impressed with what you've done. You really are a pioneer of the comunity. Keep it up, mate!
Alchemist
Original Poster
#12 Old 8th Feb 2005 at 5:58 PM
Quote: Originally posted by Vinther
Hey Wes, why don't you come on over to the world of Blender? It's a much more complete tool than Milkshape (infact, I think it feels just as good as any comercial tool), you can easily add scripts and exporters (Python scripts) and it's absolutely free! We could really use your work over here, especially now that the obj's exported with Blender don't seem to work with the Mesh Tool.

So, whaddaya say?

Kidding aside, I'm really impressed with what you've done. You really are a pioneer of the comunity. Keep it up, mate!


I can't manage the user interface to blender... to "unix-ey" for me.
In the interest of being cross-platform, programs that throw away the user interface features on a particular platform (e.g. PeeCee) make learning to use them more difficult.
While what's under the hood may be a superb engine, I can't stomach trying to drive the ugly old thing.

Speaking od the .obj format, it was a good start when we thought that meshes were pretty much what was in a GMDC. In fact, there is still quite a bit of stuff that isn't supported by MilkShape (or by my plugins). There is special morphing and smoothing data (like for fatness and pregnancy), as well as the bone support. And the bumpmap normals are a method used to make low poly count objects appear smoother.
While we don't exactly know enough of the format for the modifiers to work with them, the bumpmap normals could be managed if I had somewhere to keep them in MilkShape.
The good thing is that almost all the unknown items are what could be termed 'optional' overlay modifiers. Objects appear to work without them, but certain expected changes won't work right without them.
By the time a real year has gone by (I think 1 real year is equal to about 7 Sims 2 years) all this will be well settled. It has been but a shade over 3 months since I took the shrink wrap off my copy of "The Sims 2" (of course, that's almost 2 "Sims2" years ago!).
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#13 Old 8th Feb 2005 at 7:58 PM
I tried Blender once... the interface was enough to make me not bother using it any further. Too confusing. :\
I know 3DS supports the multiple bone assigments for each vertex, I'm not so sure about the mesh deformation because I've never worked with it. (I vagely remember how to make things explode, but... that's not helpful. XD)
While 3DS is far from free, I'm pretty sure plugins for it work in GMAX (which is free) or vice versa. o_o I don't think Milkshape can fully handle Sims 2 character mesh editing, due to the whole vertex weighting issue.

Looking forward to seeing progress made on this. <3
Test Subject
#14 Old 9th Feb 2005 at 12:05 AM
Hi Wes,

I have been playing around with what you have been doing for the last couple of days, and have a couple of suggestions.

The original GMDC I extracted from the game package was about 300K in size (an af top), I import into Milkshape, modify the verts, and export, and the size is down to 160kb. Obviously, it seems like a bunch of data is getting lost in translation.

Since I am not up on the file structure of the GMDC, I don't know for sure if it is possible or not, but could you perhaps build some external files that store off the data you can't preserve in Milkshape. And then provide a way to attach this data back into the exported GMDC file after youve manipulated the file.

Failing that would it be possible for you to construct the bump map normals programatically upon export (seems better than omitting them completely). I can provide you with some normal calculation c routines if you would like.

Also, I have noticed that some of the filtering tools won't hold the joint data after going through them (for example, the stretch/squeeze filter). I get an error when I Export after running it through the tool (could be the tool, but merits having you look into it).

Great job so far though! If you would like some assistance, please let me know.

Regards,
John
Alchemist
Original Poster
#15 Old 9th Feb 2005 at 2:58 AM
Quote: Originally posted by javram
Hi Wes,

I have been playing around with what you have been doing for the last couple of days, and have a couple of suggestions.

The original GMDC I extracted from the game package was about 300K in size (an af top), I import into Milkshape, modify the verts, and export, and the size is down to 160kb. Obviously, it seems like a bunch of data is getting lost in translation.

Since I am not up on the file structure of the GMDC, I don't know for sure if it is possible or not, but could you perhaps build some external files that store off the data you can't preserve in Milkshape. And then provide a way to attach this data back into the exported GMDC file after youve manipulated the file.

Failing that would it be possible for you to construct the bump map normals programatically upon export (seems better than omitting them completely). I can provide you with some normal calculation c routines if you would like.

Also, I have noticed that some of the filtering tools won't hold the joint data after going through them (for example, the stretch/squeeze filter). I get an error when I Export after running it through the tool (could be the tool, but merits having you look into it).

Great job so far though! If you would like some assistance, please let me know.

Regards,
John


John:
Thank you for your thoughtful critique and suggestions.
I have though about "storing it off" many times. Architecturally, it's crude, but certainly doable. Delphy and Miche opted for a form of this (by re-reading the gmdc at export time), and as such left them with the dilemma of not being able to make any changes in vertex count without breaking the model.
But the big problem is alignment.
There is a one-to-one correspomdence between the bumpmap normals and the vertex points. Since there is no support in MilkShape for these (and no way to edit or create them) out they go. By the time you're done editing, there is likely no direct correlation between a vertex's original position and it's new one (viewed as a linear list of numbers) so matchup becomes impossible.
There is no one-to-one relationship with some of the other
data types, but the key is here: I don't know how they are matched to the original data well enough to rematch them after editing.
But someone (maybe me) will figure this out, and when it happens, writing the code to support bringing it across should not be a block to progress.
I hadn't tried the most of the MilkShape filtering tools. If they don't work right, you're free to report the problems at chumbalum soft's website board. All I do is get the data in, and get it out again. However, check on whether they are regrouping the data... if the "BoneMap" disappears before export, the software will complain. You can recover from this, but it takes a little juggling (I describe how-to in the readme file).
The regular vertex normals are imported and exported. The bumpmap normals are an extra set of normals that are used to provide additional smoothing, particularly for low-poly-count models (like we have here).
Besides the data left out, there is some additonal stuff I did that did decreased the gmdc filesize, significantly, on animated meshes.
At the end of these type files is a block where the vertices and faces (only) are repeated, but sorted into groups by bone assignment. Each active section after the first has a pad area (filled with zeroes) equal in size to all the vertex items previously written (so it gets bigger, and bigger). I'm curious as to what internal need this was designed to satisfy, but at any rate one of the things that was not happening on the original code was that vertices that perhaps originally shared a location but not a normal were now free to be 'welded' together. And this is exactly what I did to them. Everything works the same, but no only do you save the vertice size for every one you cull, but for all except the final section you also save up to several times the vertice size in null padding.
When I implemented this change, I notice around a 20% size decrease, measured against the same file with the old algorithm. Not too bad, for about 20 or so lines of code.
The last thing I want to say is, while I don't intend to walk away from supporting what I have produced for MilkShape so far, the next level of advancement will probably be for a different software platform. MilkShape at this time does not have the all the advanced features necessary to support further improvements, and as such it is time for me to look at doing it a little differently.
Good luck, and if you make anything really cool, I'd like you to stop back and point me at it (since I don't always scan the downloads so regularly anymore).
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Alchemist
Original Poster
#16 Old 9th Feb 2005 at 3:03 AM
Quote: Originally posted by Saikatsu
I tried Blender once... the interface was enough to make me not bother using it any further. Too confusing. :\
I know 3DS supports the multiple bone assigments for each vertex, I'm not so sure about the mesh deformation because I've never worked with it. (I vagely remember how to make things explode, but... that's not helpful. XD)
While 3DS is far from free, I'm pretty sure plugins for it work in GMAX (which is free) or vice versa. o_o I don't think Milkshape can fully handle Sims 2 character mesh editing, due to the whole vertex weighting issue.

Looking forward to seeing progress made on this. <3


GMAX (and Maya PLE) both have their documented plugin interface disabled. If they didn't, who'd ever buy the parent if a plugin gave you the support you needed?
And I believe you are right about MilkShape not being the tool for full character editing. As I expressed earlier, the next major improvement will probably (very probably) not be something that interfaces with MilkShape.
Since this is a HOBBY for me, I am just so reluctant to throw these guys as much money as they are asking for their programs.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Test Subject
#17 Old 9th Feb 2005 at 4:45 AM
Hi Wes,

I managed to take some pics of the different states of the model both pre and post import from Milkshape. As you can see the differences are pretty noticeable right off the bat. In the game pictures (MS3DGame.jpg) You can see that the top of the shirt is clipped pretty badly, and that the shadows are not rendering properly (look at the arms). Also, the bottom of the model (since it is just the top), is clipped completely.

Leads me to believe that some of that data you are leaving out is there for a reason, some ideas are:
-light map (precalculated phong shading?)
-deformation map (since you can clearly see the seperate joints in the ms3d model, but this could just be what you call the bump mapping data that was left out).
-Node connection information (describing how the top connects to the bottom, and also possibly to the head).

OTHO, the geometry itself looks good. No flipped verts, the shape looks right etc, so you've nailed that part. (but you probably already knew that).

I know that it is possible to write plugins for import/export of models into gmax, if you haven't seen it before, check out NWNScript, which is for importing models from neverwinter nights into and out of gmax. It is basically a customization of the original import/export max scripts that the developer released. The funny thing about gmax is that they try to make you adhere to there proprietary formats, which means very few people actually use it.

My advice would be to stick with Milkshape for the time being. Figure out the rest of the file format, and once you've got it, then look at building something else. I think you could very easily add some nice external file functionality to what you have, that would make it easier for all of us mod'ers out there who just want to move some stuff around, and not try to reinvent the wheel.

Another option might be to create a seperate node in Milkshape to hold the verts with the Blending data thats being lost, that way, it would at least be exportable and be included in the same file (give it an arbitrary group name of blending data_do_not disturb) or something, although it doesn't solve the problem of adding new verts, etc.

anyway my 2 pennies.
Screenshots
Alchemist
Original Poster
#18 Old 9th Feb 2005 at 10:57 PM
Quote: Originally posted by javram
I managed to take some pics of the different states of the model both pre and post import from Milkshape. As you can see the differences are pretty noticeable right off the bat. In the game pictures (MS3DGame.jpg) You can see that the top of the shirt is clipped pretty badly, and that the shadows are not rendering properly (look at the arms). Also, the bottom of the model (since it is just the top), is clipped completely.


I really like your comparison and critique. I know it does a miserable job on bodies.
One of the big things missing right off is multiple bone assignments. You can see that at the shoulders on the model. MilkShape only has room to attach a single bone for any one vertex. This is enough for some things, for example, the Alienware Computer.
For a body, it's not enough. The meshes I studied (which included the afbodynaked, but not just the aftopnaked) had from 1 to 3 bone assignments per vertex. Obviously, a point at a fingertip is only influenced by one bone, but those closer to the knuckle change with two bones.
Another important item is bone weighting. If there are influences from more than one bone, then there is a need to describe how much from each. That's bone weighting, which often looked something like 0.75 0.25 0.0, basically saying 75% from the first bone listed, and 25% from the second. You can see this clearly when you put an edited mesh in the game and watch them walk around, etc. The flesh movement around the joints is very angular with single bone assignments.
I KNOW that at least some parts of the other data relates to morphs, two in particular are fatness and pregnancy. I also suspect that you are right about the 'parts matching' although that may also be also related to the lack of multiple bone assignments. The ambottomnaked seems to have only 4 vertices that are primarily associated with the 'belly' node, but there were quite a few more that had influences from the belly, although the pelvis and thighs had greater influences.
The import plugin just picks the bone with the greatest influence and uses that.
So, unless or until Mete adds more horsepower to MilkShape, I think it's value for editing body meshes is low.
BUT, let's not write everything off here... you can, for example, rearrange and edit the Alienware Computer with this. You can move the screen, and the video clips show up on it at it's new location. I had less success at trying to move the mouse to the left hand side. I moved it and the mousepad over easily enough, but the animation software just moved the mouse back over to the right side (although the mouse pad stayed in it's newly assigned location).
There were a lot of objects people were stumbling over due to animation on previous releases... for example the diving board that Peter Halland was playing with. Although I haven't looked at it again, I would bet work on the diving board would be more successful with this version than previous ones.

Please do let me know of any further shortcomings you find. Whether I can fix them or not is one thing, but knowing the obstacles are there is important.

Oh, and from what I read, Discreet charges huge sums for the rights to develop and distribute game-specific plugins for GMAX... one reported sum was $85,000. This could have some bearing on why Maxis didn't do that themselves and give it to us. It certainly puts it out of the class of projects that I can afford.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#19 Old 10th Feb 2005 at 12:20 AM Last edited by fleabay : 10th Feb 2005 at 12:24 AM.
Wes, Check this out. I have not tried it but it might interest you.

http://forums.modthesims2.com/showt...hlight=gmax+obj

Better yet, figure out the Maya 6 PLE native format and make a stand alone converter.
Lab Assistant
#20 Old 10th Feb 2005 at 9:43 AM
i have played with this pluggin, i like the way it imports the bones with the mesh. i wanted to see what vertices are assigned to what bone, seems that, if the mesh and bones are imported, the assignment is not, when, in milkshape 1.7.3, i select the bone, and try to select the vertices assigned by the ad hoc button, no vertices are selected. could you confirm that, when importing a body or hair mesh, the vercites to bones assignement is not imported, or is there a way i don't know to make the assigned vertices appear when i select a bone ?
Field Researcher
#21 Old 10th Feb 2005 at 10:48 AM
Thanks wes for the new plugins. After all my misstakes i learned to work more straight. So yesterday i spent the evening to create a totaly new cloned lamp with 6 mesh groups and changed allmost everything in the meshes. I can report the object shows up in the game perfect. So, your new plugin used with ms 1.7.4 works perfect for me and makes things easy and quick to export/import. Next days i will test something little more bony .
I understand that there are problems with ms. However, hopefully there will be ways to resolve all this. Lot of people uses milkshape, it is cheap and perfect for me as a newby. But most of us dont shout out loudly what we using, as usage of milkshape don t seems to be popular to more rutined 3d-designers.
Test Subject
#22 Old 10th Feb 2005 at 11:11 AM
Sheesh...

You give us Wes's a good name, Wes. You da man.
Test Subject
#23 Old 10th Feb 2005 at 11:27 AM
Quote: Originally posted by wes_h
I can't manage the user interface to blender... to "unix-ey" for me.
In the interest of being cross-platform, programs that throw away the user interface features on a particular platform (e.g. PeeCee) make learning to use them more difficult.
While what's under the hood may be a superb engine, I can't stomach trying to drive the ugly old thing.


It seems pretty much everyone who takes a look at the Blender interface get scared to death. I did too. But after I read a couple of tutorials (to which links can be found on the Blender site), I quickly got more and more comfortable using it. Now it all comes as easy as walking and it feels completely logical to me.

Milkshape, on the other hand, is slow and annoying to work with. I can't understand why so many people use it. It may be cheaper than programs like 3D Studio or Maya, but I wouldn't pay a cent for it.

I don't mean to disrespect you Milkshape users, I mean, you use what program you feel comfortable with. I just don't understand why you pay for an incomplete program like that, when Blender is absolutely free.
Lab Assistant
#24 Old 10th Feb 2005 at 6:15 PM
It seems pretty interesting that a simple object such as glasses has a full body sim skeleton.

.
Alchemist
Original Poster
#25 Old 11th Feb 2005 at 12:33 PM
Quote: Originally posted by dyonis-my
i have played with this pluggin, i like the way it imports the bones with the mesh. i wanted to see what vertices are assigned to what bone, seems that, if the mesh and bones are imported, the assignment is not, when, in milkshape 1.7.3, i select the bone, and try to select the vertices assigned by the ad hoc button, no vertices are selected. could you confirm that, when importing a body or hair mesh, the vercites to bones assignement is not imported, or is there a way i don't know to make the assigned vertices appear when i select a bone ?


I need an example. Not ALL bones in a model have vertices assigned, but a bottom body mesh always has vertices attached to the thighs, upper pelvis (which, in future versions will be called just the pelvis) and other bones.
The button on the Joints tab titled "SelAssigned" should select all vertices assigned to that joint. It does here, and if it doesn't there, then there is something very strange wrong. Importing AND exporting the bone assignments is an important part of what I have tried to do here.
<* Wes *>

If you like to say what you think, be sure you know which to do first.
Locked thread | Locked by: tiggerypum Reason: Unsupported, Locked at Wes' Request
Page 1 of 12
Back to top