Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_naming.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (BKE_modifiers_uses_armature(ob, arm) && BKE_object_supports_vertex_groups(ob)) { | if (BKE_modifiers_uses_armature(ob, arm) && BKE_object_supports_vertex_groups(ob)) { | ||||
| bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname); | bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname); | ||||
| if (dg) { | if (dg) { | ||||
| BLI_strncpy(dg->name, newname, MAXBONENAME); | BLI_strncpy(dg->name, newname, MAXBONENAME); | ||||
| DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY); | |||||
| } | } | ||||
| } | } | ||||
| /* fix modifiers that might be using this name */ | /* fix modifiers that might be using this name */ | ||||
| for (md = ob->modifiers.first; md; md = md->next) { | for (md = ob->modifiers.first; md; md = md->next) { | ||||
| switch (md->type) { | switch (md->type) { | ||||
| case eModifierType_Hook: { | case eModifierType_Hook: { | ||||
| HookModifierData *hmd = (HookModifierData *)md; | HookModifierData *hmd = (HookModifierData *)md; | ||||
| Show All 40 Lines | |||||
| LISTBASE_FOREACH (GpencilModifierData *, gp_md, &ob->greasepencil_modifiers) { | LISTBASE_FOREACH (GpencilModifierData *, gp_md, &ob->greasepencil_modifiers) { | ||||
| switch (gp_md->type) { | switch (gp_md->type) { | ||||
| case eGpencilModifierType_Armature: { | case eGpencilModifierType_Armature: { | ||||
| ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)gp_md; | ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)gp_md; | ||||
| if (mmd->object && mmd->object->data == arm) { | if (mmd->object && mmd->object->data == arm) { | ||||
| bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname); | bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname); | ||||
| if (dg) { | if (dg) { | ||||
| BLI_strncpy(dg->name, newname, MAXBONENAME); | BLI_strncpy(dg->name, newname, MAXBONENAME); | ||||
| DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case eGpencilModifierType_Hook: { | case eGpencilModifierType_Hook: { | ||||
| HookGpencilModifierData *hgp_md = (HookGpencilModifierData *)gp_md; | HookGpencilModifierData *hgp_md = (HookGpencilModifierData *)gp_md; | ||||
| if (hgp_md->object && (hgp_md->object->data == arm)) { | if (hgp_md->object && (hgp_md->object->data == arm)) { | ||||
| if (STREQ(hgp_md->subtarget, oldname)) { | if (STREQ(hgp_md->subtarget, oldname)) { | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||