Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_image.c
| Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | switch (GS(ptr->owner_id->name)) { | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| return BLI_strdup(""); | return BLI_strdup(""); | ||||
| } | } | ||||
| static void rna_Image_gpu_texture_update(Main *bmain, Scene *scene, PointerRNA *ptr) | |||||
| { | |||||
| Image *ima = (Image *)ptr->owner_id; | |||||
| if (!G.background) { | |||||
| GPU_free_image(ima); | |||||
| } | |||||
| WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id); | |||||
| } | |||||
| static const EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), | static const EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| bool *r_free) | bool *r_free) | ||||
| { | { | ||||
| Image *ima = (Image *)ptr->data; | Image *ima = (Image *)ptr->data; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int totitem = 0; | int totitem = 0; | ||||
| ▲ Show 20 Lines • Show All 910 Lines • ▼ Show 20 Lines | static void rna_def_image(BlenderRNA *brna) | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | ||||
| RNA_def_property_enum_items(prop, alpha_mode_items); | RNA_def_property_enum_items(prop, alpha_mode_items); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, | ||||
| "Alpha Mode", | "Alpha Mode", | ||||
| "Representation of alpha in the image file, to convert to and from " | "Representation of alpha in the image file, to convert to and from " | ||||
| "when saving and loading the image"); | "when saving and loading the image"); | ||||
| RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update"); | RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update"); | ||||
| prop = RNA_def_property(srna, "use_half_precision", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMA_HIGH_BITDEPTH); | |||||
| RNA_def_property_ui_text(prop, | |||||
| "Half Float Precision", | |||||
| "Use 16bits per channel to lower the memory usage during rendering"); | |||||
| RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_gpu_texture_update"); | |||||
| /* multiview */ | /* multiview */ | ||||
| prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "views_format"); | RNA_def_property_enum_sdna(prop, NULL, "views_format"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_views_format_items); | RNA_def_property_enum_items(prop, rna_enum_views_format_items); | ||||
| RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views"); | RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views"); | ||||
| RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_views_format_update"); | RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_views_format_update"); | ||||
| Show All 19 Lines | |||||