Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sculpt_paint.c
| Show First 20 Lines • Show All 495 Lines • ▼ Show 20 Lines | static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| Object *ob = OBACT(view_layer); | Object *ob = OBACT(view_layer); | ||||
| if (ob && ob->type == OB_MESH) { | if (ob && ob->type == OB_MESH) { | ||||
| ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); | ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); | ||||
| WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); | WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); | ||||
| } | } | ||||
| } | } | ||||
| static bool rna_ImaPaint_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_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Object *ob = OBACT(view_layer); | Object *ob = OBACT(view_layer); | ||||
| bScreen *screen; | bScreen *screen; | ||||
| Image *ima = scene->toolsettings->imapaint.canvas; | Image *ima = scene->toolsettings->imapaint.canvas; | ||||
| ▲ Show 20 Lines • Show All 516 Lines • ▼ Show 20 Lines | static void rna_def_image_paint(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer"); | RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); | ||||
| prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "stencil"); | RNA_def_property_pointer_sdna(prop, NULL, "stencil"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil"); | RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update"); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_stencil_update"); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll"); | |||||
| prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas"); | RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update"); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update"); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll"); | |||||
| 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"); | RNA_def_property_pointer_sdna(prop, NULL, "clone"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source"); | RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_ImaPaint_imagetype_poll"); | |||||
| prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA); | prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_float_sdna(prop, NULL, "stencil_col"); | RNA_def_property_float_sdna(prop, NULL, "stencil_col"); | ||||
| RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport"); | RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); | ||||
| prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "dither", PROP_FLOAT, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 465 Lines • Show Last 20 Lines | |||||