varenne Posted November 9, 2014 Posted November 9, 2014 Yes, some here may never fully grok what went into producing these tools. And the way I see it, you evolved Setbody as far as you could (had patience for), which was fairly far IMO. Then movomo made the next evolution. As it stands now it is so much better in so many ways than the original, which at the time too was a leap forward for a body replacer tool and MOD. Other people's UVs have always given me major angst, both in Blender and other 3D tools. Once upon a time I purchased UV Mapper and was going through standardizing all UVs for those meshes I used most often. Of course the one time an external drive decides to crap out, it had to be the one with the majority of my 3D work on it. Months of UV rework lost. I haven't revisited it since. The problem with UV mapping of 3D models stems from the fact that tools allow you to do it a number of ways. Of course there is recommended best practices, guidelines and standards, yet very few follow them. Or worse a particular school teaches you to do it one way, claiming that to be the best. Other topic, but related Do we know yet if that PyFFI bug you submitted a fix for was ever fixed? I still feel a next major boon and tool for MOD authoring and game to game conversions is a NIF cleaning tool that can be applied en masse to a set of meshes. This, much like yours and movomo's efforts around Setbody, would help to produce a standardized pre-production approach for cleaning and fixing all those wonky NIFs out there.
gerra6 Posted November 9, 2014 Author Posted November 9, 2014 Other topic, but related Do we know yet if that PyFFI bug you submitted a fix for was ever fixed? I still feel a next major boon and tool for MOD authoring and game to game conversions is a NIF cleaning tool that can be applied en masse to a set of meshes. This, much like yours and movomo's efforts around Setbody, would help to produce a standardized pre-production approach for cleaning and fixing all those wonky NIFs out there. Probably not. When I submitted it, I accidentally updated the main branch instead of creating a bug specific branch. So...Neo had to revert the main branch. I took another look at the tangent space code in pyffi. It looks like it could probably be fixed more simply than my original approach simply by changing the vertex hash call to include UVs in the hash. Basically...the tangent space function created a directional map by combining UV directional data and face normal data. Since the UV faces on either side of a UV seam can have arbitrary orientation, a given tangent space calculation should only collection data from the same side of the UV seam.
Sythdracous Posted November 9, 2014 Posted November 9, 2014 Man if I understood half of what you just said I might not need these tools. Sadly I don't so all I can say is one massive thanks for all the hell you've been through to produce these. So, THANKS AGAIN!
varenne Posted November 9, 2014 Posted November 9, 2014 Other topic, but related Do we know yet if that PyFFI bug you submitted a fix for was ever fixed? I still feel a next major boon and tool for MOD authoring and game to game conversions is a NIF cleaning tool that can be applied en masse to a set of meshes. This, much like yours and movomo's efforts around Setbody, would help to produce a standardized pre-production approach for cleaning and fixing all those wonky NIFs out there. Probably not. When I submitted it, I accidentally updated the main branch instead of creating a bug specific branch. So...Neo had to revert the main branch. I took another look at the tangent space code in pyffi. It looks like it could probably be fixed more simply than my original approach simply by changing the vertex hash call to include UVs in the hash. Basically...the tangent space function created a directional map by combining UV directional data and face normal data. Since the UV faces on either side of a UV seam can have arbitrary orientation, a given tangent space calculation should only collection data from the same side of the UV seam. Next question, same topic What would be involved in applying this fix or a fix and compiling and releasing a fixed PyFFI, outside of GIT? Maybe if they see we aren't interested in waiting any longer for a fix and have decided to take action as a community on our own, they'll escalate a fix for it too. I also volunteer to test it. GIT I've FUBARed the main branch (and a few sub branches) on projects a few times myself, which lead them to assign an admin to receive all updates, edits, etc. Something I had asked for in the beginning of the project(s), but hey that's just me. And while I'm thinking of it, here's the link to UV Mapper, for those wanting a really good stand-alone tool outside of Blender or other 3D tools, to work on UV maps.
gerra6 Posted November 9, 2014 Author Posted November 9, 2014 Well, I just need to log into my git repo and update a bug branch for pyffi and ask Neo, Ghost, and whoever else is currently paying attention to the nif portion of pyffi to take a look at my branch. I'm still a bit awkward when it comes to github. So...whee. Now, as far as independent distro is concerned, the nif module of pyffi is all in python so nothing is compiled. Updating an official version of pyffi with a hacked version is as simple as swapping the appropriate files. Sort of like what I did with that Blender 2.49b import script I sent to a few folks yesterday. As an aside, that hack that allows nifs to be imported into Blender 2.49b with full vertex order preservation wouldn't have happened if I hadn't taken the time to learn how the update tangent space function was building its hash. That inspired me to check the import.py script to see if they were doing something similar with their hash. Converting that hash to one that uses vertex index instead of loc/normal was a quick and dirty way to ensure that every vertex avoids the purge. I'll release a later version of that hack that includes a 'preserve vertex order' button on the import menu that toggles the back-end import between the two hash methods.
idonotlikeusernames Posted November 12, 2014 Posted November 12, 2014 I got this error when I was trying out some of the new functionality when attempting to convert some skinny male meshes to a more muscular body: **********Meshes Initialized****************nif_gender******MALETraceback (most recent call last): File "PythonPortable\App\Scripts\kgtools\convert_clothing.py", line 342, in <module> Main() File "PythonPortable\App\Scripts\kgtools\convert_clothing.py", line 333, in Main process_nif(this_file, lattice, lattice_dict) File "PythonPortable\App\Scripts\kgtools\convert_clothing.py", line 159, in process_nif axis_menu = NodeMovementMenu(target_nif.meshes, c_s) File "K:\Skyrim Mods\tools\Convert Clothing RC_72\PythonPortable\App\lib\site-packages\kg\ui_tools.py", line 231, in __init__ self.node2[m.lbl] = uiToggle(temp_frame, 'Alternate Constraints', arrange = 'GRID', col = 0, colspan = 3, row = 11)TypeError: __init__() got an unexpected keyword argument 'colspan' What is colspan? and what can I do to avoid this error? Do I need to generate a new lattice and if so with what settings? Edit: Nevermind reinstall of python fixed everything again.
foreveraloneguy Posted November 12, 2014 Posted November 12, 2014 This might have already been answered somewhere, but if so, I missed it. My question is on how the converter determines skin. Does it use the texture path, or something else? Bump, since I don't think I got an answer. I also have another question: what does "flatten skinning" do?
idonotlikeusernames Posted November 12, 2014 Posted November 12, 2014 I do have another question however I would be most thankful if someone could tell me how I can use these tools to convert from the Oblivion male body to Skyrim. In other words how do I sue pose converter to get from the Oblivion male pose to the Skyrim one and which steps if any do I have to do manually?
gerra6 Posted November 13, 2014 Author Posted November 13, 2014 I do have another question however I would be most thankful if someone could tell me how I can use these tools to convert from the Oblivion male body to Skyrim. In other words how do I sue pose converter to get from the Oblivion male pose to the Skyrim one and which steps if any do I have to do manually? Here's a brief rundown. One of these days I'll finish the auto-converter tool for converting Oblivion <-> Fallout <-> Skyrim meshes. At the moment, four of my tools are useful. The first is not actually mentioned on my site, but is included in the tool download: Pose Converter. This is designed to automatically convert the rest pose of nifs between Oblivion, Fallout, and Skyrim poses. Note, the finger pose conversion is not perfect at present, and the fallout wrist location needs a bit of fine tuning. I'll have an update one of these days to address these issues. Next is Mesh Rigger. You can use this to strip and re-rig an Oblivion nif with Skyrim bones and dismemberment partitions. It should also automatically update the file version when you do this. It was intended to provide the highest possible fidelity when copying bone weights, so with any luck at all, it should provide very solid results. Next is Clothing Converter. This is the fun one. With Clothing Converter, you can automatically convert an outfit that was designed for one body style to fit a different body style. Best results come when the the original body style and the conversion body style use the compatible UV maps (they can use the same texture), but the tool can also operate in a nearest point to surface conversion that does a passable job so long as the bodies have a reasonably similar shape. Finally, I'm about to update the package with a new tool that can automatically re-position meshes so that they line up properly with another mesh. Note: this only works if the two meshes have a common seam that needs to be lined up. OK, so what's the sequence for Oblivion to Skyrim conversions? 1. Run an Oblivion Rigged and Posed mesh through Pose Converter. Select Oblivion to Skyrim. Now you should have an Oblivion Rigged mesh in Skyrim pose. 2. Run Mesh Rigger on that Mesh. Use a Skyrim nif that is as similar to the base body that you are converting as possible. Enable: 'Copy Weights', 'Delete All Weights', 'Replace Bones', 'Replace Partitions'. Disable UV search. 3. Now generate a lattice to convert that armor/clothing from the Oblivion body to the Skyrim body. UV search should be disabled. 4. Use that lattice to convert the armor. 5. Open the nif in nifskope. Replace the existing body mesh with one from the Skyrim body type that you are converting to. For the armor/clothing meshes, update the material blocks to the Skyrim equivalents. I don't remember offhand how to do this. I think it's just a matter of copying the correct shader blocks from an appropriate Skyrim mesh and changing the texture paths of the copied blocks. Finally, you'll want to generate _0 and _1 weight slider meshes. At this point, you'll have either the _0 or the _1 mesh and you need to generate its partner. Generating weight slide meshes using Clothing Converter Let's say that you are converting a collection of clothing made for a particular Oblivion body and you want to convert them to an existing Skyrim body. Let's assume that they have been rigged and posed and that all that you need to do is convert them to fit an existing Skyrim body style and generate the _1 and _0 nifs. The first step will be to generate a lattice that will handle one of the conversions (either _0 or _1). The lattice is just a file that stores all of the data necessary to convert one nif into the shape of another. Generating a good lattice is generally the tricky part. Oblivion to Skyrim is going to be particularly tricky. Since this involves a conversion between bodies that use different texture standards (can't use UV search), the initial conversion should start with the most closely matching Skyrim body. You will want to make two lattices. 1. Oblivion to Skyrim: To nif should be the Skyrim body you want to convert to (I'll assume it was _1.nif). From nif should be the Oblivion body. Uv Search and Vertex Index search should be Off. 2. Weightslider: From nif should be _1.nif. To nif should be _0.nif. (or vice versa if you converted the Oblivion nif to _0.nif) Vertex Index Search should be On. UV search should be on (as a backup, probably won't get triggered) OK, so now you have your lattices. What next? 3. Run Clothing Converter on the folder of nifs that you want to convert. Default settings should be fine. Select the oblivion to skyrim lattice. 4. Run Mesh Rigger on the Clothing Converter output folder. Use the Skyrim body that you used in step 1 as the template mesh. Disable UV Search and Select Bones. Enable Copy Weights, Delete All Weights, Replace Bones, Replace Partitions. Under Game, select Skyrim and enable 'Copy Version from Template' 5. Open the nifs from the Mesh Rigger output folder in Nifskope. Delete the bodies. Branch-copy the Skyrim body from step 1 onto the scene roots. Save them. 6. Run Clothing Converter on the updated nifs. Use the lattice from step 2. 7. Rename the nifs in the Mesh Rigger output folder to *_1.nif 8. Rename the nifs in the Clothing Converter output folder to *_0.nif At that point, the meshes should be properly sized and rigged for Skyrim, however it will still have the Oblivion material block and texture block instead of the skyrim shader block.
idonotlikeusernames Posted November 14, 2014 Posted November 14, 2014 Thanks, It's a lot to take in but I think I'm going to give it a whirl this weekend and see if anything I like comes out of it.
gerra6 Posted November 14, 2014 Author Posted November 14, 2014 Thanks, It's a lot to take in but I think I'm going to give it a whirl this weekend and see if anything I like comes out of it. I'm slowly but surely putting the pieces together in my framework to automatically convert nifs from one game to another. But it's going to be awhile.
Zor2k13 Posted November 16, 2014 Posted November 16, 2014 This is a GREAT tool thanks for making it! Been converting some stuff and it works as advertised:-) Thanks to this tool I can now put more stuff from various mods into my game and have it all match the body types I have chosen to play with. The only problem I can see is what happens when you have a different race with a different body type? How do you call on matching clothes/armor parts for that other race for the same clothes/armor that another race is wearing? For example you attack a bandit npc who is a member of the big boobs and big butt race but your character is using not that big boobs and butt body. So is there some scripting function that takes care of that?
foreveraloneguy Posted November 16, 2014 Posted November 16, 2014 The body is part of the armor. When you equip the armor, you get that body. There's a mod that on nexus that tries to match up armor with body type via some mechanism, but I haven't tried it. It's called something like multi-body skimpy armor system or something like that. I have one body I like that covers the ranges I like, so I'm just working on converting stuff to that.
gerra6 Posted November 16, 2014 Author Posted November 16, 2014 The only problem I can see is what happens when you have a different race with a different body type? How do you call on matching clothes/armor parts for that other race for the same clothes/armor that another race is wearing? For example you attack a bandit npc who is a member of the big boobs and big butt race but your character is using not that big boobs and butt body. So is there some scripting function that takes care of that? Great question. There are two answers depending on exactly what you mean. If you're worried about clipping when you equip small boob armor on a character that, when nude, has a big boob body, don't worry about it. When a character equips armor that covers a given slot (determined in the construction set), that armor/clothing/equipment replaces the exiting mesh completely. That means that the body mesh that you see when you equip, say, a bikini is actually part of the bikini nif and not in any related to the one that your character would display if nude. If on the other hand, you're worried about character's body shapes changing depending on what they are equipping, that's a bit more complex to answer. These tools (Clothing Converter, Mesh Rigger, Seam Mender, etc) are probably best thought of as automation tools to make a modder's job easier and simpler. For example, Clothing Converter has the ability to batch-convert an entire collection of clothing from one body shape to another, which allows you to potentially complete the bulk of a 2 month project in 2 hours. It should be noted that the automated conversions don't handle major changes in cleavage particularly well, so some manual 3D work may be required for certain types of meshes/conversions. I've been toying with various approaches to improve cleavage handling, but I haven't yet come up with anything that is even worth public testing. However, once Clothing Converter has made those conversions it's done. It dumps the nifs into an output folder and leaves it up to you to decide what to do with them. Your question largely falls into the category of 'what to do with the nifs once you've converted them'. If you're talking about a custom race with custom equipment, then simply use clothing converter to convert the equipment for that race into whatever shape you desire. On the other hand, if you're looking for something automatic within the game to swap clothing models depending on the body style of the actor, then you're basically talking about a type of setclothing framework. I'm honestly not sure what's available along those lines for Skyrim. Is it possible? Probably...all that is required is some sort of ability to auto-swap either mesh model paths or equipment based on some readily identifiable criteria. Probably something similar to what I coded for the Oblivion BreakArmor framework (a mesh swapper based on item damage rather than assigned body type). But I honestly have no idea whether or not anyone has actually written one. My Skyrim game-playing was almost entirely limited to rigging testing to ensure that my tools can properly rig/modify Skyrim nifs.
Zor2k13 Posted November 17, 2014 Posted November 17, 2014 Yeah in skyrim you could specify a race specific mesh for each item of clothing or armor but I don't know if that is in the cs for oblivion or not. I am having trouble converting boots right now though, when I convert them the ankles don't match up and poke out of the boots. I haven't tried shoes yet but that will probably look worse! I tried some tricks like some shoes had a portion of the foot exposed so I would take that and paste it in the from body, and find something as similar looking as possible for the to body. What comes out of that though is some really ugly looking stuff:-( I know in skyrim there are skin partitions on the arms and legs so if boots are worn the lower legs just don't render after the beginning of the skin partition, but when I look at oblivion body repplacer parts there is no skin partition! So won't the ankles stick out of the boots as they are shown after conversion or am I missing something? I don't leave the lower body mesh in the boots in the nif file I just have the boots there expecting the game to insert the lower body mesh correctly otherwise the boots would have to be a one piece with the greaves and just replace the whole lower body. I can't see that working any better since I can't hide the ankles poking through that way.
gerra6 Posted November 17, 2014 Author Posted November 17, 2014 I am having trouble converting boots right now though, when I convert them the ankles don't match up and poke out of the boots. I haven't tried shoes yet but that will probably look worse! After you convert the boots, try swapping the old body foot mesh with the new body foot mesh. I don't leave the lower body mesh in the boots in the nif file I just have the boots there expecting the game to insert the lower body mesh correctly otherwise the boots would have to be a one piece with the greaves and just replace the whole lower body. I can't see that working any better since I can't hide the ankles poking through that way. Not sure if I am following. OK. If you load up a piece of equipment in the Creation Kit, you'll see a section 'Biped Object'. For shoes, boots, etc, this should be set to 37 (you can select more than one for equipment that covers more slots) Setting it to 37 tells Skyrim to replace the default body foot with this mesh whenever that item is equipped. So, what happens if it isn't set to 37? Well, then when your character equips the nif, both the Skyrim foot and the shoe/boot nif get loaded at the same time. What about Dismemberment Partitions? Well, they follow the same numbering scheme, but mean something completely different. Dismemberment partitions specify where and how the mesh gets cut in the even of a dismemberment event, as well as part specific gore, shaders, etc. So, it sounds like you are converting equipment, deleting the body, and then selecting a non-body slot for the object. You can do this. But if you do, Skyrim will allow you to wear, say, a pair of shoes and a pair of boots at the same time as long as they are both set to different biped objects. And, of course, Skyrim will attempt to render both at the same time. Unless you are going for a very specific effect that is designed to work with a very specific body, that is going to look bad. Instead, just include the appropriate body parts in the nif, choose the correct biped object slot, and be happy.
gerra6 Posted November 17, 2014 Author Posted November 17, 2014 Not modding skyrim, modding oblivion:-( Exactly the same principle applies in Oblivion. It's equipment slots in Oblivion.
myuhinny Posted November 17, 2014 Posted November 17, 2014 Not sure if this has been asked or not but would running a nif through mesh rigger fix inproper rotation matrix errors if you removed and replaced the bones? I just tried converting 2 UNP pieces to 7BASE TBBP and the end result wasn't pretty.
gerra6 Posted November 17, 2014 Author Posted November 17, 2014 Most of the time, this sort of mesh spaghetti is due to some bad and or excessively creative skin deformation run amok. Combine that with some of the thoroughly bugged bones in the x32 skeleton (the ones with improper rotation matrices) and everything can turn to crap pretty quickly. Wondering why improper rotation matrices are so bad? Here's why. A proper rotation matrix is fully invertible and has a determinant of exactly 1.0. This is *extremely important. Why? A determinant of 1.0 means that the rotation matrix can change the orientation of a bone, but won't change its scale in any way. This prevents the bone from improperly deforming anything that it is influencing. Invertibility is even more important. An invertible matrix means that any tranformation performed by the matrix can be reversed. This means that you can potentially get back to where you started without too many crazy steps...just reverse what you just did. This is particularly important in bones, because one of the most important steps to skinning a bone onto a mesh it to invert the bone matrix and set that as the skinned bone's matrix. This creates a neutral transform where the bind transform of the bone is exactly neutralized by the transform of the skinned bone. What happens if a matrix is not invertible? Since you can't generate an inverse of that matrix, the skinned bone won't be able to fully cancel out the bind transform of the bone. And that is how evil happens. I've started experimenting with a new option in my dev builds of the tools that completely deletes all existing skin deformation. This should allow the tool to untangle any skin deformation-related mesh jajangmyeon. Note: *many* Skyrim nifs use crazy skin deformation weirdness to reposition the mesh in the world. So in addition to the 'delete skin deformation' option, I'll add an automatic 'reposition mesh' option that will autodetect any seam-based offsets and reposition the entire mesh to properly line up with the foot, hand, and neck seams of a user-selected template nif.
Zor2k13 Posted November 17, 2014 Posted November 17, 2014 I looked in the cs for oblivion and there is only slots like upper, llower, foot, hand, head, tail, neckace, ring thats it! cs is not like ck with thighs calves forearms. Been trying to get boots to look right because what happens when a boot assigned to the boot slot is worn and no other clothes worn? The character is naked except for the boots and there is the problem with some boots they clip with the legs on some bodies. I am trying to take boots from speedbuster stuff and make them play nice with a set of naked HGEC LL legs. Since speedbuster had so many different kinds of bodies on their outfits, sometimes it is impossible to find a naked lower body or any body that matches that boot so I have to find a boot that has a matching naked part and then use that naked part as the from nif and the HGEC LL lowerbody as the to nif. The result is always "oh almost got it" where some clipping occurs and it will probably look worse with movement. The only thing I can think of is to find something slightly bigger than HGEC LL lower body but I don't think there is one except extreme stuff like guts or muscle chick stuff. I tried umpa body and round ass body they seem to have slightly different leg shapes but nope no real difference. Do you know of a slightly bigger HGEC leg than LL? evenly bigger all over not just fatter calves or something?
gerra6 Posted November 17, 2014 Author Posted November 17, 2014 The Customize Meshes menu can help with those sorts of issues. Unfortunately, it was accidentally disabled by a bug in the .h and .i versions. So I've uploaded a .j version to http://kgtools.org/that is just a very minor bugfix for the .i version that should fix the menu issue. (Note, this does not include any of the updated experimental code that I've been working on other than the menu fix) From your description, I would do two things. The first would be to use the 'padding' setting. That is designed to increase the padding between the mesh and the body. Once your conversions are complete, I would recommend re-rigging the nif using Mesh Rigger and a good template body. Since Speedbuster tended to use highly customized bodies, the existing boneweight painting won't necessarily play nice with other bodies.
Zor2k13 Posted November 17, 2014 Posted November 17, 2014 I had no idea there was a padding setting thanks for that! I will check out mesh rigger after experimenting with the padding settings thanks:-)
Zor2k13 Posted November 17, 2014 Posted November 17, 2014 Downloaded the update for portable version and dumped it in, clicked on clothing converter, customise mesh button clicked that and it doesn't do anything just shows that button is pressed. When I try to convert I get an error as long as that button is pressed. I don't see any padding settings anywhere were they supposed to pop up after pressing that customise mesh button? edit Ok I copied one of those bat files and renamed it cliping eliminator and put the clipping eliminator.py link in the bat file. So ran that and got the menu for what I think it is your talking about but it doesn't produce any output files. I give it the converted boots after running clothing converter, a LOT of code flies by on the dos prompt and then it closes. Nothing in the output directory. I take the converted boots and paste the body mesh in there thinking :oh ok it needs something to reference to not clip with" and then run that bat again. The flying code only happens for a very short period this time and then closes and still no output file. edit2 OMGOMGOMGOMG! Mmmmmmkay it worked for original version of your program! I had to dump the directory just trash it and then go download everything again, got the e version and all the updates then installed them all one at a time and it still didn't work so I trashed everything again and just used the e version no updates and the mesh button works! I was assuming this whole time, pressing mesh button will pop up some menu right away, it doesn't. The menu comes up after clicking on mesh button and then clicking ok button. The process starts and early in the process it would pop up the mesh config stuff! That padding works GREAT! Just gotta fine tune here and there then all my problems are gone! Will try that mesh rigging you were talking about too. I don't know why your latest update doesn't allow the mesh config to start but when I use it, the process crashes and I look at the log and it says something about "col" or something error. Sorry to not be more descriptive than that but I was in a hurry to get it to work and didn't save the log.
gerra6 Posted November 18, 2014 Author Posted November 18, 2014 I'll figure out the menu evilness. That last patch should have fixed it. Hmm. >clipping eliminator.py Heh...that doesn't actually do much of anything. That's a very early bit of prototype dev code that I've been poking at for a few months. Basically...it performs a bunch of triangle-triangle collision tests and attempts to resolve them. It just doesn't do a very good job. I actually wrote a few new algorithms for that over the weekend. At some point I want to include a fully functional anti-clipping tool in my tool package. It's not there yet.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now