diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-08-29 10:47:08 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-08-29 10:47:08 +0300 |
commit | 613b6ad9e55fe904a90ba9166c8eb2fd654a8d85 (patch) | |
tree | 301f8621568f819adb5191cfb1f5cbda63ad4d94 /source/blender/blenkernel | |
parent | 377b81ac0733ff25dba54f9fce6e99f66073e761 (diff) |
GPencil: New conversion to outline in draw mode
This new option converts the stroke to outline perimeter as soon as is drawn.
If no alternative material is set, the actual material is used.
The algorithm is similar to the new operator in D15664
Reviewed By: pepeland
Differential Revision: https://developer.blender.org/D15738
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/brush.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.cc b/source/blender/blenkernel/intern/brush.cc index fc45ce0bbe7..34b87dda338 100644 --- a/source/blender/blenkernel/intern/brush.cc +++ b/source/blender/blenkernel/intern/brush.cc @@ -186,6 +186,7 @@ static void brush_foreach_id(ID *id, LibraryForeachIDData *data) BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, brush->paint_curve, IDWALK_CB_USER); if (brush->gpencil_settings) { BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, brush->gpencil_settings->material, IDWALK_CB_USER); + BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, brush->gpencil_settings->material_alt, IDWALK_CB_USER); } BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_texture_mtex_foreach_id(data, &brush->mtex)); BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, @@ -346,6 +347,7 @@ static void brush_blend_read_lib(BlendLibReader *reader, ID *id) else { brush->gpencil_settings->material = nullptr; } + BLO_read_id_address(reader, brush->id.lib, &brush->gpencil_settings->material_alt); } } @@ -358,6 +360,7 @@ static void brush_blend_read_expand(BlendExpander *expander, ID *id) BLO_expand(expander, brush->paint_curve); if (brush->gpencil_settings != nullptr) { BLO_expand(expander, brush->gpencil_settings->material); + BLO_expand(expander, brush->gpencil_settings->material_alt); } } @@ -704,6 +707,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type) /* Set vertex mix factor. */ brush->gpencil_settings->vertex_mode = GPPAINT_MODE_BOTH; brush->gpencil_settings->vertex_factor = 1.0f; + brush->gpencil_settings->material_alt = nullptr; switch (type) { case GP_BRUSH_PRESET_AIRBRUSH: { |