samfred2 commited on
Commit
215ef12
·
verified ·
1 Parent(s): 10f929c

Add transcription for: frames/MDA_TheSymbioteCreature_DownloadPirate.com_SYMBIOTE_CH008_VELLUM_LEGS_ATTACHMENT_1080p_mp4_frames.zip

Browse files
transcriptions/frames/MDA_TheSymbioteCreature_DownloadPirate.com_SYMBIOTE_CH008_VELLUM_LEGS_ATTACHMENT_1080p_mp4_frames_transcription.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "text": " So in this chapter we'll continue digging into the vellum solver, adding other microsolvers that will define our movement and we were left at the sub-solver. The last thing we did was transferring the attributes, the main attributes, the CDN-CDR, which are controlling the activation of the legs and the attachment detachment of our tentacles. Arms legs tentacles I mean it's the same thing in this case. So we moved our attribute VOP from the subs to the dubs inside this subsolver and yeah we have this FRC attribute as a debugging tool so we can display it see what happens with the forces it will it simulates at least one frame. So we'll be continuing here, working on the tentacle attachment to the ground. So let's see how we can do this. So we'll be creating a valent constraints, Microsoft, and I'll add merge here. We can connect them in parallel or in series, but I prefer to use a merge for this. So we're going to evaluate evaluate from left to right in parallel. So we're gonna name this Valem Attach, CSDR, and we're gonna change to the creation of the constraints of each frame. We're gonna choose the, oh yeah, I forgot something. We have to create a group. So yeah, we're going to use points, where we'll use GRT tips attach as a group that will attach itself to our ground. And then we're gonna change the type of constraints to attach to geometry. So we're not gonna change any master thickness here. We'll leave primitives as a target group and we'll go into the speaker and choose the, choose the ground force, out ground force, so this is going to be our ground. The group which is GRP tips attached is going to attach to the ground once it's close enough. And I'm going to set the max distance here to 0.03. Once the tips get close to this ground and the distance between them is lower than this, it's going to attach itself to the ground. as we create permanent constraints, depending on what you're doing afterwards with them. And for the stiffness, I'm gonna really set the stiffness to like, maximum that I can do here. Depending on the sub steps of your simulation, it's either going to satisfy or not. But I think with the current settings, this is really a lot. And I don't think this kind of stiffness will be satisfied with those sub steps, which means that the real stiffness of those constraints is gonna be lower than this. And for the damping ratio, we're gonna set here 0.01, 10-fold, and the rest scale to 0.03. I really wanna have really tight constraints here. So the rest of the scale is gonna shrink the size of those constraints to 30% of its original size. So if the constraint is like one centimeter or like one meter, let's say, it's gonna go to 30 centimeters or 0.03 centimeters respectively. So yeah, we're gonna leave this everything like this And for the output group, I prefer to really explicitly set the name of the constraints. CSTR, that's attached. I really like to have everything neatly grouped and packed and cleaned and organized because organizing your scenes, this is really critical, especially when you work in teams and you pass your stuff around to other people. Yeah, so we'll keep it really clean this time. So yeah, this is going to be the attachment constraint. So let's check if it works or not. We're going to evaluate a few frames. Let's play this back and see if it works. So we see the vectors that are activating, but they are not doing anything with the arms yet. Yeah, so it starts to move. And once the tips, they just get close to the ground, you'll see that there's gonna be something happening here. I'll evaluate a few frames and come back. So we see that something's happening there. I'm gonna disable the visualization of this FRC debugging attribute and I'll come back to the vellum node and go into the visualize and check attach to geometry. It'll display the attachment constraints. So as you can see, there's attachment constraints all the three arms and yeah we're I'm gonna decrease the size so it doesn't really so as you can see they they have they have a line between this is the primitive that defines the connection between the two points the points that are found on the ground and the points that are on the creature maybe the the the rest land scale was a little bit too much because it really tries to push the constraints to shrink them really tightly in size and maybe it puts a lot of strain on the polygons and tetrahedrons and may create interpenetrations between the monster body and the ground. I'll set it to 0.6 for now. So now we have the constraints that attach themselves to the ground. But now we have to think about detaching them once there's a force applied to this leg. So let's say the monster is like this and you have one arm like this and there's attachment constraints that are here attached to the ground. So basically the arm is attached to the ground. Once the arm becomes white, the tip of the arm becomes white, there's this force that be talked about and supplied in a diagonal manner. So it has to go into this direction. So let's say you have this direction that is defined by the two vectors, the forward and the normal vector. But we have the attachment constraints that are really holding the arm down. And we want to cut to make them disappear at this moment in time. When the tip becomes white, I really want to kill these constraints off so they don't hold the arm stuck to the ground. So in order to do this, we have to tell the constraints that we don't need them anymore when the tips become white. So this is why we have the CD attribute also so we can really disconnect and kill off these primitives, these connection primitives in order to release the arm. So how do we do this? it will require a little bit of VEX. So we're gonna create a well-enhanced constraint properties. So this is another Microsoft which is amazing and it can control stuff using VEX. So we're gonna check this checkbox, the group checkbox and the use VEX expression. We're gonna choose the CSTR, we use this one, CSTR that's attached. Because we're on the first frame, we don't see this group in the list. So you see there's no CSTR that's attached here because the group will be created once there's at least one primitive created by this Microsoft. Because we're above the ground and the tips they don't even touch the ground. There's no primitive created, there's no attachments created, so there's no group like this created. So feel free to just copy the name of this output group and put it here, because we're gonna process only these constraints. I really don't want to touch anything else except this group. I want to kill these specific constraints when our CD, our color, becomes bigger than zero. So basically any component of our CD becomes higher than zero then we kill off these constraints. So in order to do this we have to check the remove checkbox. This is a dummy parameter so we have to connect any some code to it because it's called remove. So you'll see how we use this. In order to get our attribute, the cdc attribute is a it's a point attribute. So in some way we have to tell the primitives which are connected to those points to listen to follow what's happening with the point attribute. So let's create a list of points which are connected to these attachment constraints. So in pts, so we're creating an array of points which are connected to these primitives and and the syntax is this. So basically we're creating an array, print points it's called, the function, and then we're checking if the length of this array is zero, then nothing happens. And then, and then we're gonna loop through those through that array, find each point in that array for each int Pt. So we're creating another variable which is called Pt in the array Pts and we're opening a bracket. I'm gonna sample the color, vector color, and it's gonna be point attribute which is CD. With the index, the Pt instead of the Pt num, we're using the Pt. This way we're basically cycling through all the points that are connected to our attachment constraints primitives and checking the color. So once the color is higher than zero, we're activating this dummy attribute, which is called remove. So this remove attribute is going to be a Boolean which is the result of this condition. So if our color, if the color of the point which is connected to this attachment constraint is above zero, the remove is activated. so it becomes one. So any constraint, attachment constraint that is connected to a point that has a color like this higher than zero, it's gonna be killed off. So we're really physically removing this primitive, this constraint from the simulation safely. Sometimes you can really remove some primitives in a really not safe manner, and it's gonna be, it will give you an unstable simulation. So to just go through this code again, we're basically creating a point array, which is an array made of points connected to these attachment constraints. We're checking if the length of this array, which is the amount of points, if it's equal to 0, it just does nothing. And we are doing a forEach loop, which cycles through this array. And for each point in that array, we're checking the color. So if the color is zero, it's bigger than zero, the remove dummy parameter is gonna be activated. So this is how you use the remove. Same with the broken here. You're using like a condition. So it equals to a condition all the time. So it must be equal to a condition, which yields you like a zero, one or whatever. But usually these two are Boolean parameters. They require like either zero or one, because it's like nothing in between is gonna work. 0.5 is not going to remove the... I mean, I didn't try it, but it might not work, so you need 0 or 1. So, yeah, this is where we... so let me push this back to the brackets. So now we have this code, and let's see if it works. I'm going to evaluate a few frames, can't come back. So, if we scroll through, we'll see that we have the attachment constraints here, and if I go frame by frame here. Once it turns white, you see that the tips are black here and they stay still. But once this one turns white, as you can see the constraints are removed. We're going to go into wireframe. You see there's a blue, let me color them red for example. So once the color turns white, they're gone. There's nothing here like the constraints are gone and the attachment is gone. So this is how you create and remove attachment constraints. So any kind of constraints, it doesn't matter. You do it safely through this VELON constraint property. So we're gonna rename this. Animate. Yeah, so now we have the attachment set and we're going to work on the arms contraction. arms contraction. So once we have the arms attached to the ground, we need the arms to contract. So the color on the arms, you see the white and black on the arms, on this part of the arm, this is going to control the contraction of our arm. So in order to do this, we're gonna make another Microsoft and we're gonna copy the best previous well constraint property we're gonna name it vellum animate contract and let's put it here and the vellum animate contract is going to control our that fibers so remove the CSTR we're gonna find the that fibers constraints here because they're already created earlier before we set we'll lay down the volume solver, so CSTR-tets-fibers. We're gonna use the same code that we used before, but also, yeah, we're not gonna remove any constraints here, so we're gonna uncheck this. I'm gonna remove this also, the remove dummy parameter, but yeah, we're gonna set the stiffness here, because the stiffness, if you remember well, in the fibers constraints, we set our out to the group to see how that's fibers and we set the stiffness to zero. So nothing happens with the dead fibers. So let's set the stiffness here to zero also and this value is going to be replaced by this VEX code. We're going to tell it to, we're going to set this stiffness if you see parameters stiffness in the explanation box. It's called stiffness. So we're going to override this value with something in VEX. So we have the same code that previously used in the attachment constraint, uh, uh, Microsoft, and, uh, I'm going to set the stiffness as a, uh, fit color X. So we're going to take the X component, the red channel of the color, and because it's a, from, it's a value between zero and one, we're going to fit it, uh, we're going to take the initial values, like the old minimum and old maximum are going to be zero and one, and the stiffness is going going to go from 0 to 1000. So which means that the stiffness parameter is going to be replaced by either with a value between 0 and 1000, depending on the color that is blinking here. So if it's black, the value is still going to be 0. If it's white, the value is going to be 1000. So it means it's going to contract. And if it's gray, it's going to be 500. So it's gradual contraction and gradual release, gradual expansion of the muscle. So it's a basic contraction and release animation. We're using only the TETS fibers. And you'll see I'm going to play back a few frames, and you'll see what it does. And then we're going to fix the issues that come with it, because there's going to be issues. See in a second. So as you can see, it already starts to move. And the middle arm is thicker. So there's more tetrahedrons there, and there's more weight. So it pulls more forward. So the other two arms are a little bit thinner. There's less compression going on there. But as you can see, it moves the body forward. So this is great. We're on the right track. So we already moved, like, worked on this. Oh, the other thing we didn't consider is the movement kind of deforms and changes the shape of the arms. So if we check the deer arm attribute along which the fiber constraints are contracting. You'll see that, let's see. You see that it's kind of messed up because it keeps the same direction. I wanted the deer arm attribute to follow the deformation of this tetrahedral mesh. So I want to compress this mesh in this direction, but the vector is not updating at this time. So it still keeps the same direction that we had the initiative. This is a problem. So I really want this to follow along the deformation of our mesh. So in order to do this, I will be pasting a code. I'm not gonna retype it again because it's quite a lot of code. So it's a code that I borrowed from some example files from SideFX, but I modified it just for my specific needs. We'll create a geometry wrangle where we're gonna paste this code and you'll see what it does. Geometry wrangle. So this geometry wrangler, I'm gonna put it after the sub-solver, and this is the order I prefer, usually. I didn't commit it properly, so it goes into the merge. And now we're gonna move this here in the middle. The geometry wrangle is going to contain quite a bit of code, so I'm going to paste the code. I mean, it's not a lot, but it's... I'll explain what this code does. And then we're gonna type the other two lines manually. So it's pretty much the same. So we're defining a, first of all, we're including a PBD constraints library from Houdini's repo, basically from Houdini's folder. There's like a library, which is called PBD constraints.h, and it contains some functions like is that a wrap? So it's a check that does the checking for the type of constraints, which is a, as rigid as possible, a tetrahedral constraint. So we're basically looping through all the primitives that belong to each point of this geometry. And we're checking if the constraints between those primitives, between those points and primitives are, as rigid as possible, our tetrahedral constraints. And we're basically applying, because we initialize the value that's called that here, which is a minus one, which basically shows that there's no, it's a primitive that doesn't exist. And once we check that it's a tetrahedral constraint of the type as rigid as possible, like we have here, which is, you see, a nonlinear A or A wrap. So once the condition is satisfied, we apply this primitive number to the tet variable. to the that variable. So now we're checking the, yeah, if the that is lower than zero, which is minus one, it means it doesn't do anything. But if it does, it's going to continue with this code. So the code will be, we're going to read in our quaternion attribute, which is an orientation attribute for each petrochial primitive in the geometry. So let's write it down. So we're reading in from the second input of our geometry, and we're going to change this because we need to, I'll show you how. We're reading a quaternion attribute, which is called the rest vector, and instead of the primitive number we're using the tet that we clearly checked in this whole each for each loop that it's a tetrahedral constraint of the type as rigid as possible. We're reading its rest vector so we're going to use this rest vector in order to rotate our our deer arm attribute and apply it to the material w. In the previous simulation that I've made the preview for in this simulation, we have a default material w attribute that apparently is in the right direction, but we're gonna modify it so it fits, so it follows our deformed their arm attribute. So in order to do this we're going back to our geometry wrangle and also in the inputs because you see we're basically initializing this from the first input, but the first input is nothing, there's nothing here. So we're going to type in a dot data in the second input here and the dot data is going to be like this object ID constraints constraint geometry. So basically we're reading in a primitive attribute called rest vector. As you saw before I connected the null to this primitive constraint geometry like output and this constraint geometry output contains all the all the constraints that are created by vellum. So this is why when you right-click and go into the spreadsheet you see a lot of these are all primitive attributes and yeah, also you see you can see the type of the constraint is that a wrap here, so the first part of the code checks if this type of constraints. So we have the rest vector. So this is what we're reading in into the simulation directly and also Yeah, we're going to create a vMaterialW attribute and and it's going to be a qRotate, what? vdirarm. So what we're doing here, we're rotating this vector, like if you type qRotate, you rotate a vector by a coternian. We have a vector which is dirarm, which is the red one on the screen, and we're having the coternian, which is the rest orientation of our tetrahedron. So this is how we rotate this vector. We're rotating the deer arm by the quaternion that we pulled from the first input, which is a primitive attribute. So that's it. And also, yeah, I want to normalize this whole thing because I really don't want any magnitudes going crazy there. Oh, yeah, so that's cool. Now this material w attribute is going to be read by the tetfiber, by the vellum animate contract, and by the vellum fibers. Because the vellum fibers, this is what they use as a vector for contracting the arms. So let's see if it works, because this is interesting. Once the monster is going to fall down, you'll see that the red attribute, like the red vector lines, will be deforming along the... oh yeah, they will not be... wait just a second, because we're not displaying the modified... the deer arm attribute is gonna stay the same, but we're also going to display the material w, and we go here, press here, material w, we're gonna color it, I'm gonna be a vector trail, I'm going to color it as a green vector, let's say this, and it's not created yet because we didn't evaluate anything. Oh yeah, so now it's created. Let's decrease this. 0, 3 for example. So you now, you'll see that the vector is going to appear, the material w. And you'll see that it moves compared to the red one. So the green one deforms with the arms. Once there's deformation in the mesh, the rest vector of the the Trohedron is changing, so the rest vector will be rotating their arm attribute and right again inside the, into the material W. So it's a container for rotated their arm. So as you can see, there's a big difference between the two vectors. One doesn't move and the other one follows the deformations. I'm going to disable the red one so we're not bothered by the visually by this and as you can see once there's deformation it just follows deformation. The best example is this. Let's decrease the length of this vector. As you can see there's deformation here and it rotates along the arm. This is great, this is what we need. But keep in mind that this material W vector is going to be used only on this section of the arm because we're only deforming, contracting the fiber constraints which are applied only on the arms. So this is done. Let's name this a line material W, this is critical because we want this to work properly, independent of how twisted the arms are. So I want it to contract along the arms. So we have the attachment constraints, their creation, their destruction, we have the contraction of the legs, we have the alignment of the the arm along the rest vector, which is written finally into the material W, which is an internal attribute used by Valem. And yeah, we have the forces applied to our creature. Now let's think about the tail. As you remember we created a tail group which is a group I wanted to pin down to the ground so it slides. In order to do this we're going to create another vellum constraint node and yeah so let's call it Valem, attach, tail. So this is going to be a permanent attribute and I'm going to create it, let's say, in each frame, but I want it to be created after the frame 5 because, yeah, where I let it fall down properly on the ground and then I'm going to create... I usually use this condition often when the initial... I do the initial setup of the monster. I just let it fall first and then I create constraints after like frame 10, 15, depends. But here I'm going to set it to It's going to be attached to geometry constraint, a point group and tail ends, and we're going to attach it to the ground force. Also we'll use a 001 distance threshold, so anything with a distance less than 001 to the ground is going to attach itself to the ground. The sliding rate, this is the interesting part. The sliding rate is a great parameter and it can be controlled with any like well-constrained properties with Vex, with anything you want, that she builds. And when it's set to one, it means that the constraints are sliding freely along the surface. They do not detach, they just slide along. They don't, they're always there. So it's a great thing to make objects that are kind of sliding on slippery surfaces and they're still holding on onto it. But I'm going to set it to 0.5, which means there's going to be some friction there. The constraints will be created after the frame five. There's going to be sliding, which is 50% sliding, 50% friction. It can be really scaled by attributes and anything else, anything you can think of. There's some great, really great examples of the sliding rate in the help file of the... So yeah, you can check it out if you want. Just type in sliding rate and you'll find the example files. So as for the stiffness, it's not going to be really stiff. It's going to be kind of a loose constraint. The stiffness defines how strongly the constraint resists to elongation or deformation. And so if someone pulls the constraint really hard, how is it going to react? Is it going to be stretching or is it going to be resisting a lot and not stretching at all or just stretching slightly? So as for the other nodes, I'm really using higher damping ratio than the default. 0, 0, 0, 1 is not enough for me. So 0, 0, 1 is great. And we're going to write these constraints into a group, which is called CSTRTestPaleApatch. So we can identify this group if we need to. And this looks great. Let's see if it works. I'm going to disable the other nodes for now. And let's check if it works. So yeah. Let's wait for the frame 5 and see if the tail attaches. As you can see, we can really build a huge complicated system here with the microsolvers and you can either use external attributes, internal attributes that you create here or you can really make it big. But I prefer to work on one single element at a time because you have to see if the data circulates properly and yeah Houdini is great at this. It's a really good system where data flows, it's like piping and you have liquids in those pipes and you have to follow if the water gets to where it's supposed to get. So as you can see we have the attachment constraints of the tail. They're gonna be sliding once the creature starts pulling into the desired direction. We're going to leave it as is and disable it and we're gonna work on the bubbles next. So this is the last Microsoft and it's going to be a vellum constraint and we're gonna actually duplicate this one because it already has the code in it and this is great. Enable it, I'm going to call it Bellum bubbles and remove this group and we're going to check the bubbles. This is our group and what we're going to modify here is going to be a little bit different than the other ones. We're going to check if, oh actually now the the bubbles are a point group, I don't want to use it. What I want to change the rest land of is the tetrachet. So we're going to inflate the tetrahedral stretch constraints, which are hiding underneath the skin. But I want to filter only tetrahedrons that belong to this bubbles group. So let's see if it works directly with the... What I want to check is make a blast node here. Let's see if we have the group propagated. Buddy, bubbles. Also the bubbles are tetrahedron. So we can do it in two ways. So this works. We have the bubbles as a group that contains the tetrahedrons. So in the bubbles, let's do directly the bubbles, bubbles, grp bubbles, and see if it works because I'm not sure it's gonna work, but I'm gonna remove this and we'll come back if it's, so we're reading in the color again. As you can see, when we read from the first input, it's always reading the geometry and not the constraints. So it's reading the geometry, we're actually reading a point attributes from the geometry of the object. So this string here is like in the geometry wrangle we did before. Here I put constraint geometry because we're reading in the constraint geometry, not the geometry itself, we're reading the constraints. But here we're reading the geometry. So there's two contexts, either it's geometry or constraint geometry. It's the live geometry or the live constraints from the simulation. So yeah, we're basically, yeah, we're gonna uncheck the remove because we want to change the rest scale. we're gonna leave it at one and read in the color. So same as for the other attributes, same as for the other building constraint properties. We're going to read in our color. So we read in the color from the points and we're going to remap it and apply it to the rest scale. So whenever you wanna override any of these values, you just point your cursor onto the property you want to change and you see that the parameter is named RESTScale. So we type in RESTScale and we fit the color X. The initial values are 0 to 1 and the output values will be 1 to 4. So this is just for your, let's make a channel here, max inflate. Press this button and it's going to create a max inflate. Let's set it to 4. So what it's going to do, anytime a bubble changes color, its value, or the value of the color, or the x component of the color, which is red channel, is going mapped to one between one and four because this is like if it's zero if it's black the rest scale doesn't change if it's white the max inflation will be four so this is what the rest length scale does it just scales the rest lengths of your constraints so compared to the rest length parameter which is above the first one this one just defines explicitly what rest length you want to have at the end. So it's also measured in real world values, real world scale, centimeters, millimeters. So if you want to change this value you can do it explicitly. So now let's check if it works. Also let's check it first and then we'll see if it... So, as I thought, what it does here is just a point group. It doesn't contain any primitive groups because the list here is usually the list of all the groups, including the point groups, primitive groups. So let's reset this. And then we go back and we see all the groups. This includes primitive groups that we created when we did all these well constrained properties nodes. So instead of this, we're going to target that stretch group which contains all the tetrahedral constraints in the object. We're going to make a small condition here if endpoint group 1 EGRP bubbles. So if the drag-and-drop constraints are related in any way to the bubbles, we're going to see the calculate the spectra, which is reading in the color of the... So, another set of brackets. And now it should work. Let's see. You'll see a sudden inflation of some of those bubbles. So the inflate, inflate depending on the color. So let's do the max inflate something like 3. And now we're gonna enable all of these nodes and just simulate the entire thing, see how it works and if it works. We'll come back in the next lesson. See if everything is working properly and if not we'll fix that. See you in the next one.",
3
+ "segments": [
4
+ {
5
+ "text": " So in this chapter we'll continue digging into the vellum solver, adding other microsolvers that will define our movement and we were left at the sub-solver. The last thing we did was transferring the attributes, the main attributes, the CDN-CDR, which are controlling the activation of the legs and the attachment detachment of our tentacles. Arms legs tentacles I mean it's the same thing in this case. So we moved our attribute VOP from the subs to the dubs inside this subsolver and yeah we have this FRC attribute as a debugging tool so we can display it see what happens with the forces it will it simulates at least one frame. So we'll be continuing here, working on the tentacle attachment to the ground. So let's see how we can do this. So we'll be creating a valent constraints, Microsoft, and I'll add merge here. We can connect them in parallel or in series, but I prefer to use a merge for this. So we're going to evaluate evaluate from left to right in parallel. So we're gonna name this Valem Attach, CSDR, and we're gonna change to the creation of the constraints of each frame. We're gonna choose the, oh yeah, I forgot something. We have to create a group. So yeah, we're going to use points, where we'll use GRT tips attach as a group that will attach itself to our ground. And then we're gonna change the type of constraints to attach to geometry. So we're not gonna change any master thickness here. We'll leave primitives as a target group and we'll go into the speaker and choose the, choose the ground force, out ground force, so this is going to be our ground. The group which is GRP tips attached is going to attach to the ground once it's close enough. And I'm going to set the max distance here to 0.03. Once the tips get close to this ground and the distance between them is lower than this, it's going to attach itself to the ground. as we create permanent constraints, depending on what you're doing afterwards with them. And for the stiffness, I'm gonna really set the stiffness to like, maximum that I can do here. Depending on the sub steps of your simulation, it's either going to satisfy or not. But I think with the current settings, this is really a lot. And I don't think this kind of stiffness will be satisfied with those sub steps, which means that the real stiffness of those constraints is gonna be lower than this. And for the damping ratio, we're gonna set here 0.01, 10-fold, and the rest scale to 0.03. I really wanna have really tight constraints here. So the rest of the scale is gonna shrink the size of those constraints to 30% of its original size. So if the constraint is like one centimeter or like one meter, let's say, it's gonna go to 30 centimeters or 0.03 centimeters respectively. So yeah, we're gonna leave this everything like this And for the output group, I prefer to really explicitly set the name of the constraints. CSTR, that's attached. I really like to have everything neatly grouped and packed and cleaned and organized because organizing your scenes, this is really critical, especially when you work in teams and you pass your stuff around to other people. Yeah, so we'll keep it really clean this time. So yeah, this is going to be the attachment constraint. So let's check if it works or not. We're going to evaluate a few frames. Let's play this back and see if it works. So we see the vectors that are activating, but they are not doing anything with the arms yet. Yeah, so it starts to move. And once the tips, they just get close to the ground, you'll see that there's gonna be something happening here. I'll evaluate a few frames and come back. So we see that something's happening there. I'm gonna disable the visualization of this FRC debugging attribute and I'll come back to the vellum node and go into the visualize and check attach to geometry. It'll display the attachment constraints. So as you can see, there's attachment constraints all the three arms and yeah we're I'm gonna decrease the size so it doesn't really so as you can see they they have they have a line between this is the primitive that defines the connection between the two points the points that are found on the ground and the points that are on the creature maybe the the the rest land scale was a little bit too much because it really tries to push the constraints to shrink them really tightly in size and maybe it puts a lot of strain on the polygons and tetrahedrons and may create interpenetrations between the monster body and the ground. I'll set it to 0.6 for now. So now we have the constraints that attach themselves to the ground. But now we have to think about detaching them once there's a force applied to this leg. So let's say the monster is like this and you have one arm like this and there's attachment constraints that are here attached to the ground. So basically the arm is attached to the ground. Once the arm becomes white, the tip of the arm becomes white, there's this force that be talked about and supplied in a diagonal manner. So it has to go into this direction. So let's say you have this direction that is defined by the two vectors, the forward and the normal vector. But we have the attachment constraints that are really holding the arm down. And we want to cut to make them disappear at this moment in time. When the tip becomes white, I really want to kill these constraints off so they don't hold the arm stuck to the ground. So in order to do this, we have to tell the constraints that we don't need them anymore when the tips become white. So this is why we have the CD attribute also so we can really disconnect and kill off these primitives, these connection primitives in order to release the arm. So how do we do this? it will require a little bit of VEX. So we're gonna create a well-enhanced constraint properties. So this is another Microsoft which is amazing and it can control stuff using VEX. So we're gonna check this checkbox, the group checkbox and the use VEX expression. We're gonna choose the CSTR, we use this one, CSTR that's attached. Because we're on the first frame, we don't see this group in the list. So you see there's no CSTR that's attached here because the group will be created once there's at least one primitive created by this Microsoft. Because we're above the ground and the tips they don't even touch the ground. There's no primitive created, there's no attachments created, so there's no group like this created. So feel free to just copy the name of this output group and put it here, because we're gonna process only these constraints. I really don't want to touch anything else except this group. I want to kill these specific constraints when our CD, our color, becomes bigger than zero. So basically any component of our CD becomes higher than zero then we kill off these constraints. So in order to do this we have to check the remove checkbox. This is a dummy parameter so we have to connect any some code to it because it's called remove. So you'll see how we use this. In order to get our attribute, the cdc attribute is a it's a point attribute. So in some way we have to tell the primitives which are connected to those points to listen to follow what's happening with the point attribute. So let's create a list of points which are connected to these attachment constraints. So in pts, so we're creating an array of points which are connected to these primitives and and the syntax is this. So basically we're creating an array, print points it's called, the function, and then we're checking if the length of this array is zero, then nothing happens. And then, and then we're gonna loop through those through that array, find each point in that array for each int Pt. So we're creating another variable which is called Pt in the array Pts and we're opening a bracket. I'm gonna sample the color, vector color, and it's gonna be point attribute which is CD. With the index, the Pt instead of the Pt num, we're using the Pt. This way we're basically cycling through all the points that are connected to our attachment constraints primitives and checking the color. So once the color is higher than zero, we're activating this dummy attribute, which is called remove. So this remove attribute is going to be a Boolean which is the result of this condition. So if our color, if the color of the point which is connected to this attachment constraint is above zero, the remove is activated. so it becomes one. So any constraint, attachment constraint that is connected to a point that has a color like this higher than zero, it's gonna be killed off. So we're really physically removing this primitive, this constraint from the simulation safely. Sometimes you can really remove some primitives in a really not safe manner, and it's gonna be, it will give you an unstable simulation. So to just go through this code again, we're basically creating a point array, which is an array made of points connected to these attachment constraints. We're checking if the length of this array, which is the amount of points, if it's equal to 0, it just does nothing. And we are doing a forEach loop, which cycles through this array. And for each point in that array, we're checking the color. So if the color is zero, it's bigger than zero, the remove dummy parameter is gonna be activated. So this is how you use the remove. Same with the broken here. You're using like a condition. So it equals to a condition all the time. So it must be equal to a condition, which yields you like a zero, one or whatever. But usually these two are Boolean parameters. They require like either zero or one, because it's like nothing in between is gonna work. 0.5 is not going to remove the... I mean, I didn't try it, but it might not work, so you need 0 or 1. So, yeah, this is where we... so let me push this back to the brackets. So now we have this code, and let's see if it works. I'm going to evaluate a few frames, can't come back. So, if we scroll through, we'll see that we have the attachment constraints here, and if I go frame by frame here. Once it turns white, you see that the tips are black here and they stay still. But once this one turns white, as you can see the constraints are removed. We're going to go into wireframe. You see there's a blue, let me color them red for example. So once the color turns white, they're gone. There's nothing here like the constraints are gone and the attachment is gone. So this is how you create and remove attachment constraints. So any kind of constraints, it doesn't matter. You do it safely through this VELON constraint property. So we're gonna rename this. Animate. Yeah, so now we have the attachment set and we're going to work on the arms contraction. arms contraction. So once we have the arms attached to the ground, we need the arms to contract. So the color on the arms, you see the white and black on the arms, on this part of the arm, this is going to control the contraction of our arm. So in order to do this, we're gonna make another Microsoft and we're gonna copy the best previous well constraint property we're gonna name it vellum animate contract and let's put it here and the vellum animate contract is going to control our that fibers so remove the CSTR we're gonna find the that fibers constraints here because they're already created earlier before we set we'll lay down the volume solver, so CSTR-tets-fibers. We're gonna use the same code that we used before, but also, yeah, we're not gonna remove any constraints here, so we're gonna uncheck this. I'm gonna remove this also, the remove dummy parameter, but yeah, we're gonna set the stiffness here, because the stiffness, if you remember well, in the fibers constraints, we set our out to the group to see how that's fibers and we set the stiffness to zero. So nothing happens with the dead fibers. So let's set the stiffness here to zero also and this value is going to be replaced by this VEX code. We're going to tell it to, we're going to set this stiffness if you see parameters stiffness in the explanation box. It's called stiffness. So we're going to override this value with something in VEX. So we have the same code that previously used in the attachment constraint, uh, uh, Microsoft, and, uh, I'm going to set the stiffness as a, uh, fit color X. So we're going to take the X component, the red channel of the color, and because it's a, from, it's a value between zero and one, we're going to fit it, uh, we're going to take the initial values, like the old minimum and old maximum are going to be zero and one, and the stiffness is going going to go from 0 to 1000. So which means that the stiffness parameter is going to be replaced by either with a value between 0 and 1000, depending on the color that is blinking here. So if it's black, the value is still going to be 0. If it's white, the value is going to be 1000. So it means it's going to contract. And if it's gray, it's going to be 500. So it's gradual contraction and gradual release, gradual expansion of the muscle. So it's a basic contraction and release animation. We're using only the TETS fibers. And you'll see I'm going to play back a few frames, and you'll see what it does. And then we're going to fix the issues that come with it, because there's going to be issues. See in a second. So as you can see, it already starts to move. And the middle arm is thicker. So there's more tetrahedrons there, and there's more weight. So it pulls more forward. So the other two arms are a little bit thinner. There's less compression going on there. But as you can see, it moves the body forward. So this is great. We're on the right track. So we already moved, like, worked on this. Oh, the other thing we didn't consider is the movement kind of deforms and changes the shape of the arms. So if we check the deer arm attribute along which the fiber constraints are contracting. You'll see that, let's see. You see that it's kind of messed up because it keeps the same direction. I wanted the deer arm attribute to follow the deformation of this tetrahedral mesh. So I want to compress this mesh in this direction, but the vector is not updating at this time. So it still keeps the same direction that we had the initiative. This is a problem. So I really want this to follow along the deformation of our mesh. So in order to do this, I will be pasting a code. I'm not gonna retype it again because it's quite a lot of code. So it's a code that I borrowed from some example files from SideFX, but I modified it just for my specific needs. We'll create a geometry wrangle where we're gonna paste this code and you'll see what it does. Geometry wrangle. So this geometry wrangler, I'm gonna put it after the sub-solver, and this is the order I prefer, usually. I didn't commit it properly, so it goes into the merge. And now we're gonna move this here in the middle. The geometry wrangle is going to contain quite a bit of code, so I'm going to paste the code. I mean, it's not a lot, but it's... I'll explain what this code does. And then we're gonna type the other two lines manually. So it's pretty much the same. So we're defining a, first of all, we're including a PBD constraints library from Houdini's repo, basically from Houdini's folder. There's like a library, which is called PBD constraints.h, and it contains some functions like is that a wrap? So it's a check that does the checking for the type of constraints, which is a, as rigid as possible, a tetrahedral constraint. So we're basically looping through all the primitives that belong to each point of this geometry. And we're checking if the constraints between those primitives, between those points and primitives are, as rigid as possible, our tetrahedral constraints. And we're basically applying, because we initialize the value that's called that here, which is a minus one, which basically shows that there's no, it's a primitive that doesn't exist. And once we check that it's a tetrahedral constraint of the type as rigid as possible, like we have here, which is, you see, a nonlinear A or A wrap. So once the condition is satisfied, we apply this primitive number to the tet variable. to the that variable. So now we're checking the, yeah, if the that is lower than zero, which is minus one, it means it doesn't do anything. But if it does, it's going to continue with this code. So the code will be, we're going to read in our quaternion attribute, which is an orientation attribute for each petrochial primitive in the geometry. So let's write it down. So we're reading in from the second input of our geometry, and we're going to change this because we need to, I'll show you how. We're reading a quaternion attribute, which is called the rest vector, and instead of the primitive number we're using the tet that we clearly checked in this whole each for each loop that it's a tetrahedral constraint of the type as rigid as possible. We're reading its rest vector so we're going to use this rest vector in order to rotate our our deer arm attribute and apply it to the material w. In the previous simulation that I've made the preview for in this simulation, we have a default material w attribute that apparently is in the right direction, but we're gonna modify it so it fits, so it follows our deformed their arm attribute. So in order to do this we're going back to our geometry wrangle and also in the inputs because you see we're basically initializing this from the first input, but the first input is nothing, there's nothing here. So we're going to type in a dot data in the second input here and the dot data is going to be like this object ID constraints constraint geometry. So basically we're reading in a primitive attribute called rest vector. As you saw before I connected the null to this primitive constraint geometry like output and this constraint geometry output contains all the all the constraints that are created by vellum. So this is why when you right-click and go into the spreadsheet you see a lot of these are all primitive attributes and yeah, also you see you can see the type of the constraint is that a wrap here, so the first part of the code checks if this type of constraints. So we have the rest vector. So this is what we're reading in into the simulation directly and also Yeah, we're going to create a vMaterialW attribute and and it's going to be a qRotate, what? vdirarm. So what we're doing here, we're rotating this vector, like if you type qRotate, you rotate a vector by a coternian. We have a vector which is dirarm, which is the red one on the screen, and we're having the coternian, which is the rest orientation of our tetrahedron. So this is how we rotate this vector. We're rotating the deer arm by the quaternion that we pulled from the first input, which is a primitive attribute. So that's it. And also, yeah, I want to normalize this whole thing because I really don't want any magnitudes going crazy there. Oh, yeah, so that's cool. Now this material w attribute is going to be read by the tetfiber, by the vellum animate contract, and by the vellum fibers. Because the vellum fibers, this is what they use as a vector for contracting the arms. So let's see if it works, because this is interesting. Once the monster is going to fall down, you'll see that the red attribute, like the red vector lines, will be deforming along the... oh yeah, they will not be... wait just a second, because we're not displaying the modified... the deer arm attribute is gonna stay the same, but we're also going to display the material w, and we go here, press here, material w, we're gonna color it, I'm gonna be a vector trail, I'm going to color it as a green vector, let's say this, and it's not created yet because we didn't evaluate anything. Oh yeah, so now it's created. Let's decrease this. 0, 3 for example. So you now, you'll see that the vector is going to appear, the material w. And you'll see that it moves compared to the red one. So the green one deforms with the arms. Once there's deformation in the mesh, the rest vector of the the Trohedron is changing, so the rest vector will be rotating their arm attribute and right again inside the, into the material W. So it's a container for rotated their arm. So as you can see, there's a big difference between the two vectors. One doesn't move and the other one follows the deformations. I'm going to disable the red one so we're not bothered by the visually by this and as you can see once there's deformation it just follows deformation. The best example is this. Let's decrease the length of this vector. As you can see there's deformation here and it rotates along the arm. This is great, this is what we need. But keep in mind that this material W vector is going to be used only on this section of the arm because we're only deforming, contracting the fiber constraints which are applied only on the arms. So this is done. Let's name this a line material W, this is critical because we want this to work properly, independent of how twisted the arms are. So I want it to contract along the arms. So we have the attachment constraints, their creation, their destruction, we have the contraction of the legs, we have the alignment of the the arm along the rest vector, which is written finally into the material W, which is an internal attribute used by Valem. And yeah, we have the forces applied to our creature. Now let's think about the tail. As you remember we created a tail group which is a group I wanted to pin down to the ground so it slides. In order to do this we're going to create another vellum constraint node and yeah so let's call it Valem, attach, tail. So this is going to be a permanent attribute and I'm going to create it, let's say, in each frame, but I want it to be created after the frame 5 because, yeah, where I let it fall down properly on the ground and then I'm going to create... I usually use this condition often when the initial... I do the initial setup of the monster. I just let it fall first and then I create constraints after like frame 10, 15, depends. But here I'm going to set it to It's going to be attached to geometry constraint, a point group and tail ends, and we're going to attach it to the ground force. Also we'll use a 001 distance threshold, so anything with a distance less than 001 to the ground is going to attach itself to the ground. The sliding rate, this is the interesting part. The sliding rate is a great parameter and it can be controlled with any like well-constrained properties with Vex, with anything you want, that she builds. And when it's set to one, it means that the constraints are sliding freely along the surface. They do not detach, they just slide along. They don't, they're always there. So it's a great thing to make objects that are kind of sliding on slippery surfaces and they're still holding on onto it. But I'm going to set it to 0.5, which means there's going to be some friction there. The constraints will be created after the frame five. There's going to be sliding, which is 50% sliding, 50% friction. It can be really scaled by attributes and anything else, anything you can think of. There's some great, really great examples of the sliding rate in the help file of the... So yeah, you can check it out if you want. Just type in sliding rate and you'll find the example files. So as for the stiffness, it's not going to be really stiff. It's going to be kind of a loose constraint. The stiffness defines how strongly the constraint resists to elongation or deformation. And so if someone pulls the constraint really hard, how is it going to react? Is it going to be stretching or is it going to be resisting a lot and not stretching at all or just stretching slightly? So as for the other nodes, I'm really using higher damping ratio than the default. 0, 0, 0, 1 is not enough for me. So 0, 0, 1 is great. And we're going to write these constraints into a group, which is called CSTRTestPaleApatch. So we can identify this group if we need to. And this looks great. Let's see if it works. I'm going to disable the other nodes for now. And let's check if it works. So yeah. Let's wait for the frame 5 and see if the tail attaches. As you can see, we can really build a huge complicated system here with the microsolvers and you can either use external attributes, internal attributes that you create here or you can really make it big. But I prefer to work on one single element at a time because you have to see if the data circulates properly and yeah Houdini is great at this. It's a really good system where data flows, it's like piping and you have liquids in those pipes and you have to follow if the water gets to where it's supposed to get. So as you can see we have the attachment constraints of the tail. They're gonna be sliding once the creature starts pulling into the desired direction. We're going to leave it as is and disable it and we're gonna work on the bubbles next. So this is the last Microsoft and it's going to be a vellum constraint and we're gonna actually duplicate this one because it already has the code in it and this is great. Enable it, I'm going to call it Bellum bubbles and remove this group and we're going to check the bubbles. This is our group and what we're going to modify here is going to be a little bit different than the other ones. We're going to check if, oh actually now the the bubbles are a point group, I don't want to use it. What I want to change the rest land of is the tetrachet. So we're going to inflate the tetrahedral stretch constraints, which are hiding underneath the skin. But I want to filter only tetrahedrons that belong to this bubbles group. So let's see if it works directly with the... What I want to check is make a blast node here. Let's see if we have the group propagated. Buddy, bubbles. Also the bubbles are tetrahedron. So we can do it in two ways. So this works. We have the bubbles as a group that contains the tetrahedrons. So in the bubbles, let's do directly the bubbles, bubbles, grp bubbles, and see if it works because I'm not sure it's gonna work, but I'm gonna remove this and we'll come back if it's, so we're reading in the color again. As you can see, when we read from the first input, it's always reading the geometry and not the constraints. So it's reading the geometry, we're actually reading a point attributes from the geometry of the object. So this string here is like in the geometry wrangle we did before. Here I put constraint geometry because we're reading in the constraint geometry, not the geometry itself, we're reading the constraints. But here we're reading the geometry. So there's two contexts, either it's geometry or constraint geometry. It's the live geometry or the live constraints from the simulation. So yeah, we're basically, yeah, we're gonna uncheck the remove because we want to change the rest scale. we're gonna leave it at one and read in the color. So same as for the other attributes, same as for the other building constraint properties. We're going to read in our color. So we read in the color from the points and we're going to remap it and apply it to the rest scale. So whenever you wanna override any of these values, you just point your cursor onto the property you want to change and you see that the parameter is named RESTScale. So we type in RESTScale and we fit the color X. The initial values are 0 to 1 and the output values will be 1 to 4. So this is just for your, let's make a channel here, max inflate. Press this button and it's going to create a max inflate. Let's set it to 4. So what it's going to do, anytime a bubble changes color, its value, or the value of the color, or the x component of the color, which is red channel, is going mapped to one between one and four because this is like if it's zero if it's black the rest scale doesn't change if it's white the max inflation will be four so this is what the rest length scale does it just scales the rest lengths of your constraints so compared to the rest length parameter which is above the first one this one just defines explicitly what rest length you want to have at the end. So it's also measured in real world values, real world scale, centimeters, millimeters. So if you want to change this value you can do it explicitly. So now let's check if it works. Also let's check it first and then we'll see if it... So, as I thought, what it does here is just a point group. It doesn't contain any primitive groups because the list here is usually the list of all the groups, including the point groups, primitive groups. So let's reset this. And then we go back and we see all the groups. This includes primitive groups that we created when we did all these well constrained properties nodes. So instead of this, we're going to target that stretch group which contains all the tetrahedral constraints in the object. We're going to make a small condition here if endpoint group 1 EGRP bubbles. So if the drag-and-drop constraints are related in any way to the bubbles, we're going to see the calculate the spectra, which is reading in the color of the... So, another set of brackets. And now it should work. Let's see. You'll see a sudden inflation of some of those bubbles. So the inflate, inflate depending on the color. So let's do the max inflate something like 3. And now we're gonna enable all of these nodes and just simulate the entire thing, see how it works and if it works. We'll come back in the next lesson. See if everything is working properly and if not we'll fix that. See you in the next one."
6
+ }
7
+ ]
8
+ }