[Bf-blender-cvs] [948e1de3259] greasepencil-object: Rename parent layer when change bone name

Antonioya noreply at git.blender.org
Thu Aug 23 10:34:24 CEST 2018


Commit: 948e1de32593eb2b0888e30854e8f870878ee15f
Author: Antonioya
Date:   Mon Aug 20 22:34:14 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB948e1de32593eb2b0888e30854e8f870878ee15f

Rename parent layer when change bone name

===================================================================

M	source/blender/editors/armature/armature_naming.c

===================================================================

diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 3ea20e6fde3..4c5313257dc 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -34,6 +34,7 @@
 #include "DNA_armature_types.h"
 #include "DNA_constraint_types.h"
 #include "DNA_object_types.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_gpencil_modifier_types.h"
 
 #include "BLI_blenlib.h"
@@ -270,6 +271,15 @@ void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep,
 
 			/* fix grease pencil modifiers and vertex groups */
 			if (ob->type == OB_GPENCIL) {
+
+				bGPdata *gpd = (bGPdata *)ob->data;
+				for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+					if ((gpl->parent != NULL) && (gpl->parent->data == arm)) {
+						if (STREQ(gpl->parsubstr, oldname))
+							BLI_strncpy(gpl->parsubstr, newname, MAXBONENAME);
+					}
+				}
+
 				GpencilModifierData *gp_md = BKE_gpencil_modifiers_findByType(ob, eGpencilModifierType_Armature);
 				if (gp_md) {
 					ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)gp_md;



More information about the Bf-blender-cvs mailing list