Contrary to reports, MTS is NOT compromised, and it IS safe to download from here. For more information, see this thread.
Quick Reply
Search this Thread
Alchemist
Original Poster
#1 Old 29th Apr 2007 at 1:59 AM Last edited by wes_h : 5th May 2007 at 3:34 AM. Reason: revised to V4.09X3
Default TESTERS WANTED: Body Mesh Joint Assignment plugin for MilkShape
TEST SOFTWARE WARNING: This is in testing only mode, and has only proven useful on a small number of items.

This is a MilkShape plugin, a new member of the UniMesh suite, that was designed to HELP with bone assignments. What it does, when run, is assign any vertices with unassigned joints (except the MORPHMOD groups) to the closest joint, or some split between the closest two joints.

Member jase439 originally came up with this idea, and worked on it, but I have never seen any finished product. So I wrote my own version.

Here are some important notes and caveats about the plugin:

Quote:
* It is only for Sims2 Body/clothing meshes; it will not work on object meshes and will not assign faces, accessories or hair properly. This is because the plugin needs some hints about the skeleton construction.

* It expects a standard skeleton, as imported via UniMesh (with bone comments).

* It does not do work as well as was done by the Maxis/EA artists on the game meshes.

* It makes, at most, two assignments per vertex, with distance variable weightings.

* The shoulders, breasts and hands may need some manual help to animate properly. Also, items like long dresses get some assignments to the feet and toes, which is not optimal when animated. It's just a program, and not as smart as you are.


Now, a while back, I would never have thought that as much functionality as this plugin does could be done via a program. I have proceeded with work on it, in spite of the shortcomings, because I thought doing 80% or so of the work automatically sure beats doing 100% by hand.

I have attached a screenshot of a mesh in which I deleted all the joint assignments and then created new assignments via the plugin. This is NOT the way I recommend to use it, but rather is a demonstration and test. What I expect is the most useful function will be using this when you add new mesh parts to a body mesh.

So, I need some good testers. I am interested in feedback that describes what it does wrong in more detail than "the shoulders look funny in the game". I know it isn't perfect, and may never be, but if I learn, with your help, what it does right and wrong, I may be able to improve it.

Of course, I also want to know about any other issues, side effects or just plain goofy behavior that needs fixed.

<* Wes *>

Edit: I have added an additional factor to the bones that increases or decreases their range of influence, and have been able to make the shoulders and hands behave better when animated.

Special thanks go to TiggeryPum, for her help in getting this Out-The-(virtual)Door.
Screenshots
Attached files:
File Type: zip  msTS2AutoJoint.zip (29.0 KB, 512 downloads) - View custom content
Advertisement
Scholar
#2 Old 29th Apr 2007 at 2:56 AM
Oi! I should test this, but it's 2:55 am XD This does look and sound brilliant! You make my jaw drop every time

Please visit WickedNoukFamily Forum for my creations.
Can't take requests, I'm completely swamped with unfinished projects! :O
Instructor
#3 Old 29th Apr 2007 at 4:27 PM Last edited by marvine : 30th Apr 2007 at 12:39 AM. Reason: Added pics
Thanks a lot for working on this, it's a much needed tool!

Well, for one, no crashing anywhere but I didn't expect anything of the kind

Now I'm not sure how the distance from the nearest vertices is taken into account, or what the plugin assumes are the nearest vertices - the results are a little weird for now.

For this test, I just divided an edge on the arm (between the two green vertices on the first pic), in a location where the assignments are simple enough: one row of 50 - 10 (l_upperarm) / 50 - 11 (l_biceps) on one side, one row of 100 - 11 on the other side.

- On the first pic, the new vertex wasn't moved and is at the same distance from the nearest vertices; the expected value would have been 75 - 11 / 25 - 10.
.
- So I moved the new vertex closer to the shoulder (pic 2), and the values do change accordingly - but there's still too much weight on the l_biceps; and the closest vertices are now the two ones assigned 50 - 10 / 50 - 11, so I rather expected the same numbers for the new vertex.

- Then I moved that vertex closer to the elbow, and it got partly assigned to the l_forearm while the 2 nearest vertices are 100 l_biceps.

I experimented on the torso, but as expected the results are unpredictable when the surrounding vertices have more than 2 assignments, or when they aren't assigned to exactly the same bones.

Um, I hope this is clear enough >_<
Screenshots
Alchemist
Original Poster
#4 Old 29th Apr 2007 at 9:34 PM
You forgot to post the pictures.

A little of the distance logic:

First, with the exception of the thumb and fingertip, neck and toes, the distance is calculated from the certerpoint of the bone (between the joint and the child joint).

For each vertex, three distances are calculated: the closest joint, the next closest one, and the distance between j1 and j2.

If the distance to J2 is greater than the distance between J1 and J2, then only J1 is used for assignment, because J2 is somehow on the opposite side of J1 from the vertice. V --- J1 ----J2.

If the distance from V to J1 is less than 15% of the distance from V to J2, then again, only J1 is used, because it is close. J1 - V -------J2.

In the other cases, the program is supposed to split the weighting between J1 and J2. This does become a problem on the chest and shoulders, because the clavicles seem to get too much weighting over too large an area.

One of the things I am contemplation is adding some type of "influence zone" parameter to the program for each joint, such that I could program the clavicles to have less influence, or perhaps the spineX and Pelvis bones more influence. So this is one of the reasons why I am interested in your feedback, to help learn where the especially goofy things happen.

And I learned something from your post, even without the pictures: that I can just unassign one vertex, run the tool, and the compare it to the neighbors that still have Maxis made assignments. I didn't think of testing that way, simple but effective. Thanks, marvine.

<* Wes *>
Instructor
#5 Old 30th Apr 2007 at 12:58 AM
Ok, I added the pics but I guess they are useless after all - in fact I misunderstood the way the plugin works...

I'm so used to interpolating the weightings of the nearest vertices to assign a new one that I misread the part where you say "nearest joints" (and I really should wear these stupid glasses!).
So I'll go back to Milkshape after a good night of sleep
Alchemist
Original Poster
#6 Old 30th Apr 2007 at 1:52 AM
Oh. Well, I didn't expect I would be able to do something this radical and escape without some problems.

I see now what you were saying. The plugin doesn't pay any attention to other vertices, or what they are assigned to. While it will completely assign a skeleton, it isn't as smart as you are.

Anyway, your post gave me a good testing idea, and that was worth reading and responding to. I appreciate the time you spent, and I hope you are not so embarrased that you will fail to test when you are better rested. I recognize we are dealing with complex issues when we discuss skin-weighting methods, and misunderstandings happen.

<* Wes *>
Instructor
#7 Old 30th Apr 2007 at 5:21 PM
Quote:
While it will completely assign a skeleton, it isn't as smart as you are.


You sure know how to make people feel better!!

Surely the matter is complex, and certainly hard to explain to people that don't have the same background as you have - thank you for your efforts in this. Also, the vocabulary is always a bit confusing - "joint" being used to name the rotation point only, or also the pyramid pointing towards the child joint (which I tend to think of as "bone"); all this tends to get mixed-up when meshing without real 3D knowledge.

The important part here is that the distance is calculated from the centerpoint of the bone; in this light, the results make much more sense.

The first pic is a reassigned arm in animation mode - while that's not how an arm should bend, it shows that the plugin does a pretty good job with the weightings calculation.

Now there's some wierdness with the legs... On the second pic, you can see that two vertices inside the calf got the weighting split between the left and right calf - well, not that surprising given that they are the two nearest joints, and it might work well on a skirt.
But I'm not certain what's going on with the knee: the four vertices right at the back of the knee get single weightings on the inside, and split weightings on the outside. Would the proximity with the opposite calf joint cause that?
Screenshots
Instructor
#8 Old 30th Apr 2007 at 7:08 PM
Thanks wes, ill try these plugins at once
Alchemist
Original Poster
#9 Old 30th Apr 2007 at 8:51 PM
Quote: Originally posted by marvine
The first pic is a reassigned arm in animation mode - while that's not how an arm should bend, it shows that the plugin does a pretty good job with the weightings calculation.

Now there's some wierdness with the legs... On the second pic, you can see that two vertices inside the calf got the weighting split between the left and right calf - well, not that surprising given that they are the two nearest joints, and it might work well on a skirt.
But I'm not certain what's going on with the knee: the four vertices right at the back of the knee get single weightings on the inside, and split weightings on the outside. Would the proximity with the opposite calf joint cause that?


I have seen that clothing items can blow some of my best-laid plans up. For instance, the long dress mesh I used in the screenshot in post #1 gets some vertices assigned to the feet and toes. I think in RL that assigning them to just the legs would be the right thing to do. But since the feet and toes move with the lower leg when walking, it may work (that I didn't test in-game).

I posted a newer version (X3) this morning. I added to it a factor, used on some bones, that expands or shrinks the bone's "influence zone". So I used that tuning to shrink the clavicles some, expand the spine and pelvis, shrink the toes and shring the pinky bones (they seemed to latch on to some mid-finger vertices).

What I am debating (at least I can argue with the echoes in my head) is whether to bring any of that tuning outside, for user configuration, and if I did so, would anyone use it, considering it might be easier just to edit any problems with the BoneTool than to reconfigure, run tests, lather, rinse, repeat.

What I have right now is a table of numbers hard-coded in, centered on 1.0 that are then used at runtime. One thing I though I could do, if I decided to open it up, is create a comment keyword of some type that could be used to override individual bone values with new ones. While the newest version has 1.0 for most bones, it uses something like 1.5 for the spine and pelvis, and 0.8 or so for the toes and pinky.

Anyway, I appreciate the testing and comments.

<* Wes *>
Scholar
#10 Old 1st May 2007 at 3:01 PM
This works much better than I would have thought possible, but as you said it's no match for doing it manually.

I don't know if this suggestion is practical, or even possible, to do with the plugin, but here's mine anyway

Like Marvine (and probably most of us) I base my new vertex assignments on the existing assignments of the surrounding vertices.

Is it possible to take the assignments of close-by vertices (if there are any already assigned) into account? Or maybe only the existing assignments of vertices in the selected area?

I think either of these could produce much better results.
Alchemist
Original Poster
#11 Old 1st May 2007 at 9:02 PM
Dr. Pixel:

I am thinking about your suggested application of joint assignment. This may be a candidate for a different plugin with a different approach to determining the assignments (perhaps one that need not be confined to body meshes, for one thing).

<* Wes *>
Space Pony
#12 Old 26th Jun 2007 at 7:05 AM
Hi Wes,

I just have a quick question. I read through a lot of stuff here but I still am not sure of the answer.

Do the fat & pregnant morphs need joint assignments? I am thinking that they don't because when I chek the box that says "draw verticies with bone colors" in the Joint tab, only the body group gets any colors, the fat & pregnant morphs stay all white. But...... I'm not sure!

Thanks,

Morague
Banned Asshat
#13 Old 26th Jun 2007 at 11:38 AM
i tried it with a poser figure i imported as a obj. file and it wasn't bad at all
It will get you started but needs alot adjusting and like marvine said the leg boneassignements switch from left to right.
Maybe its caused by the short's boneassignements, they always give me probs.
I prefer working with just the left and right thigh assignements.

@Mor,they dont need bones cos they use the ones from the body
Scholar
#14 Old 26th Jun 2007 at 2:25 PM
Since I happened by before Wes did, I'll try to answer.

The fat morph (and pregnant if there is one) do not have any assignments since they are really just representations of the re-located positions of the vertices of the main mesh. Only the main mesh actually exists in the game, when the Sim gets fat/pregnant the game simply moves it's vertices into the "morph" position and keeps the same assignments.

If you do add assignments to the morph groups, they are ignored by the exporter anyway.

Quote: Originally posted by Morague
Hi Wes,

I just have a quick question. I read through a lot of stuff here but I still am not sure of the answer.

Do the fat & pregnant morphs need joint assignments? I am thinking that they don't because when I chek the box that says "draw verticies with bone colors" in the Joint tab, only the body group gets any colors, the fat & pregnant morphs stay all white. But...... I'm not sure!

Thanks,

Morague
Space Pony
#15 Old 26th Jun 2007 at 11:26 PM
Thank you, Dr Pixel!

That's sort of what I thought but I wanted to be sure Good - less stuff to worry about. I'm making some new maternity meshes.
Alchemist
Original Poster
#16 Old 27th Jun 2007 at 5:07 AM
I have seen other comments on the leg joints. As far as I know, the main issue here is that the legs are parallel, and there would be places where the second closest bone would be in the other leg.

I plan to try sometime later to make a 'map' for each closest joint that will limit the available secondary joints. By this I mean, ofr example, if the closest bone is the l_thigh, then only l_thigh, l_calf and pelvis might be allowed as secondary assignments (not r_leg bones). Another place that is difficult like this is the shoulders, where some of the upperarm has spine1 or spine2 closer than the bicep or the clavicle.

But I am not promising a quick update because I have another project that I am working hard on, but when that is done and posted I will see about this.

<* Wes *>
Banned Asshat
#17 Old 27th Jun 2007 at 5:14 AM
Hmm, its easy to avoid maybe by deleting half of the body, assigning the other half, export it and to the same with the other half, then reimport both and weld together.
Gotta try that...should work, no?
Back to top