Jump to content
Sign in to follow this  
Guest Chinaski

Spray Paint Tutorial

Recommended Posts

Guest Chinaski

I've been working on a system to spray paint on 3D geometry in Cinema 4D. As a little offshoot of those experiments, I worked out an easy system for real-time spray painting in After Effects, with a little drip system included.

 

I know a lot of people on this board are interested in creating these types of effects, so I put together a little After Effects tutorial.

 

I hope some of you find it useful.

Share this post


Link to post
Share on other sites
Guest Sao_Bento

Nice work Adam. Thanks for taking the time to put this together. I'm sure it will be quite popular.

Share this post


Link to post
Share on other sites
Guest noneone1156

I've been working on a system to spray paint on 3D geometry in Cinema 4D. As a little offshoot of those experiments, I worked out an easy system for real-time spray painting in After Effects, with a little drip system included.

 

I know a lot of people on this board are interested in creating these types of effects, so I put together a little After Effects tutorial.

 

I hope some of you find it useful.

 

Hey man let me be the first one to tell you thank you. Its because of people like you that I just love this forum. Awesome tutorial great job.

Share this post


Link to post
Share on other sites
Guest Self_90

Very good initiative Chinaski, thanks for that one you'll have a lot of hits !!

Share this post


Link to post
Share on other sites
Guest T02

Simply wonderful :)

 

Man, this is totally nice of you to share the knowledge. Thank you!

Share this post


Link to post
Share on other sites
Guest Coen Deurloo

Hi there,

 

Thanks a lot for this great tutorial! using this with a tablet is awesome.

 

However, I have one small but important problem. The drips dissapear after some time. The life of the particle does not influence this, so i'm kinda stuck. I've tried various things, double checked my drips randomizer, but everything seems to be ok.

 

What could be the problem?

 

See an example movie

Edited by Coen Deurloo

Share this post


Link to post
Share on other sites
Guest Chinaski

Hi there,

 

Thanks a lot for this great tutorial! using this with a tablet is awesome.

 

However, I have one small but important problem. The drips dissapear after some time. The life of the particle does not influence this, so i'm kinda stuck. I've tried various things, double checked my drips randomizer, but everything seems to be ok.

 

What could be the problem?

 

See an example movie

 

Without seeing your file, I can only guess, but here are a couple possible reasons:

 

1. Your comp with the drip animation may not be long enough, so the layer cuts out before it should. Check the drip animation comp and check the randomizer comp and make sure the drips are all the way through the life of the comps. Especially, check the last frames of the comps. If it is blank, then the drips disappear, as the particle settings are set to play only once, and not loop or hold.

 

2. In the randomizer comp, make sure you have the clips lined up exactly front to back and that they all together exactly equal the length of the comp.

 

3. Make sure you are not mixing different frame rates. All frame rates for all comps should be exactly the same.

Share this post


Link to post
Share on other sites
Guest DeepOmega

I used this tutorial as a starting point for a project of my own, but it felt too clean at the end. So here's how I changed it.

 

1. I replaced the animating line drips with actual drips from spraypaint. You can either do it yourself and scan it, or you can find pics on your favorite stock photo site. I used iStockPhotos, but that's because I'm both lazy and cheap. Use the drip as a Silhouette Luma, with a black Solid underneath. Mask the solid, animate the mask moving down, and there you go. I made three versions, but really the more you have the more natural it will look. I may go back and add more for the final version of this.

 

2. I added a softer blur to the paint sprite - spray paint spreads, right? I also played a bit with opacity, but that's nothing special.

 

3. I spray painted a sheet of paper very quickly and scanned it to get the "spatter" effect that it leaves when you hold it in place too long. I added a third Particular emitter, duplicating settings from the drip, and used the new spatter sprite as its particle. Instant spatter. I had to play a lot with opacity settings to get this to work nicely.

 

4. I changed the drips to act more like real spray paint. The faster the spray painter null is moved, the less drips there are. To do this, alt/option click the stopwatch button for the Particles/sec property on my drip emitter. What you want to do is come up with an equation for the velocity of the Emitter. To do this, I used length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1. Let's break it down. effect("Particular")("Position XY") returns the value of the property Position XY currently. Adding valueAtTime changes it to return the value at the time within the parentheses - in this case, time - .1 seconds. In other words, .1 seconds ago.

 

Because Position XY is a vector (that is, an X,Y coordinate, not just a single value) the vector subtraction function, sub, must be used. This returns a vector of the difference between the position now and the position .1 seconds ago. This value is given to length(), which calculates the length of a vector - its magnitude. This magnitude is the distance traveled in the last .1 seconds. Divide by .1 seconds, and we have a velocity.

 

Now we could use this for the expression. What would happen? As the emitter moved faster, it would create MORE drips - this is not how spray paint works. So we want it to work backwards. A good estimate is to take the maximum velocity of the emitter, and SUBTRACT the expression above from it. In my case, I ended up using 100, but feel free to tweak it. The larger it is, the faster the painter will have to go to get zero drips.

 

So - the expression for Particles/sec of the drip emitter is now (100 - length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1). Whew! When I tried this, it was still way too drippy - so I just divided it by a big number. 50. This gave much more reasonable results, but you may need to tweak it for your needs. A lot of this is dependent on how quickly you draw the path.

 

With the expression (100 - length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1)/50, I got great results. At its max speed, there were almost no drips. When held in place, it dripped all over. Hooray!

 

There. Hope that helps someone else. It's the first real expression work I've done in AE - I've done flash scripting, but nothing in AE. Learning is fun for everyone. I hope this long-ass post helps someone else.

Share this post


Link to post
Share on other sites
Guest Sao_Bento

I used this tutorial as a starting point for a project of my own, but it felt too clean at the end. So here's how I changed it.

 

1. I replaced the animating line drips with actual drips from spraypaint. You can either do it yourself and scan it, or you can find pics on your favorite stock photo site. I used iStockPhotos, but that's because I'm both lazy and cheap. Use the drip as a Silhouette Luma, with a black Solid underneath. Mask the solid, animate the mask moving down, and there you go. I made three versions, but really the more you have the more natural it will look. I may go back and add more for the final version of this . . .

I'll get out the airbrush and put up some hi-rez scans of some paint spatter, in case anyone wants to try DeepOmega's recipe. Prolly take me a day to get em up though.

Share this post


Link to post
Share on other sites
Guest Chinaski

I used this tutorial as a starting point for a project of my own, but it felt too clean at the end. So here's how I changed it.

 

1. I replaced the animating line drips with actual drips from spraypaint. You can either do it yourself and scan it, or you can find pics on your favorite stock photo site. I used iStockPhotos, but that's because I'm both lazy and cheap. Use the drip as a Silhouette Luma, with a black Solid underneath. Mask the solid, animate the mask moving down, and there you go. I made three versions, but really the more you have the more natural it will look. I may go back and add more for the final version of this.

 

2. I added a softer blur to the paint sprite - spray paint spreads, right? I also played a bit with opacity, but that's nothing special.

 

3. I spray painted a sheet of paper very quickly and scanned it to get the "spatter" effect that it leaves when you hold it in place too long. I added a third Particular emitter, duplicating settings from the drip, and used the new spatter sprite as its particle. Instant spatter. I had to play a lot with opacity settings to get this to work nicely.

 

4. I changed the drips to act more like real spray paint. The faster the spray painter null is moved, the less drips there are. To do this, alt/option click the stopwatch button for the Particles/sec property on my drip emitter. What you want to do is come up with an equation for the velocity of the Emitter. To do this, I used length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1. Let's break it down. effect("Particular")("Position XY") returns the value of the property Position XY currently. Adding valueAtTime changes it to return the value at the time within the parentheses - in this case, time - .1 seconds. In other words, .1 seconds ago.

 

Because Position XY is a vector (that is, an X,Y coordinate, not just a single value) the vector subtraction function, sub, must be used. This returns a vector of the difference between the position now and the position .1 seconds ago. This value is given to length(), which calculates the length of a vector - its magnitude. This magnitude is the distance traveled in the last .1 seconds. Divide by .1 seconds, and we have a velocity.

 

Now we could use this for the expression. What would happen? As the emitter moved faster, it would create MORE drips - this is not how spray paint works. So we want it to work backwards. A good estimate is to take the maximum velocity of the emitter, and SUBTRACT the expression above from it. In my case, I ended up using 100, but feel free to tweak it. The larger it is, the faster the painter will have to go to get zero drips.

 

So - the expression for Particles/sec of the drip emitter is now (100 - length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1). Whew! When I tried this, it was still way too drippy - so I just divided it by a big number. 50. This gave much more reasonable results, but you may need to tweak it for your needs. A lot of this is dependent on how quickly you draw the path.

 

With the expression (100 - length(sub(effect("Particular")("Position XY"),effect("Particular")("Position XY").valueAtTime(time - .1)))/.1)/50, I got great results. At its max speed, there were almost no drips. When held in place, it dripped all over. Hooray!

 

There. Hope that helps someone else. It's the first real expression work I've done in AE - I've done flash scripting, but nothing in AE. Learning is fun for everyone. I hope this long-ass post helps someone else.

 

 

Thanks for contributing to this! As I said in the tut, I wasn't trying to create the perfect spraypaint, just show people a system and method they could use to help them along. I'm glad you were able to take it to the next level. You gonna' post some samples?

 

By the way, nice addition with the velocity expression. I had thought of adding something like that, but decided that a basic velocity based system is kind of already happening. Well, it is not velocity based at all, but based on the length of time a person keeps their mouse in one position. The slower someone moves their mouse, the more time it takes, thus the more particles that are emitted during that period of time, so, greater number of drips if the user keeps his mouse steady for a beat or two. To me, spray paint drips are not at all related to the velocity of the can, but to the buildup of paint over a certain time period. But, your velocity expression would come in very useful if someone wants to create a brush-stroke/paint splatter effect, where increased velocity would produce more spatters and random particles.

Share this post


Link to post
Share on other sites
Guest DeepOmega

Thanks for contributing to this! As I said in the tut, I wasn't trying to create the perfect spraypaint, just show people a system and method they could use to help them along. I'm glad you were able to take it to the next level. You gonna' post some samples?

 

By the way, nice addition with the velocity expression. I had thought of adding something like that, but decided that a basic velocity based system is kind of already happening. Well, it is not velocity based at all, but based on the length of time a person keeps their mouse in one position. The slower someone moves their mouse, the more time it takes, thus the more particles that are emitted during that period of time, so, greater number of drips if the user keeps his mouse steady for a beat or two. To me, spray paint drips are not at all related to the velocity of the can, but to the buildup of paint over a certain time period. But, your velocity expression would come in very useful if someone wants to create a brush-stroke/paint splatter effect, where increased velocity would produce more spatters and random particles.

 

Yeah, the drip effect was mainly born out of changing the paint to be a bit thinner. To get proper buildup with my version, you have to go relatively slowly. If you move it very quickly, it'll be rather thin. I'll post a sample later today. But as a result, the really fast strokes would look thin, but still have drips. With the original method, there was always a chance of drippage - with mine, you can control this a bit more, with there being no dripping if you move slowly. Mostly, tho, it depends on how you plan to use it.

 

Thanks for the good springboard, by the way. A nice little lead-in to some more fancy scripting for me, since I've been too lazy to play with it before.

Share this post


Link to post
Share on other sites
Guest DeepOmega

spraypaint1.jpg

 

spraypaint2.jpg

 

There you go. You can see how it's thin on quick strokes - this is particularly good for working with a tablet. I really should add more drips, so I'll do that sometime soon. I just added a Slider Control to make it easier to affect the drippiness.

Share this post


Link to post
Share on other sites
Guest Nhowe

nice work adam, cool technique.

 

thanks again for the emails, scheduling didnt really work out for now just because i was aready booked but i look forward to working with you guys in the future!

 

Nate

Share this post


Link to post
Share on other sites
Guest Chinaski

i look forward to working with you guys in the future!

 

Nate

 

One day soon, hopefully :)

Share this post


Link to post
Share on other sites
Guest kinojay33

Hmm...it's not working for me. The drips don't seem to follow the spray painter, even though the expression is correctly set. The drips just go in the general shape of the motion sketch, but run the entire verticle length of the comp (top to bottom) instead of just dripping downward. Any suggestions?

Share this post


Link to post
Share on other sites
Guest kinojay33

Never mind...I didn't follow the instruction about drawing the spline path from the center of the comp.

 

I AM MORAN :unsure:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...