diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-10 18:28:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-10 18:30:33 +0300 |
commit | 93aecd2b8107709e117975ebd504cb6b170b79dc (patch) | |
tree | 7edb04fb5fdd2c9f5b1305eeff6db87bbea28715 | |
parent | 7bf1eca4953509db231912a5a516ec87514fdd75 (diff) |
Cleanup: Remove old deprecated DerivedMesh functions
Were ifdef-ed for a long time.
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index c228595b6e8..e9ffe25bfb5 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1199,136 +1199,6 @@ static void displist_surf_indices(DispList *dl) } } -/* XXX2.8(Sybren): unused function; impossible to test after porting to Mesh */ -#ifdef WITH_DERIVEDMESH_DEPRECATED_FUNCS -static DerivedMesh *create_orco_dm(Depsgraph *depsgraph, Scene *scene, Object *ob) -{ - DerivedMesh *dm; - ListBase disp = {NULL, NULL}; - - /* OrcoDM should be created from underformed disp lists */ - BKE_displist_make_curveTypes_forOrco(depsgraph, scene, ob, &disp); - dm = CDDM_from_curve_displist(ob, &disp); - - BKE_displist_free(&disp); - - return dm; -} - -static void add_orco_dm(Object *ob, DerivedMesh *dm, DerivedMesh *orcodm) -{ - float(*orco)[3], (*layerorco)[3]; - int totvert, a; - Curve *cu = ob->data; - - totvert = dm->getNumVerts(dm); - - orco = MEM_callocN(sizeof(float) * 3 * totvert, "dm orco"); - - if (orcodm->getNumVerts(orcodm) == totvert) { - orcodm->getVertCos(orcodm, orco); - } - else { - dm->getVertCos(dm, orco); - } - - for (a = 0; a < totvert; a++) { - float *co = orco[a]; - co[0] = (co[0] - cu->loc[0]) / cu->size[0]; - co[1] = (co[1] - cu->loc[1]) / cu->size[1]; - co[2] = (co[2] - cu->loc[2]) / cu->size[2]; - } - - if ((layerorco = DM_get_vert_data_layer(dm, CD_ORCO))) { - memcpy(layerorco, orco, sizeof(float) * totvert); - MEM_freeN(orco); - } - else { - DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, orco); - } -} -#endif - -/* XXX2.8(Sybren): unused function; impossible to test after porting to Mesh */ -#ifdef WITH_DERIVEDMESH_DEPRECATED_FUNCS -static void curve_calc_orcodm(Depsgraph *depsgraph, - Scene *scene, - Object *ob, - DerivedMesh *dm_final, - const bool for_render, - const bool use_render_resolution) -{ - /* this function represents logic of mesh's orcodm calculation - * for displist-based objects - */ - VirtualModifierData virtualModifierData; - ModifierData *md = modifiers_getVirtualModifierList(ob, &virtualModifierData); - ModifierData *pretessellatePoint; - Curve *cu = ob->data; - int required_mode; - const bool editmode = (!for_render && (cu->editnurb || cu->editfont)); - DerivedMesh *ndm, *orcodm = NULL; - ModifierApplyFlag app_flag = MOD_APPLY_ORCO; - - if (use_render_resolution) { - app_flag |= MOD_APPLY_RENDER; - required_mode = eModifierMode_Render; - } - else { - required_mode = eModifierMode_Realtime; - } - - const ModifierEvalContext mectx = {depsgraph, ob, app_flag}; - - pretessellatePoint = curve_get_tessellate_point(scene, ob, use_render_resolution, editmode); - - if (editmode) { - required_mode |= eModifierMode_Editmode; - } - - if (pretessellatePoint) { - md = pretessellatePoint->next; - } - - /* If modifiers are disabled, we wouldn't be here because - * this function is only called if there're enabled constructive - * modifiers applied on the curve. - * - * This means we can create ORCO DM in advance and assume it's - * never NULL. - */ - orcodm = create_orco_dm(depsgraph, scene, ob); - - for (; md; md = md->next) { - const ModifierTypeInfo *mti = modifierType_getInfo(md->type); - - md->scene = scene; - - if (!modifier_isEnabled(scene, md, required_mode)) { - continue; - } - if (mti->type != eModifierTypeType_Constructive) { - continue; - } - - ndm = modwrap_applyModifier(md, &mectx, orcodm); - - if (ndm) { - /* if the modifier returned a new dm, release the old one */ - if (orcodm && orcodm != ndm) { - orcodm->release(orcodm); - } - orcodm = ndm; - } - } - - /* add an orco layer if needed */ - add_orco_dm(ob, dm_final, orcodm); - - orcodm->release(orcodm); -} -#endif - void BKE_displist_make_surf(Depsgraph *depsgraph, Scene *scene, Object *ob, |