Page MenuHome

GPencil MultiStroke modifier
ClosedPublic

Authored by YimingWu (NicksBest) on Sep 14 2019, 10:28 AM.

Details

Summary

This patch includes a modifiers that developed for NPR rendering.

  • MultiStroke modifier that generates multiple strokes around the original ones.

Diff Detail

Repository
rB Blender

Event Timeline

As this is base on master, we can test this change only. Of course, this would be in 2.82.

@YimingWu (NicksBest) Do we need to have LANPR patch or only master? Also, it would be good remove this code from greasepencil-object branch to avoid merge conflicts in the future.

No, this is stand-alone and don't need LANPR patch to run. I'll remove this from gp-object branch later.

Fixed stroke shrinking function for correct length handling. Now Length modifier in both relative and absolute mode works correctly, and they handles 0 length situations correctly.

Added layer/material selector for UI/functionality consistency with other GPencil modifiers. Works after simple test.

source/blender/blenkernel/intern/gpencil.c
1774

Always is better to keep float initialization using the "f" prefix (0.0f)

1778

Same here for float constant prefix.

1816

Can you use const?

1874

Can you use const?

1905

Comment Style. Don't use /* for each line, only /* */ for all lines and secondary lines start with *

1931

Can you use a = b = c = 0.0f format?

2510

Style 0.0f

source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
93 ↗(On Diff #18243)

Maybe here is 2.0f

180 ↗(On Diff #18243)

getDuplicationFactor Has been removed. Delete this line.

source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c
73

0.5f

350

Remove

source/blender/makesdna/DNA_gpencil_modifier_types.h
683

Put all comments above variable

YimingWu (NicksBest) marked 12 inline comments as done.

Code style fixes.

source/blender/blenkernel/intern/gpencil.c
1432

IIRC I removed this if checking in master, so we don't need it.

source/blender/blenlib/BLI_map.h
625 ↗(On Diff #18914)

This changes look a problem with ARC. You don't need include BLI_map.h in your patch

source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
76 ↗(On Diff #18914)

More f missing.

YimingWu (NicksBest) marked 3 inline comments as done.

Fixed code styles and discarded BLI_map.h changes.

source/blender/blenkernel/intern/gpencil.c
1431

You have removed too much. Keep this line:

DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);

Reverted the DEG_id_tag_update() line.

Changes made in this diff:

  • In sync with master.
  • Fix the uninitialized color when add_stroke() in the modifier.
  • Other fixes.

Changes:

  • "MultiStroke" -> "Multiple Strokes" naming change.
  • Length modifier now has another tip length value to avoid end-point jittering.
  • For Multiple Strokes modifier: When duplications==0 then disable, don't use the checkbox for it.

Here's a demonstration of the combined use of angle split and length modifier:

This comment was removed by YimingWu (NicksBest).

Uploaded a wrong diff. Fixed.

Fix problems in the previous ARC patch (LANPR changes were included by error)

This revision is now accepted and ready to land.Nov 14 2019, 2:50 PM
This revision now requires review to proceed.Nov 14 2019, 2:55 PM
  • GPencil: Change UI for Multiply modifier
  • GPencil: Change default values for Multiply modifier
  • Remove Length modifier
Antonio Vazquez (antoniov) retitled this revision from GPencil Length and MultiStroke modifier to GPencil MultiStroke modifier.Nov 14 2019, 7:16 PM
Antonio Vazquez (antoniov) edited the summary of this revision. (Show Details)

As the length modifier needs more work, I hace changed the patch to have only the Multistroke modifier.

After all changes and tweaks in the UI the new Multi Strokes modifier it's Ok for me

This revision is now accepted and ready to land.Nov 14 2019, 7:35 PM
This revision was automatically updated to reflect the committed changes.