Duchess_Gummybuns Posted March 15, 2016 Posted March 15, 2016 Can anyone tell me how SOS' underwear scales bulge size to relative penis size and help me implement that functionality into new clothing? I know it has something to do with being scaled to a bone, but I have no idea where to start when adding it to new items.
Garruk Posted March 15, 2016 Posted March 15, 2016 i wish i could separate the underwear bulge from the actual schlong size, it annoys me how much smaller the bulge seems when using underwear,
PaulGreen Posted March 17, 2016 Posted March 17, 2016 It is in the mesh vertex weights. The concept is related to how 3D character modelling works in general. A model consists generally of a mesh and a rigging (skeleton). The mesh is the actual collections of vertex points in 3D space, and a set of data describing how to connect them to form "faces". The rigging consists of a set of points in space that represent "bones". These points in space are connect in a hierarchy. So, for instance, give a point in space and label it the "pelvis", then give another 3D coordinate and label it the "R Thigh", then give another point in space and label it the "R Calf". You connect the R Calf point as a child object of the R Thigh point which in turn is a child of the Pelvis point. If you then move or rotate the "Pelvis" point, both the R Thigh and R Calf move/rotate with it since they are "child" points. Mesh Vertex Points: Mesh Faces and Edges: Skeleton rig for SoS body: What you do is take this rigging heirarchy (the skeleton) and create a set of data that ties vertices in that model mesh to the bones in the skeleton. So, if you have a mesh that looks like a person, you would select all of the vertex coordinates around the pelvis area and 'attach' them to the bone called "pelvis" in the rig. Then, by moving/rotating the skeleton points, any mesh vertex points that have been attached to that bone or any of it's children (which would move with the parent bone) will be moved along with the skeleton. SoS Body with Skeleton: SoS Body showing Pelvis vertex group (vertices attached to the "pelvis" bone): This is how animations are done. You don't take a 3D mesh and describe 3D position changes of the vertices in the mesh. Instead you attach all of the vertex points of the mesh to these bones, then you simply rotate/move those bones to animate the mesh. The animations are then stored as "rotations/translations over time" of these bones and the mesh is animated accordingly. The extra piece of information is that, when you attach a mesh vertex point to a bone, you can also describe a "weight". A weight of 0.0 means that, even though that vertex is "attached" to a particular bone, it will not move when the bone moves. A weight of 1.0 means that the mesh vertex will move exactly as the bone moves.. if the bone translates by 3.5 units, the mesh vertex will translate by 3.5 units. A weight of 0.5 means that the mesh vertex will move %50 of the magnitude of a bone's momvement. So, that mesh vertex would only move 1.75 units when the bone moves 3.5 units. Doing a smooth weighting gradient on all of the mesh vertices around a bone allows a more natural look of the movement. The mesh surface "stretches" a bit as rotations or movements occur. SoS Body meshe showing Pelvis bone weighting. Blue = no weight Light blue ---> Green ---> Red indicates increasing weight. Bright red is 1.0 weight In Skyrim, all of the pieces of clothing have the character body "bones" referenced inside their data files, and the vertices of the armor itself are weighted in a similar (nearly identical) way to the bare body. That way, when the character moves its leg (R Thigh, R Calf, R Foot, R Toes...), the armor's mesh will deform in a very similar way. Most armors do not reference the "genital" bones addded by SoS in anyway (certainly not armors that came with the game, heh). What needs to happen, basically, is that any given piece of armor will need to have the "GenitalBase [GenBase]" bone added to it's .nif data file, and then the appropriate vertices within the mesh of the armor attached and weighted to that bone. Doing this means that any scaling of the GenBase bone will cause the vertices to move "away" from the bone's position as the bone scale goes up. SoS Underwear model: SoS Underwear showing the GenBase bone weight that pushes out the "bulge" with increasing bone scale: To actually accomplish this... I'm not entirely sure the easiest way >.> I'd just use Blender, but I think Bodyslide and other programs are easier to use to do it. If you actually want try, I can look it up.
Duchess_Gummybuns Posted March 18, 2016 Author Posted March 18, 2016 It is in the mesh vertex weights. The concept is related to how 3D character modelling works in general. A model consists generally of a mesh and a rigging (skeleton). The mesh is the actual collections of vertex points in 3D space, and a set of data describing how to connect them to form "faces". The rigging consists of a set of points in space that represent "bones". These points in space are connect in a hierarchy. So, for instance, give a point in space and label it the "pelvis", then give another 3D coordinate and label it the "R Thigh", then give another point in space and label it the "R Calf". You connect the R Calf point as a child object of the R Thigh point which in turn is a child of the Pelvis point. If you then move or rotate the "Pelvis" point, both the R Thigh and R Calf move/rotate with it since they are "child" points. Mesh Vertex Points: vertices.jpg Mesh Faces and Edges: facesAndEdges.jpg Skeleton rig for SoS body: skeleton.jpg What you do is take this rigging heirarchy (the skeleton) and create a set of data that ties vertices in that model mesh to the bones in the skeleton. So, if you have a mesh that looks like a person, you would select all of the vertex coordinates around the pelvis area and 'attach' them to the bone called "pelvis" in the rig. Then, by moving/rotating the skeleton points, any mesh vertex points that have been attached to that bone or any of it's children (which would move with the parent bone) will be moved along with the skeleton. SoS Body with Skeleton: MeshAndSkeleton.jpg SoS Body showing Pelvis vertex group (vertices attached to the "pelvis" bone): PelvisVertexGroup.jpg This is how animations are done. You don't take a 3D mesh and describe 3D position changes of the vertices in the mesh. Instead you attach all of the vertex points of the mesh to these bones, then you simply rotate/move those bones to animate the mesh. The animations are then stored as "rotations/translations over time" of these bones and the mesh is animated accordingly. The extra piece of information is that, when you attach a mesh vertex point to a bone, you can also describe a "weight". A weight of 0.0 means that, even though that vertex is "attached" to a particular bone, it will not move when the bone moves. A weight of 1.0 means that the mesh vertex will move exactly as the bone moves.. if the bone translates by 3.5 units, the mesh vertex will translate by 3.5 units. A weight of 0.5 means that the mesh vertex will move %50 of the magnitude of a bone's momvement. So, that mesh vertex would only move 1.75 units when the bone moves 3.5 units. Doing a smooth weighting gradient on all of the mesh vertices around a bone allows a more natural look of the movement. The mesh surface "stretches" a bit as rotations or movements occur. SoS Body meshe showing Pelvis bone weighting. Blue = no weight Light blue ---> Green ---> Red indicates increasing weight. Bright red is 1.0 weight PelvisWeight.jpg In Skyrim, all of the pieces of clothing have the character body "bones" referenced inside their data files, and the vertices of the armor itself are weighted in a similar (nearly identical) way to the bare body. That way, when the character moves its leg (R Thigh, R Calf, R Foot, R Toes...), the armor's mesh will deform in a very similar way. Most armors do not reference the "genital" bones addded by SoS in anyway (certainly not armors that came with the game, heh). What needs to happen, basically, is that any given piece of armor will need to have the "GenitalBase [GenBase]" bone added to it's .nif data file, and then the appropriate vertices within the mesh of the armor attached and weighted to that bone. Doing this means that any scaling of the GenBase bone will cause the vertices to move "away" from the bone's position as the bone scale goes up. SoS Underwear model: SoSunderwear.jpg SoS Underwear showing the GenBase bone weight that pushes out the "bulge" with increasing bone scale: SoSUnderwearGenBaseWeight.jpg To actually accomplish this... I'm not entirely sure the easiest way >.> I'd just use Blender, but I think Bodyslide and other programs are easier to use to do it. If you actually want try, I can look it up. What a great explanation, man! Perfect! Thank you. It covered a lot that I knew, but it reinforced what I was unclear about. Thank you. Truly, thank you. I use 3dsmax but I would prefer to do it bodyslide if possible. I'm going to thinker, but if you find a guide, that would be killer. ^~^ Weight painted to NPC GenBase, but the effect is barely noticeable and only pulls straight down
rhody01 Posted March 18, 2016 Posted March 18, 2016 I'll second the thanks on this great walkthrough. I know it takes a lot of time to invest in creating these types of explanations so a BIG thanks. I was gonna suggest just weighting the brief to the bones in Bodyslide but I didn't want to spread misinformation. I was tinkering with this when trying to add hdt to a piece of jewelry and was playing with the weighting in that. Would the axis of the deform be controlled in the nif? or is it the way its painted? Like Duchess stated, the mesh stretched down instead of out.
PaulGreen Posted March 18, 2016 Posted March 18, 2016 The original placement of the vertices in the mesh is the determinant. When you scale a bone, a vertex's movement direction is based off of its original displacement from that bone. Imagine a straight line starting at the bone position and going out to the vertex point. When you scale, the vertex will continue moving along that line, either toward the bone when scaling down ( <1.0 scale ) or away from the bone if scaling up ( > 1.0 ). If the mesh of the armor is not placed well, the scaling alone will not look good. If the part of the mesh weight-painted to the GenBase bone is mostly "directly below" the bone, then the scaling would push those vertices "mostly downward" from the bone. The SoS underwear works because the part of the mesh weight-painted to the Genbase bone is sort of "in front and slightly below" the bone. Scaling then pushes those vertices "out and slightly down" To fix it, I'm not sure the best way.. There might be little ways to cheat and make it work, and I can think of a few things, but I don't actually know if they work. I'll look at it soon, day or two.
PaulGreen Posted March 22, 2016 Posted March 22, 2016 I think there is a way to 'cheat' and do it. For a piece of armor where the position of the genbase bone is not ideal for doing this, you can basically 'move' the bone on equip using nioverride (in Racemenu). This adds a racemenu dependency on your armor, though. Per racemen instructions, add a NiStringExtraData named "SDTA" under the trishape and make the string something like below. This will automatically move that bone to the specified position ( and/or scale and rotation if you put those in) every time the armor is equipped. [{"name":"NPC GenitalsBase [GenBase],"pos":[1.0,0,1.5]}] The trick is that moving the bone affects the mesh. There is no way to move the bone without also causing the mesh to deform. instead you can move the bone, reset the "rest" position so that the mesh treats the new position as the bind pose (the mesh is not deformed), weight the mesh appropriately, then reverse the bone move allowing the mesh to deform. Then, apply the deformation to the mesh itself. The idea is that, at rest, the armor looks screwed up, but when you do the on-equip bone reposition in the game, the mesh will deform to the "right" position and any scaling then works as it did when weight painting in the adjusted bone position... For some reason, I'm am feeling like I want attention.. therefore, I can attempt to gain some attention by demonstrating how to do this in a video or something if you want, heh. I dunno where to upload, though. Does youtube allow rated R to X stuff?
Duchess_Gummybuns Posted March 24, 2016 Author Posted March 24, 2016 I think there is a way to 'cheat' and do it. For a piece of armor where the position of the genbase bone is not ideal for doing this, you can basically 'move' the bone on equip using nioverride (in Racemenu). This adds a racemenu dependency on your armor, though. Per racemen instructions, add a NiStringExtraData named "SDTA" under the trishape and make the string something like below. This will automatically move that bone to the specified position ( and/or scale and rotation if you put those in) every time the armor is equipped. [ {"name":"NPC GenitalsBase [GenBase],"pos":[1.0,0,1.5]} ] The trick is that moving the bone affects the mesh. There is no way to move the bone without also causing the mesh to deform. instead you can move the bone, reset the "rest" position so that the mesh treats the new position as the bind pose (the mesh is not deformed), weight the mesh appropriately, then reverse the bone move allowing the mesh to deform. Then, apply the deformation to the mesh itself. The idea is that, at rest, the armor looks screwed up, but when you do the on-equip bone reposition in the game, the mesh will deform to the "right" position and any scaling then works as it did when weight painting in the adjusted bone position... For some reason, I'm am feeling like I want attention.. therefore, I can attempt to gain some attention by demonstrating how to do this in a video or something if you want, heh. I dunno where to upload, though. Does youtube allow rated R to X stuff? That sounds good. I'll tinker with it. A video would be nice, but unfortunately I cannot clear the understanding on Youtubes stuff. You'll be in the clear if you put a little blur over things like nipples, but, at the same time, I watch a Youtube tutorial series that doesn't blur 3ds max rendered nips.
Duchess_Gummybuns Posted April 7, 2016 Author Posted April 7, 2016 Did you ever figure this out? No. I got bumped up to full time and my computer took a dive, so my little spare time has been eaten up pretty completely. It's high on my to do list, right after I get my new rig set up.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.