Merging r47624 through r47661 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 10 Jun 2012 09:44:26 +0000 (09:44 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 10 Jun 2012 09:44:26 +0000 (09:44 +0000)
1  2 
source/blender/compositor/CMakeLists.txt
source/blender/editors/space_clip/clip_dopesheet_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/transform/transform.c

index 6fc938c192c1e66930130a24fd891fd0c48c70bd,22f72270734e7a87bc6b8f0562f42e56b4d9e0c4..b9e5c7d385cf70490bf5c1ab32f0e08ed778eb4c
  
  set(INC
        .
+       intern
+       nodes
+       operations
        ../blenkernel
        ../blenlib
+       ../blenlib
+       ../blenloader
+       ../imbuf
        ../makesdna
-       ../render/extern/include
-       ../render/intern/include
        ../makesrna
-       ../blenloader
-       ../blenlib
+       ../opencl
        ../windowmanager
-       ../imbuf
-       ../../../intern/guardedalloc
-       nodes
-       ../nodes/
+       ../nodes
        ../nodes/composite
        ../nodes/intern
-       intern
-       operations
-       ../opencl
+       ../render/extern/include
+       ../render/intern/include
+       ../../../intern/guardedalloc
  )
  
  set(SRC
        operations/COM_QualityStepHelper.h
        operations/COM_QualityStepHelper.cpp
  
- # Internal nodes
      # Internal nodes
        nodes/COM_MuteNode.cpp
        nodes/COM_MuteNode.h
        nodes/COM_GroupNode.cpp
        nodes/COM_SocketProxyNode.cpp
        nodes/COM_SocketProxyNode.h
  
- # input nodes
      # input nodes
        nodes/COM_RenderLayersNode.cpp
        nodes/COM_RenderLayersNode.h
        nodes/COM_ImageNode.cpp
        nodes/COM_MaskNode.cpp
        nodes/COM_MaskNode.h
  
- # output nodes
      # output nodes
        nodes/COM_CompositorNode.cpp
        nodes/COM_CompositorNode.h
        nodes/COM_ViewerNode.cpp
        operations/COM_CalculateMeanOperation.cpp
        operations/COM_CalculateMeanOperation.h
  
- # distort nodes
      # distort nodes
        nodes/COM_TranslateNode.cpp
        nodes/COM_TranslateNode.h
        nodes/COM_ScaleNode.cpp
        nodes/COM_DefocusNode.cpp
        nodes/COM_DefocusNode.h
  
- # color nodes
-               nodes/COM_VectorCurveNode.cpp
-               nodes/COM_VectorCurveNode.h
-               nodes/COM_ColorCurveNode.cpp
-               nodes/COM_ColorCurveNode.h
-               nodes/COM_ColorToBWNode.cpp
-               nodes/COM_ColorToBWNode.h
-               nodes/COM_ColorRampNode.cpp
-               nodes/COM_ColorRampNode.h
-               nodes/COM_MixNode.cpp
-               nodes/COM_MixNode.h
-               nodes/COM_AlphaOverNode.cpp
-               nodes/COM_AlphaOverNode.h
-               nodes/COM_ZCombineNode.cpp
-               nodes/COM_ZCombineNode.h
-               nodes/COM_BrightnessNode.cpp
-               nodes/COM_BrightnessNode.h
-               nodes/COM_ColorBalanceNode.cpp
-               nodes/COM_ColorBalanceNode.h
-               nodes/COM_InvertNode.cpp
-               nodes/COM_InvertNode.h
      # color nodes
+       nodes/COM_VectorCurveNode.cpp
+       nodes/COM_VectorCurveNode.h
+       nodes/COM_ColorCurveNode.cpp
+       nodes/COM_ColorCurveNode.h
+       nodes/COM_ColorToBWNode.cpp
+       nodes/COM_ColorToBWNode.h
+       nodes/COM_ColorRampNode.cpp
+       nodes/COM_ColorRampNode.h
+       nodes/COM_MixNode.cpp
+       nodes/COM_MixNode.h
+       nodes/COM_AlphaOverNode.cpp
+       nodes/COM_AlphaOverNode.h
+       nodes/COM_ZCombineNode.cpp
+       nodes/COM_ZCombineNode.h
+       nodes/COM_BrightnessNode.cpp
+       nodes/COM_BrightnessNode.h
+       nodes/COM_ColorBalanceNode.cpp
+       nodes/COM_ColorBalanceNode.h
+       nodes/COM_InvertNode.cpp
+       nodes/COM_InvertNode.h
        nodes/COM_GammaNode.cpp
        nodes/COM_GammaNode.h
        nodes/COM_SetAlphaNode.cpp
        operations/COM_TonemapOperation.cpp
        operations/COM_TonemapOperation.h
  
- # converter nodes
-               nodes/COM_IDMaskNode.cpp
-               nodes/COM_IDMaskNode.h
-               nodes/COM_SeparateRGBANode.cpp
-               nodes/COM_SeparateRGBANode.h
-               nodes/COM_CombineRGBANode.cpp
-               nodes/COM_CombineRGBANode.h
-               nodes/COM_SeparateHSVANode.cpp
-               nodes/COM_SeparateHSVANode.h
-               nodes/COM_CombineHSVANode.cpp
-               nodes/COM_CombineHSVANode.h
-               nodes/COM_SeparateYUVANode.cpp
-               nodes/COM_SeparateYUVANode.h
-               nodes/COM_CombineYUVANode.cpp
-               nodes/COM_CombineYUVANode.h
-               nodes/COM_SeparateYCCANode.cpp
-               nodes/COM_SeparateYCCANode.h
-               nodes/COM_CombineYCCANode.cpp
-               nodes/COM_CombineYCCANode.h
      # converter nodes
+       nodes/COM_IDMaskNode.cpp
+       nodes/COM_IDMaskNode.h
+       nodes/COM_SeparateRGBANode.cpp
+       nodes/COM_SeparateRGBANode.h
+       nodes/COM_CombineRGBANode.cpp
+       nodes/COM_CombineRGBANode.h
+       nodes/COM_SeparateHSVANode.cpp
+       nodes/COM_SeparateHSVANode.h
+       nodes/COM_CombineHSVANode.cpp
+       nodes/COM_CombineHSVANode.h
+       nodes/COM_SeparateYUVANode.cpp
+       nodes/COM_SeparateYUVANode.h
+       nodes/COM_CombineYUVANode.cpp
+       nodes/COM_CombineYUVANode.h
+       nodes/COM_SeparateYCCANode.cpp
+       nodes/COM_SeparateYCCANode.h
+       nodes/COM_CombineYCCANode.cpp
+       nodes/COM_CombineYCCANode.h
  
        nodes/COM_NormalNode.cpp
        nodes/COM_NormalNode.h
        operations/COM_NormalizeOperation.cpp
        operations/COM_NormalizeOperation.h
  
- # Filter nodes
      # Filter nodes
        nodes/COM_BilateralBlurNode.cpp
        nodes/COM_BilateralBlurNode.h
        operations/COM_BilateralBlurOperation.cpp
        operations/COM_VectorBlurOperation.cpp
        operations/COM_VectorBlurOperation.h
  
-               nodes/COM_FilterNode.cpp
-               nodes/COM_FilterNode.h
-               nodes/COM_DilateErodeNode.cpp
-               nodes/COM_DilateErodeNode.h
+       nodes/COM_FilterNode.cpp
+       nodes/COM_FilterNode.h
+       nodes/COM_DilateErodeNode.cpp
+       nodes/COM_DilateErodeNode.h
        nodes/COM_BlurNode.cpp
        nodes/COM_BlurNode.h
        nodes/COM_BokehBlurNode.cpp
        operations/COM_GammaCorrectOperation.h
        operations/COM_GammaCorrectOperation.cpp
  
- # Matte nodes
      # Matte nodes
        nodes/COM_BoxMaskNode.cpp
        nodes/COM_BoxMaskNode.h
        nodes/COM_EllipseMaskNode.cpp
  
        operations/COM_DoubleEdgeMaskOperation.cpp
        operations/COM_DoubleEdgeMaskOperation.h
- operations/COM_ColorSpillOperation.cpp
- operations/COM_ColorSpillOperation.h
-               operations/COM_RenderLayersBaseProg.cpp
-               operations/COM_RenderLayersBaseProg.h
-               operations/COM_RenderLayersImageProg.cpp
-               operations/COM_RenderLayersImageProg.h
-               operations/COM_RenderLayersAlphaProg.cpp
-               operations/COM_RenderLayersAlphaProg.h
-               operations/COM_RenderLayersDepthProg.cpp
-               operations/COM_RenderLayersDepthProg.h
-               operations/COM_RenderLayersNormalOperation.cpp
-               operations/COM_RenderLayersNormalOperation.h
-               operations/COM_RenderLayersSpeedOperation.cpp
-               operations/COM_RenderLayersSpeedOperation.h
-               operations/COM_RenderLayersColorOperation.cpp
-               operations/COM_RenderLayersColorOperation.h
-               operations/COM_RenderLayersUVOperation.cpp
-               operations/COM_RenderLayersUVOperation.h
-               operations/COM_RenderLayersMistOperation.cpp
-               operations/COM_RenderLayersMistOperation.h
-               operations/COM_RenderLayersObjectIndexOperation.cpp
-               operations/COM_RenderLayersObjectIndexOperation.h
-               operations/COM_RenderLayersMaterialIndexOperation.cpp
-               operations/COM_RenderLayersMaterialIndexOperation.h
-               operations/COM_RenderLayersDiffuseOperation.cpp
-               operations/COM_RenderLayersDiffuseOperation.h
-               operations/COM_RenderLayersSpecularOperation.cpp
-               operations/COM_RenderLayersSpecularOperation.h
-               operations/COM_RenderLayersShadowOperation.cpp
-               operations/COM_RenderLayersShadowOperation.h
-               operations/COM_RenderLayersAOOperation.cpp
-               operations/COM_RenderLayersAOOperation.h
-               operations/COM_RenderLayersEmitOperation.cpp
-               operations/COM_RenderLayersEmitOperation.h
-               operations/COM_RenderLayersReflectionOperation.cpp
-               operations/COM_RenderLayersReflectionOperation.h
-               operations/COM_RenderLayersRefractionOperation.cpp
-               operations/COM_RenderLayersRefractionOperation.h
-               operations/COM_RenderLayersEnvironmentOperation.cpp
-               operations/COM_RenderLayersEnvironmentOperation.h
-               operations/COM_RenderLayersIndirectOperation.cpp
-               operations/COM_RenderLayersIndirectOperation.h
-               operations/COM_RenderLayersCyclesOperation.cpp
-               operations/COM_RenderLayersCyclesOperation.h
 +
++
 +      nodes/COM_KeyingNode.cpp
 +      nodes/COM_KeyingNode.h
 +      nodes/COM_KeyingScreenNode.cpp
 +      nodes/COM_KeyingScreenNode.h
 +      operations/COM_KeyingOperation.cpp
 +      operations/COM_KeyingOperation.h
 +      operations/COM_KeyingScreenOperation.cpp
 +      operations/COM_KeyingScreenOperation.h
 +      operations/COM_KeyingDespillOperation.cpp
 +      operations/COM_KeyingDespillOperation.h
 +      operations/COM_KeyingClipOperation.cpp
 +      operations/COM_KeyingClipOperation.h
 +
+       operations/COM_ColorSpillOperation.cpp
+       operations/COM_ColorSpillOperation.h
+       operations/COM_RenderLayersBaseProg.cpp
+       operations/COM_RenderLayersBaseProg.h
+       operations/COM_RenderLayersImageProg.cpp
+       operations/COM_RenderLayersImageProg.h
+       operations/COM_RenderLayersAlphaProg.cpp
+       operations/COM_RenderLayersAlphaProg.h
+       operations/COM_RenderLayersDepthProg.cpp
+       operations/COM_RenderLayersDepthProg.h
+       operations/COM_RenderLayersNormalOperation.cpp
+       operations/COM_RenderLayersNormalOperation.h
+       operations/COM_RenderLayersSpeedOperation.cpp
+       operations/COM_RenderLayersSpeedOperation.h
+       operations/COM_RenderLayersColorOperation.cpp
+       operations/COM_RenderLayersColorOperation.h
+       operations/COM_RenderLayersUVOperation.cpp
+       operations/COM_RenderLayersUVOperation.h
+       operations/COM_RenderLayersMistOperation.cpp
+       operations/COM_RenderLayersMistOperation.h
+       operations/COM_RenderLayersObjectIndexOperation.cpp
+       operations/COM_RenderLayersObjectIndexOperation.h
+       operations/COM_RenderLayersMaterialIndexOperation.cpp
+       operations/COM_RenderLayersMaterialIndexOperation.h
+       operations/COM_RenderLayersDiffuseOperation.cpp
+       operations/COM_RenderLayersDiffuseOperation.h
+       operations/COM_RenderLayersSpecularOperation.cpp
+       operations/COM_RenderLayersSpecularOperation.h
+       operations/COM_RenderLayersShadowOperation.cpp
+       operations/COM_RenderLayersShadowOperation.h
+       operations/COM_RenderLayersAOOperation.cpp
+       operations/COM_RenderLayersAOOperation.h
+       operations/COM_RenderLayersEmitOperation.cpp
+       operations/COM_RenderLayersEmitOperation.h
+       operations/COM_RenderLayersReflectionOperation.cpp
+       operations/COM_RenderLayersReflectionOperation.h
+       operations/COM_RenderLayersRefractionOperation.cpp
+       operations/COM_RenderLayersRefractionOperation.h
+       operations/COM_RenderLayersEnvironmentOperation.cpp
+       operations/COM_RenderLayersEnvironmentOperation.h
+       operations/COM_RenderLayersIndirectOperation.cpp
+       operations/COM_RenderLayersIndirectOperation.h
+       operations/COM_RenderLayersCyclesOperation.cpp
+       operations/COM_RenderLayersCyclesOperation.h
  
        operations/COM_ImageOperation.cpp
        operations/COM_ImageOperation.h
        operations/COM_BokehImageOperation.h
  
  
-               operations/COM_SocketProxyOperation.h
-               operations/COM_SocketProxyOperation.cpp
+       operations/COM_SocketProxyOperation.h
+       operations/COM_SocketProxyOperation.cpp
  
-               operations/COM_CompositorOperation.h
-               operations/COM_CompositorOperation.cpp
+       operations/COM_CompositorOperation.h
+       operations/COM_CompositorOperation.cpp
        operations/COM_OutputFileOperation.h
        operations/COM_OutputFileOperation.cpp
-               operations/COM_ViewerBaseOperation.h
-               operations/COM_ViewerBaseOperation.cpp
-               operations/COM_ViewerOperation.h
-               operations/COM_ViewerOperation.cpp
-               operations/COM_PreviewOperation.h
-               operations/COM_PreviewOperation.cpp
-               operations/COM_SplitViewerOperation.h
-               operations/COM_SplitViewerOperation.cpp
-               operations/COM_ConvertValueToColourProg.h
-               operations/COM_ConvertValueToColourProg.cpp
-               operations/COM_ConvertColourToValueProg.h
-               operations/COM_ConvertColourToValueProg.cpp
-               operations/COM_ConvertColorToBWOperation.h
-               operations/COM_ConvertColorToBWOperation.cpp
-               operations/COM_ConvertColorToVectorOperation.h
-               operations/COM_ConvertColorToVectorOperation.cpp
-               operations/COM_ConvertValueToVectorOperation.h
-               operations/COM_ConvertValueToVectorOperation.cpp
-               operations/COM_ConvertVectorToColorOperation.h
-               operations/COM_ConvertVectorToColorOperation.cpp
-               operations/COM_ConvertVectorToValueOperation.h
-               operations/COM_ConvertVectorToValueOperation.cpp
- operations/COM_ConvertDepthToRadiusOperation.h
- operations/COM_ConvertDepthToRadiusOperation.cpp
-               operations/COM_ZCombineOperation.cpp
-               operations/COM_ZCombineOperation.h
+       operations/COM_ViewerBaseOperation.h
+       operations/COM_ViewerBaseOperation.cpp
+       operations/COM_ViewerOperation.h
+       operations/COM_ViewerOperation.cpp
+       operations/COM_PreviewOperation.h
+       operations/COM_PreviewOperation.cpp
+       operations/COM_SplitViewerOperation.h
+       operations/COM_SplitViewerOperation.cpp
+       operations/COM_ConvertValueToColourProg.h
+       operations/COM_ConvertValueToColourProg.cpp
+       operations/COM_ConvertColourToValueProg.h
+       operations/COM_ConvertColourToValueProg.cpp
+       operations/COM_ConvertColorToBWOperation.h
+       operations/COM_ConvertColorToBWOperation.cpp
+       operations/COM_ConvertColorToVectorOperation.h
+       operations/COM_ConvertColorToVectorOperation.cpp
+       operations/COM_ConvertValueToVectorOperation.h
+       operations/COM_ConvertValueToVectorOperation.cpp
+       operations/COM_ConvertVectorToColorOperation.h
+       operations/COM_ConvertVectorToColorOperation.cpp
+       operations/COM_ConvertVectorToValueOperation.h
+       operations/COM_ConvertVectorToValueOperation.cpp
      operations/COM_ConvertDepthToRadiusOperation.h
      operations/COM_ConvertDepthToRadiusOperation.cpp
+       operations/COM_ZCombineOperation.cpp
+       operations/COM_ZCombineOperation.h
  
        operations/COM_ConvertRGBToYCCOperation.h
        operations/COM_ConvertRGBToYCCOperation.cpp
        operations/COM_GammaOperation.h
        operations/COM_ColorCorrectionOperation.cpp
        operations/COM_ColorCorrectionOperation.h
-               operations/COM_SetValueOperation.h
-               operations/COM_SetValueOperation.cpp
-               operations/COM_SetColorOperation.h
-               operations/COM_SetColorOperation.cpp
-               operations/COM_SetVectorOperation.h
-               operations/COM_SetVectorOperation.cpp
-               operations/COM_MixBurnOperation.h
-               operations/COM_MixBurnOperation.cpp
-               operations/COM_MixColorOperation.h
-               operations/COM_MixColorOperation.cpp
-               operations/COM_MixDarkenOperation.h
-               operations/COM_MixDarkenOperation.cpp
-               operations/COM_MixDodgeOperation.h
-               operations/COM_MixDodgeOperation.cpp
-               operations/COM_MixDifferenceOperation.h
-               operations/COM_MixDifferenceOperation.cpp
-               operations/COM_MixDivideOperation.h
-               operations/COM_MixDivideOperation.cpp
-               operations/COM_MixHueOperation.h
-               operations/COM_MixHueOperation.cpp
-               operations/COM_MixLightenOperation.h
-               operations/COM_MixLightenOperation.cpp
-               operations/COM_MixLinearLightOperation.h
-               operations/COM_MixLinearLightOperation.cpp
-               operations/COM_MixOverlayOperation.h
-               operations/COM_MixOverlayOperation.cpp
-               operations/COM_MixSaturationOperation.h
-               operations/COM_MixSaturationOperation.cpp
-               operations/COM_MixScreenOperation.h
-               operations/COM_MixScreenOperation.cpp
-               operations/COM_MixSoftLightOperation.h
-               operations/COM_MixSoftLightOperation.cpp
-               operations/COM_MixValueOperation.h
-               operations/COM_MixValueOperation.cpp
-               operations/COM_MixSubtractOperation.h
-               operations/COM_MixSubtractOperation.cpp
+       operations/COM_SetValueOperation.h
+       operations/COM_SetValueOperation.cpp
+       operations/COM_SetColorOperation.h
+       operations/COM_SetColorOperation.cpp
+       operations/COM_SetVectorOperation.h
+       operations/COM_SetVectorOperation.cpp
+       operations/COM_MixBurnOperation.h
+       operations/COM_MixBurnOperation.cpp
+       operations/COM_MixColorOperation.h
+       operations/COM_MixColorOperation.cpp
+       operations/COM_MixDarkenOperation.h
+       operations/COM_MixDarkenOperation.cpp
+       operations/COM_MixDodgeOperation.h
+       operations/COM_MixDodgeOperation.cpp
+       operations/COM_MixDifferenceOperation.h
+       operations/COM_MixDifferenceOperation.cpp
+       operations/COM_MixDivideOperation.h
+       operations/COM_MixDivideOperation.cpp
+       operations/COM_MixHueOperation.h
+       operations/COM_MixHueOperation.cpp
+       operations/COM_MixLightenOperation.h
+       operations/COM_MixLightenOperation.cpp
+       operations/COM_MixLinearLightOperation.h
+       operations/COM_MixLinearLightOperation.cpp
+       operations/COM_MixOverlayOperation.h
+       operations/COM_MixOverlayOperation.cpp
+       operations/COM_MixSaturationOperation.h
+       operations/COM_MixSaturationOperation.cpp
+       operations/COM_MixScreenOperation.h
+       operations/COM_MixScreenOperation.cpp
+       operations/COM_MixSoftLightOperation.h
+       operations/COM_MixSoftLightOperation.cpp
+       operations/COM_MixValueOperation.h
+       operations/COM_MixValueOperation.cpp
+       operations/COM_MixSubtractOperation.h
+       operations/COM_MixSubtractOperation.cpp
  
        operations/COM_MathBaseOperation.h
        operations/COM_MathBaseOperation.cpp
  
-               operations/COM_AlphaOverMixedOperation.h
-               operations/COM_AlphaOverMixedOperation.cpp
-               operations/COM_AlphaOverPremultiplyOperation.h
-               operations/COM_AlphaOverPremultiplyOperation.cpp
-               operations/COM_AlphaOverKeyOperation.h
-               operations/COM_AlphaOverKeyOperation.cpp
-               operations/COM_ColorBalanceLGGOperation.h
-               operations/COM_ColorBalanceLGGOperation.cpp
-               operations/COM_ColorBalanceASCCDLOperation.h
-               operations/COM_ColorBalanceASCCDLOperation.cpp
-               operations/COM_InvertOperation.cpp
-               operations/COM_InvertOperation.h
+       operations/COM_AlphaOverMixedOperation.h
+       operations/COM_AlphaOverMixedOperation.cpp
+       operations/COM_AlphaOverPremultiplyOperation.h
+       operations/COM_AlphaOverPremultiplyOperation.cpp
+       operations/COM_AlphaOverKeyOperation.h
+       operations/COM_AlphaOverKeyOperation.cpp
+       operations/COM_ColorBalanceLGGOperation.h
+       operations/COM_ColorBalanceLGGOperation.cpp
+       operations/COM_ColorBalanceASCCDLOperation.h
+       operations/COM_ColorBalanceASCCDLOperation.cpp
+       operations/COM_InvertOperation.cpp
+       operations/COM_InvertOperation.h
        operations/COM_SetAlphaOperation.cpp
        operations/COM_SetAlphaOperation.h
        operations/COM_MapValueOperation.cpp
        operations/COM_MapValueOperation.h
  
- # Distort operation
-               operations/COM_TranslateOperation.h
-               operations/COM_TranslateOperation.cpp
-               operations/COM_RotateOperation.h
-               operations/COM_RotateOperation.cpp
-               operations/COM_ScaleOperation.h
-               operations/COM_ScaleOperation.cpp
-               operations/COM_MapUVOperation.h
-               operations/COM_MapUVOperation.cpp
-               operations/COM_DisplaceOperation.h
-               operations/COM_DisplaceOperation.cpp
-               operations/COM_DisplaceSimpleOperation.h
-               operations/COM_DisplaceSimpleOperation.cpp
-               operations/COM_FlipOperation.h
-               operations/COM_FlipOperation.cpp
-               operations/COM_ProjectorLensDistortionOperation.cpp
-               operations/COM_ProjectorLensDistortionOperation.h
-               operations/COM_ScreenLensDistortionOperation.cpp
-               operations/COM_ScreenLensDistortionOperation.h
- #Filter operations
      # Distort operation
+       operations/COM_TranslateOperation.h
+       operations/COM_TranslateOperation.cpp
+       operations/COM_RotateOperation.h
+       operations/COM_RotateOperation.cpp
+       operations/COM_ScaleOperation.h
+       operations/COM_ScaleOperation.cpp
+       operations/COM_MapUVOperation.h
+       operations/COM_MapUVOperation.cpp
+       operations/COM_DisplaceOperation.h
+       operations/COM_DisplaceOperation.cpp
+       operations/COM_DisplaceSimpleOperation.h
+       operations/COM_DisplaceSimpleOperation.cpp
+       operations/COM_FlipOperation.h
+       operations/COM_FlipOperation.cpp
+       operations/COM_ProjectorLensDistortionOperation.cpp
+       operations/COM_ProjectorLensDistortionOperation.h
+       operations/COM_ScreenLensDistortionOperation.cpp
+       operations/COM_ScreenLensDistortionOperation.h
      #Filter operations
        operations/COM_ConvolutionFilterOperation.h
        operations/COM_ConvolutionFilterOperation.cpp
        operations/COM_ConvolutionEdgeFilterOperation.h
        operations/COM_SetSamplerOperation.h
  
  
- #Convert operations
      #Convert operations
        operations/COM_IDMaskOperation.cpp
        operations/COM_IDMaskOperation.h
  
  
        operations/COM_DotproductOperation.cpp
        operations/COM_DotproductOperation.h
- # Matte operation
+       # Matte operation
        operations/COM_BoxMaskOperation.h
        operations/COM_BoxMaskOperation.cpp
        operations/COM_EllipseMaskOperation.h
index 499eae75a73ca394361f3827529200b28e70ebd8,914e82472bbc023377134a86d3ce482d4d3a17ba..7b0b1eb170f823eeed1d88df74a7cd54591747d0
@@@ -25,7 -25,7 +25,7 @@@
   * ***** END GPL LICENSE BLOCK *****
   */
  
- /** \file blender/editors/space_clip/clip_graph_ops.c
+ /** \file blender/editors/space_clip/clip_dopesheet_ops.c
   *  \ingroup spclip
   */
  
  
  #include "clip_intern.h"      // own include
  
 +#if 0
 +static int ED_space_clip_dopesheet_poll(bContext *C)
 +{
 +      SpaceClip *sc = CTX_wm_space_clip(C);
 +
 +      if (sc && sc->clip) {
 +              if (sc->view == SC_VIEW_DOPESHEET) {
 +                      ARegion *ar = CTX_wm_region(C);
 +
 +                      return ar->regiontype == RGN_TYPE_PREVIEW;
 +              }
 +      }
 +
 +      return FALSE;
 +}
 +#endif
 +
  /********************** select channel operator *********************/
  
  static int dopesheet_select_channel_poll(bContext *C)
index 65d2b8f23b32ab70a70bf3cf74c8fe63411bc98f,08fc84d193c5456e0a9f8135c17df8117ca4113c..f6e9622f0a53b071d18925ed7c5407f0f474b761
@@@ -79,8 -79,6 +79,8 @@@
  
  #include "clip_intern.h"      // own include
  
 +static float dist_to_crns(float co[2], float pos[2], float crns[4][2]);
 +
  /********************** add marker operator *********************/
  
  static void add_marker(SpaceClip *sc, float x, float y)
@@@ -262,16 -260,15 +262,16 @@@ typedef struct 
  
        int mval[2];
        int width, height;
 -      float *min, *max, *pos, *offset;
 -      float smin[2], smax[2], spos[2], soff[2];
 +      float *min, *max, *pos, *offset, (*corners)[2];
 +      float smin[2], smax[2], spos[2], soff[2], scorners[4][2];
        float (*smarkers)[2];
  
 -      int lock, accurate;
 +      int lock, accurate, scale;
  } SlideMarkerData;
  
  static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTrack *track,
 -                      MovieTrackingMarker *marker, wmEvent *event, int area, int action, int width, int height)
 +                                                 MovieTrackingMarker *marker, wmEvent *event,
 +                                                                                               int area, int corner, int action, int width, int height)
  {
        SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data");
        int framenr = ED_space_clip_clip_framenr(sc);
        }
        else if (area == TRACK_AREA_PAT) {
                if (action == SLIDE_ACTION_SIZE) {
 -                      data->min = track->pat_min;
 -                      data->max = track->pat_max;
 +                      data->corners = marker->pattern_corners;
                }
 -              else {
 +              else if (action == SLIDE_ACTION_OFFSET) {
                        int a;
  
                        data->pos = marker->pos;
                        for (a = 0; a < track->markersnr; a++)
                                copy_v2_v2(data->smarkers[a], track->markers[a].pos);
                }
 +              else if (action == SLIDE_ACTION_POS) {
 +                      data->corners = marker->pattern_corners;
 +                      data->pos = marker->pattern_corners[corner];
 +
 +                      copy_v2_v2(data->spos, data->pos);
 +              }
        }
        else if (area == TRACK_AREA_SEARCH) {
 -              data->min = track->search_min;
 -              data->max = track->search_max;
 +              data->min = marker->search_min;
 +              data->max = marker->search_max;
        }
  
 -      if (area == TRACK_AREA_SEARCH || (area == TRACK_AREA_PAT && action != SLIDE_ACTION_OFFSET)) {
 -              copy_v2_v2(data->smin, data->min);
 -              copy_v2_v2(data->smax, data->max);
 +      if ((area == TRACK_AREA_SEARCH) ||
 +              (area == TRACK_AREA_PAT && action != SLIDE_ACTION_OFFSET))
 +      {
 +              if (data->corners) {
 +                      memcpy(data->scorners, data->corners, sizeof(data->scorners));
 +              }
 +              else {
 +                      copy_v2_v2(data->smin, data->min);
 +                      copy_v2_v2(data->smax, data->max);
 +              }
        }
  
        data->mval[0] = event->mval[0];
        return data;
  }
  
 -/* corner = 0: right-bottom corner,
 - * corner = 1: left-top corner */
 -static int mouse_on_corner(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
 +static int mouse_on_corner(SpaceClip *sc, MovieTrackingMarker *marker,
                             int area, float co[2], int corner, int width, int height)
  {
        int inside = 0;
        float crn[2], dx, dy, tdx, tdy;
  
        if (area == TRACK_AREA_SEARCH) {
 -              copy_v2_v2(min, track->search_min);
 -              copy_v2_v2(max, track->search_max);
 +              copy_v2_v2(min, marker->search_min);
 +              copy_v2_v2(max, marker->search_max);
        }
        else {
 -              copy_v2_v2(min, track->pat_min);
 -              copy_v2_v2(max, track->pat_max);
 +              BKE_tracking_marker_pattern_minmax(marker, min, max);
        }
  
        dx = size / width / sc->zoom;
        return inside;
  }
  
 +static int get_mouse_pattern_corner(SpaceClip *sc, MovieTrackingMarker *marker, float co[2], int width, int height)
 +{
 +      int i, next;
 +      float len = FLT_MAX, dx, dy;
 +
 +      for (i = 0; i < 4; i++) {
 +              float cur_len;
 +
 +              next = (i + 1) % 4;
 +
 +              cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]);
 +
 +              len = MIN2(cur_len, len);
 +      }
 +
 +      dx = 6.0f / width / sc->zoom;
 +      dy = 6.0f / height / sc->zoom;
 +
 +      dx = MIN2(dx * 2.0f / 3.0f, len / 6.0f);
 +      dy = MIN2(dy * 2.0f / 3.0f, len * width / height / 6.0f);
 +
 +      for (i = 0; i < 4; i++) {
 +              float crn[2];
 +              int inside;
 +
 +              add_v2_v2v2(crn, marker->pattern_corners[i], marker->pos);
 +
 +              inside = IN_RANGE_INCL(co[0], crn[0] - dx, crn[0] + dx) &&
 +                       IN_RANGE_INCL(co[1], crn[1] - dy, crn[1] + dy);
 +
 +              if (inside)
 +                      return i;
 +      }
 +
 +      return -1;
 +}
 +
  static int mouse_on_offset(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
 -                      float co[2], int width, int height)
 +                           float co[2], int width, int height)
  {
        float pos[2], dx, dy;
 +      float pat_min[2], pat_max[2];
 +
 +      BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
  
        add_v2_v2v2(pos, marker->pos, track->offset);
  
        dx = 12.0f / width / sc->zoom;
        dy = 12.0f / height / sc->zoom;
  
 -      dx = MIN2(dx, (track->pat_max[0] - track->pat_min[0]) / 2.0f);
 -      dy = MIN2(dy, (track->pat_max[1] - track->pat_min[1]) / 2.0f);
 +      dx = MIN2(dx, (pat_max[0] - pat_min[0]) / 2.0f);
 +      dy = MIN2(dy, (pat_max[1] - pat_min[1]) / 2.0f);
  
        return co[0] >= pos[0] - dx && co[0] <= pos[0] + dx && co[1] >= pos[1] - dy && co[1] <= pos[1] + dy;
  }
  
 +static int slide_check_corners(float (*corners)[2])
 +{
 +      int i, next, prev;
 +      float cross = 0.0f;
 +      float p[2] = {0.0f, 0.0f};
 +
 +      if (!isect_point_quad_v2(p, corners[0], corners[1], corners[2], corners[3]))
 +              return FALSE;
 +
 +      for (i = 0; i < 4; i++) {
 +              float v1[2], v2[2], cur_cross;
 +
 +              next = (i + 1) % 4;
 +              prev = (4 + i - 1) % 4;
 +
 +              sub_v2_v2v2(v1, corners[i], corners[prev]);
 +              sub_v2_v2v2(v2, corners[next], corners[i]);
 +
 +              cur_cross = cross_v2v2(v1, v2);
 +
 +              if (fabsf(cur_cross) > FLT_EPSILON) {
 +                      if (cross == 0.0f) {
 +                              cross = cur_cross;
 +                      }
 +                      else if (cross * cur_cross < 0.0f) {
 +                              return FALSE;
 +                      }
 +              }
 +      }
 +
 +      return TRUE;
 +}
 +
  static void hide_cursor(bContext *C)
  {
        wmWindow *win = CTX_wm_window(C);
@@@ -509,45 -424,28 +509,45 @@@ static void *slide_marker_customdata(bC
                        MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
  
                        if ((marker->flag & MARKER_DISABLED) == 0) {
 -                              if (!customdata)
 +                              if (!customdata) {
                                        if (mouse_on_offset(sc, track, marker, co, width, height))
 -                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT,
 +                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT, 0,
                                                                                      SLIDE_ACTION_POS, width, height);
 +                              }
  
                                if (sc->flag & SC_SHOW_MARKER_SEARCH) {
 -                                      if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height))
 -                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH,
 +                                      if (mouse_on_corner(sc, marker, TRACK_AREA_SEARCH, co, 1, width, height)) {
 +                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, 0,
                                                                                      SLIDE_ACTION_OFFSET, width, height);
 -                                      else if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height))
 -                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH,
 +                                      }
 +                                      else if (mouse_on_corner(sc, marker, TRACK_AREA_SEARCH, co, 0, width, height)) {
 +                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, 0,
                                                                                      SLIDE_ACTION_SIZE, width, height);
 +                                      }
                                }
  
                                if (!customdata && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
 -                                      if (mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1,  width, height))
 -                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT,
 -                                                              SLIDE_ACTION_OFFSET, width, height);
 -
 -                                      if (!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height))
 -                                              customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT,
 -                                                                                    SLIDE_ACTION_SIZE, width, height);
 +                                      /* XXX: need to be real check if affine tracking is enabled, but for now not
 +                                       *      sure how to do this, so assume affine tracker is always enabled */
 +                                      if (TRUE) {
 +                                              int corner = get_mouse_pattern_corner(sc, marker, co, width, height);
 +
 +                                              if (corner != -1) {
 +                                                      customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, corner,
 +                                                                                            SLIDE_ACTION_POS, width, height);
 +                                              }
 +                                      }
 +                                      else {
 +                                              if (mouse_on_corner(sc, marker, TRACK_AREA_PAT, co, 1,  width, height)) {
 +                                                      customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, 0,
 +                                                                                            SLIDE_ACTION_OFFSET, width, height);
 +                                              }
 +
 +                                              if (!customdata && mouse_on_corner(sc, marker, TRACK_AREA_PAT, co, 0, width, height)) {
 +                                                      customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, 0,
 +                                                                                            SLIDE_ACTION_SIZE, width, height);
 +                                              }
 +                                      }
                                }
  
                                if (customdata)
@@@ -595,16 -493,9 +595,16 @@@ static void cancel_mouse_slide(SlideMar
                        copy_v2_v2(data->pos, data->spos);
        }
        else {
 -              if (data->action == SLIDE_ACTION_SIZE) {
 -                      copy_v2_v2(data->min, data->smin);
 -                      copy_v2_v2(data->max, data->smax);
 +              if ((data->action == SLIDE_ACTION_SIZE) ||
 +                  (data->action == SLIDE_ACTION_POS && data->area == TRACK_AREA_PAT))
 +              {
 +                      if (data->corners) {
 +                              memcpy(data->corners, data->scorners, sizeof(data->scorners));
 +                      }
 +                      else {
 +                              copy_v2_v2(data->min, data->smin);
 +                              copy_v2_v2(data->max, data->smax);
 +                      }
                }
                else {
                        int a;
@@@ -640,10 -531,6 +640,10 @@@ static int slide_marker_modal(bContext 
                                if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
                                        data->lock = event->val == KM_RELEASE;
  
 +                      if (data->action == SLIDE_ACTION_POS)
 +                              if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
 +                                      data->scale = event->val == KM_PRESS;
 +
                        if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
                                data->accurate = event->val == KM_PRESS;
  
                                else {
                                        data->pos[0] = data->spos[0] + dx;
                                        data->pos[1] = data->spos[1] + dy;
 -
 -                                      data->marker->flag &= ~MARKER_TRACKED;
                                }
  
                                WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
                        }
                        else {
                                if (data->action == SLIDE_ACTION_SIZE) {
 -                                      data->min[0] = data->smin[0] - dx;
 -                                      data->max[0] = data->smax[0] + dx;
 +                                      if (data->corners) {
 +                                              data->corners[0][0] = data->scorners[0][0] - dx;
 +                                              data->corners[0][1] = data->scorners[0][1] + dy;
 +
 +                                              data->corners[1][0] = data->scorners[1][0] + dx;
 +                                              data->corners[1][1] = data->scorners[1][1] + dy;
  
 -                                      data->min[1] = data->smin[1] + dy;
 -                                      data->max[1] = data->smax[1] - dy;
 +                                              data->corners[2][0] = data->scorners[2][0] + dx;
 +                                              data->corners[2][1] = data->scorners[2][1] - dy;
 +
 +                                              data->corners[3][0] = data->scorners[3][0] - dx;
 +                                              data->corners[3][1] = data->scorners[3][1] - dy;
 +                                      }
 +                                      else {
 +                                              data->min[0] = data->smin[0] - dx;
 +                                              data->max[0] = data->smax[0] + dx;
 +
 +                                              data->min[1] = data->smin[1] + dy;
 +                                              data->max[1] = data->smax[1] - dy;
 +                                      }
  
                                        if (data->area == TRACK_AREA_SEARCH)
 -                                              BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_DIM);
 +                                              BKE_tracking_clamp_marker(data->marker, CLAMP_SEARCH_DIM);
                                        else
 -                                              BKE_tracking_clamp_track(data->track, CLAMP_PAT_DIM);
 +                                              BKE_tracking_clamp_marker(data->marker, CLAMP_PAT_DIM);
                                }
 -                              else {
 +                              else if (data->action == SLIDE_ACTION_OFFSET) {
                                        float d[2] = {dx, dy};
  
                                        if (data->area == TRACK_AREA_SEARCH) {
                                        }
  
                                        if (data->area == TRACK_AREA_SEARCH)
 -                                              BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_POS);
 +                                              BKE_tracking_clamp_marker(data->marker, CLAMP_SEARCH_POS);
 +                              }
 +                              else if (data->action == SLIDE_ACTION_POS) {
 +                                      if (data->scale) {
 +                                              float scale = 1.0f + 10.0f * (dx - dy);
 +
 +                                              if (scale > 0.0f) {
 +                                                      int a;
 +
 +                                                      for (a = 0; a < 4; a++) {
 +                                                              mul_v2_v2fl(data->corners[a], data->scorners[a], scale);
 +                                                      }
 +                                              }
 +                                      }
 +                                      else {
 +                                              float spos[2];
 +
 +                                              copy_v2_v2(spos, data->pos);
 +
 +                                              /* corners might've been scaled before, restore their original position */
 +                                              memcpy(data->corners, data->scorners, sizeof(data->scorners));
 +
 +                                              data->pos[0] = data->spos[0] + dx;
 +                                              data->pos[1] = data->spos[1] + dy;
 +
 +                                              if (!slide_check_corners(data->corners)) {
 +                                                      copy_v2_v2(data->pos, spos);
 +                                              }
 +                                      }
 +
 +                                      /* currently only patterns are allowed to have such combination of event and data */
 +                                      BKE_tracking_clamp_marker(data->marker, CLAMP_PAT_DIM);
                                }
                        }
  
 +                      data->marker->flag &= ~MARKER_TRACKED;
 +
                        WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
  
                        break;
@@@ -832,41 -673,31 +832,41 @@@ static int mouse_on_rect(float co[2], f
               mouse_on_side(co, pos[0] + max[0], pos[1] + min[1], pos[0] + max[0], pos[1] + max[1], epsx, epsy);
  }
  
 +static int mouse_on_crns(float co[2], float pos[2], float crns[4][2], float epsx, float epsy)
 +{
 +      float dist = dist_to_crns(co, pos, crns);
 +
 +      return dist < MAX2(epsx, epsy);
 +}
 +
  static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *track)
  {
        int framenr = ED_space_clip_clip_framenr(sc);
        MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
 +      float pat_min[2], pat_max[2];
        float epsx, epsy;
        int width, height;
  
        ED_space_clip_size(sc, &width, &height);
  
 -      epsx = MIN4(track->pat_min[0] - track->search_min[0], track->search_max[0] - track->pat_max[0],
 -                 fabsf(track->pat_min[0]), fabsf(track->pat_max[0])) / 2;
 -      epsy = MIN4(track->pat_min[1] - track->search_min[1], track->search_max[1] - track->pat_max[1],
 -                 fabsf(track->pat_min[1]), fabsf(track->pat_max[1])) / 2;
 +      BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
 +
 +      epsx = MIN4(pat_min[0] - marker->search_min[0], marker->search_max[0] - pat_max[0],
 +                  fabsf(pat_min[0]), fabsf(pat_max[0])) / 2;
 +      epsy = MIN4(pat_min[1] - marker->search_min[1], marker->search_max[1] - pat_max[1],
 +                  fabsf(pat_min[1]), fabsf(pat_max[1])) / 2;
  
        epsx = MAX2(epsx, 2.0f / width);
        epsy = MAX2(epsy, 2.0f / height);
  
        if (sc->flag & SC_SHOW_MARKER_SEARCH) {
 -              if (mouse_on_rect(co, marker->pos, track->search_min, track->search_max, epsx, epsy))
 +              if (mouse_on_rect(co, marker->pos, marker->search_min, marker->search_max, epsx, epsy))
                        return TRACK_AREA_SEARCH;
        }
  
        if ((marker->flag & MARKER_DISABLED) == 0) {
                if (sc->flag & SC_SHOW_MARKER_PATTERN)
 -                      if (mouse_on_rect(co, marker->pos, track->pat_min, track->pat_max, epsx, epsy))
 +                      if (mouse_on_crns(co, marker->pos, marker->pattern_corners, epsx, epsy))
                                return TRACK_AREA_PAT;
  
                epsx = 12.0f / width;
@@@ -897,21 -728,6 +897,21 @@@ static float dist_to_rect(float co[2], 
        return MIN4(d1, d2, d3, d4);
  }
  
 +static float dist_to_crns(float co[2], float pos[2], float crns[4][2])
 +{
 +      float d1, d2, d3, d4;
 +      float p[2] = {co[0] - pos[0], co[1] - pos[1]};
 +      float *v1 = crns[0], *v2 = crns[1],
 +            *v3 = crns[2], *v4 = crns[3];
 +
 +      d1 = dist_to_line_segment_v2(p, v1, v2);
 +      d2 = dist_to_line_segment_v2(p, v2, v3);
 +      d3 = dist_to_line_segment_v2(p, v3, v4);
 +      d4 = dist_to_line_segment_v2(p, v4, v1);
 +
 +      return MIN4(d1, d2, d3, d4);
 +}
 +
  static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbase, float co[2])
  {
        MovieTrackingTrack *track = NULL, *cur;
  
                        /* distance to marker point */
                        d1 = sqrtf((co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
 -                                        (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
 +                                         (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
  
                        /* distance to pattern boundbox */
                        if (sc->flag & SC_SHOW_MARKER_PATTERN)
 -                              d2 = dist_to_rect(co, marker->pos, cur->pat_min, cur->pat_max);
 +                              d2 = dist_to_crns(co, marker->pos, marker->pattern_corners);
  
                        /* distance to search boundbox */
                        if (sc->flag & SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur))
 -                              d3 = dist_to_rect(co, marker->pos, cur->search_min, cur->search_max);
 +                              d3 = dist_to_rect(co, marker->pos, marker->search_min, marker->search_max);
  
                        /* choose minimal distance. useful for cases of overlapped markers. */
                        dist = MIN3(d1, d2, d3);
@@@ -1045,8 -861,7 +1045,8 @@@ void CLIP_OT_select(wmOperatorType *ot
        /* api callbacks */
        ot->exec = select_exec;
        ot->invoke = select_invoke;
 -      ot->poll = ED_space_clip_tracking_poll;
 +      //ot->poll = ED_space_clip_tracking_poll; // so mask view can Ctrl+RMB markers
 +      ot->poll = ED_space_clip_view_clip_poll;
  
        /* flags */
        ot->flag = OPTYPE_UNDO;
@@@ -2325,14 -2140,17 +2325,17 @@@ static int set_orientation_poll(bContex
        if (sc) {
                Scene *scene = CTX_data_scene(C);
                MovieClip *clip = ED_space_clip(sc);
-               MovieTracking *tracking = &clip->tracking;
-               MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
  
-               if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
-                       return TRUE;
-               }
-               else {
-                       return OBACT != NULL;
+               if (clip) {
+                       MovieTracking *tracking = &clip->tracking;
+                       MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
+                       if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
+                               return TRUE;
+                       }
+                       else {
+                               return OBACT != NULL;
+                       }
                }
        }
  
@@@ -2935,10 -2753,13 +2938,13 @@@ static int set_solution_scale_poll(bCon
  
        if (sc) {
                MovieClip *clip = ED_space_clip(sc);
-               MovieTracking *tracking = &clip->tracking;
-               MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
  
-               return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
+               if (clip) {
+                       MovieTracking *tracking = &clip->tracking;
+                       MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
+                       return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
+               }
        }
  
        return FALSE;
index 1a6ec2813fa46da19492787912c68b8ef79efc31,12c369874fea299d95aac15d157de415e0be73ee..aed282e4a4a7803b91d3212c8040b60142fdb3fd
@@@ -1442,18 -1442,16 +1442,16 @@@ static void node_shader_set_butfunc(bNo
  static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
  {
        bNode *node = ptr->data;
-       PointerRNA imaptr;
-       PropertyRNA *prop;
+       PointerRNA imaptr, iuserptr;
        
        uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL);
        
        if (!node->id) return;
        
-       prop = RNA_struct_find_property(ptr, "image");
-       if (!prop || RNA_property_type(prop) != PROP_POINTER) return;
-       imaptr = RNA_property_pointer_get(ptr, prop);
+       imaptr = RNA_pointer_get(ptr, "image");
+       RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr);
        
-       node_buts_image_user(layout, C, &imaptr, ptr);
+       node_buts_image_user(layout, C, &imaptr, &iuserptr);
  }
  
  static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@@ -2425,36 -2423,6 +2423,36 @@@ static void node_composit_buts_mask(uiL
        uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL);
  }
  
 +static void node_composit_buts_keyingscreen(uiLayout *layout, bContext *C, PointerRNA *ptr)
 +{
 +      bNode *node= ptr->data;
 +
 +      uiTemplateID(layout, C, ptr, "clip", NULL, NULL, NULL);
 +
 +      if (node->id) {
 +              MovieClip *clip = (MovieClip *) node->id;
 +              uiLayout *col;
 +              PointerRNA tracking_ptr;
 +
 +              RNA_pointer_create(&clip->id, &RNA_MovieTracking, &clip->tracking, &tracking_ptr);
 +
 +              col = uiLayoutColumn(layout, 1);
 +              uiItemPointerR(col, ptr, "tracking_object", &tracking_ptr, "objects", "", ICON_OBJECT_DATA);
 +      }
 +}
 +
 +static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 +{
 +      /* bNode *node= ptr->data; */ /* UNUSED */
 +
 +      uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE);
 +      uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE);
 +      uiItemR(layout, ptr, "clip_black", 0, NULL, ICON_NONE);
 +      uiItemR(layout, ptr, "clip_white", 0, NULL, ICON_NONE);
 +      uiItemR(layout, ptr, "dilate_distance", 0, NULL, ICON_NONE);
 +      uiItemR(layout, ptr, "blur_post", 0, NULL, ICON_NONE);
 +}
 +
  /* only once called */
  static void node_composit_set_butfunc(bNodeType *ntype)
  {
                case CMP_NODE_MASK:
                        ntype->uifunc= node_composit_buts_mask;
                        break;
 +              case CMP_NODE_KEYINGSCREEN:
 +                      ntype->uifunc = node_composit_buts_keyingscreen;
 +                      break;
 +              case CMP_NODE_KEYING:
 +                      ntype->uifunc = node_composit_buts_keying;
 +                      break;
                default:
                        ntype->uifunc = NULL;
        }
index fb28afbbdd9eed52426d02752ed5bcbf23c3c807,ea86083fac4ffb56103f441cddadc102256ff1da..d41294c787518b750e649f0eb980ed16cd9edc64
@@@ -815,14 -815,6 +815,14 @@@ int transformEvent(TransInfo *t, wmEven
                                        initSnapping(t, NULL); // need to reinit after mode change
                                        t->redraw |= TREDRAW_HARD;
                                }
 +                              else if (t->mode == TFM_RESIZE) {
 +                                      if (t->options & CTX_MOVIECLIP) {
 +                                              restoreTransObjects(t);
 +
 +                                              t->flag ^= T_ALT_TRANSFORM;
 +                                              t->redraw |= TREDRAW_HARD;
 +                                      }
 +                              }
                                break;
                                
                        case TFM_MODAL_SNAP_INV_ON:
                return OPERATOR_PASS_THROUGH;
  }
  
- int calculateTransformCenter(bContext *C, int centerMode, float *cent3d, int *cent2d)
+ int calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], int cent2d[2])
  {
        TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data");
-       int success = 1;
+       int success;
  
        t->state = TRANS_RUNNING;
  
        t->around = centerMode;                         // override userdefined mode
  
        if (t->total == 0) {
-               success = 0;
+               success = FALSE;
        }
        else {
-               success = 1;
+               success = TRUE;
  
                calculateCenter(t);
  
@@@ -2738,9 -2730,6 +2738,9 @@@ static void ElementResize(TransInfo *t
        {
                copy_v3_v3(center, td->center);
        }
 +      else if (t->options & CTX_MOVIECLIP) {
 +              copy_v3_v3(center, td->center);
 +      }
        else {
                copy_v3_v3(center, t->center);
        }
@@@ -3114,10 -3103,6 +3114,10 @@@ static void ElementRotation(TransInfo *
                {
                        center = td->center;
                }
 +
 +              if (t->options & CTX_MOVIECLIP) {
 +                      center = td->center;
 +              }
        }
  
        if (t->flag & T_POINTS) {