[Bf-blender-cvs] [baca8611e5f] active-fcurve-keyframe: Merge branch 'master' into active-fcurve-keyframe

Hans Goudey noreply at git.blender.org
Tue Sep 1 19:49:49 CEST 2020


Commit: baca8611e5fe4b3dcd6f5065fb125bc0a9d65934
Author: Hans Goudey
Date:   Tue Sep 1 12:35:14 2020 -0500
Branches: active-fcurve-keyframe
https://developer.blender.org/rBbaca8611e5fe4b3dcd6f5065fb125bc0a9d65934

Merge branch 'master' into active-fcurve-keyframe

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



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

diff --cc source/blender/blenloader/intern/versioning_userdef.c
index d1bd518baca,d04907872b7..bfbf985b08f
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@@ -227,7 -228,11 +228,13 @@@ static void do_versions_theme(const Use
     */
    {
      /* Keep this block, even when empty. */
+ 
+     /* The new defaults for the file browser theme are the same as
+      * the outliner's, and it's less disruptive to just copy them. */
+     copy_v4_v4_uchar(btheme->space_file.back, btheme->space_outliner.back);
+     copy_v4_v4_uchar(btheme->space_file.row_alternate, btheme->space_outliner.row_alternate);
++
 +    FROM_DEFAULT_V4_UCHAR(space_graph.vertex_active);
    }
  
  #undef FROM_DEFAULT_V4_UCHAR
diff --cc source/blender/editors/space_graph/graph_draw.c
index c358ba278e5,ac860b72e84..2a3985fdaa4
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@@ -911,164 -868,6 +911,164 @@@ static void draw_fcurve_curve_bezts(bAn
    GPU_matrix_pop();
  }
  
 +static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAnimListElem *ale)
 +{
 +  FCurve *fcu = (FCurve *)ale->key_data;
 +  FModifier *fcm = find_active_fmodifier(&fcu->modifiers);
 +  AnimData *adt = ANIM_nla_mapping_get(ac, ale);
 +
 +  /* map keyframes for drawing if scaled F-Curve */
 +  if (adt) {
 +    ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0);
 +  }
 +
 +  /* draw curve:
 +   * - curve line may be result of one or more destructive modifiers or just the raw data,
 +   *   so we need to check which method should be used
 +   * - controls from active modifier take precedence over keyframes
 +   *   (XXX! editing tools need to take this into account!)
 +   */
 +
 +  /* 1) draw curve line */
 +  if (((fcu->modifiers.first) || (fcu->flag & FCURVE_INT_VALUES)) ||
 +      (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert))) {
 +    /* set color/drawing style for curve itself */
 +    /* draw active F-Curve thicker than the rest to make it stand out */
 +    if (fcu->flag & FCURVE_ACTIVE) {
 +      GPU_line_width(2.5);
 +    }
 +    else {
 +      GPU_line_width(1.0);
 +    }
 +
 +    /* anti-aliased lines for less jagged appearance */
 +    if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
 +      GPU_line_smooth(true);
 +    }
-     GPU_blend(true);
++    GPU_blend(GPU_BLEND_ALPHA);
 +
 +    const uint shdr_pos = GPU_vertformat_attr_add(
 +        immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 +
 +    immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
 +
 +    float viewport_size[4];
 +    GPU_viewport_size_get_f(viewport_size);
 +    immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC);
 +
 +    immUniform1i("colors_len", 0); /* Simple dashes. */
 +
 +    if (BKE_fcurve_is_protected(fcu)) {
 +      /* protected curves (non editable) are drawn with dotted lines */
 +      immUniform1f("dash_width", 4.0f);
 +      immUniform1f("dash_factor", 0.5f);
 +    }
 +    else {
 +      immUniform1f("dash_factor", 2.0f); /* solid line */
 +    }
 +
 +    if (((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) || (fcu->flag & FCURVE_MUTED)) {
 +      /* muted curves are drawn in a grayish hue */
 +      /* XXX should we have some variations? */
 +      immUniformThemeColorShade(TH_HEADER, 50);
 +    }
 +    else {
 +      /* set whatever color the curve has set
 +       * - unselected curves draw less opaque to help distinguish the selected ones
 +       */
 +      immUniformColor3fvAlpha(fcu->color, fcurve_display_alpha(fcu));
 +    }
 +
 +    /* draw F-Curve */
 +    if ((fcu->modifiers.first) || (fcu->flag & FCURVE_INT_VALUES)) {
 +      /* draw a curve affected by modifiers or only allowed to have integer values
 +       * by sampling it at various small-intervals over the visible region
 +       */
 +      draw_fcurve_curve(ac, ale->id, fcu, &region->v2d, shdr_pos);
 +    }
 +    else if (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert)) {
 +      /* just draw curve based on defined data (i.e. no modifiers) */
 +      if (fcu->bezt) {
 +        if (fcurve_can_use_simple_bezt_drawing(fcu)) {
 +          draw_fcurve_curve_bezts(ac, ale->id, fcu, &region->v2d, shdr_pos);
 +        }
 +        else {
 +          draw_fcurve_curve(ac, ale->id, fcu, &region->v2d, shdr_pos);
 +        }
 +      }
 +      else if (fcu->fpt) {
 +        draw_fcurve_curve_samples(ac, ale->id, fcu, &region->v2d, shdr_pos);
 +      }
 +    }
 +
 +    immUnbindProgram();
 +
 +    if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
 +      GPU_line_smooth(false);
 +    }
-     GPU_blend(false);
++    GPU_blend(GPU_BLEND_NONE);
 +  }
 +
 +  /* 2) draw handles and vertices as appropriate based on active
 +   * - If the option to only show controls if the F-Curve is selected is enabled,
 +   *   we must obey this.
 +   */
 +  if (!(sipo->flag & SIPO_SELCUVERTSONLY) || (fcu->flag & FCURVE_SELECTED)) {
 +    if (!BKE_fcurve_are_keyframes_usable(fcu) && !(fcu->fpt && fcu->totvert)) {
 +      /* only draw controls if this is the active modifier */
 +      if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) {
 +        switch (fcm->type) {
 +          case FMODIFIER_TYPE_ENVELOPE: /* envelope */
 +            draw_fcurve_modifier_controls_envelope(fcm, &region->v2d);
 +            break;
 +        }
 +      }
 +    }
 +    else if (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert)) {
 +      short mapping_flag = ANIM_get_normalization_flags(ac);
 +      float offset;
 +      float unit_scale = ANIM_unit_mapping_get_factor(
 +          ac->scene, ale->id, fcu, mapping_flag, &offset);
 +
 +      /* apply unit-scaling to all values via OpenGL */
 +      GPU_matrix_push();
 +      GPU_matrix_scale_2f(1.0f, unit_scale);
 +      GPU_matrix_translate_2f(0.0f, offset);
 +
 +      /* Set this once and for all -
 +       * all handles and handle-verts should use the same thickness. */
 +      GPU_line_width(1.0);
 +
 +      if (fcu->bezt) {
 +        bool do_handles = draw_fcurve_handles_check(sipo, fcu);
 +
 +        if (do_handles) {
 +          /* only draw handles/vertices on keyframes */
 +          draw_fcurve_handles(sipo, fcu);
 +        }
 +
 +        draw_fcurve_vertices(region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY));
 +      }
 +      else {
 +        /* samples: only draw two indicators at either end as indicators */
 +        draw_fcurve_samples(sipo, region, fcu);
 +      }
 +
 +      GPU_matrix_pop();
 +    }
 +  }
 +
 +  /* 3) draw driver debugging stuff */
 +  if ((ac->datatype == ANIMCONT_DRIVERS) && (fcu->flag & FCURVE_ACTIVE)) {
 +    graph_draw_driver_debug(ac, ale->id, fcu);
 +  }
 +
 +  /* undo mapping of keyframes for drawing if scaled F-Curve */
 +  if (adt) {
 +    ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0);
 +  }
 +}
 +
  /* Debugging -------------------------------- */
  
  /* Draw indicators which show the value calculated from the driver,
diff --cc source/blender/makesdna/DNA_userdef_types.h
index e66a3233dd0,ec46d2680ca..0acc2054472
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@@ -358,7 -357,7 +358,7 @@@ typedef struct ThemeSpace 
    unsigned char path_before[4], path_after[4];
    unsigned char path_keyframe_before[4], path_keyframe_after[4];
    unsigned char camera_path[4];
--  unsigned char _pad1[2];
++  unsigned char _pad1[6];
  
    unsigned char gp_vertex_size;
    unsigned char gp_vertex[4], gp_vertex_select[4];



More information about the Bf-blender-cvs mailing list