Mango request: added an input node to use track's position in compositor
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 10 Jul 2012 11:01:25 +0000 (11:01 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 10 Jul 2012 11:01:25 +0000 (11:01 +0000)
--
svn merge -r48088:48089 -r48091:48092 ^/branches/soc-2011-tomato

1  2 
source/blender/blenkernel/intern/node.c
source/blender/compositor/CMakeLists.txt
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/nodes/COM_TrackPositionNode.cpp
source/blender/compositor/operations/COM_TrackPositionOperation.cpp
source/blender/compositor/operations/COM_TrackPositionOperation.h
source/blender/editors/space_node/drawnode.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/nodes/CMakeLists.txt

@@@ -121,265 -122,252 +122,268 @@@ Node *Converter::convert(bNode *b_node
  {
        Node *node;
  
 -      if (bNode->flag & NODE_MUTED) {
 -              node = new MuteNode(bNode);
 +      if (b_node->flag & NODE_MUTED) {
 +              node = new MuteNode(b_node);
                return node;
        }
 +      if (fast) {
 +              if (b_node->type == CMP_NODE_BLUR ||
 +                      b_node->type == CMP_NODE_VECBLUR ||
 +                      b_node->type == CMP_NODE_BILATERALBLUR ||
 +                      b_node->type == CMP_NODE_DEFOCUS ||
 +                      b_node->type == CMP_NODE_BOKEHBLUR ||
 +                      b_node->type == CMP_NODE_GLARE ||
 +                      b_node->type == CMP_NODE_DBLUR ||
 +                      b_node->type == CMP_NODE_MOVIEDISTORTION ||
 +                      b_node->type == CMP_NODE_LENSDIST ||
 +                      b_node->type == CMP_NODE_DOUBLEEDGEMASK ||
 +                      b_node->type == CMP_NODE_DILATEERODE) 
 +              {
 +                      return new MuteNode(b_node);
 +              }
 +      }
  
 -      switch (bNode->type) {
 +      switch (b_node->type) {
                case CMP_NODE_COMPOSITE:
 -                      node = new CompositorNode(bNode);
 +                      node = new CompositorNode(b_node);
                        break;
                case CMP_NODE_R_LAYERS:
 -                      node = new RenderLayersNode(bNode);
 +                      node = new RenderLayersNode(b_node);
                        break;
                case CMP_NODE_TEXTURE:
 -                      node = new TextureNode(bNode);
 +                      node = new TextureNode(b_node);
                        break;
                case CMP_NODE_RGBTOBW:
 -                      node = new ColourToBWNode(bNode);
 +                      node = new ColorToBWNode(b_node);
                        break;
                case CMP_NODE_MIX_RGB:
 -                      node = new MixNode(bNode);
 +                      node = new MixNode(b_node);
                        break;
                case CMP_NODE_TRANSLATE:
 -                      node = new TranslateNode(bNode);
 +                      node = new TranslateNode(b_node);
                        break;
                case CMP_NODE_SCALE:
 -                      node = new ScaleNode(bNode);
 +                      node = new ScaleNode(b_node);
                        break;
                case CMP_NODE_ROTATE:
 -                      node = new RotateNode(bNode);
 +                      node = new RotateNode(b_node);
                        break;
                case CMP_NODE_FLIP:
 -                      node = new FlipNode(bNode);
 +                      node = new FlipNode(b_node);
                        break;
                case CMP_NODE_FILTER:
 -                      node = new FilterNode(bNode);
 +                      node = new FilterNode(b_node);
                        break;
                case CMP_NODE_ID_MASK:
 -                      node = new IDMaskNode(bNode);
 +                      node = new IDMaskNode(b_node);
                        break;
                case CMP_NODE_BRIGHTCONTRAST:
 -                      node = new BrightnessNode(bNode);
 +                      node = new BrightnessNode(b_node);
                        break;
                case CMP_NODE_SEPRGBA:
 -                      node = new SeparateRGBANode(bNode);
 +                      node = new SeparateRGBANode(b_node);
                        break;
                case CMP_NODE_COMBRGBA:
 -                      node = new CombineRGBANode(bNode);
 +                      node = new CombineRGBANode(b_node);
                        break;
                case CMP_NODE_SEPHSVA:
 -                      node = new SeparateHSVANode(bNode);
 +                      node = new SeparateHSVANode(b_node);
                        break;
                case CMP_NODE_COMBHSVA:
 -                      node = new CombineHSVANode(bNode);
 +                      node = new CombineHSVANode(b_node);
                        break;
                case CMP_NODE_SEPYUVA:
 -                      node = new SeparateYUVANode(bNode);
 +                      node = new SeparateYUVANode(b_node);
                        break;
                case CMP_NODE_COMBYUVA:
 -                      node = new CombineYUVANode(bNode);
 +                      node = new CombineYUVANode(b_node);
                        break;
                case CMP_NODE_SEPYCCA:
 -                      node = new SeparateYCCANode(bNode);
 +                      node = new SeparateYCCANode(b_node);
                        break;
                case CMP_NODE_COMBYCCA:
 -                      node = new CombineYCCANode(bNode);
 +                      node = new CombineYCCANode(b_node);
                        break;
                case CMP_NODE_ALPHAOVER:
 -                      node = new AlphaOverNode(bNode);
 +                      node = new AlphaOverNode(b_node);
                        break;
                case CMP_NODE_COLORBALANCE:
 -                      node = new ColorBalanceNode(bNode);
 +                      node = new ColorBalanceNode(b_node);
                        break;
                case CMP_NODE_VIEWER:
 -                      node = new ViewerNode(bNode);
 +                      node = new ViewerNode(b_node);
                        break;
                case CMP_NODE_SPLITVIEWER:
 -                      node = new SplitViewerNode(bNode);
 +                      node = new SplitViewerNode(b_node);
                        break;
                case CMP_NODE_INVERT:
 -                      node = new InvertNode(bNode);
 +                      node = new InvertNode(b_node);
                        break;
                case NODE_GROUP:
 -                      node = new GroupNode(bNode);
 +                      node = new GroupNode(b_node);
                        break;
                case CMP_NODE_NORMAL:
 -                      node = new NormalNode(bNode);
 +                      node = new NormalNode(b_node);
                        break;
                case CMP_NODE_NORMALIZE:
 -                      node = new NormalizeNode(bNode);
 +                      node = new NormalizeNode(b_node);
                        break;
                case CMP_NODE_IMAGE:
 -                      node = new ImageNode(bNode);
 +                      node = new ImageNode(b_node);
                        break;
                case CMP_NODE_SETALPHA:
 -                      node = new SetAlphaNode(bNode);
 +                      node = new SetAlphaNode(b_node);
                        break;
                case CMP_NODE_PREMULKEY:
 -                      node = new ConvertAlphaNode(bNode);
 +                      node = new ConvertAlphaNode(b_node);
                        break;
                case CMP_NODE_MATH:
 -                      node = new MathNode(bNode);
 +                      node = new MathNode(b_node);
                        break;
                case CMP_NODE_HUE_SAT:
 -                      node = new HueSaturationValueNode(bNode);
 +                      node = new HueSaturationValueNode(b_node);
                        break;
                case CMP_NODE_COLORCORRECTION:
 -                      node = new ColorCorrectionNode(bNode);
 +                      node = new ColorCorrectionNode(b_node);
                        break;
                case CMP_NODE_MASK_BOX:
 -                      node = new BoxMaskNode(bNode);
 +                      node = new BoxMaskNode(b_node);
                        break;
                case CMP_NODE_MASK_ELLIPSE:
 -                      node = new EllipseMaskNode(bNode);
 +                      node = new EllipseMaskNode(b_node);
                        break;
                case CMP_NODE_GAMMA:
 -                      node = new GammaNode(bNode);
 +                      node = new GammaNode(b_node);
                        break;
                case CMP_NODE_CURVE_RGB:
 -                      node = new ColorCurveNode(bNode);
 +                      node = new ColorCurveNode(b_node);
                        break;
                case CMP_NODE_CURVE_VEC:
 -                      node = new VectorCurveNode(bNode);
 +                      node = new VectorCurveNode(b_node);
                        break;
                case CMP_NODE_HUECORRECT:
 -                      node = new HueSaturationValueCorrectNode(bNode);
 +                      node = new HueSaturationValueCorrectNode(b_node);
                        break;
                case CMP_NODE_MAP_UV:
 -                      node = new MapUVNode(bNode);
 +                      node = new MapUVNode(b_node);
                        break;
                case CMP_NODE_DISPLACE:
 -                      node = new DisplaceNode(bNode);
 +                      node = new DisplaceNode(b_node);
                        break;
                case CMP_NODE_VALTORGB:
 -                      node = new ColorRampNode(bNode);
 +                      node = new ColorRampNode(b_node);
                        break;
                case CMP_NODE_DIFF_MATTE:
 -                      node = new DifferenceMatteNode(bNode);
 +                      node = new DifferenceMatteNode(b_node);
                        break;
                case CMP_NODE_LUMA_MATTE:
 -                      node = new LuminanceMatteNode(bNode);
 +                      node = new LuminanceMatteNode(b_node);
                        break;
                case CMP_NODE_DIST_MATTE:
 -                      node = new DistanceMatteNode(bNode);
 +                      node = new DistanceMatteNode(b_node);
                        break;
                case CMP_NODE_CHROMA_MATTE:
 -                      node = new ChromaMatteNode(bNode);
 +                      node = new ChromaMatteNode(b_node);
                        break;
                case CMP_NODE_COLOR_MATTE:
 -                      node = new ColorMatteNode(bNode);
 +                      node = new ColorMatteNode(b_node);
                        break;
                case CMP_NODE_CHANNEL_MATTE:
 -                      node = new ChannelMatteNode(bNode);
 +                      node = new ChannelMatteNode(b_node);
                        break;
                case CMP_NODE_BLUR:
 -                      node = new BlurNode(bNode);
 +                      node = new BlurNode(b_node);
                        break;
                case CMP_NODE_BOKEHIMAGE:
 -                      node = new BokehImageNode(bNode);
 +                      node = new BokehImageNode(b_node);
                        break;
                case CMP_NODE_BOKEHBLUR:
 -                      node = new BokehBlurNode(bNode);
 +                      node = new BokehBlurNode(b_node);
                        break;
                case CMP_NODE_DILATEERODE:
 -                      node = new DilateErodeNode(bNode);
 +                      node = new DilateErodeNode(b_node);
                        break;
                case CMP_NODE_LENSDIST:
 -                      node = new LensDistortionNode(bNode);
 +                      node = new LensDistortionNode(b_node);
                        break;
                case CMP_NODE_RGB:
 -                      node = new ColorNode(bNode);
 +                      node = new ColorNode(b_node);
                        break;
                case CMP_NODE_VALUE:
 -                      node = new ValueNode(bNode);
 +                      node = new ValueNode(b_node);
                        break;
                case CMP_NODE_TIME:
 -                      node = new TimeNode(bNode);
 +                      node = new TimeNode(b_node);
                        break;
                case CMP_NODE_DBLUR:
 -                      node = new DirectionalBlurNode(bNode);
 +                      node = new DirectionalBlurNode(b_node);
                        break;
                case CMP_NODE_ZCOMBINE:
 -                      node = new ZCombineNode(bNode);
 +                      node = new ZCombineNode(b_node);
                        break;
                case CMP_NODE_TONEMAP:
 -                      node = new TonemapNode(bNode);
 +                      node = new TonemapNode(b_node);
                        break;
                case CMP_NODE_SWITCH:
 -                      node = new SwitchNode(bNode);
 +                      node = new SwitchNode(b_node);
                        break;
                case CMP_NODE_GLARE:
 -                      node = new GlareNode(bNode);
 +                      node = new GlareNode(b_node);
                        break;
                case CMP_NODE_MOVIECLIP:
 -                      node = new MovieClipNode(bNode);
 +                      node = new MovieClipNode(b_node);
                        break;
                case CMP_NODE_COLOR_SPILL:
 -                      node = new ColorSpillNode(bNode);
 +                      node = new ColorSpillNode(b_node);
                        break;
                case CMP_NODE_OUTPUT_FILE:
 -                      node = new OutputFileNode(bNode);
 +                      node = new OutputFileNode(b_node);
                        break;
                case CMP_NODE_MAP_VALUE:
 -                      node = new MapValueNode(bNode);
 +                      node = new MapValueNode(b_node);
                        break;
                case CMP_NODE_TRANSFORM:
 -                      node = new TransformNode(bNode);
 +                      node = new TransformNode(b_node);
                        break;
                case CMP_NODE_STABILIZE2D:
 -                      node = new Stabilize2dNode(bNode);
 +                      node = new Stabilize2dNode(b_node);
                        break;
                case CMP_NODE_BILATERALBLUR:
 -                      node = new BilateralBlurNode(bNode);
 +                      node = new BilateralBlurNode(b_node);
                        break;
                case CMP_NODE_VECBLUR:
 -                      node = new VectorBlurNode(bNode);
 +                      node = new VectorBlurNode(b_node);
                        break;
                case CMP_NODE_MOVIEDISTORTION:
 -                      node = new MovieDistortionNode(bNode);
 +                      node = new MovieDistortionNode(b_node);
                        break;
                case CMP_NODE_VIEW_LEVELS:
 -                      node = new ViewLevelsNode(bNode);
 +                      node = new ViewLevelsNode(b_node);
                        break;
                case CMP_NODE_DEFOCUS:
 -                      node = new DefocusNode(bNode);
 +                      node = new DefocusNode(b_node);
                        break;
                case CMP_NODE_DOUBLEEDGEMASK:
 -                      node = new DoubleEdgeMaskNode(bNode);
 +                      node = new DoubleEdgeMaskNode(b_node);
                        break;
                case CMP_NODE_CROP:
 -                      node = new CropNode(bNode);
 +                      node = new CropNode(b_node);
                        break;
                case CMP_NODE_MASK:
 -                      node = new MaskNode(bNode);
 +                      node = new MaskNode(b_node);
                        break;
                case CMP_NODE_KEYINGSCREEN:
 -                      node = new KeyingScreenNode(bNode);
 +                      node = new KeyingScreenNode(b_node);
                        break;
                case CMP_NODE_KEYING:
 -                      node = new KeyingNode(bNode);
 +                      node = new KeyingNode(b_node);
                        break;
 -                      node = new TrackPositionNode(bNode);
+               case CMP_NODE_TRACKPOS:
++                      node = new TrackPositionNode(b_node);
+                       break;
                /* not inplemented yet */
                default:
 -                      node = new MuteNode(bNode);
 +                      node = new MuteNode(b_node);
                        break;
        }
        return node;
index 0000000,c692bb4..243f63a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,66 +1,68 @@@
+ /*
+  * Copyright 2012, Blender Foundation.
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * Contributor:
+  *            Jeroen Bakker
+  *            Monique Dewanchand
+  *            Sergey Sharybin
+  */
+ #include "COM_TrackPositionNode.h"
+ #include "COM_ExecutionSystem.h"
+ #include "COM_TrackPositionOperation.h"
+ extern "C" {
+       #include "DNA_movieclip_types.h"
+ }
+ TrackPositionNode::TrackPositionNode(bNode *editorNode) : Node(editorNode)
+ {
+       /* pass */
+ }
+ void TrackPositionNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+ {
+       OutputSocket *outputX = this->getOutputSocket(0);
+       OutputSocket *outputY = this->getOutputSocket(1);
+       bNode *editorNode = this->getbNode();
+       MovieClip *clip = (MovieClip *) editorNode->id;
+       NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage;
+       TrackPositionOperation *operationX = new TrackPositionOperation();
+       TrackPositionOperation *operationY = new TrackPositionOperation();
+       operationX->setMovieClip(clip);
+       operationX->setTrackingObject(trackpos_data->tracking_object);
+       operationX->setTrackName(trackpos_data->track_name);
+       operationX->setFramenumber(context->getFramenumber());
+       operationX->setAxis(0);
++      operationX->setRelative(editorNode->custom1);
+       operationY->setMovieClip(clip);
+       operationY->setTrackingObject(trackpos_data->tracking_object);
+       operationY->setTrackName(trackpos_data->track_name);
+       operationY->setFramenumber(context->getFramenumber());
+       operationY->setAxis(1);
++      operationY->setRelative(editorNode->custom1);
+       outputX->relinkConnections(operationX->getOutputSocket());
+       outputY->relinkConnections(operationY->getOutputSocket());
+       graph->addOperation(operationX);
+ }
index 0000000,359e973..cf51640
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,85 +1,100 @@@
+ /*
+  * Copyright 2012, Blender Foundation.
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * Contributor:
+  *            Jeroen Bakker
+  *            Monique Dewanchand
+  *            Sergey Sharybin
+  */
+ #include "COM_TrackPositionOperation.h"
+ #include "MEM_guardedalloc.h"
+ #include "BLI_listbase.h"
+ #include "BLI_math.h"
+ #include "BLI_math_color.h"
+ #include "DNA_scene_types.h"
+ extern "C" {
+       #include "BKE_movieclip.h"
+       #include "BKE_tracking.h"
+ }
+ TrackPositionOperation::TrackPositionOperation() : NodeOperation()
+ {
+       this->addOutputSocket(COM_DT_VALUE);
+       this->movieClip = NULL;
+       this->framenumber = 0;
+       this->trackingObject[0] = 0;
+       this->trackName[0] = 0;
+       this->axis = 0;
++      this->relative = false;
+ }
+ void TrackPositionOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+ {
+       MovieClipUser user = {0};
+       MovieTracking *tracking = &movieClip->tracking;
+       MovieTrackingObject *object = BKE_tracking_object_get_named(tracking, this->trackingObject);
+       MovieTrackingTrack *track;
+       MovieTrackingMarker *marker;
+       int width, height;
+       outputValue[0] = 0.0f;
+       if (!object)
+               return;
+       track = BKE_tracking_track_get_named(tracking, object, this->trackName);
+       if (!track)
+               return;
+       BKE_movieclip_user_set_frame(&user, this->framenumber);
+       BKE_movieclip_get_size(this->movieClip, &user, &width, &height);
+       marker = BKE_tracking_marker_get(track, this->framenumber);
+       outputValue[0] = marker->pos[this->axis];
++      if (this->relative) {
++              int i;
++
++              for (i = 0; i < track->markersnr; i++) {
++                      marker = &track->markers[i];
++
++                      if ((marker->flag & MARKER_DISABLED) == 0) {
++                              outputValue[0] -= marker->pos[this->axis];
++
++                              break;
++                      }
++              }
++      }
++
+       if (this->axis == 0)
+               outputValue[0] *= width;
+       else
+               outputValue[0] *= height;
+ }
+ void TrackPositionOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+ {
+       resolution[0] = preferredResolution[0];
+       resolution[1] = preferredResolution[1];
+ }
index 0000000,5ef745c..caf444d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,67 +1,69 @@@
+ /*
+  * Copyright 2012, Blender Foundation.
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * Contributor:
+  *            Jeroen Bakker
+  *            Monique Dewanchand
+  *            Sergey Sharybin
+  */
+ #ifndef _COM_TrackPositionOperation_h
+ #define _COM_TrackPositionOperation_h
+ #include <string.h>
+ #include "COM_NodeOperation.h"
+ #include "DNA_scene_types.h"
+ #include "DNA_movieclip_types.h"
+ #include "BLI_listbase.h"
+ /**
+   * Class with implementation of green screen gradient rasterization
+   */
+ class TrackPositionOperation : public NodeOperation {
+ protected:
+       MovieClip *movieClip;
+       int framenumber;
+       char trackingObject[64];
+       char trackName[64];
+       int axis;
++      bool relative;
+       /**
+         * Determine the output resolution. The resolution is retrieved from the Renderer
+         */
+       void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+ public:
+       TrackPositionOperation();
+       void setMovieClip(MovieClip *clip) {this->movieClip = clip;}
+       void setTrackingObject(char *object) {strncpy(this->trackingObject, object, sizeof(this->trackingObject));}
+       void setTrackName(char *track) {strncpy(this->trackName, track, sizeof(this->trackName));}
+       void setFramenumber(int framenumber) {this->framenumber = framenumber;}
+       void setAxis(int value) {this->axis = value;}
++      void setRelative(bool value) {this->relative = value;}
+       void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]);
+       const bool isSetOperation() const { return true; }
+ };
+ #endif
@@@ -2525,6 -2467,39 +2526,41 @@@ static void node_composit_buts_keying(u
        uiItemR(layout, ptr, "blur_post", 0, NULL, ICON_NONE);
  }
  
+ static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRNA *ptr)
+ {
+       bNode *node= ptr->data;
+       uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
+       if (node->id) {
+               MovieClip *clip = (MovieClip *) node->id;
+               MovieTracking *tracking = &clip->tracking;
+               MovieTrackingObject *object;
+               uiLayout *col;
+               PointerRNA tracking_ptr;
+               NodeTrackPosData *data = node->storage;
+               RNA_pointer_create(&clip->id, &RNA_MovieTracking, tracking, &tracking_ptr);
+               col = uiLayoutColumn(layout, 0);
+               uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
+               object = BKE_tracking_object_get_named(tracking, data->tracking_object);
+               if (object) {
+                       PointerRNA object_ptr;
+                       RNA_pointer_create(&clip->id, &RNA_MovieTrackingObject, object, &object_ptr);
+                       uiItemPointerR(col, ptr, "track_name", &object_ptr, "tracks", "", ICON_ANIM_DATA);
+               }
+               else {
+                       uiItemR(layout, ptr, "track_name", 0, "", ICON_ANIM_DATA);
+               }
++
++              uiItemR(layout, ptr, "use_relative", 0, NULL, ICON_NONE);
+       }
+ }
  /* only once called */
  static void node_composit_set_butfunc(bNodeType *ntype)
  {
@@@ -3633,21 -3610,33 +3633,50 @@@ static void def_cmp_keying(StructRNA *s
        RNA_def_property_float_sdna(prop, NULL, "edge_kernel_tolerance");
        RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Edge Kernel Tolerance", "Tolerance to pixels inside kernel which are treating as belonging to the same plane");
 -      RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 +      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +
 +      prop = RNA_def_property(srna, "feather_falloff", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "feather_falloff");
 +      RNA_def_property_enum_items(prop, proportional_falloff_curve_only_items);
 +      RNA_def_property_ui_text(prop, "Feather Falloff", "Falloff type the feather");
 +      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +
 +      prop = RNA_def_property(srna, "feather_distance", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "feather_distance");
 +      RNA_def_property_range(prop, -100, 100);
 +      RNA_def_property_ui_text(prop, "Feather Distance", "Distance to grow/shrink the feather");
 +      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
  
+ static void def_cmp_trackpos(StructRNA *srna)
+ {
+       PropertyRNA *prop;
+       prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "id");
+       RNA_def_property_struct_type(prop, "MovieClip");
+       RNA_def_property_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Movie Clip", "");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
++      prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
++      RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
++      RNA_def_property_ui_text(prop, "Relative", "Return relative position to first track's marker");
++      RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
++
+       RNA_def_struct_sdna_from(srna, "NodeTrackPosData", "storage");
+       prop = RNA_def_property(srna, "tracking_object", PROP_STRING, PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "tracking_object");
+       RNA_def_property_ui_text(prop, "Tracking Object", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       prop = RNA_def_property(srna, "track_name", PROP_STRING, PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "track_name");
+       RNA_def_property_ui_text(prop, "Track", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+ }
  /* -- Texture Nodes --------------------------------------------------------- */
  
  static void def_tex_output(StructRNA *srna)
Simple merge