Page MenuHome

GPencil Length and MultiStroke modifier
Needs ReviewPublic

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

Details

Summary

This patch includes two modifiers that developed for NPR rendering.

  • Length modifier that stretch/shrink a stroke.
  • MultiStroke modifier that generates multiple strokes around the original ones.

Diff Detail

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
94

Maybe here is 2.0f

181

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
77

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.