Merging r40653 through r40847 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Oct 2011 18:57:26 +0000 (18:57 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Oct 2011 18:57:26 +0000 (18:57 +0000)
43 files changed:
1  2 
CMakeLists.txt
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
release/scripts/modules/bpy_extras/keyconfig_utils.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/render/intern/include/render_types.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt

diff --cc CMakeLists.txt
index a45a3560ffac10b2a4dbf9b20f2aa5ff5cb035cf,405c885050487287ded320809f7c968195b1a7d2..ad7c684807f7c242e521d2e029c1986b7346d77e
@@@ -195,12 -194,9 +194,12 @@@ option(WITH_JACK          "Enable Jack 
  option(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON)
  option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)" ON)
  
 +# Tracking
 +option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 +
  # Misc
  option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
- option(WITH_RAYOPTIMIZATION   "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
+ option(WITH_RAYOPTIMIZATION   "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
  if(UNIX AND NOT APPLE)
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
  endif()
Simple merge
Simple merge
index 7d0191043b017353d0639b1b6a320c34e32e2a26,b1943fdf97c329fda3269769669bc745e6b12dc3..ce630afc180fc77a15e923cc10b5654ee819689f
@@@ -145,13 -143,16 +145,18 @@@ int object_is_modified(struct Scene *sc
  void object_camera_mode(struct RenderData *rd, struct Object *camera);
  void object_camera_matrix(
                struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second,
 -              float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor,
 +              float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, float *sensor_x, float *ycor,
                float *viewdx, float *viewdy);
  
+ void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
+                           float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
+ void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
  void object_relink(struct Object *ob);
  
 +struct MovieClip *object_get_movieclip(struct Scene *scene, struct Object *ob);
 +
  #ifdef __cplusplus
  }
  #endif
index 5c70f6ac9d47557c82c8ebee988f82c20de98877,ce5805921dcb80f9ac9c37b7a62cde6e0c47ecd5..195d6ba68440a5650499bd34dfdcc9954e8fc6d2
@@@ -12196,93 -12074,75 +12191,128 @@@ static void do_versions(FileData *fd, L
                        }
                }
  
-               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_VIEW3D) {
-                                               View3D *v3d= (View3D *)sl;
+               {
+                       /* set defaults for obstacle avoidance, recast data */
+                       Scene *sce;
+                       for(sce = main->scene.first; sce; sce = sce->id.next)
+                       {
+                               if (sce->gm.levelHeight == 0.f)
+                                       sce->gm.levelHeight = 2.f;
+                               if(sce->gm.recastData.cellsize == 0.0f)
+                                       sce->gm.recastData.cellsize = 0.3f;
+                               if(sce->gm.recastData.cellheight == 0.0f)
+                                       sce->gm.recastData.cellheight = 0.2f;
+                               if(sce->gm.recastData.agentmaxslope == 0.0f)
+                                       sce->gm.recastData.agentmaxslope = (float)M_PI/4;
+                               if(sce->gm.recastData.agentmaxclimb == 0.0f)
+                                       sce->gm.recastData.agentmaxclimb = 0.9f;
+                               if(sce->gm.recastData.agentheight == 0.0f)
+                                       sce->gm.recastData.agentheight = 2.0f;
+                               if(sce->gm.recastData.agentradius == 0.0f)
+                                       sce->gm.recastData.agentradius = 0.6f;
+                               if(sce->gm.recastData.edgemaxlen == 0.0f)
+                                       sce->gm.recastData.edgemaxlen = 12.0f;
+                               if(sce->gm.recastData.edgemaxerror == 0.0f)
+                                       sce->gm.recastData.edgemaxerror = 1.3f;
+                               if(sce->gm.recastData.regionminsize == 0.0f)
+                                       sce->gm.recastData.regionminsize = 8.f;
+                               if(sce->gm.recastData.regionmergesize == 0.0f)
+                                       sce->gm.recastData.regionmergesize = 20.f;
+                               if(sce->gm.recastData.vertsperpoly<3)
+                                       sce->gm.recastData.vertsperpoly = 6;
+                               if(sce->gm.recastData.detailsampledist == 0.0f)
+                                       sce->gm.recastData.detailsampledist = 6.0f;
+                               if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
+                                       sce->gm.recastData.detailsamplemaxerror = 1.0f;
+                       }
+               }
  
-                                               if(v3d->bundle_size==0.0f) {
-                                                       v3d->bundle_size= 0.1f;
-                                                       v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
-                                               }
+               {
+                       /* flip normals */
+                       Material *ma= main->mat.first;
+                       while(ma) {
+                               int a;
+                               for(a= 0; a<MAX_MTEX; a++) {
+                                       MTex *mtex= ma->mtex[a];
  
-                                               if(v3d->bundle_drawtype==0)
-                                                       v3d->bundle_drawtype= OB_EMPTY_SPHERE;
-                                       }
-                                       else if(sl->spacetype==SPACE_CLIP) {
-                                               SpaceClip *sclip= (SpaceClip *)sl;
-                                               if(sclip->scopes.track_preview_height==0)
-                                                       sclip->scopes.track_preview_height= 120;
+                                       if(mtex) {
+                                               if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) {
+                                                       if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) {
+                                                               Tex *tex= newlibadr(fd, lib, mtex->tex);
+                                                               if(!tex || (tex->imaflag&TEX_NORMALMAP)==0) {
+                                                                       mtex->norfac= -mtex->norfac;
+                                                                       mtex->texflag|= MTEX_BUMP_FLIPPED;
+                                                               }
+                                                       }
+                                               }
                                        }
                                }
+                               ma= ma->id.next;
                        }
                }
 -
+       }
+       /* put compatibility code here until next subversion bump */
+       {
++              {
++                      bScreen *sc;
++                      Camera *cam;
++                      MovieClip *clip;
++
++                      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_VIEW3D) {
++                                                      View3D *v3d= (View3D *)sl;
++                                                      if(v3d->bundle_size==0.0f) {
++                                                              v3d->bundle_size= 0.1f;
++                                                              v3d->flag2 |= V3D_SHOW_RECONSTRUCTION;
++                                                      }
++
++                                                      if(v3d->bundle_drawtype==0)
++                                                              v3d->bundle_drawtype= OB_EMPTY_SPHERE;
++                                              }
++                                              else if(sl->spacetype==SPACE_CLIP) {
++                                                      SpaceClip *sc= (SpaceClip *)sl;
++                                                      if(sc->scopes.track_preview_height==0)
++                                                              sc->scopes.track_preview_height= 120;
++                                              }
++                                      }
++                              }
 +
-               for (clip= main->movieclip.first; clip; clip= clip->id.next) {
-                       if(clip->aspx<1.0f) {
-                               clip->aspx= 1.0f;
-                               clip->aspy= 1.0f;
 +                      }
 +
-                       /* XXX: a bit hacky, probably include imbuf and use real constants are nicer */
-                       clip->proxy.build_tc_flag= 7;
-                       if(clip->proxy.build_size_flag==0)
-                               clip->proxy.build_size_flag= 1;
++                      for(cam= main->camera.first; cam; cam= cam->id.next) {
++                              if (cam->sensor_x < 0.01) {
++                                      cam->sensor_x = 32.f;
++                              }
++                      }
 +
-                       if(clip->proxy.quality==0)
-                               clip->proxy.quality= 90;
++                      for (clip= main->movieclip.first; clip; clip= clip->id.next) {
++                              if(clip->aspx<1.0f) {
++                                      clip->aspx= 1.0f;
++                                      clip->aspy= 1.0f;
++                              }
 +
-                       if(clip->tracking.camera.pixel_aspect<0.01f)
-                               clip->tracking.camera.pixel_aspect= 1.f;
-               }
++                              /* XXX: a bit hacky, probably include imbuf and use real constants are nicer */
++                              clip->proxy.build_tc_flag= 7;
++                              if(clip->proxy.build_size_flag==0)
++                                      clip->proxy.build_size_flag= 1;
 +
-               for(cam= main->camera.first; cam; cam= cam->id.next) {
-                       if (cam->sensor_x < 0.01f) {
-                               cam->sensor_x = 32.f;
++                              if(clip->proxy.quality==0)
++                                      clip->proxy.quality= 90;
++
++                              if(clip->tracking.camera.pixel_aspect<0.01f)
++                                      clip->tracking.camera.pixel_aspect= 1.f;
 +                      }
 +              }
        }
  
-       //set defaults for obstacle avoidance, recast data
-       {
-               Scene *sce;
-               for(sce = main->scene.first; sce; sce = sce->id.next)
-               {
-                       if (sce->gm.levelHeight == 0.f)
-                               sce->gm.levelHeight = 2.f;
-                       if(sce->gm.recastData.cellsize == 0.0f)
-                               sce->gm.recastData.cellsize = 0.3f;
-                       if(sce->gm.recastData.cellheight == 0.0f)
-                               sce->gm.recastData.cellheight = 0.2f;
-                       if(sce->gm.recastData.agentmaxslope == 0.0f)
-                               sce->gm.recastData.agentmaxslope = (float)M_PI/4;
-                       if(sce->gm.recastData.agentmaxclimb == 0.0f)
-                               sce->gm.recastData.agentmaxclimb = 0.9f;
-                       if(sce->gm.recastData.agentheight == 0.0f)
-                               sce->gm.recastData.agentheight = 2.0f;
-                       if(sce->gm.recastData.agentradius == 0.0f)
-                               sce->gm.recastData.agentradius = 0.6f;
-                       if(sce->gm.recastData.edgemaxlen == 0.0f)
-                               sce->gm.recastData.edgemaxlen = 12.0f;
-                       if(sce->gm.recastData.edgemaxerror == 0.0f)
-                               sce->gm.recastData.edgemaxerror = 1.3f;
-                       if(sce->gm.recastData.regionminsize == 0.0f)
-                               sce->gm.recastData.regionminsize = 50.f;
-                       if(sce->gm.recastData.regionmergesize == 0.0f)
-                               sce->gm.recastData.regionmergesize = 20.f;
-                       if(sce->gm.recastData.vertsperpoly<3)
-                               sce->gm.recastData.vertsperpoly = 6;
-                       if(sce->gm.recastData.detailsampledist == 0.0f)
-                               sce->gm.recastData.detailsampledist = 6.0f;
-                       if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
-                               sce->gm.recastData.detailsamplemaxerror = 1.0f;
-               }                       
-       }
-       
        /* 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! */
  
Simple merge
index 35de623a418808c8f4120abe0dc49229b2d06a81,b84998e6b83dd77aadc9ba7b126a395798500e18..c820ef51e0a2f528d768217fc0f4166ebb0c2552
@@@ -1592,20 -1370,11 +1592,17 @@@ static void drawcamera(Scene *scene, Vi
  {
        /* a standing up pyramid with (0,0,0) as top */
        Camera *cam;
-       float vec[8][4], facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy;
 +      Object *ob= base->object;
+       float tvec[3];
+       float vec[4][3], asp[2], shift[2], scale[3];
        int i;
        float drawsize;
        const short is_view= (rv3d->persp==RV3D_CAMOB && ob==v3d->camera);
-       const float scax= 1.0f / len_v3(ob->obmat[0]);
-       const float scay= 1.0f / len_v3(ob->obmat[1]);
-       const float scaz= 1.0f / len_v3(ob->obmat[2]);
 +      MovieClip *clip= object_get_movieclip(scene, base->object);
 +
 +      /* draw data for movie clip set as active for scene */
 +      if(clip)
 +              draw_viewport_reconstruction(scene, base, v3d, clip, flag);
  
  #ifdef VIEW3D_CAMERA_BORDER_HACK
        if(is_view && !(G.f & G_PICKSEL)) {
Simple merge
Simple merge
index 298475ffc59068b91c2dba5682d3bedf0c011686,0000000000000000000000000000000000000000..b0e77b8921f6d6e2119749256a3b7a6bffb8c890
mode 100644,000000..100644
--- /dev/null
@@@ -1,756 -1,0 +1,756 @@@
-       RNA_def_property_collection_funcs(prop, "rna_tracking_stabTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
 +/*
 + * $Id$
 + *
 + * ***** BEGIN GPL LICENSE BLOCK *****
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 + *
 + * Contributor(s): Blender Foundation,
 + *                 Sergey Sharybin
 + *
 + * ***** END GPL LICENSE BLOCK *****
 + */
 +
 +/** \file blender/makesrna/intern/rna_tracking.c
 + *  \ingroup RNA
 + */
 +
 +
 +#include <stdlib.h>
 +#include <limits.h>
 +
 +#include "MEM_guardedalloc.h"
 +
 +#include "BKE_movieclip.h"
 +#include "BKE_tracking.h"
 +
 +#include "RNA_define.h"
 +
 +#include "rna_internal.h"
 +
 +#include "DNA_movieclip_types.h"
 +#include "DNA_scene_types.h"
 +
 +#include "WM_types.h"
 +
 +#ifdef RNA_RUNTIME
 +
 +#include "BKE_depsgraph.h"
 +#include "BKE_node.h"
 +
 +#include "IMB_imbuf.h"
 +
 +#include "WM_api.h"
 +
 +static void rna_tracking_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
 +}
 +
 +static void rna_tracking_tracks_add(MovieTracking *tracking, int framenr, int number)
 +{
 +      BKE_tracking_add_track(tracking, 0, 0, framenr, 1, 1);
 +      WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL);
 +}
 +
 +static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +
 +      return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, clip->tracking.act_track);
 +}
 +
 +static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingTrack *track= (MovieTrackingTrack *)value.data;
 +      int index= BLI_findindex(&clip->tracking.tracks, track);
 +
 +      if(index>=0) clip->tracking.act_track= track;
 +      else clip->tracking.act_track= NULL;
 +}
 +
 +void rna_trackingTrack_name_get(PointerRNA *ptr, char *value)
 +{
 +      MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
 +      BLI_strncpy(value, track->name, sizeof(track->name));
 +}
 +
 +int rna_trackingTrack_name_length(PointerRNA *ptr)
 +{
 +      MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
 +      return strlen(track->name);
 +}
 +
 +void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value)
 +{
 +      MovieClip *clip= (MovieClip *)ptr->id.data;
 +      MovieTrackingTrack *track= (MovieTrackingTrack *)ptr->data;
 +      BLI_strncpy(track->name, value, sizeof(track->name));
 +
 +      BKE_track_unique_name(&clip->tracking, track);
 +}
 +
 +static void rna_tracking_trackerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingTrack *track;
 +
 +      /* XXX: clamp modified marker only */
 +      track= clip->tracking.tracks.first;
 +      while(track) {
 +              BKE_tracking_clamp_track(track, CLAMP_PAT_DIM);
 +              track= track->next;
 +      }
 +}
 +
 +static void rna_tracking_trackerSearch_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingTrack *track;
 +
 +      /* XXX: clamp modified marker only */
 +      track= clip->tracking.tracks.first;
 +      while(track) {
 +              BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
 +              track= track->next;
 +      }
 +}
 +
 +static float rna_trackingCamera_focal_get(PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingCamera *camera= &clip->tracking.camera;
 +      float val= camera->focal;
 +
 +      if(camera->units==CAMERA_UNITS_MM) {
 +              if(clip->lastsize[0])
 +                      val= val*camera->sensor_width/(float)clip->lastsize[0];
 +      }
 +
 +      return val;
 +}
 +
 +static void rna_trackingCamera_focal_set(PointerRNA *ptr, float value)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingCamera *camera= &clip->tracking.camera;
 +
 +      if(camera->units==CAMERA_UNITS_MM) {
 +              if(clip->lastsize[0])
 +                      value= clip->lastsize[0]*value/camera->sensor_width;
 +      }
 +
 +      camera->focal= value;
 +}
 +
 +static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
 +{
 +      MovieTrackingTrack *track= (MovieTrackingTrack*)data;
 +
 +      if((track->flag&TRACK_USE_2D_STAB)==0)
 +              return 1;
 +
 +      return 0;
 +}
 +
 +static void rna_tracking_stabTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization);
 +}
 +
 +static int rna_tracking_stabTracks_active_index_get(PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      return clip->tracking.stabilization.act_track;
 +}
 +
 +static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      clip->tracking.stabilization.act_track= value;
 +}
 +
 +static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +
 +      *min= 0;
 +      *max= clip->tracking.stabilization.tot_track-1;
 +      *max= MAX2(0, *max);
 +}
 +
 +static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
 +{
 +      MovieClip *clip= (MovieClip*)ptr->id.data;
 +      MovieTrackingStabilization *stab= &clip->tracking.stabilization;
 +
 +      stab->ok= 0;
 +
 +      NodeTagIDChanged(scene->nodetree, &clip->id);
 +
 +      WM_main_add_notifier(NC_SCENE|ND_NODES, NULL);
 +      DAG_id_tag_update(&clip->id, 0);
 +}
 +
 +/* API */
 +
 +static MovieTrackingMarker *rna_trackingTrack_marker_get(MovieTrackingTrack *track, int framenr)
 +{
 +      return BKE_tracking_get_marker(track, framenr);
 +}
 +
 +#else
 +
 +static int rna_matrix_dimsize_4x4[]= {4, 4};
 +
 +static void rna_def_trackingSettings(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      static EnumPropertyItem tracker_items[] = {
 +              {TRACKER_SAD, "SAD", 0, "SAD", "Sum of Absolute Differences tracker"},
 +              {TRACKER_KLT, "KLT", 0, "KLT", "Kanade–Lucas–Tomasi racker"},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      static EnumPropertyItem speed_items[] = {
 +              {0, "FASTEST", 0, "Fastest", "Track as fast as it's possible"},
 +          {TRACKING_SPEED_DOUBLE, "DOUBLE", 0, "Double", "Track with double speed"},
 +              {TRACKING_SPEED_REALTIME, "REALTIME", 0, "Realtime", "Track with realtime speed"},
 +              {TRACKING_SPEED_HALF, "HALF", 0, "Half", "Track with half of realtime speed"},
 +              {TRACKING_SPEED_QUARTER, "QUARTER", 0, "Quarter", "Track with quarter of realtime speed"},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      static EnumPropertyItem cleanup_items[] = {
 +              {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select un-clean tracks"},
 +              {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete un-clean tracks"},
 +              {TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete un-clean segments of tracks"},
 +              {0, NULL, 0, NULL, NULL}
 +      };
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingSettings", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match-moving tracking settings");
 +
 +      /* tracker */
 +      prop= RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_enum_items(prop, tracker_items);
 +      RNA_def_property_ui_text(prop, "tracker", "Tracking algorithm to use");
 +
 +      /* speed */
 +      prop= RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_enum_items(prop, speed_items);
 +      RNA_def_property_ui_text(prop, "Speed", "Speed to make tracking with");
 +
 +      /* limit frames */
 +      prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "frames_limit");
 +      RNA_def_property_range(prop, 0, INT_MAX);
 +      RNA_def_property_ui_text(prop, "Frames Limit", "Amount of frames to be tracked during single tracking operation");
 +
 +      /* adjust frames */
 +      prop= RNA_def_property(srna, "adjust_frames", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "adjframes");
 +      RNA_def_property_range(prop, 0, INT_MAX);
 +      RNA_def_property_ui_text(prop, "Adjust Frames", "Automatically re-adjust marker position using position on each N frames. 0 means only keyframed position is sued");
 +
 +      /* margin */
 +      prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "margin");
 +      RNA_def_property_range(prop, 0, 300);
 +      RNA_def_property_ui_text(prop, "Margin", "Margin for markers from image boundary");
 +
 +      /* keyframe_a */
 +      prop= RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "keyframe1");
 +      RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization");
 +
 +      /* keyframe_b */
 +      prop= RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "keyframe2");
 +      RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization");
 +
 +      /* minmal correlation */
 +      prop= RNA_def_property(srna, "min_correlation", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_float_sdna(prop, NULL, "corr");
 +      RNA_def_property_range(prop, -1.0f, 1.0f);
 +      RNA_def_property_ui_range(prop, -1.f, 1.f, .1, 3);
 +      RNA_def_property_ui_text(prop, "Correlation", "Minimal value of correlation between mathed pattern and reference which is still treated as successful tracking");
 +
 +      /* tool settings */
 +
 +      /* distance */
 +      prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_float_sdna(prop, NULL, "dist");
 +      RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for scene scaling");
 +
 +      /* frames count */
 +      prop= RNA_def_property(srna, "clean_frames", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "clean_frames");
 +      RNA_def_property_range(prop, 0, INT_MAX);
 +      RNA_def_property_ui_text(prop, "Tracked Frames", "Affect on tracks which are tracked less than specified amount of frames");
 +
 +      /* reprojection error */
 +      prop= RNA_def_property(srna, "clean_error", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_float_sdna(prop, NULL, "clean_error");
 +      RNA_def_property_range(prop, 0, FLT_MAX);
 +      RNA_def_property_ui_text(prop, "Reprojection Error", "Affect on tracks with have got larger reprojection error");
 +
 +      /* cleanup action */
 +      prop= RNA_def_property(srna, "clean_action", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "clean_action");
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_enum_items(prop, cleanup_items);
 +      RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute");
 +}
 +
 +static void rna_def_trackingCamera(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      static EnumPropertyItem camera_units_items[] = {
 +              {CAMERA_UNITS_PX, "PIXELS", 0, "px", "Use pixels for units of focal length"},
 +              {CAMERA_UNITS_MM, "MILLIMETERS", 0, "mm", "Use millimeters for units of focal length"},
 +              {0, NULL, 0, NULL, NULL}};
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingCamera", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking camera data", "Match-moving camera data for tracking");
 +
 +      /* Sensor */
 +      prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "sensor_width");
 +      RNA_def_property_range(prop, 0.0f, 500.0f);
 +      RNA_def_property_ui_text(prop, "Sensor", "Width of CCD sensor in millimeters");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +
 +      /* Focal Length */
 +      prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "focal");
 +      RNA_def_property_range(prop, 0.0f, 5000.0f);
 +      RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length in pixels");
 +      RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_get", "rna_trackingCamera_focal_set", NULL);
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +
 +      /* Units */
 +      prop= RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "units");
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_enum_items(prop, camera_units_items);
 +      RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length");
 +
 +      /* Principal Point */
 +      prop= RNA_def_property(srna, "principal", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_float_sdna(prop, NULL, "principal");
 +      RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +
 +      /* Radial distortion parameters */
 +      prop= RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "k1");
 +      RNA_def_property_ui_range(prop, -10, 10, .1, 3);
 +      RNA_def_property_ui_text(prop, "K1", "");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
 +
 +      prop= RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "k2");
 +      RNA_def_property_ui_range(prop, -10, 10, .1, 3);
 +      RNA_def_property_ui_text(prop, "K2", "");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
 +
 +      prop= RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "k3");
 +      RNA_def_property_ui_range(prop, -10, 10, .1, 3);
 +      RNA_def_property_ui_text(prop, "K3", "");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
 +
 +      /* pixel aspect */
 +      prop= RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ);
 +      RNA_def_property_float_sdna(prop, NULL, "pixel_aspect");
 +      RNA_def_property_range(prop, 0.1f, 5000.0f);
 +      RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
 +      RNA_def_property_ui_text(prop, "Pixel Aspect", "Pixel aspect ratio");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +}
 +
 +static void rna_def_trackingMarker(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingMarker", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking marker data", "Match-moving marker data for tracking");
 +
 +      /* position */
 +      prop= RNA_def_property(srna, "pos", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
 +      RNA_def_property_float_sdna(prop, NULL, "pos");
 +      RNA_def_property_ui_text(prop, "Position", "Marker position at frame in unified coordinates");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +
 +      /* frame */
 +      prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);       /* can't be safty edited for now, need to re-sort markers array after change */
 +      RNA_def_property_int_sdna(prop, NULL, "framenr");
 +      RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +
 +      /* enabled */
 +      prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MARKER_DISABLED);
 +      RNA_def_property_ui_text(prop, "Enabled", "Is marker enabled for current frame");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +}
 +
 +static void rna_def_trackingTrack(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      FunctionRNA *func;
 +      PropertyRNA *parm;
 +
 +      rna_def_trackingMarker(brna);
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking track data", "Match-moving track data for tracking");
 +      RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
 +
 +      /* name */
 +      prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Name", "Unique name of track");
 +      RNA_def_property_string_funcs(prop, "rna_trackingTrack_name_get", "rna_trackingTrack_name_length", "rna_trackingTrack_name_set");
 +      RNA_def_property_string_maxlength(prop, MAX_ID_NAME);
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
 +      RNA_def_struct_name_property(srna, prop);
 +
 +      /* Pattern */
 +      prop= RNA_def_property(srna, "pattern_min", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
 +      RNA_def_property_float_sdna(prop, NULL, "pat_min");
 +      RNA_def_property_ui_text(prop, "Pattern Min", "Left-bottom corner of pattern area in unified coordinates relative to marker position");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update");
 +
 +      prop= RNA_def_property(srna, "pattern_max", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
 +      RNA_def_property_float_sdna(prop, NULL, "pat_max");
 +      RNA_def_property_ui_text(prop, "Pattern Max", "Right-bottom corner of pattern area in unified coordinates relative to marker position");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update");
 +
 +      /* Search */
 +      prop= RNA_def_property(srna, "search_min", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
 +      RNA_def_property_float_sdna(prop, NULL, "search_min");
 +      RNA_def_property_ui_text(prop, "Search Min", "Left-bottom corner of search area in unified coordinates relative to marker position");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update");
 +
 +      prop= RNA_def_property(srna, "search_max", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5);
 +      RNA_def_property_float_sdna(prop, NULL, "search_max");
 +      RNA_def_property_ui_text(prop, "Search Max", "Right-bottom corner of search area in unified coordinates relative to marker position");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update");
 +
 +      /* markers_count */
 +      prop= RNA_def_property(srna, "markers_count", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "markersnr");
 +      RNA_def_property_ui_text(prop, "Markers Count", "Total number of markers in track");
 +
 +      /* markers */
 +      prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingMarker");
 +      RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr");
 +      RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track");
 +
 +      /* ** channels ** */
 +
 +      /* use_red_channel */
 +      prop= RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_RED);
 +      RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* use_green_channel */
 +      prop= RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_GREEN);
 +      RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* use_blue_channel */
 +      prop= RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_BLUE);
 +      RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* has bundle */
 +      prop= RNA_def_property(srna, "has_bundle", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HAS_BUNDLE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Has Bundle", "True if track has a valid bundle");
 +
 +      /* bundle position */
 +      prop= RNA_def_property(srna, "bundle", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_float_sdna(prop, NULL, "bundle_pos");
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Bundle", "Position of bundle reconstructed from this tarck");
 +
 +      /* hidden */
 +      prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HIDDEN);
 +      RNA_def_property_ui_text(prop, "Hidden", "Track is hidden");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* locked */
 +      prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED);
 +      RNA_def_property_ui_text(prop, "Locked", "Track is locked and all changes to it are disabled");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* custom color */
 +      prop= RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_CUSTOMCOLOR);
 +      RNA_def_property_ui_text(prop, "Custom Color", "Use custom color instead of theme-defined");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* color */
 +      prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_range(prop, 0.0f, 1.0f);
 +      RNA_def_property_ui_text(prop, "Color", "Color of the track in the Clip Editor");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* average error */
 +      prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "error");
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection");
 +
 +      /* ** api ** */
 +
 +      func= RNA_def_function(srna, "get_marker", "rna_trackingTrack_marker_get");
 +      RNA_def_function_ui_description(func, "Get marker for specified frame");
 +      parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "type for the new spline", MINFRAME, MAXFRAME);
 +      RNA_def_property_flag(parm, PROP_REQUIRED);
 +      parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
 +      RNA_def_function_return(func, parm);
 +}
 +
 +static void rna_def_trackingStabilization(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingStabilization", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking stabilization data", "Match-moving stabilization data for tracking");
 +
 +      /* 2d stabilization */
 +      prop= RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_2D_STABILIZATION);
 +      RNA_def_property_ui_text(prop, "Use 2D stabilization", "Use 2D stabilization for footage");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* tracks */
 +      prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
-       RNA_def_property_collection_funcs(prop, "rna_tracking_tracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
++      RNA_def_property_collection_funcs(prop, "rna_tracking_stabTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
 +      RNA_def_property_struct_type(prop, "MovieTrackingTrack");
 +      RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks used for stabilization");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* rotation track */
 +      prop= RNA_def_property(srna, "rotation_track", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_pointer_sdna(prop, NULL, "rot_track");
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Rotation Track", "Track used to compensate rotation");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate");
 +
 +      /* active track index */
 +      prop= RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "act_track");
 +      RNA_def_property_int_funcs(prop, "rna_tracking_stabTracks_active_index_get", "rna_tracking_stabTracks_active_index_set", "rna_tracking_stabTracks_active_index_range");
 +      RNA_def_property_ui_text(prop, "Active Track Index", "Index of active track in stabilization tracks list");
 +
 +      /* autoscale */
 +      prop= RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE);
 +      RNA_def_property_ui_text(prop, "Autoscale", "Automatically scale footage to cover unfilled areas when stabilizating");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* max scale */
 +      prop= RNA_def_property(srna, "max_scale", PROP_FLOAT, PROP_FACTOR);
 +      RNA_def_property_float_sdna(prop, NULL, "maxscale");
 +      RNA_def_property_range(prop, 0.f, 10.f);
 +      RNA_def_property_ui_text(prop, "Miximal Scale", "Maximal value for scale factor");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* influence_location */
 +      prop= RNA_def_property(srna, "influence_location", PROP_FLOAT, PROP_FACTOR);
 +      RNA_def_property_float_sdna(prop, NULL, "locinf");
 +      RNA_def_property_range(prop, 0.f, 1.f);
 +      RNA_def_property_ui_text(prop, "Location Influence", "Influence of stabilization algorithm on footage location");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* influence_scale */
 +      prop= RNA_def_property(srna, "influence_scale", PROP_FLOAT, PROP_FACTOR);
 +      RNA_def_property_float_sdna(prop, NULL, "scaleinf");
 +      RNA_def_property_range(prop, 0.f, 1.f);
 +      RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +
 +      /* influence_rotation */
 +      prop= RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR);
 +      RNA_def_property_float_sdna(prop, NULL, "rotinf");
 +      RNA_def_property_range(prop, 0.f, 1.f);
 +      RNA_def_property_ui_text(prop, "Rotation Influence", "Influence of stabilization algorithm on footage rotation");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 +}
 +
 +static void rna_def_reconstructedCamera(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      srna= RNA_def_struct(brna, "MovieReconstructedCamera", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking reconstructed camera data", "Match-moving reconstructed camera data from tracker");
 +
 +      /* frame */
 +      prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_int_sdna(prop, NULL, "framenr");
 +      RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
 +
 +      /* matrix */
 +      prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
 +      RNA_def_property_float_sdna(prop, NULL, "mat");
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
 +      RNA_def_property_ui_text(prop, "Matrix", "Worldspace transformation matrix");
 +}
 +
 +static void rna_def_trackingReconstruction(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      rna_def_reconstructedCamera(brna);
 +
 +      srna= RNA_def_struct(brna, "MovieTrackingReconstruction", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking reconstruction data", "Match-moving reconstruction data from tracker");
 +
 +      /* is_reconstructed */
 +      prop= RNA_def_property(srna, "is_reconstructed", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_RECONSTRUCTED);
 +      RNA_def_property_ui_text(prop, "Reconstructed", "Is tracking data contsains valid reconstruction information");
 +
 +      /* average_error */
 +      prop= RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "error");
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction");
 +
 +      /* cameras */
 +      prop= RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieReconstructedCamera");
 +      RNA_def_property_collection_sdna(prop, NULL, "cameras", "camnr");
 +      RNA_def_property_ui_text(prop, "Cameras", "Collection of solved cameras");
 +}
 +
 +static void rna_def_trackingTracks(BlenderRNA *brna, PropertyRNA *cprop)
 +{
 +      StructRNA *srna;
 +      FunctionRNA *func;
 +
 +      RNA_def_property_srna(cprop, "MovieTrackingTracks");
 +      srna= RNA_def_struct(brna, "MovieTrackingTracks", NULL);
 +      RNA_def_struct_sdna(srna, "MovieTracking");
 +      RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks");
 +
 +      func= RNA_def_function(srna, "add", "rna_tracking_tracks_add");
 +      RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip");
 +      RNA_def_int(func, "framenr", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME);
 +      RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of tracks to add to the movie clip", 0, INT_MAX);
 +}
 +
 +static void rna_def_tracking(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      rna_def_trackingSettings(brna);
 +      rna_def_trackingCamera(brna);
 +      rna_def_trackingTrack(brna);
 +      rna_def_trackingStabilization(brna);
 +      rna_def_trackingReconstruction(brna);
 +
 +      srna= RNA_def_struct(brna, "MovieTracking", NULL);
 +      RNA_def_struct_ui_text(srna, "Movie tracking data", "Match-moving data for tracking");
 +
 +      /* settings */
 +      prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingSettings");
 +
 +      /* camera properties */
 +      prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingCamera");
 +
 +      /* tracks */
 +      prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
++      RNA_def_property_collection_funcs(prop, "rna_tracking_tracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
 +      RNA_def_property_struct_type(prop, "MovieTrackingTrack");
 +      RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object");
 +      rna_def_trackingTracks(brna, prop);
 +
 +      /* active track */
 +      prop= RNA_def_property(srna, "active_track", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingTrack");
 +      RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
 +      RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
 +      RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
 +
 +      /* stabilization */
 +      prop= RNA_def_property(srna, "stabilization", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingStabilization");
 +
 +      /* reconstruction */
 +      prop= RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_struct_type(prop, "MovieTrackingReconstruction");
 +}
 +
 +void RNA_def_tracking(BlenderRNA *brna)
 +{
 +      rna_def_tracking(brna);
 +}
 +
 +#endif
index f2ea6afa8c4cee7b1e8583e7478eb0014d9f8fcc,fe53937ec5aea8cc21e2d75a04ac915ed0804771..eb3a9c96770a9dccc2f68c292f9a8fc4e7110011
@@@ -369,9 -368,7 +369,10 @@@ void uiTemplateHistogram(struct uiLayou
  void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op){}
  void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){}
  void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){}
+ void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){}
 +void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact){}
 +void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname){}
 +void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact){}
  
  /* rna render */
  struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;}
Simple merge