Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_naming.c
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2001-2002 NaN Holding BV. All rights reserved. */ | * Copyright 2001-2002 NaN Holding BV. All rights reserved. */ | ||||
| /** \file | /** \file | ||||
| * \ingroup edarmature | * \ingroup edarmature | ||||
| * Operators and API's for renaming bones both in and out of Edit Mode. | * Operators and API's for renaming bones both in and out of Edit Mode. | ||||
| * | * | ||||
| * This file contains functions/API's for renaming bones and/or working with them. | * This file contains functions/API's for renaming bones and/or working with them. | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_camera_types.h" | |||||
| #include "DNA_constraint_types.h" | #include "DNA_constraint_types.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | #include "DNA_gpencil_modifier_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| ▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | for (ob = bmain->objects.first; ob; ob = ob->id.next) { | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* fix camera focus */ | |||||
| if (ob->type == OB_CAMERA) { | |||||
| Camera *cam = (Camera *)ob->data; | |||||
| if (cam->dof.focus_object->data == arm){ | |||||
| if (STREQ(cam->dof.focus_subtarget, oldname)) { | |||||
| BLI_strncpy(cam->dof.focus_subtarget, newname, MAXBONENAME); | |||||
| DEG_id_tag_update(&cam->id, ID_RECALC_COPY_ON_WRITE); | |||||
| } | |||||
| } | |||||
| } | |||||
| /* fix grease pencil modifiers and vertex groups */ | /* fix grease pencil modifiers and vertex groups */ | ||||
| if (ob->type == OB_GPENCIL) { | if (ob->type == OB_GPENCIL) { | ||||
| bGPdata *gpd = (bGPdata *)ob->data; | bGPdata *gpd = (bGPdata *)ob->data; | ||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| if ((gpl->parent != NULL) && (gpl->parent->data == arm)) { | if ((gpl->parent != NULL) && (gpl->parent->data == arm)) { | ||||
| if (STREQ(gpl->parsubstr, oldname)) { | if (STREQ(gpl->parsubstr, oldname)) { | ||||
| BLI_strncpy(gpl->parsubstr, newname, MAXBONENAME); | BLI_strncpy(gpl->parsubstr, newname, MAXBONENAME); | ||||
| ▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines | |||||