Merging r42723 through r42769 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 20 Dec 2011 17:24:20 +0000 (17:24 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 20 Dec 2011 17:24:20 +0000 (17:24 +0000)
1  2 
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_view3d/drawobject.c

index ab362fba14310c7b89ad9abaf0bc09e22d6306bd,593b526d38bae9b42e75cacc93a55c95ff0b78ae..8c96e4fa3772a1b1a3bd98f1b4d502af60eec43b
@@@ -12688,43 -12691,46 +12712,85 @@@ static void do_versions(FileData *fd, L
  
        /* put compatibility code here until next subversion bump */
        {
-               MovieClip *clip;
-               Object *ob;
+               {
+                       /* update use flags for node sockets (was only temporary before) */
+                       Scene *sce;
+                       Material *mat;
+                       Tex *tex;
+                       Lamp *lamp;
+                       World *world;
+                       bNodeTree *ntree;
  
-               for (clip= main->movieclip.first; clip; clip= clip->id.next) {
-                       MovieTracking *tracking= &clip->tracking;
-                       MovieTrackingObject *tracking_object= tracking->objects.first;
+                       for (sce=main->scene.first; sce; sce=sce->id.next)
+                               if (sce->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(sce->nodetree);
  
-                       if(!tracking->settings.object_distance)
-                               tracking->settings.object_distance= 1.0f;
+                       for (mat=main->mat.first; mat; mat=mat->id.next)
+                               if (mat->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(mat->nodetree);
+                       for (tex=main->tex.first; tex; tex=tex->id.next)
+                               if (tex->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
  
-                       if(tracking->objects.first == NULL)
-                               BKE_tracking_new_object(tracking, "Camera");
+                       for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+                               if (lamp->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(lamp->nodetree);
  
-                       while(tracking_object) {
-                               if(!tracking_object->scale)
-                                       tracking_object->scale= 1.0f;
+                       for (world=main->world.first; world; world=world->id.next)
+                               if (world->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(world->nodetree);
  
-                               tracking_object= tracking_object->next;
+                       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+                               do_versions_nodetree_socket_use_flags_2_62(ntree);
+               }
+               {
+                       /* Initialize BGE exit key to esc key */
+                       Scene *scene;
+                       for(scene= main->scene.first; scene; scene= scene->id.next) {
+                               if (!scene->gm.exitkey)
+                                       scene->gm.exitkey = 218; // Blender key code for ESC
                        }
                }
-               for (ob= main->object.first; ob; ob= ob->id.next) {
-                       bConstraint *con;
-                       for (con= ob->constraints.first; con; con=con->next) {
-                               bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
++              {
++                      MovieClip *clip;
++                      Object *ob;
 +
-                               if(!cti)
-                                       continue;
++                      for (clip= main->movieclip.first; clip; clip= clip->id.next) {
++                              MovieTracking *tracking= &clip->tracking;
++                              MovieTrackingObject *tracking_object= tracking->objects.first;
++
++                              if(!tracking->settings.object_distance)
++                                      tracking->settings.object_distance= 1.0f;
++
++                              if(tracking->objects.first == NULL)
++                                      BKE_tracking_new_object(tracking, "Camera");
++
++                              while(tracking_object) {
++                                      if(!tracking_object->scale)
++                                              tracking_object->scale= 1.0f;
++
++                                      tracking_object= tracking_object->next;
++                              }
++                      }
++
++                      for (ob= main->object.first; ob; ob= ob->id.next) {
++                              bConstraint *con;
++                              for (con= ob->constraints.first; con; con=con->next) {
++                                      bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
 +
-                               if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
-                                       bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
++                                      if(!cti)
++                                              continue;
 +
-                                       if(data->invmat[3][3]==0.0f)
-                                               unit_m4(data->invmat);
++                                      if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
++                                              bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
 +
++                                              if(data->invmat[3][3]==0.0f)
++                                                      unit_m4(data->invmat);
++                                      }
 +                              }
 +                      }
 +              }
        }
  
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */