3 Simple ways to Animate Face Textures 2.0 [With Drivers][In Blender]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone a few months ago we made this video it's real good link in the description and since then we've made these methods even gooder here's link from link's awakening we have a tutorial on how to model him if you're interested we're going to use him as an example for updating method one i'm going to cover the basic setup again and then create this user interface to select and keyframe the poses with here we have the standard material setup with several image texture nodes if you've never used materials before you can add nodes with shift a go to texture image texture then hit open and navigate to your image here i've added a few texture notes which are just a couple different eye options i'm just gonna collapse all these nodes so i can get them on screen at once hit shift a add a mix node clomp it down between these two nodes connect up the color outputs like so now you can slide this factor slider to easily swap between these first two textures select this mix node and duplicate it with shift d connect in the next texture keep doing this to connect up every texture node and now we have a series of sliders that change which texture is being shown on our model you could keyframe each of these factor sliders as needed but we can make it even easier add a value node and a math node connect them up and change the bottom value to 0 for now duplicate the math node with shift d and change it to greater than duplicate this greater than node for each mix node change the threshold on each to one two three four increase by one as you go for however many you need now connect up this value node to the top input on the greater than nodes like this and connect the value output to the greater than nodes to the factor inputs on the mix nodes now this single value will slide through each face texture change this bottom value on the add node to a very small number something like .001 this would just make the integers greater than the thresholds on the greater than nodes box select these nodes and hit ctrl g to turn them into a group hitting tab allows you to enter and exit node groups now tab out of this node group we can delete this value node since it's built into the node group now select and tab back in an advantage to using a node group like this is in the side end menu under the node tab we can change the maximum and minimum value of our value input so it won't just slide off into infinity on accident and this was basically how we left method 1 in the first video [Music] just as a quick side track if no groups that look like spider webs drive you crazy keep in mind that you can hold shift and right click drag with your mouse to add a re-root note and you can make your node groups look a little more organized it looks different but it's exactly the same thing now let's make this material even more gooder by integrating it into our model's rig i'm going to select my character's rig in object mode and tab into edit mode if you're not using a rig character just add an armature single bone in object mode and then tap into edit mode so in your characters rig hit shift a to add a bone scale it to your desired size in the bone properties tab change its name to something appropriate duplicate this bone with shift d and move it over on the x axis name this new bone something like oh i don't know exactly selector base hit numpad 7 to go into top down view i find orthographic view to be helpful as well numpad 5 toggles between ortho and perspective duplicate this second bone and move it over on the x-axis a little name it something like eye selector under bone relation set the second bone's parent to the face rigged base and the final bones pair it to the second bone in object mode hit shift a and add a plane scale it down to fit your rig or whatever while in edit mode go into the modifier tab and add an array modifier change the x factor to zero the y factor to one and change the count to five tab into object mode and choose apply from the drop down menu select all with a and change the pivot point up here to individual origins and scale down a little bit i think i used exactly 0.9 select our plane object and create a new face material add an image texture to the material and choose one of our face textures add a new material slot choose the face material again and duplicate it here rename this material and change the texture over to the second eye texture choose face select and select the second plane select the second material and hit aside now create materials for each of your eye textures and assign them to the planes in ascending order depending on how your material is laid out this graphic is really just user interface so you could use numbers if you want or different pictures of my friend cj really whatever and that's good there for now let's real quick make an arrow add a plane in object mode put an edge loop down the middle with ctrl r and two this way with ctrl r and scrolling the mouse wheel select and delete only the faces delete these two vertices and these three edges merge these front vertices by selecting them and hitting m choose at center select all with a and scale on the y axis to make it look how you want it to [Music] in edit mode rotate this arrow by 90 degrees on the x-axis in object mode select the rig and go into pose mode select the eye selector bone under viewport display use this eyedropper to select the arrow as the custom object now disable the viewport and render visibilities of this arrow object still in pose mode add a limit location bone constraint currently this bone can move all over the place which we don't want hit these four check boxes and select local space now this bone will only slide along this axis go into object mode select this object and shift select the rig hit control p and choose with empty groups in the vertex data tab select the eye selector base tab into edit mode select all with a and hit a sign over here select the rig and go back into pose mode so now this bone controls our little face rig while in side view rotate by 90 degrees now it's standing upright everything is set up now but it doesn't actually do anything yet in object mode select our character's object which contains the eye material in the material editor right click on the value input of the node group and select add driver under object choose your character's rig and under bone choose the eye selector change the type to z location and space to local space select the armature and go into pose mode and it's clearly not working correctly yet notice how currently the eye changes when i slide my selector way down here we'll want to adjust our driver so that it works the way we want it to select the eye object and go into the eye material right click on the value and choose edit driver this expression field is how we transform the z location of our bone into the value we use on our material in this case i tried var times negative 20 and that's moving in the right direction now but it's not quite synced up so back into the material edit the driver maybe negative 7 will work better you can trial and error it or actually do the math that's getting pretty close so instead of adjusting the expression let's put our arrow at the top of where this first box should be go into object mode and select our i squares select this bottom edge and move the cursor to selected with shift s and the pivot point to the 3d cursor and scale it all down in object mode really close now so scale it down in object mode a little more and there we go now that it's all set up this little rig is pretty flexible all you need to do now is keyframe the location of the selector bone to animate your character's face you can scale this selector base and move it all around and it still works and name this object you'll also probably want to disable the little selector interface's render display that way it won't show up in your scenes and you can make the same thing for every other material you can do it for his mouth or if you want his nostrils to grow or something weird another thing to keep in mind when you're using drivers on a material node is that you can do your math within the material itself instead of the driver so for example we can edit our driver and remove this multiply by negative seven then select and tab into our node group and add a math node then choose multiply by negative 7. as you can see does the same thing and now you could also add a driver to the multiplication value and link a bunch of sliders together and make some really cool systems if you wanted to another question that's asked often about method one is how to deal with textures that have an alpha channel so i used the exact same material setup that we used for ling space but chose some paper mario textures to take their place i'm a real quick toss in a cube and a light so you can see the texture's transparency at work in rendered view this is what our material looks like so far converting it to work with alpha is actually really easy as you can see each value has its own texture just select these mix nodes duplicate them with shift d connect the greater than nodes up to the factors and connect up our textures alpha channels to the mix nodes in the same order as the color outputs are connected above also connect the final color output to the alpha input on the shader node we've only connected up the first two so let's connect the rest it looks pretty out of control so you can tidy this up with three root nodes if you want and that's method one for method two we'll use red from pokemon like we did last time so in this case we have one image with multiple poses on it it's pretty simple to set up a node system to animate this add a texture coordinate and a mapping node connect them up like so and weirdly that's pretty much all you need to do now you can slide these x and y values around to animate his face i made this little key for the first video showing how the coordinates work in this instance so you can type in the location here to change his active face then keyframe these location values to animate his face and that was pretty much where i left it off in the first video we can make this quicker to change by adding some combined xyz nodes and typing in all the various face pose locations but we need a way to mix these nodes together i was messing around one day and connected up a texture coordinate node object output to the base color input of my shader and saw this and i realized that blender being the smart and bestest program that it is will take the x y and z of an object and read them as colors if you ask it to so essentially the object's x location becomes a red value the y a green value and the z of blue value this gave me an idea let's just set up method two basically like method one and use mix nodes to mix the x and y locations of the texture so that's what we're gonna do add some mix nodes and connect these nodes up and weirdly it works now we can use our values and math nodes like before and set it up almost exactly like method [Music] one let's make a node group with control g delete this superfluous input node you can add as many xyz nodes as you need change the min and max of the value change this add to a small value and there we go a working method 2 node group where you only have to keyframe this one value and we can take it a step further and set up the little rig selector system again add a bone to your armature duplicate a name duplicate a name again set up the relations like so add a plane in object mode just kind of move it around a bunch create a new material using the face texture use ctrl r to add edge loops as needed move this off to the side enable snapping the grid so we can evenly space them and copy the individual faces over with shift d zoom in if you want a higher degree of snapping accuracy delete the original plane select the rig go into edit mode position this bone about in the middle select the faces and shift select the rig in object mode hit control p and select parent with empty groups select the rig in object mode and shift select the faces then go into weight paint mode tab in edit mode and select all with a make sure you're selected on the right bone in weight paint mode then in vertex groups hit a sign while selected on the eye selector base now this bone controls the face selector select the rig and in edit mode hit n to bring up the transform menu over here notice the z location it's about negative 50-ish at the final phase i don't like it we want our material node to get a value of 5 while we're here so go into the material node and add a driver to this value select the armature for the object and the eye selector is the bone choose z location and local space so how do we turn negative 50 into positive 5 math edit your driver divide by negative 10 or multiply by negative 0.1 and that's pretty close let's add a bone constraint again so it doesn't slide all over limit location lock the x and y's use local space rotate it upright in side view and it's working pretty gooder let's real quick make an arrow again [Music] and in pose mode change the selector bones appearance adjust the scale as needed and it's pretty close instead of adjusting the driver let's just scale the faces to fit shift s to set the cursor to the bottom edge of the faces set the pivot point to the 3d cursor and scale them down and it's beautiful once again make sure to disable the render visibility of the irig [Music] and there you have it a pretty intuitive way to animate your face textures without much bust and now for the third and final method it involves animating the render visibility of objects this method can be used on planes with textures or 3d modeled objects it allows you to swap out objects entirely for instance the characters from super smash bros have modeled face poses that swap in and out here's a demonstration of the sonic model doing something similar in blender i recently used this method on my mario rig to have three states this allowed me to have mario take off his hat easily and seamlessly while having his hair look good the whole time but you can use this method in a ton of different ways let's do it i'm going to create a new collection and drag my cube object into it add a few other basic objects and move them all into the collection since we're going to be setting up a driver to toggle on and off the visibility of objects turn on the disable and viewport and the disable and render toggles now right click the disable and viewport toggle on the cube object and select add driver we don't have an object to assign it to yet so let's make that real quick and unlike the previous two methods this time i'm going to be adding an empty to act as my driver object you can use anything doesn't always have to be a bone and for this example i'll lock the x and y locations of my empty so it only moves along the z axis now right click the disable and viewport toggle on the cube object and select edit driver under object select the empty and for type choose z location this part took a bit of math but i figured it out so you don't have to here's the equation here's the graph that shows what's happening here i want the expression to only dip below one between the intervals that i want the object active i want the cube object to only be active between 0 and 1 and the cone to be active between 1 and 2 and so on copy the driver and paste it in the cones viewport toggle now edit it change this number to 6 and this one to 5. paste the driver to the rest of the objects edit the cylinder change to 10 and 13. [Music] change the next object to 14 and 25 but don't delete the bracket like i did or if you did fix it fix it like i did and change the next one to 18 and 41. now as you can see the z location of our empty determines what object is active in this area there's a lot of crazy ways to make use of this if you're not a fan of math you are not alone but if you need more than five stages for your project here's the formula for making more if we consider the first object zero the second object 1 and so on here's all the math on screen the next object or stage 6 would be object 5. hopefully that comes in handy to not have to figure out also make sure you copy each of these drivers over to their disable and render counterparts so that your animation actually renders hopefully that's not too confusing and comes in handy when trying to decide how to animate stuff like this like everything else you'll have to make adjustments to things to fit your project and your style but hopefully this gives you some ideas on how to get things working hopefully hopefully hopefully thank you for watching if you have questions feel free to ask subscribe and if you enjoyed the video maybe leave us a like thank you again love you bye [Music] you
Info
Channel: The Observatory
Views: 106,115
Rating: undefined out of 5
Keywords: Blender, Blender Tutorial, Blender Face Tutorial, Blender Animation, Blender Face Animation, Character, Blender Animation Tutorial, Blender Texture Animation, 3D, Blender Face Rig, Face Rig, Rig, Animation, How to Animate, 3D Modeling, Pokemon, Super Smash Bros., Sonic, Legend of Zelda, Paper Mario
Id: nmzAbeUDPUQ
Channel Id: undefined
Length: 18min 16sec (1096 seconds)
Published: Sat Mar 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.