samfred2 commited on
Commit
7918edd
·
verified ·
1 Parent(s): e7a81b6

[flow_default] Transcription for week04 08 ik ribbon spine squash stretch color coding.wav

Browse files
week04 08 ik ribbon spine squash stretch color coding.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "file": "week04 08 ik ribbon spine squash stretch color coding.wav",
3
+ "transcription": {
4
+ "audio_file": "week04%2008%20ik%20ribbon%20spine%20squash%20stretch%20color%20coding.wav",
5
+ "text": "In this video, I want to show you how we can do some color coding. So at the moment, what we have is we can see that it's squashing and stretching, but it might be good for animators. You know, if they're squashing, stretching the spine just a little bit, it might be hard for them to see. And, you know, also what we could probably add is maybe a multiplier so that it should, you know, whether it should stretch or not, or sorry, I think it will always stretch, but whether it should keep the volume preservation or not, or that they can actually set a multiplier of how much it should keep the volume. And in that case, if we have that, then the animators can't really see easily how much they're squashing or how much they're stretching the spine. So it's usually a good idea to have some sort of color coding. So I want to show you that how we can change the color here of our skin in that area of the part that we're stretching. And then we also have to do a little bit of cleanup at the end here too, because we have now new things here that we probably don't want to see all the time. Okay, let's do that here. So first let's start maybe with the color coding. If we go into the hyper shade, we look at which shader we have currently assigned to our body. In this case for me it is like that shader here is what I call the cloth shader and we also have a little bit of skin here. So what I'm going to do is I'm going to duplicate that cloth shader and I'll call this maybe torso. And I have one just for the torso. And then what I'm going to do is I'm going to assign it to specific faces here. So maybe I'll go isolate, select it. You can always assign it to more later, but start with a few of those here. Basically the ones, oops, not delete, basically the ones that I want to color code now. Actually, you know what? Let's try this. Let's select a cloth here and say select objects with material that will select us the ones that we have. And then I'll say the ones that I don't want or deselect the ones that I don't want to be, that I don't want to change color. It's not so important, I guess, but... That could work. Could have probably also painted the selection. It would have been easier. OK. Almost done. Here we go. So perhaps we want to change the color on those guys here. Then we'll assign it that new shader, a cloth torso, assign material to selection. And now what we can do basically here is we can change things like, you know, the incandescence, which currently is that value. If we change it to something else, then we basically can change or influence the color here with that. Or we could also change just the color on the object itself. For example, making it a little bit more red or making it a little bit more blue or whatever. So now we have to connect it up to our ratio. So we have to get back our ratio multiplier. Find that in utilities. Let's see if we can find it. It should be under M somewhere. R, M, M-spine ratio, here we go. So we have that in here. Now, let's first do an easy setup here. I'm not worrying about what the color currently is and I will kind of can restore the color later on. So the easy solution would probably be if it's smaller, you know, if it's shrinking down, we want one color and if it's getting bigger, we want another color. So that is a condition. If you know it's true, then we want one thing. If it's false, then or the opposite and we want to have another thing. So for that, we actually have a condition node in here. So if we type in condition, it's this guy here, condition. And here you can see if we have the first term and the second term, so two values, and Maya is going to compare those two values in that node and say, if they're equal or greater than or less than or greater or equal than, if it's true, it's going to use one color and if it's false, it's going to use another color. So then let's take that output and connect it into the first term. Output of the multiply divide connected into the first term. So one. Now if we're stretching it, you can see it's getting bigger. So if we put one here, that means now if this is getting bigger, then we can set that if it's greater than, if one point or this value, whatever it is, is bigger, greater than the second value. If it's true, it's going to use those colors. And if it's false, it's going to be using those colors. So if we now connect that up into our cloth torso color, for example, or something else in the canvas. I usually like to use incandescence here, but actually it seems that I've lost my things here. So let's assign those again. Here we go. I usually like to use incandescence because that keeps the color as it is about you could connect it to color or even to transparency, whatever you want. Let's try the incandescence first. So I'll connect the out color to the incandescence. Out color goes to... Find incandescent attribute. Here we go. R to R, G to G, B to B. Now if we try that, at the moment not much is happening, it just means that if it's true, the incandescence is zero, and if it's false, that means if it's getting shorter, the incandescence will be one. So if we try that, again, it's really probably would be better if we had an animation going here from bigger to smaller. Otherwise, I always have to go in and select my control here. If it's getting bigger, it's black. And if it's getting smaller, it should be turning white. But it doesn't. Because I think the trick was that it doesn't work with incandescence if I remember correctly. Oh yeah, I remember now. So it's kind of really weird. For some reason, you cannot directly connect the incandescence and see it update here. It's kind of a Maya bug here. So what we'd have to use instead is we'd probably have to use an expression, I think, or a set run key might also work, but direct connections for some reason don't work with incandescent. So instead, let's break this connection here, because if we just set it to zero, then it works, but let's break this, leave it at black, and let's connect it to the color just for demo purposes, because I think that should work. Out color. If we change that, now we can see. Don't tell me that doesn't work either. Doesn't seem to be working either. Let's try a set room key instead. It's been a while since I did that. So let's try setRimKey if that works. SetKey, no sorry not setKey. And setRimKey set. And we'll load the conditional as the driver. And we'll load the shader here as the driven and I will say outColorR is probably enough here, outColorR and I will connect it to colorRGB. So if it's true, actually this will make it a little bit more tricky here. Let's try it with an expression instead. Sorry, nice. Let's come here and go on to the color and use some edit expressions. And then we'll set it up that way. So we use the name of the condition node. So here it is condition one. And it was outColorR and then we'll put the color of the cloth towards the shader color R equals outColor and then we can actually see a change, okay? If you ask me, it's really stupid that Maya doesn't fix that and then we can duplicate those lines and use a semicolon at the end and change it to RGB, GP, GP, and edit. And now we should be able to see that working. So now if we stretch it, it should become black. And if we squash it, it should become white. And we can see that working. Now we want to change it a little bit up so we want to say if it's stretching it should become red and if it's squashing it should become blue. So then we go into our condition node and change those colors here. This is again RGB so what we can do if it's true, so if it's greater than then we want it to be red so we just set it to red here 1, 0, 0. If it's false then we want to to be red, so we just set it to red here, 1, 0, 0. If it's false, then we want it to be blue, so RGB, so that means we only have a value here in our last one, so we set it to 0 and 0. And now if we try that again, we can see if it's stretching, it's red, and if it's squashing, it's becoming blue, if it's getting smaller. And now what we can do is, or actually what we probably should have done in the beginning anyway is put it onto the incandescence instead because that should work now too, just like what we're doing with the color here. So we will put, we'll go back to our expression, which we should get if we're selecting this one here and we go to a new tab for example and show the output connections on this. then we can see here is our expression in between. And this is what it is. What we can also do is we can come into the expression editor. So it's under Window, Animation, Expression Editor. And then what we'll do is we will search by expression. So select by expression name, then we click on this expression, and then here is our expression. So now we can change that from, you know, that it doesn't change the color of the shader, but it instead changes the incandescence. So, and we might actually connect this up here now manually, I wonder if that works, or is still not incandescence. And then we disconnect it from the color. Might not work. Let's type it in. Let's type it in. So incandescence instead of color incandescence. I have to type it correctly Let's try it out. If not, then getting an arrow here, edit, and it does work. So we get expression1, so it did work here, in fact. And now this is working. So now instead of having it on the color, we have it on the incandescence. But now what we can see is it's turning color immediately. What would be nice if it would slowly kind of fade in and get redder, more and more red, or more and more blue, the more we stretch and in the middle it will still be its original color. So for that what we can try to do is on our condition node here dial this to zero when it is kind of one here the ratio. So we need our ratio again to find it in here. So left side M spine ratio. And now we can use again a remap node probably to say if it's between 0 or rather if the ratio is 1 between 1 and 2 then it should kind of slowly dial up and otherwise should dial down so we probably need to remap values so remap value. And we could do all of that probably also with setRivinKeys. If you're more familiar with setRivinKeys, I just want to show you how we can use nodes for all of that. So we have to connect the ratio in here into the input, the ratio output into input value. So if we set this to, and again, usually I like using animations here because then we can, especially if we're doing it live as we do, then we can move all these windows out of the way a little bit. We can kind of just set it to zero here or to the default. Default is always here at the first frame and then we're moving into a different valley here so we can kind of test it out as we go. We don't have to select things and move it. We just have to remember to delete the animation at the end. Okay, so now we have one and so what we want to remap is the minimum should be one and the maximum should for example be two if we stretch it up two units or whatever. So at the moment it's not even close to that but that's what we want. And now we're remapping from one to two. If it's one, the color should be zero and if it's maximum, if it's reaching two, then the color should be one. So it's kind of ramping up as we go towards two and then two will be the maximum and it won't change color after that. And now we take this and we connect it to our red if it's true, if this is stretching. So this is dynamic. So if it's zero, then this will be zero. And if this is becoming, going towards two, then this is becoming more and more red. So we connect the output of that now to remap into our condition node, output value, and we have to connect it to the condition node to the color if true R attribute. Color if true, color if true, attribute R. And now we get exactly that. So if it's zero, it's black, as you can see here. And as we're dialing it in, it's becoming more and more red. It's going more and more towards red. So the more we stretch it, stretch it even more, you will see it's becoming more and more red. At one point, of course, it will then flip. But so this is how we can kind of set up a dynamic change. And now we have to do the same for the opposite side as well. So we need a different remap node, a new one, remap value. And now we have to remap for the opposite way. So now we have to remap, well if the ratio is, so we have to connect it in again, the ratio output x into the value input value. And now we have to say, okay, well, by default, it will be one. Actually, we probably have to do it the other way around. So the maximum can be 1. After that, it won't change anymore. And then the minimum will be, for example, 0 or 0.5, depending on how much we want to be able to compress. So if we want to go all the way to 0, then this would be the minimum, and it goes between 0 and 1. And now if it's the maximum 1, that means the spine is going to be at the default. So then we want the color of the blue to be zero. And if it's at the minimum, if it's like all the way compressed down, then we want the color blue to be one, right? So we want it to be one if it's all the way at zero. And if the spine has a length of one, it's not stretched or squashed, then we want the value of zero. And now this one, we have to now connect to the color of false B so that when we are compressing it down that it starts out with zero which basically means this would be zero and as it's squashing more and more it will become one. So now we connect that to the color if false blue channel. This output value already changed color a little bit. And now we're essentially getting exactly that. So it's becoming more and more red, it's becoming more and more blue. And at the middle, if we set this to zero, then we see it's black. It's still not the original color, but that is only because we messed with the color originally. So we set this color to gray. So we have to restore that color that we had earlier. Let's try. I see if we can do that. So we have our original cloth object still here. So we have those colors that it was by default. So we'll copy those and we'll paste them on here. Or what you could also do is you could probably also go onto the cloth and just pick the color here, you know, kind of store it. It's a little bit finicky here, I find. But then you have the color in there and then you could come to your cloth torso and kind of pick that color that we used before. I think it was this one, that one, this one. And then you should have the same kind of values, hopefully, and you do. Now, there's still a difference in terms of color and that difference is coming from the fact that here in incandescence we already have values by default, right? So while with this one here we have disconnected by the expression so now it's zero all the incandescences. But what we could now do is we could add those incandescences that we had before with a plus minus node for example. So instead of just going from the expression directly in here, we could add on top of it a, you know, the incandescent spec that we had here, those values. So we can try that too. So we can try that adding a plus minus node, we could probably also do it in the expression itself, just saying, you know, plus those values that might actually be the easiest now thinking about it. We don't even need that extra node. We just have to kind of write down the values that we have here. So if 0.1, 0.0, 0.5, 0.0, 0.5, either write them down or remember them. Try to remember them. And then we'll go back into our expression. Best with animation, or window animation expression editor. Go to our expression and then just say plus 0.1 I think it was plus 0.005 plus 0.005 that I think were default values. If we hit that edit then we can see now those two colors are exactly the same but now we still have the ability that it is becoming more red or more blue as we squash and stretch. Now we could of course assign the shader really to the pieces where we want the color coding and we could do kind of the same thing for the body skin as well if we want the color on these faces here to change as well as we squash and stretch. Especially useful, you know, perhaps if you have clothing on it then probably I would do this obviously on the most outer layer so if you have clothing on your character then I would do this obviously on the most outer layer. So if you have clothing on your character, then I would do the color coding on the clothing shader and not on the skin shader if this is hidden inside. So yeah, this is how we can add color coding to this question stretch.",
6
+ "language": "en",
7
+ "duration": 1436.6,
8
+ "timestamp": "2025-11-28T05:12:13.110377"
9
+ },
10
+ "timestamp": "2025-11-28T05:12:13.117295",
11
+ "processing_time_seconds": 305.8240053653717
12
+ }