redrob41 Posted March 30, 2014 Share Posted March 30, 2014 Ever since the Awesome HeadFixer tool came out, I've wanted to fix and maybe even make new heads for the games. One that I've always been annoyed with, is how the tongue on PMHH01 clips through his cheek when he turns his head. While I'm able to fix that, there are new problems that crop up. Here is a pic where the top row shows the original head model. I've changed the texture to neutral grey (R=128, G=128, B=128) but I changed the tongue texture to Red. Neutral grey always acts like primer paint on physical models: all the flaws are easier to see. In the top row, you can see how the tongue clips through. You can also see how all the model seams are smoothed out properly. Compare that to the bottom row, where the jaw line and hairline are the most noticeable hard edges. There's also little cuts in the model that show up (like the outside corners of the eye socket, and the top corners of the nostrils meeting the cheek). At least the tongue works. As far as I can find out, It's a problem with how MDLOps (I'm using v6) converts the ascii mdl into binary mdl and mdx. It seems to me that the info for smoothing edges is stored in the mdx. Unfortunately, I can't just use the original mdx (when I tried, other areas lost their proper animations or bone weighting). I've tried comparing the mdxs with HexCmp, but I'm just shooting in the dark (since I'm not a programmer ). Does anyone know how the smoothing group info is stored in the compiled model files? Link to comment Share on other sites More sharing options...
DarthParametric Posted March 31, 2014 Share Posted March 31, 2014 I'm not sure the MDL/MDX format was ever fully reverse engineered properly. The best we ever got was "functional". You could always try drumming up some interest over at Xentax, see if anyone would be willing to take a crack at a new converter/exporter. I don't know that there would be many takers on a game as old as K1/TSL though. Btw is your head a single mesh? I recall there was another thread about broken shading a while back where the problem was due to detached polys. Is mdlops splitting your mesh on conversion perhaps? Link to comment Share on other sites More sharing options...
redrob41 Posted March 31, 2014 Author Share Posted March 31, 2014 yeah, all the hard edges happen wherever the polys are detached. It's something that is built in way too often with the original TSL models. While I could go in and fix the small ones (like around the eyes and nose), I can't do anything about the jawline and hairline, since the texture and uvw maps require the separate pieces. I don't think that MDLOps is splitting them during conversion. When I re-did my female Rattataki heads, I wound up joining all the polys around the jawline and hairline. Since they are bald, all the skin can just flow into each other. It just meant re-arranging the textures and uvw a fair bit. On those models, the head is now one solid piece, with only the ears, eyes, teeth and tongue separated. I won't be able to do that with any other species though. Link to comment Share on other sites More sharing options...
Kainzorus Prime Posted March 31, 2014 Share Posted March 31, 2014 I hope you'll find a way to solve this. VP's canonical Revan suffers from this very same issue along the jawline, perhaps that could be fixed too. Link to comment Share on other sites More sharing options...
Super Saiyan 4 Revan Posted March 31, 2014 Share Posted March 31, 2014 I'm finally glad that a tool was released to fix this head model, specially since I use DarthParametric's Head reskin for it Link to comment Share on other sites More sharing options...
DarthParametric Posted April 1, 2014 Share Posted April 1, 2014 yeah, all the hard edges happen wherever the polys are detached. It's something that is built in way too often with the original TSL models.The top picture is the original vanilla model though, right? Those areas are not detached in that model obviously, because the jawline, etc. have consistent smoothing. The model on the bottom is your altered mesh, correct? Those polys are detached in that model, but how did that actually happen? Presumably you didn't purposely detach them yourself. Would I be correct in assuming you exported your converted model (which looked fine at the time), tested it in game and noticed the broken shading, then converted the model back to ASCII to check it in Max? The interesting thing with that head is that the detached polys match with the UV islands, at least the jawline and front hair sections anyway. I wonder if that is related? It would be an interesting experiment to do a quick and dirty remap of that (undetached) head so the face/neck is all one island, then export and see if the same detaching happens again. Link to comment Share on other sites More sharing options...
redrob41 Posted April 1, 2014 Author Share Posted April 1, 2014 The top picture is the original vanilla model though, right? Those areas are not detached in that model obviously, because the jawline, etc. have consistent smoothing. You're right, the top picture is the original vanilla model. The model on the bottom is your altered mesh, correct? Those polys are detached in that model, but how did that actually happen? Presumably you didn't purposely detach them yourself. Would I be correct in assuming you exported your converted model (which looked fine at the time), tested it in game and noticed the broken shading, then converted the model back to ASCII to check it in Max? What I did is ran the original mdl through MDLOps6, then used NWNMax to import the ascii file into 3DSMax 2011. Without doing anything, the mesh will already have detached polys at every location that needs a cut for the UV islands. The only changes I made were to the bone weights of the tongue, then exported. Then I used MDLOps6 again to recompile the ascii into a binary mdl & mdx. The mdl was then ran through the HeadFixer 1.0b The interesting thing with that head is that the detached polys match with the UV islands, at least the jawline and front hair sections anyway. I wonder if that is related? It would be an interesting experiment to do a quick and dirty remap of that (undetached) head so the face/neck is all one island, then export and see if the same detaching happens again. AFAIK, Kotor can't have attached x,y,z polys anywhere that you want detached UV nodes. It always has to be separate in both the mesh & the uv map. If you leave the mesh with attached xyz polys, then try to cut out only the map, exporting the ascii from max will automatically reattach the uv nodes, and the texture gets stretched. I did put a link in the first post to another thread, but I'll just put it here again http://www.lucasforums.com/showthread.php?t=157286 So, cchargin has known about the smooth group problem for a long time, but I don't know if a solution has ever been found. Link to comment Share on other sites More sharing options...
DarthParametric Posted April 1, 2014 Share Posted April 1, 2014 I was suggesting creating a single UV island, if that is the problem. You should be able to bake the existing map and transfer it across to new UVs (although you'd probably need to tidy up the seams). I know how to do it in other apps, but I've never done it in Max. Link to comment Share on other sites More sharing options...
redrob41 Posted April 1, 2014 Author Share Posted April 1, 2014 I don't know how to do that either. Plus, if I did do that, then any other mod that used the original head texture, would no longer be compatible with the new one. That kinda defeats the whole purpose. PMHH01 is a very popular head mod. I did make a single UV island for my Rattataki female heads, and manually rearranged the uv maps and textures. Since I was making unique heads, I didn't have to worry about other mods being compatible. What I'm really looking for, is figuring out how the smooth group info is stored in the mdx file. I'm hoping that it'll be something like swapping a small series of hex values, so that a tool (like the HeadFixer) could be built. Link to comment Share on other sites More sharing options...
VarsityPuppet Posted April 1, 2014 Share Posted April 1, 2014 I've had a way of "trying" to fix the 'hard edges' (at least if one really wanted to). It's more of a sneaky workaround for sure, but when I've tried it out it has worked well. Basically, it comes down to creating an extra face/poly between the detached portions but keeping the vertices in the same place (if that makes sense). Of course, the real trick would be to do that programmatically, wouldn't it? It doesn't help that lately all of my head experiments have gone pretty wrong (I blame either 2014 for this, or my 'fix' to the 3ds plug-in). I haven't had time to go back and fix it however, but at least know you're not alone. If you'd like though, I can look into it as well and see what I can find on the subject as well as decoding the .mdx I hope you'll find a way to solve this. VP's canonical Revan suffers from this very same issue along the jawline, perhaps that could be fixed too. In all fairness, that mod would not have been possible without RedRob! Link to comment Share on other sites More sharing options...
DarthParametric Posted April 2, 2014 Share Posted April 2, 2014 Plus, if I did do that, then any other mod that used the original head texture, would no longer be compatible with the new one. That kinda defeats the whole purpose. PMHH01 is a very popular head mod.Can't make an omelette without breaking a few eggs. People can still use the original if they want. You supply a new head as an alternative with a texture template for other mods. If you are waiting for someone to fix mdlops to do it properly, well you may not ever see a solution. I don't know how to do that either.I'll look into how to do it in Max. It's a fairly common procedure, so I'm sure there's some modifier in there somewhere that facilitates it. The actual texture transfer should be relatively painless, it's the remapping part that is the real PITA. Alternatively, I can take a crack at it outside of Max if you want. You'd need to send me the smoothed head, seeing as the process is dependent on correct vert ID/order, which will be different in a head with the detached sections rejoined. Link to comment Share on other sites More sharing options...
Quanon Posted April 2, 2014 Share Posted April 2, 2014 The Unwrap Modifier in Max has a lot of functions. You can make your own cut across a model and then use the Relax function. To smooth out those 'islands'. Been awhile since I messed around with that stuff. There's also some function to 'pack' your UVWs automatically. Though that often destroys more of your work then anything else x-( But it's easy enough to find some tutorials out on the web, that shows where the buttons are Link to comment Share on other sites More sharing options...
DarthParametric Posted April 2, 2014 Share Posted April 2, 2014 Here's the kind of thing I was suggesting. This is just a quick and dirty example, it would need some cleanup. The original is mirrored, so doing that would be a more effective use of UV space. Easy enough to do. It was just easier to remap that way. Link to comment Share on other sites More sharing options...
Quanon Posted April 2, 2014 Share Posted April 2, 2014 It's not really a tutorial purely about UVWmapping in 3Ds Max. The real topic is creating a good looking rock boulder Though at 5:10 into the video, you'll see how they go about mapping the boulder. (This BBCode requires its accompanying plugin to work properly.) Link to comment Share on other sites More sharing options...
redrob41 Posted April 2, 2014 Author Share Posted April 2, 2014 I've had a way of "trying" to fix the 'hard edges' (at least if one really wanted to). It's more of a sneaky workaround for sure, but when I've tried it out it has worked well. Basically, it comes down to creating an extra face/poly between the detached portions but keeping the vertices in the same place (if that makes sense). That's something I hadn't thought of before, but I can imagine how it could work. Sneaky indeed @DP & Q: I guess it was the baking of textures that I haven't learned yet. I have used the relax and packing of uv elements quite a bit (especially on my Luxa hair fix that took forever ). Thanks for the extra info though, I'll have to check out that video tutorial next week (I've got family coming to stay for the rest of this week ) If you are waiting for someone to fix mdlops to do it properly, well you may not ever see a solution. That was my hope, but you're probably right . I guess I'll just have to try one of the workarounds, and give up on hex editing mdxs. Link to comment Share on other sites More sharing options...
redrob41 Posted April 3, 2014 Author Share Posted April 3, 2014 Alright, so I scrapped what I had done before, and started over. I figured that I had tried to do too many changes at once the first time, so this time I only changed one thing for four verticies on the tongue. So, here's what I did: 1 - ran the original mdl through MDLOps6 to produce PMHH01-ascii.mdl 2 - used NWNMax to import the ascii file into 3DSMax 2011 3 - without changing anything, I immediately exported a file and called it PMHH01-ascii_NotFixed.mdl 4 - on the mesh for the tongue I only changed the weighting on the four vertexes that were weighted 100% on the wrong bone. I made them 100% onto the correct one (previously I had split them to 95% on the bone, 5% on tonguetip). 5 - exported to a file called PMHH01-ascii_FixedTongueWeightOnly.mdl 6 - ran both files through MDLOps6 to produce PMHH01-ascii_NotFixed-k2-bin.mdl & mdx as well as PMHH01-ascii_FixedTongueWeightOnly-k2-bin.mdl & mdx 7 - used HexCmp program to compare the two mdxs. There were only four differences (highlighted in light red). Show spoiler (hidden content - requires Javascript to show) 8 - used a Hex Editor to open the original PMHH01.mdx 9 - searched for the unique hex strings (highlighted in yellow) and found that the weren't repeated anywhere else, and they were on the same line (38E0) as the modified ones. My guess is that the hex strings that I highlighted refer only to those four vertexes of the tongue (but I don't know what they mean). Anyway, the series following of 00s and 80 3F or 80 BF might be coordinates or string values? 10 - manually changed the values (light red) from 40 to 00 (in the original PMHH01.mdx). Saved. 11 - put the new PMHH01.mdx into my override and tested in-game (along with the original, unchanged PMHH01.mdl). Show spoiler (hidden content - requires Javascript to show) 12 - Looks fixed to me Now, this doesn't address the problem of MDLOps messing up the smooth groups, but it does show that I can fix bone weight issues in the original models without having to "create a new head" from an ascii.mdl that was exported from max. It seems to me that this is kinda what Taina's replacer does, but that program is limited to xyz and uv coordinates. It would be nice if it could also replace values for the weights as well. So, before I release this to the world, are there any other models that have really bad bone weight issues? PMHH01 is the only one I've really noticed, but if there are a few more, I could make a mod pack. BTW, I know that many female heads and Twi'lek males have that lower lip problem, but I think that has to do with supermodels and animation, not bone weights. Link to comment Share on other sites More sharing options...
L0ki194 Posted April 3, 2014 Share Posted April 3, 2014 Oh happy day, you fixed it! The reason why I'm so happy is that "that" particular head resembles the K1 PMHC04 aka "Mullet Man", which is what I use most of the time playing K1. Finally that eyesore is off the model without any other problems. Now I don't know a thing about modelling, so I have to ask a really n00b-ish question: What is bad bone weight exactly? Is it like what was with the original head model where something is out of place? But anyways, glad you figured it all out! Now I just wish I knew how to model working heads to recreate the K1 head I was talking about. Link to comment Share on other sites More sharing options...
Quanon Posted April 3, 2014 Share Posted April 3, 2014 Now I don't know a thing about modelling, so I have to ask a really n00b-ish question: What is bad bone weight exactly? Well, bones are what gets a model moving around, doing its combat animations, walking, falling you name it. You need bones to animate your model. Bones aren't really visible they are underneath the mesh/ skin of the model. Just like our own bones. In much the same way a 3D skeleton gets build up with these bones. A skeleton that fits the model ofcourse. The weighting part is how strongly a bone affects a part of the model. When making models and animating them, there's a bit of experimentation to see what the limits are. And much depends on how detailed the models are. Though, as with Redrobs headmodel, you can do whacko things. You could link the tongue, with say the bone of the left hand pinky. Everytime that pinky bone moves in an animation, the tongue would move aswell. It's odd the folks at Obsidian didn't fix this, it's rather hard to miss. EDIT: @Redrob: Man that's some hardcore detective work. Hex editing is... well, it looks weird and never makes any sense to me what the numbers do Congrats on another well done job! Link to comment Share on other sites More sharing options...
L0ki194 Posted April 3, 2014 Share Posted April 3, 2014 Ah, Okay. Thanks for the info Quanon! Link to comment Share on other sites More sharing options...
JCarter426 Posted April 3, 2014 Share Posted April 3, 2014 Ah, a most clever solution! So, before I release this to the world, are there any other models that have really bad bone weight issues? PMHH01 is the only one I've really noticed, but if there are a few more, I could make a mod pack. I believe the bones of PMHC04 clip through the face during the Talk_Forceful animation. Well, something clips through the face, but I think it's the bones. Link to comment Share on other sites More sharing options...
Kainzorus Prime Posted April 3, 2014 Share Posted April 3, 2014 Like I said before, if you could fix VP's canonical Revan head, as a separate request, that'd be grand. He put it up in his resource pack - http://deadlystream.com/forum/files/file/213-vp-modders-source-compilation/ Link to comment Share on other sites More sharing options...
Super Saiyan 4 Revan Posted April 4, 2014 Share Posted April 4, 2014 Query: Will reskins that apply only textures to the head still work with the new remodel? I imagine it should, but better be safe than sorry. Link to comment Share on other sites More sharing options...
DarthParametric Posted April 4, 2014 Share Posted April 4, 2014 Nicely done redrob. Good to see you managed to get it working without having to modify the UVs. As to other heads that have problems, I don't doubt there will be more of them. It seems to be a pretty common issue with Odyssey heads - something I noticed a lot of with Jade Empire models for example. Query: Will reskins that apply only textures to the head still work with the new remodel? I imagine it should, but better be safe than sorry.Yes, existing retextures will be fine. The head is unchanged for the purposes of texturing. Only bone weights were edited, not UVs. I believe the bones of PMHC04 clip through the face during the Talk_Forceful animation. Well, something clips through the face, but I think it's the bones.No, you don't see the bones in-game. It will be a piece of the mesh, either the mouthbox, teeth, or tongue. Link to comment Share on other sites More sharing options...
JCarter426 Posted April 4, 2014 Share Posted April 4, 2014 Well, it's not any of those... it's solid grey, like the bones. Not sure what it is. Link to comment Share on other sites More sharing options...
DarthParametric Posted April 4, 2014 Share Posted April 4, 2014 It's not the right brow, is it? Looks like there is a shading error that occurs there due to extreme mesh deformation during a couple of frames, making it look dark grey. That animation is a bit screwy in Max though, the eyes are messed up with PMHC04 when applying it. Other than that though, I can't see any mesh clipping through the face. Got a pic of what you mean? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.