svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Jun 2009 14:21:58 +0000 (14:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Jun 2009 14:21:58 +0000 (14:21 +0000)
Sequencer changes from source/blender/src coming next

14 files changed:
1  2 
projectfiles_vc9/blender/nodes/nodes.vcproj
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/BME_tools.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_sequence_types.h
source/blender/render/intern/source/texture.c
source/gameengine/Converter/SConscript
source/gameengine/Ketsji/KX_PythonInit.cpp

Simple merge
@@@ -1613,11 -2146,8 +1616,8 @@@ static void mesh_calc_modifiers(Scene *
        if(deform_r) *deform_r = NULL;
        *final_r = NULL;
  
-       if(useRenderParams) required_mode = eModifierMode_Render;
-       else required_mode = eModifierMode_Realtime;
        if(useDeform) {
 -              if(useDeform > 0 && do_ob_key(ob)) /* shape key makes deform verts */
 +              if(useDeform > 0 && do_ob_key(scene, ob)) /* shape key makes deform verts */
                        deformedVerts = mesh_getVertexCos(me, &numVerts);
                else if(inputVertexCos)
                        deformedVerts = inputVertexCos;
                for(;md; md = md->next, curr = curr->next) {
                        ModifierTypeInfo *mti = modifierType_getInfo(md->type);
  
-                       if((md->mode & required_mode) != required_mode) continue;
-                       if(mti->isDisabled && mti->isDisabled(md)) continue;
 +                      md->scene= scene;
 +                      
+                       if(!modifier_isEnabled(md, required_mode)) continue;
                        if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;
  
                        if(mti->type == eModifierTypeType_OnlyDeform) {
        for(;md; md = md->next, curr = curr->next) {
                ModifierTypeInfo *mti = modifierType_getInfo(md->type);
  
-               if((md->mode & required_mode) != required_mode) continue;
 +              md->scene= scene;
 +              
+               if(!modifier_isEnabled(md, required_mode)) continue;
                if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue;
                if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
                        modifier_setError(md, "Modifier requires original data, bad stack position.");
@@@ -7815,10 -7828,12 +7830,12 @@@ static void meshdeformModifier_deformVe
  {
        DerivedMesh *dm;
  
-       if(!derivedData && ob->type==OB_MESH)
-               dm= CDDM_from_mesh(ob->data, ob);
-       else
-               dm= derivedData;
+       if (!derivedData) {
 -              dm= get_original_dm(ob, NULL, 0);
++              dm= get_original_dm(md->scene, ob, NULL, 0);
+               if (dm == NULL) return;
+       }
+       else dm= derivedData;
  
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
        
@@@ -7961,10 -7922,10 +7978,10 @@@ static void shrinkwrapModifier_foreachO
        walk(userData, ob, &smd->auxTarget);
  }
  
 -static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 +static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
  {
        DerivedMesh *dm = NULL;
-       CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md);
+       CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(ob, md);
  
        /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */
        if(dataMask)
@@@ -8075,10 -8036,10 +8092,10 @@@ static void simpledeformModifier_update
                dag_add_relation(forest, dag_get_node(forest, smd->origin), obNode, DAG_RL_OB_DATA, "SimpleDeform Modifier");
  }
  
 -static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 +static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
  {
        DerivedMesh *dm = NULL;
-       CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md);
+       CustomDataMask dataMask = simpledeformModifier_requiredDataMask(ob, md);
  
        /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */
        if(dataMask)
@@@ -8727,9 -8696,11 +8757,11 @@@ LinkNode *modifiers_calcDataMasks(Objec
                ModifierTypeInfo *mti = modifierType_getInfo(md->type);
                CustomDataMask mask = 0;
  
-               if(mti->requiredDataMask) mask = mti->requiredDataMask(md);
+               if(modifier_isEnabled(md, required_mode))
+                       if(mti->requiredDataMask)
+                               mask = mti->requiredDataMask(ob, md);
  
 -              BLI_linklist_prepend(&dataMasks, (void *)mask);
 +              BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask));
        }
  
        /* build the list of required data masks - each mask in the list must
@@@ -1758,10 -1759,13 +1758,13 @@@ void reset_particle(Scene *scene, Parti
        else{
                /* get precise emitter matrix if particle is born */
                if(part->type!=PART_HAIR && pa->time < cfra && pa->time >= psys->cfra)
 -                      where_is_object_time(ob,pa->time);
 +                      where_is_object_time(scene, ob,pa->time);
  
                /* get birth location from object               */
-               psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0);
+               if(part->tanfac!=0.0)
+                       psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0);
+               else
+                       psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
                
                /* save local coordinates for later             */
                VECCOPY(tloc,loc);
@@@ -8989,154 -8155,35 +8989,182 @@@ static void do_versions(FileData *fd, L
                }
        
        }
 +
 +      if (main->versionfile < 250) {
 +              bScreen *screen;
 +              Scene *scene;
 +              Material *ma;
 +              Mesh *me;
 +              Scene *sce;
 +              Tex *tx;
 +              ParticleSettings *part;
 +              
 +              for(screen= main->screen.first; screen; screen= screen->id.next) {
 +                      do_versions_windowmanager_2_50(screen);
 +                      do_versions_gpencil_2_50(main, screen);
 +              }
 +              
 +              /* old Animation System (using IPO's) needs to be converted to the new Animato system 
 +               * (NOTE: conversion code in blenkernel/intern/ipo.c for now)
 +               */
 +              //do_versions_ipos_to_animato(main);
 +              
 +              /* struct audio data moved to renderdata */
 +              for(scene= main->scene.first; scene; scene= scene->id.next) {
 +                      scene->r.audio = scene->audio;
 +                      
 +                      if(!scene->toolsettings->uv_selectmode)
 +                              scene->toolsettings->uv_selectmode= UV_SELECT_VERTEX;
 +              }
 +              
 +              /* shader, composit and texture node trees have id.name empty, put something in
 +               * to have them show in RNA viewer and accessible otherwise.
 +               */
 +              for(ma= main->mat.first; ma; ma= ma->id.next) {
 +                      if(ma->nodetree && strlen(ma->nodetree->id.name)==0)
 +                              strcpy(ma->nodetree->id.name, "NTShader Nodetree");
 +              }
 +              /* and composit trees */
 +              for(sce= main->scene.first; sce; sce= sce->id.next) {
 +                      if(sce->nodetree && strlen(sce->nodetree->id.name)==0)
 +                              strcpy(sce->nodetree->id.name, "NTComposit Nodetree");
 +              }
 +              /* and texture trees */
 +              for(tx= main->tex.first; tx; tx= tx->id.next) {
 +                      if(tx->nodetree && strlen(tx->nodetree->id.name)==0)
 +                              strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
 +              }
 +              
 +              /* copy standard draw flag to meshes(used to be global, is not available here) */
 +              for(me= main->mesh.first; me; me= me->id.next) {
 +                      me->drawflag= ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES;
 +              }
 +
 +              /* particle settings conversion */
 +              for(part= main->particle.first; part; part= part->id.next) {
 +                      if(part->draw_as) {
 +                              if(part->draw_as == PART_DRAW_DOT) {
 +                                      part->ren_as = PART_DRAW_HALO;
 +                                      part->draw_as = PART_DRAW_REND;
 +                              }
 +                              else if(part->draw_as <= PART_DRAW_AXIS) {
 +                                      part->ren_as = PART_DRAW_HALO;
 +                              }
 +                              else {
 +                                      part->ren_as = part->draw_as;
 +                                      part->draw_as = PART_DRAW_REND;
 +                              }
 +                      }
 +              }
 +      }
 +
 +      /* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can
 +         bump the version (or sub-version.) */
 +      {
 +              Object *ob;
 +              Material *ma;
 +              int i;
 +
 +              for(ob = main->object.first; ob; ob = ob->id.next) {
 +
 +                      if(ob->type == OB_MESH) {
 +                              Mesh *me = newlibadr(fd, lib, ob->data);
 +                              void *olddata = ob->data;
 +                              ob->data = me;
 +
 +                              if(me && me->mr) {
 +                                      MultiresLevel *lvl;
 +                                      ModifierData *md;
 +                                      MultiresModifierData *mmd;
 +                                      DerivedMesh *dm, *orig;
 +
 +                                      /* Load original level into the mesh */
 +                                      lvl = me->mr->levels.first;
 +                                      CustomData_free_layers(&me->vdata, CD_MVERT, lvl->totvert);
 +                                      CustomData_free_layers(&me->edata, CD_MEDGE, lvl->totedge);
 +                                      CustomData_free_layers(&me->fdata, CD_MFACE, lvl->totface);
 +                                      me->totvert = lvl->totvert;
 +                                      me->totedge = lvl->totedge;
 +                                      me->totface = lvl->totface;
 +                                      me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
 +                                      me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge);
 +                                      me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface);
 +                                      memcpy(me->mvert, me->mr->verts, sizeof(MVert) * me->totvert);
 +                                      for(i = 0; i < me->totedge; ++i) {
 +                                              me->medge[i].v1 = lvl->edges[i].v[0];
 +                                              me->medge[i].v2 = lvl->edges[i].v[1];
 +                                      }
 +                                      for(i = 0; i < me->totface; ++i) {
 +                                              me->mface[i].v1 = lvl->faces[i].v[0];
 +                                              me->mface[i].v2 = lvl->faces[i].v[1];
 +                                              me->mface[i].v3 = lvl->faces[i].v[2];
 +                                              me->mface[i].v4 = lvl->faces[i].v[3];
 +                                      }
 +
 +                                      /* Add a multires modifier to the object */
 +                                      md = ob->modifiers.first;
 +                                      while(md && modifierType_getInfo(md->type)->type == eModifierTypeType_OnlyDeform)
 +                                              md = md->next;                          
 +                                      mmd = (MultiresModifierData*)modifier_new(eModifierType_Multires);
 +                                      BLI_insertlinkbefore(&ob->modifiers, md, mmd);
 +
 +                                      multiresModifier_subdivide(mmd, ob, me->mr->level_count - 1, 1, 0);
 +
 +                                      mmd->lvl = mmd->totlvl;
 +                                      orig = CDDM_from_mesh(me, NULL);
 +                                      dm = multires_dm_create_from_derived(mmd, orig, me, 0, 0);
 +                                       
 +                                      multires_load_old(dm, me->mr);
 +
 +                                      MultiresDM_mark_as_modified(dm);
 +                                      dm->release(dm);
 +                                      orig->release(orig);
 +
 +                                      /* Remove the old multires */
 +                                      multires_free(me->mr);
 +                                      me->mr = NULL;
 +                              }
 +
 +                              ob->data = olddata;
 +                      }
 +              }
 +
 +              for(ma = main->mat.first; ma; ma = ma->id.next) {
 +                      if(ma->mode & MA_HALO) {
 +                              ma->material_type= MA_TYPE_HALO;
 +                              ma->mode &= ~MA_HALO;
 +                      }
 +              }
 +      }
        
 -                              WHILE_SEQ(&ed->seqbase) {
+       if (main->versionfile < 249 && main->subversionfile < 2) {
+               Scene *sce= main->scene.first;
+               Sequence *seq;
+               Editing *ed;
+               
+               while(sce) {
+                       ed= sce->ed;
+                       if(ed) {
 -                                              if (G.scene->r.size != 100.0) {
++                              SEQP_BEGIN(ed, seq) {
+                                       if (seq->strip && seq->strip->proxy){
 -                              END_SEQ
++                                              if (sce->r.size != 100.0) {
+                                                       seq->strip->proxy->size
+                                                               = sce->r.size;
+                                               } else {
+                                                       seq->strip->proxy->size
+                                                               = 25.0;
+                                               }
+                                               seq->strip->proxy->quality =90;
+                                       }
+                               }
++                              SEQ_END
+                       }
+                       
+                       sce= sce->id.next;
+               }
+       }
  
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
@@@ -18,7 -18,6 +18,8 @@@ incs += ' #source/gameengine/Physics/co
  incs += ' #source/gameengine/Physics/Dummy'
  incs += ' #source/gameengine/Network/LoopBackNetwork'
  incs += ' #source/blender/misc #source/blender/blenloader #source/blender/gpu'
 +incs += ' #source/blender/windowmanager'
++incs += ' #source/blender/makesrna'
  
  if env['WITH_BF_SOLID']:
        incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/Fuzzics/include'