Merging r45620 through r45692 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 16 Apr 2012 12:47:34 +0000 (12:47 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 16 Apr 2012 12:47:34 +0000 (12:47 +0000)
1  2 
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_userdef.c

index f82f10e83f56a7e927a20744dd12ea1421deda4b,4242b89c3e7dbb8545451d0a4d55923210606048..93cf4f2037b418a3451dbe3474b58bafe7f22c1a
  #include <stdarg.h> /* for va_start/end */
  
  #ifndef WIN32
      #include <unistd.h> // for read close
#  include <unistd.h> // for read close
  #else
      #include <io.h> // for open close read
- #include "winsock2.h"
- #include "BLI_winstuff.h"
#  include <io.h> // for open close read
+ #  include "winsock2.h"
+ #  include "BLI_winstuff.h"
  #endif
  
  /* allow readfile to use deprecated functionality */
@@@ -5385,7 -5385,6 +5385,7 @@@ static void lib_link_screen(FileData *f
                                                sclip->clip= newlibadr_us(fd, sc->id.lib, sclip->clip);
  
                                                sclip->scopes.track_preview = NULL;
 +                                              sclip->draw_context = NULL;
                                                sclip->scopes.ok = 0;
                                        }
                                }
@@@ -7673,32 -7672,6 +7673,6 @@@ static void do_versions_nodetree_socket
        }
  }
  
- /* set the SOCK_AUTO_HIDDEN flag on collapsed nodes */
- static void do_versions_nodetree_socket_auto_hidden_flags_2_62(bNodeTree *ntree)
- {
-       bNode *node;
-       bNodeSocket *sock;
-       
-       for (node=ntree->nodes.first; node; node=node->next) {
-               if (node->flag & NODE_HIDDEN) {
-                       for (sock=node->inputs.first; sock; sock=sock->next) {
-                               if (sock->link==NULL)
-                                       sock->flag |= SOCK_AUTO_HIDDEN;
-                       }
-                       for (sock=node->outputs.first; sock; sock= sock->next) {
-                               if (nodeCountSocketLinks(ntree, sock)==0)
-                                       sock->flag |= SOCK_AUTO_HIDDEN;
-                       }
-               }
-               else {
-                       for (sock=node->inputs.first; sock; sock= sock->next)
-                               sock->flag &= ~SOCK_AUTO_HIDDEN;
-                       for (sock=node->outputs.first; sock; sock= sock->next)
-                               sock->flag &= ~SOCK_AUTO_HIDDEN;
-               }
-       }
- }
  static void do_versions_nodetree_multi_file_output_format_2_62_1(Scene *sce, bNodeTree *ntree)
  {
        bNode *node;
@@@ -13121,38 -13094,6 +13095,6 @@@ static void do_versions(FileData *fd, L
                                }
                        }
                }
-               {
-                       /* set the SOCK_AUTO_HIDDEN flag on collapsed nodes */
-                       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_socket_auto_hidden_flags_2_62(sce->nodetree);
-                       for (mat=main->mat.first; mat; mat=mat->id.next)
-                               if (mat->nodetree)
-                                       do_versions_nodetree_socket_auto_hidden_flags_2_62(mat->nodetree);
-                       for (tex=main->tex.first; tex; tex=tex->id.next)
-                               if (tex->nodetree)
-                                       do_versions_nodetree_socket_auto_hidden_flags_2_62(tex->nodetree);
-                       for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
-                               if (lamp->nodetree)
-                                       do_versions_nodetree_socket_auto_hidden_flags_2_62(lamp->nodetree);
-                       for (world=main->world.first; world; world=world->id.next)
-                               if (world->nodetree)
-                                       do_versions_nodetree_socket_auto_hidden_flags_2_62(world->nodetree);
-                       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
-                               do_versions_nodetree_socket_auto_hidden_flags_2_62(ntree);
-               }
        }
  
        if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 2))
                }
        }
  
+       if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 4))
+       {
+               /* Read Viscosity presets from older files */
+               Object *ob;
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       ModifierData *md;
+                       for (md = ob->modifiers.first; md; md = md->next) {
+                               if (md->type == eModifierType_Fluidsim) {
+                                       FluidsimModifierData *fmd = (FluidsimModifierData *)md;
+                                       if(fmd->fss->viscosityMode == 3) {
+                                               fmd->fss->viscosityValue = 5.0;
+                                               fmd->fss->viscosityExponent = 5;
+                                       }
+                                       else if(fmd->fss->viscosityMode == 4) {
+                                               fmd->fss->viscosityValue = 2.0;
+                                               fmd->fss->viscosityExponent = 3;
+                                       }
+                               }
+                       }
+               }
+       }
  
        {
                /* Default for old files is to save particle rotations to pointcache */
index 336ff07a1ad65d153f6df3ba88f826cda6ce929e,35986fa27006461738ef406f043a55c59d911cd7..fa2085ac9303e6af7c33f75dcab0cc43a8d657f2
@@@ -92,25 -92,6 +92,25 @@@ static int space_clip_frame_poll(bConte
        return FALSE;
  }
  
 +static int space_clip_size_poll(bContext *C)
 +{
 +      SpaceClip *sc = CTX_wm_space_clip(C);
 +
 +      if (sc) {
 +              MovieClip *clip = ED_space_clip(sc);
 +
 +              if (clip) {
 +                      int width, height;
 +
 +                      BKE_movieclip_get_size(clip, &sc->user, &width, &height);
 +
 +                      return width > 0 && height > 0;
 +              }
 +      }
 +
 +      return FALSE;
 +}
 +
  /********************** add marker operator *********************/
  
  static void add_marker(SpaceClip *sc, float x, float y)
@@@ -175,7 -156,7 +175,7 @@@ void CLIP_OT_add_marker(wmOperatorType 
        /* api callbacks */
        ot->invoke = add_marker_invoke;
        ot->exec = add_marker_exec;
 -      ot->poll = space_clip_frame_poll;
 +      ot->poll = space_clip_size_poll;
  
        /* flags */
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@@ -662,7 -643,7 +662,7 @@@ void CLIP_OT_slide_marker(wmOperatorTyp
        ot->idname = "CLIP_OT_slide_marker";
  
        /* api callbacks */
 -      ot->poll = space_clip_frame_poll;
 +      ot->poll = space_clip_size_poll;
        ot->invoke = slide_marker_invoke;
        ot->modal = slide_marker_modal;
  
@@@ -1219,7 -1200,7 +1219,7 @@@ void CLIP_OT_select_grouped(wmOperatorT
  
        /* api callbacks */
        ot->exec = select_groped_exec;
 -      ot->poll = space_clip_frame_poll;
 +      ot->poll = space_clip_size_poll;
  
        /* flags */
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@@ -2035,7 -2016,7 +2035,7 @@@ static Object *get_orientation_object(b
  
  static int set_orientation_poll(bContext *C)
  {
 -      if (space_clip_frame_poll(C)) {
 +      if (space_clip_size_poll(C)) {
                Scene *scene = CTX_data_scene(C);
                SpaceClip *sc = CTX_wm_space_clip(C);
                MovieClip *clip = ED_space_clip(sc);
@@@ -2452,7 -2433,7 +2452,7 @@@ void CLIP_OT_set_plane(wmOperatorType *
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
  
        /* properties */
-       RNA_def_enum(ot->srna, "plane", plane_items, 0, "Plane", "Plane to be sued for orientation");
+       RNA_def_enum(ot->srna, "plane", plane_items, 0, "Plane", "Plane to be used for orientation");
  }
  
  /********************** set axis operator *********************/
@@@ -2645,7 -2626,7 +2645,7 @@@ void CLIP_OT_set_scale(wmOperatorType *
  
  static int set_solution_scale_poll(bContext *C)
  {
 -      if (space_clip_frame_poll(C)) {
 +      if (space_clip_size_poll(C)) {
                SpaceClip *sc = CTX_wm_space_clip(C);
                MovieClip *clip = ED_space_clip(sc);
                MovieTracking *tracking = &clip->tracking;
@@@ -2993,7 -2974,7 +2993,7 @@@ void CLIP_OT_frame_jump(wmOperatorType 
  
        /* api callbacks */
        ot->exec = frame_jump_exec;
 -      ot->poll = space_clip_frame_poll;
 +      ot->poll = ED_space_clip_poll;
  
        /* flags */
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@@ -3050,7 -3031,7 +3050,7 @@@ void CLIP_OT_join_tracks(wmOperatorTyp
  
        /* api callbacks */
        ot->exec = join_tracks_exec;
 -      ot->poll = space_clip_frame_poll;
 +      ot->poll = space_clip_size_poll;
  
        /* flags */
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
@@@ -3536,8 -3517,10 +3536,10 @@@ void CLIP_OT_clean_tracks(wmOperatorTyp
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
  
        /* properties */
-       RNA_def_int(ot->srna, "frames", 0, 0, INT_MAX, "Tracked Frames", "Effect on tracks which are tracked less than specified amount of frames", 0, INT_MAX);
-       RNA_def_float(ot->srna, "error", 0.0f, 0.0f, FLT_MAX, "Reprojection Error", "Effect on tracks with have got larger re-projection error", 0.0f, 100.0f);
+       RNA_def_int(ot->srna, "frames", 0, 0, INT_MAX, "Tracked Frames",
+                   "Effect on tracks which are tracked less than specified amount of frames", 0, INT_MAX);
+       RNA_def_float(ot->srna, "error", 0.0f, 0.0f, FLT_MAX, "Reprojection Error",
+                     "Effect on tracks which have got larger re-projection error", 0.0f, 100.0f);
        RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Cleanup action to execute");
  }
  
index 59061ac9a3314b7db83c3f0b15c92eac44111b47,da73a25d1975b3c0a7d43ae04cc2647cc117ab4c..316ea46d1598474aae653eb3b91d81d6dc905cec
@@@ -338,7 -338,6 +338,7 @@@ extern StructRNA RNA_MouseSensor
  extern StructRNA RNA_MovieSequence;
  extern StructRNA RNA_MovieClipSequence;
  extern StructRNA RNA_MovieTrackingObject;
 +extern StructRNA RNA_MovieTrackingTrack;
  extern StructRNA RNA_MulticamSequence;
  extern StructRNA RNA_MultiresModifier;
  extern StructRNA RNA_MusgraveTexture;
@@@ -903,11 -902,11 +903,11 @@@ void RNA_collection_clear(PointerRNA *p
  #define RNA_BEGIN(sptr, itemptr, propname)                                    \
        {                                                                         \
                CollectionPropertyIterator rna_macro_iter;                            \
-               for(RNA_collection_begin(sptr, propname, &rna_macro_iter);            \
-                   rna_macro_iter.valid;                                             \
-                   RNA_property_collection_next(&rna_macro_iter))                    \
+               for (RNA_collection_begin(sptr, propname, &rna_macro_iter);           \
+                    rna_macro_iter.valid;                                            \
+                    RNA_property_collection_next(&rna_macro_iter))                   \
                {                                                                     \
-                       PointerRNA itemptr= rna_macro_iter.ptr;
+                       PointerRNA itemptr = rna_macro_iter.ptr;
  
  #define RNA_END                                                               \
                }                                                                     \
  #define RNA_PROP_BEGIN(sptr, itemptr, prop)                                   \
        {                                                                         \
                CollectionPropertyIterator rna_macro_iter;                            \
-               for(RNA_property_collection_begin(sptr, prop, &rna_macro_iter);       \
-                       rna_macro_iter.valid;                                             \
-                       RNA_property_collection_next(&rna_macro_iter))                    \
+               for (RNA_property_collection_begin(sptr, prop, &rna_macro_iter);      \
+                    rna_macro_iter.valid;                                            \
+                    RNA_property_collection_next(&rna_macro_iter))                   \
                {                                                                     \
-                       PointerRNA itemptr= rna_macro_iter.ptr;
+                       PointerRNA itemptr = rna_macro_iter.ptr;
  
  #define RNA_PROP_END                                                          \
                }                                                                     \
  #define RNA_STRUCT_BEGIN(sptr, prop)                                          \
        {                                                                         \
                CollectionPropertyIterator rna_macro_iter;                            \
-               for(RNA_property_collection_begin(                                    \
-                                       sptr,                                                     \
-                                       RNA_struct_iterator_property(sptr->type),                 \
-                                       &rna_macro_iter);                                         \
-                       rna_macro_iter.valid;                                             \
-                       RNA_property_collection_next(&rna_macro_iter))                    \
+               for (RNA_property_collection_begin(                                   \
+                            sptr,                                                    \
+                            RNA_struct_iterator_property(sptr->type),                \
+                            &rna_macro_iter);                                        \
+                    rna_macro_iter.valid;                                            \
+                    RNA_property_collection_next(&rna_macro_iter))                   \
                {                                                                     \
-                       PropertyRNA *prop= rna_macro_iter.ptr.data;
+                       PropertyRNA *prop = rna_macro_iter.ptr.data;
  
  #define RNA_STRUCT_END                                                        \
                }                                                                     \
index d1a776235c29f6eec45faa8f15056ae3f608c8e6,8d4b5a329698adadcc5025df2b3c81fab7990606..2e0d25423d943343ed01b370816feabb1cc92c1b
@@@ -1024,9 -1024,8 +1024,9 @@@ static EnumPropertyItem *rna_SpacePrope
  static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
  {
        SpaceClip *sc = (SpaceClip*)(ptr->data);
 +      bScreen *screen = (bScreen*)ptr->id.data;
  
 -      ED_space_clip_set(NULL, sc, (MovieClip*)value.data);
 +      ED_space_clip_set(NULL, screen, sc, (MovieClip*)value.data);
  }
  
  static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@@ -1356,7 -1355,7 +1356,7 @@@ static void rna_def_background_image(Bl
  
        prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FOREGROUND);
-       RNA_def_property_ui_text(prop, "Show On Foreground", "Show this image in fround of objects in viewport");
+       RNA_def_property_ui_text(prop, "Show On Foreground", "Show this image in front of objects in viewport");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
  }
  
@@@ -2931,7 -2930,6 +2931,7 @@@ static void rna_def_space_clip(BlenderR
        static EnumPropertyItem view_items[] = {
                {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
                {SC_VIEW_GRAPH, "GRAPH", ICON_IPO, "Graph", "Show graph view for active element"},
 +              {SC_VIEW_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dopesheet", "Dopesheet view for tracking data"},
                {0, NULL, 0, NULL, NULL}};
  
        srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
        RNA_def_property_boolean_sdna(prop, NULL, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
        RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
        RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 +
 +      /* timeline */
 +      prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_SECONDS);
 +      RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
 +      RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
  }
  
  
index 13948fde367dab32d5b296f491abba077ba6dde4,8d331670135abb18e23485f8bb4a60f3bab1d493..faf14e62564df22f53e05e851f4eb616ba0640a5
@@@ -607,12 -607,6 +607,12 @@@ static void rna_def_trackingSettings(Bl
        RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
        RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
  
 +      /* solver settings */
 +      prop = RNA_def_property(srna, "use_tripod_solver", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "motion_flag", TRACKING_MOTION_TRIPOD);
 +      RNA_def_property_ui_text(prop, "Tripod Motion", "Tracking footage is shooted by tripod camera and should use special sovler for this");
 +
        /* limit frames */
        prop = RNA_def_property(srna, "default_frames_limit", PROP_INT, PROP_NONE);
        RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@@ -1080,7 -1074,7 +1080,7 @@@ static void rna_def_trackingTrack(Blend
        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 Movie Track Editor and the 3D viewport after a solve");
+                                "Color of the track in the Movie Clip Editor and the 3D viewport after a solve");
        RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
  
        /* average error */
index e63f05bd969b85e3a60e3495f873e9b357080335,e65f59144af65d16e420e8b11cf954ec57f43d49..4f066d9f1ad32e537048e489a13d6594c2fa8cce
@@@ -2002,7 -2002,6 +2002,7 @@@ static void rna_def_userdef_theme_space
        RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
  
        rna_def_userdef_theme_spaces_main(srna);
 +      rna_def_userdef_theme_spaces_list_main(srna);
  
        prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
        RNA_def_property_float_sdna(prop, NULL, "marker_outline");
        RNA_def_property_range(prop, 0, 255);
        RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "strip");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Strips", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "strip_select");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Strips Selected", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
  }
  
  static void rna_def_userdef_themes(BlenderRNA *brna)
@@@ -2682,7 -2669,7 +2682,7 @@@ static void rna_def_userdef_edit(Blende
        prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
        RNA_def_property_float_sdna(prop, NULL, "fcu_inactive_alpha");
        RNA_def_property_range(prop, 0.001f, 1.0f);
-       RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility", 
+       RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility",
                                 "Amount that unselected F-Curves stand out from the background (Graph Editor)");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);