Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sculpt_paint.c
| Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | else if (paint_contains_brush_slot(&ts->gp_sculptpaint->paint, tslot, &slot_index)) { | ||||
| mode = OB_MODE_SCULPT_GPENCIL; | mode = OB_MODE_SCULPT_GPENCIL; | ||||
| } | } | ||||
| else if (paint_contains_brush_slot(&ts->gp_weightpaint->paint, tslot, &slot_index)) { | else if (paint_contains_brush_slot(&ts->gp_weightpaint->paint, tslot, &slot_index)) { | ||||
| if (slot_index != brush->gpencil_weight_tool) { | if (slot_index != brush->gpencil_weight_tool) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| mode = OB_MODE_WEIGHT_GPENCIL; | mode = OB_MODE_WEIGHT_GPENCIL; | ||||
| } | } | ||||
| else if (paint_contains_brush_slot(&ts->hm_sculpt->paint, tslot, &slot_index)) { | |||||
| if (slot_index != brush->heightmap_sculpt_tool) { | |||||
| return false; | |||||
| } | |||||
| mode = OB_MODE_SCULPT_HEIGHTMAP; | |||||
| } | |||||
| return brush->ob_mode & mode; | return brush->ob_mode & mode; | ||||
| } | } | ||||
| static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| 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); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static char *rna_GpSculptPaint_path(PointerRNA *UNUSED(ptr)) | ||||
| return BLI_strdup("tool_settings.gpencil_sculpt_paint"); | return BLI_strdup("tool_settings.gpencil_sculpt_paint"); | ||||
| } | } | ||||
| static char *rna_GpWeightPaint_path(PointerRNA *UNUSED(ptr)) | static char *rna_GpWeightPaint_path(PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| return BLI_strdup("tool_settings.gpencil_weight_paint"); | return BLI_strdup("tool_settings.gpencil_weight_paint"); | ||||
| } | } | ||||
| static char *rna_HmSculptPaint_path(PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| return BLI_strdup("tool_settings.heightmap_sculpt_paint"); | |||||
| } | |||||
| static char *rna_ParticleBrush_path(PointerRNA *UNUSED(ptr)) | static char *rna_ParticleBrush_path(PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| return BLI_strdup("tool_settings.particle_edit.brush"); | return BLI_strdup("tool_settings.particle_edit.brush"); | ||||
| } | } | ||||
| static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Paint_brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| Paint *paint = ptr->data; | Paint *paint = ptr->data; | ||||
| ▲ Show 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| srna = RNA_def_struct(brna, "GpWeightPaint", "Paint"); | srna = RNA_def_struct(brna, "GpWeightPaint", "Paint"); | ||||
| RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path"); | RNA_def_struct_path_func(srna, "rna_GpWeightPaint_path"); | ||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", ""); | RNA_def_struct_ui_text(srna, "Grease Pencil Weight Paint", ""); | ||||
| } | } | ||||
| static void rna_def_hm_sculptpaint(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| srna = RNA_def_struct(brna, "HmSculptPaint", "Paint"); | |||||
| RNA_def_struct_path_func(srna, "rna_HmSculptPaint_path"); | |||||
| RNA_def_struct_ui_text(srna, "HeightMap Sculpt Paint", ""); | |||||
| } | |||||
| /* use for weight paint too */ | /* use for weight paint too */ | ||||
| static void rna_def_vertex_paint(BlenderRNA *brna) | static void rna_def_vertex_paint(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "VertexPaint", "Paint"); | srna = RNA_def_struct(brna, "VertexPaint", "Paint"); | ||||
| RNA_def_struct_sdna(srna, "VPaint"); | RNA_def_struct_sdna(srna, "VPaint"); | ||||
| ▲ Show 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | void RNA_def_sculpt_paint(BlenderRNA *brna) | ||||
| rna_def_paint_tool_slot(brna); | rna_def_paint_tool_slot(brna); | ||||
| rna_def_paint(brna); | rna_def_paint(brna); | ||||
| rna_def_sculpt(brna); | rna_def_sculpt(brna); | ||||
| rna_def_uv_sculpt(brna); | rna_def_uv_sculpt(brna); | ||||
| rna_def_gp_paint(brna); | rna_def_gp_paint(brna); | ||||
| rna_def_gp_vertexpaint(brna); | rna_def_gp_vertexpaint(brna); | ||||
| rna_def_gp_sculptpaint(brna); | rna_def_gp_sculptpaint(brna); | ||||
| rna_def_gp_weightpaint(brna); | rna_def_gp_weightpaint(brna); | ||||
| rna_def_hm_sculptpaint(brna); | |||||
| rna_def_vertex_paint(brna); | rna_def_vertex_paint(brna); | ||||
| rna_def_image_paint(brna); | rna_def_image_paint(brna); | ||||
| rna_def_particle_edit(brna); | rna_def_particle_edit(brna); | ||||
| rna_def_gpencil_guides(brna); | rna_def_gpencil_guides(brna); | ||||
| rna_def_gpencil_sculpt(brna); | rna_def_gpencil_sculpt(brna); | ||||
| RNA_define_animate_sdna(true); | RNA_define_animate_sdna(true); | ||||
| } | } | ||||
| #endif | #endif | ||||