+ return OPERATOR_FINISHED;
+ else
+ return OPERATOR_CANCELLED;
+}
+
+void POSE_OT_group_unassign (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Selected from Bone Groups";
+ ot->idname= "POSE_OT_group_unassign";
+ ot->description= "Add selected bones from all bone groups";
+
+ /* api callbacks */
+ ot->exec= pose_group_unassign_exec;
+ ot->poll= ED_operator_posemode;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/* ----------------- */
+
+static int pose_groupOps_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt)
+{
+ Object *ob= CTX_data_active_object(C);
+ uiPopupMenu *pup= uiPupMenuBegin(C, op->type->name, 0);
+ uiLayout *layout= uiPupMenuLayout(pup);
+
+ /* sanity check - must have object with pose */
+ if ELEM(NULL, ob, ob->pose)
+ return OPERATOR_CANCELLED;
+
+ /* get mode of action */
+ if (CTX_DATA_COUNT(C, selected_pchans)) {
+ /* if selected bone(s), include options to add/remove to active group */
+ uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign");