[Bf-blender-cvs] [77e79bea56b] greasepencil-object: Fix error in Join objects

Antonio Vazquez noreply at git.blender.org
Sun Apr 29 16:59:09 CEST 2018


Commit: 77e79bea56b3c4199a0e514127c39cc945c8c03a
Author: Antonio Vazquez
Date:   Sun Apr 29 16:59:02 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB77e79bea56b3c4199a0e514127c39cc945c8c03a

Fix error in Join objects

The index of the material must be stroke value + 1.

===================================================================

M	source/blender/editors/gpencil/gpencil_data.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 854690cc31d..d7fc6fedef0 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1912,7 +1912,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
 						for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
 
 							/* reasign material. Look old material and try to find in dst */
-							ma_src = give_current_material(ob_src, gps->mat_nr - 1);
+							ma_src = give_current_material(ob_src, gps->mat_nr + 1);
 							if (ma_src != NULL) {
 								idx = BKE_object_material_slot_find_index(ob_dst, ma_src);
 								if (idx > 0) {



More information about the Bf-blender-cvs mailing list