View Full Version : Creating a Stroke on a tracker path

06 June 2007, 06:06 PM
I'm trying to grow a paint stroke along a tracker path, but I can't seem to think of a way to do it.

I've tried using quickpaint by drawing a path and then animating the end. The problem with this is that I can't see the path I need to draw all at once, I need to look at each frame to draw it (I'm trying to follow the path of an object.) I don't use quickpaint much. Is there a way to extend a paint stroke one frame at a time? I don't mean just animating its growth, but actually painting it as I move through the sequence.

I can track the object or even follow it with a rotoshape, but as far as I know these won't allow me create a stroke.

Any thoughts?



06 June 2007, 04:58 PM
if you're comfortable with a little scripting, you can create a macro that does a brute force paint job. Start with an image you want to use as the "brush" such as a small RGrad, then create a for loop in your macro that positions the brush at each point along the track path at a regular interval. You can get the poisition of the tracker at a specific time using the @@ operator in an expression. I'm not in front of shake right now but I can make this macro for you sometime next week.

maybe I should put a little pseudocode, something like: image result=Black();
for(count=starttime; count<=endtime; count+=increment)
transformedBrush=Move2D(BrushImage, <transform for TrackVariable@@count>...);
result=Over(transformedBrush, result, ...);
return result;starttime and endtime being the time range where you want to paint the track path. The result will always be visible.

06 June 2007, 05:32 PM
Thanks Philip. This looks quite promising. But am I wrong in thinking that I would only draw one 'dot' per frame and thus not look like a stroke as much as a series of dots?



06 June 2007, 06:26 AM
It would if your increment was 1 frame. If you use a smaller increment, it will place the dots closer together.

But actually I just thought of a better way. You can just use shake's motion blur...

Connect the "brush" image (the RGrad or whatever) to a Move2d node. You'll need to link your track variables into the Move2d. Type Tracker1.track1X into the Move2d's xPan field, and Tracker1.track1Y into the yPan. Of course, type your tracker's name instead if it's not "Tracker1"

In the Move2d, there is a variable called motion blur. Set it to 1 to enable it. Then expand it by clicking the + box to the left of it. You should see shutterTiming and shutterOffset under motion blur. Set shutterTiming to the length of time you want the stroke to cover, and set shutterOffset to "-time+start" where start is the time on the track curve that you want the stroke to start. Putting "-time" first will make the shutter offset reference the same time no matter what frame you are on.

I hope you follow that. The stroke line will become dimmer the more you increase shutterTiming, because you are actually blurring the "brush." So you may want to use a Bytes node to change to 16 bit before doing the blur, and then you can brighten up your stroke after doing the blur without getting color banding.

06 June 2007, 10:04 AM
That's great! I didn't realise I could dial the motion blur up that high.



CGTalk Moderation
06 June 2007, 10:04 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.