[Bf-blender-cvs] [95011f6d484] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Mon Jun 4 09:48:26 CEST 2018


Commit: 95011f6d484b369db92ae13c674a6522d664ea8f
Author: Campbell Barton
Date:   Mon Jun 4 09:39:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB95011f6d484b369db92ae13c674a6522d664ea8f

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/editors/animation/anim_channels_defines.c
index d48798ece97,304d548b01b..5d5d8f10a88
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@@ -119,13 -116,14 +119,13 @@@ static void acf_generic_root_backdrop(b
  	short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
  	short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
  	float color[3];
- 	
+ 
  	/* set backdrop drawing color */
  	acf->get_backdrop_color(ac, ale, color);
- 	
 -	glColor3fv(color);
+ 
  	/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
  	UI_draw_roundbox_corner_set((expanded) ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
 -	UI_draw_roundbox_gl_mode(GL_POLYGON, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
 +	UI_draw_roundbox_3fvAlpha(true, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f);
  }
  
  
@@@ -233,18 -225,12 +233,18 @@@ static void acf_generic_channel_backdro
  	short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
  	float color[3];
  
 +	unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- 	
++
  	/* set backdrop drawing color */
  	acf->get_backdrop_color(ac, ale, color);
 -	glColor3fv(color);
 +
 +	immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 +	immUniformColor3fv(color);
- 	
+ 
  	/* no rounded corners - just rectangular box */
 -	glRectf(offset, yminc,  v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
 +	immRectf(pos, offset, yminc,  v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
 +
 +	immUnbindProgram();
  }
  
  /* Indention + Offset ------------------------------------------- */
@@@ -432,16 -418,17 +432,16 @@@ static void acf_summary_backdrop(bAnimC
  	const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
  	View2D *v2d = &ac->ar->v2d;
  	float color[3];
- 	
+ 
  	/* set backdrop drawing color */
  	acf->get_backdrop_color(ac, ale, color);
- 	
- 	/* rounded corners on LHS only 
- 	 *	- top and bottom 
- 	 *	- special hack: make the top a bit higher, since we are first... 
 -	glColor3fv(color);
+ 
+ 	/* rounded corners on LHS only
+ 	 *	- top and bottom
+ 	 *	- special hack: make the top a bit higher, since we are first...
  	 */
  	UI_draw_roundbox_corner_set(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
 -	UI_draw_roundbox_gl_mode(GL_POLYGON, 0,  yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
 +	UI_draw_roundbox_3fvAlpha(true, 0,  yminc - 2, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f);
  }
  
  /* name for summary entries */
@@@ -649,15 -636,13 +649,15 @@@ static int acf_object_icon(bAnimListEle
  			return ICON_OUTLINER_OB_LATTICE;
  		case OB_SPEAKER:
  			return ICON_OUTLINER_OB_SPEAKER;
 +		case OB_LIGHTPROBE:
 +			return ICON_OUTLINER_OB_LIGHTPROBE;
  		case OB_ARMATURE:
  			return ICON_OUTLINER_OB_ARMATURE;
- 		case OB_FONT: 
+ 		case OB_FONT:
  			return ICON_OUTLINER_OB_FONT;
- 		case OB_SURF: 
+ 		case OB_SURF:
  			return ICON_OUTLINER_OB_SURFACE;
- 		case OB_EMPTY: 
+ 		case OB_EMPTY:
  			return ICON_OUTLINER_OB_EMPTY;
  		default:
  			return ICON_OBJECT_DATA;
@@@ -826,13 -811,14 +826,13 @@@ static void acf_group_backdrop(bAnimCon
  	short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
  	short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
  	float color[3];
- 	
+ 
  	/* set backdrop drawing color */
  	acf->get_backdrop_color(ac, ale, color);
- 	
 -	glColor3fv(color);
+ 
  	/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
  	UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
 -	UI_draw_roundbox_gl_mode(GL_POLYGON, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8);
 +	UI_draw_roundbox_3fvAlpha(true, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 8, color, 1.0f);
  }
  
  /* name for group entries */
@@@ -1082,13 -1068,14 +1082,13 @@@ static void acf_nla_controls_backdrop(b
  	short expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
  	short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
  	float color[3];
- 	
+ 
  	/* set backdrop drawing color */
  	acf->get_backdrop_color(ac, ale, color);
- 	
- 	/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */	
 -	glColor3fv(color);
+ 
+ 	/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
  	UI_draw_roundbox_corner_set(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
 -	UI_draw_roundbox_gl_mode(GL_POLYGON, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 5);
 +	UI_draw_roundbox_3fvAlpha(true, offset,  yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc, 5, color, 1.0f);
  }
  
  /* name for nla controls expander entries */
@@@ -2028,14 -2015,14 +2028,14 @@@ static int acf_dspart_setting_flag(bAni
  {
  	/* clear extra return data first */
  	*neg = false;
- 	
+ 
  	switch (setting) {
  		case ACHANNEL_SETTING_EXPAND: /* expanded */
 -			return PART_DS_EXPAND;
 +			return 0;
- 			
+ 
  		case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
  			return ADT_NLA_EVAL_OFF;
- 			
+ 
  		case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
  			*neg = true;
  			return ADT_CURVES_NOT_VISIBLE;
@@@ -2049,20 -2036,24 +2049,20 @@@
  }
  
  /* get pointer to the setting */
 -static void *acf_dspart_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 +static void *acf_dspart_setting_ptr(bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting, short *type)
  {
 -	ParticleSettings *part = (ParticleSettings *)ale->data;
 -
  	/* clear extra return data first */
  	*type = 0;
- 	
+ 
  	switch (setting) {
  		case ACHANNEL_SETTING_EXPAND: /* expanded */
 -			return GET_ACF_FLAG_PTR(part->flag, type);
 +			return NULL;
- 			
+ 
  		case ACHANNEL_SETTING_SELECT: /* selected */
  		case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
  		case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
 -			if (part->adt)
 -				return GET_ACF_FLAG_PTR(part->adt->flag, type);
  			return NULL;
- 		
+ 
  		default: /* unsupported */
  			return NULL;
  	}
@@@ -3428,11 -3419,15 +3428,11 @@@ static void acf_nlaaction_backdrop(bAni
  	 *   so we ignore that and use our own when needed
  	 */
  	nla_action_get_color(adt, (bAction *)ale->data, color);
- 	
+ 
 -	if (adt && (adt->flag & ADT_NLA_EDIT_ON)) {
 -		/* Yes, the color vector has 4 components, BUT we only want to be using 3 of them! */
 -		glColor3fv(color);
 -	}
 -	else {
 -		float alpha = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f;
 -		glColor4f(color[0], color[1], color[2], alpha);
 -	}
 +	if (adt && (adt->flag & ADT_NLA_EDIT_ON))
 +		color[3] = 1.0f;
 +	else
 +		color[3] = (adt && (adt->flag & ADT_NLA_SOLO_TRACK)) ? 0.3f : 1.0f;
  
  	/* only on top left corner, to show that this channel sits on top of the preceding ones
  	 * while still linking into the action line strip to the right
@@@ -3829,11 -3824,11 +3829,11 @@@ void ANIM_channel_draw(bAnimContext *ac
  		selected = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
  	else
  		selected = 0;
- 		
+ 
  	/* set blending again, as may not be set in previous step */
 -	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 +	glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
  	glEnable(GL_BLEND);
- 	
+ 
  	/* step 1) draw backdrop ...........................................  */
  	if (acf->draw_backdrop)
  		acf->draw_backdrop(ac, ale, yminc, ymaxc);
@@@ -3866,20 -3861,15 +3866,20 @@@
  			/* for F-Curves, draw color-preview of curve behind checkbox */
  			if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
  				FCurve *fcu = (FCurve *)ale->data;
 +				unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 +
 +				immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- 				
- 				/* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever 
- 				 * color the curve has stored 
+ 
+ 				/* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever
+ 				 * color the curve has stored
  				 */
 -				glColor3fv(fcu->color);
 +				immUniformColor3fv(fcu->color);
- 				
+ 
  				/* just a solid color rect
  				 */
 -				glRectf(offset, yminc, offset + ICON_WIDTH, ymaxc);
 +				immRectf(pos, offset, yminc, offset + ICON_WIDTH, ymaxc);
 +
 +				immUnbindProgram();
  			}
  			/* icon is drawn as widget now... */
  			if (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
@@@ -3916,27 -3904,17 +3916,27 @@@
  
  		/* get name */
  		acf->name(ale, name);
- 		
+ 
  		offset += 3;
 -		UI_fontstyle_draw_simple(fstyle, offset, ytext, name);
 +		UI_fontstyle_draw_simple(fstyle, offset, ytext, name, col);
- 		
+ 
  		/* draw red underline if channel is disabled */
  		if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) {
 +			unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 +
 +			immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 +
  			/* FIXME: replace hardcoded color here, and check on extents! */
 -			glColor3f(1.0f, 0.0f, 0.0f);
 -			glLineWidth(2.0);
 -			fdrawline((float)(offset), yminc,
 -			          (float)(v2d->cur.xmax), yminc);
 +			immUniformColor3f(1.0f, 0.0f, 0.0f);
 +
 +			glLineWidth(2.0f);
 +
 +			immBegin(GWN_PRIM_LINES, 2);
 +			immVertex2f(pos, (float)offset, yminc);
 +			immVertex2f(pos, (float)v2d->cur.xmax, yminc);
 +			immEnd();
 +
 +			immUnbindProgram();
  		}
  	}
  
@@@ -3950,14 -3928,11 +3950,14 @@@
  		short draw_sliders = 0;
  		float ymin_ofs = 0.0f;
  		float color[3];
 +		unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 +
 +		immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- 		
+ 
  		/* get and set backdrop color */
  		acf->get_backdrop_color(ac, ale, color);
 -		glColor3fv(color);
 +		immUniformColor3fv(color)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list