[Bf-blender-cvs] [b6011099609] greasepencil-object: Merge branch 'master' into greasepencil-object
Antonio Vazquez
noreply at git.blender.org
Sat Aug 17 19:01:15 CEST 2019
Commit: b60110996096e32c6e960407034765ef287c111f
Author: Antonio Vazquez
Date: Sat Aug 17 16:31:36 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBb60110996096e32c6e960407034765ef287c111f
Merge branch 'master' into greasepencil-object
Conflicts:
source/blender/editors/gpencil/gpencil_brush.c
source/blender/editors/gpencil/gpencil_intern.h
===================================================================
===================================================================
diff --cc source/blender/editors/gpencil/gpencil_intern.h
index 94e8ee28881,715665fe6e9..55b1b1e449d
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@@ -637,60 -635,10 +637,64 @@@ struct GP_EditableStrokes_Iter
} \
(void)0
+ #define GPENCIL_ANY_SCULPT_MASK(flag) \
+ ((flag & (GP_SCULPT_MASK_SELECTMODE_POINT | GP_SCULPT_MASK_SELECTMODE_STROKE | \
+ GP_SCULPT_MASK_SELECTMODE_SEGMENT)))
+
+/**
+ * Iterate over all editable strokes using derived data 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_DERIVED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
+ { \
+ struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
+ Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
+ Object *obact_ = CTX_data_active_object(C); \
+ Object *obeval_ = DEG_get_evaluated_object(depsgraph_, obact_); \
+ bGPdata *gpd_ = CTX_data_gpencil_data(C); \
+ const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
+ int derived_idx = 0; \
+ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { \
+ if (gpencil_layer_is_editable(gpl)) { \
+ bGPDframe *init_gpf_ = gpl->actframe; \
+ if (is_multiedit_) { \
+ init_gpf_ = gpl->frames.first; \
+ } \
+ for (bGPDframe *gpf_ = init_gpf_; gpf_; gpf_ = gpf_->next) { \
+ if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && is_multiedit_)) { \
+ ED_gpencil_parent_location(depsgraph_, obact_, gpd_, gpl, gpstroke_iter.diff_mat); \
+ invert_m4_m4(gpstroke_iter.inverse_diff_mat, gpstroke_iter.diff_mat); \
+ /* get derived frame with modifiers applied */ \
+ bGPDframe *derived_gpf_ = &obeval_->runtime.derived_frames[derived_idx]; \
+ /* loop over strokes */ \
+ for (bGPDstroke *gps = derived_gpf_->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(obact_, gpl, gps) == false) \
+ continue; \
+ /* ... Do Stuff With Strokes ... */
+
+#define GP_DERIVED_STROKES_END(gpstroke_iter) \
+ } \
+ } \
+ if (!is_multiedit_) { \
+ break; \
+ } \
+ } \
+ } \
+ derived_idx++; \
+ } \
+ } \
+ (void)0
+
/* ****************************************************** */
#endif /* __GPENCIL_INTERN_H__ */
diff --cc source/blender/editors/gpencil/gpencil_select.c
index 01a2ac757d6,4c185b7fb8a..7908d2d081c
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@@ -1082,18 -1096,13 +1109,17 @@@ static int gpencil_generic_select_exec(
int i;
bool hit = false;
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
+ if (pt->runtime.pt_orig == NULL) {
+ continue;
+ }
+
/* convert point coords to screenspace */
const bool is_inside = is_inside_fn(gps, pt, &gsc, gpstroke_iter.diff_mat, user_data);
-
if (strokemode == false) {
- const bool is_select = (pt->flag & GP_SPOINT_SELECT) != 0;
+ const bool is_select = (pt->runtime.pt_orig->flag & GP_SPOINT_SELECT) != 0;
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
if (sel_op_result != -1) {
- SET_FLAG_FROM_TEST(pt->flag, sel_op_result, GP_SPOINT_SELECT);
+ SET_FLAG_FROM_TEST(pt->runtime.pt_orig->flag, sel_op_result, GP_SPOINT_SELECT);
changed = true;
/* expand selection to segment */
More information about the Bf-blender-cvs
mailing list