Fix T47760: Toggling GPencil's "Selection Mask" via Python does not update UI
Add rna updates to greasepencil sculpt properties D1849 by @lichtwerk, reviewed by @aligorith
This commit is contained in:
parent
570fbba3f3
commit
8d91864242
Notes:
blender-bot
2023-09-08 04:55:43 +02:00
Referenced by issue #47760, Toggling GPencil's "Selection Mask" via Python does not update UI
|
@ -1003,6 +1003,7 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
|
|||
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
|
||||
RNA_def_property_enum_items(prop, rna_enum_gpencil_sculpt_brush_items);
|
||||
RNA_def_property_ui_text(prop, "Tool", "");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "GPencilSculptBrush");
|
||||
|
@ -1013,7 +1014,7 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
|
|||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_SELECT_MASK);
|
||||
RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
|
||||
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); // FIXME: this needs a custom icon
|
||||
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
/* brush */
|
||||
srna = RNA_def_struct(brna, "GPencilSculptBrush", NULL);
|
||||
|
@ -1025,28 +1026,34 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
|
|||
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS);
|
||||
RNA_def_property_ui_range(prop, 1, 100, 10, 3); // XXX: too big
|
||||
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_range(prop, 0.001, 1.0);
|
||||
RNA_def_property_ui_text(prop, "Strength", "Brush strength");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_PRESSURE);
|
||||
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
|
||||
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_FALLOFF);
|
||||
RNA_def_property_ui_text(prop, "Use Falloff", "Strength of brush decays with distance from cursor");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "affect_pressure", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE);
|
||||
RNA_def_property_ui_text(prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
|
||||
RNA_def_property_enum_items(prop, prop_direction_items);
|
||||
RNA_def_property_ui_text(prop, "Direction", "");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
}
|
||||
|
||||
void RNA_def_sculpt_paint(BlenderRNA *brna)
|
||||
|
|
Loading…
Reference in New Issue