Merging r46725 through r46963 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 24 May 2012 09:47:29 +0000 (09:47 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 24 May 2012 09:47:29 +0000 (09:47 +0000)
36 files changed:
1  2 
source/blender/CMakeLists.txt
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/ED_transform.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/space_node.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_space.c
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_composite.h
source/blender/nodes/composite/node_composite_tree.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt

Simple merge
Simple merge
@@@ -1930,7 -1940,13 +1940,15 @@@ static void registerCompositNodes(bNode
        register_node_type_cmp_transform(ttype);
        register_node_type_cmp_stabilize2d(ttype);
        register_node_type_cmp_moviedistortion(ttype);
+       register_node_type_cmp_colorcorrection(ttype);
+       register_node_type_cmp_boxmask(ttype);
+       register_node_type_cmp_ellipsemask(ttype);
+       register_node_type_cmp_bokehimage(ttype);
+       register_node_type_cmp_bokehblur(ttype);
+       register_node_type_cmp_switch(ttype);
++
 +      register_node_type_cmp_mask(ttype);
  }
  
  static void registerShaderNodes(bNodeTreeType *ttype) 
@@@ -5427,12 -5359,11 +5360,12 @@@ static void lib_link_screen(FileData *f
                                                
                                                snode->linkdrag.first = snode->linkdrag.last = NULL;
                                        }
-                                       else if (sl->spacetype==SPACE_CLIP) {
-                                               SpaceClip *sclip= (SpaceClip *)sl;
+                                       else if (sl->spacetype == SPACE_CLIP) {
+                                               SpaceClip *sclip = (SpaceClip *)sl;
 -                                              
 +
-                                               sclip->clip= newlibadr_us(fd, sc->id.lib, sclip->clip);
-                                               sclip->mask= newlibadr_us(fd, sc->id.lib, sclip->mask);
+                                               sclip->clip = newlibadr_us(fd, sc->id.lib, sclip->clip);
 -                                              
++                                              sclip->mask = newlibadr_us(fd, sc->id.lib, sclip->mask);
 +
                                                sclip->scopes.track_preview = NULL;
                                                sclip->draw_context = NULL;
                                                sclip->scopes.ok = 0;
@@@ -5695,12 -5622,11 +5624,12 @@@ void lib_link_screen_restore(Main *newm
                                                snode->nodetree= restore_pointer_by_name(newmain, &snode->nodetree->id, 1);
                                        }
                                }
-                               else if (sl->spacetype==SPACE_CLIP) {
-                                       SpaceClip *sclip= (SpaceClip *)sl;
+                               else if (sl->spacetype == SPACE_CLIP) {
+                                       SpaceClip *sclip = (SpaceClip *)sl;
 -                                      
 +
-                                       sclip->clip= restore_pointer_by_name(newmain, (ID *)sclip->clip, 1);
-                                       sclip->mask= restore_pointer_by_name(newmain, (ID *)sclip->mask, 1);
+                                       sclip->clip = restore_pointer_by_name(newmain, (ID *)sclip->clip, 1);
 -                                      
++                                      sclip->mask = restore_pointer_by_name(newmain, (ID *)sclip->mask, 1);
 +
                                        sclip->scopes.ok = 0;
                                }
                        }
@@@ -6196,21 -6114,17 +6117,18 @@@ static void lib_link_group(FileData *fd
  
  static void direct_link_movieReconstruction(FileData *fd, MovieTrackingReconstruction *reconstruction)
  {
-       reconstruction->cameras= newdataadr(fd, reconstruction->cameras);
+       reconstruction->cameras = newdataadr(fd, reconstruction->cameras);
  }
  
 -static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
 +static void direct_link_movieTracks(FileData *fd, MovieClip *clip, ListBase *tracksbase)
  {
        MovieTrackingTrack *track;
+       
        link_list(fd, tracksbase);
 -      
 +
-       track= tracksbase->first;
-       while (track) {
-               track->markers= newdataadr(fd, track->markers);
-               track->gpd= newlibadr_us(fd, clip->id.lib, track->gpd);
-               track= track->next;
+       for (track = tracksbase->first; track; track = track->next) {
+               track->markers = newdataadr(fd, track->markers);
++              track->gpd = newlibadr_us(fd, clip->id.lib, track->gpd);
        }
  }
  
@@@ -6221,36 -6135,33 +6139,33 @@@ static void direct_link_movieclip(FileD
  
        clip->adt= newdataadr(fd, clip->adt);
  
-       if (fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache);
-       else clip->cache= NULL;
+       if (fd->movieclipmap) clip->cache = newmclipadr(fd, clip->cache);
+       else clip->cache = NULL;
  
-       if (fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
-       else clip->tracking.camera.intrinsics= NULL;
+       if (fd->movieclipmap) clip->tracking.camera.intrinsics = newmclipadr(fd, clip->tracking.camera.intrinsics);
+       else clip->tracking.camera.intrinsics = NULL;
  
 -      direct_link_movieTracks(fd, &tracking->tracks);
 +      direct_link_movieTracks(fd, clip, &tracking->tracks);
        direct_link_movieReconstruction(fd, &tracking->reconstruction);
  
-       clip->tracking.act_track= newdataadr(fd, clip->tracking.act_track);
+       clip->tracking.act_track = newdataadr(fd, clip->tracking.act_track);
  
-       clip->anim= NULL;
-       clip->tracking_context= NULL;
-       clip->tracking.stats= NULL;
+       clip->anim = NULL;
+       clip->tracking_context = NULL;
+       clip->tracking.stats = NULL;
  
-       clip->tracking.stabilization.ok= 0;
-       clip->tracking.stabilization.scaleibuf= NULL;
-       clip->tracking.stabilization.rot_track= newdataadr(fd, clip->tracking.stabilization.rot_track);
+       clip->tracking.stabilization.ok = 0;
+       clip->tracking.stabilization.scaleibuf = NULL;
+       clip->tracking.stabilization.rot_track = newdataadr(fd, clip->tracking.stabilization.rot_track);
  
        clip->tracking.dopesheet.ok = 0;
        clip->tracking.dopesheet.channels.first = clip->tracking.dopesheet.channels.last = NULL;
  
        link_list(fd, &tracking->objects);
-       object= tracking->objects.first;
-       while (object) {
+       
+       for (object = tracking->objects.first; object; object = object->next) {
 -              direct_link_movieTracks(fd, &object->tracks);
 +              direct_link_movieTracks(fd, clip, &object->tracks);
                direct_link_movieReconstruction(fd, &object->reconstruction);
-               object= object->next;
        }
  }
  
@@@ -7092,34 -6938,37 +7023,34 @@@ static void do_versions(FileData *fd, L
                                        }
                                }
                        }
-                       for (clip= main->movieclip.first; clip; clip= clip->id.next) {
+                       
+                       for (clip = main->movieclip.first; clip; clip = clip->id.next) {
                                MovieTrackingTrack *track;
-                               if (clip->aspx<1.0f) {
-                                       clip->aspx= 1.0f;
-                                       clip->aspy= 1.0f;
+                               
+                               if (clip->aspx < 1.0f) {
+                                       clip->aspx = 1.0f;
+                                       clip->aspy = 1.0f;
                                }
-                               clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
-                                                          IMB_TC_FREE_RUN |
-                                                          IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
-                               if (clip->proxy.build_size_flag==0)
-                                       clip->proxy.build_size_flag= IMB_PROXY_25;
-                               if (clip->proxy.quality==0)
-                                       clip->proxy.quality= 90;
-                               if (clip->tracking.camera.pixel_aspect<0.01f)
-                                       clip->tracking.camera.pixel_aspect= 1.f;
-                               track= clip->tracking.tracks.first;
+                               
+                               clip->proxy.build_tc_flag = IMB_TC_RECORD_RUN |
+                                                           IMB_TC_FREE_RUN |
+                                                           IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
+                               
+                               if (clip->proxy.build_size_flag == 0)
+                                       clip->proxy.build_size_flag = IMB_PROXY_25;
+                               
+                               if (clip->proxy.quality == 0)
+                                       clip->proxy.quality = 90;
+                               
+                               if (clip->tracking.camera.pixel_aspect < 0.01f)
+                                       clip->tracking.camera.pixel_aspect = 1.0f;
+                                       
+                               track = clip->tracking.tracks.first;
                                while (track) {
-                                       if (track->minimum_correlation==0.0f)
-                                               track->minimum_correlation= 0.75f;
 -                                      if (track->pyramid_levels == 0)
 -                                              track->pyramid_levels = 2;
 -                                      
+                                       if (track->minimum_correlation == 0.0f)
+                                               track->minimum_correlation = 0.75f;
 -                                      
 +
-                                       track= track->next;
+                                       track = track->next;
                                }
                        }
                }
                for (sce = main->scene.first; sce; sce = sce->id.next) {
                        do_versions_image_settings_2_60(sce);
                }
+               
                for (clip= main->movieclip.first; clip; clip= clip->id.next) {
                        MovieTrackingSettings *settings= &clip->tracking.settings;
 -                      
 -                      if (settings->default_pyramid_levels == 0) {
 -                              settings->default_tracker= TRACKER_KLT;
 -                              settings->default_pyramid_levels = 2;
 +
 +                      if (settings->default_pattern_size == 0.0f) {
-                               settings->default_motion_model= TRACK_MOTION_MODEL_TRANSLATION;
-                               settings->default_minimum_correlation= 0.75;
-                               settings->default_pattern_size= 11;
-                               settings->default_search_size= 51;
++                              settings->default_motion_model = TRACK_MOTION_MODEL_TRANSLATION;
+                               settings->default_minimum_correlation = 0.75;
+                               settings->default_pattern_size = 11;
+                               settings->default_search_size = 51;
                        }
                }
-               for (sc= main->screen.first; sc; sc= sc->id.next) {
+               
+               for (sc = main->screen.first; sc; sc = sc->id.next) {
                        ScrArea *sa;
-                       for (sa= sc->areabase.first; sa; sa= sa->next) {
+                       for (sa = sc->areabase.first; sa; sa = sa->next) {
                                SpaceLink *sl;
-                               for (sl= sa->spacedata.first; sl; sl= sl->next) {
-                                       if (sl->spacetype==SPACE_VIEW3D) {
-                                               View3D *v3d= (View3D *)sl;
-                                               v3d->flag2&= ~V3D_RENDER_SHADOW;
+                               for (sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d = (View3D *)sl;
+                                               v3d->flag2 &= ~V3D_RENDER_SHADOW;
                                        }
                                }
                        }
                }
        }
  
 -      
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 6))
+       {
+               /* update use flags for node sockets (was only temporary before) */
+               Scene *sce;
+               Material *mat;
+               Tex *tex;
+               Lamp *lamp;
+               World *world;
+               bNodeTree *ntree;
+               
+               for (sce=main->scene.first; sce; sce=sce->id.next)
+                       if (sce->nodetree)
+                               do_versions_nodetree_frame_2_64_6(sce->nodetree);
+               
+               for (mat=main->mat.first; mat; mat=mat->id.next)
+                       if (mat->nodetree)
+                               do_versions_nodetree_frame_2_64_6(mat->nodetree);
+               
+               for (tex=main->tex.first; tex; tex=tex->id.next)
+                       if (tex->nodetree)
+                               do_versions_nodetree_frame_2_64_6(tex->nodetree);
+               
+               for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+                       if (lamp->nodetree)
+                               do_versions_nodetree_frame_2_64_6(lamp->nodetree);
+               
+               for (world=main->world.first; world; world=world->id.next)
+                       if (world->nodetree)
+                               do_versions_nodetree_frame_2_64_6(world->nodetree);
+               
+               for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+                       do_versions_nodetree_frame_2_64_6(ntree);
+       }
++
 +      {
 +              MovieClip *clip;
 +              bScreen *sc;
 +
 +              for (clip = main->movieclip.first; clip; clip = clip->id.next) {
 +                      MovieTrackingTrack *track;
 +
 +                      track = clip->tracking.tracks.first;
 +                      while (track) {
 +                              int i;
 +
 +                              for (i = 0; i < track->markersnr; i++) {
 +                                      MovieTrackingMarker *marker = &track->markers[i];
 +
 +                                      if (is_zero_v2(marker->pattern_corners[0]) && is_zero_v2(marker->pattern_corners[1]) &&
 +                                          is_zero_v2(marker->pattern_corners[3]) && is_zero_v2(marker->pattern_corners[3]))
 +                                      {
 +                                              marker->pattern_corners[0][0] = track->pat_min[0];
 +                                              marker->pattern_corners[0][1] = track->pat_min[1];
 +
 +                                              marker->pattern_corners[1][0] = track->pat_max[0];
 +                                              marker->pattern_corners[1][1] = track->pat_min[1];
 +
 +                                              marker->pattern_corners[2][0] = track->pat_max[0];
 +                                              marker->pattern_corners[2][1] = track->pat_max[1];
 +
 +                                              marker->pattern_corners[3][0] = track->pat_min[0];
 +                                              marker->pattern_corners[3][1] = track->pat_max[1];
 +                                      }
 +
 +                                      if (is_zero_v2(marker->search_min) && is_zero_v2(marker->search_max)) {
 +                                              copy_v2_v2(marker->search_min, track->search_min);
 +                                              copy_v2_v2(marker->search_max, track->search_max);
 +                                      }
 +                              }
 +
 +                              track = track->next;
 +                      }
 +              }
 +
 +              for (sc = main->screen.first; sc; sc = sc->id.next) {
 +                      ScrArea *sa;
 +
 +                      for (sa = sc->areabase.first; sa; sa = sa->next) {
 +                              SpaceLink *sl;
 +
 +                              for (sl = sa->spacedata.first; sl; sl = sl->next) {
 +                                      if (sl->spacetype == SPACE_CLIP) {
 +                                              SpaceClip *sclip = (SpaceClip *)sl;
 +
 +                                              if (sclip->around == 0) {
 +                                                      sclip->around = V3D_CENTROID;
 +                                              }
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
 +
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
+       {
+               Scene *scene;
+               // composite redesign
+               for (scene=main->scene.first; scene; scene=scene->id.next) {
+                       if (scene->nodetree) {
+                               if (scene->nodetree->chunksize == 0) {
+                                       scene->nodetree->chunksize = 256;
+                               }
+                       }
+               }
+       }
+       
        /* don't forget to set version number in blender.c! */
  }
  
@@@ -7708,10 -7555,9 +7695,10 @@@ static void lib_link_all(FileData *fd, 
        lib_link_brush(fd, main);
        lib_link_particlesettings(fd, main);
        lib_link_movieclip(fd, main);
 -      
 +      lib_link_mask(fd, main);
 +
        lib_link_mesh(fd, main);                /* as last: tpage images with users at zero */
+       
        lib_link_library(fd, main);             /* only init users */
  }
  
@@@ -1967,11 -2132,262 +2132,267 @@@ static void node_composit_buts_moviedis
        uiItemR(layout, ptr, "distortion_type", 0, "", 0);
  }
  
+ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiLayout *row;
+       
+       row = uiLayoutRow(layout, 0);
+       uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemL(row, "", 0);
+       uiItemL(row, "Saturation", 0);
+       uiItemL(row, "Contrast", 0);
+       uiItemL(row, "Gamma", 0);
+       uiItemL(row, "Gain", 0);
+       uiItemL(row, "Lift", 0);
+       row = uiLayoutRow(layout, 0);
+       uiItemL(row, "Master", 0);
+       uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemL(row, "Highlights", 0);
+       uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemL(row, "Midtones", 0);
+       uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemL(row, "Shadows", 0);
+       uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, "", ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+ }
+ static void node_composit_buts_colorcorrection_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) {
+       uiLayout *row;
+       
+       row = uiLayoutRow(layout, 0);
+       uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
+       row = layout;
+       uiItemL(row, "Saturation", 0);
+       uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemL(row, "Contrast", 0);
+       uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemL(row, "Gamma", 0);
+       uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemL(row, "Gain", 0);
+       uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       
+       uiItemL(row, "Lift", 0);
+       uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       row = uiLayoutRow(layout, 0);
+       uiItemR(row, ptr, "midtones_start", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "midtones_end", 0, NULL, ICON_NONE);
+ }
+ static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiItemR(layout, ptr, "check", 0, NULL, ICON_NONE);
+ }
+ static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiLayout *row;
+       
+       row= uiLayoutRow(layout, 1);
+       uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
+       
+       row= uiLayoutRow(layout, 1);
+       uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "rotation", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "mask_type", 0, NULL, ICON_NONE);
+ }
+ static void node_composit_buts_bokehimage(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiItemR(layout, ptr, "flaps", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "angle", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "rounding", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "catadioptric", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "shift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+ }
+ void node_composit_backdrop_viewer(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+ {
+ //    node_composit_backdrop_canvas(snode, backdrop, node, x, y);
+       if (node->custom1 == 0) { /// @todo: why did we need this one?
+               const float backdropWidth = backdrop->x;
+               const float backdropHeight = backdrop->y;
+               const float cx  = x+snode->zoom*backdropWidth*node->custom3;
+               const float cy = y+snode->zoom*backdropHeight*node->custom4;
+               glColor3f(1.0, 1.0, 1.0);
+               glBegin(GL_LINES);
+               glVertex2f(cx-25, cy-25);
+               glVertex2f(cx+25, cy+25);
+               glVertex2f(cx+25, cy-25);
+               glVertex2f(cx-25, cy+25);
+               glEnd();
+       }
+ }
+ void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+ {
+       NodeBoxMask *boxmask = node->storage;
+       const float backdropWidth = backdrop->x;
+       const float backdropHeight = backdrop->y;
+       const float aspect = backdropWidth/backdropHeight;
+       const float rad = DEG2RADF(-boxmask->rotation);
+       const float cosine = cosf(rad);
+       const float sine = sinf(rad);
+       const float halveBoxWidth = backdropWidth * (boxmask->width / 2.0f);
+       const float halveBoxHeight = backdropHeight * (boxmask->height / 2.0f) * aspect;
+       float cx, cy, x1, x2, x3, x4;
+       float y1, y2, y3, y4;
+       /* keep this, saves us from a version patch */
+       if (snode->zoom == 0.0f) snode->zoom = 1.0f;
+       glColor3f(1.0, 1.0, 1.0);
+       cx  = x+snode->zoom*backdropWidth*boxmask->x;
+       cy = y+snode->zoom*backdropHeight*boxmask->y;
+       x1 = cx - (cosine*halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
+       x2 = cx - (cosine*-halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
+       x3 = cx - (cosine*-halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
+       x4 = cx - (cosine*halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
+       y1 = cy - (-sine*halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
+       y2 = cy - (-sine*-halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
+       y3 = cy - (-sine*-halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+       y4 = cy - (-sine*halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+       glBegin(GL_LINE_LOOP);
+       glVertex2f(x1, y1);
+       glVertex2f(x2, y2);
+       glVertex2f(x3, y3);
+       glVertex2f(x4, y4);
+       glEnd();
+ }
+ void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+ {
+       NodeEllipseMask * ellipsemask = node->storage;
+       const float backdropWidth = backdrop->x;
+       const float backdropHeight = backdrop->y;
+       const float aspect = backdropWidth / backdropHeight;
+       const float rad = DEG2RADF(-ellipsemask->rotation);
+       const float cosine = cosf(rad);
+       const float sine = sinf(rad);
+       const float halveBoxWidth = backdropWidth * (ellipsemask->width / 2.0f);
+       const float halveBoxHeight = backdropHeight * (ellipsemask->height / 2.0f) * aspect;
+       float cx, cy, x1, x2, x3, x4;
+       float y1, y2, y3, y4;
+       /* keep this, saves us from a version patch */
+       if (snode->zoom == 0.0f) snode->zoom = 1.0f;
+       glColor3f(1.0, 1.0, 1.0);
+       cx  = x+snode->zoom*backdropWidth*ellipsemask->x;
+       cy = y+snode->zoom*backdropHeight*ellipsemask->y;
+       x1 = cx - (cosine*halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
+       x2 = cx - (cosine*-halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
+       x3 = cx - (cosine*-halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
+       x4 = cx - (cosine*halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
+       y1 = cy - (-sine*halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
+       y2 = cy - (-sine*-halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
+       y3 = cy - (-sine*-halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+       y4 = cy - (-sine*halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+       glBegin(GL_LINE_LOOP);
+       glVertex2f(x1, y1);
+       glVertex2f(x2, y2);
+       glVertex2f(x3, y3);
+       glVertex2f(x4, y4);
+       glEnd();
+ }
+ static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiLayout *row;
+       row= uiLayoutRow(layout, 1);
+       uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
+       uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
+       row= uiLayoutRow(layout, 1);
+       uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "rotation", 0, NULL, ICON_NONE);
+       uiItemR(layout, ptr, "mask_type", 0, NULL, ICON_NONE);
+ }
+ static void node_composit_buts_viewer_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+       uiLayout *col;
+       
+       uiItemR(layout, ptr, "tile_order", 0, NULL, ICON_NONE);
+       if (RNA_enum_get(ptr, "tile_order")==0) {
+               col= uiLayoutColumn(layout, 1);
+               uiItemR(col, ptr, "center_x", 0, NULL, ICON_NONE);
+               uiItemR(col, ptr, "center_y", 0, NULL, ICON_NONE);
+       }
+ }
 +static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
 +{
 +      uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL);
 +}
 +
  /* only once called */
  static void node_composit_set_butfunc(bNodeType *ntype)
  {
                case CMP_NODE_MOVIEDISTORTION:
                        ntype->uifunc= node_composit_buts_moviedistortion;
                        break;
+               case CMP_NODE_COLORCORRECTION:
+                       ntype->uifunc=node_composit_buts_colorcorrection;
+                       ntype->uifuncbut=node_composit_buts_colorcorrection_but;
+                       break;
+               case CMP_NODE_SWITCH:
+                       ntype->uifunc= node_composit_buts_switch;
+                       break;
+               case CMP_NODE_MASK_BOX:
+                       ntype->uifunc= node_composit_buts_boxmask;
+                       ntype->uibackdropfunc = node_composit_backdrop_boxmask;
+                       break;
+               case CMP_NODE_MASK_ELLIPSE:
+                       ntype->uifunc= node_composit_buts_ellipsemask;
+                       ntype->uibackdropfunc = node_composit_backdrop_ellipsemask;
+                       break;
+               case CMP_NODE_BOKEHIMAGE:
+                       ntype->uifunc= node_composit_buts_bokehimage;
+                       break;
+               case CMP_NODE_VIEWER:
+                       ntype->uifunc = NULL;
+                       ntype->uifuncbut= node_composit_buts_viewer_but;
+                       ntype->uibackdropfunc = node_composit_backdrop_viewer;
+                       break;
 +              case CMP_NODE_MASK:
 +                      ntype->uifunc= node_composit_buts_mask;
 +                      break;
                default:
                        ntype->uifunc= NULL;
        }
@@@ -67,14 -67,15 +67,16 @@@ struct wmOperator
  struct wmTimer;
  struct MovieClip;
  struct MovieClipScopes;
 +struct Mask;
  
-       /**
-        * The base structure all the other spaces
-        * are derived (implicitly) from. Would be
-        * good to make this explicit.
-        */
  
+ /* SpaceLink (Base) ==================================== */
+ /**
+  * The base structure all the other spaces
+  * are derived (implicitly) from. Would be
+  * good to make this explicit.
+  */
  typedef struct SpaceLink {
        struct SpaceLink *next, *prev;
        ListBase regionbase;            /* storage of regions for inactive spaces */
@@@ -532,415 -1006,64 +1010,74 @@@ typedef struct SpaceClip 
        short dope_sort;                /* sort order in dopesheet view */
        short dope_flag;                /* dopsheet view flags */
  
 -      int pad3;
 +      int around;                     /* pivot point for transforms */
 +
 +      /* **** mask editing **** */
 +      struct Mask *mask;
  } SpaceClip;
  
- /* view3d  Now in DNA_view3d_types.h */
- /* **************** SPACE DEFINES ********************* */
- /* button defines (deprecated) */
- /* warning: the values of these defines are used in sbuts->tabs[8] */
- /* sbuts->mainb new */
- #define CONTEXT_SCENE 0
- #define CONTEXT_OBJECT        1
- #define CONTEXT_TYPES 2
- #define CONTEXT_SHADING       3
- #define CONTEXT_EDITING       4
- #define CONTEXT_SCRIPT        5
- #define CONTEXT_LOGIC 6
- /* sbuts->mainb old (deprecated) */
- #define BUTS_VIEW                     0
- #define BUTS_LAMP                     1
- #define BUTS_MAT                      2
- #define BUTS_TEX                      3
- #define BUTS_ANIM                     4
- #define BUTS_WORLD                    5
- #define BUTS_RENDER                   6
- #define BUTS_EDIT                     7
- #define BUTS_GAME                     8
- #define BUTS_FPAINT                   9
- #define BUTS_RADIO                    10
- #define BUTS_SCRIPT                   11
- #define BUTS_SOUND                    12
- #define BUTS_CONSTRAINT               13
- #define BUTS_EFFECTS          14
- /* buts->mainb new */
- #define BCONTEXT_RENDER                               0
- #define BCONTEXT_SCENE                                1
- #define BCONTEXT_WORLD                                2
- #define BCONTEXT_OBJECT                               3
- #define BCONTEXT_DATA                         4
- #define BCONTEXT_MATERIAL                     5
- #define BCONTEXT_TEXTURE                      6
- #define BCONTEXT_PARTICLE                     7
- #define BCONTEXT_PHYSICS                      8
- #define BCONTEXT_BONE                         9
- #define BCONTEXT_MODIFIER                     10
- #define BCONTEXT_CONSTRAINT                   12
- #define BCONTEXT_BONE_CONSTRAINT      13
- #define BCONTEXT_TOT                          14
- /* sbuts->flag */
- #define SB_PRV_OSA                    1
- #define SB_PIN_CONTEXT                2
- //#define SB_WORLD_TEX                4       //not used anymore
- //#define SB_BRUSH_TEX                8       //not used anymore      
- #define SB_SHADING_CONTEXT    16
- /* sbuts->texture_context */
- #define SB_TEXC_MAT_OR_LAMP   0
- #define SB_TEXC_WORLD         1
- #define SB_TEXC_BRUSH         2
- #define SB_TEXC_PARTICLES     3
- /* sbuts->align */
- #define BUT_FREE              0
- #define BUT_HORIZONTAL  1
- #define BUT_VERTICAL    2
- #define BUT_AUTO              3
- /* sbuts->scaflag */          
- #define BUTS_SENS_SEL         1
- #define BUTS_SENS_ACT         2
- #define BUTS_SENS_LINK                4
- #define BUTS_CONT_SEL         8
- #define BUTS_CONT_ACT         16
- #define BUTS_CONT_LINK                32
- #define BUTS_ACT_SEL          64
- #define BUTS_ACT_ACT          128
- #define BUTS_ACT_LINK         256
- #define BUTS_SENS_STATE               512
- #define BUTS_ACT_STATE                1024
- #define BUTS_CONT_INIT_STATE  2048
- /* FileSelectParams.display */
- enum FileDisplayTypeE {
-       FILE_DEFAULTDISPLAY = 0,
-       FILE_SHORTDISPLAY,
-       FILE_LONGDISPLAY,
-       FILE_IMGDISPLAY
- };
- /* FileSelectParams.sort */
- enum FileSortTypeE {
-       FILE_SORT_NONE = 0,
-       FILE_SORT_ALPHA = 1,
-       FILE_SORT_EXTENSION,
-       FILE_SORT_TIME,
-       FILE_SORT_SIZE
- };
- /* these values need to be hardcoded in structs, dna does not recognize defines */
- /* also defined in BKE */
- #define FILE_MAXDIR                   768
- #define FILE_MAXFILE          256
- #define FILE_MAX                      1024
- #define FILE_MAX_LIBEXTRA   (FILE_MAX + 32)
- /* filesel types */
- #define FILE_UNIX                     8
- #define FILE_BLENDER          8 /* don't display relative paths */
- #define FILE_SPECIAL          9
- #define FILE_LOADLIB          1
- #define FILE_MAIN                     2
- #define FILE_LOADFONT         3
- /* filesel op property -> action */
- #define FILE_OPENFILE         0
- #define FILE_SAVE                     1
- /* sfile->params->flag and simasel->flag */
- #define FILE_SHOWSHORT                (1<<0)
- #define FILE_RELPATH          (1<<1) /* was FILE_STRINGCODE */
- #define FILE_LINK                     (1<<2)
- #define FILE_HIDE_DOT         (1<<3)
- #define FILE_AUTOSELECT               (1<<4)
- #define FILE_ACTIVELAY                (1<<5)
- /* #define FILE_ATCURSOR      (1<<6) */ /* deprecated */
- #define FILE_DIRSEL_ONLY      (1<<7)
- #define FILE_FILTER                   (1<<8)
- #define FILE_BOOKMARKS                (1<<9)
- #define FILE_GROUP_INSTANCE   (1<<10)
- /* files in filesel list: file types */
- #define BLENDERFILE                   (1<<2)
- #define BLENDERFILE_BACKUP    (1<<3)
- #define IMAGEFILE                     (1<<4)
- #define MOVIEFILE                     (1<<5)
- #define PYSCRIPTFILE          (1<<6)
- #define FTFONTFILE                    (1<<7)
- #define SOUNDFILE                     (1<<8)
- #define TEXTFILE                      (1<<9)
- #define MOVIEFILE_ICON                (1<<10) /* movie file that preview can't load */
- #define FOLDERFILE                    (1<<11) /* represents folders for filtering */
- #define BTXFILE                               (1<<12)
- #define COLLADAFILE                   (1<<13)
- #define OPERATORFILE          (1<<14) /* from filter_glob operator property */
- /* Selection Flags in filesel: struct direntry, unsigned char selflag */
- /* #define ACTIVE_FILE                (1<<1) */ /* UNUSED */
- #define HILITED_FILE          (1<<2)
- #define SELECTED_FILE         (1<<3)
- #define EDITING_FILE          (1<<4)
- /* SpaceImage->dt_uv */
- #define SI_UVDT_OUTLINE       0
- #define SI_UVDT_DASH  1
- #define SI_UVDT_BLACK 2
- #define SI_UVDT_WHITE 3
- /* SpaceImage->dt_uvstretch */
- #define SI_UVDT_STRETCH_ANGLE 0
- #define SI_UVDT_STRETCH_AREA  1
- /* SpaceImage->sticky
-  * Note DISABLE should be 0, however would also need to re-arrange icon order,
-  * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
- #define SI_STICKY_LOC         0
- #define SI_STICKY_DISABLE     1
- #define SI_STICKY_VERTEX      2
- /* SpaceImage->flag */
- #define SI_BE_SQUARE  (1<<0)
- #define SI_EDITTILE           (1<<1)
- #define SI_CLIP_UV            (1<<2)
- #define SI_DRAWTOOL           (1<<3)
- #define SI_NO_DRAWFACES       (1<<4)
- #define SI_DRAWSHADOW   (1<<5)
- /* #define SI_SELACTFACE   (1<<6) */ /* deprecated */
- #define SI_DEPRECATED2        (1<<7)
- #define SI_DEPRECATED3  (1<<8)        /* stick UV selection to mesh vertex (UVs wont always be touching) */
- #define SI_COORDFLOATS  (1<<9)
- #define SI_PIXELSNAP  (1<<10)
- #define SI_LIVE_UNWRAP        (1<<11)
- #define SI_USE_ALPHA  (1<<12)
- #define SI_SHOW_ALPHA (1<<13)
- #define SI_SHOW_ZBUF  (1<<14)
-               /* next two for render window dislay */
- #define SI_PREVSPACE  (1<<15)
- #define SI_FULLWINDOW (1<<16)
- #define SI_DEPRECATED4        (1<<17)
- #define SI_DEPRECATED5        (1<<18)
-               /* this means that the image is drawn until it reaches the view edge,
-                * in the image view, its unrelated to the 'tile' mode for texface */
- #define SI_DRAW_TILE  (1<<19)
- #define SI_SMOOTH_UV  (1<<20)
- #define SI_DRAW_STRETCH       (1<<21)
- #define SI_DISPGP             (1<<22)
- #define SI_DRAW_OTHER (1<<23)
- #define SI_COLOR_CORRECTION   (1<<24)
- /* SpaceIpo->flag (Graph Editor Settings) */
-       /* OLD DEPRECEATED SETTING */
- #define SIPO_LOCK_VIEW                        (1<<0)
-       /* don't merge keyframes on the same frame after a transform */
- #define SIPO_NOTRANSKEYCULL           (1<<1)
-       /* don't show any keyframe handles at all */
- #define SIPO_NOHANDLES                        (1<<2)
-       /* don't show current frame number beside indicator line */
- #define SIPO_NODRAWCFRANUM            (1<<3)
-       /* show timing in seconds instead of frames */
- #define SIPO_DRAWTIME                 (1<<4)
-       /* only show keyframes for selected F-Curves */
- #define SIPO_SELCUVERTSONLY           (1<<5)
-       /* draw names of F-Curves beside the respective curves */
-       /* NOTE: currently not used */
- #define SIPO_DRAWNAMES                        (1<<6)
-       /* show sliders in channels list */
- #define SIPO_SLIDERS                  (1<<7)
-       /* don't show the horizontal component of the cursor */
- #define SIPO_NODRAWCURSOR             (1<<8)
-       /* only show handles of selected keyframes */
- #define SIPO_SELVHANDLESONLY  (1<<9)
-       /* temporary flag to force channel selections to be synced with main */
- #define SIPO_TEMP_NEEDCHANSYNC        (1<<10)
-       /* don't perform realtime updates */
- #define SIPO_NOREALTIMEUPDATES        (1<<11)
-       /* don't draw curves with AA ("beauty-draw") for performance */
- #define SIPO_BEAUTYDRAW_OFF           (1<<12)
- /* SpaceIpo->mode (Graph Editor Mode) */
- enum {
-               /* all animation curves (from all over Blender) */
-       SIPO_MODE_ANIMATION     = 0,
-               /* drivers only */
-       SIPO_MODE_DRIVERS,
- } eGraphEdit_Mode;
- /* SpaceText flags (moved from DNA_text_types.h) */
- #define ST_SCROLL_SELECT        0x0001 // scrollable
- #define ST_CLEAR_NAMESPACE      0x0010 // clear namespace after script
-                                                                          // execution (see BPY_main.c)
- #define       ST_FIND_WRAP                    0x0020
- #define       ST_FIND_ALL                             0x0040
- #define       ST_SHOW_MARGIN                  0x0080
- #define       ST_MATCH_CASE                   0x0100
- /* stext->findstr/replacestr */
- #define ST_MAX_FIND_STR               256
- /* SpaceOops->flag */
- #define SO_TESTBLOCKS 1
- #define SO_NEWSELECTED        2
- #define SO_HIDE_RESTRICTCOLS          4
- #define SO_HIDE_KEYINGSETINFO         8
- /* SpaceOops->outlinevis */
- #define SO_ALL_SCENES 0
- #define SO_CUR_SCENE  1
- #define SO_VISIBLE            2
- #define SO_SELECTED           3
- #define SO_ACTIVE             4
- #define SO_SAME_TYPE  5
- #define SO_GROUPS             6
- #define SO_LIBRARIES  7
- #define SO_VERSE_SESSION      8
- #define SO_VERSE_MS           9
- #define SO_SEQUENCE           10
- #define SO_DATABLOCKS 11
- #define SO_USERDEF            12
- #define SO_KEYMAP             13
- /* SpaceOops->storeflag */
- #define SO_TREESTORE_CLEANUP  1
-               /* if set, it allows redraws. gets set for some allqueue events */
- #define SO_TREESTORE_REDRAW           2
- /* outliner search flags (SpaceOops->search_flags) */
- #define SO_FIND_CASE_SENSITIVE                (1<<0)
- #define SO_FIND_COMPLETE                      (1<<1)
- #define SO_SEARCH_RECURSIVE           (1<<2)
- /* headerbuttons: 450-499 */
- #define B_IMASELHOME          451
- #define B_IMASELREMOVEBIP     452
- /* nla->flag */
- /* flags (1<<0), (1<<1), and (1<<3) are depreceated flags from old blenders */
-       /* draw timing in seconds instead of frames */
- #define SNLA_DRAWTIME         (1<<2)
-       /* don't draw frame number beside frame indicator */
- #define SNLA_NODRAWCFRANUM    (1<<4)
-       /* don't draw influence curves on strips */
- #define SNLA_NOSTRIPCURVES    (1<<5)
-       /* don't perform realtime updates */
- #define SNLA_NOREALTIMEUPDATES        (1<<6)
- /* time->flag */
-       /* show timing in frames instead of in seconds */
- #define TIME_DRAWFRAMES               1
-       /* show time indicator box beside the frame number */
- #define TIME_CFRA_NUM         2
-       /* only keyframes from active/selected channels get shown */
- #define TIME_ONLYACTSEL               4
- /* time->redraws (now screen->redraws_flag) */
- #define TIME_REGION                           1
- #define TIME_ALL_3D_WIN                       2
- #define TIME_ALL_ANIM_WIN             4
- #define TIME_ALL_BUTS_WIN             8
- #define TIME_WITH_SEQ_AUDIO           16              // deprecated
- #define TIME_SEQ                              32
- #define TIME_ALL_IMAGE_WIN            64
- #define TIME_CONTINUE_PHYSICS 128
- #define TIME_NODES                            256
- #define TIME_CLIPS                            512
- /* time->cache */
- #define TIME_CACHE_DISPLAY            1
- #define TIME_CACHE_SOFTBODY           2
- #define TIME_CACHE_PARTICLES  4
- #define TIME_CACHE_CLOTH              8
- #define TIME_CACHE_SMOKE              16
- #define TIME_CACHE_DYNAMICPAINT       32
- /* sseq->mainb */
- #define SEQ_DRAW_SEQUENCE         0
- #define SEQ_DRAW_IMG_IMBUF        1
- #define SEQ_DRAW_IMG_WAVEFORM     2
- #define SEQ_DRAW_IMG_VECTORSCOPE  3
- #define SEQ_DRAW_IMG_HISTOGRAM    4
- /* sseq->flag */
- #define SEQ_DRAWFRAMES   1
- #define SEQ_MARKER_TRANS 2
- #define SEQ_DRAW_COLOR_SEPARATED     4
- #define SEQ_DRAW_SAFE_MARGINS        8
- #define SEQ_DRAW_GPENCIL                      16
- #define SEQ_NO_DRAW_CFRANUM                   32
- /* sseq->view */
- #define SEQ_VIEW_SEQUENCE                     1
- #define SEQ_VIEW_PREVIEW                      2
- #define SEQ_VIEW_SEQUENCE_PREVIEW     3
- /* sseq->render_size */
- #define SEQ_PROXY_RENDER_SIZE_NONE      -1
- #define SEQ_PROXY_RENDER_SIZE_SCENE     0
- #define SEQ_PROXY_RENDER_SIZE_25        25
- #define SEQ_PROXY_RENDER_SIZE_50        50
- #define SEQ_PROXY_RENDER_SIZE_75        75
- #define SEQ_PROXY_RENDER_SIZE_100       99
- #define SEQ_PROXY_RENDER_SIZE_FULL      100
  /* SpaceClip->flag */
- #define SC_SHOW_MARKER_PATTERN        (1<<0)
- #define SC_SHOW_MARKER_SEARCH (1<<1)
- #define SC_LOCK_SELECTION             (1<<2)
- #define SC_SHOW_TINY_MARKER           (1<<3)
- #define SC_SHOW_TRACK_PATH            (1<<4)
- #define SC_SHOW_BUNDLES                       (1<<5)
- #define SC_MUTE_FOOTAGE                       (1<<6)
- #define SC_HIDE_DISABLED              (1<<7)
- #define SC_SHOW_NAMES                 (1<<8)
- #define SC_SHOW_GRID                  (1<<9)
- #define SC_SHOW_STABLE                        (1<<10)
- #define SC_MANUAL_CALIBRATION (1<<11)
- /*#define SC_SHOW_GPENCIL                     (1<<12)*/       /* UNUSED */
- #define SC_SHOW_FILTERS                       (1<<13)
- #define SC_SHOW_GRAPH_FRAMES  (1<<14)
- #define SC_SHOW_GRAPH_TRACKS  (1<<15)
- /*#define SC_SHOW_PYRAMID_LEVELS      (1<<16) */      /* UNUSED */
- #define SC_LOCK_TIMECURSOR            (1<<17)
- #define SC_SHOW_SECONDS                       (1<<18)
+ typedef enum eSpaceClip_Flag {
+       SC_SHOW_MARKER_PATTERN = (1 << 0),
+       SC_SHOW_MARKER_SEARCH  = (1 << 1),
+       SC_LOCK_SELECTION      = (1 << 2),
+       SC_SHOW_TINY_MARKER    = (1 << 3),
+       SC_SHOW_TRACK_PATH     = (1 << 4),
+       SC_SHOW_BUNDLES        = (1 << 5),
+       SC_MUTE_FOOTAGE        = (1 << 6),
+       SC_HIDE_DISABLED       = (1 << 7),
+       SC_SHOW_NAMES          = (1 << 8),
+       SC_SHOW_GRID           = (1 << 9),
+       SC_SHOW_STABLE         = (1 << 10),
+       SC_MANUAL_CALIBRATION  = (1 << 11),
+ /*    SC_SHOW_GPENCIL        = (1 << 12),*/   /* UNUSED */
+       SC_SHOW_FILTERS        = (1 << 13),
+       SC_SHOW_GRAPH_FRAMES   = (1 << 14),
+       SC_SHOW_GRAPH_TRACKS   = (1 << 15),
+ /*    SC_SHOW_PYRAMID_LEVELS = (1 << 16), */  /* UNUSED */
+       SC_LOCK_TIMECURSOR     = (1 << 17),
+       SC_SHOW_SECONDS        = (1 << 18),
+ } eSpaceClip_Flag;
  
  /* SpaceClip->mode */
- #define SC_MODE_TRACKING              0
- #define SC_MODE_RECONSTRUCTION        1
- #define SC_MODE_DISTORTION            2
- #define SC_MODE_MASKEDITING           3
+ typedef enum eSpaceClip_Mode {
+       SC_MODE_TRACKING = 0,
+       SC_MODE_RECONSTRUCTION,
+       SC_MODE_DISTORTION,
++      SC_MODE_MASKEDITING,
+ } eSpaceClip_Mode;
  
  /* SpaceClip->view */
- #define SC_VIEW_CLIP          0
- #define SC_VIEW_GRAPH         1
- #define SC_VIEW_DOPESHEET     2
+ typedef enum eSpaceClip_View {
+       SC_VIEW_CLIP = 0,
+       SC_VIEW_GRAPH,
+       SC_VIEW_DOPESHEET,
+ } eSpaceClip_View;
  
  /* SpaceClip->dope_sort */
- #define SC_DOPE_SORT_NAME             0
- #define SC_DOPE_SORT_LONGEST          1
- #define SC_DOPE_SORT_TOTAL            2
+ typedef enum eSpaceClip_Dopesheet_Sort {
+       SC_DOPE_SORT_NAME = 0,
+       SC_DOPE_SORT_LONGEST,
+       SC_DOPE_SORT_TOTAL,
+ } eSpaceClip_Dopesheet_Sort;
  
  /* SpaceClip->dope_flag */
- #define SC_DOPE_SORT_INVERSE          1
+ typedef enum eSpaceClip_Dopesheet_Flag {
+       SC_DOPE_SORT_INVERSE    = (1 << 0),
+ } eSpaceClip_Dopesheet_Flag;
  
- #define SC_GPENCIL_SRC_CLIP           0
- #define SC_GPENCIL_SRC_TRACK          1
 +/* SPaceClip->gpencil_src */
++typedef enum eSpaceClip_GPencil_Source {
++      SC_GPENCIL_SRC_CLIP = 0,
++      SC_GPENCIL_SRC_TRACK = 1,
++} eSpaceClip_GPencil_Source;
++
+ /* **************** SPACE DEFINES ********************* */
+ /* headerbuttons: 450-499 */
+ #define B_IMASELHOME          451
+ #define B_IMASELREMOVEBIP     452
  
  /* space types, moved from DNA_screen_types.h */
  /* Do NOT change order, append on end. types are hardcoded needed */
Simple merge
@@@ -159,7 -160,11 +160,12 @@@ DefNode( CompositorNode, CMP_NODE_MOVIE
  DefNode( CompositorNode, CMP_NODE_TRANSFORM,      dev_cmd_transform,      "TRANSFORM",      Transform,        "Transform",         ""              )
  DefNode( CompositorNode, CMP_NODE_STABILIZE2D,    def_cmp_stabilize2d,    "STABILIZE2D",    Stabilize,        "Stabilize 2D",      ""              )
  DefNode( CompositorNode, CMP_NODE_MOVIEDISTORTION,def_cmp_moviedistortion,"MOVIEDISTORTION",MovieDistortion,  "Movie Distortion",  ""              )
+ DefNode( CompositorNode, CMP_NODE_MASK_BOX,       def_cmp_boxmask,        "BOXMASK"        ,BoxMask,          "Box mask",          ""              )
+ DefNode( CompositorNode, CMP_NODE_MASK_ELLIPSE,   def_cmp_ellipsemask,    "ELLIPSEMASK"    ,EllipseMask,      "Ellipse mask",      ""              )
+ DefNode( CompositorNode, CMP_NODE_BOKEHIMAGE,     def_cmp_bokehimage,     "BOKEHIMAGE"     ,BokehImage,       "Bokeh image",       ""              )
+ DefNode( CompositorNode, CMP_NODE_SWITCH,         def_cmp_switch,         "SWITCH"         ,Switch,           "Switch",            ""              )
+ DefNode( CompositorNode, CMP_NODE_COLORCORRECTION,def_cmp_colorcorrection,"COLORCORRECTION",ColorCorrection,  "ColorCorrection",   ""              )
 +DefNode( CompositorNode, CMP_NODE_MASK,           def_cmp_mask,           "MASK",           Mask,             "Mask",              ""              )
                                                                                                                                                     
  DefNode( TextureNode,    TEX_NODE_OUTPUT,         def_tex_output,         "OUTPUT",         Output,           "Output",            ""              )
  DefNode( TextureNode,    TEX_NODE_CHECKER,        0,                      "CHECKER",        Checker,          "Checker",           ""              )
@@@ -35,7 -35,7 +35,8 @@@ set(IN
        ../makesrna
        ../render/extern/include
        ../../../intern/guardedalloc
 +      ../../../intern/raskter
+       ../compositor
  )
  
  set(INC_SYS
Simple merge
@@@ -911,7 -910,8 +911,9 @@@ endif(
                cycles_kernel
                cycles_util
                cycles_subd
+               bf_compositor #added for opencl compositor
+               bf_opencl #added for opencl compositor
 +              bf_intern_raskter
        )
  
        if(WITH_LIBMV)