forked from bartvdbraak/blender
Style cleanup: displist module
This commit is contained in:
parent
c7b20e79cd
commit
3ef11693f5
@ -78,29 +78,28 @@ typedef struct DispList {
|
||||
unsigned int *bevelSplitFlag;
|
||||
} DispList;
|
||||
|
||||
extern void copy_displist(struct ListBase *lbn, struct ListBase *lb);
|
||||
extern void free_disp_elem(DispList *dl);
|
||||
extern DispList *find_displist_create(struct ListBase *lb, int type);
|
||||
extern DispList *find_displist(struct ListBase *lb, int type);
|
||||
extern void addnormalsDispList(struct ListBase *lb);
|
||||
extern void count_displist(struct ListBase *lb, int *totvert, int *totface);
|
||||
extern void freedisplist(struct ListBase *lb);
|
||||
extern int displist_has_faces(struct ListBase *lb);
|
||||
void BKE_displist_copy(struct ListBase *lbn, struct ListBase *lb);
|
||||
void BKE_displist_elem_free(DispList *dl);
|
||||
DispList *BKE_displist_find_or_create(struct ListBase *lb, int type);
|
||||
DispList *BKE_displist_find(struct ListBase *lb, int type);
|
||||
void BKE_displist_normals_add(struct ListBase *lb);
|
||||
void BKE_displist_count(struct ListBase *lb, int *totvert, int *totface);
|
||||
void BKE_displist_free(struct ListBase *lb);
|
||||
int BKE_displist_has_faces(struct ListBase *lb);
|
||||
|
||||
extern void makeDispListSurf(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forRender, int forOrco);
|
||||
extern void makeDispListCurveTypes(struct Scene *scene, struct Object *ob, int forOrco);
|
||||
extern void makeDispListCurveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco);
|
||||
extern void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
|
||||
extern void makeDispListMBall(struct Scene *scene, struct Object *ob);
|
||||
extern void makeDispListMBall_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
|
||||
void BKE_displist_make_surf(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forRender, int forOrco);
|
||||
void BKE_displist_make_curveTypes(struct Scene *scene, struct Object *ob, int forOrco);
|
||||
void BKE_displist_make_curveTypes_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct DerivedMesh **derivedFinal, int forOrco);
|
||||
void BKE_displist_make_curveTypes_forOrco(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
|
||||
void BKE_displist_make_mball(struct Scene *scene, struct Object *ob);
|
||||
void BKE_displist_make_mball_forRender(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
|
||||
|
||||
int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
|
||||
void filldisplist(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
|
||||
int BKE_displist_surfindex_get(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
|
||||
void BKE_displist_fill(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
|
||||
|
||||
float calc_taper(struct Scene *scene, struct Object *taperobj, int cur, int tot);
|
||||
float BKE_displist_calc_taper(struct Scene *scene, struct Object *taperobj, int cur, int tot);
|
||||
|
||||
/* add Orco layer to the displist object which has got derived mesh and return orco */
|
||||
float *makeOrcoDispList(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender);
|
||||
float *BKE_displist_make_orco(struct Scene *scene, struct Object *ob, struct DerivedMesh *derivedFinal, int forRender);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -2097,7 +2097,7 @@ static void clear_mesh_caches(Object *ob)
|
||||
me->bb = NULL;
|
||||
}
|
||||
|
||||
freedisplist(&ob->disp);
|
||||
BKE_displist_free(&ob->disp);
|
||||
|
||||
if (ob->derivedFinal) {
|
||||
ob->derivedFinal->needsFree = 1;
|
||||
|
@ -1818,7 +1818,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
|
||||
|
||||
/* only happens on reload file, but violates depsgraph still... fix! */
|
||||
if ((cu->path == NULL) || (cu->path->data == NULL))
|
||||
makeDispListCurveTypes(scene, ikData->tar, 0);
|
||||
BKE_displist_make_curveTypes(scene, ikData->tar, 0);
|
||||
}
|
||||
|
||||
/* find the root bone and the chain of bones from the root to the tip
|
||||
|
@ -516,7 +516,7 @@ static void contarget_get_lattice_mat(Object *ob, const char *substring, float m
|
||||
{
|
||||
Lattice *lt = (Lattice *)ob->data;
|
||||
|
||||
DispList *dl = find_displist(&ob->disp, DL_VERTS);
|
||||
DispList *dl = BKE_displist_find(&ob->disp, DL_VERTS);
|
||||
float *co = dl ? dl->verts : NULL;
|
||||
BPoint *bp = lt->def;
|
||||
|
||||
@ -1234,7 +1234,7 @@ static void followpath_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
|
||||
|
||||
/* only happens on reload file, but violates depsgraph still... fix! */
|
||||
if (cu->path == NULL || cu->path->data == NULL)
|
||||
makeDispListCurveTypes(cob->scene, ct->tar, 0);
|
||||
BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
|
||||
|
||||
if (cu->path && cu->path->data) {
|
||||
float quat[4];
|
||||
@ -2007,7 +2007,7 @@ static void pycon_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstraintTa
|
||||
|
||||
/* this check is to make sure curve objects get updated on file load correctly.*/
|
||||
if (cu->path == NULL || cu->path->data == NULL) /* only happens on reload file, but violates depsgraph still... fix! */
|
||||
makeDispListCurveTypes(cob->scene, ct->tar, 0);
|
||||
BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
|
||||
}
|
||||
|
||||
/* firstly calculate the matrix the normal way, then let the py-function override
|
||||
@ -3090,7 +3090,7 @@ static void clampto_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bCo
|
||||
|
||||
/* only happens on reload file, but violates depsgraph still... fix! */
|
||||
if (cu->path == NULL || cu->path->data == NULL)
|
||||
makeDispListCurveTypes(cob->scene, ct->tar, 0);
|
||||
BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
|
||||
}
|
||||
|
||||
/* technically, this isn't really needed for evaluation, but we don't know what else
|
||||
@ -3720,7 +3720,7 @@ static void splineik_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bC
|
||||
|
||||
/* only happens on reload file, but violates depsgraph still... fix! */
|
||||
if (cu->path == NULL || cu->path->data == NULL)
|
||||
makeDispListCurveTypes(cob->scene, ct->tar, 0);
|
||||
BKE_displist_make_curveTypes(cob->scene, ct->tar, 0);
|
||||
}
|
||||
|
||||
/* technically, this isn't really needed for evaluation, but we don't know what else
|
||||
|
@ -136,7 +136,7 @@ void BKE_curve_free(Curve *cu)
|
||||
{
|
||||
BKE_nurbList_free(&cu->nurb);
|
||||
BLI_freelistN(&cu->bev);
|
||||
freedisplist(&cu->disp);
|
||||
BKE_displist_free(&cu->disp);
|
||||
BKE_curve_editfont_free(cu);
|
||||
|
||||
BKE_curve_editNurb_free(cu);
|
||||
@ -1234,7 +1234,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
|
||||
float *fp, *coord_array;
|
||||
ListBase disp = {NULL, NULL};
|
||||
|
||||
makeDispListCurveTypes_forOrco(scene, ob, &disp);
|
||||
BKE_displist_make_curveTypes_forOrco(scene, ob, &disp);
|
||||
|
||||
numVerts = 0;
|
||||
for (dl = disp.first; dl; dl = dl->next) {
|
||||
@ -1306,7 +1306,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
|
||||
}
|
||||
}
|
||||
|
||||
freedisplist(&disp);
|
||||
BKE_displist_free(&disp);
|
||||
|
||||
return coord_array;
|
||||
}
|
||||
@ -1337,13 +1337,13 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
|
||||
facy = cu->bevobj->size[1];
|
||||
|
||||
if (forRender) {
|
||||
makeDispListCurveTypes_forRender(scene, cu->bevobj, &bevdisp, NULL, 0);
|
||||
BKE_displist_make_curveTypes_forRender(scene, cu->bevobj, &bevdisp, NULL, 0);
|
||||
dl = bevdisp.first;
|
||||
}
|
||||
else {
|
||||
dl = cu->bevobj->disp.first;
|
||||
if (dl == NULL) {
|
||||
makeDispListCurveTypes(scene, cu->bevobj, 0);
|
||||
BKE_displist_make_curveTypes(scene, cu->bevobj, 0);
|
||||
dl = cu->bevobj->disp.first;
|
||||
}
|
||||
}
|
||||
@ -1370,7 +1370,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
|
||||
dl = dl->next;
|
||||
}
|
||||
|
||||
freedisplist(&bevdisp);
|
||||
BKE_displist_free(&bevdisp);
|
||||
}
|
||||
}
|
||||
else if (cu->ext1 == 0.0f && cu->ext2 == 0.0f) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -181,7 +181,7 @@ static void precalculate_effector(EffectorCache *eff)
|
||||
Curve *cu= eff->ob->data;
|
||||
if (cu->flag & CU_PATH) {
|
||||
if (cu->path==NULL || cu->path->data==NULL)
|
||||
makeDispListCurveTypes(eff->scene, eff->ob, 0);
|
||||
BKE_displist_make_curveTypes(eff->scene, eff->ob, 0);
|
||||
|
||||
if (cu->path && cu->path->data) {
|
||||
where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL);
|
||||
|
@ -846,7 +846,7 @@ makebreak:
|
||||
|
||||
cucu->flag |= (CU_PATH + CU_FOLLOW);
|
||||
|
||||
if (cucu->path == NULL) makeDispListCurveTypes(scene, cu->textoncurve, 0);
|
||||
if (cucu->path == NULL) BKE_displist_make_curveTypes(scene, cu->textoncurve, 0);
|
||||
if (cucu->path) {
|
||||
float distfac, imat[4][4], imat3[3][3], cmat[3][3];
|
||||
float minx, maxx, miny, maxy;
|
||||
|
@ -149,7 +149,7 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
|
||||
lt->typeu = lt->typev = lt->typew = KEY_LINEAR;
|
||||
|
||||
/* prevent using deformed locations */
|
||||
freedisplist(<Ob->disp);
|
||||
BKE_displist_free(<Ob->disp);
|
||||
|
||||
copy_m4_m4(mat, ltOb->obmat);
|
||||
unit_m4(ltOb->obmat);
|
||||
@ -294,7 +294,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
|
||||
/* we make an array with all differences */
|
||||
Lattice *lt = oblatt->data;
|
||||
BPoint *bp;
|
||||
DispList *dl = find_displist(&oblatt->disp, DL_VERTS);
|
||||
DispList *dl = BKE_displist_find(&oblatt->disp, DL_VERTS);
|
||||
float *co = dl ? dl->verts : NULL;
|
||||
float *fp, imat[4][4];
|
||||
float fu, fv, fw;
|
||||
@ -541,7 +541,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float co[3],
|
||||
|
||||
/* to be sure, mostly after file load */
|
||||
if (cu->path == NULL) {
|
||||
makeDispListCurveTypes(scene, par, 0);
|
||||
BKE_displist_make_curveTypes(scene, par, 0);
|
||||
if (cu->path == NULL) return 0; // happens on append...
|
||||
}
|
||||
|
||||
@ -963,7 +963,7 @@ void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
|
||||
float (*vertexCos)[3] = NULL;
|
||||
int numVerts, editmode = (lt->editlatt != NULL);
|
||||
|
||||
freedisplist(&ob->disp);
|
||||
BKE_displist_free(&ob->disp);
|
||||
|
||||
for (; md; md = md->next) {
|
||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||
|
@ -1172,7 +1172,7 @@ int object_remove_material_slot(Object *ob)
|
||||
/* check indices from mesh */
|
||||
if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
data_delete_material_index_id((ID *)ob->data, actcol - 1);
|
||||
freedisplist(&ob->disp);
|
||||
BKE_displist_free(&ob->disp);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -196,7 +196,7 @@ void BKE_mball_free(MetaBall *mb)
|
||||
if (mb->mat) MEM_freeN(mb->mat);
|
||||
if (mb->bb) MEM_freeN(mb->bb);
|
||||
BLI_freelistN(&mb->elems);
|
||||
if (mb->disp.first) freedisplist(&mb->disp);
|
||||
if (mb->disp.first) BKE_displist_free(&mb->disp);
|
||||
}
|
||||
|
||||
MetaBall *BKE_mball_add(const char *name)
|
||||
|
@ -242,7 +242,7 @@ void BKE_object_free_display(Object *ob)
|
||||
ob->derivedFinal = NULL;
|
||||
}
|
||||
|
||||
freedisplist(&ob->disp);
|
||||
BKE_displist_free(&ob->disp);
|
||||
}
|
||||
|
||||
void free_sculptsession_deformMats(SculptSession *ss)
|
||||
@ -1638,7 +1638,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
|
||||
|
||||
cu = par->data;
|
||||
if (cu->path == NULL || cu->path->data == NULL) /* only happens on reload file, but violates depsgraph still... fix! */
|
||||
makeDispListCurveTypes(scene, par, 0);
|
||||
BKE_displist_make_curveTypes(scene, par, 0);
|
||||
if (cu->path == NULL) return;
|
||||
|
||||
/* catch exceptions: feature for nla stride editing */
|
||||
@ -1846,7 +1846,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
||||
else if (par->type == OB_LATTICE) {
|
||||
Lattice *latt = par->data;
|
||||
BPoint *bp;
|
||||
DispList *dl = find_displist(&par->disp, DL_VERTS);
|
||||
DispList *dl = BKE_displist_find(&par->disp, DL_VERTS);
|
||||
float *co = dl ? dl->verts : NULL;
|
||||
|
||||
if (latt->editlatt) latt = latt->editlatt->latt;
|
||||
@ -2593,13 +2593,13 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
|
||||
break;
|
||||
|
||||
case OB_MBALL:
|
||||
makeDispListMBall(scene, ob);
|
||||
BKE_displist_make_mball(scene, ob);
|
||||
break;
|
||||
|
||||
case OB_CURVE:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
makeDispListCurveTypes(scene, ob, 0);
|
||||
BKE_displist_make_curveTypes(scene, ob, 0);
|
||||
break;
|
||||
|
||||
case OB_LATTICE:
|
||||
|
@ -2188,7 +2188,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
|
||||
|
||||
/* curve taper */
|
||||
if (cu->taperobj)
|
||||
mul_v3_fl(vec_to_point, calc_taper(eff->scene, cu->taperobj, (int)(data->strength * guidetime * 100.0f), 100));
|
||||
mul_v3_fl(vec_to_point, BKE_displist_calc_taper(eff->scene, cu->taperobj, (int)(data->strength * guidetime * 100.0f), 100));
|
||||
|
||||
else { /* curve size*/
|
||||
if (cu->flag & CU_PATH_RADIUS) {
|
||||
|
@ -346,7 +346,7 @@ int MeshImporter::triangulate_poly(unsigned int *indices, int totvert, MVert *ve
|
||||
vert += 3;
|
||||
}
|
||||
|
||||
filldisplist(&dispbase, &dispbase, 0);
|
||||
BKE_displist_fill(&dispbase, &dispbase, 0);
|
||||
|
||||
int tottri = 0;
|
||||
dl= (DispList*)dispbase.first;
|
||||
@ -368,7 +368,7 @@ int MeshImporter::triangulate_poly(unsigned int *indices, int totvert, MVert *ve
|
||||
}
|
||||
}
|
||||
|
||||
freedisplist(&dispbase);
|
||||
BKE_displist_free(&dispbase);
|
||||
|
||||
return tottri;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ static void draw_triangulated(int mcords[][2], short tot)
|
||||
}
|
||||
|
||||
/* do the fill */
|
||||
filldisplist(&lb, &lb, 0);
|
||||
BKE_displist_fill(&lb, &lb, 0);
|
||||
|
||||
/* do the draw */
|
||||
dl = lb.first; /* filldisplist adds in head of list */
|
||||
@ -170,7 +170,7 @@ static void draw_triangulated(int mcords[][2], short tot)
|
||||
glEnd();
|
||||
}
|
||||
|
||||
freedisplist(&lb);
|
||||
BKE_displist_free(&lb);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1239,7 +1239,7 @@ static EnumPropertyItem convert_target_items[] = {
|
||||
static void curvetomesh(Scene *scene, Object *ob)
|
||||
{
|
||||
if (ob->disp.first == NULL)
|
||||
makeDispListCurveTypes(scene, ob, 0); /* force creation */
|
||||
BKE_displist_make_curveTypes(scene, ob, 0); /* force creation */
|
||||
|
||||
BKE_mesh_from_nurbs(ob); /* also does users */
|
||||
|
||||
@ -1405,7 +1405,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
cu = newob->data;
|
||||
|
||||
if (!newob->disp.first)
|
||||
makeDispListCurveTypes(scene, newob, 0);
|
||||
BKE_displist_make_curveTypes(scene, newob, 0);
|
||||
|
||||
newob->type = OB_CURVE;
|
||||
cu->type = OB_CURVE;
|
||||
@ -1446,7 +1446,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
curvetomesh(scene, newob);
|
||||
|
||||
/* meshes doesn't use displist */
|
||||
freedisplist(&newob->disp);
|
||||
BKE_displist_free(&newob->disp);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
@ -1467,7 +1467,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
newob = ob;
|
||||
|
||||
/* meshes doesn't use displist */
|
||||
freedisplist(&newob->disp);
|
||||
BKE_displist_free(&newob->disp);
|
||||
}
|
||||
|
||||
curvetomesh(scene, newob);
|
||||
@ -1487,7 +1487,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
if (!baseob->disp.first) {
|
||||
makeDispListMBall(scene, baseob);
|
||||
BKE_displist_make_mball(scene, baseob);
|
||||
}
|
||||
|
||||
if (!(baseob->flag & OB_DONE)) {
|
||||
|
@ -1372,10 +1372,10 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
|
||||
BKE_lattice_modifiers_calc(scene, ob);
|
||||
}
|
||||
else if (ob->type == OB_MBALL) {
|
||||
makeDispListMBall(scene, ob);
|
||||
BKE_displist_make_mball(scene, ob);
|
||||
}
|
||||
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
makeDispListCurveTypes(scene, ob, 0);
|
||||
BKE_displist_make_curveTypes(scene, ob, 0);
|
||||
}
|
||||
|
||||
mmd->bindfunc = NULL;
|
||||
|
@ -533,7 +533,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
|
||||
|
||||
if ((cu->flag & CU_PATH) == 0) {
|
||||
cu->flag |= CU_PATH | CU_FOLLOW;
|
||||
makeDispListCurveTypes(scene, par, 0); /* force creation of path data */
|
||||
BKE_displist_make_curveTypes(scene, par, 0); /* force creation of path data */
|
||||
}
|
||||
else cu->flag |= CU_FOLLOW;
|
||||
|
||||
|
@ -107,7 +107,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
|
||||
stats->totcurve += totob;
|
||||
|
||||
if (ob->disp.first)
|
||||
count_displist(&ob->disp, &tot, &totf);
|
||||
BKE_displist_count(&ob->disp, &tot, &totf);
|
||||
|
||||
tot *= totob;
|
||||
totf *= totob;
|
||||
@ -124,7 +124,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
|
||||
case OB_MBALL: {
|
||||
int tot = 0, totf = 0;
|
||||
|
||||
count_displist(&ob->disp, &tot, &totf);
|
||||
BKE_displist_count(&ob->disp, &tot, &totf);
|
||||
|
||||
tot *= totob;
|
||||
totf *= totob;
|
||||
|
@ -1924,7 +1924,7 @@ void lattice_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, BPo
|
||||
Object *obedit = vc->obedit;
|
||||
Lattice *lt = obedit->data;
|
||||
BPoint *bp = lt->editlatt->latt->def;
|
||||
DispList *dl = find_displist(&obedit->disp, DL_VERTS);
|
||||
DispList *dl = BKE_displist_find(&obedit->disp, DL_VERTS);
|
||||
float *co = dl ? dl->verts : NULL;
|
||||
int i, N = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
|
||||
short s[2] = {IS_CLIPPED, 0};
|
||||
@ -1972,7 +1972,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
|
||||
/* now we default make displist, this will modifiers work for non animated case */
|
||||
if (ob->disp.first == NULL)
|
||||
BKE_lattice_modifiers_calc(scene, ob);
|
||||
dl = find_displist(&ob->disp, DL_VERTS);
|
||||
dl = BKE_displist_find(&ob->disp, DL_VERTS);
|
||||
|
||||
if (is_edit) {
|
||||
lt = lt->editlatt->latt;
|
||||
@ -3917,10 +3917,10 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
|
||||
dl = lb->first;
|
||||
if (dl == NULL) return 1;
|
||||
|
||||
if (dl->nors == NULL) addnormalsDispList(lb);
|
||||
if (dl->nors == NULL) BKE_displist_normals_add(lb);
|
||||
index3_nors_incr = 0;
|
||||
|
||||
if (displist_has_faces(lb) == 0) {
|
||||
if (BKE_displist_has_faces(lb) == 0) {
|
||||
if (!render_only) {
|
||||
draw_index_wire = 0;
|
||||
drawDispListwire(lb);
|
||||
@ -3948,7 +3948,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
|
||||
index3_nors_incr = 1;
|
||||
}
|
||||
else {
|
||||
if (!render_only || (render_only && displist_has_faces(lb))) {
|
||||
if (!render_only || (render_only && BKE_displist_has_faces(lb))) {
|
||||
draw_index_wire = 0;
|
||||
retval = drawDispListwire(lb);
|
||||
draw_index_wire = 1;
|
||||
@ -3963,7 +3963,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
|
||||
dl = lb->first;
|
||||
if (dl == NULL) return 1;
|
||||
|
||||
if (dl->nors == NULL) addnormalsDispList(lb);
|
||||
if (dl->nors == NULL) BKE_displist_normals_add(lb);
|
||||
|
||||
if (draw_glsl_material(scene, ob, v3d, dt)) {
|
||||
GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL);
|
||||
@ -3984,7 +3984,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
|
||||
|
||||
if (BKE_mball_is_basis(ob)) {
|
||||
lb = &ob->disp;
|
||||
if (lb->first == NULL) makeDispListMBall(scene, ob);
|
||||
if (lb->first == NULL) BKE_displist_make_mball(scene, ob);
|
||||
if (lb->first == NULL) return 1;
|
||||
|
||||
if (solid) {
|
||||
@ -6162,7 +6162,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
|
||||
if (BKE_mball_is_basis(ob)) {
|
||||
bb = ob->bb;
|
||||
if (bb == NULL) {
|
||||
makeDispListMBall(scene, ob);
|
||||
BKE_displist_make_mball(scene, ob);
|
||||
bb = ob->bb;
|
||||
}
|
||||
}
|
||||
@ -6235,7 +6235,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
hasfaces = dm->getNumTessFaces(dm);
|
||||
}
|
||||
else {
|
||||
hasfaces = displist_has_faces(&ob->disp);
|
||||
hasfaces = BKE_displist_has_faces(&ob->disp);
|
||||
}
|
||||
|
||||
if (hasfaces && ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
|
||||
@ -6574,7 +6574,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
/* bad exception, solve this! otherwise outline shows too late */
|
||||
if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
/* still needed for curves hidden in other layers. depgraph doesnt handle that yet */
|
||||
if (ob->disp.first == NULL) makeDispListCurveTypes(scene, ob, 0);
|
||||
if (ob->disp.first == NULL) BKE_displist_make_curveTypes(scene, ob, 0);
|
||||
}
|
||||
|
||||
/* draw outline for selected objects, mesh does itself */
|
||||
|
@ -105,7 +105,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
|
||||
copycu->editnurb = tmpcu->editnurb;
|
||||
|
||||
/* get updated display list, and convert to a mesh */
|
||||
makeDispListCurveTypes(sce, tmpobj, 0);
|
||||
BKE_displist_make_curveTypes(sce, tmpobj, 0);
|
||||
|
||||
copycu->editfont = NULL;
|
||||
copycu->editnurb = NULL;
|
||||
@ -135,9 +135,9 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
|
||||
|
||||
if (render) {
|
||||
ListBase disp = {NULL, NULL};
|
||||
makeDispListMBall_forRender(sce, ob, &disp);
|
||||
BKE_displist_make_mball_forRender(sce, ob, &disp);
|
||||
BKE_mesh_from_metaball(&disp, tmpmesh);
|
||||
freedisplist(&disp);
|
||||
BKE_displist_free(&disp);
|
||||
}
|
||||
else
|
||||
BKE_mesh_from_metaball(&ob->disp, tmpmesh);
|
||||
|
@ -360,7 +360,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
|
||||
|
||||
if (!cu->path) {
|
||||
cu->flag |= CU_PATH; // needed for path & bevlist
|
||||
makeDispListCurveTypes(scene, amd->curve_ob, 0);
|
||||
BKE_displist_make_curveTypes(scene, amd->curve_ob, 0);
|
||||
}
|
||||
if (cu->path)
|
||||
length = scale * cu->path->totdist;
|
||||
|
@ -1055,7 +1055,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
|
||||
for (i = 0; i < len_polylines; i++) {
|
||||
polyLine = PySequence_GetItem(polyLineSeq, i);
|
||||
if (!PySequence_Check(polyLine)) {
|
||||
freedisplist(&dispbase);
|
||||
BKE_displist_free(&dispbase);
|
||||
Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"One or more of the polylines is not a sequence of mathutils.Vector's");
|
||||
@ -1109,7 +1109,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
|
||||
}
|
||||
|
||||
if (ls_error) {
|
||||
freedisplist(&dispbase); /* possible some dl was allocated */
|
||||
BKE_displist_free(&dispbase); /* possible some dl was allocated */
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"A point in one of the polylines "
|
||||
"is not a mathutils.Vector type");
|
||||
@ -1117,7 +1117,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
|
||||
}
|
||||
else if (totpoints) {
|
||||
/* now make the list to return */
|
||||
filldisplist(&dispbase, &dispbase, 0);
|
||||
BKE_displist_fill(&dispbase, &dispbase, 0);
|
||||
|
||||
/* The faces are stored in a new DisplayList
|
||||
* thats added to the head of the listbase */
|
||||
@ -1125,7 +1125,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
|
||||
|
||||
tri_list = PyList_New(dl->parts);
|
||||
if (!tri_list) {
|
||||
freedisplist(&dispbase);
|
||||
BKE_displist_free(&dispbase);
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"failed to make a new list");
|
||||
return NULL;
|
||||
@ -1138,11 +1138,11 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
|
||||
dl_face += 3;
|
||||
index++;
|
||||
}
|
||||
freedisplist(&dispbase);
|
||||
BKE_displist_free(&dispbase);
|
||||
}
|
||||
else {
|
||||
/* no points, do this so scripts don't barf */
|
||||
freedisplist(&dispbase); /* possible some dl was allocated */
|
||||
BKE_displist_free(&dispbase); /* possible some dl was allocated */
|
||||
tri_list = PyList_New(0);
|
||||
}
|
||||
|
||||
|
@ -2452,7 +2452,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
|
||||
need_orco= 1;
|
||||
}
|
||||
|
||||
makeDispListMBall_forRender(re->scene, ob, &dispbase);
|
||||
BKE_displist_make_mball_forRender(re->scene, ob, &dispbase);
|
||||
dl= dispbase.first;
|
||||
if (dl==0) return;
|
||||
|
||||
@ -2526,7 +2526,7 @@ static void init_render_mball(Render *re, ObjectRen *obr)
|
||||
}
|
||||
|
||||
/* enforce display lists remade */
|
||||
freedisplist(&dispbase);
|
||||
BKE_displist_free(&dispbase);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -2828,11 +2828,11 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
|
||||
|
||||
if (ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1;
|
||||
|
||||
makeDispListSurf(re->scene, ob, &displist, &dm, 1, 0);
|
||||
BKE_displist_make_surf(re->scene, ob, &displist, &dm, 1, 0);
|
||||
|
||||
if (dm) {
|
||||
if (need_orco) {
|
||||
orco= makeOrcoDispList(re->scene, ob, dm, 1);
|
||||
orco= BKE_displist_make_orco(re->scene, ob, dm, 1);
|
||||
if (orco) {
|
||||
set_object_orco(re, ob, orco);
|
||||
}
|
||||
@ -2854,7 +2854,7 @@ static void init_render_surf(Render *re, ObjectRen *obr, int timeoffset)
|
||||
}
|
||||
}
|
||||
|
||||
freedisplist(&displist);
|
||||
BKE_displist_free(&displist);
|
||||
|
||||
MEM_freeN(matar);
|
||||
}
|
||||
@ -2878,7 +2878,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
|
||||
if (ob->type==OB_FONT && cu->str==NULL) return;
|
||||
else if (ob->type==OB_CURVE && cu->nurb.first==NULL) return;
|
||||
|
||||
makeDispListCurveTypes_forRender(re->scene, ob, &disp, &dm, 0);
|
||||
BKE_displist_make_curveTypes_forRender(re->scene, ob, &disp, &dm, 0);
|
||||
dl= disp.first;
|
||||
if (dl==NULL) return;
|
||||
|
||||
@ -2898,7 +2898,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
|
||||
|
||||
if (dm) {
|
||||
if (need_orco) {
|
||||
orco= makeOrcoDispList(re->scene, ob, dm, 1);
|
||||
orco= BKE_displist_make_orco(re->scene, ob, dm, 1);
|
||||
if (orco) {
|
||||
set_object_orco(re, ob, orco);
|
||||
}
|
||||
@ -3005,7 +3005,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
|
||||
|
||||
for (a=0; a<dl->parts; a++) {
|
||||
|
||||
if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
|
||||
if (BKE_displist_surfindex_get(dl, a, &b, &p1, &p2, &p3, &p4)==0)
|
||||
break;
|
||||
|
||||
p1+= startvert;
|
||||
@ -3062,7 +3062,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
|
||||
}
|
||||
}
|
||||
|
||||
freedisplist(&disp);
|
||||
BKE_displist_free(&disp);
|
||||
|
||||
MEM_freeN(matar);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user