Fix T37612: UV warp modifier bone name doesn't update when renamed
This commit is contained in:
		@@ -232,14 +232,33 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
 | 
				
			|||||||
			
 | 
								
 | 
				
			||||||
			/* 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) {
 | 
				
			||||||
				if (md->type == eModifierType_Hook) {
 | 
									switch (md->type) {
 | 
				
			||||||
					HookModifierData *hmd = (HookModifierData *)md;
 | 
										case eModifierType_Hook:
 | 
				
			||||||
					
 | 
										{
 | 
				
			||||||
					/* uses armature, so may use the affected bone name */
 | 
											HookModifierData *hmd = (HookModifierData *)md;
 | 
				
			||||||
					if (hmd->object && (hmd->object->data == arm)) {
 | 
					
 | 
				
			||||||
						if (!strcmp(hmd->subtarget, oldname))
 | 
											if (hmd->object && (hmd->object->data == arm)) {
 | 
				
			||||||
							BLI_strncpy(hmd->subtarget, newname, MAXBONENAME);
 | 
												if (STREQ(hmd->subtarget, oldname))
 | 
				
			||||||
 | 
													BLI_strncpy(hmd->subtarget, newname, MAXBONENAME);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
										case eModifierType_UVWarp:
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											UVWarpModifierData *umd = (UVWarpModifierData *)md;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											if (umd->object_src && (umd->object_src->data == arm)) {
 | 
				
			||||||
 | 
												if (STREQ(umd->bone_src, oldname))
 | 
				
			||||||
 | 
													BLI_strncpy(umd->bone_src, newname, MAXBONENAME);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											if (umd->object_dst && (umd->object_dst->data == arm)) {
 | 
				
			||||||
 | 
												if (STREQ(umd->bone_dst, oldname))
 | 
				
			||||||
 | 
													BLI_strncpy(umd->bone_dst, newname, MAXBONENAME);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										default:
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user