Introduction to a Random OpticalFlowDeform FX

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Introduction to a Random OpticalFlowDeform FX

Post by Svengali »

Optical Flow Concept
The Optical Flow Effect uses a field of source and destination dots in a user-selected/sized grid of deformation points to distort the current image.

With the HUD on, the image can be interactively distorted with a round brush (user set size) simply by painting strokes to dislocate the destination dots. By default, the source dots (red) and the destination dots (green) and the vector lines(blue) are visible in Preview. The distortion displacement in the current image is also displayed and permits interactive deformation.
Vary the effect of your applied distortion brush by changing Size and Power.
The displacement offset can also be REINITIALIZED or reduced interactively by RMB stroking.
A key frame can be created for the deformation at any current frame. Likewise, subsequent keyframes can be created with some modification in the flow, and the interpolation between those key frames can be previewed by hitting play. As with any interpolation, more distance between keys results in slower and smoother progress.

The default dimensions for the dot field are Width 20 Height 15. You can define your own custom dimensions using the Set Size button.
You can also reset the offsets for an individual key by selecting the keyframe then pressing Reset Current Key.
You can reset all of the keys by selecting the Set Size button, and pressing OK without changing the values.

The purpose of the Edit, Selection, Render and Display modes are pretty much self-evident.
Edit mode is for entering default adjustments, previewing deformation and the apply FX operation. The other modes let you change parameters and areas affected.

The BOX mode lets you apply transformations to the entire field of dots (use control-key to scale).

Some other things to point out:
1. Multiple applications of an established set of deformation keyframes simply emphasizes the original deformation so that the displacement becomes exaggerated.
2. When you brush an area, you are changing the destination (green) points and their vectors. The source points stay in original position.
3. Applying the FX moves the image pixels' direction and distance… and interpolates the surrounding pixel positions accordingly.



So, what about the Random Mode (the crossed arrows)?
What happens in random mode is the destination points are automatically displaced in each frame, along randomly generated vectors to a specified distance (length) in each keyframe so, when the Apply FX Stack button is pressed, a multi=frame layer displaying a single image can be distorted/deformed on EVERY FRAME.

IMPORTANT TO NOTICE:
When you are in Random Mode, and you press play, EVERY FRAME BECOMES A KEYFRAME with NEW random vectors for EVERY source/destination pair. This results in a kind of frenzied deformation - without any interpolation at all. Useful for some situations, but not for most situations in my experience.

Simple Demo of OpticalFlowDeform FX
So how to use the POWER and EXPEDIENCY of random vector generation alongside the POWER and EXPEDIENCY of FX interpolation?

For me, it involves a tricky dance:
Using the Random (cross arrows) mode - ONLY to set individual keyframes.
Using the Brush (round) mode - ONLY for copying and pasting keys AND always for preview playback.
Often, I have to use the FX Stack UNDO key to backtrack as well.

Here is the workflow for creating three random vectored keyframe, source/destination fields, each 5 frames apart, copying the original random vector key to the 21st frame for a smooth loop.

1. Setup a layer with a single image for 20 frames.
2. With cursor on frame 1, select Random. Leave Seed at 123456. Set Length 10. Leave Variance on 10%.
3. Press keyframe icon.
4. Move cursor to frame 6 (keyframe is automatically added capturing new field of random vectors)
5. Move cursor to frame 11 (keyframe is automatically added capturing new field of random vectors)
6. Move cursor to frame 16 (keyframe is automatically added capturing new field of random vectors)
7. Move cursor to frame 21 (keyframe is automatically added capturing new field of random vectors)
8. Immediately select Brush (round)
9. Select keyframe @1, and copy it.
10. Select keyframe @21, and paste keyframe from frame 1.
11. Press play to view random interpolations of the green destination grid and blue vectors.
12. Apply FX Stack

Click to view Example:
OpticalFlowDeform - random.gif
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Introduction to a Random OpticalFlowDeform FX

Post by D.T. Nethery »

This is very useful. Thank you.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Introduction to a Random OpticalFlowDeform FX

Post by daninski »

hmmm, this might be a useful alternative method for creating pseudo boil. I'll check it out properly later.
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
User avatar
daninski
Posts: 289
Joined: 01 Oct 2015, 12:13
Location: Budapest/Newport
Contact:

Re: Introduction to a Random OpticalFlowDeform FX

Post by daninski »

It works pretty well. I did a grid 150 x 100. It didn't bog down my computer at all. It's a recent 13" MacBook Pro.
Got a pretty good boil, quicker than generating a noise layer and then distortion map.
I'm going to try and max out the grid.
http://www.daninski.com
Award winning director with an iMac from about 2013 and a cintiq from about 2009, there's some RAM too.
Post Reply