[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40575] branches/soc-2011-tomato/source/ blender/editors/gpencil/gpencil_paint.c: Camera tracking integration

Sergey Sharybin g.ulairi at gmail.com
Mon Sep 26 17:39:10 CEST 2011


Revision: 40575
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40575
Author:   nazgul
Date:     2011-09-26 15:39:10 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
Camera tracking integration
===========================

- Now different areas can use different default oclor for
  new layer creating when making initial stroke.
- Change default color for movie clip to pink.
  It's much useful now because black strokes aren't useful
  at all because it's difficult to notice them and you always
  used to change layer's color before doing manual calibraiton.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/gpencil/gpencil_paint.c

Modified: branches/soc-2011-tomato/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/gpencil/gpencil_paint.c	2011-09-26 15:29:24 UTC (rev 40574)
+++ branches/soc-2011-tomato/source/blender/editors/gpencil/gpencil_paint.c	2011-09-26 15:39:10 UTC (rev 40575)
@@ -104,7 +104,10 @@
 	short radius;		/* radius of influence for eraser */
 	short flags;		/* flags that can get set during runtime */
 
-	float imat[4][4];
+	float imat[4][4];	/* inverted transformation matrix applying when converting coords from screen-space
+						   to region space */
+
+	float custom_color[3];	/* custom color for  */
 } tGPsdata;
 
 /* values for tGPsdata->status */
@@ -1112,6 +1115,12 @@
 
 			invert_m4_m4(p->imat, sc->unistabmat);
 
+			/* custom color for new layer */
+			p->custom_color[0]= 1.0f;
+			p->custom_color[1]= 0.0f;
+			p->custom_color[2]= 0.5f;
+			p->custom_color[3]= 0.9f;
+
 			/* check that gpencil data is allowed to be drawn */
 			if ((sc->flag & SC_SHOW_GPENCIL)==0) {
 				p->status= GP_STATUS_ERROR;
@@ -1206,8 +1215,12 @@
 {	
 	/* get active layer (or add a new one if non-existent) */
 	p->gpl= gpencil_layer_getactive(p->gpd);
-	if (p->gpl == NULL)
+	if (p->gpl == NULL) {
 		p->gpl= gpencil_layer_addnew(p->gpd);
+
+		if(p->custom_color[3])
+			copy_v3_v3(p->gpl->color, p->custom_color);
+	}
 	if (p->gpl->flag & GP_LAYER_LOCKED) {
 		p->status= GP_STATUS_ERROR;
 		if (G.f & G_DEBUG)




More information about the Bf-blender-cvs mailing list