Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_image_api.c
| Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| func = RNA_def_function(srna, "save_render", "rna_Image_save_render"); | func = RNA_def_function(srna, "save_render", "rna_Image_save_render"); | ||||
| RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); | RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| parm = RNA_def_string_file_path(func, "filepath", NULL, 0, "", "Save path"); | parm = RNA_def_string_file_path(func, "filepath", NULL, 0, "", "Save path"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); | RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); | ||||
| func = RNA_def_function(srna, "save", "rna_Image_save"); | func = RNA_def_function(srna, "save", "rna_Image_save"); | ||||
| RNA_def_function_ui_description(func, "Save image to its source path"); | RNA_def_function_ui_description(func, "Save image to its source path"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| func = RNA_def_function(srna, "pack", "rna_Image_pack"); | func = RNA_def_function(srna, "pack", "rna_Image_pack"); | ||||
| RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file"); | RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file"); | ||||
| Show All 15 Lines | void RNA_api_image(StructRNA *srna) | ||||
| 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 image in pixels"); | RNA_def_function_ui_description(func, "Scale the image in pixels"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_int(func, "width", 1, 1, 10000, "", "Width", 1, 10000); | parm = RNA_def_int(func, "width", 1, 1, 10000, "", "Width", 1, 10000); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, "height", 1, 1, 10000, "", "Height", 1, 10000); | parm = RNA_def_int(func, "height", 1, 1, 10000, "", "Height", 1, 10000); | ||||
| RNA_def_property_flag(parm, PROP_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(func, "Delay the image from being cleaned from the cache due inactivity"); | RNA_def_function_ui_description(func, "Delay the image from being cleaned from the cache due inactivity"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_int(func, "frame", 0, 0, INT_MAX, "Frame", | RNA_def_int(func, "frame", 0, 0, INT_MAX, "Frame", | ||||
| "Frame of image sequence or movie", 0, INT_MAX); | "Frame of image sequence or movie", 0, INT_MAX); | ||||
| RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", | RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", | ||||
| "The texture minifying function to use if the image wasn't loaded", -INT_MAX, INT_MAX); | "The texture minifying function to use if the image wasn't loaded", -INT_MAX, INT_MAX); | ||||
| RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", | RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", | ||||
| "The texture magnification function to use if the image wasn't loaded", -INT_MAX, INT_MAX); | "The texture magnification function to use if the image wasn't loaded", -INT_MAX, INT_MAX); | ||||
| /* return value */ | /* return value */ | ||||
| parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); | parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "gl_load", "rna_Image_gl_load"); | func = RNA_def_function(srna, "gl_load", "rna_Image_gl_load"); | ||||
| RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory"); | RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_int(func, "frame", 0, 0, INT_MAX, "Frame", | RNA_def_int(func, "frame", 0, 0, INT_MAX, "Frame", | ||||
| "Frame of image sequence or movie", 0, INT_MAX); | "Frame of image sequence or movie", 0, INT_MAX); | ||||
| RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", | RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", | ||||
| "The texture minifying function", -INT_MAX, INT_MAX); | "The texture minifying function", -INT_MAX, INT_MAX); | ||||
| RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", | RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", | ||||
| "The texture magnification function", -INT_MAX, INT_MAX); | "The texture magnification function", -INT_MAX, INT_MAX); | ||||
| /* return value */ | /* return value */ | ||||
| parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); | parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "gl_free", "rna_Image_gl_free"); | func = RNA_def_function(srna, "gl_free", "rna_Image_gl_free"); | ||||
| RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory"); | RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory"); | ||||
| /* path to an frame specified by image user */ | /* path to an frame specified by image user */ | ||||
| func = RNA_def_function(srna, "filepath_from_user", "rna_Image_filepath_from_user"); | func = RNA_def_function(srna, "filepath_from_user", "rna_Image_filepath_from_user"); | ||||
| RNA_def_function_ui_description(func, "Return the absolute path to the filepath of an image frame specified by the image user"); | RNA_def_function_ui_description(func, "Return the absolute path to the filepath of an image frame specified by the image user"); | ||||
| RNA_def_pointer(func, "image_user", "ImageUser", "", "Image user of the image to get filepath for"); | RNA_def_pointer(func, "image_user", "ImageUser", "", "Image user of the image to get filepath for"); | ||||
| parm = RNA_def_string_file_path(func, "filepath", NULL, FILE_MAX, "File Path", | parm = RNA_def_string_file_path(func, "filepath", NULL, FILE_MAX, "File Path", | ||||
| "The resulting filepath from the image and it's user"); | "The resulting filepath from the image and it's user"); | ||||
| RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */ | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| func = RNA_def_function(srna, "buffers_free", "rna_Image_buffers_free"); | func = RNA_def_function(srna, "buffers_free", "rna_Image_buffers_free"); | ||||
| RNA_def_function_ui_description(func, "Free the image buffers from memory"); | RNA_def_function_ui_description(func, "Free the image buffers from memory"); | ||||
| /* TODO, pack/unpack, maybe should be generic functions? */ | /* TODO, pack/unpack, maybe should be generic functions? */ | ||||
| } | } | ||||
| #endif | #endif | ||||