Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_image_api.c
| Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | static void rna_Image_update(Image *image, ReportList *reports) | ||||
| } | } | ||||
| ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; | ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; | ||||
| BKE_image_partial_update_mark_full_update(image); | BKE_image_partial_update_mark_full_update(image); | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| static void rna_Image_scale(Image *image, ReportList *reports, int width, int height) | static void rna_Image_scale(Image *image, bContext *C, ReportList *reports, int width, int height) | ||||
| { | { | ||||
| if (!BKE_image_scale(image, width, height)) { | if (!BKE_image_scale(image, width, height)) { | ||||
| BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2); | BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2); | ||||
| } | } | ||||
| else { | |||||
| BKE_image_partial_update_mark_full_update(image); | |||||
| WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image); | |||||
| } | |||||
| } | } | ||||
| static int rna_Image_gl_load( | static int rna_Image_gl_load( | ||||
| Image *image, ReportList *reports, int frame, int layer_index, int pass_index) | Image *image, ReportList *reports, int frame, int layer_index, int pass_index) | ||||
| { | { | ||||
| ImageUser iuser; | ImageUser iuser; | ||||
| BKE_imageuser_default(&iuser); | BKE_imageuser_default(&iuser); | ||||
| iuser.framenr = frame; | iuser.framenr = frame; | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | void RNA_api_image(StructRNA *srna) | ||||
| RNA_def_function_ui_description(func, "Reload the image from its source path"); | RNA_def_function_ui_description(func, "Reload the image from its source path"); | ||||
| func = RNA_def_function(srna, "update", "rna_Image_update"); | func = RNA_def_function(srna, "update", "rna_Image_update"); | ||||
| RNA_def_function_ui_description(func, "Update the display image from the floating-point buffer"); | RNA_def_function_ui_description(func, "Update the display image from the floating-point buffer"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| func = RNA_def_function(srna, "scale", "rna_Image_scale"); | func = RNA_def_function(srna, "scale", "rna_Image_scale"); | ||||
| RNA_def_function_ui_description(func, "Scale the buffer of the image, in pixels"); | RNA_def_function_ui_description(func, "Scale the buffer of the image, in pixels"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | ||||
| parm = RNA_def_int(func, "width", 1, 1, INT_MAX, "", "Width", 1, INT_MAX); | parm = RNA_def_int(func, "width", 1, 1, INT_MAX, "", "Width", 1, INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, "height", 1, 1, INT_MAX, "", "Height", 1, INT_MAX); | parm = RNA_def_int(func, "height", 1, 1, INT_MAX, "", "Height", 1, INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "gl_touch", "rna_Image_gl_touch"); | func = RNA_def_function(srna, "gl_touch", "rna_Image_gl_touch"); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, "Delay the image from being cleaned from the cache due inactivity"); | func, "Delay the image from being cleaned from the cache due inactivity"); | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||