static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; if(!ED_object_shape_key_remove(C, ob)) return OPERATOR_CANCELLED; return OPERATOR_FINISHED; }
static int shape_key_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = ED_object_context(C); bool changed = false; if (RNA_boolean_get(op->ptr, "all")) { changed = ED_object_shape_key_remove_all(bmain, ob); } else { changed = ED_object_shape_key_remove(bmain, ob); } if (changed) { DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return OPERATOR_FINISHED; } else { return OPERATOR_CANCELLED; } }