gregathit Posted March 7, 2013 Posted March 7, 2013 Varenne, I would just open a thread and allow folks to upload to it. Then you can take those files and put them in the OP so folks can easily find them. I can help you keep up with it as I can also edit the OP so the burden won't be soley on you. As to structure, I think labels would be enough: 1. Conversion lattice from Roberts normal body to Robert's muscular body. 2. Conversion from DMRA to HGEC Hcup & LL lowerbody. Does this make sense?
gerra6 Posted March 7, 2013 Author Posted March 7, 2013 I'll be travelling for the next two weeks so I probably won't get much coding done. So, here's the Beta for the next version of the Lattice Generator. It's in pretty good shape, with most features working exactly the way they're supposed to. However, I'm going to leave it buried in the back of the thread because it is very much a beta. Both the UI and back-end algorithms have been completely rebuilt from the 4.2 version. The package contains two main scripts and a function library in the /kg/ folder. Both the main scripts and the kg folder should be installed in your /.Blender/scripts folder (or your custom user folder if you created one) Major Functionality Changes: 1. Save and Load Lattices. You can now save and load lattices to and from external .lat files. (Apply, Load or Save Lattice) 2. Generate lattices for selected vertices only. You can now select a small region of both meshes and generate a lattice targeted to convert only that small region. (Create Transformation Lattice) 3. Apply lattices to selected vertices only. This will apply the lattice only to selected vertices on the active mesh. Enabling this option will also enable edge smoothing settings that can help reduce the sharp transitions between transformed and non-transformed regions. (Apply, Load or Save Lattice) Use this version more or less the way you would the earlier versions. This version, in Fast Search mode, processes nodes and vertices ~10X faster than the 4.2 version, so feel free to experiment with different lattice styles. However, chances are good that the default settings, combined with careful selection of vertex groups for troublesome regions (such as breasts) is all that you need. lattice_generator.7z
gregathit Posted March 7, 2013 Posted March 7, 2013 Thanks Gerra6! Hopefully I'll get a chance to play with it while you are gone! Have a good trip!
varenne Posted March 7, 2013 Posted March 7, 2013 Varenne, I would just open a thread and allow folks to upload to it. Then you can take those files and put them in the OP so folks can easily find them. I can help you keep up with it as I can also edit the OP so the burden won't be soley on you. As to structure, I think labels would be enough: 1. Conversion lattice from Roberts normal body to Robert's muscular body. 2. Conversion from DMRA to HGEC Hcup & LL lowerbody. Does this make sense? Works for me! Forgot to ask, which forum, sub forum do you feel it deserves to be in? Seeing as this works for Oblivion, and the other games here too. Modders Resources maybe?
gregathit Posted March 7, 2013 Posted March 7, 2013 Modders Resources would probably be the most logical section IMHO. I have two lattices I can contribute that I made back when Gerra6 first made his tool and I was giving it a test run. The male lattice works GREAT and I used it for a number of conversions which I'll release when I get around to making my BU pack number 3. The female lattice was not so good as the lattice generator was not all that great at downsizing things back then (making a DMRA into a HGEC GM). I'll probably just upload the male lattice and redo the female one as I am sure things have improved in the months since the tool was first issued. Cheers, Greg
movomo Posted March 7, 2013 Posted March 7, 2013 I'll be travelling for the next two weeks so I probably won't get much coding done. So, here's the Beta for the next version of the Lattice Generator. It's in pretty good shape, with most features working exactly the way they're supposed to. However, I'm going to leave it buried in the back of the thread because it is very much a beta. Both the UI and back-end algorithms have been completely rebuilt from the 4.2 version. The package contains two main scripts and a function library in the /kg/ folder. Both the main scripts and the kg folder should be installed in your /.Blender/scripts folder (or your custom user folder if you created one) Major Functionality Changes: 1. Save and Load Lattices. You can now save and load lattices to and from external .lat files. (Apply, Load or Save Lattice) 2. Generate lattices for selected vertices only. You can now select a small region of both meshes and generate a lattice targeted to convert only that small region. (Create Transformation Lattice) 3. Apply lattices to selected vertices only. When enabled, this will activate an edge smoothing option that can reduce the sharp transitions between transformed and non-transformed regions. (Apply, Load or Save Lattice) Use this version more or less the way you would the earlier versions. This version, in Fast Search mode, processes nodes and vertices ~10X faster than the 4.2 version, so feel free to experiment with different lattice styles. However, chances are good that the default settings, combined with careful selection of vertex groups for troublesome regions (such as breasts) is all that you need. Thanks for all the hard works. By the way, is this the different version from the one you sent me as a dev build before ?
gerra6 Posted March 7, 2013 Author Posted March 7, 2013 Thanks for all the hard works. By the way, is this the different version from the one you sent me as a dev build before ? It's pretty much the same build. There are a few differences in the back end, but I don't think there should be any functionality changes between this version and the last dev build. When I get back, I'll start coding modifications to the way that the ring search (used by the Vertex Groups and Ring Search options) calculates angles on 'bad' rings that should resolve the twisted mesh issue that you were getting with your custom waist ring vertex group. In the meantime, it should be possible to simulate elements of my planned fix. Warning: Technical explanation ahead The ring search generates a connectivity map of all of the edges shared by vertices in the Vertex Group. It then identifies the outer edges and separates them into different groups depending on connectivity. So, a bucket shaped region might have a single outer edge, while a tube shaped region might have two outer edges. If more than one edge is found, it compares edge regions between the selected meshes and attempts to find the best match to use as a starting point. Note: Non-manifold vertices count as edges, which is one of the reason that non-manifold vertex doubles can cause distortion. Next, the tool iterates inwards, finding the next ring of vertices, and so on until it runs out of vertices in the group (or runs out of iterations for the ring search options). To get an idea of what this looks like, tab into edit mode, deselect all vertices, hit <control alt shift m> to highlight the non-manifold vertices. If you used the entire mesh as your vertex group (a very bad idea, by the way), these would represent the outer edges. If you deselect all of those edges except one, you get a starting edge. Assign this starting edge to its own vertex group. Next, hit control + to expand the selected area. Deselect the vertex group for the starting edge. This is what the second ring would look like. Rinse, repeat. OK, once the ring search has separated the vertices in the vertex group into distinct rings, it then analyzes the geometry of each ring. The Ring Center is the average position of all of the vertices in a given ring. The Ring Direction of Travel is the vector between the Ring Center and the next Ring Center. The Ring Normal is an averaged axis of the ring, in the same general direction as the direction of travel (It's calculated by generating a vector from the Ring Center to each ring vertex, calculating the cross product between an arbitrary vertex and one 1/4 of the way around the ring, marching that calculation all the way around the ring, and then averaging the resulting vectors) The algorithm then calculates the total distance traveled by the rings in both meshes, normalizes them to 1.0, and matches up rings by the relative distance traveled by each. Once a ring has its matches (generally the one or two closest rings by percentage distance traveled) the tool averages the two or three Ring Normals and generates an orthographic projection matrix that will project each ring onto a common plane (Reducing a 3 dimensional collection of vertices into a 2 dimensional wobbly circle). The last step is to compare the relative positions by angular distance relative to the orthographic projection of a (1,1,1) vector onto that plane. (Note, I will be replacing this somewhat tempermental system with a direct distance comparison of the normalized vectors in this plane in the next release). OK, so when does this system break down? Well, mostly when the vertices fail to form a complete ring. Under these circumstances, the calculations for the ring center and thus the ring axis turn to mush, and the entire system for comparing rings between the meshes collapses. So what can you do? Well, pay close attention to how you are selecting the vertices. Keep in mind that any set of vertices that don't form a complete ring may break the tool (in its current form). So, in the case of Movomo's pregnant meshes, the tool breaks because the rings break down when they hit the belly button. So what can be done? At the moment, for a waist ring vertex group, I would recommend replacing the single waist ring vertex group with three separate groups. One goes from the middle of the waist (excluding the belly button) to the bottom of the desired region. The second goes from the middle of the waist to the top of the desired region. The third is just the belly button and maybe the surrounding region. By avoiding the knots of vertices that cause the ring algorithm to choke, this approach should allow it to process otherwise impossible regions. This approach should work for any groups that have a similar knot problem.
Symon Posted March 7, 2013 Posted March 7, 2013 This will be useful: 2. Generate lattices for selected vertiTces only. You can now select a small region of both meshes and generate a lattice targeted to convert
movomo Posted March 7, 2013 Posted March 7, 2013 The ring search generates a connectivity map of all of the edges shared by vertices in the Vertex Group. It then identifies the outer edges and separates them into different groups depending on connectivity. So, a bucket shaped region might have a single outer edge, while a tube shaped region might have two outer edges. If more than one edge is found, it compares edge regions between the selected meshes and attempts to find the best match to use as a starting point. Note: Non-manifold vertices count as edges, which is one of the reason that non-manifold vertex doubles can cause distortion. Next, the tool iterates inwards, finding the next ring of vertices, and so on until it runs out of vertices in the group (or runs out of iterations for the ring search options). To get an idea of what this looks like, tab into edit mode, deselect all vertices, hit <control alt shift m> to highlight the non-manifold vertices. If you used the entire mesh as your vertex group (a very bad idea, by the way), these would represent the outer edges. If you deselect all of those edges except one, you get a starting edge. Assign this starting edge to its own vertex group. Next, hit control + to expand the selected area. Deselect the vertex group for the starting edge. This is what the second ring would look like. Rinse, repeat. OK, once the ring search has separated the vertices in the vertex group into distinct rings, it then analyzes the geometry of each ring. The Ring Center is the average position of all of the vertices in a given ring. The Ring Direction of Travel is the vector between the Ring Center and the next Ring Center. The Ring Normal is an averaged axis of the ring, in the same general direction as the direction of travel (It's calculated by generating a vector from the Ring Center to each ring vertex, calculating the cross product between an arbitrary vertex and one 1/4 of the way around the ring, marching that calculation all the way around the ring, and then averaging the resulting vectors) The algorithm then calculates the total distance traveled by the rings in both meshes, normalizes them to 1.0, and matches up rings by the relative distance traveled by each. Once a ring has its matches (generally the one or two closest rings by percentage distance traveled) the tool averages the two or three Ring Normals and generates an orthographic projection matrix that will project each ring onto a common plane. The last step is to compare the relative positions by angular distance relative to the orthographic projection of a (1,1,1) vector onto that plane. (Note, I will be replacing this somewhat tempermental system with a direct distance comparison of the normalized vectors in this plane in the next release). OK, so when does this system break down? Well, mostly when the vertices fail to form a complete ring. Under these circumstances, the calculations for the ring center and thus the ring axis turn to mush, and the entire system for comparing rings between the meshes collapses. So what can you do? Well, pay close attention to how you are selecting the vertices. Keep in mind that any set of vertices that don't form a complete ring may break the tool (in its current form). So, in the case of Movomo's pregnant meshes, the tool breaks because the rings break down when they hit the belly button. So what can be done? At the moment, for a waist ring vertex group, I would recommend replacing the single waist ring vertex group with three separate groups. One goes from the middle of the waist (excluding the belly button) to the bottom of the desired region. The second goes from the middle of the waist to the top of the desired region. The third is just the belly button and maybe the surrounding region. By avoiding the knots of vertices that cause the ring algorithm to choke, this approach should allow it to process otherwise impossible regions. This approach should work for any groups that have a similar knot problem. I had a heart attack But I got the idea. I'll try that one avoiding the navel.
gerra6 Posted March 7, 2013 Author Posted March 7, 2013 I had a heart attackI warned you. I even hid it in spoilers. Aren't I nice. But yeah...you think reading that gives you a heart attack...imagine wracking your brain for weeks coming up with the algorithms in the first place, or worse, coming back two months later and trying to decipher the code that some crazed noob code monkey (me) wrote in a fit of insanity. This project has been just a wee bit nuts.
FreeStyler Posted March 10, 2013 Posted March 10, 2013 I'm having trouble using the lattice transformation script. I am using Blender 2.4.9b, Nifskope 1.0.21, PYFFI 2.0.4, Python 2.6.4, and Blender Nifscripts 2.4.12. The error message I get is provided in the attachment. Please also note that I am a bit of a noob trying to get into modding so any help would be appreciated.
varenne Posted March 10, 2013 Posted March 10, 2013 I'm having trouble using the lattice transformation script. I am using Blender 2.4.9b, Nifskope 1.0.21, PYFFI 2.0.4, Python 2.6.4, and Blender Nifscripts 2.4.12. The error message I get is provided in the attachment. Please also note that I am a bit of a noob trying to get into modding so any help would be appreciated. Script Error.txt Compiled with Python version 2.6.2 Checking for installed Python...got it! Traceback <most recent call last>: File "<string>", line 1, in <module> File "C:\Program Files <x86>\Blender Foundation\Blender\.blender\scripts\object_create_transformation_lattice.py", line 25, in <module> import BPyMesh ImportError: No module named BPyMesh Here's a quick screen capture of where that missing module, BPyMesh should or could be located, at least it is in my installation. Also I think I have a somewhat different setup/installation of these tools. I settled on this 'package' Blender_2_49b_Stable.7z after initiating a discussion a while back in the thread: Which version of Blender? I have not had any issues with missing modules or scripts using that package. So your issue has to do with your installation of Blender and/or required modules and not the lattice transformation script.
FreeStyler Posted March 11, 2013 Posted March 11, 2013 Thanks very much for your reply! It was indeed my version of Blender that was the problem. Now hopefully I can get back to learning how to mod.
GKM Posted March 11, 2013 Posted March 11, 2013 I'm using X-Blender 2.6 (portable) with builtin niftools, and it works fine (or seems to) I'm having issues with cleavage & BBB Clipping when converting HGEC E Cup to DMRA, but I'm gonna try the 2 lattice approach since that's the only thing I haven't tried yet, and get back to you. Neph mentioned offhand about using weight-painting + shrinkwrap earlier, does anyone have a tutorial on that? (I don't think it will help my current problem), but shrinkwrap often, almost does what I want, so being able to configure it better might be nice (I can already control it with vertex groups, but that only works so well) (I can't internet today)
movomo Posted March 12, 2013 Posted March 12, 2013 The issue you guys having could be of missing file in the new version., I'm not sure.. I had no problem with the dev versions. perhaps he forgot to put some important script into the archive. I'm using X-Blender 2.6 (portable) with builtin niftools, and it works fine (or seems to) I'm having issues with cleavage & BBB Clipping when converting HGEC E Cup to DMRA, but I'm gonna try the 2 lattice approach since that's the only thing I haven't tried yet, and get back to you. Neph mentioned offhand about using weight-painting + shrinkwrap earlier, does anyone have a tutorial on that? (I don't think it will help my current problem), but shrinkwrap often, almost does what I want, so being able to configure it better might be nice (I can already control it with vertex groups, but that only works so well) Shrinkwrap is not needed as long as you've successfully generated decent lattices with this. It's mostly for 'manual' conversion.. especially when the geometry difference is too huge and you have no idea of how to move them manually or with lattices. Using it is simple by the way, just separate the boobs part and assign the modifier and play with the offset value. But if the boobs part of the source clothing has some complex things, then your best bet would be just sticking with lattices. Clipping and cleavage are related to bone weight indeed. Clipping occurs when the bone weights of two don't match well. Copy from the body and fix further by hand, if needed. Usually, OP 1,2,3 and Spine2 (perhaps even Spine1) are the critical bones for movement of boobs. Cleavage occurs because of 'knots' of the bone weight. Vertex weight should be smooth within its range.. it's possible to fix them manually(either vert-by-vert editing or using scripts) but generally copying is the way to go.
gerra6 Posted March 12, 2013 Author Posted March 12, 2013 I'm using X-Blender 2.6 (portable) with builtin niftools, and it works fine (or seems to) I'm having issues with cleavage & BBB Clipping when converting HGEC E Cup to DMRA, but I'm gonna try the 2 lattice approach since that's the only thing I haven't tried yet, and get back to you. Neph mentioned offhand about using weight-painting + shrinkwrap earlier, does anyone have a tutorial on that? (I don't think it will help my current problem), but shrinkwrap often, almost does what I want, so being able to configure it better might be nice (I can already control it with vertex groups, but that only works so well) (I can't internet today) I'm traveling, so I probably won't be writing much code for the next week and a half. If you're getting clipping during BBB animations but not the rest of the time, then then the clothing and the underlying body most likely have mismatched boneweight painting. You've got two choices. Which you choose is up to you. One option is to grab the updated boneweight copy script http://www.loverslab.com/topic/11841-blender-bone-weight-copy-script-23a/ and replace the existing OP1 to OP3 groups with the ones from the replacement mesh. Your other option is to apply a transformation lattice to both the body and the armor. One question, are you using the 4.2b lattice generator or the Beta version buried somewhere near the last post? Now, on the other hand, if you are getting clipping with the meshes while they are still in Blender, then the lattice is not moving the vertices into the correct positions. This can be caused by many things. The most important factor to generating high quality lattices are high quality vertex groups (for regions that require them) Read through the thread, there are a few sections where I or someone else explains the process in detail. Note, also grab the BB weightpainter to largely automate the process of generating BB weights. Another important factor is setting a good growth margin. Consider generating multiple lattices and applying them in sequence. If you are using the Beta, try generating lattices that affect selected vertices only.
GKM Posted March 12, 2013 Posted March 12, 2013 Yeah, I'm like a total noob (hence using this ridiculously simple mesh to test with), so I'm trying to figure out how the bone-copy weights works.Couple things I did drastically improved the lattice: Generating seperate left & right meshes. Not using the clavical group (with clavical left & right lattices are not symmetric), not sure why I thought this was a good idea when I did it (now just using bip01 and bip02 L&R) (which wasn't a problem when I generated a single lattice instead of L&R) Regenerating the BBB weighting with the automated tool. There's still clipping during animation, but it's not in the cleavage, it's now on the top and sides of the breasts, I can fix this by manually inflating the mesh, but I'll see if I can get bone copy to work first.It's the very skimpy shopkeeper shirt from this post btw. though that's the old manually converted version (which also clips during BBB).
movomo Posted March 12, 2013 Posted March 12, 2013 lol. I misunderstood the meaning of 'cleavage'. What an epic fail. I thouht you were refering to the 'crack' of clotings when animated. Ignore it... But as I said, make sure that weight value for following bones are corect and match well. OP L/R 1,2 Spine 2 Sometimes Spine 1 as well Many of non-bbb clothings have strong(orange or even red) spine2 weight in the breast region, you should weaken them if you don't want to see clippings. The easiest way to do it is using BWC 2.3 script, which allows you to select the individual vertex groups to be copied. As to lattice generating.. don't select all the vertex groups when you generate. It's not intended to use so. OP1 and Buttock for the overall shape, and OP3 for the ponty nipples. That's all you need. Some huge boobs however are overlapped with the belly region (like pregnant bodies..). In this case, you may need a custom vertex group to help the script to distinguish where should belong to the breast and where should belong to the belly.
cobme Posted March 20, 2013 Posted March 20, 2013 Hi , I'm having a problem when attempting to create a lattice. After following your instruction (I tried making a converting lattice from DMRA upper body to ZKEC E cup upper body) I reached the point of selecting the source body and Shit-selecting the target body, fine, I went to - object>scripts>create transformation lattice>load>upper body*>ok>ok and then it says: Error, python script error: Check to console
briancs159 Posted April 7, 2013 Posted April 7, 2013 I've run into a problem and I've no idea how to fix it. I've started a new game as a Khajit character. I came across a new armor that I liked and decided to create break armor stages and convert it for the pregnant armor stages. I haven't changed anything that I'm aware of but when I equip it in game the skin looks wrong. It's as if you shaved my khajit character and her back is half pale and half light orange. The original unmodified armor looks fine by the way. I imported a nif that I knew had the same body that my new armor was going to use. I copied that body over and used it instead of the old body that I originally had with the new armor. I imported the same skeleton and exported it using the same settings and suddenly it looks fine. I tried the same technique with a different armor and it doesn't work. What would cause this? Edit: I know it's not my import/export settings. I imported the armor in question and deleted the skeleton, re-imported the skeleton, and then exported it. It looks fine. It's only when I assign one of my old lattices to the body.
FastestDogInTheDistrict Posted June 5, 2013 Posted June 5, 2013 I have what might be considered a boneheaded request... The "How-To" pictures in the OP are good, but is anyone able to provide some pics showing the process used INCLUDING *where* the menus/drop-downs/etc. are located on the screen (basically, "How-To Pics... For Dummies"). I'm really only trying to use Blender to quickly morph armour objects through so I can get the morphed armour back into 3dsMax (all Nightasy's stuff is in 3dsMax) for work. I am battling my way through "Blender for Idiots" interface tutorials, but looking for this specific info while still being unfamiliar with Blender is kinda like looking for hay in a haystack. (For example - I can't even *find* the right drop-down "Object" menu to access "object=>scripts" to check if I've installed this tool correctly. The ones I can see don't even seem to have a "scripts" option...)
gregathit Posted June 5, 2013 Posted June 5, 2013 Make sure you are in object mod and then select the object tab right next to that box and you will see the scripts from which you can choose. Gerra6 has been absent from the forums for several months so a tutorial is probably not going to be happening. You can open a lattice file I made to see what is what from post 3 here if that helps: http://www.loverslab.com/topic/14943-clothing-converter-lattice-library/ It has been quite a long time since I used this since I delved into animating so I really can't help too much. ThatOne put together a blender tutorial that may help also: http://www.loverslab.com/topic/10838-guide-blender-nifskope/
FastestDogInTheDistrict Posted June 5, 2013 Posted June 5, 2013 Make sure you are in object mod and then select the object tab right next to that box and you will see the scripts from which you can choose. Gerra6 has been absent from the forums for several months so a tutorial is probably not going to be happening. You can open a lattice file I made to see what is what from post 3 here if that helps: http://www.loverslab.com/topic/14943-clothing-converter-lattice-library/ It has been quite a long time since I used this since I delved into animating so I really can't help too much. ThatOne put together a blender tutorial that may help also: http://www.loverslab.com/topic/10838-guide-blender-nifskope/ Hey Gregathit! Okay - junked Blender 2.6something. Installed 2.49 from the "Which Version of Blender" thread linked, and Python as well using the supplied .exe, and found objects=>scripts straightaway. Step One - done! ***SEE ATTACHED PIC - that's what I'm looking at*** (**"NifTools" is not Skyrim-friendly according to the description, so I'll move .NIFs through 3dsMax as .OBJ's, and import those to Blender instead, yes?) HOWEVER - while I can get the BoneweightCopy script thing to show in objects=>scripts (by putting it in \Python\tools\Scripts), no matter where I put ClothingBodyTypeConverter I can't get it to show. If I create a "Scripts" folder in ...\Program Files(x86)\Blender\ the option does not show, nor does it show if I put the scripts in the main Blender folder, or the Python folder. I think someone else had this problem, but I can't seem to find the post... (*EDIT: Found post, but it's for Blender 2.6 which seems to have a different file structure. My Blender has no "Bin", for example. Also, trying to create a ".blender" folder results in "Computer Says No") (*EDIT: also tried putting the 3 script files in: C:\Users\[mynamehere]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Blender Foundation\Blender\Scripts. "Create Transformation Lattice" does not appear). (*EDIT: Also tried putting the scripts in the suggested filepath/s shown HERE in the 2.4 Blender Manual, with no success) EDIT: I GOTTIT! Big text is big. Okay - here is what the problem apparently was: I uninstalled/re-installed Blender, then went to install that Pyffi.exe thing (whatever that is - no clue, but hey why not, right?) included with the Blender download. When I tried that, I got a warning saying "Blah blah Blender scripts not installed rightways wrong place here instead blah blah die" (or something... okay, maybe it didn't say die. Yes, I do read these and take notice, but once I've dealt with them I forget the exact wording). SO - I uninstalled/re-installed Blender 2.49b, and this time selected the "Installation File Path", which is not the default option. It's the second one down. Both the default, and the correct option sound like they might be right, and it is easy to bugger the whole thing up if you don't know (as I don't). It was only by trying to install the Pyffi thing that the problem became apparent, and the incorrect filepaths were fixed via a re-install. *WHEW!* What I can see now: So... now to start butchering meshes I guess. Heh heh heh!
gregathit Posted June 5, 2013 Posted June 5, 2013 If you are using blender portable then you go to your install directory (where ever you installed it to) and put the script files here: X-Blender_2.49b_rev8\Bin\Blender\.blender\scripts\ Blender portable is available here: http://oblivion.nexusmods.com/mods/42755//?
FastestDogInTheDistrict Posted June 5, 2013 Posted June 5, 2013 Ah! Was editing while you replied, sorry!!! I think I fixed it (I hope) - read above. I hope I haven't buggered it this time!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.