Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 8 May 2018 14:06:32 +0000 (16:06 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 8 May 2018 14:06:32 +0000 (16:06 +0200)
Conflicts:
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blender/modifiers/intern/MOD_uvproject.c

1  2 
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blender/modifiers/intern/MOD_meshsequencecache.c
source/blender/modifiers/intern/MOD_uvproject.c

@@@ -45,8 -45,8 +45,8 @@@
  #include "BLI_blenlib.h"
  
  #ifdef WITH_AUDASPACE
 -#  include AUD_DEVICE_H
 -#  include AUD_SPECIAL_H
 +#  include <AUD_Device.h>
 +#  include <AUD_Special.h>
  #endif
  
  #include "BLI_utildefines.h"
@@@ -326,6 -326,10 +326,6 @@@ static int write_video_frame(FFMpegCont
  
        frame->pts = cfra;
  
 -      if (rd->mode & R_FIELDS) {
 -              frame->top_field_first = ((rd->mode & R_ODDFIELD) != 0);
 -      }
 -
        ret = avcodec_encode_video2(c, &packet, frame, &got_output);
  
        if (ret >= 0 && got_output) {
@@@ -615,7 -619,8 +615,8 @@@ static AVStream *alloc_video_stream(FFM
        c->rc_buffer_aggressivity = 1.0;
  #endif
  
-       c->me_method = ME_EPZS;
+       /* Deprecated and not doing anything since July 2015, deleted in recent ffmpeg */
+       //c->me_method = ME_EPZS;
        
        codec = avcodec_find_encoder(c->codec_id);
        if (!codec)
                c->flags |= CODEC_FLAG_GLOBAL_HEADER;
        }
        
 -      /* Determine whether we are encoding interlaced material or not */
 -      if (rd->mode & R_FIELDS) {
 -              PRINT("Encoding interlaced video\n");
 -              c->flags |= CODEC_FLAG_INTERLACED_DCT;
 -              c->flags |= CODEC_FLAG_INTERLACED_ME;
 -      }
 -
        /* xasp & yasp got float lately... */
  
        st->sample_aspect_ratio = c->sample_aspect_ratio = av_d2q(((double) rd->xasp / (double) rd->yasp), 255);
  
  #include "BKE_cdderivedmesh.h"
  #include "BKE_dynamicpaint.h"
 +#include "BKE_layer.h"
  #include "BKE_library.h"
  #include "BKE_library_query.h"
  #include "BKE_modifier.h"
  
 -#include "depsgraph_private.h"
 +#include "DEG_depsgraph.h"
 +
  #include "DEG_depsgraph_build.h"
  
  #include "MOD_modifiertypes.h"
@@@ -62,12 -60,6 +62,6 @@@ static void copyData(const ModifierDat
        DynamicPaintModifierData *tpmd = (DynamicPaintModifierData *)target;
        
        dynamicPaint_Modifier_copy(pmd, tpmd);
-       if (tpmd->canvas) {
-               for (DynamicPaintSurface *surface = tpmd->canvas->surfaces.first; surface; surface = surface->next) {
-                       id_us_plus((ID *)surface->init_texture);
-               }
-       }
  }
  
  static void freeData(ModifierData *md)
@@@ -88,7 -80,7 +82,7 @@@ static CustomDataMask requiredDataMask(
                        if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ || 
                            surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE)
                        {
 -                              dataMask |= CD_MASK_MLOOPUV | CD_MASK_MTEXPOLY;
 +                              dataMask |= CD_MASK_MLOOPUV;
                        }
                        /* mcol */
                        if (surface->type == MOD_DPAINT_SURFACE_T_PAINT ||
                        }
                }
        }
 -
 -      if (pmd->brush) {
 -              if (pmd->brush->flags & MOD_DPAINT_USE_MATERIAL) {
 -                      dataMask |= CD_MASK_MLOOPUV | CD_MASK_MTEXPOLY;
 -              }
 -      }
        return dataMask;
  }
  
 -static DerivedMesh *applyModifier(ModifierData *md, Object *ob, 
 -                                  DerivedMesh *dm,
 -                                  ModifierApplyFlag flag)
 +static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
 +                                  DerivedMesh *dm)
  {
        DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
  
        /* dont apply dynamic paint on orco dm stack */
 -      if (!(flag & MOD_APPLY_ORCO)) {
 -              return dynamicPaint_Modifier_do(pmd, md->scene, ob, dm);
 +      if (!(ctx->flag & MOD_APPLY_ORCO)) {
 +              return dynamicPaint_Modifier_do(pmd, ctx->depsgraph, md->scene, ctx->object, dm);
        }
        return dm;
  }
@@@ -122,6 -121,27 +116,6 @@@ static bool is_brush_cb(Object *UNUSED(
        return ((DynamicPaintModifierData *)pmd)->brush != NULL;
  }
  
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -      DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;
 -
 -      /* add relation from canvases to all brush objects */
 -      if (pmd && pmd->canvas) {
 -#ifdef WITH_LEGACY_DEPSGRAPH
 -              for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface; surface = surface->next) {
 -                      if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) {
 -                              dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, surface->effector_weights, true, 0, "Dynamic Paint Field");
 -                      }
 -
 -                      /* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
 -                      dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
 -              }
 -#else
 -      (void)ctx;
 -#endif
 -      }
 -}
 -
  static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
        DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
                        }
  
                        /* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
 -                      DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
 +                      DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, surface->brush_group,  eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
                }
        }
  }
@@@ -159,6 -179,9 +153,6 @@@ static void foreachIDLink(ModifierData 
                        }
                }
        }
 -      if (pmd->brush) {
 -              walk(userData, ob, (ID **)&pmd->brush->mat, IDWALK_CB_USER);
 -      }
  }
  
  static void foreachTexLink(ModifierData *UNUSED(md), Object *UNUSED(ob),
@@@ -179,25 -202,17 +173,25 @@@ ModifierTypeInfo modifierType_DynamicPa
                                eModifierTypeFlag_UsesPreview,
  
        /* copyData */          copyData,
 +
 +      /* deformVerts_DM */    NULL,
 +      /* deformMatrices_DM */ NULL,
 +      /* deformVertsEM_DM */  NULL,
 +      /* deformMatricesEM_DM*/NULL,
 +      /* applyModifier_DM */  applyModifier,
 +      /* applyModifierEM_DM */NULL,
 +
        /* deformVerts */       NULL,
        /* deformMatrices */    NULL,
        /* deformVertsEM */     NULL,
        /* deformMatricesEM */  NULL,
 -      /* applyModifier */     applyModifier,
 +      /* applyModifier */     NULL,
        /* applyModifierEM */   NULL,
 +
        /* initData */          initData,
        /* requiredDataMask */  requiredDataMask,
        /* freeData */          freeData,
        /* isDisabled */        NULL,
 -      /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     dependsOnTime,
        /* dependsOnNormals */  NULL,
@@@ -37,6 -37,7 +37,6 @@@
  #include "BKE_library_query.h"
  #include "BKE_scene.h"
  
 -#include "depsgraph_private.h"
  #include "DEG_depsgraph_build.h"
  
  #include "MOD_modifiertypes.h"
@@@ -64,9 -65,6 +64,6 @@@ static void copyData(const ModifierDat
  
        modifier_copyData_generic(md, target);
  
-       if (tmcmd->cache_file) {
-               id_us_plus(&tmcmd->cache_file->id);
-       }
        tmcmd->reader = NULL;
  }
  
@@@ -90,14 -88,15 +87,14 @@@ static bool isDisabled(ModifierData *md
        return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0');
  }
  
 -static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 -                                  DerivedMesh *dm,
 -                                  ModifierApplyFlag UNUSED(flag))
 +static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
 +                                  DerivedMesh *dm)
  {
  #ifdef WITH_ALEMBIC
        MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
  
        /* Only used to check whether we are operating on org data or not... */
 -      Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;
 +      Mesh *me = (ctx->object->type == OB_MESH) ? ctx->object->data : NULL;
        DerivedMesh *org_dm = dm;
  
        Scene *scene = md->scene;
        if (!mcmd->reader) {
                mcmd->reader = CacheReader_open_alembic_object(cache_file->handle,
                                                               NULL,
 -                                                             ob,
 +                                                             ctx->object,
                                                               mcmd->object_path);
                if (!mcmd->reader) {
                        modifier_setError(md, "Could not create Alembic reader for file %s", cache_file->filepath);
        }
  
        DerivedMesh *result = ABC_read_mesh(mcmd->reader,
 -                                          ob,
 +                                          ctx->object,
                                            dm,
                                            time,
                                            &err_str,
        return result ? result : dm;
  #else
        return dm;
 -      UNUSED_VARS(md, ob);
 +      UNUSED_VARS(ctx, md);
  #endif
  }
  
@@@ -168,6 -167,18 +165,6 @@@ static void foreachIDLink(ModifierData 
  }
  
  
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -      MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
 -
 -      if (mcmd->cache_file != NULL) {
 -              DagNode *curNode = dag_get_node(ctx->forest, mcmd->cache_file);
 -
 -              dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -                               DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Cache File Modifier");
 -      }
 -}
 -
  static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
        MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
  }
  
  ModifierTypeInfo modifierType_MeshSequenceCache = {
 -    /* name */              "Mesh Sequence Cache",
 -    /* structName */        "MeshSeqCacheModifierData",
 -    /* structSize */        sizeof(MeshSeqCacheModifierData),
 -    /* type */              eModifierTypeType_Constructive,
 -    /* flags */             eModifierTypeFlag_AcceptsMesh |
 -                            eModifierTypeFlag_AcceptsCVs,
 -    /* copyData */          copyData,
 -    /* deformVerts */       NULL,
 -    /* deformMatrices */    NULL,
 -    /* deformVertsEM */     NULL,
 -    /* deformMatricesEM */  NULL,
 -    /* applyModifier */     applyModifier,
 -    /* applyModifierEM */   NULL,
 -    /* initData */          initData,
 -    /* requiredDataMask */  NULL,
 -    /* freeData */          freeData,
 -    /* isDisabled */        isDisabled,
 -    /* updateDepgraph */    updateDepgraph,
 -    /* updateDepsgraph */   updateDepsgraph,
 -    /* dependsOnTime */     dependsOnTime,
 -    /* dependsOnNormals */  NULL,
 -    /* foreachObjectLink */ NULL,
 -    /* foreachIDLink */     foreachIDLink,
 -    /* foreachTexLink */    NULL,
 +      /* name */              "Mesh Sequence Cache",
 +      /* structName */        "MeshSeqCacheModifierData",
 +      /* structSize */        sizeof(MeshSeqCacheModifierData),
 +      /* type */              eModifierTypeType_Constructive,
 +      /* flags */             eModifierTypeFlag_AcceptsMesh |
 +                              eModifierTypeFlag_AcceptsCVs,
 +
 +      /* copyData */          copyData,
 +
 +      /* deformVerts_DM */    NULL,
 +      /* deformMatrices_DM */ NULL,
 +      /* deformVertsEM_DM */  NULL,
 +      /* deformMatricesEM_DM*/NULL,
 +      /* applyModifier_DM */  applyModifier,
 +      /* applyModifierEM_DM */NULL,
 +
 +      /* deformVerts */       NULL,
 +      /* deformMatrices */    NULL,
 +      /* deformVertsEM */     NULL,
 +      /* deformMatricesEM */  NULL,
 +      /* applyModifier */     NULL,
 +      /* applyModifierEM */   NULL,
 +
 +      /* initData */          initData,
 +      /* requiredDataMask */  NULL,
 +      /* freeData */          freeData,
 +      /* isDisabled */        isDisabled,
 +      /* updateDepsgraph */   updateDepsgraph,
 +      /* dependsOnTime */     dependsOnTime,
 +      /* dependsOnNormals */  NULL,
 +      /* foreachObjectLink */ NULL,
 +      /* foreachIDLink */     foreachIDLink,
 +      /* foreachTexLink */    NULL,
  };
@@@ -47,7 -47,6 +47,7 @@@
  #include "BKE_camera.h"
  #include "BKE_library.h"
  #include "BKE_library_query.h"
 +#include "BKE_material.h"
  #include "BKE_mesh.h"
  #include "BKE_DerivedMesh.h"
  
  
  #include "MEM_guardedalloc.h"
  
 -#include "depsgraph_private.h"
  #include "DEG_depsgraph_build.h"
  
  static void initData(ModifierData *md)
  {
        UVProjectModifierData *umd = (UVProjectModifierData *) md;
  
 -      umd->flags = 0;
 +
        umd->num_projectors = 1;
        umd->aspectx = umd->aspecty = 1.0f;
        umd->scalex = umd->scaley = 1.0f;
  }
  
- static void copyData(const ModifierData *md, ModifierData *target)
- {
- #if 0
-       const UVProjectModifierData *umd = (const UVProjectModifierData *) md;
-       UVProjectModifierData *tumd = (UVProjectModifierData *) target;
- #endif
-       modifier_copyData_generic(md, target);
- }
  static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))
  {
        CustomDataMask dataMask = 0;
  
        /* ask for UV coordinates */
 -      dataMask |= CD_MLOOPUV | CD_MTEXPOLY;
 +      dataMask |= CD_MLOOPUV;
  
        return dataMask;
  }
@@@ -100,13 -90,28 +90,13 @@@ static void foreachObjectLink(ModifierD
  static void foreachIDLink(ModifierData *md, Object *ob,
                            IDWalkFunc walk, void *userData)
  {
 +#if 0
        UVProjectModifierData *umd = (UVProjectModifierData *) md;
 -
 -      walk(userData, ob, (ID **)&umd->image, IDWALK_CB_USER);
 +#endif
  
        foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
  }
  
 -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 -{
 -      UVProjectModifierData *umd = (UVProjectModifierData *) md;
 -      int i;
 -
 -      for (i = 0; i < umd->num_projectors; ++i) {
 -              if (umd->projectors[i]) {
 -                      DagNode *curNode = dag_get_node(ctx->forest, umd->projectors[i]);
 -
 -                      dag_add_relation(ctx->forest, curNode, ctx->obNode,
 -                                       DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "UV Project Modifier");
 -              }
 -      }
 -}
 -
  static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
  {
        UVProjectModifierData *umd = (UVProjectModifierData *)md;
@@@ -130,9 -135,12 +120,9 @@@ static DerivedMesh *uvprojectModifier_d
  {
        float (*coords)[3], (*co)[3];
        MLoopUV *mloop_uv;
 -      MTexPoly *mtexpoly, *mt = NULL;
        int i, numVerts, numPolys, numLoops;
 -      Image *image = umd->image;
        MPoly *mpoly, *mp;
        MLoop *mloop;
 -      const bool override_image = (umd->flags & MOD_UVPROJECT_OVERRIDEIMAGE) != 0;
        Projector projectors[MOD_UVPROJECT_MAXPROJECTORS];
        int num_projectors = 0;
        char uvname[MAX_CUSTOMDATA_LAYER_NAME];
        mloop_uv = CustomData_duplicate_referenced_layer_named(&dm->loopData,
                                                               CD_MLOOPUV, uvname, numLoops);
  
 -      /* can be NULL */
 -      mt = mtexpoly = CustomData_duplicate_referenced_layer_named(&dm->polyData,
 -                                                                  CD_MTEXPOLY, uvname, numPolys);
 -
        numVerts = dm->getNumVerts(dm);
  
        coords = MEM_malloc_arrayN(numVerts, sizeof(*coords),
        mpoly = dm->getPolyArray(dm);
        mloop = dm->getLoopArray(dm);
  
 -      /* apply coords as UVs, and apply image if tfaces are new */
 -      for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp, ++mt) {
 -              if (override_image || !image || (mtexpoly == NULL || mt->tpage == image)) {
 -                      if (num_projectors == 1) {
 -                              if (projectors[0].uci) {
 -                                      unsigned int fidx = mp->totloop - 1;
 -                                      do {
 -                                              unsigned int lidx = mp->loopstart + fidx;
 -                                              unsigned int vidx = mloop[lidx].v;
 -                                              BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], projectors[0].uci);
 -                                      } while (fidx--);
 -                              }
 -                              else {
 -                                      /* apply transformed coords as UVs */
 -                                      unsigned int fidx = mp->totloop - 1;
 -                                      do {
 -                                              unsigned int lidx = mp->loopstart + fidx;
 -                                              unsigned int vidx = mloop[lidx].v;
 -                                              copy_v2_v2(mloop_uv[lidx].uv, coords[vidx]);
 -                                      } while (fidx--);
 -                              }
 +      /* apply coords as UVs */
 +      for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
 +              if (num_projectors == 1) {
 +                      if (projectors[0].uci) {
 +                              unsigned int fidx = mp->totloop - 1;
 +                              do {
 +                                      unsigned int lidx = mp->loopstart + fidx;
 +                                      unsigned int vidx = mloop[lidx].v;
 +                                      BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], projectors[0].uci);
 +                              } while (fidx--);
                        }
                        else {
 -                              /* multiple projectors, select the closest to face normal direction */
 -                              float face_no[3];
 -                              int j;
 -                              Projector *best_projector;
 -                              float best_dot;
 -
 -                              /* get the untransformed face normal */
 -                              BKE_mesh_calc_poly_normal_coords(mp, mloop + mp->loopstart, (const float (*)[3])coords, face_no);
 -
 -                              /* find the projector which the face points at most directly
 -                               * (projector normal with largest dot product is best)
 -                               */
 -                              best_dot = dot_v3v3(projectors[0].normal, face_no);
 -                              best_projector = &projectors[0];
 -
 -                              for (j = 1; j < num_projectors; ++j) {
 -                                      float tmp_dot = dot_v3v3(projectors[j].normal,
 -                                                               face_no);
 -                                      if (tmp_dot > best_dot) {
 -                                              best_dot = tmp_dot;
 -                                              best_projector = &projectors[j];
 -                                      }
 -                              }
 -
 -                              if (best_projector->uci) {
 -                                      unsigned int fidx = mp->totloop - 1;
 -                                      do {
 -                                              unsigned int lidx = mp->loopstart + fidx;
 -                                              unsigned int vidx = mloop[lidx].v;
 -                                              BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], best_projector->uci);
 -                                      } while (fidx--);
 -                              }
 -                              else {
 -                                      unsigned int fidx = mp->totloop - 1;
 -                                      do {
 -                                              unsigned int lidx = mp->loopstart + fidx;
 -                                              unsigned int vidx = mloop[lidx].v;
 -                                              mul_v2_project_m4_v3(mloop_uv[lidx].uv, best_projector->projmat, coords[vidx]);
 -                                      } while (fidx--);
 -                              }
 +                              /* apply transformed coords as UVs */
 +                              unsigned int fidx = mp->totloop - 1;
 +                              do {
 +                                      unsigned int lidx = mp->loopstart + fidx;
 +                                      unsigned int vidx = mloop[lidx].v;
 +                                      copy_v2_v2(mloop_uv[lidx].uv, coords[vidx]);
 +                              } while (fidx--);
                        }
                }
 +              else {
 +                      /* multiple projectors, select the closest to face normal direction */
 +                      float face_no[3];
 +                      int j;
 +                      Projector *best_projector;
 +                      float best_dot;
 +
 +                      /* get the untransformed face normal */
 +                      BKE_mesh_calc_poly_normal_coords(mp, mloop + mp->loopstart, (const float (*)[3])coords, face_no);
 +
 +                      /* find the projector which the face points at most directly
 +                       * (projector normal with largest dot product is best)
 +                       */
 +                      best_dot = dot_v3v3(projectors[0].normal, face_no);
 +                      best_projector = &projectors[0];
 +
 +                      for (j = 1; j < num_projectors; ++j) {
 +                              float tmp_dot = dot_v3v3(projectors[j].normal, face_no);
 +                              if (tmp_dot > best_dot) {
 +                                      best_dot = tmp_dot;
 +                                      best_projector = &projectors[j];
 +                              }
 +                      }
  
 -              if (override_image && mtexpoly) {
 -                      mt->tpage = image;
 +                      if (best_projector->uci) {
 +                              unsigned int fidx = mp->totloop - 1;
 +                              do {
 +                                      unsigned int lidx = mp->loopstart + fidx;
 +                                      unsigned int vidx = mloop[lidx].v;
 +                                      BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], best_projector->uci);
 +                              } while (fidx--);
 +                      }
 +                      else {
 +                              unsigned int fidx = mp->totloop - 1;
 +                              do {
 +                                      unsigned int lidx = mp->loopstart + fidx;
 +                                      unsigned int vidx = mloop[lidx].v;
 +                                      mul_v2_project_m4_v3(mloop_uv[lidx].uv, best_projector->projmat, coords[vidx]);
 +                              } while (fidx--);
 +                      }
                }
        }
  
        MEM_freeN(coords);
 -      
 +
        if (free_uci) {
                int j;
                for (j = 0; j < num_projectors; ++j) {
        return dm;
  }
  
 -static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 -                                  DerivedMesh *derivedData,
 -                                  ModifierApplyFlag UNUSED(flag))
 +static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
 +                                  DerivedMesh *derivedData)
  {
        DerivedMesh *result;
        UVProjectModifierData *umd = (UVProjectModifierData *) md;
  
 -      result = uvprojectModifier_do(umd, ob, derivedData);
 +      result = uvprojectModifier_do(umd, ctx->object, derivedData);
  
        return result;
  }
@@@ -338,26 -358,18 +328,26 @@@ ModifierTypeInfo modifierType_UVProjec
                                eModifierTypeFlag_SupportsEditmode |
                                eModifierTypeFlag_EnableInEditmode,
  
-       /* copyData */          copyData,
+       /* copyData */          modifier_copyData_generic,
 +
 +      /* deformVerts_DM */    NULL,
 +      /* deformMatrices_DM */ NULL,
 +      /* deformVertsEM_DM */  NULL,
 +      /* deformMatricesEM_DM*/NULL,
 +      /* applyModifier_DM */  applyModifier,
 +      /* applyModifierEM_DM */NULL,
 +
        /* deformVerts */       NULL,
        /* deformMatrices */    NULL,
        /* deformVertsEM */     NULL,
        /* deformMatricesEM */  NULL,
 -      /* applyModifier */     applyModifier,
 +      /* applyModifier */     NULL,
        /* applyModifierEM */   NULL,
 +
        /* initData */          initData,
        /* requiredDataMask */  requiredDataMask,
        /* freeData */          NULL,
        /* isDisabled */        NULL,
 -      /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     NULL,
        /* dependsOnNormals */  NULL,