Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 728 Lines • ▼ Show 20 Lines | static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| if (br->flag & BRUSH_CUSTOM_ICON) { | if (br->flag & BRUSH_CUSTOM_ICON) { | ||||
| BKE_icon_changed(BKE_icon_id_ensure(&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 bool rna_Brush_imagetype_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | |||||
| { | |||||
| Image *image = (Image *)value.owner_id; | |||||
| return image->type != IMA_TYPE_R_RESULT && image->type != IMA_TYPE_COMPOSITE; | |||||
| } | |||||
| static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr) | static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| MTex *mtex = ptr->data; | MTex *mtex = ptr->data; | ||||
| /* skip invalidation of overlay for stencil mode */ | /* skip invalidation of overlay for stencil mode */ | ||||
| if (mtex->mapping != MTEX_MAP_MODE_STENCIL) { | if (mtex->mapping != MTEX_MAP_MODE_STENCIL) { | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex); | BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex); | ||||
| ▲ Show 20 Lines • Show All 2,684 Lines • ▼ Show 20 Lines | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); | RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); | ||||
| /* clone tool */ | /* clone tool */ | ||||
| prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "clone.image"); | RNA_def_property_pointer_sdna(prop, NULL, "clone.image"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool"); | RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update"); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_imagetype_poll"); | |||||
| prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); | RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display"); | RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ); | prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ); | ||||
| ▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines | |||||