Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/gpencil.c
| Show First 20 Lines • Show All 1,855 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Remove the group */ | /* Remove the group */ | ||||
| BLI_freelinkN(&gpd->vertex_group_names, defgroup); | BLI_freelinkN(&gpd->vertex_group_names, defgroup); | ||||
| /* Update the active deform index if necessary. */ | |||||
| const int active_index = BKE_object_defgroup_active_index_get(ob); | |||||
| if (active_index > def_nr) { | |||||
| BKE_object_defgroup_active_index_set(ob, active_index - 1); | |||||
| } | |||||
| /* Keep a valid active index if we still have some vertex groups. */ | |||||
| if (!BLI_listbase_is_empty(&gpd->vertex_group_names) && | |||||
| BKE_object_defgroup_active_index_get(ob) < 1) { | |||||
| BKE_object_defgroup_active_index_set(ob, 1); | |||||
| } | |||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| void BKE_gpencil_dvert_ensure(bGPDstroke *gps) | void BKE_gpencil_dvert_ensure(bGPDstroke *gps) | ||||
| { | { | ||||
| if (gps->dvert == NULL) { | if (gps->dvert == NULL) { | ||||
| gps->dvert = MEM_callocN(sizeof(MDeformVert) * gps->totpoints, "gp_stroke_weights"); | gps->dvert = MEM_callocN(sizeof(MDeformVert) * gps->totpoints, "gp_stroke_weights"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,169 Lines • Show Last 20 Lines | |||||