Recording Paint strokes

   2779   2   1
User Avatar
Member
6 posts
Joined: Nov. 2008
Offline
Hello,

I would like to record position info of paint strokes on geometry into channels using the Record Chop. I have to start playback to record though. Is there any way to have the frame change one frame ONLY if there is any change in the paint stroke ? A way to trigger a “move one frame up if position on stroke changes” kinda system.

Thanks,

Frank
Frank Aalbers
Effects TD
Pixar Animation Studios
User Avatar
Member
412 posts
Joined: July 2005
Offline
Hi Frank,

I'm still trying to think of an automated way to handle this but for now, are you able to easily record one frame at a time by simply using the right arrow key to step forward?

I'm doing this now to a simple sphere and a paint sop with a fetch chop grabbing hitpos and a record chop storing those channels at each frame. It basically becomes a rhythmic paint, hit right arrow, paint, right arrow, paint, etc etc and those positions are getting stored just fine… No need to have playback start up. This even allowed me to go back to a particular frame and overwrite it if necessary.. I even added a keyboard chop to (de)activate the record chop through a toggle so I could decide when I wanted it to record or not (the only downside to that is you'll have to manage your scroll lock key for intercept mode which is not worth it imho)

I'll keep thinking of something more automated too..

Hope that helps somewhat,
dave
Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
well here's an idea using the event parm on the paint sop (stroke tab). I basically fetch that state in chops and run it through a logic chop with bounds set from 1 to 1 and an hscript command set to “ fcur `$F+1` ” for the ‘while on’ trigger. Since a value of 1 equals the ‘active stroke’ event on the paint sop, the hscript command basically takes the current frame and adds to it recursively while you are actively stroking (or holding the mouse button down).

Next to all that, I'm fetching the hitpos channels and recording them in chops. So no need to playback, no need to step forward.. Just paint and your frames will increase and your position will be actively recorded when done so.

Now, I'll admit I'm not crazy about the stability of this idea to be quite honest. Sure, it “works” but you can run your frame count really high, really fast which can cause Houdini to segfault.. Not fun. (I suggest testing this out by painting in short stints rather than holding the mouse down for a whole minute). Especially since it appears to have no tolerance over whether the position hasn't changed much if not at all, so it may record flat lines here which is probably not what you want.

You can even attempt to have it fcur at `$FF+.1` if you'd rather work with floating frames, but still not what i'd say a perfect solution by any means. But hey, it may generate some ideas and maybe get you closer to a solution.. :wink:

Plus, if you don't want it step forward and record every frame while you're ‘actively stroking’, change the bounds to 0, 0 and it will only step on the ‘begin stroke’ event. This will record the exact position each time you press the mouse button down but not anything else during a position change or at the end..

I prob won't have access to H tomorrow so maybe someone else can chime in as well if this doesn't get you anywhere..

Cheers,
dave

Attachments:
paint_record.hipnc (48.2 KB)

Dave Quirus
  • Quick Links