Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/displist.c
| Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | void BKE_displist_fill(ListBase *dispbase, | ||||
| if (BLI_listbase_is_empty(dispbase)) { | if (BLI_listbase_is_empty(dispbase)) { | ||||
| return; | return; | ||||
| } | } | ||||
| sf_arena = BLI_memarena_new(BLI_SCANFILL_ARENA_SIZE, __func__); | sf_arena = BLI_memarena_new(BLI_SCANFILL_ARENA_SIZE, __func__); | ||||
| while (cont) { | while (cont) { | ||||
| int dl_flag_accum = 0; | int dl_flag_accum = 0; | ||||
| int dl_rt_accum = 0; | |||||
| cont = 0; | cont = 0; | ||||
| totvert = 0; | totvert = 0; | ||||
| nextcol = 0; | nextcol = 0; | ||||
| BLI_scanfill_begin_arena(&sf_ctx, sf_arena); | BLI_scanfill_begin_arena(&sf_ctx, sf_arena); | ||||
| LISTBASE_FOREACH (DispList *, dl, dispbase) { | LISTBASE_FOREACH (DispList *, dl, dispbase) { | ||||
| if (dl->type == DL_POLY) { | if (dl->type == DL_POLY) { | ||||
| Show All 31 Lines | LISTBASE_FOREACH (DispList *, dl, dispbase) { | ||||
| } | } | ||||
| else if (colnr < dl->col) { | else if (colnr < dl->col) { | ||||
| /* got poly with next material at current char */ | /* got poly with next material at current char */ | ||||
| cont = 1; | cont = 1; | ||||
| nextcol = 1; | nextcol = 1; | ||||
| } | } | ||||
| } | } | ||||
| dl_flag_accum |= dl->flag; | dl_flag_accum |= dl->flag; | ||||
| dl_rt_accum |= dl->rt; | |||||
| } | } | ||||
| } | } | ||||
| /* XXX (obedit && obedit->actcol) ? (obedit->actcol - 1) : 0)) { */ | /* XXX (obedit && obedit->actcol) ? (obedit->actcol - 1) : 0)) { */ | ||||
| if (totvert && (tot = BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, normal_proj))) { | if (totvert && (tot = BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, normal_proj))) { | ||||
| if (tot) { | if (tot) { | ||||
| dlnew = MEM_callocN(sizeof(DispList), "filldisplist"); | dlnew = MEM_callocN(sizeof(DispList), "filldisplist"); | ||||
| dlnew->type = DL_INDEX3; | dlnew->type = DL_INDEX3; | ||||
| dlnew->flag = (dl_flag_accum & (DL_BACK_CURVE | DL_FRONT_CURVE)); | dlnew->flag = (dl_flag_accum & (DL_BACK_CURVE | DL_FRONT_CURVE)); | ||||
| dlnew->rt = (dl_rt_accum & CU_SMOOTH); | |||||
| dlnew->col = colnr; | dlnew->col = colnr; | ||||
| dlnew->nr = totvert; | dlnew->nr = totvert; | ||||
| dlnew->parts = tot; | dlnew->parts = tot; | ||||
| dlnew->index = MEM_mallocN(sizeof(int[3]) * tot, "dlindex"); | dlnew->index = MEM_mallocN(sizeof(int[3]) * tot, "dlindex"); | ||||
| dlnew->verts = MEM_mallocN(sizeof(float[3]) * totvert, "dlverts"); | dlnew->verts = MEM_mallocN(sizeof(float[3]) * totvert, "dlverts"); | ||||
| if (normal_proj != NULL) { | if (normal_proj != NULL) { | ||||
| ▲ Show 20 Lines • Show All 569 Lines • ▼ Show 20 Lines | if (force_mesh_conversion && !modified) { | ||||
| * (see T71055) | * (see T71055) | ||||
| * | * | ||||
| * The easy workaround is to force to generate a Mesh that will be used for display data | * The easy workaround is to force to generate a Mesh that will be used for display data | ||||
| * since a Mesh output is already used for generative modifiers. | * since a Mesh output is already used for generative modifiers. | ||||
| * However it does not fix problems with actual edit data still being shared. | * However it does not fix problems with actual edit data still being shared. | ||||
| * | * | ||||
| * The right solution would be to COW the Curve data block at the input of the modifier | * The right solution would be to COW the Curve data block at the input of the modifier | ||||
| * stack just like what the mesh modifier does. | * stack just like what the mesh modifier does. | ||||
| * */ | */ | ||||
| modified = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase); | modified = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase); | ||||
| } | } | ||||
| if (modified) { | if (modified) { | ||||
| /* XXX2.8(Sybren): make sure the face normals are recalculated as well */ | /* XXX2.8(Sybren): make sure the face normals are recalculated as well */ | ||||
| BKE_mesh_ensure_normals(modified); | BKE_mesh_ensure_normals(modified); | ||||
| ▲ Show 20 Lines • Show All 734 Lines • Show Last 20 Lines | |||||