GridWarp
The GridWarp node allows you to warp images by transferring image information from one Bezier grid onto another. When using this node, you first position the source grid, which defines where to warp from. Next, you position the destination grid, which defines where to warp the image to. This grid can be a duplicate of the source grid, or you can define it separately. When you manipulate the destination grid, the corresponding warp is applied to the source image.
See also SplineWarp.
Inputs and Controls
Connection Type |
Connection Name |
Function |
Input |
bg |
The background image to receive the warp result when the background control is set to bg. |
dst |
The destination image to warp to. |
|
src |
The source image to warp from. |
|
mask |
An optional image to use as a mask. By default, the warp effect is limited to the non-black areas of the mask. At first, the mask input appears as triangle on the right side of the node, but when you drag it, it turns into an arrow labeled mask. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
GridWarp Tab |
|||
channels |
channels |
all |
The warp effect is only applied to these channels. If you set this to something other than all or none, you can use the checkboxes on the right to select individual channels. |
mask |
N/A |
disabled |
Enables the associated mask channel to the right. Disabling this checkbox is the same as setting the channel to none. |
maskChannelInput |
none |
The channel to use as a mask. By default, the warp is limited to the non-black areas of this channel. |
|
inject |
inject |
disabled |
Copies the mask input to the predefined mask.a channel. Injecting the mask allows you to use the same mask further downstream. |
invert |
invert_mask |
disabled |
Inverts the use of the mask channel so that the warp is limited to the non-white areas of the mask. |
fringe |
fringe |
disabled |
When enabled, only apply the effect to the edge of the mask. When disabled, the effect is applied to the entire mask. |
Source Grid |
|||
keys |
source_grid_keys |
0, 0 |
Controls keyframes applied to the Source Grid: • keys - displays the current and total number of keyframes. • - browse to the previous and next keyframe. • - add or remove a keyframe on the current frame. • - copy a keyframe to the clipboard. • - paste a keyframe from the clipboard. Note: If Viewer tools auto is enabled, any changes to the grid are automatically set as keyframes at the current frame. |
visible |
source_grid_visible |
disabled |
When enabled, the Source Grid lines and handles are visible. |
locked |
source_grid_locked |
disabled |
When enabled, the Source Grid lines and handles are locked. |
Resize to Image |
source_image_size |
N/A |
Click to resize the Source Grid to the same size as the src input image. |
Destination Grid |
|||
keys |
destination_grid_keys |
0, 0 |
Controls keyframes applied to the Destination Grid: • keys - displays the current and total number of keyframes. • - browse to the previous and next keyframe. • - add or remove a keyframe on the current frame. • - copy a keyframe to a temporary buffer. • - paste a keyframe from the temporary buffer. Note: If Viewer tools auto is enabled, any changes to the grid are automatically set as keyframes at the current frame. |
visible |
destination_grid_visible |
enabled |
When enabled, the Destination Grid lines and handles are visible. |
locked |
destination_grid_locked |
disabled |
When enabled, the Destination Grid lines and handles are locked. |
Resize to Image |
destination_image_size |
N/A |
Click to resize the Destination Grid to the same size as the dst input image. |
Settings |
|||
output |
output |
source warped |
Controls what output is displayed in the Viewer: • source - the source image and source grid. • sourcewarped - the source image and destination grid. • destination - the destination image and destination grid. • destinationwarped - the destination image and source grid. • morph - the morphed image, controlled by the warp and mix parameters, and both grids. |
warp |
warp |
1 |
Controls grid distortion during morphing. The mix value controls whether the source or destination grids are affected. Note: Warp is only enabled when the output control is set to morph. |
mix |
mix |
0 |
Dissolves between the source image (at 0) and the destination image (at 1). Note: Mix is only enabled when the output control is set to morph. |
background |
background |
on src |
Sets what to use as the warp background: • on black - render the warped image on top of a constant black image. • on src - render the warped image on top of the image connected to the src input of the GridWarp node. • on dst - render the warped image on top of the image connected to the dst input of the GridWarp node. • on bg - render the warped image on top of a background image connected to the bg input of the GridWarp node. |
background mix |
background_mix |
0 |
Blends between the output of the GridWarp node (at 0) and whatever you have selected from the background dropdown menu (at 1). |
set bbox to |
boundary_box |
union |
Sets the boundary box properties. • union - both input boundary boxes are combined. • format - the input with the largest boundary box is used. |
Transform Tab |
|||
Source |
|||
translate xy |
source_grid_transform_translate |
0, 0 |
Translates the selected grid(s) on the x and y axes. Alternatively, you can drag on an axis on the transformation overlay in the Viewer. |
rotate |
source_grid_transform_rotate |
0 |
Rotates the selected grid(s) around the center xy coordinates. Alternatively, you drag the transformation overlay in the Viewer. |
scale |
source_grid_transform_scale |
1 |
Scales the selected grid(s) width and height. Setting one of these to a negative value reverses the selected grid(s) along that axis. |
skew X |
source_grid_transform_skewX |
0 |
Skews the selected grid(s) on the x axis. |
skew Y |
source_grid_transform_skewY |
0 |
Skews the selected grid(s) on the y axis. |
skew order |
source_grid_transform_skew_order |
XY |
Sets the order in which skew transforms are applied to the source grid: • XY • YX |
center xy |
source_grid_transform_center |
Dependent on source input |
Sets the center of scaling and rotation for the selected grid(s). |
extra matrix |
source_grid_transform_matrix |
N/A |
Copy tracking information from either a Tracker or Roto/RotoPaint node to this matrix. Warps linked in this way follow the information from the imported track automatically. |
Destination |
|||
use source transform |
use_source_transform |
enabled |
When enabled, the source and destination grids are translated identically. Disable this control if you want to translate the destination image independently. |
transform xy |
destination_grid_transform_translate |
0, 0 |
Translates the destination grid on the x and y axes. Alternatively, you can drag on an axis on the transformation overlay in the Viewer. |
rotate |
destination_grid_transform_rotate |
0 |
Rotates the destination grid around the center xy. Alternatively, you drag the transformation overlay in the Viewer. |
scale |
destination_grid_transform_scale |
1 |
Scales the destination grid width and height. Setting one of these to a negative value reverses the input image along that axis. |
skew X |
destination_grid_transform_skewX |
0 |
Skews the selected grid(s) on the x axis. |
skew Y |
destination_grid_transform_skewY |
0 |
Skews the selected grid(s) on the y axis. |
skew order |
destination_grid_transform_skew_order |
XY |
Sets the order in which skew transforms are applied to the destination grid: • XY • YX |
center xy |
destination_grid_transform_center |
Dependent on destination input |
Sets the center of scaling and rotation for the destination grid. |
extra matrix |
destination_grid_transform_matrix |
N/A |
Copy tracking information from either a Tracker or Roto/RotoPaint node to this matrix. Warps linked in this way follow the information from the imported track automatically. |
Render Tab |
|||
submesh resolution |
render_res |
10 |
Sets the number of subdivisions created between bezier curves in the grid during rendering. |
filter |
filter |
cubic |
Select the filtering algorithm to use when remapping pixels from their original positions to new positions. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values). • Impulse - remapped pixels carry their original values. • Cubic - remapped pixels receive some smoothing. • Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve). • Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve). • Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve). • Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation. • Parzen - remapped pixels receive the greatest smoothing of all filters. • Notch - remapped pixels receive flat smoothing (which tends to hide moire patterns). • Lanczos4, Lanczos6, and Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. Lanczos4 provides the least sharpening and Sinc4 the most. |
Options Tab |
|||
Colors |
|||
source color |
source_color |
N/A |
Sets the color of the source grid. |
destination color |
destination_color |
N/A |
Sets the color of the destination grid. |
Step-by-Step Guides
Video Tutorials
NUKE 6.3 Tutorial: Grid Warp & Spline Warp Nodes from Foundry on Vimeo.
Hello everyone and welcome to this introduction to the newly improved SplineWarp and GridWarp nodes inside Nuke 6.3. These nodes have been overhauled in a major way, leading to an increase in speed, stability, and user interaction when warping and morphing. In this video we will be covering new features in these nodes, and demonstrating some of their uses.
We are going to dive straight in with the GridWarp, which can be found in its usual home in the Transform tab under GridWarp. And you can see, when looking at it straight away, that you have your usual source, destination, and background inputs. At first glance, you can see we have our usual properties bin, with some overhauled icons here for copying and pasting our keys. We also have some extra Options and our extra Render tab, which we will be looking at in a moment. We also have a new tool bin here, with tools for adjusting the resolution of our grid. Along the top here, we have quick access to a lot of our parameters. So, straight away once it is plugged in, you can see it has automatically snapped to the resolution of our grid. We are looking at some footage here that has been kindly donated to us from fxphd. Now let’s just start from the top and work across. So, we have our output dropdown here, which basically gives us the choice of seeing the output from just our source grid. Right now, this is just our source footage here. Then we can view our source footage warped (source warped). If we have an image plugged into our destination, then we have the ability to see our destination image and we have the ability to see that warped (destination warped). If we turn on morph, we get access to the mix and warp values here for when you are doing morphing. I am just going to put this back to source warped to start with.
Now, the next feature you will see across here is we have the first three boxes here, which are relating directly to the visible grid. So these are toggles for whether we are looking at our source grid or destination grid. So, if I just turn off this A here, you can see that I have the choice of my destination grid. Right now, I am doing my source. If I turn that off, I am seeing nothing. That’s my destination grid. If I turn on the A, it is going to make the best choice, based on the output I am choosing. If I look at my source grid here, you can see I am viewing my source grid there. If I choose to see source warped, I am actually going to see the result of my destination. If I look at destination, it will show me my destination grid, and destination warped will show me the source grid. So, you can see how that works. Most of the time you will find that using this automatic toggle here (A) is the best way to go. We also have an autokey button here, which allows us to autokey any changes we make to the grid. Then, here, we have the ability to ripple edit those points, based on whether or not we ripple across all of our frames, from start of our sequence, or to end, or a user defined range. If you output into the ripple mode, you will see, much like on the RotoPaint node, we get a red outline just to make sure we know we are in ripple edit. Any changes we make to any of our points whilst we are in the ripple mode are going to be carried across to every single frame. So if we have multiple keyframes, for example, on any individual point, any changes we make in ripple mode will be added to all of the keyframes evenly.
Now, the next thing we have is the ability to see the labels of our points. We have a toggle here for our transform handle, and then next to that we have one of the biggest changes in both the GridWarp and the SplineWarp nodes, and that is this persistent preview here. If you remember before, every time you adjusted your GridWarp, what would happen is you would first see a low-res proxy version of the warp you were doing. Then, once you release, it would snap back and you would have to wait for that scanline to finish. Now what happens is, as we move our point, we actually go into an OpenGL view of our warp, which is really nicely detailed, and works really smoothly and is very interactive. When we let go of this, we have a very minute pause, depending on the intensity of the warp, before we snap back to our render, so it’s holding that OpenGL preview until the scanline is finished. That really does mean this becomes a much more interactive tool.
Next up, I’m going to bring in a new GridWarp node here - just to show you this divisions slider. This is a nice, quick way of increasing the divisions of your grid. You can see it’s totally interactive, and nice and fast. If you have made adjustments to your grid, I’m going to quickly move some points around here in an arbitrary fashion, making a very horrible image. Now I attempt to adjust the divisions here, Nuke is going to give me a warning, saying that if I subdivide the grid, any manually moved points may not match in the new grid, but it will do its best to rebuild the topology using the divisions to get the best result. So, if I hit Yes here, you can see that I now have a much denser grid and pretty much the same result that we had before with our lower divisions. It does a really good job of re-aligning the topology.
Now over here, on this side, you can see we have a whole new set of tools. If you remember before, every time you wanted to add resolution to your grid using the add resolution button, you would have to click on it, add some resolution, then click on it again and add more resolution. Now, we can just hit this plus key here and we can interactively add resolution on either axis. We also have ability to remove in the same fashion. If we select points, we can subdivide in either one axis or the other axis, or if we select again we can subdivide in both axes. So, that’s a nice quick way once again of interactively increasing the resolution of our grid.
Now, one of the other really useful features here is the ability to draw a new boundary for your grid warp (Draw Boundary). So rather than having to scale it around, we can just select this and say I want to grid warp this lady’s face here, which is what we are going to be doing in our next example anyway. I can just drag a grid over it, let go, and it is going to give me a new mesh and I will have this make a resolution of 3 (divisions), so it’s nice and easy to view, and if I want to change my mind about where that grid is, I can just draw again and it is going to replace it. I can just draw again to replace it there. You can’t have more than 1 grid at any one time, but it does automatically rebuild it somewhere else for you, so that is also a very quick way of having an interactive method of laying down a grid.
Now, just moving over into our properties here, we still have our keys section here only it’s much neater. We have the ability to copy and paste our source grid to our destination grid. We can still resize our source and destination grids here to the size of our image (Resize to Image). We have access to the output again, as we have up here, and we also have our warp and mix tabs here, we can also add masks in. We have our Transform parameters as well, on top, so that’s another global transformation here and we have that for Source and Destination, and the ability to source our destination’s transformation from the source grid (use source transform). In our Render tab, we can change the submesh resolution; this is the accuracy and detail of the mesh in between our different points. So, the higher this goes, the smoother you may find your warp to be but it may also slow down the processing of it. Then we also have the ability to change our filter if we require a bit of sharpening, or smoothing when we do our warp, so that is the main properties of it. Now let’s look at an example of using it.
So, let’s say we want to use our grid warper to augment the lady’s face here, maybe making her lip look more swollen, or maybe her cheek, or eyebrow. What I have done is a very quick rudimentary track of her eyes, and now I am going to bring in our GridWarp node. The first thing I am going to do is use the interactive grid drawing tool to draw a grid around her face, and I’m going to go to my first frame and I will clear my tracker’s parameters for a minute, select this grid, and move it down. Now, I’m going to change to the Source view here, so I don’t actually see any of the warp that is happening. The first thing I am going to do is adjust the topology of the grid to fit her face nicely. I’m going to start moving points around to get them in a position that I think is useful for us. Let’s isolate the edge of her mouth here, and then I will start interactively adding in some extra lines: one here, one for the boundary of that, especially if I will be adjusting her eyebrow. So, very much like a model of a face mesh in 3D, I am just laying out her features. I want one for the bottom of her mouth, one for the top of her mouth, I will just add a line down the middle of her face, here, for her nose and the middle of her lip. I will also add one across the center here, for the tip of her nose, and I’m going to say that is a good number of grids. Just be greedy, one more.
So, now I have this grid for her face, I can go into the Transform tab, and using the fairly new link to parameter, I can go in here and say I want to link to > Tracker1 > translate. Now if we look at this, I now have a grid that is tracked to her face globally. So, now if I wanted to, I could go in here and make some adjustments with autokey. Maybe here, her mouth opens and I’m going to want to have that represented, like so. Just keep noodling this until I get a result I am happy with. So, now what I want to do is have a look at this source warped. If I look at this, obviously, it’s going to horrifically warp her face. All I am going to do is copy my source grid and paste it as my destination grid. Now you can see that my source warped grid, where I am viewing the destination here, now matches, which means that between my source and my source warped, I don’t have any deformation. So now, this is where the fun stuff starts.
I have my grid tracked to her face and I have nicely laid out topology. I can go in here now, and I would probably do this with the ripple edit turned on, so I will put this on to all frames. I am going to come in here and start by spreading out her lip a little bit, here and here. I’m trying to make that look as uncomfortable as possible. I am actually going to add another point in here interactively; you can see how easy that is. I want to spread this area out and make it look more painful, maybe adjust her eye to make it look swollen, like so. Now, I have made some quite subtle adjustments, maybe a little less subtle than I would do in reality, just so you guys can see. This is before and this is after, all using that persistent preview so I got really nice feedback. Then when I play from here, you can also see that the GridWarp is quite a lot quicker. You can see now that we have a more injured girl.
We also have in here a mask input. So if I bring in a Roto node, like so, and draw that out, maybe just cut across the face - I’m being quite brutal - and plug that in as a mask, you can see now that only inside that mask are we getting our warp. So, if I move that over, you can see I am getting that warp. This works nicely with a feathered mask as well, if you really want to blend in your warps.
Another big improvement with both the GridWarp and the SplineWarp is the ability to attach trackers to any of the grid points or spline points you wish, and still have a record or way of checking to see which of these points is attached to what. So I am just going to bring in a GridWarp quickly, and I am just going to chuck this on source to show my point. I have a Tracker, here, that is tracked to the corner of her eye. I am just going to select my GridWarp, select my point, right-click, and go to Link to > Tracker1 > track1. You will see instantly, I now have a GridWarp point that is now tracked to her eye, and then if I right-click on this and go back to Link to > Tracker linking dialog. I can see what I am currently connected to (expression, Tracker1.translate). I have a way of knowing, and also changing, what that is connected to. So that was a big deal, and that is a massive step forward with the grid warper. That’s pretty much all of the GridWarp features, so we can move on to the SplineWarp.
Now, the SplineWarp in 6.3 is quite different to what we have been used to. I’m just going to pull one of these in. I will go to the Transform tab > SplineWarp. As you can see straight away, the properties bin has been expanded to have a layer stack here. We have a tool bin here, and we have a lot of our properties at the top of our Viewer accessible nice and easily. So, I’m going to quickly run through some of these properties, many of them are similar to the GridWarp, then we will get into showing some of the tool’s uses. So, we have the same tools as the GridWarp: autokey, label points, show transform handle toggle, and ripple edit, the same output dropdown here for source warped and source, etc. We have a very similar manifestation of our three toggles here, between auto toggling, the curve we want to see based on our output here, or manually toggling which ones we want to see. We also have our persistent preview so, once again, that OpenGL persistent preview that we have just seen in the GridWarp that really enhances user interaction. We also have the ability to toggle on and off shapes and their contributions, and we have the ability to lock them down as well.
So let’s just start off straight away by getting in here and drawing a shape so we can start seeing what we have got. We have got our usual Roto candidates in here, so I’m just going to start with a Bezier and I will draw that, like so. At this point, you can see that we don’t have any change between our source and our source warped. Now, if I go to source warped and just zoom in straight away, I am going to select a point and stretch it out. Now you can see, not only are we getting a warp, but we are also getting this new UI feature that we haven't seen before, which is this dotted line. Now, these dotted lines show you the connection between your destination spline, which we are currently adjusting here, and the source spline that it comes from. This means if I automatically turn off the toggle, here, you can see that I can see the source spline. Often having those two splines becomes quite confusing on-screen, so we can turn off our source spline and just have our destination spline, but still have some kind of idea of how far we have moved our point. We can obviously adjust our points free form like this, or you can also click on this dotted line, and slide left and right to slide the point along that connected line. So, you are basically returning it back to its original position. This is a really nice, useful way of being able to adjust your warp, once you have found a good position for it.
On top of that, we also have another way of understanding the connection between our two splines. So, I’m just going to turn on the other spline here first, actually. I am going to warp all of this stuff up so we have a bit of a difference, like so, and I’m going to turn on our source spline now. There is a toggle here, which is called correspondence visibility. If I turn that on, you can see we get lines that are connected between our source and our destination splines. So, we have them at the beginning and then equally spread out at 2 points along them. These are our correspondence lines. Now, on our toolbar here, we also have our Correspondence tab, where we can add, modify, or remove correspondence points. Let’s start by adding a few. I’m just going to add a few extra correspondence points in between. These correspondence points are, if I just hop over to Modify Correspondence Point, basically saying that at this point on my source curve, I want to be corresponding to this point on my destination curve. All of these are fully keyframable, fully editable correspondence points. So you have two levels of adjustment there: you have the actual spline curves that you have created, and you also have these correspondence points in between them to help you manipulate and adjust the minutiae of your warp. So, they’re really nice features.
The next key feature in the SplineWarp is the fact we can have multiple spline warps all in one node. So, we have our layer stack over here. I am just going to go over into my Bezier drawing mode again, so I can here, select to have a SplineWarp for her mouth. I could then do an Ellipse for her nose and, as you can see, I have three warps all happening within the same layer stack. I can then use the visibility to turn on and off the contribution of them. I have these three warps all happening now, within the same layer stack. I will just remove these.
Now, another really useful feature is using this layer stack to have multiple masks adjusting the contribution of your warps. So, what I am going to do is draw an Ellipse around the eye here, and we are going to draw it intersecting with the original SplineWarp here. All I am going to do, instead of having this ellipse set to standard, I will go over here, and there are these two toggle buttons here - one is hard boundary and the other is boundary. If I turn on the hard boundary, you can see the warp is very, very rigidly only happening within that area. So, if I adjust this, you can see I am getting a very hard boundary to my warp. If I change that over to a softer boundary, you can see that is adjusting the contribution but it’s not totally fixed to within that line, which gives you a softer falloff. Then you can also have multiple masks, like this, so I could draw another one for this eye, which I could set to be a hard mask, for example. All of these are just adjusting the contribution of these warps. So, that is another really useful feature; it is that ability to have multiple layers of warp within one SplineWarp node, and multiple layers of masking within that as well.
So, I have just reset again here, so I can show you another tool in the SplineWarp. I am going to bring in a new SplineWarp node. Now, this new tool is the Pin Tool (P). It’s really, really funky and incredibly useful, and can be used in a number of ways. I’m going to, first of all, draw a spline down the center of her face here, and then I’m just going to make a warp adjustment to it, like so. Now what I am going to do is select the Pin Tool and I’m going to start dropping down pins. I will drop one in the middle of her eye, and one on the other side of her face, here. What you can see is where I am dropping these pins is actually creating a region around that pin, which is limiting the effect of this warp from the spline. So, if I put another pin by her mouth and another pin here, you can see that now that warp is only happening in that center area. I will give you a little demo, so you can see there is a definite limiting region here, and here. You can see that you still have a bit of a warp change further out, so if you want to pin that down you can just drop a couple of extra pins. Then we can even try dropping some really close, here and here. So we really start limiting that warp down the center of her face. That’s one way of using the pins. It’s a really nice way, once you have laid down a warp spline, for you just to go in and make really tiny adjustments to limit areas you don’t want to be warped.
Now, the second use for it is actually as its own warping tool. I am going to delete that and bring in another SplineWarp. This time, I am going to drop some pins around her face and the outside of her hair. It is a nice interactive, quick tool and now you can view this as basically like you have laid out a GridWarp, but without any connecting lines and without it needing to be any particular shape. You now have a point that is much like a GridWarp, but it is also limited by the surrounding points. You still get your offset line here, so you can see where you have come from, your source to and from, using the dotted line. Now I have got these, I can select all of these outer points and scale up the outer part of her face here. If I wanted to limit the effect on our guy, I could drop some extra pins around so that we are really just limiting a small area. That’s a pretty strange effect. We can undo that. Obviously, with the way we have laid this out, we can also select the inner portion and scale in the center of her face, just to really make things look weird. So, you can see there you have two ways of using this Pin Tool. You could either use it as a limiting feature, so you can limit the area of your warps, or you could use it as its own point-based grid warp, which is really fast, really interactive and, with the persistent preview, gives you a really fast feedback.
Hopefully you can see that you have a fully featured tool set here. The warpers have taken a giant leap forward and they have improved in terms of their stability, speed, and their interactivity. Hopefully you guys can sit and have a play with them now 6.3 is out, and reap the benefits. Thanks for watching.