[Bf-blender-cvs] [30a558bce58] greasepencil-object: When remove layer parent reset stroke position
Antonio Vazquez
noreply at git.blender.org
Thu Apr 13 19:41:11 CEST 2017
Commit: 30a558bce58749bd6b27e45c911538d1aac92b97
Author: Antonio Vazquez
Date: Thu Apr 13 19:40:27 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB30a558bce58749bd6b27e45c911538d1aac92b97
When remove layer parent reset stroke position
With new design when a layer parent is removed, the stroke revert to original position without parenting.
===================================================================
M source/blender/makesrna/intern/rna_gpencil.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 20fc9fa7b0b..c2d3cdc7d06 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -186,7 +186,6 @@ static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char *
/* set parent object and inverse matrix */
static void rna_GPencilLayer_parent_set(PointerRNA *ptr, PointerRNA value)
{
- bGPdata *gpd = (bGPdata *)ptr->id.data;
bGPDlayer *gpl = (bGPDlayer *)ptr->data;
Object *par = (Object *)value.data;
@@ -194,21 +193,6 @@ static void rna_GPencilLayer_parent_set(PointerRNA *ptr, PointerRNA value)
set_parent(gpl, par, gpl->partype, gpl->parsubstr);
}
else {
- /* keep strokes in the same place, so apply current transformation */
- if (gpl->parent != NULL) {
- bGPDspoint *pt;
- int i;
- float diff_mat[4][4];
- /* calculate difference matrix */
- ED_gpencil_parent_location(NULL, gpd, gpl, diff_mat);
- for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
- for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
- mul_m4_v3(diff_mat, &pt->x);
- }
- }
- }
- }
/* clear parent */
gpl->parent = NULL;
}
More information about the Bf-blender-cvs
mailing list