Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | |||||
| static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type)) | static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type)) | ||||
| { | { | ||||
| ID *id = &br->id; | ID *id = &br->id; | ||||
| if (br->flag & BRUSH_CUSTOM_ICON) | if (br->flag & BRUSH_CUSTOM_ICON) | ||||
| return; | return; | ||||
| if (id->icon_id >= BIFICONID_LAST) { | if (id->icon_id >= BIFICONID_LAST) { | ||||
| BKE_icon_delete(id); | BKE_icon_id_delete(id); | ||||
| BKE_previewimg_free_id(id); | BKE_previewimg_id_free(id); | ||||
| } | } | ||||
| id->icon_id = 0; | id->icon_id = 0; | ||||
| } | } | ||||
| static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| Brush *br = (Brush *)ptr->data; | Brush *br = (Brush *)ptr->data; | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| if (br->icon_imbuf) { | if (br->icon_imbuf) { | ||||
| IMB_freeImBuf(br->icon_imbuf); | IMB_freeImBuf(br->icon_imbuf); | ||||
| br->icon_imbuf = NULL; | br->icon_imbuf = NULL; | ||||
| } | } | ||||
| br->id.icon_id = 0; | br->id.icon_id = 0; | ||||
| if (br->flag & BRUSH_CUSTOM_ICON) { | if (br->flag & BRUSH_CUSTOM_ICON) { | ||||
| BKE_previewimg_get(&br->id); | BKE_previewimg_id_ensure(&br->id); | ||||
| BKE_icon_changed(BKE_icon_getid(&br->id)); | BKE_icon_changed(BKE_icon_id_ensure(&br->id)); | ||||
| } | } | ||||
| WM_main_add_notifier(NC_BRUSH | NA_EDITED, br); | WM_main_add_notifier(NC_BRUSH | NA_EDITED, br); | ||||
| } | } | ||||
| static void rna_TextureSlot_brush_angle_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_TextureSlot_brush_angle_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| MTex *mtex = ptr->data; | MTex *mtex = ptr->data; | ||||
| ▲ Show 20 Lines • Show All 1,071 Lines • Show Last 20 Lines | |||||