Tutorial: Simulating Handwriting in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this video contains an ad for nordvpn but more about that later in this tutorial you're going to learn how to draw any shape you want give it some thickness and a glowing material and turn it into a simulation and what's so powerful about this technique is that it works with handwriting as well so we're going to write the word place it on a real video background and interact with it using a very simple rotoscoping method and this type of simulation might seem advanced at first but once you've cracked the code you might be able to execute your own ideas and that's just really satisfying so here we are in blender version 3.1 we're going to start by deleting everything and creating a curve so this is going to be our string so let's press tab to go to edit mode and let's just delete everything and let's select the draw tool i'm going to just go shh now let's go back to object mode and to make this into a cloth simulation all we have to do is go to physics properties and oh where is it it's not here and that's because this is a vectorized curve so to be able to simulate this we have to make it into mesh so right click convert to mesh so now we can click cloth simulation and if you press play it falls straight down so the cloth simulation in blender might be a little bit intimidating so to make things a little bit easier for ourselves let's just collapse physical properties so now the only thing we need to focus on for this effect is the shape and specifically the pin group so we're going to use a pin group to attach only this point of the string so that all these other points will fall right down like this so to create a ping group we need to create a vertex group so let's go to object data properties and under vertex groups you can click this plus icon to add a vertex group but now we can't really do anything here we have to go into edit mode and now you can see you have all these vertices in our mesh so we are going to select a vertex at the far left in our object and we want this to be pinned so in our vertex group let's just click assign and this assigns this vertex with a value of 1. so if you press tab to go back to object mode and you go back to physics properties now we can set the ping group to group so now when you press play it's going to be attached like this and already this is a really cool effect but the problem is if we set this to render view and you turn off the overlay it's invisible and that's because this is an infinitely thin line we need to add geometry to this so our render engine can pick it up with the material let's go to modify properties add a modifier skim so now this just turns into a really weird blob and to understand how this works and how we can fix it let's press tab to go to edit mode and let's toggle x-ray so now you can select a vertex and you can press g to move it and you can see it has this weird thickness around it so to adjust this thickness we can press a to select all and use ctrl a and just move your cursor so let's disable x-ray mode now let's go back to object mode so now when you press play you can see that we have a perfect looking string and now with this shape you might run into a little bit of a problem let's zoom in on this edge here you see that this little rotation there that's because this is actually rotating quite a bit so to make this less jarring when you're rendering it out especially with motion blur let's go to add modifier subdivision surface and this will make it a lot rounder and then you can set the skin modifier to smooth shading so now when we press play we have a smooth string in our scene let's add a material let's go to material properties let's click on new and let's call this string and now we can see that the surface is set to principled bsdf and let's click this and change it to emission but nothing changed and even if we change the color nothing changes and that's because we have to set this to render view so in the top right corner let's set the viewport shading to rendered and now you can see we have the color and what i like to do to get a really warm color is to click on this little socket there and set it to blackbody and this gives us the value in kelvin temperature which is really cool i mean warm so now you can increase the strength but we want this to glow like a magical glow effect so let's set the strength to something high like 15 and then to add some glow to this let's go to render properties and let's enable bloom so now when you press play we have this glowing string in our scene for the first time on this channel this video has a sponsor and is nordvpn and i could just start reading from a spec sheet of reasons to why you should use a vpn but i want to visualize this using particle simulations so first of all nordvpn offers a secure vpn and now they also offer threat protection they are combining their lightning-fast vpn with a new anti-malware feature this is a powerful combination the vpn acts as a secure tunnel for all your internet traffic while the threat protection blocks intrusive ads and web trackers this makes nordvpn more than just a vpn by offering a safer and smoother online experience it gets much more difficult for websites to track you with a unique profile of who you are and what you like you can also enable the automatic kill switch so if the vpn connection accidentally drops it instantly blocks your device from accessing the web right now nordvpn has a 30 day money back guarantee so if it's not for you they'll give you a full refund you can go to nordvpn.com polyford to get this deal now let's get back to the tutorial so instead of this string just being a squiggly line it can be whatever you want you can write a word if you like and then you can simulate that handwriting using the exact same techniques that we just used so let's try that let's delete our curve and let's create another one press tab to go back to edit mode just like we did and let's delete the segments and i'm just going to write something using my handwriting if you're unhappy with the result you can use this select box tool and then you can just press g and move this stuff around and press s to scale and you can tweak this after you've written it which is really nice if your handwriting is a little bit rusty and if you get these really sharp edges like this and you want to change them to regular you can press v and set it to automatic and that will make it less sharp so i think this is looking good so let's press tab to go back to object mode and let's right click convert to mesh so now let's just do the same thing that we did let's go to physics properties cloth go to object editor properties let's make a vertex group press tab to go to edit mode select one of the points you know what let's actually select this point at the end because i want to show you something so now let's click assign and let's go back to object mode back to physics properties ping group group so now when you press play amazing look at that how cool is that now i want to show you something that is incredibly powerful with this technique i want to control this vertex but i'm unable to control that in object mode so we want to make a link between edit mode and object mode and a really efficient way to do that is to use something called hooks so make sure you're in edit mode by pressing tab and let's select the vertex that we assigned in the vertex group and let's press ctrl h and this allows us to hook to a new object so now you can see we have an empty object and this single vertex is now linked to this empty object so let's press tab and go back to object mode and now you can see that there is a line and it's easier to see if you do like this and right now we can't just press play and move this around because the cloth simulation is being calculated before the hook so to fix this let's select our text object let's go to modifier properties and here you can see the cloth modifier and this hook modifier and let's just move the hook before the cloth so now when you press play you can move this around and it's going to work in real time let's go to add modifier skin let's do the same thing that we did ctrl a scale it down and let's add a subdivision surface modifier and set it to smooth now let's press play and you can see as we can move this around in real time but i think it's a little bit annoying that it just falls straight down so this is really cool let's go to scene properties and let's turn off gravity so now when you press play you can move this around and we have this zero gravity text effect and look this is just so cool look at this how cool is this effect this is amazing so let's actually add a material to this again i think we can just use this one and let's set it to render view perfect so now you could have this animation that just exits like this now you can see you have this colored line down here and if i just press play now this just starts moving and that's because this is baked now into the cache so if i try and move this again it won't work so if you run into this issue it's really easy to fix you can simply select the simulation and press tab to go to edit mode and then press tab again to go to object mode now you can see it resets again this is so fun to play around with oh and by the way if you think this this relationship line if you think this is annoying you can go to overlays and you can turn off relationship lines and if this happens you can just move this back roughly it doesn't really have to be super precise so i want this to be written out like an actual pen writing this before the simulation starts first let's go to physics properties and under cache let's set the simulation start to 60. so now the simulation doesn't start before frame 60 which allows us to manipulate this mesh before let's go to modify properties and we can collapse this just to make this a little bit more tidy and let's add modifier build and then we can set the length to be 60 frames so now when we press play this is being written like this and then we can animate it and if the build modifier is a little bit glitching like you can see this part here is glowing before it reaches over there it might help to move the build modifier before the skin modifier so now let's have a look perfect okay so i thought it would be really cool to add this effect on top of some real footage so i recorded my hand sneaking in to grab this sort of edge of the string and then just pulling it out like this and this is actually surprisingly simple to do in blender so the first thing we're going to do we're going to just zoom in here on the end this is where we want to grab it so we want it to be a little bit slimmer so to do this press tab to go to edit mode and let's turn on x-ray again and now you can see that you can still move these vertices around by pressing g but if you enable proportional editing up here hotkey o now you can press g and you can scroll on your mouse wheel to adjust the level of falloff and the really cool thing about this is that it also works with the vertex radius so let's press ctrl a and adjust the scroll wheel and then you can make it fade out like this you know what let's actually do it for this side as well so let's just perfect okay so let's import our video footage let's go shift a plane and this is going to be our video background so let's press f2 to rename this video background and now let's rotate it on the x-axis by a value of 90 and let's move it behind the text so press g and y to move it behind on the y-axis and now you can press s to just scale this up and make it really big perfect now we have our video background so to add the video texture to this let's go to material properties and click new and let's call this background texture and let's change the surface from principle bstf to emission and now let's click this little socket and set it to image texture and now you can click open to find where you have saved your video file and i've saved this to my desktop there it is open image now this looks really weird for a couple of reasons first of all the colors are all wrong and let's fix that super easily let's go to render properties and let's scroll all the way down to color management and let's change the view transform from filmic to standard so now the colors are correct but the image is really stretched and to fix this in a super easy way let's create a camera so let's go shift a let's make a camera and now we want the camera to see what we are seeing so let's go view align view align active camera to view and now you can see that the camera has the correct aspect ratio because our timeline by default under output properties is set to 1920 by 1080. so let's give this texture the same aspect ratio as the camera let's go to material properties and let's change the vector from default to window and now the aspect ratio is correct but we want to remove this repeating pattern so let's change it from repeat to clip so this is a really easy way to just get some footage into your scene and you might notice that when you're moving this around you can see how this works it's just a window into this texture and then when you view it from the camera it just lines up perfectly and life is good but now when we change the color this glowing text looks different so let's just tweak this until we're happy with the result again so i want to change the temperature just a little bit brighter let's do uh 2200 and maybe let's give it a strength of 10 actually okay so let's press play and see what this looks like why doesn't this video update that's because blender thinks that this is just one frame we have to tell blunder that this is more than just one frame so let's select the video and under frames let's just increase this number and i don't know how many frames this video is but that doesn't matter we can just increase this by a lot let's just do 2000 but it still doesn't update and that's because we haven't enabled auto refresh so click auto refresh and now you can scrub through your timeline it's going to lag a little bit and you can see that the video is moving let's figure out what's happening in this video and i'm just going to select our text and just hide it for now we start walking and we go around like this and then the tripod hits the ground and we're stationary so now let's zoom out and let's move over here and let's keep going here we can see my hand enters the frame and it's going to grab the text and then it's going to pull the text away so we can see that the grab happens at exactly frame 439 we're going to mark that so let's just pull this up and get a little bit more space and let's just press m to create a marker and then hover your mouse over the marker and press ctrl m to rename and let's just call this grab so now let's go to where the tripod starts so on frame 249 the camera is stationary so let's press m to make a new marker make sure the marker is selected and hold your mouse over it and press ctrl m and let's call this writing start so now let's find the end of the video let's go over here frame 700 is probably good let's just set the end frame to 700 okay perfect so this is our timeline and this is what we have to work with so i'm going to unhide the text layer and now we're going to make this line up with the camera this was filmed with the iphone 11 pro and the wide-angle lens is a 13 millimeter full-frame equivalent and in blender our camera is full frame so let's just set the focal length to 30 millimeter but now this gets zoomed out a little bit instead of scaling up our background immediately we want to move our camera closer first so let's select the camera and press g and y to move it on the y axis all the way here and then you can press g to move the camera you can hold shift to make it more sensitive and then since we have zero gravity here we're just going to be a little bit sneaky and rotate the camera because we can do that so let's rotate it and let's just line this up make sure you're on the frame where the grab is actually happening because that's what we're lining it up for let's rotate it a little bit more perfect okay so now our camera has the correct focal length and roughly the correct position it doesn't really have to be that precise since the camera is not moving for the part where we're showing the simulation okay so now we're going to make this empty object follow the motion of the hand and instead of making a new keyframe every time there's a change we're going to use something called auto keying so all we have to do is to simply move the empty and go forward in time and the keyframes will be placed automatically in many cases it's actually faster than motion tracking okay so before we start rotoscoping make sure you select the text object and let's go to physics properties and let's just disable the cloth simulation for now because this is going to allow us to see the hook without rerunning the physics simulation all the time okay so this is going to be our first frame and now let's turn on auto keying and you can press g to move and let's just line this up with the fingers you see that we just created a keyframe and then you can hold down alt and scroll on your mouse wheel let's go maybe four frames and now you can press g and move this to where you think it should be and now the auto keying has created another keyframe so this is the process we're going to do to rotoscope this so let's hold down alt and scroll another few frames down here for example and press g and you move it so it aligns and the keyframe has been automatically created so now let's just keep doing this every frame there's a lot of movement so what i'm doing is i'm holding down alt and i'm scrolling three or four scrolls on my mouse and then i'm pressing g and just placing the empty where it's supposed to be placed and i'm just viewing this from the camera view and now we get to the edge let's just go like a couple hundred frames maybe 100 frames over and then let's just move it like really far away like this so this will automatically make it just keep going so now to just be a little bit more precise let's just do the other way again now we have all these keyframes and let's just see okay here it was a little bit imprecise and we'll just fill the gaps in some of these places where it's needed and this doesn't actually have to be super precise because remember it's going to be a lot of simulation going on over here so people won't be paying attention to this rotored finger but i guess that's just excuses i'm telling myself to do a lousy job okay i think this is good now the most important thing you have to remember now that you've done all this is you have to remember to turn off auto keying because i have ruined so many projects leaving this on so remember to turn off the automatic key just now i've said it twice you'll remember it and now we're almost done all we have to do is make this into a simulation again so let's select our text and let's enable the cloth simulation and now the simulation ends at frame 700 so let's set it to end on frame 700 and it starts on the grab frame so that's frame 439 and now let's make the writing start on writing start so make sure the text is selected go to modify properties and in the build modifier let's set the start frame to 249 which is the writing start in this case instead of doing the math on how many frames it is from 249 to 439 go right before the grab happens and let's just increase the length and when it starts writing you can see okay so we made it yeah 174 yeah oh this is going to be so cool so now instead of just pressing play because the video is lagging a little bit look at this the frame rate is like a bit lower than it should be oh wait i think the frame rate is wrong actually let's go to output properties yeah the frame rate is 24 but i know that this was filmed at 30 frames per second so let's click 30 and let's go back to the physics properties and to save the physics simulation let's press bake so now this text should be writing like this yeah that's perfect and then my hand enters and then it grabs perfect look at this that's amazing it doesn't go far enough actually i wanted to exit the frame select the empty object and jump to keyframes so you're on the exactly correct keyframe press g and let's just move it even further over here i think and then press i and insert location so now this should go even further and it should exit the frame properly so to rebake the simulation just select the simulation go delete bake and bake again so now it hopefully should exit ah that's perfect okay so what's really cool about this effect is that we have done everything in camera the video background is here the glow is here so we don't have to do any sort of compositing we just export this as a video right away so to export this as a video let's go to output properties and make sure the resolution is at full hd 100 let's set the file format to ffmpeg video let's go to encoding and let's change the container from matroska to mpeg4 and if you like you can set the output quality to high quality and then just find where you want to save it i want to save it to my desktop string vfx version 1 and just click accept so now all you have to do is go render render animation okay so our render is finished let's have a look at the final result so let's have a look here we are walking around in norway the weather was really good and then i'm placing the tripod on the ground and oh there the riding starts look at that look at the glow looks really good then my hand enters and oh they're flawless rotoscoping as well and then it just roll up this really challenges the need for compositing when you can just do everything in camera it's so cool to be able to do this in real time and even with the glow and the video texture and everything so now that we've gone through the basic setup of this technique let me show you some more advanced stuff you can do using this same setup for example instead of using the skin modifier you can add thickness to the curve itself by increasing the bevel and that's really nice if you want to do adjustments to the curve and see the thickness while you're adjusting it and you can select the segments and use alt s to adjust the thickness to get this smooth gradient fall off and you can actually just convert this curve to mesh just lower the resolution preview and maybe the bevel resolution as well so you get less geometry and then you can use the subdivision surface modifier to add geometry after the simulation so it simulates much much faster oh and when you're going to create the vertex group you can actually just select the vertices and press ctrl g and it will instantly create the vertices group and assign them and it's super fast and what i think is so interesting about doing it this way is that your simulation gets a completely different feel to it it's more like a balloon shape because you have actual geometry that is being simulated instead of just having vertices with a skin modifier around it and since we have actual geometry that we can add materials to in edit mode you can have different materials for the different parts of the simulation which just opens up for so many possibilities like transparent or glossy or it's really cool and the lighting setup here is actually just a single light source in cycles i have a tutorial on this type of cinematic lighting in blender if you want to check it out and i honestly have to admit it would be perfectly reasonable to assume that that's the end of this tutorial but the weird thing is that it just keeps going let's take this motion capture figure from mixamo for example remember that time when we attached robotic arms to the back of this guy what if i told you we can draw a string from one arm to the other just like this nope nope nope there we go and then let's add the skin modifier on the glowing material then you can parent the empty itself to the bones in his knuckles and when he starts moving his arms it just works so let's duplicate the strings switch to cycles turn off the light add a ground plane and an area light we'll add a camera with some camera shake and then we can do some compositing with just a simple glow and a little bit of chromatic aberration and okay fine we'll actually extend the strings and just do a little bit of an animation there but this is it right we're finished right [Applause] [Applause] [Music] beautiful but deadly and a million years old okay we'll do the web it's actually surprisingly simple all you have to do is you make the basic shape that you want to make but delete all the faces and add hooks to the outer vertices and then you can add the skin modifier and then you can do the simulation it's actually incredibly similar to what we've done so far but what i think is exciting about this is that we have the option to make this photorealistic because the shape is something that we can recognize from real life so to make a photorealistic render let's start off by importing an hdri and give some depth of field to our camera and i also like to increase the contrast a little bit for the hdri and for this i like to just do math with the strength and it's probably not the correct way to do it but it gives quite interesting results and for the tiny condensation bubbles on the web i find the easiest way is to just use a particle system with some spheres and then with the physics just completely disabled so they were stuck to the web and then to get some more life in the background i like to use a video texture instead of just a static hdri just to read some life into it this is also an extremely efficient way to just completely change the mood of your scene if you're unhappy with anything so that's it if you watch this entire tutorial i would say you're already halfway there blender is free you can just download it and you can just start messing around with it and i'm really looking forward to see what you'll create with this [Music] so [Music] [Applause]
Info
Channel: Polyfjord
Views: 350,688
Rating: undefined out of 5
Keywords:
Id: vy_4rH7pRc0
Channel Id: undefined
Length: 24min 19sec (1459 seconds)
Published: Mon May 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.