COPs (and ROPs?) - Detecting Hold Frames in Animated Footage

   720   3   1
User Avatar
Member
6 posts
Joined: March 2015
Offline
I'm working on a project where hand-drawn, animation frames made to look like chalk drawings leave behind an "erased" onion-skin type effect. I did this in COPs by blurring and compositing frames $F-1 and $F-2 with the current frame. This all works nicely.

The PROBLEM is that sometimes these drawings are "held" for multiple frames (the same drawing is repeated), and since Houdini has no idea this is happening, it composites the same drawing on top of itself, when it really should hold the previous erase effect for the same amount of time.

We could export only unique drawings, then use a dopesheet from our animator and manually hold each frame as necessary, but I feel like there's a better way. If I use a Difference blend on $F and $F-1, I can tell if $F is a hold frame because the difference will be just a black frame. As far as I can tell I need to:

1) Turn that black frame into a readable value somehow. All black pixels = Hold, anything else = Not Hold. I tried a VEX wrangle in COPs, but didn't get far.
2) Cache/store each individual frame that's generated.
3) IF a hold frame is detected in step 1, re-render the last stored frame instead of whatever the graph would generate.

I didn't see much in COPs that looked like it would help, I feel like I might need to dive into ROPs but I have no idea what I'm doing there or how to connect the two, really. Mostly I just export geometry, I've done very little with rendering.

Thanks!

Attachments:
ChalkEraseTest.rop_image1.0010.png (1.8 MB)

—Dylan
User Avatar
Member
68 posts
Joined: Nov. 2021
Offline
first thing that came to my mind was a SOP solver that checks the current frame against the previous one, so maybe you can import your sequence into sops with attribute from map to do the check and import that back into COPs
User Avatar
Member
31 posts
Joined: July 2018
Online
ROP Image OUT in COP is the place for saving images. Additionally you can try the TOP version ROP Image OUT for more advanced batch image processing.
As for the black frame, you can make a "cop solver" based workflow to hold/blur/composite the using the current&previous frame.
MotionCOPs toolkit - pushing COPS into motion design and dynamic effects territory.
https://github.com/Boning1011/motion-cops [github.com]
User Avatar
Member
6 posts
Joined: March 2015
Offline
I played with dumping the image into SOPs with an attribute from map! It's VERY hacky, but with a little VEX, it mostly works? I think?

I'm using ROP_image as the main output right now, it works but I don't see any parameters for holding frames, unfortunately. I was playing with nodes in a separate ROP network, but couldn't really get anything going nicely.

I'll trying piping it into a TOP ROP_image output and see if that does anything.

Thanks ya'll!
—Dylan
  • Quick Links