Making a pencil draw text

I have seen it mentioned a couple times and seen some nice video animations but never saw any tutorial or sample blender files for this.

  • I thought I was in the right direction when I started this project with paths and particles.

  • I started with a single text letter and converted it to a curve.

  • I got a tiny box-object follow it which will act like the point of the pencil

  • I added particles to this object which have ‘no motion’ and have a ‘lifetime of 1’ and I ‘enable Died’ in the particles render properties.
    The problem is I can’t get the particle result to look like a pencil drawing. The resulting streak isn’t confined enough to look like a fine pencil mark no matter if I use a small halo or other material, but again I’m not an expert here.

  • Since that didn’t seem to be working I tried something different.
    I tried doing it another way by using the build modifier on the single text letter but that idea ended when I couldn’t figure out how to follow the path of the build with a box-object.

  • My next idea was looking for a growing pipe tutorial which I can maybe have the pipe look like a text but all that I found is growing vines tutorials which have an odd taper at the end and doesn’t look like text being drawn.
    Are any of these ideas correct? What am I missing? It would be great to have a tutorial or blend file… anything in the right direction would help actually :slight_smile:

Have a look at http://www.miikahweb.com/en/tutorials/blender-meshpaint-basics

With your first aproach and MiikaH’s Dynamic Paint build you could reveal some already drawn texture on a surface… I would try loading the baked sequence as an alpha, this way you should have total control on the look of the lines.
See the nice tutorials on MiikaH’s website.

You might want to approach it the other way around. Make the text appear on a plane in writing fashion that you require. So this would be an animated material on a plane. Then draw a curve to match that motion. Then use your point for the pencil to follow that curve.

Here is a 2.49 file that draws particles along a curve.

Attachments

particle_draws_along_curve.blend (373 KB)

wow you got three answers in two minutes, not even in irc… :slight_smile:

@Everyone That is unbelievable with the extremely quick response! and I checked back only a couple minutes later and I’m impressed. That must show you either I was lucky, or that there is such a decent population of blender users. Thanks very much everyone!.. I’ve been working on these 2 techniques.

@LIERO: Thanks for the idea! Dynamic Painting which I actually saw that tutorial a couple months ago I believe. Great idea now I’m trying to master it to have a fine tip on the paint brush. When I shrink the ‘paint object’ which is the object that paints onto the canvas, it seems to be skipping spaces so the final rendering is showing a broken up fine line. Possibly because it’s an alpha problem but not sure yet I will still have to figure out what is meant by baking it as an alpha.

@ATOM: Thanks for the sample file! Your object emitting particles along the curve is interesting because the object emitting the particles simulating a pencil point is a plane but you deleted all the vertices except for a single vertices. I thought to myself this could be a great trick but it still isn’t giving me the particles tight enough clustered so that it looks like a decent fine line unless I enlarge the text quite a bit. The example blend file was excellent at first glance.

I probably can do it both ways but I still have to figure out why I can’t get the outline of the font sharp enough to look nice with alot of text in the final rendered view.

The point of working with a mask, that would be your alpha, is that it can be a bit loose and still work fine, cause you are just exposing the already drawn lines… it’s a common technique in 2D, but may be not that easy to set up here…
There’s a substep setting you should tweak to smooth your paint.

Yeah I have been playing with that setting also. That helps a little bit. The higher the resolution I set, the finer the line but it still is very blotchy and doesn’t look right.

I wonder if I can do some sort of array growth that follows the path of a curve (in this case the text converted to a curve) either that if it’s even possible or some way of setting up a bevel and taper in the curve so that it simulates a pipe growing. Then I can shrink and color it to the size I desire.

Did you set up any substeps when using dynamic paint? http://www.miikahweb.com/en/tutorials/dynamic-paint-guide the vids on that page are pretty self explanatory… Oops seems liero already mentioned it.

How intricate is your scene? are you painting on a simple surface? It may pay to do the dynamic painting on a simple plane set up with a basic paint object and then use the texture frames on the modified scene. I’ve been getting reasonable results using a tyre to lay down skid marks on a road. I can take the curve modifier off the road and car, replace the curve with a straight line. Run the dynamic paint… then go back to the curve.

I’m assuming you are doing much the same. . You have a way of driving the tip of the pencil along the path to draw your line. I am using a curve modifier to drive the car along the curve, that way i can use the same loc drivers to drive it along a straight path progressing at the same distance per frame as it will go when driven along the curve. My road object is deformed by the path also. I find using the curve modifier to drive things along curves, although takes an extra object to set up … simplifies things because you are not having to deal with follow path constrant and the timeline. To make the pencil rotate with the curve I often use a 2 vertex driving mesh and use one vertex to copy location and the other to track to.

Interested to hear what you think.

In simple terms is I can use dp to draw a straight line at the speed i drive the paint object along a straight line path, on a rectangle object (the road in my case)… get the textures… then apply the curve modifier after.

PS …

It occurs to me if you are doing an unbroken line you could quite simply just scale (or set its dimension along the curve constraint axis) of a rect with a pencil line texture along the curve up to the current location of the pencil tip as you go.

Liked that Idea… had to have a go at that . works a treat attached a file. Have a one vertex mesh keyframed along a curve with a curve modifier… The pencil follows that . The pencil-line is centred on one edge and just scaled by the distance of travel along the curve using a driver…

Wow that’s some food for thought.
That sample blend file looks excellent. Never used anything called drivers before in a blend file… hmmmm I’m trying to understand the logic in that nice blend file which I’d like to replace the curve with an actual text letter of a font through text to curve conversion. Before I do that I want to understand what was done in the file. I first saw the object called ‘plane’ and deleted it because it seemed to be doing nothing but having a useless plane fly across the screen haha. Then I removed ‘plane.002’ which didn’t do anything (that I saw). Now it’s working fine without the 2 planes making it easier to understand but not easy enough for me to figure out what was done. I see both are using the curve modifier and both are dependent on each other for some reason. Also I noticed you have a vertex group setup, but at first look it only looks like a single vertex for the plane.001. Does the drivers do something special to create the dependency… Hmmm interesting…

By the way, you asked how intricate my setup had to be, I wanted to set up some scenes that have a bit of intricacy to them. Nothing is locked in stone though. If I can set it up for very intricate then I will have little trouble if I decide down the road to not have this level of intricacy.

As for the dynamic paint setup, I added multiple substeps and it seemed to remove the gaps that were missing paint. Without the substeps it has the effect of a paintbrush that was lifting off the canvas but with adding the substeps it was more consistent. Still the edges were blotchy.

For the record though, I was using a plane as the canvas for dynamic painting and a cone rotated so the point is facing the canvas and sticking through it a little. . Still trying to think about the logistics of that dynamic painting setup. I didn’t add any special parameters to the plane which I used as canvas as well, I didn’t add any special parameters to the cone object as pencil. A first thought was that either the canvas or paint object was rough that it was leaving a blotchy trail. There didn’t seem to be any deformities or what I might call roughness to either canvas or paint object that would I would making the dynamic paint trail seem so blotchy. Not sure if that made sense.

I will play with it a little more and read back a few times what you wrote but also I wanted to mention that before I fell asleep last night I got another possible solution that I might play with if I can’t figure out that nice idea you came up with in the blend file. It was simpler than I thought to use arrays and I actually was able to add an array modifier to a small plane object and have it follow a curve which made it look very much closer to a pencil drawing than the dynamic painting but not as nice as your blend file… The problem so far with that is that I can’t have an object follow the additional array. I tried having a separate object track the curve but there is a timing difference… but once again I am liking your blend file and will do my best to understand it…
Thank once again…

Hmmm I’ll try and explain it better.

Plane.001 is a one vertex mesh that follows a curve by using the curve modifier… x direction and has a vertex group defined. This is what i use to “drive” along the curve. I just keyframed it in to be at the start of curve at frame 1 and the end of curve at 250. notice the mesh follows the curve not the object… it goes along the x axis.

Plane.003 is the pencil mark. It has a curve modifier too I just added a plane… subdivided it a bit so it would deform better. I didn’t have to tweak it … but i’m thinking it must have been 1 unit long. It’s object centre has been set to the edge so when it scales it goes with the curve. I have used the driver to simply take the x location of the Plane.001 and apply it as a scale to this. Because it starts at the origin this worked fine… If you want to start away from the origin you would need to take the starting point away from the current location to scale it… The beauty of the curve modifier is we are only needing one direction.

The cone or pencil has a constraint to follow the vertex group of plane.001…

Anything left Plane Plane.002 is just crap left over I was using to test things and can be deleted.

“Theoretically” should be able to use the same method to jump from curve to curve. Had a look at using the array modifier but it seems the count variable can be driven/keyframed but only takes integers… maybe you can get it working but i had no luck trying with the array modifier.

You should be able to set this up to follow any curve… I have used the same method wth http://blenderartists.org/forum/showthread.php?t=203473&p=1746598&highlight=#post1746598 without the pencil line ofcourse… but should work ok on the T path.

PS blender 2.55 really makes drivers quite simple.http://aligorith.blogspot.com/2010/09/rigging-faq-basics-of-new-driver-system.html is a good read, well his whole lair contains some great info.

OK I found some tutorials on the drivers and before I go deeper I was curious in your own words why it only gets driven in only one direction. As the point travels along the curve, both the x & y values change. It’s 2 dimensional. That’s confusing me so far…

The curve modifier does that I suppose it’s designed to deform a mesh along a curve… I find it handy to drive things along path and be able to key in distances… I got it from a car rig… possibly by ROUBAL. You define an axis and any motion along that axis will move the mesh along the curve that distance… (in all 3 dimensions if the curve is 3d or skewed)
Note the point driven along the curve is the mesh that’s why it has a vertex group to use for copy location of the pen tip. The object travels only in the x direction.

I did a quick test on this and it worked fine on a text to curve curve. Just switch the two curve modifiers move the text curve to 0,0,0 and off you go. May pay to add a subsurf modifier to the pencil mark (Plane.003) or subdivide it a bit more … otherwise it has a bit of shimmering on the corners as it scales.

How did you start off with the curve modifier. I was trying to create what you did from scratch and first added plane.001 i erased 3 out of the 4 vertex, i created a vertex group with that single vertex in it then added the curve modifier and selected the curve object but I didn’t know where to go from there. I cant animate the plane like you did. What’s the trick to get the plane to follow the curve like the ‘follow curve’ feature?

With follow curve, I normally would have selected the first frame then selected the curve and right clicked in path animation to add a keyframe, then did the same on the last keyframe after advancing the evaluation time.

Keyframe in some x locations for the Plane.001. Having something like the cone constrained to the location of the vertex group of plane.001 makes it easier to see where it is considering it is only one vertex.

That’s exactly where I’m lost. I setup the constraint to the group. Now I’m not sure what techinique (steps) you used to keyframe in x locations.

Did you make up the locations manually by approximating different coordinates throughout the motion?

and if you did it manually, did you just put in X locations and left it to automatically calculate the remaining coordinates? Because if it’s manual, that kind of gives a big room for error… I still must be looking at it wrong…

There are two locx keys for Plane.001 keyed in that’s all. One at frame 1 one at frame 250. That’s the only manual part. The pencil line uses the driver to stretch to the location of Plane.001.

Try this … add any new curve at 0,0,0 and change the curve modifiers of Plane.001 and 003 to that new curve… That’ll show it’s not manual. The driver on the plane.003’s scale uses the xloc of the Plane.001 object.

Hey batFINGER I was going to post the simplest way I know to do this only to realize it is almost the same as yours, just with a curve instead of a plane and simple keyframing. The driver you use is a nice adition. See here that you can tilt and radius the curve to enhance the fun… Farsthary did another take on this theme, making use of the loose alpha technique to get a modulated line, but that can also be done changing radius along the path.

Yeah I’d stick with the driver on scale but would go with the curve and a bevel object for the pencil line in hindsight.