Improve current Grease Pencil in order to get a better 2D animation tool
More info in WIKI pages: https://wiki.blender.org/index.php/User:Antoniov
Differential D2115
Grease Pencil v2 Branch Authored by Antonio Vazquez (antoniov) on Jul 19 2016, 11:36 AM.
Details Improve current Grease Pencil in order to get a better 2D animation tool More info in WIKI pages: https://wiki.blender.org/index.php/User:Antoniov
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes Comment Actions I will upload a new diff with redesign of the close stroke operator using Severin idea of cyclic drawing. The new operator has 3 options: Close all, Open all, Toggle.
Comment Actions Aligorith, the alpha value for selection is not by sculpt brush. It is defined in GP_BrushEdit_Settings struct, just below GP_BRUSHEDIT_FLAG_SELECT_MASK flag field. This settings are defined in the ToolSetting in gp_sculpt field. Comment Actions Add comment
Comment Actions Add a comment
Comment Actions
Note: These commits are by Antonio and myself, don't want to take all the credit ;) Comment Actions Second round of (partially really rough) review. Some more notes:
Overall I think this is almost ready for merge (even though I'd prefer to have more time to go over all details ;) ).
Comment Actions Some more changes, my previous comment still applies.
Comment Actions The reason to create the join y mainly due fill. For example, if you draw a comic human face and the strokes are not continuous (for artistic reasons), if you don't join with invisible lines you cannot fill. The join speed up a lot the filling process. Join&Copy is used to create automatically a duplicate with the current active color. This is the same technique used by ToonBoom Animate/Harmony. Comment Actions About change color, this operator must change all layers, not only active. What you propose, change the name of the operator? Comment Actions Comment Added
Comment Actions Add Comment
Comment Actions
Comment Actions Add comment
Comment Actions Looking through a bit more of the code, I came across a few places where it's now iterating over the layers, then the strokes manually, so that we have access to the layer that a stroke belongs to, in order to apply parenting corrections. The problem is that this just makes maintenance worse, in that now you have to modify all the places where this happens (which happens to be most of the tools). There are two options to solve this:
I lean towards the first one, since the context stuff ends up being used by the Python API too, making it messy to define adhoc pairs of items. Meanwhile, the third one borders on being overkill and a bit heavy handed (not to mention needing a lot more helper functions to make everything work); at this stage, it might be too much trouble to recode everything to work this way, so I'm not keen on doing that here for now. So, I imagine the context iterator macros to look something like this: /**
* Iterate over all editable strokes in the current context,
* stopping on each usable layer + stroke pair (i.e. gpl and gps)
* to perform some operations on the stroke.
*
* \param gpl The identifier to use for the layer of the stroke being processed.
* Choose a suitable value to avoid name clashes.
* \param gps The identifier to use for current stroke being processed.
* Choose a suitable value to avoid name clashes.
*/
#define GP_EDITABLE_STROKES_BEGIN(C, gpl, gps) \
{ \
CTX_DATA_BEGIN(C, bGPDlayer*, gpl, editable_gpencil_layers) \
{ \
/* calculate difference matrix if parent object */
float diffmat[4][4]; \
ED_gpencil_parent_location(gpl, diff_mat); \
/* loop over strokes */
for (bGPDstroke *gps = gpl->actframe->strokes.first; gps; gps = gps->next) { \
/* skip strokes that are invalid for current view */
if (ED_gpencil_stroke_can_use(C, gps) == false) \
continue; \
/* check if the color is editable */
if (ED_gpencil_stroke_color_use(gpl, gps) == false) \
continue; \
/* ... Do Stuff With Strokes ... */
#define GP_EDITABLE_STROKES_END \
} \
} \
} (void)0
Comment Actions Let's address the two points here separately:
This is something I've never bothered to change (apart from a little "argh!" at some bits of the conventions too ;) So, was it intentional - 50/50 :) But yes, this is something to consider for later and not as part of this patch. Comment Actions The join operator does exactly this: Join the end of one stroke with the next one. I have implemented a flip routine to reverse stroke direction in order to join properly the strokes. The routine try to do the flip automatically if necessary, but the result is not perfect in all situations, so I implemented a visual hint to see start and end points and a flip operator. I think we could implement better joining/flipping algorithms in future versions. Comment Actions Some more code review. Sorry for all the noise with separate comments, but this editor seems to get laggy if I do too many of these in one go :/
Comment Actions My first idea about colors was to save the index of the color (faster and shorter) but after some test with artists, sometimes they have different number of color in each palette and the order of the colors could be different, so the index is not a solution. If we lock the palettes to have the same colors in the same order, then we could use the index. Comment Actions Add comment
Comment Actions
Comment Actions Add comment
Comment Actions
Comment Actions I still don't like it that the join OP messes up the 1 stroke == 1 continuous line concept, but I don't see a better way to do it offhand either. stroke_lock_color and palette_lock_layer both apply to all colors and to all strokes if I understand correctly. However they are placed within options that only apply to the currently active color. I'd either move them on top of the panel (even before the palette selector), or into the toolbar. Can be done after branch is merged. Another thing to think about before merging: What's up with documentation for release notes and manual?
Comment Actions
Comment Actions A few things to check on here and there still, but good enough to go in. Will commit in a bit. Comment Actions Committed to master :) Thanks for all the hard work @Antonio Vazquez (antoniov), keep up the great work! Comment Actions Alrighty, so here are some further steps:
Comment Actions About the operator, I think they are in the correct location. Both of them lock/hide colors in the palette, If we move to top, then the artist will not know what colors are affected. These operators are not related to layers, but palette colors. Maybe the problem is the name of the operators, but not the location in UI panel. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||