ebmar 893 Posted January 1, 2019 Greetings, fellow Jedi! May the Force be with you. I'm opening this thread awaiting further discussion of fixing collar for PFBF model variant in particular- which me and @DarthParametric previously discussed here. So, continuing from where things left off- Quote Regarding the clipping at the back, that is presumably because the collar on the body is weighted entirely to torsoupr_g, while that area of the neck on the head has a reasonable amount of influence from neck_g. This is again something that could possibly be a more general problem, or maybe it only affects Twi'lek female heads, since they were never intended to be used on other bodies. The solution would likely again be to edit the body model, this time adjusting the skin weights of the collar. This may necessitate adding bones to the rig, as body models typically stop at torsoupr_g and don't have the neck_g bone. Alternatively, the head could be edited to set the weights on that area of the neck to necklwr_g (which is functionally identical to torsoupr_g). Either way should stop the clipping. Does fixing the collar had anything to do with moving the model's vertex? I'm looking to have practice on fixing the issue personally. and also- 6 hours ago, DarthParametric said: However I did a quick in-game test with PMBFS (small seems to have the worst clipping problems for females) and I didn't see any problems, and I haven't seen any on the large model either, so it seems they are probably ok. It seems the large model which is the PFBFL variant have a similar level of worse too; as seen here: Was so damned as two of my released mods were using PFBF_ variant, lol Many- many thanks for considering this. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted January 1, 2019 The female Class 8 / G (PFBG) model has a much shorter collar than either the Class 7 / F (PFBF) or Class 9 / H (PFBH) models. Additionally, the collar in the G model has skin weights for the neck bone (neck_g). These two factors mean it doesn't appear to suffer any clipping, or at least nothing notable. The collar in the F/H models is completely weighted to the upper torso bone (torsoupr_g), which is equivalent to the lower neck bone in head models (necklwr_g). That makes the collar entirely rigid in regards to head movement. The male G and H models have neck weights on their collars, although the F models still lack them. The general shape and proportions though in relation to the male heads seems like it precludes them from the same clipping issues. I've uploaded a fix for it here: @ebmar, if you are interested in learning how to go about it, I can post some step-by-step details. 1 1 Quote Share this post Link to post Share on other sites
ebmar 893 Posted January 1, 2019 (edited) Ah I am late on noticing the latest reply- 4 hours ago, DarthParametric said: I've uploaded a fix for it here: Thank you for the fix, DP! I have installed it to my game and them collars are look amazing now! By my perspective- better than vanilla setup for the collar. Quote ...if you are interested in learning how to go about it, I can post some step-by-step details. I am interested! As I believe to have gained a basic skill of vertex editing from the recent attempt, I think I can follow up a little bit more now. Many thanks for considering this. Edited January 1, 2019 by ebmar Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted January 2, 2019 OK so here is how I went about the fix. We'll use PFBFS as the example, as the issue is most pronounced in the small models, along with the PFHA01 head. I should also preface this by saying this following is predicated on working in Max. I'm unsure if GMax will support all of it. I know in the past I have said "it's easy, just do XYZ", only to discover GMax doesn't have said ability. To start with, here is a closeup view of the problem areas. The back of the neck is particularly bad in this example, with a large section clipping through right down to the base: There's also the issue at the front with the center front vert clipping past the front of the collar. From the wireframe of the collar, you can see the reason for this is that the front of the collar is pushed inwards, past the front of the neck: As I stated in the previous post, the G model doesn't have the same issues. The collar is shorter and wider, and unlike the F/H models has weighting to the neck_g bone: We can take advantage of this fact and use the G collar to replace the existing F/H collars. So, on to the fix. The first step is to load up the G model and obtain our donor collar. Because of K1's three different sizes, this process will need to be repeated for each of the L, M, and S models, giving you three donor collar meshes, one for each body size. I'll just show the process with the S model, but the steps are identical for each. With the PFBGS ASCII model imported, select the Torso mesh and then Hide Unselected. It helps to hide the texture if those are loaded, and additionally change the object colour from white so it's easier to differentiate meshes in wireframe/edged face modes later on. Change to a side view and swap to a lasso selection mode. Unfold the Editable Mesh modifier in the stack and select the Element sub-mode. Now in the viewport select the collar elements: Switch back to a perspective view and ensure you have it all selected: Now Select Invert and Delete. That should leave the collar by itself: This is probably a good point to rename the mesh from Torso to something more appropriate, like Collar_G_S. Select the Skin modifier in the stack and find the Advanced Parameters section. Under that click the Save button, which will prompt you to choose a location to export an envelope (ENV) file. This file records the skin weights for each vertex in the mesh. We'll need this once we merge the donor collar mesh into the recipient model: Now you can Unhide All and, with the collar mesh selected, Select Invert and Delete. Now the only object in the scene should be the collar mesh. Save this as a Max/GMax file, then do a Reset to create a fresh scene. Import the PFBFS ASCII model. Just like with the G model, select the Torso mesh and hide everything else, disable the texture if necessary and change the object colour. Select the collar elements: The difference is this time we want to delete the collar, like so: Now go to File -> Import -> Merge and select the saved G collar file. In the Merge dialogue that pops up, select the collar mesh and hit OK: Now the collar mesh will be in the scene, although it won't mate cleanly with the hole in the torso: We'll need to do a bit of vertex shuffling to make a seamless join. The first step is to hide most of the torso mesh to make things easier to see. Go into the Polygon sub-mode of the Editable Mesh and select the ring of polys around the neck hole: Now Select Invert and hit Hide under the Selection section of the Polygon rollout: Now there's a minor adjustment to make in the Torso mesh. You'll see the back of the neck clips inside the collar, so we need to drag that out a bit: Select the Torso mesh and go to the Vertex sub-mode of the Editable Mesh. Select these two verts: And move them back past the collar: It is important to only move these verts, and not touch the verts connected to the rest of the torso. With that done, select the collar mesh and go into the Vertex sub-mode of the Editable Mesh. Go to Tools -> Grids and Snaps -> Grids and Snaps Settings and make sure only Vertex is enabled and toggle Snaps on in the toolbar. Now comes the process of selecting each vert around the collar and snapping it to the appropriate vert on the torso. You'll want to have Edged Faces enabled in the view settings to make things easier. Snaps can be finicky, so you may need to make use of Undo a lot until you get the hang of it. Hiding as much unwanted geometry as possible helps a lot here to avoid snapping to the wrong place, as well as making it easier to access verts amidst intersecting geometry. Additionally, because of the mismatched subdivision between the two meshes, the torso will need to have a couple of verts snapped to edges on the collar in order to close all the holes. All this is easier to demonstrate in a video: Now we have the collar cleanly mated to the torso, It's time to load in the skin weights. Unhide All, then with the collar mesh selected, click on the Skin modifier and under Parameters click on the Add button at the top of the Bone list. This will pop up a window of all the objects in the scene. Select the torsoupr_g and neck_g bones: In the Advanced Parameters section, click the Load button and find the ENV file you saved earlier. You'll get a a Load Envelopes window where you can match bones. Because we are using the same names, hitting the Match By Name button should be sufficient (although for future reference, bone names are case sensitive). If you left the original bone list untouched, you'll likely have a long list of extra bones in the Incoming Envelopes column. That's fine, you can safely ignore those. They have no weights as we deleted the rest of the torso mesh they were originally assigned to. Hit the OK button: You can hit the Edit Envelopes button to make sure your weights imported correctly: The final step is to address the texture. Because life is never that easy, each of the F/G/H models have completely different UV mapping, If you assign one of the F textures to the collar, you'll see its a mess: Because of how texture variants work, we'll need to edit the collar's UVs to match the F texture layout. To do that you'll want to check the UVs of the vanilla F collar (I probably should have mentioned that before you deleted it - whoops). It looks like this: Back with the G collar, add an Unwrap UVW modifier above Editable Mesh in the stack. Obviously the existing UVs will not be anywhere close to right: The interior section is pretty easy to fix with some rotation and scaling: The outer ring though will require a bit more finessing. First it will require a Flip Horizontal, then some Scale Horizontal to get it roughly the right width. After that, switch to Vertex mode and shuffle verts until you have something in the ballpark of the original layout: You don't have to try and slavishly copy the original to the pixel. Just get it looking more or less the same. You can see here I actually shifted the front seam (righthand side in the UV window) back a bit compared to the original, as the texture kind of fades out to mush further to the right. Once you are happy with the result, right click on the Unwrap UVW modifier and choose Collapse To. It is important to choose this and not Collapse All, as well as making sure the modifier is underneath the Skin and Trimesh modifiers. Otherwise you'll destroy those. And that is pretty much it. All that remains is to make the collar mesh a child of the base, export, and compile. Then you can test in-game. Edit: One additional step I missed. It's not entirely necessary, given that the G collar seems to work fine, but to be doubly sure you may want to pull the front verts out a little, like so: And here's the final result with the PFHA01 head: 2 Quote Share this post Link to post Share on other sites
ebmar 893 Posted January 2, 2019 Many- many thanks for the step-by-step detailed tutorial, DarthParametric! I will look to take this into practice in every chance possible; this will be very helpful on a long run same as this tutorial here you've made earlier. I have trouble getting to know with gmax's interface which I believe pretty much stalled my development in general practice but still, I'm looking to progressing further on this case. At last, your effort and time on making this excellent guide is very much appreciated. Thank you very much. Quote The final step is to address the texture. Because life is never that easy, each of the F/G/H models have completely different UV mapping... I was shocked at the exact moment; thought all is set and done only by vert snapping, lol. 1 Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted January 2, 2019 20 minutes ago, ebmar said: thought all is set and done Chances are with modding that if you think you're done, you're probably not done. A couple of points I didn't address regarding skinned meshes: You can delete elements of a skinned mesh and still retain intact skin weights on the remaining portions. However you can't add new geometry without destroying the weights (basically it all boils down to vert ID numbers). If you want to merge two or more meshes into a single mesh, you'll have to recreate the skin weight data. When butting up two skinned meshes like this, you need to make sure that the weights for each paired vertex are identical, otherwise you'll get bad deformation and see gaps. I skipped over discussing it here because all the verts around the neck hole in the torso are weighted 1.0 to torsoupr_g, as are the bottom row of verts on the collar. But that's something to be mindful of when doing this sort of thing. Similar examples in KOTOR are splinting meshes at the shoulders or wrists (because of the engine's bones-per-mesh limit). If you look at those you'll see they typically try to minimise the number of bones at the split to one or two for simplicity. It's also debatable whether this is the "right" way to approach this problem. There's usually more than one way to skin a cat, as they say, and you could resolve this issue in an alternative manner. The obvious way would be to reshape the existing collars, adding in weighting to the neck_g bone. That would eliminate the need to mate two different meshes together and edit the UVs, but I considered it the more laborious approach for me personally. 1 Quote Share this post Link to post Share on other sites