From 7b6d68d7a356364432ec22a38aa6d66fc2e7d09c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 27 Apr 2007 11:54:09 +0000 Subject: [PATCH] == 2 Bugfixes == MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug #6611: Renaming bones didn't rename corresponding action-channels in NLA strips for that object. Was even marked in code as todo ;-) Bugfix #6599: Vgroup button does not update the panels in 3d viewports. Fix provided by Juho Vepsäläinen --- source/blender/src/buttons_editing.c | 5 ++--- source/blender/src/editarmature.c | 23 ++++++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index a64f461b0a0..28818e66b44 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -5073,14 +5073,13 @@ void weight_paint_buttons(uiBlock *block) uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft", 160,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Use a soft brush"); uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 235,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting"); - if(ob){ + if(ob) { uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, VP_ONLYVGROUP, 0, "Vgroup", 10,0,75,19, &Gwp.flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group."); + uiDefButBitS(block, TOG, VP_ONLYVGROUP, REDRAWVIEW3D, "Vgroup", 10,0,75,19, &Gwp.flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group."); uiDefButBitS(block, TOG, VP_MIRROR_X, REDRAWVIEW3D, "X-Mirror", 85,0,75,19, &Gwp.flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name"); uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 160,0,75,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes"); uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 235,0,75,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices"); uiBlockEndAlign(block); - } } diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 2eee1f86d80..36240714a6a 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -50,6 +50,7 @@ #include "DNA_ID.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_nla_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -2682,14 +2683,15 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) if(arm==ob->data) { Object *cob; bAction *act; - bActionChannel *chan; + bActionChannel *achan; + bActionStrip *strip; /* Rename action channel if necessary */ act = ob->action; - if (act && !act->id.lib){ + if (act && !act->id.lib) { /* Find the appropriate channel */ - chan= get_action_channel(act, oldname); - if(chan) BLI_strncpy(chan->name, newname, MAXBONENAME); + achan= get_action_channel(act, oldname); + if(achan) BLI_strncpy(achan->name, newname, MAXBONENAME); } /* Rename the pose channel, if it exists */ @@ -2700,8 +2702,16 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) } } - /* and actually do the NLA too */ - /* (todo) */ + /* check all nla-strips too */ + for (strip= ob->nlastrips.first; strip; strip= strip->next) { + /* Rename action channel if necessary */ + act = strip->act; + if (act && !act->id.lib) { + /* Find the appropriate channel */ + achan= get_action_channel(act, oldname); + if(achan) BLI_strncpy(achan->name, newname, MAXBONENAME); + } + } /* Update any object constraints to use the new bone name */ for(cob= G.main->object.first; cob; cob= cob->id.next) { @@ -2714,7 +2724,6 @@ void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) } } } - } /* See if an object is parented to this armature */