[Bf-blender-cvs] [1e7d29b0127] master: Cleanup: rename time related variables

Richard Antalik noreply at git.blender.org
Fri Nov 6 15:14:18 CET 2020


Commit: 1e7d29b0127f17df3ccd9aba72cf3b27ac9ba5b4
Author: Richard Antalik
Date:   Fri Nov 6 14:10:59 2020 +0100
Branches: master
https://developer.blender.org/rB1e7d29b0127f17df3ccd9aba72cf3b27ac9ba5b4

Cleanup: rename time related variables

Variables renaned:
 - cfra -> timeline_frame
 - nr -> frame index
 - cfra_over -> overlap_frame

Function seq_give_stripelem_index was renamed to seq_give_frame_index.

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

M	source/blender/editors/space_sequencer/sequencer_add.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_sequencer/sequencer_intern.h
M	source/blender/editors/space_sequencer/sequencer_select.c
M	source/blender/sequencer/SEQ_sequencer.h
M	source/blender/sequencer/intern/effects.c
M	source/blender/sequencer/intern/image_cache.c
M	source/blender/sequencer/intern/modifier.c
M	source/blender/sequencer/intern/proxy.c
M	source/blender/sequencer/intern/proxy.h
M	source/blender/sequencer/intern/render.c
M	source/blender/sequencer/intern/render.h
M	source/blender/sequencer/intern/sequencer.c
M	source/blender/sequencer/intern/sequencer.h

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

diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 7335882e947..37dfcdbc765 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -148,7 +148,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
   Sequence *seq;
   Scene *scene = CTX_data_scene(C);
   Editing *ed = BKE_sequencer_editing_get(scene, true);
-  int cfra = (int)CFRA;
+  int timeline_frame = (int)CFRA;
   int proximity = INT_MAX;
 
   if (!ed || !ed->seqbasep) {
@@ -156,10 +156,10 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
   }
 
   for (seq = ed->seqbasep->first; seq; seq = seq->next) {
-    if ((type == -1 || seq->type == type) && (seq->enddisp < cfra) &&
-        (cfra - seq->enddisp < proximity)) {
+    if ((type == -1 || seq->type == type) && (seq->enddisp < timeline_frame) &&
+        (timeline_frame - seq->enddisp < proximity)) {
       tgt = seq;
-      proximity = cfra - seq->enddisp;
+      proximity = timeline_frame - seq->enddisp;
     }
   }
 
@@ -173,17 +173,17 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
 {
   Scene *scene = CTX_data_scene(C);
 
-  int cfra = (int)CFRA;
+  int timeline_frame = (int)CFRA;
 
   /* Effect strips don't need a channel initialized from the mouse. */
   if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "channel") == 0) {
     RNA_int_set(op->ptr, "channel", sequencer_generic_invoke_xy_guess_channel(C, type));
   }
 
-  RNA_int_set(op->ptr, "frame_start", cfra);
+  RNA_int_set(op->ptr, "frame_start", timeline_frame);
 
   if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) {
-    RNA_int_set(op->ptr, "frame_end", cfra + 25); /* XXX arbitrary but ok for now. */
+    RNA_int_set(op->ptr, "frame_end", timeline_frame + 25); /* XXX arbitrary but ok for now. */
   }
 
   if (!(flag & SEQPROP_NOPATHS)) {
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7e23f4ed281..8ac562f0ae0 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -970,14 +970,14 @@ static void fcurve_batch_add_verts(GPUVertBuf *vbo,
                                    float y1,
                                    float y2,
                                    float y_height,
-                                   int cfra,
+                                   int timeline_frame,
                                    float curve_val,
                                    unsigned int *vert_count)
 {
   float vert_pos[2][2];
 
-  copy_v2_fl2(vert_pos[0], cfra, (curve_val * y_height) + y1);
-  copy_v2_fl2(vert_pos[1], cfra, y2);
+  copy_v2_fl2(vert_pos[0], timeline_frame, (curve_val * y_height) + y1);
+  copy_v2_fl2(vert_pos[1], timeline_frame, y2);
 
   GPU_vertbuf_vert_set(vbo, *vert_count, vert_pos[0]);
   GPU_vertbuf_vert_set(vbo, *vert_count + 1, vert_pos[1]);
@@ -1026,23 +1026,25 @@ static void draw_seq_fcurve(
     float prev_val = INT_MIN;
     bool skip = false;
 
-    for (int cfra = eval_start; cfra <= eval_end; cfra += eval_step) {
-      curve_val = evaluate_fcurve(fcu, cfra);
+    for (int timeline_frame = eval_start; timeline_frame <= eval_end;
+         timeline_frame += eval_step) {
+      curve_val = evaluate_fcurve(fcu, timeline_frame);
       CLAMP(curve_val, 0.0f, 1.0f);
 
       /* Avoid adding adjacent verts that have the same value. */
-      if (curve_val == prev_val && cfra < eval_end - eval_step) {
+      if (curve_val == prev_val && timeline_frame < eval_end - eval_step) {
         skip = true;
         continue;
       }
 
       /* If some frames were skipped above, we need to close the shape.  */
       if (skip) {
-        fcurve_batch_add_verts(vbo, y1, y2, y_height, cfra - eval_step, prev_val, &vert_count);
+        fcurve_batch_add_verts(
+            vbo, y1, y2, y_height, timeline_frame - eval_step, prev_val, &vert_count);
         skip = false;
       }
 
-      fcurve_batch_add_verts(vbo, y1, y2, y_height, cfra, curve_val, &vert_count);
+      fcurve_batch_add_verts(vbo, y1, y2, y_height, timeline_frame, curve_val, &vert_count);
       prev_val = curve_val;
     }
 
@@ -1241,7 +1243,7 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain,
                           struct Depsgraph *depsgraph,
                           Scene *scene,
                           SpaceSeq *sseq,
-                          int cfra,
+                          int timeline_frame,
                           int frame_ofs,
                           const char *viewname)
 {
@@ -1285,10 +1287,10 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain,
   }
 
   if (special_seq_update) {
-    ibuf = SEQ_render_give_ibuf_direct(&context, cfra + frame_ofs, special_seq_update);
+    ibuf = SEQ_render_give_ibuf_direct(&context, timeline_frame + frame_ofs, special_seq_update);
   }
   else {
-    ibuf = SEQ_render_give_ibuf(&context, cfra + frame_ofs, sseq->chanshown);
+    ibuf = SEQ_render_give_ibuf(&context, timeline_frame + frame_ofs, sseq->chanshown);
   }
 
   if (viewport) {
@@ -1766,7 +1768,7 @@ void sequencer_draw_preview(const bContext *C,
                             Scene *scene,
                             ARegion *region,
                             SpaceSeq *sseq,
-                            int cfra,
+                            int timeline_frame,
                             int offset,
                             bool draw_overlay,
                             bool draw_backdrop)
@@ -1788,7 +1790,7 @@ void sequencer_draw_preview(const bContext *C,
 
   /* Get image. */
   ibuf = sequencer_ibuf_get(
-      bmain, region, depsgraph, scene, sseq, cfra, offset, names[sseq->multiview_eye]);
+      bmain, region, depsgraph, scene, sseq, timeline_frame, offset, names[sseq->multiview_eye]);
 
   /* Setup off-screen buffers. */
   GPUViewport *viewport = WM_draw_region_get_viewport(region);
@@ -2318,9 +2320,9 @@ void draw_timeline_seq(const bContext *C, ARegion *region)
 
   /* Draw overlap frame frame indicator. */
   if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) {
-    int cfra_over = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ?
-                        scene->ed->over_cfra :
-                        scene->r.cfra + scene->ed->over_ofs;
+    int overlap_frame = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ?
+                            scene->ed->over_cfra :
+                            scene->r.cfra + scene->ed->over_ofs;
 
     uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
     immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -2334,8 +2336,8 @@ void draw_timeline_seq(const bContext *C, ARegion *region)
     immUniformThemeColor(TH_CFRAME);
 
     immBegin(GPU_PRIM_LINES, 2);
-    immVertex2f(pos, cfra_over, v2d->cur.ymin);
-    immVertex2f(pos, cfra_over, v2d->cur.ymax);
+    immVertex2f(pos, overlap_frame, v2d->cur.ymin);
+    immVertex2f(pos, overlap_frame, v2d->cur.ymax);
     immEnd();
 
     immUnbindProgram();
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 8f3a3ba50a0..eb4a1601187 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -985,21 +985,21 @@ static bool split_seq_list(
   return (seq_first_new != NULL);
 }
 
-static bool sequence_offset_after_frame(Scene *scene, const int delta, const int cfra)
+static bool sequence_offset_after_frame(Scene *scene, const int delta, const int timeline_frame)
 {
   Sequence *seq;
   Editing *ed = BKE_sequencer_editing_get(scene, false);
   bool done = false;
   TimeMarker *marker;
 
-  /* All strips >= cfra are shifted. */
+  /* All strips >= timeline_frame are shifted. */
 
   if (ed == NULL) {
     return 0;
   }
 
   for (seq = ed->seqbasep->first; seq; seq = seq->next) {
-    if (seq->startdisp >= cfra) {
+    if (seq->startdisp >= timeline_frame) {
       BKE_sequence_translate(scene, seq, delta);
       BKE_sequence_calc(scene, seq);
       BKE_sequence_invalidate_cache_preprocessed(scene, seq);
@@ -1009,7 +1009,7 @@ static bool sequence_offset_after_frame(Scene *scene, const int delta, const int
 
   if (!scene->toolsettings->lock_markers) {
     for (marker = scene->markers.first; marker; marker = marker->next) {
-      if (marker->frame >= cfra) {
+      if (marker->frame >= timeline_frame) {
         marker->frame += delta;
       }
     }
@@ -1095,7 +1095,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
 {
   Scene *scene = CTX_data_scene(C);
   rctf rectf;
-  int cfra, efra, sfra;
+  int timeline_frame, efra, sfra;
   bool first = false, done;
   bool do_all = RNA_boolean_get(op->ptr, "all");
 
@@ -1105,24 +1105,24 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
   efra = (int)rectf.xmax;
 
   /* Check if the current frame has a gap already. */
-  for (cfra = CFRA; cfra >= sfra; cfra--) {
-    if (SEQ_render_evaluate_frame(scene, cfra)) {
+  for (timeline_frame = CFRA; timeline_frame >= sfra; timeline_frame--) {
+    if (SEQ_render_evaluate_frame(scene, timeline_frame)) {
       first = true;
       break;
     }
   }
 
-  for (; cfra < efra; cfra++) {
+  for (; timeline_frame < efra; timeline_frame++) {
     /* There's still no strip to remove a gap for. */
     if (first == false) {
-      if (SEQ_render_evaluate_frame(scene, cfra)) {
+      if (SEQ_render_evaluate_frame(scene, timeline_frame)) {
         first = true;
       }
     }
-    else if (SEQ_render_evaluate_frame(scene, cfra) == 0) {
+    else if (SEQ_render_evaluate_frame(scene, timeline_frame) == 0) {
       done = true;
-      while (SEQ_render_evaluate_frame(scene, cfra) == 0) {
-        done = sequence_offset_after_frame(scene, -1, cfra);
+      while (SEQ_render_evaluate_frame(scene, timeline_frame) == 0) {
+        done = sequence_offset_after_frame(scene, -1, timeline_frame);
         if (d

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list