Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Merging Models (so to speak)

Page: 1 of 1
 Jolly Boots
04-10-2006, 6:45 PM
#1
Posts from an almost forgotten thread on how to Merge Models... discussion may be carried on in the original thread. (http://lucasforums.com/showthread.php?t=163521) You all can thank oldflash for finding this. ;) -RH

Is it at all possible to "merge" a model? Like lets say I want to replace a the light armor arms with heavy armor arms (not really doing this but just an example). Can it be done by simply having the two model meshes on top of each other and then deleting the unnecceasry parts? I figure there is more to it since the result would be that the model would be missing arms. I'm just curious to know how would one go about this. Like would I simply press the Attach button and attach it to the torso? I'm sure there is more to it then that...
 Kha
04-13-2006, 4:13 PM
#2
Hi Jolly Boots....

Yes you can merge meshes from different files, at least it works with underwear models, what I usually do is open the body model I want, import the mesh part I need, with the body model selected I attach the mesh part, then delete the unwanted parts. The only problem is that you will need to fix some bone weights, and the smooth groups doesn't work with Mdlops....
 Jolly Boots
04-14-2006, 11:32 AM
#3
Hi Jolly Boots....

Yes you can merge meshes from different files, at least it works with underwear models, what I usually do is open the body model I want, import the mesh part I need, with the body model selected I attach the mesh part, then delete the unwanted parts. The only problem is that you will need to fix some bone weights, and the smooth groups doesn't work with Mdlops....
Do you think you can go into depth with the bone weights? Since thats basically what I was asking how to do in the first place. :P

You see, what I'm doing is something I brought up some time ago. I'm going to make Attons vest removable and Miras jacket removable. So I figured I would switch Attons torso with the underwear model torso and Miras arms and torso with the dancer model torso (the only other model with the same cleavage) and underwear model arms. The models in the end, will be replacing unused KOTOR I models and take over the Clothing item while the regular ones with vest and jacket will remain the specialized clothes.
 Kha
04-14-2006, 1:33 PM
#4
Yes I can, but before fixing the bone weights you need have the model done, because if you you need add or remove vertex, GMax will recalculate the bone weights and change it, messing it again.

I did the same thing you wanna do with Mira and Atton to Carth (http://img152.imageshack.us/img152/5479/kharth408pt.jpg), I remodeled his underwear body model and attached to it his pants, boots and Canderous belt, and it is working fine :D, the only problem is that I have this seam at the back of his arms because of Mdlops.

Once I get the model done I do a kind of animation.... select each bone, rotate it with the local in the reference system coordinate, and add keys for it, for example, I select the arm bone set a key at frame 1, rotate it to make the arm goes down set another key at frame 4, and then I copy the first key at frame 7. If you play the animation it will lower the arm and returns it to the original position...I do it for all his bones, at different frames, doing most of the movements the body parts would do, this way I can see where the deformation is working or not, once I find a vertex the deformation doesn't look good I change the weight bone for that vertex...

I could go deeper on the explanation, but don't know how much you have done already....and it is much easier to understand while you work on it....

So I guess the first thing is getting your model done and test it in the game to see if there is some mesh problems, and spot where the bones are not working right.... then you could start fixing the bones weights.

That is it for now...
Kha
 Jolly Boots
04-14-2006, 2:43 PM
#5
Hm. I'm going to post screens and steps to make sure I did the model right.
http://img418.imageshack.us/img418/1318/15xl.th.jpg) (http://img418.imageshack.us/my.php?image=15xl.jpg)
Import the first model (underwear model).
http://img418.imageshack.us/img418/2711/25wt.th.jpg) (http://img418.imageshack.us/my.php?image=25wt.jpg)
Go into editable mesh mode on the torso.
http://img418.imageshack.us/img418/4240/36ex1.th.jpg) (http://img418.imageshack.us/my.php?image=36ex1.jpg)
Select the upperbody mesh and detach it from the lower body.
http://img418.imageshack.us/img418/8729/47gq.th.jpg) (http://img418.imageshack.us/my.php?image=47gq.jpg)
http://img418.imageshack.us/img418/2532/53qj.th.jpg) (http://img418.imageshack.us/my.php?image=53qj.jpg)
Select everything else except fort the part needed (upperbody mesh) and delete it.
http://img418.imageshack.us/img418/3841/65or.th.jpg) (http://img418.imageshack.us/my.php?image=65or.jpg)
Now importing the Atton model so it's basically on top.
http://img418.imageshack.us/img418/5184/77pb.th.jpg) (http://img418.imageshack.us/my.php?image=77pb.jpg)
Select the upperboady like with the underwear mesh and detach it.
http://img450.imageshack.us/img450/196/80hr.th.jpg) (http://img450.imageshack.us/my.php?image=80hr.jpg)
Attach underwear torso with Atton legs so it's one big mesh.
http://img139.imageshack.us/img139/9529/96az.th.jpg) (http://img139.imageshack.us/my.php?image=96az.jpg)
Now we come to the part where I am. I'm VERY ignorant on this so forgive me. The narrow white in the blue area is the bone, correct? Also, I'm not sure what you mean with "local in the reference system coordinate..."
 Jackel
04-14-2006, 5:41 PM
#6
I did the same thing you wanna do with Mira and Atton to Carth (http://img152.imageshack.us/img152/5479/kharth408pt.jpg), I remodeled his underwear body model and attached to it his pants, boots and Canderous belt, and it is working fine :D, the only problem is that I have this seam at the back of his arms because of Mdlops.
That Carth model looks good. I personally would want a vest or something on him though, topless Carth running around is my idea of a smart guy. Also seeing the Carth clothing model is in K2 any chance or trying to do the same thing for K2 (without porting over anything that isnt in K2 already though).
 Kha
04-14-2006, 9:36 PM
#7
Thanks Jeckel,

This model is not to make Carth look smart, but yummy :drool1: !! Anyway, I'm working on a mod to give Carth different cloths and underwear for Kotor I and II.

___

Hi Jolly, I'm following you here....

I would do a few different steps from you...

1. Once you have the upper body mesh... I would delete the skin modifier using the trash can in the modifier list with the skin modifier selected, because Atton's bone will mess with the mesh once it is imported to the other file anyway, and then I would save this file:
http://img89.imageshack.us/img89/5787/khafig016ju.th.jpg) (http://img89.imageshack.us/my.php?image=khafig016ju.jpg)

2. Reset Gmax and import Atton model, it is not a good idea use the same file because it will import the bones of the underwear model and Atton body model. Now I select the Torso_geo, RArm_Geo, LArm_Geo, JacketFlapNew and ShirtFlapNew, hide everything else and do a Selection Set with those meshes (select everything and give it a name, for example cloths) to make the selection of these meshes easier, if you want you can make selections for bones and another for helpers it is a good idea... if you don't get it take a look in this Uvmap tutorial (http://geocities.yahoo.com.br/ninivekha/Telos/HeadUVRemap.zip) I've done for a friend.
http://img89.imageshack.us/img89/5113/khafig022xa.th.jpg) (http://img89.imageshack.us/my.php?image=khafig022xa.jpg)


3. Now using File->Merge the file with the underwear mesh and select the torso.
http://img88.imageshack.us/img88/4536/khafig038by.th.jpg) (http://img88.imageshack.us/my.php?image=khafig038by.jpg)

4. Select the Torso_Geo, with editable mesh highlighted in the modifier list select element, enable the attach button and click the underwear mesh.
http://img20.imageshack.us/img20/4789/khafig040xu.th.jpg) (http://img20.imageshack.us/my.php?image=khafig040xu.jpg)

5. Torso_geo and underwear is one big mesh now.... unhide all the bones and change the system coordinate from view to local, because I want the bones to rotate using their axis and not the viewport axis.
http://img110.imageshack.us/img110/9590/khafig054lg.jpg) (http://imageshack.us)


6. Select all the bones and press CTRL X to make them a little transparent, let's see if the bones are still affecting the mesh...select the bone from the torso,torsoUpr_g, and rotate it around the y axis...you see that the jacket moves but not the underwear mesh... we need add the bone weights for the underwear vertices, press CTRL Z to undo the rotation.
http://img86.imageshack.us/img86/1867/khafig076oe.th.jpg) (http://img86.imageshack.us/my.php?image=khafig076oe.jpg)

7. Let's delete Atton's shirt to see his underwear and then we can fix the bone weights...with editable mesh enabled, we highlight element and select all parts of his shirt and delete it, we hide the object ShirtFlapNew too. But before going on it is a good idea model the mesh the way you want it, export it to the game to see if it is at least working without any crash, and then, when all the modeling and texture painting is done we can fix the bones weight.
http://img133.imageshack.us/img133/5183/khafig081nh.th.jpg) (http://img133.imageshack.us/my.php?image=khafig081nh.jpg)

continue....
 Kha
04-14-2006, 9:37 PM
#8
8. This is how you can change the bone weights...with the body mesh selected we enable the skin modfier and highlight envelope, in the modifier parameters we will use the bone list, the Abs. Effect in the Weight Properties, and check the Vertices box in the Filters.
http://img100.imageshack.us/img100/8757/khafig093lv.th.jpg) (http://img100.imageshack.us/my.php?image=khafig093lv.jpg)

9. When you select a bone in the bone list, some vertices of the mesh is shown in color, this color shows the weight of the selected bone on the vertex, each bone is showed in the mesh as a red line when selected and black line when deselected. The vertex color goes from red (100% weight) to blue (1%) and no color at all (0%). If you checked vertex in the filters, you can select the vertices and they will be shown with a white square around it.
http://img139.imageshack.us/img139/261/khafig109ce.th.jpg) (http://img139.imageshack.us/my.php?image=khafig109ce.jpg)

10.To see the bone weight value of one vertex you select the vertex and see the number in the Abs. Effect box, it goes from 0 to 1.000, if you select more than one vertex and they have different values the box will be empty, to give it a value you just need to change the number, and the color of the vertex and the color of the faces around it will change too.
http://img101.imageshack.us/img101/2314/khafig111rx.th.jpg) (http://img101.imageshack.us/my.php?image=khafig111rx.jpg)

11. For me the best way to see if the bone's weight is working or not is doing some kind of animation (this animation will not be used by the game)...to do that I hide everything except the bones, then I enable the Animate button and the key button in the bottom panel. With one of the solid bones selected, the bone of the leg for example, I put the time slider to frame 5 and rotate the bone leg 60 degree around the y axis. You will see that a blue key is created at frame 0 and another at frame 5, if you move the time slider you will see the leg bone going up.
http://img92.imageshack.us/img92/8651/khafig124rf.th.jpg) (http://img92.imageshack.us/my.php?image=khafig124rf.jpg)

12. After this kind of moviment it is a good idea to put it back to the original position... then I go to frame 10 and copy the key at frame 0, hold the SHIFT key while moving the key from frame 0 to 10.
http://img88.imageshack.us/img88/8022/khafig136tj.th.jpg) (http://img88.imageshack.us/my.php?image=khafig136tj.jpg)

13. I do this for all the possible movement of the body, moving the respective bone around all the possible axis.... when it is done I disable the animation button, hide the bones and unhide my body mesh. Now moving the time slider we can see the mesh deformation for each moviment... here we have a big hole in the mesh while the leg goes up....
http://img137.imageshack.us/img137/7324/khafig148ic.th.jpg) (http://img137.imageshack.us/my.php?image=khafig148ic.jpg)

14. To fix that we select the Skin modifier, highlight envelop and select the bone of the leg in the bone list, select the vertex that is not in the place it should and change its value in the abs. effect, the vertex will change its color and go to the position indicated by the value you typed. It is a tedious work...but give nice results.
http://img95.imageshack.us/img95/1722/khafig152kd.th.jpg) (http://img95.imageshack.us/my.php?image=khafig152kd.jpg)

I've written too much for now, sorry for misspelings.... if you have any further questions let me know..
Good luck!
Kha
 Jolly Boots
04-15-2006, 1:09 AM
#9
Whoa...thanks Kha! I'll be sure to report in what I come up with. :D

Well, stupid me didn't import any animations so I won't be able to check to see if there are any holes. But for now, I'm just concentrating on getting in game.
 Kha
04-15-2006, 6:43 AM
#10
Hi Jolly,

I don't import the animations from the game... what I do here is create some movements using the animation tools from gmax to make it easier to see the deformations.

It would be much easier if there was a way to import the animations from the game, but if I'm not mistaken the animation from some npcs are stored in another model file...I don't know if it could be imported and used somehow.
 Jolly Boots
04-15-2006, 11:24 AM
#11
Hm. I imported it but the entire torso vanished and the shirt flap went nuts. I assume it's because the bones were properly attached. So I assume I need to change the bone weights so they are in the blue zone? And what about the shirt flap?
 Kha
04-15-2006, 11:45 AM
#12
This is good to know the game didn't crash... now it is just model and adjust the bone weights....

The flaps from the shirt and jacket have a flex modifier that mdlops can not work with, or you delete it or remove the flex modifier from it (never tried though), thats why we can not use mdlops for head models, most of them have flex modifier on hair meshes.

The torso you need give some bone weights for it vertices, otherwise its vertices goes to the floor in the game.
 KillerWave
04-15-2006, 1:52 PM
#13
Let me ask something:

I edited the berun mordul head a while ago, but I don't particularly like the hair or actually the lack of it. Would be possible ,merging models, to use another character's hair model, like the one from the bearded pc?
 Kha
04-15-2006, 3:52 PM
#14
Unfortunately not, there is something in the head model that when you change the number of vertices of the file things get screwed up when you import through MDLops in the game.

When I merged the hair from another character the mouth and nose of the face got deformed, and the head was placed in the wrong position, when I removed a few vertices, deleted some hair objects, or removed the flex modifier from the hair object I just got the head in the wrong position.
 Jolly Boots
04-17-2006, 12:10 PM
#15
Bah! I tried doing the bones but the model is still missing the entire body (minus arms).
 Kha
04-17-2006, 7:35 PM
#16
If the entire torso vanished... then there is something wrong....did you followed all the steps I've written here? Because mine is working....I have Atton's body and the underwear mesh I've merged using the texture from his jacket....
http://img215.imageshack.us/img215/1197/khafig165im.th.jpg) (http://img215.imageshack.us/my.php?image=khafig165im.jpg)
 Jolly Boots
04-18-2006, 3:05 PM
#17
Well, the torso now appears. BUT...there are a few parts that need to be trimmed down and I forgot to remove the jacket flaps. The arms probably need to be lowered with the rest of the body as well. Finally, the new torso does not move with the rest of the body.

http://img108.imageshack.us/img108/3091/almost19vs.th.jpg) (http://img108.imageshack.us/my.php?image=almost19vs.jpg)
http://img161.imageshack.us/img161/8004/almost28vs.th.jpg) (http://img161.imageshack.us/my.php?image=almost28vs.jpg)
http://img161.imageshack.us/img161/566/almost30zw.th.jpg) (http://img161.imageshack.us/my.php?image=almost30zw.jpg)
 Kha
04-18-2006, 6:19 PM
#18
That is it... now you need to model the torso the way you want it, paint the texture and fix the bone weights.
 Jolly Boots
04-18-2006, 6:27 PM
#19
So, would fixing the bone weights fix the problem with the new torso being left behind?
 Kha
04-18-2006, 8:59 PM
#20
Yea... that's what I've done here.... I selected the TorsoUpr_g bone and assigned the vertices of the upper torso to 1.0 (red), selected the torso_g bone and assigned the vertices of the middle torso to 1.0, and did the same with the pelvis_g bone and the bottom vertices of the torso...
http://img227.imageshack.us/img227/7499/khafig178vr.th.jpg) (http://img227.imageshack.us/my.php?image=khafig178vr.jpg)

In your picture it appears the torso is not in the center of the body... perhaps that is why the arms appear misplaced. Remember that it is not a good idea move the bones, because if you do its rotation center will stay in the same place, so the body movement won't look good. You will need to model the torso to fit the arms position.
 Jolly Boots
04-18-2006, 10:20 PM
#21
Ooh. I almost got it. The only problem is that I'm missing the shoulder and the belt area (and the hands are misplaced a little from moving them to be more in line.) But nothing I can't fix. :D

Thank you so much, Kha. You really did help me when I didn't do anything to deserve it. I owe you one (actually I owe you ALOT). And of course thanks for putting up with me. Hope I wasn't too much of a pain.
 Kha
04-19-2006, 6:05 PM
#22
You are welcome....
If you have any problem let me know ;)
Page: 1 of 1