[Bf-blender-cvs] [0d0036cb53f] master: Cleanup: Fix comment style and check if they are valid or make sense.

Richard Antalik noreply at git.blender.org
Sun Apr 5 23:58:26 CEST 2020


Commit: 0d0036cb53f83597aa8a52edd0e19fd915f4ed65
Author: Richard Antalik
Date:   Sun Apr 5 23:55:51 2020 +0200
Branches: master
https://developer.blender.org/rB0d0036cb53f83597aa8a52edd0e19fd915f4ed65

Cleanup: Fix comment style and check if they are valid or make sense.

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

M	source/blender/editors/space_sequencer/sequencer_add.c
M	source/blender/editors/space_sequencer/sequencer_buttons.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_modifier.c
M	source/blender/editors/space_sequencer/sequencer_ops.c
M	source/blender/editors/space_sequencer/sequencer_preview.c
M	source/blender/editors/space_sequencer/sequencer_scopes.c
M	source/blender/editors/space_sequencer/sequencer_select.c
M	source/blender/editors/space_sequencer/sequencer_view.c
M	source/blender/editors/space_sequencer/space_sequencer.c

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

diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 278fb9fb683..049f3d76b53 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -51,8 +51,7 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
-/* for menu/popup icons etc etc*/
-
+/* For menu, popup, icons, etc. */
 #include "ED_screen.h"
 #include "ED_sequencer.h"
 
@@ -67,16 +66,16 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
 
-/* own include */
+/* Own include. */
 #include "sequencer_intern.h"
 
 typedef struct SequencerAddData {
   ImageFormatData im_format;
 } SequencerAddData;
 
-/* Generic functions, reused by add strip operators */
+/* Generic functions, reused by add strip operators. */
 
-/* avoid passing multiple args and be more verbose */
+/* Avoid passing multiple args and be more verbose. */
 #define SEQPROP_STARTFRAME (1 << 0)
 #define SEQPROP_ENDFRAME (1 << 1)
 #define SEQPROP_NOPATHS (1 << 2)
@@ -101,7 +100,7 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
   }
 
   if (flag & SEQPROP_ENDFRAME) {
-    /* not usual since most strips have a fixed length */
+    /* Not usual since most strips have a fixed length. */
     RNA_def_int(ot->srna,
                 "frame_end",
                 0,
@@ -119,7 +118,7 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
   RNA_def_boolean(
       ot->srna, "replace_sel", 1, "Replace Selection", "Replace the current selection");
 
-  /* only for python scripts which import strips and place them after */
+  /* Only for python scripts which import strips and place them after. */
   prop = RNA_def_boolean(
       ot->srna, "overlap", 0, "Allow Overlap", "Don't correct overlap on new sequence strips");
   RNA_def_property_flag(prop, PROP_HIDDEN);
@@ -175,7 +174,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
 
   int cfra = (int)CFRA;
 
-  /* effect strips don't need a channel initialized from the mouse */
+  /* 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));
   }
@@ -203,18 +202,17 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
   memset(seq_load, 0, sizeof(SeqLoadInfo));
 
   seq_load->start_frame = RNA_int_get(op->ptr, "frame_start");
-  seq_load->end_frame = seq_load->start_frame; /* un-set */
-
+  seq_load->end_frame = seq_load->start_frame;
   seq_load->channel = RNA_int_get(op->ptr, "channel");
-  seq_load->len = 1;  // images only, if endframe isn't set!
+  seq_load->len = 1;
 
   if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) {
-    /* full path, file is set by the caller */
+    /* Full path, file is set by the caller. */
     RNA_property_string_get(op->ptr, prop, seq_load->path);
     is_file = 1;
   }
   else if ((prop = RNA_struct_find_property(op->ptr, "directory"))) {
-    /* full path, file is set by the caller */
+    /* Full path, file is set by the caller. */
     RNA_property_string_get(op->ptr, prop, seq_load->path);
     is_file = 0;
   }
@@ -252,15 +250,13 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
     seq_load->flag |= SEQ_LOAD_SYNC_FPS;
   }
 
-  /* always use this for ops */
+  /* Create consecutive array of strips. */
   seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE;
 
   if (is_file == 1) {
     BLI_strncpy(seq_load->name, BLI_path_basename(seq_load->path), sizeof(seq_load->name));
   }
   else if ((prop = RNA_struct_find_property(op->ptr, "files"))) {
-    /* used for image strip */
-    /* best guess, first images name */
     RNA_PROP_BEGIN (op->ptr, itemptr, prop) {
       char *name = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
       BLI_strncpy(seq_load->name, name, sizeof(seq_load->name));
@@ -278,9 +274,6 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
 
       seq_load->views_format = imf->views_format;
       seq_load->flag |= SEQ_USE_VIEWS;
-
-      /* operator custom data is always released after the SeqLoadInfo,
-       * no need to handle the memory here */
       seq_load->stereo3d_format = &imf->stereo3d_format;
     }
   }
@@ -332,22 +325,17 @@ static bool seq_effect_add_properties_poll(const bContext *UNUSED(C),
   return true;
 }
 
-/* add scene operator */
 static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
   Editing *ed = BKE_sequencer_editing_get(scene, true);
-
   Scene *sce_seq;
+  Sequence *seq;
 
-  Sequence *seq; /* generic strip vars */
-
-  int start_frame, channel; /* operator props */
-
+  int start_frame, channel;
   start_frame = RNA_int_get(op->ptr, "frame_start");
   channel = RNA_int_get(op->ptr, "channel");
-
   sce_seq = BLI_findlink(&bmain->scenes, RNA_enum_get(op->ptr, "scene"));
 
   if (sce_seq == NULL) {
@@ -356,11 +344,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
   }
 
   seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel, SEQ_TYPE_SCENE);
-  seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
-
+  seq->blend_mode = SEQ_TYPE_CROSS;
   seq->scene = sce_seq;
-
-  /* basic defaults */
   seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
 
   BLI_strncpy(seq->name + 2, sce_seq->id.name + 2, sizeof(seq->name) - 2);
@@ -388,26 +373,23 @@ static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const w
 
   sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_SCENE);
   return sequencer_add_scene_strip_exec(C, op);
-  // needs a menu
-  // return WM_menu_invoke(C, op, event);
 }
 
 void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
 {
   PropertyRNA *prop;
 
-  /* identifiers */
+  /* Identifiers. */
   ot->name = "Add Scene Strip";
   ot->idname = "SEQUENCER_OT_scene_strip_add";
   ot->description = "Add a strip to the sequencer using a blender scene as a source";
 
-  /* api callbacks */
+  /* Api callbacks. */
   ot->invoke = sequencer_add_scene_strip_invoke;
   ot->exec = sequencer_add_scene_strip_exec;
-
   ot->poll = ED_operator_sequencer_active_editable;
 
-  /* flags */
+  /* Flags. */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
   sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
@@ -417,22 +399,17 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
   ot->prop = prop;
 }
 
-/* add movieclip operator */
 static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
   Editing *ed = BKE_sequencer_editing_get(scene, true);
-
   MovieClip *clip;
+  Sequence *seq;
 
-  Sequence *seq; /* generic strip vars */
-
-  int start_frame, channel; /* operator props */
-
+  int start_frame, channel;
   start_frame = RNA_int_get(op->ptr, "frame_start");
   channel = RNA_int_get(op->ptr, "channel");
-
   clip = BLI_findlink(&bmain->movieclips, RNA_enum_get(op->ptr, "clip"));
 
   if (clip == NULL) {
@@ -443,12 +420,10 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
   seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel, SEQ_TYPE_MOVIECLIP);
   seq->blend_mode = SEQ_TYPE_CROSS;
   seq->clip = clip;
+  seq->len = BKE_movieclip_get_duration(clip);
 
   id_us_ensure_real(&seq->clip->id);
 
-  /* basic defaults */
-  seq->len = BKE_movieclip_get_duration(clip);
-
   BLI_strncpy(seq->name + 2, clip->id.name + 2, sizeof(seq->name) - 2);
   BKE_sequence_base_unique_name_recursive(&ed->seqbase, seq);
 
@@ -473,26 +448,23 @@ static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, con
 
   sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MOVIECLIP);
   return sequencer_add_movieclip_strip_exec(C, op);
-  // needs a menu
-  // return WM_menu_invoke(C, op, event);
 }
 
 void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot)
 {
   PropertyRNA *prop;
 
-  /* identifiers */
+  /* Identifiers. */
   ot->name = "Add MovieClip Strip";
   ot->idname = "SEQUENCER_OT_movieclip_strip_add";
   ot->description = "Add a movieclip strip to the sequencer";
 
-  /* api callbacks */
+  /* Api callbacks. */
   ot->invoke = sequencer_add_movieclip_strip_invoke;
   ot->exec = sequencer_add_movieclip_strip_exec;
-
   ot->poll = ED_operator_sequencer_active_editable;
 
-  /* flags */
+  /* Flags. */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
   sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
@@ -508,16 +480,12 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
   Editing *ed = BKE_sequencer_editing_get(scene, true);
-
   Mask *mask;
+  Sequence *seq;
 
-  Sequence *seq; /* generic strip vars */
-
-  int start_frame, channel; /* operator props */
-
+  int start_frame, channel;
   start_frame = RNA_int_get(op->ptr, "frame_start");
   channel = RNA_int_get(op->ptr, "channel");
-
   mask = BLI_findlink(&bmain->masks, RNA_enum_get(op->ptr, "mask"));
 
   if (mask == NULL) {
@@ -528,12 +496,10 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
   seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel, SEQ_TYPE_MASK);
   seq->blend_mode = SEQ_TYPE_CROSS;
   seq->mask = mask;
+  seq->len = BKE_mask_get_duration(mask);
 
   id_us_ensure_real(&seq->mask->id);
 
-  /* basic defaults */
-  seq->len = BKE_mask_get_duration(mask);
-
   BLI_strncpy(seq->name + 2, mask->id.name + 2, sizeof(seq->name) - 2);
   BKE_sequence_base_unique_name_recursive(&ed->seqbase, seq);
 
@@ -558,26 +524,23 @@ static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wm
 
   sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MASK);
   return sequencer_add_mask_strip_exec(C, op);
-  // needs a menu
-  // return WM_menu_invoke(C, op, event);
 }
 
 void SEQUENCER_OT_mask_strip_add(struct wmOperatorType *ot)
 {
   Propert

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list