static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, CBData *element) { int index = (int)(element - coba->data); if(colorband_element_remove(coba, index) == 0) BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element"); }
static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, PointerRNA *element_ptr) { CBData *element = element_ptr->data; int index = (int)(element - coba->data); if (colorband_element_remove(coba, index) == false) { BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element"); return; } RNA_POINTER_INVALIDATE(element_ptr); }