diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-10-26 12:41:59 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-10-26 12:41:59 +0300 |
commit | 780a5438a2a24b6397ead881659af4442bdbb0ae (patch) | |
tree | 7c614e30da40c3f4d3da6d0b2f24429e244f5f03 /source | |
parent | 0dc22dc65e1d31e867151572e8705c3a9448802b (diff) |
Bugfixes:
* #17900 - IK Constraint was not included regardless of what Visual-Keying method was used
* Deleting a Bone Group now corrects indices of those groups that occurred after the one that was deleted
* No more click-a-mania - Delete all vertex groups from a Mesh (Ctrl-Shift-G menu)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/include/BIF_editdeform.h | 5 | ||||
-rw-r--r-- | source/blender/src/editdeform.c | 41 | ||||
-rw-r--r-- | source/blender/src/keyframing.c | 2 | ||||
-rw-r--r-- | source/blender/src/poseobject.c | 7 |
4 files changed, 49 insertions, 6 deletions
diff --git a/source/blender/include/BIF_editdeform.h b/source/blender/include/BIF_editdeform.h index 8e8b1be2dd3..6429b60a888 100644 --- a/source/blender/include/BIF_editdeform.h +++ b/source/blender/include/BIF_editdeform.h @@ -42,9 +42,10 @@ struct bDeformGroup; struct bDeformGroup *add_defgroup_name (struct Object *ob, char *name); void add_defgroup (struct Object *ob); -void del_defgroup_in_object_mode ( Object *ob ); +void del_defgroup_in_object_mode (struct Object *ob ); void del_defgroup (struct Object *ob); -void duplicate_defgroup ( struct Object *ob ); +void del_all_defgroups (struct Object *ob); +void duplicate_defgroup (struct Object *ob ); void assign_verts_defgroup (void); void remove_verts_defgroup (int allverts); void remove_verts_defgroups (int allverts); diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c index 3f178e1ea2b..8a07a4fddff 100644 --- a/source/blender/src/editdeform.c +++ b/source/blender/src/editdeform.c @@ -439,6 +439,32 @@ void del_defgroup (Object *ob) } } +void del_all_defgroups (Object *ob) +{ + /* Sanity check */ + if (ob == NULL) + return; + + /* Remove all DVerts */ + if (ob->type==OB_MESH) { + Mesh *me= ob->data; + CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); + me->dvert= NULL; + } + else { + if (editLatt->dvert) { + MEM_freeN(editLatt->dvert); + editLatt->dvert= NULL; + } + } + + /* Remove all DefGroups */ + BLI_freelistN(&ob->defbase); + + /* Fix counters/indices */ + ob->actdef= 0; +} + void create_dverts(ID *id) { /* create deform verts @@ -1008,9 +1034,9 @@ void vgroup_operation_with_menu(void) /* give user choices of adding to current/new or removing from current */ if (ob->actdef) - mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2"); + mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3"); else - mode= pupmenu("Vertex Groups %t|Change Active Group%x1"); + mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3"); /* handle choices */ switch (mode) { @@ -1033,11 +1059,20 @@ void vgroup_operation_with_menu(void) case 2: /* delete active group */ { del_defgroup(ob); - allqueue (REDRAWVIEW3D, 1); + allqueue(REDRAWVIEW3D, 1); allqueue(REDRAWOOPS, 0); BIF_undo_push("Delete vertex group"); } break; + case 3: /* delete all groups */ + { + del_all_defgroups(ob); + allqueue(REDRAWVIEW3D, 1); + allqueue(REDRAWOOPS, 0); + allqueue(REDRAWBUTSEDIT, 1); + BIF_undo_push("Delete all vertex groups"); + } + break; } } diff --git a/source/blender/src/keyframing.c b/source/blender/src/keyframing.c index 2590bacd4b6..d9c729e7df6 100644 --- a/source/blender/src/keyframing.c +++ b/source/blender/src/keyframing.c @@ -590,6 +590,8 @@ static short visualkey_can_use (ID *id, int blocktype, char *actname, char *cons return 1; case CONSTRAINT_TYPE_FOLLOWPATH: return 1; + case CONSTRAINT_TYPE_KINEMATIC: + return 1; /* single-transform constraits */ case CONSTRAINT_TYPE_TRACKTO: diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 0f624d979d5..c2a2be80e89 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -1065,10 +1065,15 @@ void pose_remove_posegroup () /* get group to remove */ grp= BLI_findlink(&pose->agroups, pose->active_group-1); if (grp) { - /* firstly, make sure nothing references it */ + /* adjust group references (the trouble of using indices!): + * - firstly, make sure nothing references it + * - also, make sure that those after this item get corrected + */ for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) { if (pchan->agrp_index == pose->active_group) pchan->agrp_index= 0; + else if (pchan->agrp_index > pose->active_group) + pchan->agrp_index--; } /* now, remove it from the pose */ |