Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-09-29 17:42:33 +0300
committerAntonioya <blendergit@gmail.com>2018-09-29 17:54:16 +0300
commit631ddc5acc1369b66450ebf7ef1f1e894f5e4223 (patch)
tree9750a57b6176d676d6cb75a2ad7c9ab2a7826cda /source/blender/gpencil_modifiers
parent2ca67de9609e297ed608469fd6a0d3a9dd9cad2f (diff)
GP: New parameters for instance modifier: Material and On Top
Now it's possible to define what material is used in the generated strokes and if the strokes are put in front of the original (default) or keep the original in front. Before, the generated strokes have been always on top of the original because they were drawn later.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
index 3f4183e5b7a..8c125ebb1cd 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
@@ -180,6 +180,11 @@ static void generate_geometry(
mul_m4_v3(mat, &pt->x);
}
+ /* if replace material, use new one */
+ if ((mmd->mat_rpl > 0) && (mmd->mat_rpl <= ob->totcol)) {
+ gps_dst->mat_nr = mmd->mat_rpl - 1;
+ }
+
/* Add new stroke to cache, to be added to the frame once
* all duplicates have been made
*/
@@ -191,7 +196,12 @@ static void generate_geometry(
}
/* merge newly created stroke instances back into the main stroke list */
- BLI_movelisttolist(&gpf->strokes, &stroke_cache);
+ if (mmd->flag & GP_INSTANCE_KEEP_ONTOP) {
+ BLI_movelisttolist_reverse(&gpf->strokes, &stroke_cache);
+ }
+ else {
+ BLI_movelisttolist(&gpf->strokes, &stroke_cache);
+ }
/* free temp data */
MEM_SAFE_FREE(valid_strokes);