Page MenuHome

Split Grease Pencil modifier stack
AbandonedPublic

Authored by Antonio Vazquez (antoniov) on Jun 19 2018, 11:54 AM.

Details

Summary

Separate all logic of grease pencil modifiers and remove any reference to grease pencil in the mesh modifiers.

Thanks to Dalai Felinto for his help splitting the code and helping to fix compiler issues.

Diff Detail

Repository
rB Blender
Branch
temp-greasepencil-object-stacksplit
Build Status
Buildable 1771
Build 1771: arc lint + arc unit

Event Timeline

Dalai, could you review the patch before integrating in greasepencil-object branch?

Joshua Leung (aligorith) requested changes to this revision.Jun 20 2018, 5:20 AM
Joshua Leung (aligorith) added inline comments.
source/blender/blenkernel/BKE_gpencil.h
117–118

Since we have a BKE GP Modifiers header now, these macros should go there too

161–162

These defines (and a few others that are specifically for GP modifiers) should go into the BKE GP modifiers header

161–162

-> BKE_gpencil_modifiers.h

163

These ones should stay here. They're not really modifier specific, but rather, can be used for general GP stuff too.

source/blender/blenkernel/BKE_gpencil_modifier.h
23

Header guards need updating. Suggest __BKE_GPENCIL_MODIFIER_H__

53

What's the point of this enum with just two entries? Seems redundant?

EDIT: Checking the original enum this mirrors, it was used for indicating whether a modifier was a "Deformation" or a "Geometry" modifier. Perhaps we could be doing something similar here for "Stroke" vs "Geometry" modifiers, instead of checking the callbacks.

62

Mesh/CV flags seem redundant here. GP Modifiers only operate on GP objects so won't need these

84

Redundant. All of them here are GP modifiers, so all will have this enabled

203

Probably not needed?

source/blender/editors/include/ED_object.h
280

Why is this define repeated (see above, line 252)?

source/blender/editors/object/object_gpencil_modifier.c
19

;)

source/blender/makesrna/intern/rna_object.c
2280

IMO, this is not great from a UX standpoint (e.g. drivers, bpy, etc.), but it will probably have to do.

Ideally, we could have the "object.modifiers" property redirect to the correct underlying listbase/types based on "ob.type", but, that also complicates code here.

This revision now requires changes to proceed.Jun 20 2018, 5:20 AM
source/blender/editors/space_outliner/outliner_draw.c
850–1052

I'd probably have put the GP cases first (since GP ones are the exception here), but either way it's fine.

source/blender/makesdna/DNA_gpencil_modifier_types.h
384

Shouldn't be needed? (Unless we have a mesh sequence modifier on the GP object I didn't know about)

It think Joshua's comments are valid, but also we can leave some nitpicking to be done in the original branch (greasepencil-object), not necessarily on this patch.

  1. I find strange that some modifiers work in edit mode but not all of them.

For example, Instance doesn't, but Hue/Saturation/Value does.

  1. Shouldn't the Tint modifier have factor 1.0 as default?

Update the requests made by aligorith.

Disable the edit buttons for modifiers not supportted

Set Tint factor default value to 0.5 and default color to white.

Sergey Sharybin (sergey) requested changes to this revision.Jun 20 2018, 9:49 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/blenkernel/BKE_gpencil_modifier.h
98–104

Blender style says to use snake_style for variables. Stick to official style in the new code.

195–202

This is to be replaced with forachIDLink. We should get rid of foreachObjectLink in mesh modifiers as well.

source/blender/makesdna/DNA_gpencil_modifier_types.h
75–76

Kill this with fire. Must not be added.

This revision now requires changes to proceed.Jun 20 2018, 9:49 AM

Rename some fields and remove comments

foreachObjectLink will be replaced after merge

  • Remove scene from GpencilModifierData struct