Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/displist.cc
| Show First 20 Lines • Show All 897 Lines • ▼ Show 20 Lines | ModifierData *md = pretessellatePoint == nullptr ? | ||||
| pretessellatePoint->next; | pretessellatePoint->next; | ||||
| if (r_final && *r_final) { | if (r_final && *r_final) { | ||||
| BKE_id_free(nullptr, *r_final); | BKE_id_free(nullptr, *r_final); | ||||
| } | } | ||||
| Mesh *modified = nullptr; | Mesh *modified = nullptr; | ||||
| float(*vertCos)[3] = nullptr; | float(*vertCos)[3] = nullptr; | ||||
| int totvert = 0; | |||||
| for (; md; md = md->next) { | for (; md; md = md->next) { | ||||
| const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); | const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); | ||||
| if (!BKE_modifier_is_enabled(scene, md, required_mode)) { | if (!BKE_modifier_is_enabled(scene, md, required_mode)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* If we need normals, no choice, have to convert to mesh now. */ | /* If we need normals, no choice, have to convert to mesh now. */ | ||||
| Show All 10 Lines | if (modified == nullptr /* && need_normal */) { | ||||
| } | } | ||||
| modified = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase); | modified = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase); | ||||
| } | } | ||||
| if (mti->type == eModifierTypeType_OnlyDeform || | if (mti->type == eModifierTypeType_OnlyDeform || | ||||
| (mti->type == eModifierTypeType_DeformOrConstruct && !modified)) { | (mti->type == eModifierTypeType_DeformOrConstruct && !modified)) { | ||||
| if (modified) { | if (modified) { | ||||
| int totvert = 0; | |||||
| if (!vertCos) { | if (!vertCos) { | ||||
| vertCos = BKE_mesh_vert_coords_alloc(modified, &totvert); | vertCos = BKE_mesh_vert_coords_alloc(modified, &totvert); | ||||
| } | } | ||||
| if (need_normal) { | if (need_normal) { | ||||
| BKE_mesh_ensure_normals(modified); | BKE_mesh_ensure_normals(modified); | ||||
| } | } | ||||
| mti->deformVerts(md, &mectx_deform, modified, vertCos, totvert); | mti->deformVerts(md, &mectx_deform, modified, vertCos, totvert); | ||||
| } | } | ||||
| else { | else { | ||||
| int totvert = 0; | |||||
| if (!vertCos) { | if (!vertCos) { | ||||
| vertCos = displist_vert_coords_alloc(dispbase, &totvert); | vertCos = displist_vert_coords_alloc(dispbase, &totvert); | ||||
| } | } | ||||
| mti->deformVerts(md, &mectx_deform, nullptr, vertCos, totvert); | mti->deformVerts(md, &mectx_deform, nullptr, vertCos, totvert); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (!r_final) { | if (!r_final) { | ||||
| ▲ Show 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | |||||
| void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) | void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) | ||||
| { | { | ||||
| bool doit = false; | bool doit = false; | ||||
| LISTBASE_FOREACH (const DispList *, dl, dispbase) { | LISTBASE_FOREACH (const DispList *, dl, dispbase) { | ||||
| const int tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts; | const int tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts; | ||||
| for (const int i : IndexRange(tot)) { | for (const int i : IndexRange(tot)) { | ||||
| minmax_v3v3_v3(min, max, &dl->verts[i]); | minmax_v3v3_v3(min, max, &dl->verts[i * 3]); | ||||
| } | } | ||||
| if (tot != 0) { | if (tot != 0) { | ||||
| doit = true; | doit = true; | ||||
| } | } | ||||
| } | } | ||||
| if (!doit) { | if (!doit) { | ||||
| /* there's no geometry in displist, use zero-sized boundbox */ | /* there's no geometry in displist, use zero-sized boundbox */ | ||||
| Show All 32 Lines | |||||