Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_image.c
| Show First 20 Lines • Show All 591 Lines • ▼ Show 20 Lines | static void rna_render_slots_active_set(PointerRNA *ptr, | ||||
| struct ReportList *UNUSED(reports)) | struct ReportList *UNUSED(reports)) | ||||
| { | { | ||||
| Image *image = (Image *)ptr->owner_id; | Image *image = (Image *)ptr->owner_id; | ||||
| if (value.owner_id == &image->id) { | if (value.owner_id == &image->id) { | ||||
| RenderSlot *slot = (RenderSlot *)value.data; | RenderSlot *slot = (RenderSlot *)value.data; | ||||
| int index = BLI_findindex(&image->renderslots, slot); | int index = BLI_findindex(&image->renderslots, slot); | ||||
| if (index != -1) { | if (index != -1) { | ||||
| image->render_slot = index; | image->render_slot = index; | ||||
| image->gpuflag |= IMA_GPU_REFRESH; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static int rna_render_slots_active_index_get(PointerRNA *ptr) | static int rna_render_slots_active_index_get(PointerRNA *ptr) | ||||
| { | { | ||||
| Image *image = (Image *)ptr->owner_id; | Image *image = (Image *)ptr->owner_id; | ||||
| return image->render_slot; | return image->render_slot; | ||||
| } | } | ||||
| static void rna_render_slots_active_index_set(PointerRNA *ptr, int value) | static void rna_render_slots_active_index_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| Image *image = (Image *)ptr->owner_id; | Image *image = (Image *)ptr->owner_id; | ||||
| int num_slots = BLI_listbase_count(&image->renderslots); | int num_slots = BLI_listbase_count(&image->renderslots); | ||||
| image->render_slot = value; | image->render_slot = value; | ||||
| image->gpuflag |= IMA_GPU_REFRESH; | |||||
| CLAMP(image->render_slot, 0, num_slots - 1); | CLAMP(image->render_slot, 0, num_slots - 1); | ||||
| } | } | ||||
| static void rna_render_slots_active_index_range( | static void rna_render_slots_active_index_range( | ||||
| PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | ||||
| { | { | ||||
| Image *image = (Image *)ptr->owner_id; | Image *image = (Image *)ptr->owner_id; | ||||
| *min = 0; | *min = 0; | ||||
| ▲ Show 20 Lines • Show All 545 Lines • Show Last 20 Lines | |||||